Skip to content

grViz in quarto dashboard #12513

@antoine4ucsd

Description

@antoine4ucsd

Bug description

I cannot render a grViz in my quarto dashboard while the code works well outside the dashboard

Steps to reproduce

---
title: "my board"
format: 
  dashboard:
    embed-resources: true
    scrolling: false
    nav-buttons:
      - icon: globe
fig-width: 10
fig-asp: 0.3
theme: [sandstone, theme/custom2.css]

---

```{r}
library(htmltools)
library(DiagrammeRsvg)
library(DiagrammeR)
library(rsvg)
mygraph<- grViz("
digraph transmission {
  graph [layout = dot, rankdir = TB]

  node [shape = box, style = \"rounded,filled\", fillcolor = lightgray, color = gray20, fontname = Helvetica, fontsize = 12]

  D [label = 'Fruit Bat']
  B [label = 'Human', fillcolor = red]  # Red fill for B
  C [label = 'Human']

  D -> B
  B -> C
  C -> B
}
")

```
### Column {.tabset width="30%"}

```{r}
#| title: chain
mygraph
```

Actual behavior

I get this error message in the box
TypeError: Assignment to constant variable.

Image

Expected behavior

No response

Your environment

No response

Quarto check output

quarto check
Quarto 1.6.42
[✓] Checking environment information...
Quarto cache location: /Users/antoinechaillon/Library/Caches/quarto
[✓] Checking versions of quarto binary dependencies...
Pandoc version 3.4.0: OK
Dart Sass version 1.70.0: OK
Deno version 1.46.3: OK
Typst version 0.11.0: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
Version: 1.6.42
Path: /Applications/quarto/bin

[✓] Checking tools....................OK
TinyTeX: v2025.01
Chromium: (not installed)

[✓] Checking LaTeX....................OK
Using: TinyTex
Path: /Users/Library/TinyTeX/bin/universal-darwin
Version: 2024

[✓] Checking basic markdown render....OK

[✓] Checking Python 3 installation....OK
Version: 3.9.12
Path: /Users/.virtualenvs/r-reticulate/bin/python3
Jupyter: (None)

  Jupyter is not available in this Python installation.
  Install with python3 -m pip install jupyter

[✓] Checking R installation...........OK
Version: 4.4.1
Path: /Library/Frameworks/R.framework/Resources
LibPaths:
- /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library
knitr: 1.49
rmarkdown: 2.28

[✓] Checking Knitr engine render......OK

Metadata

Metadata

Assignees

No one assigned

    Labels

    supporta request for supportupstreamBug is in upstream library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions