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

Use coarse data first to make zooming smooth #47

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

meggart
Copy link
Member

@meggart meggart commented Jul 18, 2024

I played a bit with the plotting script and adapted it so that it falls back to coarser levels when zooming in and the new data is not loaded yet. This results in smoother zooming although this could still be optimised.

Copy link
Member

@felixcremer felixcremer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This introduces some strange flickering on zooming also in the local data. Can we somehow restrict this to the cloud data or get rid of the flickering.

@@ -128,6 +128,11 @@ function Base.map(f, A::Pyramid)
Pyramid(newbase, newlevels, DD.metadata(A)) # This should handle metadata better.
end

function DiskArrays.cache(p::Pyramid; maxsize=1000)
maxsize = maxsize ÷ (length(p.levels) + 1)
Pyramid(DiskArrays.cache(p.base; maxsize), DiskArrays.cache.(p.levels; maxsize), p.metadata)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to use the setter functions here instead of the access to the fields of the struct. So it should be parent(p) instead of p.base and DD.metadata(p) instead of p.metadata.

#First load overview
overview1 = min(n_agg + 4, nlevels(pyramid))
data = levels(pyramid)[overview1][ext]
odata = Observable{Any}(data)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this an Observable{Any} should we restrict this to AbstractDimArray?

@felixcremer
Copy link
Member

felixcremer commented Jul 29, 2024

I also get this strange behaviour at some zoom steps. This is way faster on the screen than on the screencast.
Screencast from 29.07.2024 14:35:26.webm

It seems as if we can hit some update loops.

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