In [1]:
using Observables, Plots
In [2]:
angle = Observable(pi/2)
Out[2]:
Observable{Float64} with 0 listeners. Value:
1.5707963267948966
In [3]:
function plot_arc(angle_value)
    angles = range(0, angle_value, length=100)
    x = cos.(angles)
    y = sin.(angles)
    plt = plot(
        x, y, 
        ratio=:equal, 
        xlims=(-1.5, 1.5), ylims=(-1.5, 1.5), 
        legend=:none, 
        framestyle=:none)
    display(plt)
end
Out[3]:
plot_arc (generic function with 1 method)
In [4]:
angle_observer = on(plot_arc, angle)
Out[4]:
(::Observables.ObserverFunction) (generic function with 0 methods)
In [5]:
notify!(angle)
In [6]:
angle[] = pi*2/3
Out[6]:
2.0943951023931953