Skip to content

Commit

Permalink
fix daattali#82 - setSelection didn't trigger the shiny selected input
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali authored and strazto committed Oct 1, 2020
1 parent 80e3771 commit 221b84e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: timevis
Title: Create Interactive Timeline Visualizations in R
Version: 0.5.0.9003
Version: 0.5.0.9004
Authors@R: c(
person("Dean", "Attali", email = "daattali@gmail.com",
role = c("aut", "cre"), comment = "R interface"),
Expand Down
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# timevis 0.5.*

TODO
TODO date

- Add `timezone` parameter to `timevis()` - supports showing the timeline in a different timezone than your local machine (#67)
- Add `setCustomTime()` and `setCurrentTime()` functions (#20)
- Fixed bug: using `setSelection()` did not trigger the Shiny selected input (#82)
- Add documentation about how to add custom style to timevis (#45)
- Add documentation tab to the demo app

Expand Down
6 changes: 6 additions & 0 deletions inst/htmlwidgets/timevis.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ HTMLWidgets.widget({
},
setSelection : function(params) {
timeline.setSelection(params.itemId, params.options);
if (HTMLWidgets.shinyMode) {
Shiny.onInputChange(
elementId + "_selected",
params.itemId
);
}
},
setWindow : function(params) {
timeline.setWindow(params.start, params.end, params.options);
Expand Down

0 comments on commit 221b84e

Please sign in to comment.