-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
I also get this strange behaviour at some zoom steps. This is way faster on the screen than on the screencast. It seems as if we can hit some update loops. |
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.