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

Update BoxEditCallback and RectanglesTableLinkCallback to also use Bokeh's Quad #5682

Closed hoxbro closed 1 year ago

hoxbro commented 1 year ago

With the changes in https://github.com/holoviz/holoviews/pull/5664, using Quad instead of Rect behind the scenes, we need also to update BoxEditCallback

https://github.com/holoviz/holoviews/blob/4d0f80b22dde0108cb63b093f89a493912a982f1/holoviews/plotting/bokeh/callbacks.py#L1159

import holoviews as hv
from holoviews import annotate

hv.extension("bokeh")

rectangles = hv.Rectangles([(0, 0, 10, 10)])
box_annotate = annotate.instance()
box_annotate(rectangles, annotations=["Label"], name="Rectangles")
Task exception was never retrieved
future: <Task finished name='Task-9' coro=<Callback.process_on_change() done, defined at /home/shh/Repos/holoviz/holoviews/holoviews/plotting/bokeh/callbacks.py:322> exception=KeyError('x')>
Traceback (most recent call last):
  File "/home/shh/Repos/holoviz/holoviews/holoviews/plotting/bokeh/callbacks.py", line 351, in process_on_change
    self.on_msg(msg)
  File "/home/shh/Repos/holoviz/holoviews/holoviews/plotting/bokeh/callbacks.py", line 170, in on_msg
    processed_msg = self._process_msg(filtered_msg)
  File "/home/shh/Repos/holoviz/holoviews/holoviews/plotting/bokeh/callbacks.py", line 1219, in _process_msg
    for (x, y, w, h) in zip(data['x'], data['y'], data['width'], data['height']):
KeyError: 'x'

Edit: Also seems to be needed for RectanglesTableLinkCallback both in Holoviews and GeoViews:

https://github.com/holoviz/holoviews/blob/4d0f80b22dde0108cb63b093f89a493912a982f1/holoviews/plotting/bokeh/links.py#L225

https://github.com/holoviz/geoviews/blob/dbd3bfa66fb0e443b99d3a6c75fdee3409e70edd/geoviews/links.py#L237

github-actions[bot] commented 3 weeks ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.