Navigation
Button
using GLMakie
fig = Figure()
ax = Axis(fig[1, 1])
fig[2, 1] = buttongrid = GridLayout(tellwidth = false)
counts = Node([1, 4, 3, 7, 2])
buttonlabels = [lift(x -> "Count: $(x[i])", counts) for i in 1:5]
buttons = buttongrid[1, 1:5] = [Button(fig, label = l) for l in buttonlabels]
for i in 1:5
on(buttons[i].clicks) do n
counts[][i] += 1
notify(counts)
end
end
barplot!(counts, color = cgrad(:Spectral)[LinRange(0, 1, 5)])
ylims!(ax, 0, 20)
fig
© Makie.jl. Last modified: October 16, 2021. Website built with
Franklin.jl
and the
Julia programming language
.
These docs were autogenerated using Makie: v0.15.3, GLMakie: v0.4.7, CairoMakie: v0.6.6, WGLMakie: v0.4.7