Skip to content

Colorbar scale on Mapbox doesn't update after callback #5397

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

Closed
Raimondo-M opened this issue Jan 12, 2021 · 1 comment
Closed

Colorbar scale on Mapbox doesn't update after callback #5397

Raimondo-M opened this issue Jan 12, 2021 · 1 comment

Comments

@Raimondo-M
Copy link

Hi everyone,
I am having the following issue using px.scatter_mapbox to show some values from a dataframe.
The issue appears when I change with a callback the value to plot.
"Value A" has a lower scale than "Value B".
When I move from A to B with the callback, everything is fine.
When I come back to "value A" from "value B", the colorbar keeps the biggest scale of "value B".
This is happening with also other scales, it always keeps the biggest scale it has seen.

bug_immage

I think this issue could be related to this one #4337, but I haven't been able to fix it

def mapbox(df = df, value = 'Human health', colors = color_scales):
    fig = px.scatter_mapbox(df, lat = "lat", lon = "lon", color = value, size = value,
                            color_continuous_scale = colors[value], size_max = 25, zoom = 12, hover_name=df.Label)
    ...
    return fig

and

@app.callback([Output('mapbox', 'figure'), Output('info_box', 'children')],
    [Input("map_impact", 'value')])
def update_need_table(value):
    return mapbox(value = value), info_box_text[value]

Thanks a lot for any help, I hope I had explained the issue clearly

(Apologies if I made mistakes in reporting this issue, it is the first time I report one)

@gvwilson
Copy link
Contributor

Hi - we are trying to tidy up the stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for several years, I'm going to close it; if it 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. Thanks for your help - @gvwilson

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

2 participants