Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Update Selection Widgets #3486

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

Closed
blink1073 opened this issue Sep 8, 2014 · 9 comments
Closed

Update Selection Widgets #3486

blink1073 opened this issue Sep 8, 2014 · 9 comments

Comments

@blink1073
Copy link
Member

I took a stab at updating the selection widgets. Namely, improving the RectangleSelector and LassoSelector, and adding new EllipseSelector, PaintSelector and LineSelector widgets. These are based on a proof of concept I made called image inspector, which in turn is based on the scikit-image canvastools.

I created a gist that demonstrates all the widgets.

Improvements to RectangleSelector:

  • Visible handles for manipulating the shape after it has been drawn
  • Keyboard modifiers:
    • Alt moves the existing shape (as does dragging the center handle)
    • Shift makes the shape square (or circular)
    • Ctrl makes the initial point the center of the shape (helpful for ellipses)
    • Ctrl and shift can be combined
  • When drawmode == 'line', actually draw the outline instead of a single line

The API is the same, but the default drawmode has been changed to 'patch', while allowing 'box' to alias to 'patch'. Also, the shape is no longer invisible after been drawn (so we can interact with it).

Improvements to LassoSelector:

  • Unified API with RectangeSelector
  • Keyboard modifier:
    • Shift enables polygon mode where it draws straight lines

Note that LassoSelector had two methods that were renamed: onpress -> press and onrelease -> release. The old methods could be kept, and call the new methods while giving a deprecation warning.

Here is a screenshot of the Ellipse tool:
image

How would you like me to proceed? Throw them all into one PR?

@blink1073
Copy link
Member Author

@tonysyu, @tacaswell, what are your thoughts?

@tacaswell
Copy link
Member

Can you spilt them into as many PRs as make sense? My concern is that large PRs are hard to review (which makes it easier for bugs to slip in) and provide a larger cross section to collect conflicts (leading to more re-basing).

Again, I apologize, I have not had the bandwidth to look in to this in any detail.

@tacaswell tacaswell added this to the v1.5.x milestone Sep 8, 2014
@fariza
Copy link
Member

fariza commented Sep 9, 2014

@blink1073 just as a side note, this could be related #3475

@WeatherGod
Copy link
Member

Just to note, if you get this completed (I agree to break this up into smaller PRs) within the next month, I'll be sure to include mention of these new widgets in my book on interactive matplotlib

On Tue, Sep 9, 2014 at 10:42 AM, Federico Ariza [email protected]
wrote:

@blink1073 https://github.com/blink1073 just as a side note, this could
be related #3475 #3475


Reply to this email directly or view it on GitHub
#3486 (comment)
.

@fariza
Copy link
Member

fariza commented Sep 10, 2014

@blink1073 be aware of #3376

@blink1073
Copy link
Member Author

It would be nice to merge #3376 first so I can build on that.

@tonysyu
Copy link
Contributor

tonysyu commented Sep 17, 2014

I think what you did with image inspector is great, and a more unified API for selection widgets would be welcome. I agree with @tacaswell that small PRs would be much easier to review. Probably just the base SelectionWidget and one of the concrete classes in the first PR.

@petehuang
Copy link
Contributor

Seems like there was great work done here, thanks and props @blink1073!

What is the status of this particular issue? I'm assuming there weren't any other PRs to submit, in which case we should mark this closed. Please do comment if otherwise.

@blink1073
Copy link
Member Author

Thanks, @petehuang! There is an open PR for the paint selector (#7411), to be followed by a PR for the line selector. I decided not to tackle the lasso selector integration after all. I'd say this particular PR can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants