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

feat: ellipse brushing #1050

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maartenbreddels
Copy link
Member

Issue number of the reported bug or feature request: #1048

Describe your changes
This adds an EllipseBrushSelector, which can be used as circular selector. To enforce a circular selector, put pixel_aspect=1. Note that this means the aspect is 1 in pixel coordinates, another requirement that could be added is having an aspect ratio in data coordinates (domain). This PR does not address that, and I think both can be orthogonal in use cases.

Testing performed
All operations are testing in the test framework.

Issue
Reshaping may change the aspect ratio of the ellipse (as visible in the demo), due to the implementation of how reshaping/dragging is implemented. We use the same code as the brushing, which assuming if you move X pixels in the x-direction, and Y pixels in the y-direction, you want an ellipse of aspect ratio X/Y. While actually when dragging the border, you probably want to calculate the 'angle' (more formally the eccentric anomaly https://en.wikipedia.org/wiki/Ellipse#Parametric_representation) and use that as a 'grab' point. I am not sure yet how this should be implemented, or what 'feels' natural.

Ideas are welcome: @astrofrog @SylvainCorlay @martinRenou

Demo
ellipse

@maartenbreddels
Copy link
Member Author

The reshaping is more natural now.
ellipse-2

Signed-off-by: Maarten A. Breddels <maartenbreddels@gmail.com>
@astrofrog
Copy link
Contributor

Works great! I ran into two small issues:

  • The clip rectangle of the axes isn't recognized as it is for other interacts:

clip

  • Setting color on the interact doesn't work as it does for other interacts - I need to set the style/border_style directly.

@maartenbreddels
Copy link
Member Author

TODO: 'backport' glue-viz/bqplot-image-gl#23

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.

None yet

2 participants