Open 00krishna opened 1 year ago
Thanks for reporting!
This should work. Dash.jl and PlotlyJS.jl use the same plotting backend.
What's most likely happening is that PlotlyJS.Plot
put the array of PlotlyFrame
elements somewhere that JSON3.write
does not know about.
We could try to patch
accordingly.
@etpinard Oh thanks for the response. Okay, so is this code that would go into a Dash.jl pull request or something that I can just add to my own code to override the existing dispatch?
Should I try and submit this code change as a PR?
Yep, ideally it would go in a Dash.jl pull request. This is a bug we want to fix!
I can submit a PR, no problem. Is there a test case that I should add to try this, or do I not need to add an additional test case. I have not submitted a PR to Dash.jl before, so just want to make sure I do it correctly.
Is there a test case that I should add to try this,
Unfortunately, similar PRs https://github.com/plotly/Dash.jl/pull/143 and https://github.com/plotly/Dash.jl/pull/166 relied on integration tests to lock down their patches.
If you can get the integration test running on your machine, adding a similar integration test file would be fine.
Otherwise, a new @testset
block in test/core.jl
would be great.
@etpinard say, as a temporary workaround, can I just write my own Play button and Slider using Dash components? I can compute the frames and save them in a Store, and then load them manually.
I was not sure how to update a frame in a plot though--is that possible? I only have 1 animated trace out and 3 static traces in my plot. If I just update the data
in the Plotly Graph Object, then I imagine that is the best way to do it--instead of repainting the whole plot. I can try that as a temporary workaround as I try and get the main issue fixed.
I am working on creating some dash animation. Now I am able to create some animations using PlotlyJS, but I cannot seem to get that same buttons and sliders to appear on a Dash webpage.
I was following this animation example, and the plots appear but the animation does not seem to appear--nor the buttons. In the code below I just have a button for the animation, but I also have other examples of PlotlyJS code with sliders.
One solution is to basically just generate the animation frames in the background, save them to a
dcc_store
, and then write my own play button and slider controls--using existing plotly components--to pull the frames from the store and display them. I can certainly do that, but was not sure if that is a good idea. The primary concern would be speed or performance on this kind of manual animation. So I was not sure if should write the manual method, or I should rely on those internally generated buttons usingupdatemenus
and the slider layout argument in Plotly.I have the code below, so I was hoping that someone might indicate whether the functionality to display this animation is not yet available, or whether I have coded this example incorrectly. Note that I am not getting any errors on in the webpage debug indicators or in the terminal.
I posted a similar question to this on the community forum. In that case I was just asking whether someone knew whether this code should work or whether I should post an issue about it. But no one has responded to that message yet, so I figured I would just post to the Issues list.