holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.71k stars 403 forks source link

Broken shared linked crosshair tool if set on one dimension only #6386

Closed TheoMathurin closed 1 month ago

TheoMathurin commented 1 month ago

ALL software version info

Software Version Info ```plaintext holoviews 1.19.1 bokeh 3.5.2 panel 1.15.0 ```

Description of expected behavior and the observed behavior

The update to Bokeh 3.5 breaks shared Crosshair tools seemingly if they're not enabled for both width and height. Separate tools appear separately on each plot.

Complete, minimal, self-contained example code that reproduces the issue

NB: Pure bokeh example from their docs works as expected.

import holoviews as hv
import numpy as np
from bokeh.models import CrosshairTool, Span
import panel as pn

hv.extension("bokeh")

s1 = hv.Scatter(np.random.randn(10, 10))
s2 = hv.Scatter(np.random.randn(10, 10))
s3 = hv.Scatter(np.random.randn(10, 10))
s4 = hv.Scatter(np.random.randn(10, 10))

height = Span(dimension="height")
width = Span(dimension="width")
cht1 = CrosshairTool(overlay=[height, width])
cht2 = CrosshairTool(overlay=height)
s1 = s1.opts(tools=[cht1])
s2 = s2.opts(tools=[cht1])
s3 = s3.opts(tools=[cht2])
s4 = s4.opts(tools=[cht2])

pn.Row(pn.Column(s1, s2), pn.Column(s3, s4)).servable()

Stack traceback and/or browser JavaScript console output

Nothing

Screenshots or screencasts of the bug in action

crosshair

hoxbro commented 1 month ago

Introduced by https://github.com/holoviz/holoviews/pull/6220