You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
in the following example, the update should only take place after releasing the slider and not on any change. Is that possible?
using Bonito
using WGLMakie
import Bonito.TailwindDashboard as D
app =App() do session::Session
sliders = [Bonito.Slider(-1:.1:1, value=0.0) for i =1:6]
vals =map!(Observable{Any}(), map(x->x.value, sliders)...) do x...return [x...]
end
f =Figure(size=(1000,200))
ax =Axis(f[1,1])
scatter!(ax, 1:6, vals)
sliderdiv(slider) = DOM.div(slider, "value: ", slider.value)
flexrow = D.FlexCol(map(sliderdiv,sliders))
return DOM.div(flexrow, f)
end
I appreciate any help you can give me.
Greetz max
The text was updated successfully, but these errors were encountered:
slider_val =Observable(0.0; ignore_equal_values=true)
onany(ax.scene.events.mousebutton, slider.value) do mb, val
if mb.action == Mouse.release
slicer_val[] = val
endend
using Bonito
using WGLMakie
import Bonito.TailwindDashboard as D
app =App() do session::Session
sliders = [Bonito.Slider(-1:.1:1, value=0.0) for i =1:6]
f =Figure(size=(1000,200))
ax =Axis(f[1,1])
slider_vals1 =map!(Observable{Any}(), map(x->x.value, sliders)...) do x...return [x...]
end
slider_vals2 =map!(Observable{Any}(), map(x->x.value, sliders)...) do x...return [x...]
endonany(ax.scene.events.mousebutton, slider_vals2) do mb, val
if mb.action == Mouse.release
slider_vals1[] = val
endendscatter!(ax, 1:6, slider_vals1)
sliderdiv(slider) = DOM.div(slider, "value: ", slider.value)
flexrow = D.FlexCol(map(sliderdiv,sliders))
return DOM.div(flexrow, f)
end
But this also doesn't work. It seems like since the sliders are not part of the scene the event Makie.MouseButtonEvent(Makie.Mouse.left, Makie.Mouse.release)
is triggered each time I change a slider.
Another solution would be to use Makie.Slider but there I do not know how to register an interaction on a slider because it is no Axis. If I could do so, I could watch for the leftdragstop event.
Hi there,
in the following example, the update should only take place after releasing the slider and not on any change. Is that possible?
I appreciate any help you can give me.
Greetz max
The text was updated successfully, but these errors were encountered: