holoviz / holoviz/hvplot

Tooltips "@value" no longer works

Open
#1,441 11 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.4k
Forks
124
Avg merge
1d 18h
Merged PRs (30d)
1

Description

#### ALL software version info

Software Version Info

```plaintext
Include version information here

python 3.13.0 h9ebbce0_100_cp313 conda-forge
hvplot 0.10.0 pyhd8ed1ab_0 conda-forge
holoviews 1.18.3 pyhd8ed1ab_0 conda-forge
bokeh 3.6.0 pyhd8ed1ab_0 conda-forge
```

#### Description of expected behavior and the observed behavior
hvplot 1.19 broke bokeh tooltips. The ("value", "@value") entry in tooltips does not make hover tool to display dataframe column values.
#### Complete, minimal, self-contained example code that reproduces the issue
This is a slightly modified example from https://discourse.holoviz.org/t/how-to-set-up-hovertool-for-multiple-columns-with-hvplot/4294/4. I run it as
```
panel serve --dev Untitled.ipynb
```
It works fine with holoviews up to 1.18.3, fails with higher versions, see the screen capture below..
```python
# code goes here between backticks
import hvplot.pandas
import numpy as np
import pandas as pd
import panel as pn

pn.extension()

index = pd.date_range("2020-07-01", "2021-07-01", freq="D")
data = np.random.random((index.size, 4)) + 10 * np.arange(4)[np.newaxis, :]
df = pd.DataFrame(data, index=index, columns=list("ABCD"))

from bokeh.models import DatetimeTickFormatter, HoverTool

tickfmt = DatetimeTickFormatter(years="%m-%d", months="%m-%d")

tooltips = [
("Month-Day", "@index{%m-%d}"),
("value", "@value"),
("name", "@Variable")
]
hover = HoverTool(tooltips=tooltips, formatters={"@index": "datetime"})

plot = df.hvplot(xformatter=tickfmt, tools=[hover])
pn.Row(plot).servable()

#### Stack traceback and/or browser JavaScript console output

#### Screenshots or screencasts of the bug in action
![2024-10-15-064047_726x360_scrot](https://github.com/user-attachments/assets/0311ee0f-4568-4871-9aba-e32161b83ca1)

- [ ] I may be interested in making a pull request to address this

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.