Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Add pickable attribute #174

Closed
wants to merge 3 commits into from
Closed

Add pickable attribute #174

wants to merge 3 commits into from

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Apr 3, 2021

This pr adds a pickable::Bool attribute that allows you to disable point picking for a plot.

My aim with this is to make pick(..., range) more useful. For example consider a line plot on an Axis. Currently there is a background mesh in Axis which will be picked whenever you're not exactly on the line. With this pr you can make the background not pickable, meaning that pick(..., range) has a chance to select the line as the next closest object.

In the context of JuliaPlots/AbstractPlotting.jl#677 this will also be helpful to avoid picking the information that's being displayed. (Probably necessary to avoid flickering if we display near the cursor.)

@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 8, 2021

Works for:

  • surface
  • mesh
  • meshscatter
  • text
  • lines
  • linesegments
  • heatmap
  • image
  • volume

@SimonDanisch
Copy link
Member

Thanks, as discussed I would prefer to filter out the plots in AbstractPlotting, which shouldn't really come at any performance cost compared to doing this directly in the shader, with the benefit of making the shaders simpler and having this work across backends. The branch in the shader may even make this slower, than filtering in AbstractPlotting.

@ffreyer
Copy link
Collaborator Author

ffreyer commented Apr 12, 2021

Ok, I'll close this in favor of #177 then.

@ffreyer ffreyer closed this Apr 12, 2021
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants