-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update plot in loop #27
Comments
The react function from PlotlyBase is only re-exported by PlutoPlotly but it's not used internally (in the current non-published version it is also forwarded from PlutoPlot objects to its internal Plot object but just for completeness of API). In the README of this package there is a mention to the This together with the utilization of To come back to your example above, in PlutoPlotly you can achieve what I think you want with the following code. # ╔═╡ c22b0535-cb6c-4264-b27c-13361fa06b87
@bind toggle Clock(1e-2)
# ╔═╡ 5f28ca6d-f3df-451e-8953-28ab22b853c3
let
toggle
phase = 5time()
x = range(0,2π, 100)
y = sin.(x .+ phase)
plot(scatter(;y,x))
end db5eea84-ce5a-4b54-9996-515683ad9f16.mp4That being said I do agree that we need more documentation in this package. |
On the note of updating an existing plot from another cell, while this is in theory possible with PlutoPlotly (and will give you even more snappyness compared to the one in the example above), it requires going the Javascript route (meaning writing functions that create and return javascript code, either with Base.HTML or Consider that I believe there is also some throttling/overhead with the clock function (I don't think it was designed for very short periods) so you can't too fast by relying on that. For much better capabilities of updating plots on Pluto in the backround we would need something like fonsp/Pluto.jl#2392 to be finished and merged. |
That sounds awesome! Using Pluto and reactive plots allows some incredible things in terms of using a headless raspberry pi for streaming data collection and visualization, and I am super-psyced about the prospect. This package appears to be the best effort, and it is already very capable. Thank you for it. The documentation was a bit hard to find my way through, so I am very glad to hear that you are in the process of a rewrite. For now, I think I will settle with the reactiveness seen in the example we provided, as it is already really impressive. I am not at all capable of contributing in this space, but again thank you for your efforts. I think it allows some really really cool stuff, implemented in very little time by people like me with very little (no) knowledge about Javascript and HTML. Thanks. |
Is it currently possible to do something like I asked for in https://discourse.julialang.org/t/toggle-indefinite-loop-in-pluto-notebook/104495/? The function
react
has me hopeful, but it is not documented at all. When I try to use it, it says that it takes a variable number of argument with type any, but errored when I gave it two vectors.The text was updated successfully, but these errors were encountered: