Skip to content

Commit 5991f97

Browse files
authored
Makie 0.23 compat (#666)
1 parent eabea8d commit 5991f97

File tree

8 files changed

+14
-19
lines changed

8 files changed

+14
-19
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
## v0.11.0 - 2025-06-16
6+
7+
- **Breaking** Added Makie 0.23 compat. As Makie 0.23 split up `Arrows` in `Arrows2D` and `Arrows3D`, `visual(Arrows2D)` needs to be specified explicitly now in AlgebraOfGraphics. As `Arrows2D` plots polygon shapes now and not a mixture of scatters and lines, the categorical `arrowhead` marker aesthetic had to be removed [#666](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/666).
8+
59
## v0.10.8 - 2025-06-06
610

711
- Added support for the Makie's new `Annotation` recipe [#663](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/663).

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "AlgebraOfGraphics"
22
uuid = "cbdf2221-f076-402e-a563-3d30da359d67"
33
authors = ["Pietro Vertechi", "Julius Krumbiegel"]
4-
version = "0.10.8"
4+
version = "0.10.9"
55

66
[deps]
77
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
@@ -50,7 +50,7 @@ GridLayoutBase = "0.6, 0.7, 0.8, 0.9, 0.10, 0.11"
5050
Isoband = "0.1"
5151
KernelDensity = "0.6"
5252
Loess = "0.5.1, 0.6.1"
53-
Makie = "0.22.10"
53+
Makie = "0.23"
5454
NaturalSort = "1"
5555
PlotUtils = "1"
5656
PolygonOps = "0.1.1"

docs/src/examples/scales/custom-scales.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ c=rand(Bool, length(x))
1717
d=rand(Bool, length(x))
1818
df = (; x, y, u, v, c, d)
1919
colors = [colorant"#E24A33", colorant"#348ABD"]
20-
heads = ['◮', '◭']
2120
plt = data(df) *
2221
mapping(:x, :y, :u, :v) *
23-
mapping(arrowhead = :c => nonnumeric) *
2422
mapping(color = :d => nonnumeric) *
25-
visual(Arrows, arrowsize=10, lengthscale=0.4, linewidth = 1)
26-
fg = draw(plt, scales(Marker = (; palette = heads), Color = (; palette = colors)))
23+
visual(Arrows2D, lengthscale=0.4)
24+
fg = draw(plt, scales(Color = (; palette = colors)))
2725
````
2826

2927
To associate specific attribute values to specific data values, use pairs.

src/aesthetics.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,14 +361,13 @@ function aesthetic_mapping(::Type{QQPlot}, ::Normal, ::Normal)
361361
])
362362
end
363363

364-
function aesthetic_mapping(::Type{Arrows}, ::Normal, ::Normal, ::Normal, ::Normal)
364+
function aesthetic_mapping(::Type{Arrows2D}, ::Normal, ::Normal, ::Normal, ::Normal)
365365
dictionary([
366366
1 => AesX,
367367
2 => AesY,
368368
3 => AesDeltaX,
369369
4 => AesDeltaY,
370370
:color => AesColor,
371-
:arrowhead => AesMarker,
372371
])
373372
end
374373

src/guides/legend.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,14 @@ function legend_elements(T::Type{<:Union{Band,VSpan,HSpan}}, attributes, scale_a
461461
)]
462462
end
463463

464-
function legend_elements(T::Type{Arrows}, attributes, scale_args::MixedArguments)
465-
marker = _get(T, scale_args, attributes, :arrowhead)
466-
marker = marker === Makie.automatic ? :utriangle : marker # Makie handles this internally due to the 2d/3d combination. This should probably be fixed in Makie
464+
function legend_elements(T::Type{Arrows2D}, attributes, scale_args::MixedArguments)
467465
[
468466
LineElement(
469467
color = _get(T, scale_args, attributes, :color),
470-
linewidth = _get(T, scale_args, attributes, :linewidth),
471-
linestyle = _get(T, scale_args, attributes, :linestyle),
472468
linepoints = [Point2(0.5, 0), Point2(0.5, 0.75)]
473469
),
474470
MarkerElement(;
475-
marker,
471+
marker = :utriangle, # Makie handles this internally due to the 2d/3d combination. This should probably be fixed in Makie,
476472
color = _get(T, scale_args, attributes, :color),
477473
markerpoints = [Point2(0.5, 0.75)],
478474
),

test/reference_tests.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ reftest("qqplot") do
679679
data((; x = sin.(1:100), y = sin.((1:100) .+ 0.2))) * mapping(:x, :y) * visual(QQPlot, qqline = :identity) |> draw
680680
end
681681

682-
reftest("arrows cat color and marker") do
682+
reftest("arrows cat color") do
683683
x=repeat(1:10, inner=10)
684684
y=repeat(1:10, outer=10)
685685
u=cos.(x)
@@ -688,13 +688,11 @@ reftest("arrows cat color and marker") do
688688
d=round.(Bool, cos.(1:100) .* 0.5 .+ 0.5)
689689
df = (; x, y, u, v, c, d)
690690
colors = [colorant"#E24A33", colorant"#348ABD"]
691-
heads = ['', '']
692691
plt = data(df) *
693692
mapping(:x, :y, :u, :v) *
694-
mapping(arrowhead = :c => nonnumeric) *
695693
mapping(color = :d => nonnumeric) *
696-
visual(Arrows, arrowsize=14, lengthscale=0.4, linewidth = 1)
697-
fg = draw(plt, scales(Marker = (; palette = heads), Color = (; palette = colors)))
694+
visual(Arrows2D, lengthscale=0.4)
695+
fg = draw(plt, scales(Color = (; palette = colors)))
698696
end
699697

700698
reftest("continuous missings") do
Binary file not shown.
22.6 KB
Loading

0 commit comments

Comments
 (0)