Skip to content

Commit

Permalink
tests for apply function in aes
Browse files Browse the repository at this point in the history
  • Loading branch information
rdboyes committed Apr 8, 2024
1 parent 12c1377 commit b688638
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions test/test_aes_ops.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,46 @@

@test plot_images_equal(t, m)
end

@testset "apply function" begin
my_func(x) = x ./ 10
my_aes_func = aesthetics_function(my_func)

t = ggplot(penguins) +
geom_point(aes(x = :bill_length_mm >> my_func, y = :bill_depth_mm))

m = Makie.plot(
Makie.SpecApi.GridLayout(
Makie.SpecApi.Axis(
plots = [
Makie.PlotSpec(
:Scatter,
penguins.bill_length_mm ./ 10,
penguins.bill_depth_mm)
]
)
)
)

@test plot_images_equal(t, m)

t = ggplot(penguins) +
geom_point(aes(x = my_aes_func(:bill_length_mm), y = :bill_depth_mm))

m = Makie.plot(
Makie.SpecApi.GridLayout(
Makie.SpecApi.Axis(
plots = [
Makie.PlotSpec(
:Scatter,
penguins.bill_length_mm ./ 10,
penguins.bill_depth_mm)
]
)
)
)

@test plot_images_equal(t, m)
end

end

0 comments on commit b688638

Please sign in to comment.