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

Plotly's themes page displays graph templates incorrectly when in dark mode #226

Open
Coding-with-Adam opened this issue Mar 8, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@Coding-with-Adam
Copy link

This bug was reported by Community Member, Bryan.

If you go to the Theming and Templates page in the docs and switch the docs to dark theme, all the graph examples will show in dark mode.

image

@AaronStiff AaronStiff added the documentation Improvements or additions to documentation label Mar 9, 2023
@Alexboiboi
Copy link

Hi @Coding-with-Adam , just as a side note. Do you have any any Idea how plotly is achieving this feature in the first place?
Since recently, numerous python library documentations introduced dark mode (e.g. PydataTheme), but unlike in the plotly docs, changing the theme does not affect the graphs. Not sure if it is worth posting an issue here though...

@nicolaskruchten
Copy link
Contributor

The dark-mode toggle fires off some simple javascript which crawls the page looking for divs that look like they were produced with Plotly.js and then calls Plotly.react() on those divs to change some basic template parameters: https://github.com/plotly/graphing-library-docs/blob/master/all_static/javascripts/improve.js

It's pretty awkward that this runs on that particular page, and I can imagine we'd want to add a URL-based exclusion to that script or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

4 participants