-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ClimaExplorer
, intearctive visualizer
#51
Comments
I made a little minimal working example, not sure if it is helpful, but here it is: using Bonito
using WGLMakie
function MWE()
fig = Figure() # defined only once
ax = Axis(fig[1,1]) # defined only once
slider = Bonito.Slider(0:0.1:1)
data = Observable(Vec2f.(1.0, slider.value[]))
scatter!(ax, data) # plot an observable
on(slider.value) do val
data[] = Vec2f.(1.0, val) # update the value of the observable
end
app = App() do session::Session
return DOM.div(
DOM.div(slider, slider.value),
fig
)
end
return app
end
MWE() |
ClimaExplorer,
intearctive visualizerClimaExplorer
, intearctive visualizer
We have to find a way to balance this with how |
I can work on it after I am done with ClimaDiagnostics (or outside of work hours) - or we can do a hackathon together! I think the ClimaAnalysis code just need some refactor, same functionality, and it won't be too many big changes, just isolate things a bit more. Anything can be an x = Observable(1.0)
coordinates = @lift(Vec2f.(1.0, $x)) # any function would work here Eventually, a Makie plot function (scatter, heatmap, ...) needs to take one or more observables in its arguments, e.g. So in ClimaAnalysis, we need to be able to retrieve arguments of plotting from a function There are other ways, but useful to know are: julia> x = Observable(1.0)
Observable(1.0)
julia> x[] = 2
2
julia> x_value = x[]
2.0
julia> typeof(x)
Observable{Float64}
julia> typeof(x_value)
Float64 I find useful: julia> y = @lift(Vec2f.(2.0, $x)) # the @lift macro
Observable(Float32[2.0, 2.0])
on(slider.value) do val # on any widget update
f(val)
end
map(menu2.value) do val # this works too
f(val)
end |
Description to be written
Tasks
The text was updated successfully, but these errors were encountered: