quarto-dev / quarto-dev/quarto-cli

Quarto Dashboard python plotly unexpected behavior

Open
#8,910 6 comments 0 reactions 1 assignee View on GitHub

@cderv is already working on this.

Since Feb 28, 2024.

bug engines-knitr plotly third-party
Dominant language
JavaScript
Stars
6k
Forks
458
Avg merge
1d 9h
Merged PRs (30d)
41

Description

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/python@3.12/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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.