JuliaGizmos / Interact.jl

Interactive widgets to play with your Julia code
Other
522 stars 76 forks source link

Output doesn't update #124

Closed tbreloff closed 7 years ago

tbreloff commented 7 years ago

I was just testing this out with Plots. It doesn't crash, which is an improvement! However it also doesn't update (which sort of defeats the purpose ;)

Just doing a simple test gave me initial output as expected, but clicking buttons/sliders/etc did not change the output:

using Plots, Interact
@manipulate for i=[5,20]
    plot(rand(10))
end

I made this simple change to https://github.com/JuliaLang/Interact.jl/blob/master/src/IJulia/setup.jl#L95-L97:

const __i = Ref(0)
function IJulia.display_dict(x::Signal)
    __i[] += 1
    @show __i[]
    IJulia.display_dict(value(x))
end

And confirmed that this method doesn't seem to get called after the initial setup.

Any idea what's going on?

JobJob commented 7 years ago

Which Plots backend? Tagged versions of Interact, Reactive, Plots or master?

This is working for me with PlotlyJS backend and a couple of different combinations of master/tagged, as in the plot updates fine when you click the buttons.

tbreloff commented 7 years ago

Interesting. I tried with pyplot and gr. What commits are you on?

On Thu, Nov 17, 2016 at 9:10 PM Joel Mason notifications@github.com wrote:

Which Plots backend? Tagged versions of Interact, Reactive, Plots or master?

This is working for me with PlotlyJS backend and a couple of different combinations of master/tagged, as in the plot updates fine when you click the buttons.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JuliaLang/Interact.jl/issues/124#issuecomment-261429601, or mute the thread https://github.com/notifications/unsubscribe-auth/AA492vxPnLg-pNR_ZRQcwkrANlCcbQ3aks5q_QkZgaJpZM4K14eE .

JobJob commented 7 years ago

Not at comp right now, sorry, but Pyplot needs special treatment to work with interact, see the example notebook 3

JobJob commented 7 years ago

gr, pyplot and plotly all work for me with tagged IJulia, Interact, Reactive and Plots.

using Plots, Interact
# gr()
pyplot()
...

You're in IJulia right? Do you have any errors in the js console? In the IJulia backend?

Your Jupyer and ipywidgets versions are good? https://github.com/JuliaLang/Interact.jl#ipywidgets-version.

tbreloff commented 7 years ago

I did a Pkg.free("Interact") and it's working! Any idea what might have changed since the last tag?

JobJob commented 7 years ago

Oh yeah, there was change in IJulia that is required for current Interact master to work. Checking out IJulia master should sort it out. Need to fix up the REQUIRE. Thanks.

JobJob commented 7 years ago

Closing this, will leave #125 open instead until a release is tagged because it's a bit clearer and more succinct if others run into the problem.