rich-iannone / DiagrammeR

Graph and network visualization using tabular data in R
https://rich-iannone.github.io/DiagrammeR/
Other
1.68k stars 247 forks source link

DiagrammeR Graph not displayed when rendering in Quarto #519

Open meersel opened 5 months ago

meersel commented 5 months ago

When I run a R code chunk within a Quarto file (.qmd) the diagram graph is displayed.

When I render the Quarto file the graph is not displayed but the following error message is displayed.

TypeError: Assignment to constant variable.

See code of R chunk below:


a_graph <-
  create_graph() %>%
  add_node() %>%
  add_node() %>%
  add_edge(from = 1, to = 2)

render_graph(a_graph)

RStudio IDE (Windows) information: RStudio 2023.12.1+402 "Ocean Storm" Release (4da58325ffcff29d157d9264087d4b1ab27f7204, 2024-01-28) for windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) RStudio/2023.12.1+402 Chrome/116.0.5845.190 Electron/26.2.4 Safari/537.36

Quarto version info: 1.4.59

R version info: R-4.3.1

DiagrammeR package version: 1.0.11

olivroy commented 5 months ago

Hi,

Was this an issue with Quarto 1.3, and DiagrammeR 1.0.10?

meersel commented 5 months ago

I am using Quarto 1.4.59 (the latest release). and DiagrammeR 1.0.11

jacciz commented 4 months ago

I had that issue. That happens when the document is rendered is shown in the viewer/browser (i.e. http://localhost:7340/web/viewer.html). Try opening the rendered document from the actual folder and it should work!