-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add slider events #1126
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
Add slider events #1126
Conversation
@rreusser can you give a real world example of these events in action? |
here is an example where the simulation pauses during interaction. here is an example that would greatly benefit from the ability to lower resolution while the component is being dragged for a quick preview. |
@etpinard what do you think of |
love it 👍 |
This PR has been updated as discussed. The initial description now specifies the three events implemented. |
@etpinard the individual commits are a little messy since I accidentally committed the linter changes, but the end result is correct (pending circle-ci). |
For live example, see console output at: http://rickyreusser.com/animation-experiments/#gapminder |
nicely done 💃 |
Due to a lack of events, sliders that execute custom code in pure JS are very difficult. This PR adds events to sliders:
plotly_sliderstart
: emitted when the slider receives a mousedown eventplotly_sliderchange
: emitted when the slider receives interaction that changes the selected value. Data containsinteraction: true | false
in order to indicate whether the change was the result of user interaction of some other state change like bindings.plotly_sliderend
: emitted on mouseup