Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link_selections function for automated linked selections #3951

wants to merge 20 commits into
base: master


Copy link

commented Sep 11, 2019


This PR adds a holoviews.selection.link_selections function that is an initial implementation of the automatic linked selection approach proposed in #3842.

This function can be used to transform HoloViews objects into new objects with linked selections enabled.


This PR depends on the following open PRs, and will be rebased once these are merged.

Example notebook

For examples, see the notebook at

Please play around with this notebook to get a feel for the workflow and capabilities and report back on how things look @jbednar @philippjfr @jlstevens.


Linked Points plots with Bokeh backend:

Linked Points, Histogram, Scatter3d, and Table layout with Plotly backend:

Linked Violin, Points and Bivariate overlay, and Distribution layout with Bokeh backend:

Selections on datashaded elements

Linked plots across notebook output cells, and updating selection color after display:


There is a lot more functionality that can be built on this foundation. Here are some directions:

  • The link_selections function only stores the latest selection. But the _base_link_selections base class is more general, and other subclasses can be added for cross filtering, and glue-style multi-color brushing.
  • Add Bounds element to display the selected region after a selection is completed. I think this will largely be a requirement for the cross-filter mode, otherwise it would be hard to make sense of the union of the selected regions across plots.
  • Selections could be displayed on grid elements (e.g. vector field, raster) if we had an element.where operation (#3933).
  • For full hvplot compatibility, will need to review hvplot to make sure source dataset information flows through all of the produced elements. This happens for some, but not all, elements at the moment.
  • Investigate geoviews compatibility
  • Dask optimization of dim expressions and histogram operation to make selection with datashader + histogram elements with Dask DataFrames scale well.
  • Support passing full Panel layouts to link_selections and traverse them to find HoloViews panes. This way a Panel layout with HoloViews panes that use different backends could be linked together.
  • Add a new BoundsPoly stream that is analogous to BoundsXY but for a polygon rather than a box. Use this to support defining selection regions using lasso selection.

Let me know which of these you think are capabilities that we really should have for the initial release. Thanks!

jonmmease added 19 commits Aug 24, 2019
Add SelectionExprStream
Add Chart2dSelectionExpr mixin class and add SelectionExprStream to support for Scatter, Curve, ErrorBars, Spikes.

Also add GeometrySelectionExpr mixin to support Geometry elements: Points, VectorField
Support select on all dims in .dataset for Histogram elements
When select is performed on a Histogram element that has .dataset and ._operation_kwargs properties, regenerate the histogram using the selected data.

This comment has been minimized.

Copy link

commented Sep 11, 2019

Fabulous! Can we have all of those things? :-) It is hard to choose!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.