-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Miscellaneous stream improvements #1436
Conversation
Note that even after having updated the skip conditions, odd things happen when using |
Looks super useful, thanks! Is the three-pronged "if" statement needed because a Curve cannot be empty? Avoiding tricky logic like that seems like a good reason to allow empty Curves... |
I think in this case it's to start a new curve every time a new drag even is started. That said in most cases we do support empty Elements, e.g. you can do |
That's right! If you can suggest a way to shorten the example, I would be very happy to try it out. |
Anyway, in my last commit I added the JS to clip the x,y values to the axis ranges for |
It's not pretty but I'm not sure how it can be improved. |
If nothing else, I can improve the formatting. After that, I think this PR is ready to merge though it might be worth investigating the odd behavior when |
To make it easier to test, here is the text of the gif example above: from holoviews.streams import Draw
vals, curves = [], {}
def callback(x,y, stroke_count):
global vals, curves
curve = hv.Curve(vals)
if len(curves)==0:
curves[stroke_count] = hv.Curve([(x,y)])
elif stroke_count != (len(curves)-1):
curves[stroke_count]= curve
vals = []
else:
vals.append((x,y))
curves[stroke_count]= curve
return hv.Path([curve.data for curve in curves.values()])
hv.DynamicMap(callback, streams=[Draw(x=0,y=0)]) It is also worth noting that we decided to call the future stream used for actually dragging a glyph/element around (i.e drag + selection) |
@philippjfr Other than the odd behavior with |
Should I go ahead and merge? Toolbar option is fixed in #1442. |
Given that the toolbar issue is fixed, yes please! |
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This PR aims to implement the suggestions in issue #1426.
The first commit distinguishes
SingleTap
fromTap
andDoubleTap
whereTap
is supposed to capture all tap events.@bryevdv Unfortunately I can't quite implement the intended semantics for
Tap
as a double tap event should resolve into two taps. As far as I can tell, the way hammer is used in bokeh does not allow for this.Is this correct? Would it be reasonable to add a bokeh event that reflects all taps, whether single or part of a double tap?