plotly / dash

Data Apps & Dashboards for Python. No JavaScript Required.
https://plotly.com/dash
MIT License
21.32k stars 2.06k forks source link

[BUG] color_continuous_scale for px.choropleth not being recognized when served by Dash #1217

Closed chwahnHTW closed 3 months ago

chwahnHTW commented 4 years ago

Hey, I am running a dash app in a Docker container , the following are related installed dash libraries :

dash-1.11.0 dash-core-components-1.9.1 dash-daq-0.5.0 dash-html-components-1.0.3 dash-renderer-1.4.0 dash-table-4.6.2

- OS: Microsoft Windows 10 Home Edition
- Browser : Google Chrome
- Version : 81.0.4044.129

I have used Plotly Express to plot a choropleth map of corona cases. When I execute my code in GoogleColab ( Google's version of JupyteNotebook ) I get the map displayed with the proper color scheme set with "color_continuous_scale = px.colors.sequential.Peach" :

fig = px.choropleth(frameForHeatmap, locations="Country", locationmode = "country names", color="Cases", color_continuous_scale = px.colors.sequential.Peach, hover_name="Country")

fig.update_layout( title_text = 'Spread of Coronavirus - Confirmed Cases', title_x = 0.5, geo=dict(showframe = True))

Right

Trying out different schemes ( Peach, Viriglis, custom list ) properly works in GoogleColab :

color_continuous_scale = px.colors.sequential.Viridis :

Right2

When trying to execute the exact same code on the dash server in the Docker container, a map is displayed, but color_continuous_scale = px.colors.sequential.Peach does not have any effect on the color scheme:

Wrong

When changing to color_continuous_scale = px.colors.sequential.Viridis on the Dash server, the color scheme isn't affected.

Wrong

In Dash, I'm creating the graph like this :

html.Div(dcc.Graph(id ="heatmap" , figure=createHeatmap())) wherecreateHeatmap() returns the figure created with the code mentioned earlier.

I've been stuck witht his for hours, trying different approaches and failig with all of them. I'm very new to Dash, any help is highly appreciated.

gvwilson commented 3 months ago

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are most important to our community. If this issue is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. (Please note that we will give priority to reports that include a short reproducible example.) If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson