Skip to content

Quarto Dashboard python plotly unexpected behavior #8910

@javendaXgh

Description

@javendaXgh

Bug description

I am creating a dashboard with Quarto using RStudio. When using the "multiple pages" format and creating a plotly chart using python the following happens:

  1. In the plotly graph when clicking on any button of the "displayModeBar" all the elements of the dashboard page disappear and to make them reappear, in the "navigation bar" it is necessary to select any page to show the content again.
  2. If I try to disable the "displayModeBar" in the py-plotly chart, it does not do it.

This behavior does not occur if I generate the same chart using an R chunk with plotly in the same dashboard. It also does not occur if I generate a "Quarto Document" or if I stop using the "multiple pages".

Important, it only happens when placing the level 1 (#).

Sorry if I am omitting information or if there is a previous answer that addresses this issue. This is my first time submitting an issue and I tried to read the related issues beforehand.

Steps to reproduce

---
title: "Quarto Dashboard Test"
format: dashboard
---

```{r}
library(reticulate)
```
# Page 1

```{python}
#| title: pl in py
import plotly.graph_objects as go

fig = go.Figure()

fig=fig.add_trace(
    go.Scatter(
        x=[1, 2, 3],
        y=[1, 3, 1]))

fig.show(config={'displayModeBar': False})

```

```{r}
#| title: pl in R
library(plotly)
df= data.frame( x=c(1, 2, 3),
                y=c(1, 3, 1))
plot_ly(data= df, x=~x)%>%
  add_trace( y= ~y, mode = 'lines+markers')

```

Expected behavior

That when clicking on some element of the "displayModeBar" it behaves according to the applied functionality.

Actual behavior

Part of the dashboard content disappears and it is necessary to select a page in the navigation bar to show all the content again.

Before click on displayModeBar

Screenshot 2024-02-27 at 20 57 18

After click on displayModeBar

Screenshot 2024-02-27 at 20 57 29

Your environment

  • IDE: RStudio Version 2023.12.1+402 (2023.12.1+402)
  • OS: MacOS Sonama 14.3.1

Quarto check output

Quarto 1.4.550
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.4.550
      Path: /Applications/quarto/bin

[✓] Checking tools....................OK
      TinyTeX: (external install)
      Chromium: (not installed)

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

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

[✓] Checking Python 3 installation....OK
      Version: 3.12.2
      Path: /opt/homebrew/opt/[email protected]/bin/python3.12
      Jupyter: (None)

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

[✓] Checking R installation...........OK
      Version: 4.3.2
      Path: /Library/Frameworks/R.framework/Resources
      LibPaths:
        - /Users/josemiguelavendanoinfante/Library/R/arm64/4.3/library
        - /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
      knitr: 1.45
      rmarkdown: 2.25

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingknitrplotlythird-partyIssues involving interaction with a third-party library

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions