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
When updating the color parameter of a plotly_express scatter plot from a dcc.Dropdown within a Dash call back and returning the output of the scatter plot into the 'figure' property of a dcc.Graph, the range of the color scale (continuous) can increase if the range of the data passed to color increases but does not decrease automatically if the range of the data decreases.
Refresh the app to get the default parameter of the "Variable couleur" dropdown. The range of the color scale is -22 to 30.
Change the "Variable couleur" dropdown to "fraction battery utilisée". This variable has a range of 0 to 1 but the color scale still shows -22 to 30 hence all the points have approximately the same color.
Change the "Variable couleur" dropdown to "distance (km)". The colorscale changes to ~< 0 to ~420.
Change the "Variable couleur" dropdown to "consommation (kWh/100km)". This variable has a range of 12 to 32 approx. Just as previously, the color scale keeps the larger range and the points show with a mostly uniform color.
Clear the "Variable couleur" dropdown. The color scale disappears (expected).
Set the "Variable couleur" dropdown back to "consommation (kWh/100km)". This time, the color scale matches the range of the data.
Playing a bit with the different variables and ranges, my conclusion is that the color scale min or max values will adjust only when the new min or max is outside the range or the previously rendered color scale. If a new variable with a range contained within the current range is passed, the color scale will not change at all.
Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson
When updating the
color
parameter of a plotly_express scatter plot from adcc.Dropdown
within a Dash call back and returning the output of the scatter plot into the'figure'
property of adcc.Graph
, the range of the color scale (continuous) can increase if the range of the data passed tocolor
increases but does not decrease automatically if the range of the data decreases.The callback function is the following:
The issue can be observed in this demo app: https://flask.urandom.xyz/boltev/
Playing a bit with the different variables and ranges, my conclusion is that the color scale min or max values will adjust only when the new min or max is outside the range or the previously rendered color scale. If a new variable with a range contained within the current range is passed, the color scale will not change at all.
The full code of the demo app is available at https://github.com/DamdlBT/BoltEV-Dash.
@emmanuelle, this is one of the two issues we discussed at the PyData meetup.
The text was updated successfully, but these errors were encountered: