-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Create country choropleth hover regression #1429
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
Comments
FYI the workaround does not work when using iplot in jupyter notebook because there is no include_plotlyjs argument. |
Any update on when this bug might be fixed? |
Also, using this old version of the Javascript causes the title to not show up on plots (see plotly/dash#539) |
Hi all. I don't think anyone has taken a look at this issue yet. We're definitely open to help if someone would like to take a look at https://github.com/plotly/plotly.py/blob/master/plotly/figure_factory/_county_choropleth.py and try to work through what's going wrong. |
I'm also encountering this issue with the following app dependencies
The hover info works fine on choropleths with < ~20 counties. Anything bigger than that breaks the tooltips. |
It looks like the bug creates duplicate hover tooltips and stores their e.g.
instead of
De-duplicating and flattening restores functionality. Building on the code snippet from @jonmmease's original post.. hover_ix, hover = [(ix, t) for ix, t in enumerate(fig['data']) if t.text][0]
# mismatching lengths indicates bug
if len(hover['text']) != len(df_sample_r):
ht = pd.Series(hover['text'])
no_dupe_ix = ht.index[~ht.duplicated()]
hover_x_deduped = np.array(hover['x'])[no_dupe_ix]
hover_y_deduped = np.array(hover['y'])[no_dupe_ix]
new_hover_x = [x if type(x) == float else x[0] for x in hover_x_deduped]
new_hover_y = [y if type(y) == float else y[0] for y in hover_y_deduped]
fig['data'][hover_ix]['text'] = ht.drop_duplicates()
fig['data'][hover_ix]['x'] = new_hover_x
fig['data'][hover_ix]['y'] = new_hover_y |
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 |
Originally reported at https://community.plot.ly/t/county-choropleths-not-displaying-hoverinfo-in-offline-mode/19241
The hover tooltips for the figure produced by
create_choropleth
are sometimes not being displayed properly with recent versions of plotly.js.Plotting this figure in the most recent version of plotly.js (1.44.3) results in no hover tooltips
But using 1.42.3 the tooltips are dipslayed as expected
The text was updated successfully, but these errors were encountered: