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
MultiCursor with additionnal optionnal horizontal bar #1811
Conversation
@@ -943,8 +954,18 @@ def __init__(self, canvas, axes, useblit=True, **lineprops): | |||
|
|||
if useblit: | |||
lineprops['animated'] = True | |||
self.lines = [ax.axvline(xmid, visible=False, **lineprops) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Obviously this breaks backwards compatibility with self.lines
- I don't think that's a problem, but it should be documented in doc/api/api_changes.rst
. I wonder if it's worth providing a property which returns the union of self.vlines
and self.hlines
- on second thoughts, that doesn't really help if users want to do self.lines.append(...)
so scrap the property idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see...
May we keep self.lines pointing to self.vlines ?
Or replace all occurrence of self.vlines by self.lines
Both solution prevent api changes...
What would you prefer ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can just document the change. I think this is a small change which I can't see having a major impact to many codes - I'd sooner have the consistency of what you have implemented, than the inconsistency that not breaking compatibility would bring.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. A new commit document this small API change in doc/api/api_changes.rst
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility, why don't we set up a property "self.lines" that would point to self.vlines, but puts out a deprecation message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. That works, nice idea.
I've not tried it out, but 👍 from me. Anybody else want to comment? @WeatherGod - I know you've done some work with the widgets in the past. Thanks for this @davidtrem . |
LGTM 👍 |
MultiCursor with additionnal optionnal horizontal bar
This pull request proposed an improved MultiCursor widget that allows to select either vertical (default) and/or horizontal cursor lines. Previous Multicursor was vertical bar only.
The default behavior of Multicursor is fully preserved by this pull request.