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

DynamicMap hover tool does not update with chosen variable #3609

Closed
dnowacki-usgs opened this issue Apr 8, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@dnowacki-usgs
Copy link

commented Apr 8, 2019

Migrating from SO.

The following code creates a DynamicMap allowing you to choose from two variables:

import holoviews as hv
import pandas as pd
import numpy as np
hv.extension('bokeh')

df = pd.DataFrame()
df['time'] = pd.date_range('2018-01-01', '2018-01-31')
df['var1'] = np.linspace(0, 1, len(df['time']))
df['var2'] = np.ones(df['var1'].shape)

def load_symbol(var):
    return hv.Curve(df, ('time', 'Time'), var)

variables = ['var1', 'var2']
dmap = hv.DynamicMap(load_symbol, kdims='Variable').redim.values(Variable=variables)

dmap.opts(framewise=True, tools=['hover'])

However, the hover tool continues to show the value for var1 even when plotting var2.

Correct behavior for var1:
Screen Shot 2019-03-21 at 12 56 23
Incorrect behavior for var2:
Screen Shot 2019-03-21 at 12 57 23
The tooltip still shows the var1 value of 0.2, but it should read 1.

What's going on here?

@philippjfr

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2019

Thank you, this is indeed a bug. Originally HoloViews did not support changing the dimensions of an element, this changed a long time ago but it seems like we never implemented updates to the HoverTool tooltips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.