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

Lasso linked select #4362

Merged
merged 30 commits into from
Apr 29, 2020
Merged

Lasso linked select #4362

merged 30 commits into from
Apr 29, 2020

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Apr 4, 2020

Implements #4359

  • Support tabular data, i.e. Points, Scatter (requires spatialpandas or shapely)
  • Support gridded/rectilinear data, i.e. Image/QuadMesh (requires datashader)
  • Support curvilinear data, i.e. QuadMesh (requires spatialpandas or shapely)
  • Support Rectangles and Segments (requires shapely)
  • Support Path, Contours, Polygons (requires shapely)
  • Fix linked selections on complex dynamicmaps
  • Fix region indicators for dynamic plots
  • Update docs
  • Fix tests
  • Add new tests

lasso_example

gridded_lasso

qmesh_lasso

box_lasso

poly_lasso

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful.

holoviews/element/selection.py Show resolved Hide resolved
from ..operation.datashader import rasterize
except ImportError:
raise ImportError("Lasso selection on gridded data requires "
"datashader to be available.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of Datashader for this purpose! Can you not fall through to the spatial_select_columnar case when datashader is not available?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, can do, although for large rasters this will be slow.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. I'm not sure if it makes sense to warn in such a case; on the one hand without a warning people might not realize that there's an easy way to make it go much faster, but on the other hand, if people genuinely can't install datashader or don't want to or have a small dataset, having such a warning will be annoying.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tbh, spatialpandas/shapely are more difficult to install and this isn't worth the extra complexity and possible user confusion.

@philippjfr
Copy link
Member Author

philippjfr commented Apr 6, 2020

Took me basically all weekend but I also used this PR to fix issue I had encountered when applying this to various hvPlot generated DynamicMaps (but this was almost certainly a more general issue).

The issue was mainly related to the fact that it was recording and replaying both dynamic operations by traversing the DynamicMap graph and the pipeline which is accumulated as operations and methods are applied. This could cause all kinds of weirdness, therefore we now use the pipeline as the single source of truth for all transforms that are applied.

This should not cause any actual issues since the pipeline is a far better record of all the transforms that were applied to an object and also far easier to manipulate.

@philippjfr philippjfr force-pushed the lasso_linked_select branch 3 times, most recently from 0a28198 to 8282ff1 Compare April 16, 2020 11:01
@philippjfr philippjfr force-pushed the lasso_linked_select branch 6 times, most recently from cfcb5dc to 2bde8b8 Compare April 29, 2020 02:39
@philippjfr
Copy link
Member Author

Merging since there are people waiting on a dev build which includes this work.

@philippjfr philippjfr merged commit 113f206 into master Apr 29, 2020
for tracking data providence for user supplied functions,
which do not make use of the clone method. Should be disabled
for operations where the output is not derived from the input
and instead depends on some external state.""")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be disabled for operations where the output is not derived from the input and instead depends on some external state.

Are there any common examples that could be listed here?

@jlstevens
Copy link
Contributor

jlstevens commented Apr 29, 2020

I know the PR is merged now but I had a look anyway. The functionality is very nice and I only have one comment regarding documentation of the link_dataset parameter on Dynamic.

I suppose my only other comment is that while nice, this functionality is a little unusual in that it requires a lot of inline imports depending on what exactly is being attempted. This seems justified in this case but I wouldn't like this sort of conditional feature to become the norm.

@philippjfr philippjfr deleted the lasso_linked_select branch April 25, 2022 14:40
@maximlt maximlt mentioned this pull request Sep 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants