Skip to content

Commit

Permalink
feat: Add volume support
Browse files Browse the repository at this point in the history
  • Loading branch information
Beforerr committed Oct 15, 2024
1 parent 2cb1a14 commit e4ea065
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/aesthetics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,15 @@ function aesthetic_mapping(::Type{Heatmap}, ::Normal, ::Normal, ::Normal)
])
end

function aesthetic_mapping(::Type{Volume}, ::Normal, ::Normal, ::Normal, ::Normal)
dictionary([

Check warning on line 230 in src/aesthetics.jl

View check run for this annotation

Codecov / codecov/patch

src/aesthetics.jl#L229-L230

Added lines #L229 - L230 were not covered by tests
1 => AesX,
2 => AesY,
3 => AesZ,
4 => AesVolumeColor, # set to AesColor would not work
])
end

function aesthetic_mapping(::Type{LinesFill}, ::Normal, ::Normal)
dictionary([
1 => AesX,
Expand Down
2 changes: 1 addition & 1 deletion src/algebra/layers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ function full_rescale(data, aes::Type{AesMarkerSize}, scale::ContinuousScale)
values_to_markersizes(data, props.sizerange, scale.extrema)
end

full_rescale(data, aes::Type{<:Union{AesContourColor,AesABIntercept,AesABSlope}}, scale::ContinuousScale) = data # passthrough, this aes is a mock one anyway
full_rescale(data, aes::Type{<:Union{AesContourColor,AesABIntercept,AesABSlope,AesVolumeColor}}, scale::ContinuousScale) = data # passthrough, this aes is a mock one anyway

function values_to_markersizes(data, sizerange, extrema)
# we scale the area linearly with the values
Expand Down
1 change: 1 addition & 0 deletions src/scales.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ struct AesText <: Aesthetic end
# maybe aesthetics that completely avoid scales
struct AesViolinSide <: Aesthetic end
struct AesContourColor <: Aesthetic end # this is just so the third contour argument doesn't conflict with other things for now, it's complex to handle in its interplay with `color` and `levels`
struct AesVolumeColor <: Aesthetic end # this is the fourth argument of volume
struct AesPlaceholder <: Aesthetic end # choropleth for example takes as first arg only geometries which avoid scales, but for now we still have to give an aes to 1, so this can serve for that purpose
struct AesABIntercept <: Aesthetic end
struct AesABSlope <: Aesthetic end
Expand Down

0 comments on commit e4ea065

Please sign in to comment.