Skip to content
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

Shiny input variable of visible items in timeline #22

Closed
padamson opened this issue Dec 30, 2016 · 2 comments
Closed

Shiny input variable of visible items in timeline #22

padamson opened this issue Dec 30, 2016 · 2 comments

Comments

@padamson
Copy link

Create a Shiny input variable of items visible in the timeline. Use visjs method getVisibleItems() to populate a vector of IDs inside a timeline.on(‘rangechanged’… listener.

Something like:

// The range of the window has changes (by dragging or zooming)                                             
timeline.on('rangechanged', function (properties) {
  Shiny.onInputChange(
    elementId + "_visible",
    timeline.getVisibleItems()
  );
});
Shiny.onInputChange(
  elementId + "_visible",
  timeline.getVisibleItems()
);
@padamson padamson changed the title Create timeline.getVisibleItems() Shiny input variable of visible items in timeline Dec 30, 2016
@daattali
Copy link
Owner

Thanks Paul

It should also be returned when the items data gets changed (if an item is added/removed/modified and affects the currently visible items)

I didn't add this functionality originally because I wanted to only expose what I thought are the most useful pieces of data. If others +1 this issue and also find it useful, we'll add it

@daattali
Copy link
Owner

@padamson you probably don't care anymore, but this is implemented :)

strazto pushed a commit to strazto/timevis that referenced this issue Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants