microsoft / datamations

https://microsoft.github.io/datamations/
Other
66 stars 14 forks source link

Send slider state from JS to Shiny on play / replay #70

Closed sharlagelfand closed 3 years ago

sharlagelfand commented 3 years ago

Added a line into the play() function that sends the status of the slider so that its position can update the tabs (as mentioned in #45)

https://user-images.githubusercontent.com/15895337/121203963-8636c600-c844-11eb-8b9b-bfe1e1eab40e.mov

giorgi-ghviniashvili commented 3 years ago

Looks good!

giorgi-ghviniashvili commented 3 years ago

The only thing is that, I modified it like this. HTMLWidgets is not defined outside shiny app.

image

sharlagelfand commented 3 years ago

Oh thanks, good catch @giorgi-ghviniashvili!

To clarify HTMLWidgets is defined when you run the widget just in e.g. RStudio but not in Shiny (that's what HTMLWidgets.shinyMode checks for) - but good catch that it doesn't exist when you're running the JS code outside of R with passed specs, so we definitely want to account for that case!