Table + link_selections + gridmatrix?

Diverging from my ‘Table + Selection1D + gridmatrix’ attempt to link-select from hv.Table to gridmatrix, I now have the following challenge as alternative.

One issue seems to be, is that, by having a gridmatrix passed into link_selections, and attempting to do a selection on one of the gridmatrix’s plot, fails as holoview attempts to select on the diagonal plots that are limited to 1 dimension, versus the chart plots that have 2 dimensions. Attempting to do this, a message such as the following is output from notebook cell:

linked_selection aborted because it could not display selection for all elements: One or more dimensions in the expression ((dim(‘petal_width’)>=19346717350653944)&(dim(‘petal_width’)<=31243492970289792))&((dim(‘sepal_width’)>=30319983374272135)&(dim(‘sepal_width’)<=43480113609140405)) could not resolve on ‘:Dataset [petal_length]’ Ensure all dimensions referenced by the expression are present on the supplied object on ‘:Distribution [petal_length] (Density)’.

I understand that by having grid and table in a hv layout with shared_datasource set to True will work. But by doing it this way I’m unable to find out what is selected (hence my original post mentioned above).

Any suggestions?

import holoviews as hv
import panel as pn
import param

from holoviews import opts
from bokeh.sampledata.iris import flowers
from holoviews.operation import gridmatrix
from holoviews.selection import link_selections


print('holoviews: ', hv.__version__)
print('panel:     ', pn.__version__)
print('param:     ', param.__version__)

Cell above outputs:

  • holoviews: 1.14.0.post7+g4f4c1c2ea
  • panel: 0.9.7
  • param: 1.9.3
iris_ds = hv.Dataset(flowers)
table = hv.Table(flowers)
grid = gridmatrix(iris_ds, diagonal_type=hv.Distribution, chart_type=hv.Points)

link = link_selections.instance()
linked_grid = link(grid + table).opts(
    opts.Layout(transpose=True, merge_tools=True, shared_datasource=True, sizing_mode="stretch_width", toolbar='above'),
    opts.Points(shared_datasource=True, tools=['box_select']),