Skip to content
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

Fix hover for overlays of gv.Points #631

Merged
merged 3 commits into from
May 10, 2023
Merged

Fix hover for overlays of gv.Points #631

merged 3 commits into from
May 10, 2023

Conversation

hoxbro
Copy link
Member

@hoxbro hoxbro commented Apr 27, 2023

Fixes #618 (the hover problem)

The main problem is the self.handles.get('hover') was the same for all plots in the overlay, where we wanted the hover per plot.

The example given in the issue could be cut down to this MRE:

import geoviews as gv
import pandas as pd

gv.extension("bokeh")
gv.opts.defaults(
    gv.opts.NdOverlay(tools=["hover"], legend_position="right", width=600),
    gv.opts.Points(tools=["hover"], size=10),
)


df = pd.DataFrame(
    dict(
        latitude=range(55, 60),
        longitude=range(-160, -155),
        time=pd.date_range("2020-01-01", freq="M", periods=5),
    )
)

ds = gv.Dataset(df, kdims=["longitude", "latitude", "time"])
ds.to(gv.Points).overlay()

image

(Note the NaN problem will be fixed in #625)

@hoxbro hoxbro marked this pull request as draft April 28, 2023 13:15
@hoxbro hoxbro marked this pull request as ready for review April 28, 2023 16:02
@hoxbro hoxbro added this to the Version 1.10 milestone Apr 29, 2023
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

Successfully merging this pull request may close these issues.

Issue with plotting multiple gv.Points with different opts arguments
1 participant