Make link_selection interact with tables
See original GitHub issueDescription of problem
I want to be able to have a table that interacts with link_selection. E.g. if I have a plot over some cars, and I Box Select the ones with a max speed above 60 km/h, I want the table to highlight those cars in the same way the scatter plot does. Currently when I use a link_selection on a table the Box Select stops working, which might be a bug.
Down below I’ve made an exaggerated simple example of the code which is not working
import pandas as pd
import holoviews as hv
from holoviews.selection import link_selections
hv.extension('bokeh')
data = {"x": [1,2,3,4,5], "y": [2,4,5,7,10]}
df = pd.DataFrame(data)
dataset = hv.Dataset(df)
dataset
bars = hv.Bars(dataset, "x", "y")
bars
scatter = hv.Scatter(dataset, "x", "y")
scatter
table = hv.Table(dataset)
table
If I only plot the scatter plot and bars, I can Box Select them properly linked:
However, if I add the table to the cocktail, Box Select draws the markup but doesn’t mark anything:
Solution
The most useful way to solve this would be to make the selected data points go to the top of the table. And then give the cells a different color, so you’d be able to separate them from the remaining data points.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
Potential Solution
I have potential solution here https://discourse.holoviz.org/t/how-do-i-link-plots-and-tables/925
@MarcSkovMadsen Thanks for posting the workaround on discourse!
From what I can tell, this is a bug in holoviews as you shouldn’t have to resort to using panel here. I don’t see why the original code posted above shouldn’t work. Do you agree @philippjfr ?
I’ve assigned it to the next milestone as I think we would all like to ensure linked selections is working for users as expected.