microsoft / datamations

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

Custom animations #144

Closed giorgi-ghviniashvili closed 2 years ago

giorgi-ghviniashvili commented 2 years ago

Here is the PR from custom_animations branch. Please check it in R environment.

willdebras commented 2 years ago

@giorgi-ghviniashvili, does the custom-animations branch have all commits needed to test the functionality? It looks like it should in that you merged main back in before the PR, but I ask because I am running into errors in the R environment:

This call results in an empty widget with the following console error.

"small_salary %>%
  group_by(Degree) %>%
  summarize(mean = mean(Salary))" %>%
  datamation_sanddance()

image

The dependency tree looks properly updated in the datamationSandDance.yaml, so I am not entirely sure what is up.

Weirdly, the widget displays fine in the demo application, but it also kills the socket, crashing the app. We should discuss tomorrow and sort out.

giorgi-ghviniashvili commented 2 years ago

@willdebras ah , seems like ?? is not supported in HTMLWidgets JS environment, but supported in any modern browser. Removed it and replaced with a different expression.

jhofman commented 2 years ago

@willdebras and @giorgi-ghviniashvili will debug the shiny app

willdebras commented 2 years ago

Think I'm onto the issue at hand with the Replay button not working:

image

I'm not entirely sure why it is trying to pass the id in the play method here. Removing it so it reads .play() properly triggers the replay of the animation (as this plays from animation frame 0).

This however is true for widgets created from the main repository though, so I am not certain why it's an issue now.

@giorgi-ghviniashvili, should we add handling in the play function to address this?

EDIT: I can remove the ID from this call in datamation_sanddance.R, which generates the HTML wrappers for the widget.

willdebras commented 2 years ago

@giorgi-ghviniashvili, this works fully now, including in the demo application with the replay button. I had to make one edit in the R side of things. Could you update the PR to include the latest commit so we can merge all at once?

https://github.com/microsoft/datamations/commit/d0ead3db91998ea0a34f8c967a042b400d05461a

giorgi-ghviniashvili commented 2 years ago

@willdebras merged it