Skip to content

Commit d27d1c0

Browse files
MikalaiPrakapenkahoxbro
authored andcommitted
fix: PolyEdit stream not synchronizes with CDS (#6534)
1 parent 5ef05ec commit d27d1c0

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

holoviews/plotting/bokeh/callbacks.py

+1
Original file line numberDiff line numberDiff line change
@@ -1405,6 +1405,7 @@ def _process_msg(self, msg):
14051405
elif (
14061406
isinstance(values, list)
14071407
and len(values) == 4
1408+
and isinstance(values[2], str)
14081409
and values[2] in ("big", "little")
14091410
and isinstance(values[3], list)
14101411
):

holoviews/tests/plotting/bokeh/test_callbacks.py

+25
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,31 @@ def test_msg_with_base64_array():
468468
assert np.equal(data_expected, data_after).all()
469469

470470

471+
def test_msg_with_polyedit_polyline():
472+
# Account for issue seen in https://github.com/holoviz/holoviews/issues/6532
473+
data_before = {
474+
"xs": [
475+
[10.0, 20.0, 30.0, 40.0],
476+
np.array([10.0, 20.0, 30.0, 40.0]),
477+
np.array([10.0, 20.0, 30.0, 40.0]),
478+
np.array([10.0, 20.0, 30.0, 40.0])
479+
],
480+
"ys": [
481+
[10.0, 20.0, 30.0, 40.0],
482+
np.array([10.0, 20.0, 30.0, 40.0]),
483+
np.array([10.0, 20.0, 30.0, 40.0]),
484+
np.array([10.0, 20.0, 30.0, 40.0])
485+
],
486+
"color": ["#FF0000", "#FF0000", "#FF0000", "#FF0000"],
487+
"line_color": ["#FF0000", "#FF0000", "#FF0000", "#FF0000"],
488+
"line_width": np.array([2, 2, 2, 2]),
489+
}
490+
msg_before = {"data": data_before}
491+
msg_after = CDSCallback(None, None, None)._process_msg(msg_before)
492+
data_after = msg_after["data"]
493+
assert np.equal(data_before, data_after).all()
494+
495+
471496
@pytest.mark.usefixtures('bokeh_backend')
472497
def test_rangexy_multi_yaxes():
473498
c1 = Curve(np.arange(100).cumsum(), vdims='y')

0 commit comments

Comments
 (0)