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

Generated html file with dark plot should also have dark background #151

Open
qarmin opened this issue Jul 10, 2023 · 2 comments
Open

Generated html file with dark plot should also have dark background #151

qarmin opened this issue Jul 10, 2023 · 2 comments

Comments

@qarmin
Copy link

qarmin commented Jul 10, 2023

Currently using

layout.template(&*PLOTLY_DARK);

will change color of plot, but not rest of the page.
As workaround i manually background color

    let mut html = plot.to_html();
    if !settings.white_plot_mode {
        html = html.replace("<head>", "<head><style>body {background-color: #111111;color: white;}</style>");
    }
@mfreeborn
Copy link
Contributor

I'll have to check what the exact behaviour is with the Python/JavaScript implementations, as I tend to base all decisions like this one on what the canonical libraries do.

@andrei-ng
Copy link
Collaborator

Hi @qarmin , I think the behaviour you describe is normal and is similar to how it behaves in Python and Java. For example the Python Express page has these examples https://plotly.com/python/templates/

I think having the entire HTML page background dark is not necessarily something in the scope of our API. However, I think that changing this would only make sense when working with the standalone plot version as generated by plotly/templates/plot.html.

I will look into dynamically changing that html.

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

3 participants