Skip to content
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

Julia: using @manipulate creates plot but doesn't update after saving notebook and reopening #411

Open
paulnakroshis opened this issue Nov 13, 2021 · 2 comments

Comments

@paulnakroshis
Copy link

I am totally stumped by the following:

  1. I create a plot in Julia 1.6.3 with the current versions of Interact.jl and WebIO.jl and use the @manipulate macro to create a plot with an options box and a slider. The plots works and can be manipulated appropriately as you expect.

  2. I am working on MacOS 12.0.1 with the most recent Conda Distribution installed.
    Here is the code which I use in a jupyterlab notebook:

using Plots
using Interact
using DataStructures
x = y = 0:0.1:30

freqs = OrderedDict(zip(["π/4", "π/2", "3π/4", "π"], [π/4, π/2, 3π/4, π]))
mp = @manipulate for freq1 in freqs, freq2 in slider(0.01:0.1:4π; label="freq2")
    y = @. sin(freq1*x) * sin(freq2*x)
    plot(x, y)
end

This will run in a new notebooks as expected. BUT: save the notebook, restart jupyterlab and open the notebook and then the plot will be created but the interactive aspect will not work. Just to make things even more confusing (but this is likely a huge clue that I am seemingly incapable of using to solve the problem), if you open a blank notebook, copy and paste the code into a cell in that new notebook, it will work!

I've tried this on Safari, Chrome, and Firefox and the same behavior exists.

Can anyone shed light on this? The Interact widgets make Julia such a valuable tool for teaching, and although I could work in Pluto notebooks, I would really like to be able to work is standard Julia notebooks.

UPDATE: (19:39 UTC 12 Nov 2021)

Just checked the code above on PopOS! with Julia 1.6.3. Same problem. First time, it runs and sliders work. Save and quit browser, kill kernel and then restarting jupyter lab resultys in failure: plot is rendered, but sliders no longer update the plots when manipulated.

Thanks in advance. I am stumped.

@thegravelinspector
Copy link

The same happens here, but if I 'reload the current page' (Ctrl-R) in firefox, it start working.
That helps me for now, and perhaps is a clue for further investigation.

@freddy5566
Copy link

After I uninstall webio_jupyter_extension and re-install it through pip. Chrome works smoothly, but safari just cannot update while I drag the slider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants