Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonDanisch authored May 14, 2024
2 parents c8f2cae + 0516496 commit e6b015e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/conversions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ function convert_arguments(T::Type{<:AbstractPlot}, args...; kw...)
# Meaning, it needs to be a conversion trait, or it needs single_convert_arguments or expand_dimensions
CT = conversion_trait(T, args...)

# Try to expand dimensions first, as this is the most basic step!
expanded = expand_dimensions(CT, args...)
!isnothing(expanded) && return convert_arguments(T, expanded...; kw...)
# Try single argument convert after
arguments_converted = map(convert_single_argument, args)
if arguments_converted !== args
Expand Down
6 changes: 6 additions & 0 deletions test/convert_arguments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ end
@test_throws ArgumentError heatmap(1im)
end

# custom vector type to ensure that the conversion can be overriden for vectors
struct MyConvVector <: AbstractVector{Float64} end
Makie.convert_arguments(::PointBased, ::MyConvVector) = ([Point(10, 20)],)

@testset "convert_arguments" begin
#=
TODO:
Expand Down Expand Up @@ -227,6 +231,8 @@ end

@test apply_conversion(CT, m2) isa Tuple{Vector{Point2{T_out}}}
@test apply_conversion(CT, m3) isa Tuple{Vector{Point3{T_out}}}

@test apply_conversion(CT, MyConvVector()) == ([Point(10, 20)],)
end
end

Expand Down

0 comments on commit e6b015e

Please sign in to comment.