You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 29, 2019. It is now read-only.
Hi, I'm not sure you're interested in this, but since we needed it… :-)
This commit adds touch/click events on minor labels. The use case for this being recentering the view on the clicked label or maybe zooming into it (ie. clicking on "Sun. 23" shows the whole day).
The implementation mirrors the way Item selection is designed so I don't think I went too much astray there; The actual changes are fairly little, so not sure why the dif on the minified files is so large. The event contains a single property called label which is a Date object.
It'd be quick to implement that on major labels too althought I'm not sure if there is a use case.
Oh, and the example is a bit messy right now but it tests support for both orientations & on the fly orientation change.
Thanks for your PR @y-lohse . The timeline still lacks support for events like click, double-click, hover, etc. So you can add your own behavior. Clicking a label is one of these customizations.
I haven't yet thought about a clear API for these event listeners. An API like .on('label', ...) may be limiting if we would want to support say double-clicking on a label too. Maybe we could have a generic .on('click', callback), which provides the clicked thing as argument, that could be an item, label, group, or empty space.
You're right, this approach is very limited and the one you described seems to be closer to what's going on in the rest of the vis.js. I'll close this PR, the code is still there if someone needs a headstart for the labels at some point :-)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
None yet
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I'm not sure you're interested in this, but since we needed it… :-)
This commit adds touch/click events on minor labels. The use case for this being recentering the view on the clicked label or maybe zooming into it (ie. clicking on "Sun. 23" shows the whole day).
The implementation mirrors the way Item selection is designed so I don't think I went too much astray there; The actual changes are fairly little, so not sure why the dif on the minified files is so large. The event contains a single property called
labelwhich is a Date object.It'd be quick to implement that on major labels too althought I'm not sure if there is a use case.
Oh, and the example is a bit messy right now but it tests support for both orientations & on the fly orientation change.