Skip to content
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

Make slider interaction work for Makie Field recipe #940

Merged
merged 18 commits into from
Dec 17, 2022
Merged

Make slider interaction work for Makie Field recipe #940

merged 18 commits into from
Dec 17, 2022

Conversation

SimonDanisch
Copy link
Collaborator

Use lift to visualize a changing field.
The updated code is designed in a way, that the mesh doesn't need recalculating if the sphere itself doesn't change, so only color values will get updated, which is much more efficient.
Also, started using the Makie native types to avoid conversions.
With this PR, a basic slider example works:

fig = Figure()
level_s = Slider(fig[2, 1], range = 1:n)
# plot level at slider
level_field = map(level_s.value) do n
    ClimaCore.level(T, n)
end
plot(fig[1, 1], level_field, axis=(show_axis=false,))
fig

clima-slider

  • Code follows the style guidelines OR N/A.
  • Unit tests are included OR N/A.
  • Code is exercised in an integration test OR N/A.
  • Documentation has been added/updated OR N/A.

lib/ClimaCoreMakie/examples/file.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/examples/file.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
@SimonDanisch SimonDanisch changed the base branch from main to sb/makie-example September 13, 2022 10:08
lib/ClimaCoreMakie/examples/file.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/examples/file.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/examples/file.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
lib/ClimaCoreMakie/src/ClimaCoreMakie.jl Outdated Show resolved Hide resolved
@SimonDanisch
Copy link
Collaborator Author

Added basic GeoMakie example:
geomakie
GeoMakie still needs MakieOrg/GeoMakie.jl#123 to work with newest versions, and I will need to think about how to more easily support the GeoMakie mesh plot via a nice recipe API...
In principle, we just do what we do in the current recipe, but with a different coordinate transformation, so we could just add it to the existing recipe!

@SimonDanisch
Copy link
Collaborator Author

SimonDanisch commented Sep 23, 2022

Improved the dashboard:
clima-dashbaord

Uncovered this bug while switching between the fields:
MakieOrg/Makie.jl#2297 (comment)
Without that bugfix, switching to vorticity will error, but the rest should still work.

@SimonDanisch
Copy link
Collaborator Author

Updated the dashboard to include a slider for the time series and commented the code a bit:

dashboard-time
(Not sure why the gif has artifacts like that)

@SimonDanisch SimonDanisch changed the base branch from sb/makie-example to main October 11, 2022 15:02
@simonbyrne
Copy link
Member

bors r+

@bors bors bot merged commit c08c71e into main Dec 17, 2022
@bors bors bot deleted the sd/makie-dev branch December 17, 2022 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants