Add link selections support to AdjointLayout
See original GitHub issueDescription of expected behavior and the observed behavior
Linking plots in an adjoint layout like link_selections(spreaded << histogram)
is currently not supported
See also: https://github.com/holoviz/holoviews/issues/4997#issuecomment-881749228
Complete, minimal, self-contained example code that reproduces the issue
import numpy as np
import pandas as pd
import datashader as ds
import holoviews.operation.datashader as hd
import holoviews as hv
from holoviews.selection import link_selections
hv.extension('bokeh')
num = 100000
np.random.seed(1)
dists = {
cat: pd.DataFrame({
'x': np.random.normal(x, s, num),
'y': np.random.normal(y, s, num),
'val': np.random.normal(val, 1.5, num),
'cat': cat
}) for x, y, s, val, cat in
[( 2, 2, 0.03, 10, "d1"),
( 2, -2, 0.10, 20, "d2"),
( -2, -2, 0.50, 30, "d3"),
( -2, 2, 1.00, 40, "d4"),
( 0, 0, 3.00, 50, "d5")]
}
points = hv.Points(pd.concat(dists), ['x', 'y'], ['val', 'cat'])
datashaded = hd.datashade(points, aggregator=ds.count_cat('cat'))
spreaded = hd.dynspread(datashaded, threshold=0.50, how='over').opts(tools=['box_select', 'lasso_select'])
# Declare dim expression to color by cluster
dim_expr = ((0.1+hv.dim('val')/10).round()).categorize(hv.Cycle('Set1').values)
histogram = points.hist(num_bins=60, adjoin=False, normed=False).opts(color=dim_expr)
link_selections(hv.AdjointLayout({'main':spreaded, 'top': histogram, 'right': histogram})) # Does not work
# link_selections(spreaded + histogram) # works
Which looks like: And does not have working linked selection tools
ALL software version info
Python: 3.9.6
numpy : 1.21.0
bokeh : 2.3.3
datashader: 0.13.0
holoviews : 1.14.4
pandas : 1.3.0
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Custom BoxSelectTool is broken when using in AdjointLayout
Custom BoxSelectTool is broken when using in AdjointLayout #4997 ... Add link selections support to AdjointLayout #5028.
Read more >Source code for holoviews.selection
ParameterizedFunction): """ Baseclass for linked selection functions. ... Overlay, NdOverlay, GridSpace, AdjointLayout)): data = OrderedDict([(k, self.
Read more >Use the Quick Links web part - Microsoft Support
Use the Quick links web part to "pin" items to your SharePoint modern page for easy access. ... Type over the Quick links...
Read more >Can I use link_selections with combined plots in Holoviews?
I would like to link selections across several elements, one of which is actually a 'Overlay' (typically plot1*plot2 ).
Read more >Define Custom Buttons and Links - Salesforce Help
Click New Button or Link. Alternatively, click Default Custom Links to add a predefined custom link. For Display Type, select Detail Page Link,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I filed a seperate issue on the selection tool on master branch only working once: https://github.com/holoviz/holoviews/issues/5029
The naive solution works on v1.14.4: https://github.com/holoviz/holoviews/pull/5030