Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Shashi Gowda
    @jiahao JuliaLang/Interact.jl#36 add yours! ;)
    is it possible to create a plot signal, which then gets updated in its representation in jupyter notebooks? so that i can update the plots from another cell?
    Shashi Gowda
    @axsk yes.
    using Reactive, Interact
    n = Signal(20)
    map(n->plot(x=rand(n), y=rand(n)), n)

    The other cell:

    push!(n, 20)


    slider(10:100, signal=n)


    m = Model(solver = GurobiSolver())
    i get n= maximum(b) already
    but for variable it requires an integer number
    how can i push n inside the variable slot?
    Oliver Schulz
    Is there any way to use Interact with Julia 0.5 already?
    Christoph Ortner

    I noticed that Interact.jl uses ipywidgets. I am currently trying to use the Python package chemview which relies on ipywidgets as well. While I can import it ok, it crashes as soon as I try to create a widget. Trying ipywidgets directly, e.g.,

    using PyCall
    @pyimport ipywidgets

    gives me just a long error message. Looking at Interact.jl I don't really understand how ipywidgets is used. Is this non-trivial thing and just getting a python package to work directly via PyCall won't be possible?

    Shashi Gowda
    Interact.jl doesn't directly deal with ipywidgets, instead it only sends messages to jupyter according to its widgets protocol
    Christoph Ortner
    thanks - do you remember whether there was a good reason for this? I.e., there are fundamental difficulties in trying to use PyCall and the ipywidgets package directly?
    Josef Heinen
    Interact.jl seems to be broken after updating ipywidgets to version 7.0.0? Does anyone have a solution?
    Hellos, does anyone tried to create an interactive plot with GtkInteract?
    w = mainwindow(title="Simple test")
    n = slider(1:10, label="n")
    m = slider(11:20, label="m")
    cg = cairographic()
    append!(w, [n, m, cg])
    map(n,m) do n,m
      push!(cg, plot(sin, n*pi, m*pi))
    I tried that program (example in GTKInteract docs) but when i use the slider i get the following error:
    MethodError : no method matching update_view(::Interact.Slider(Int64))
    I used
    using Immerse; using GtkInteract;
    Immerse v= 0.0.13, Interact version =0.5.0,
    using Interact
    using DifferentialEquations
    using Latexify
    using Plots 
    A function which simulates and plots an ODE. 
    The system is first equilibrated for an input value of 1.
    The plotted dynamics is the relaxation of the system after the input is changed to 10.
    function plotODE(ode::AbstractParameterizedFunction, parameters, plotvars)
        set_param_values!(ode, parameters)
        ode.input = 1. 
        u0 = fill(1., length(ode.syms))
        ssprob = SteadyStateProblem(ode, u0)
        u0 = solve(ssprob).u
        tspan = (0.,10.)
        ode.input = 10. 
        prob = ODEProblem(ode, u0, tspan)
        sol = solve(prob, solver=Rosenbrock23())
        plot(sol, vars=plotvars, xlabel="Time", ylabel="Concentration", ylims=[0.,-Inf])
    Automatically generate sliders for all the ODE's parameters and map the results 
    to the plotODE function.
    function interactivePlot(ode::AbstractParameterizedFunction)
        params = [slider(-2:0.1:2, label=latexify("$p"), value=log10(getfield(ode, p))) 
            for p in ode.params]
        plotvars = selection(ode.syms, multi=true)
        display(hbox(vbox(params[2:end]...), plotvars))
        map((x...)->plotODE(ode, 10. .^collect(x[1:end-1]), x[end]), 
            signal.(params)..., signal(plotvars))
    Define some ODEs
    ode1 = @ode_def negativeFeedback begin
        dx = r_x * (e_x * input * y - x)
        dy = r_y * (e_y / x - y)
    ode2 = @ode_def incoherentFeedForward begin
        dx = r_x * (e_x * input - x)
        dy = r_y * (e_y * input / x - y)
    I have tried this code and I get:
    UndefVarError: set_param_values! not defined
     [1] plotODE at .\In[13]:14 [inlined]
     [2] (::##46#49{incoherentFeedForward})(::Array{Any,1}, ::Vararg{Array{Any,1},N} where N) at .\In[13]:40
     [3] map(::Function, ::Reactive.Signal{Array{Any,1}}) at C:\Users\Joseph\.julia\v0.6\Reactive\src\operators.jl:32
     [4] interactivePlot(::incoherentFeedForward) at .\In[13]:40
     [5] include_string(::String, ::String) at .\loading.jl:515
    any help?
    Niklas Korsbo
    @jsschlosser I'm seeing this a few months late, but the problem is that DifferentialEquations changed a lot since I made that example. Parameters are now passed directly to ODEProblem and is not a property which resides within the ParameterizedFunction. I'll update the example so that it works with the new DifferentialEquations API.
    Niklas Korsbo
    The JuliaGizmos/Interact.jl#36 is now updated and working (until the next API change).
    Dear colleagues,
    I have a widget working on juno, but on responsive on mux.
    Any help?