Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ PyramidSchemeMakieExt = "Makie"
[compat]
Aqua = "0.8"
ArchGDAL = "0.10.4"
CairoMakie = "0.13, 0.14, 0.15"
Colors = "0.12, 0.13"
DimensionalData = "0.28, 0.29, 0.30"
DiskArrayEngine = "0.1.2, 0.2, 0.3"
Expand All @@ -49,7 +48,7 @@ Test = "1.10"
TestItemRunner = "1"
YAXArrayBase = "0.6.1, 0.7"
YAXArrays = "0.5.6, 0.6, 0.7"
Zarr = "0.9.3"
Zarr = "0.9.3, 0.10"
julia = "1.11"

[extras]
Expand Down
9 changes: 5 additions & 4 deletions ext/PyramidSchemeMakieExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ function Makie.plot!(plot::Heatmap{<: Tuple{<: Pyramid}})
=#
inputpositions = [Point2f(0, 0), Point2f(1, 1)]
add_input!(plot.attributes, :__pyramid_input_positions, inputpositions)
Makie.register_positions_projected!(
Makie.register_projected_positions!(
plot; input_space = :relative, output_space = :space,
input_name = :__pyramid_input_positions,
output_name = :__pyramid_dataspace_positions,
)
Makie.register_positions_projected!(
Makie.register_projected_positions!(
plot; input_space = :relative, output_space = :pixel,
input_name = :__pyramid_input_positions,
output_name = :__pyramid_pixelspace_positions,
Expand All @@ -89,20 +89,21 @@ function Makie.plot!(plot::Heatmap{<: Tuple{<: Pyramid}})
pixel_widths = Point2f(abs.(pixelpos[2] .- pixelpos[1]))

datalimit = switchkeys(data_limits_ext, pyramid_ext)

if intersects(pyramid_data_ext, data_limits_ext)
# This rebuild is necessary because YAXArray broadcast makes the data a DiskArrayEngine type
# This happens also for in-memory arrays see YAXArray issue #579
intersectdata = selectlevel(pyramid, datalimit, target_imsize = pixel_widths)
intersectdata = DD.rebuild(intersectdata, data=miss2nan.(intersectdata.data))
any(iszero, size(intersectdata)) && return nothing
return (Ref{DD.AbstractDimMatrix}(intersectdata),)
else
return nothing # nothing changed so the downstream computation is not marked dirty
end
end
zoomheat = heatmap!(plot, plot.attributes, plot.__pyramid_data)
add_input!(plot.attributes, :__pyramid_heatmap, zoomheat)
zoomheat
plot
end

function Makie.data_limits(p::Heatmap{<: Tuple{<: Pyramid}})
Expand Down
Loading