切换开关
|
该页面正在翻译中。 |
具有属性的切换 活动中 这可以是真或假,以启用或禁用交互图的属性。
using GLMakie
fig = Figure()
ax = Axis(fig[1, 1], limits = (0, 600, -2, 2))
hidexdecorations!(ax)
t = Observable(0.0)
points = lift(t) do t
x = range(t-1, t+1, length = 500)
@. sin(x) * sin(2x) * sin(4x) * sin(23x)
end
lines!(ax, points, color = (1:500) .^ 2, linewidth = 2, colormap = [(:blue, 0.0), :blue])
gl = GridLayout(fig[2, 1], tellwidth = false)
Label(gl[1, 1], "Live Update")
toggle = Toggle(gl[1, 2], active = false)
on(fig.scene.events.tick) do tick
toggle.active[] || return
t[] += tick.delta_time
end
fig