Skip to content

Commit

Permalink
Merge branch 'main' into warp_fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaqz authored Dec 10, 2023
2 parents d0debfe + f5f3cfd commit e38bc31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Flatten = "0.4"
GeoFormatTypes = "0.4"
GeoInterface = "1"
HDF5 = "0.14, 0.15, 0.16"
Makie = "0.19, 0.20"
Missings = "0.4, 1"
NCDatasets = "0.10, 0.11, 0.12, 0.13"
OffsetArrays = "1"
Expand Down
7 changes: 4 additions & 3 deletions ext/RastersMakieExt/plotrecipes.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

const HIDE_DEC = (; label=true, grid=false, minorgrid=false, minorticks=false)

const SurfaceLikeCompat = isdefined(Makie, :SurfaceLike) ? Makie.SurfaceLike : Union{Makie.VertexGrid,Makie.CellGrid,Makie.ImageLike}

function Rasters.style_rasters()
Makie.Attributes(
Axis=(
Expand Down Expand Up @@ -33,7 +35,6 @@ lift_layer(s::RasterSeries, inds...) = getindex(s, inds...)

# The all-inclusive plotting function for a 2D raster
function Rasters.rplot(position::GridPosition, raster::Union{AbstractRaster{T,2,<:Tuple{D1,D2}},Observable{<:AbstractRaster{T,2,<:Tuple{D1,D2}}}};
plottype=Makie.Heatmap,
axistype=Makie.Axis,
X=XDim, Y=YDim, Z=ZDim,
draw_colorbar=true,
Expand Down Expand Up @@ -91,7 +92,7 @@ function Rasters.rplot(position::GridPosition, raster::Union{AbstractRaster{T,2,
title, xlabel, ylabel
)
# plot to the axis with the specified plot type
plot = plot!(plottype, axis, raster; colormap, colorrange, nan_color)
plot = heatmap!(axis, raster; colormap, colorrange, nan_color)

if draw_colorbar
layout = position.layout[position.span.rows, position.span.cols, colorbar_position]
Expand Down Expand Up @@ -293,7 +294,7 @@ end
function Makie.convert_arguments(t::Makie.PointBased, A::AbstractRaster{<:Number,2})
return Makie.convert_arguments(t, _prepare_dimarray(A))
end
function Makie.convert_arguments(t::Makie.SurfaceLike, A::AbstractRaster{<:Any,2})
function Makie.convert_arguments(t::SurfaceLikeCompat, A::AbstractRaster{<:Any,2})
return Makie.convert_arguments(t, _prepare_dimarray(A))
end
function Makie.convert_arguments(t::Makie.DiscreteSurface, A::AbstractRaster{<:Any,2})
Expand Down
1 change: 0 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ if VERSION >= v"1.9.0"
@time @safetestset "extensions" begin include("extensions.jl") end
end


@time @safetestset "methods" begin include("methods.jl") end
@time @safetestset "array" begin include("array.jl") end
@time @safetestset "stack" begin include("stack.jl") end
Expand Down

0 comments on commit e38bc31

Please sign in to comment.