Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unique Plotly IDs #1308

Open
Nilsonfsilva opened this issue May 15, 2024 · 0 comments
Open

Unique Plotly IDs #1308

Nilsonfsilva opened this issue May 15, 2024 · 0 comments

Comments

@Nilsonfsilva
Copy link

I'm a new maintainer of the sphinx gallery on Debian.
Performing integration tests, sphinx-gallery fails the reproducibility test.

The patch below was the solution I found to resolve the error in the
doc/galleries.rst file:

... _unique_plotly_ids:

Unique Plotly IDs

This fix is ​​to ensure that each Plotly chart has a unique and reproducible ID.

.. code-block:: python

import plotly.graph_objects as go
import uuid

def generate_plot():
plotdivid = div_id or str(uuid.uuid4())
fig = go.Figure(data=go.Scatter(x=[1, 2, 3], y=[4, 1, 2]))
fig.show(config={'displayModeBar': False}, renderer="svg", id=plotdivid)

   Nilson Silva!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant