-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Description
Software versions
Python version : 3.13.5 (main, Jul 11 2025, 22:43:46) [Clang 20.1.4 ]
IPython version : (not installed)
Tornado version : 6.5.2
NumPy version : 2.3.2
Bokeh version : 3.8.0
BokehJS static path : /home/ediun/git/joy/.venv/lib/python3.13/site-packages/bokeh/server/static
node.js version : (not installed)
npm version : (not installed)
jupyter_bokeh version : (not installed)
Operating system : Linux-6.6.87.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Browser name and version
No response
Jupyter notebook / Jupyter Lab version
No response
Expected behavior
When adding a HoverTool
on a MultiLine
glyph, and then dynamically changing the data column to display through a JS callback (e.g., through a button), the hover tool should highlight the new data.
Observed behavior
Updating the data causes the highlighting to appear on previous (no longer displayed) data (seemingly on the same row as the new data). Moreover, the line supposed to be highlighted in the new data disappears while hovering it.
Example code
import bokeh.layouts as bl
import bokeh.models as bm
import bokeh.plotting as bp
source = bm.ColumnDataSource(
{
"ys": [[1, 2, 1]],
"xs1": [[1, 2, 3]],
"xs2": [[4, 5, 6]],
}
)
figure = bp.figure(x_range=bm.Range1d(0, 7))
lines = figure.multi_line(
"xs1", "ys", line_width=3, hover_line_color="red", source=source
)
hover = bm.HoverTool(tooltips=None)
figure.add_tools(hover)
button = bm.Button(label="Change columns")
button.js_on_click(
bm.CustomJS(
args={"lines": lines},
code="""
lines.glyph.xs.field = "xs2";
lines.glyph.change.emit();
""",
)
)
layout = bl.layout([figure, button])
bp.show(layout)
Stack traceback or browser console output
No response
Screenshots
No response