You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Plotly's themes page displays graph templates incorrectly when in dark mode #226
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...
Activity
Alexboiboi commentedon Mar 10, 2023
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 commentedon Mar 10, 2023
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.jsIt'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.