Custom hover_data in Choropleth_mapbox and keeping the current zoom after running update_layout

Hi,

I’d like to know, whether it’s possible to somehow set custom hover_data parameter in px.choropleth_mapbox other than some column name from the source dataframe? For example, some format string with a custom value in it.

Would hovertemplate work for you in this case?

it’s possible to keep the current zoom when updating the mapbox layout? Every time I’m doing it, it keeps resetting to the default value (or the value set by myself per default) and I couldn’t find a way to keep it unchanged.

I guess it depends on what you are updating, but please take a look on the uirevision in the Layout documentation.

You can find a longer discussion and examples of uirevision usage in its announcement post:

Hope this helps! :slight_smile:

1 Like