From 46ee1d3ad559fe748a02f60de6685c08df2b0906 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Wed, 14 Feb 2024 19:21:03 +0100 Subject: [PATCH] don't use `used_attributes` for datashader canvas convert --- src/basic_recipes/datashader.jl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/basic_recipes/datashader.jl b/src/basic_recipes/datashader.jl index d9bf42b2244..31408838f8d 100644 --- a/src/basic_recipes/datashader.jl +++ b/src/basic_recipes/datashader.jl @@ -458,20 +458,18 @@ function Makie.plot!(p::DataShader{<:Tuple{Dict{String, Vector{Point{2, Float32} colors = Dict(k => Makie.wong_colors()[i] for (i, (k, v)) in enumerate(categories)) p._categories = colors op = map(total -> (x -> log10(x + 1) / log10(total + 1)), toal_value) - for (k, canvas) in canvases + + for (k, canv) in canvases color = colors[k] cmap = [(color, 0.0), (color, 1.0)] - image!(p, canvas; colorrange=Vec2f(0, 1), colormap=cmap, operation=identity, local_operation=op) + image!(p, canv, identity, op; colorrange=Vec2f(0, 1), colormap=cmap) end return p end data_limits(p::DataShader) = p._boundingbox[] -used_attributes(::Canvas) = (:operation, :local_operation) - -function convert_arguments(P::Type{<:Union{MeshScatter,Image,Surface,Contour,Contour3d}}, canvas::Canvas; - operation=automatic, local_operation=identity) +function convert_arguments(P::Type{<:Union{MeshScatter,Image,Surface,Contour,Contour3d}}, canvas::Canvas, operation=automatic, local_operation=identity) pixel = Aggregation.get_aggregation(canvas; operation=operation, local_operation=local_operation) (xmin, ymin), (xmax, ymax) = extrema(canvas.bounds) return convert_arguments(P, xmin .. xmax, ymin .. ymax, pixel)