5

I'm learning HoloViews with the Bokeh backend and am making an iPython/Jupyter display of the chosen column of a pandas DataFrame (actually it's an xarray Dataset but it's simpler to show the issue with a DataFrame). The issue is that when I chose any column/variable other than the first one, the hover tooltip still shows the value from the first column/variable. My code is loosely based on the HoloViews dashboard docs.

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'])

Using the hover tool with the first variable selected: enter image description here Using the hover tool with the second variable selected: enter image description here

Note that the correct tooltip value (0.200) is shown for var1. But when var2 is selected, the hover tool still shows the value for var1, even though the tooltip is in the correct place for var2. What's going on here?

Dan
  • 1,105
  • 12
  • 15

1 Answers1

0

Apparently it was a bug in holoviews, as developer answered here (issue #3609)

It was officially solved with release 1.12.2 of holoviews. If someone still encounter this problem, upgrading to recent version should solve it.

Roim
  • 2,986
  • 2
  • 10
  • 25