Skip to content

Commit 117526d

Browse files
committed
update to Makie 0.23
1 parent eb70fef commit 117526d

File tree

3 files changed

+27
-15
lines changed

3 files changed

+27
-15
lines changed

Project.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GridVisualize"
22
uuid = "5eed8a63-0fb0-45eb-886d-8d5a387d12b8"
33
authors = ["Juergen Fuhrmann <[email protected]>", "Patrick Jaap <[email protected]>"]
4-
version = "1.12.0"
4+
version = "1.13.0"
55

66
[deps]
77
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
@@ -30,13 +30,13 @@ WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008"
3030

3131

3232
[compat]
33-
CairoMakie = "0.11.3, 0.12, 0.13"
33+
CairoMakie = "0.11.3, 0.12, 0.13, 0.14, 0.15"
3434
ColorSchemes = "3"
3535
Colors = "0.12,0.13,1"
3636
DocStringExtensions = "0.8,0.9"
3737
ElasticArrays = "1"
3838
ExtendableGrids = "1.10"
39-
GLMakie = "0.9, 0.10, 0.11"
39+
GLMakie = "0.9, 0.10, 0.11, 0.12, 0.13"
4040
GeometryBasics = "0.4.1, 0.5"
4141
GridVisualizeTools = "3"
4242
HypertextLiteral = "0.9"
@@ -50,7 +50,7 @@ PlutoVista = "0.8.24,1"
5050
Printf = "1.6"
5151
PyPlot = "2"
5252
StaticArrays = "1"
53-
WGLMakie = "0.10, 0.11"
53+
WGLMakie = "0.10, 0.11, 0.12, 0.13"
5454
julia = "1.9"
5555

5656
[extras]

examples/plotting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ end
184184
# Stream plots are currently only available with PyPlot and Makie
185185
function plotting_stream2d(; Plotter = default_plotter(), n = 50, kwargs...)
186186
g, f = vec2d(; n = n)
187-
return GridVisualize.streamplot(g, f; Plotter = Plotter, rasterpoints = 100, kwargs...)
187+
return GridVisualize.streamplot(g, f; Plotter = Plotter, rasterpoints = 20, kwargs...)
188188
end
189189
# ![](plotting_stream2d.png)
190190

src/makie.jl

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -850,16 +850,28 @@ function vectorplot!(ctx, TP::Type{MakieType}, ::Type{Val{2}}, grid, func)
850850
)
851851
add_scene!(ctx, ctx[:scene])
852852
end
853-
854-
ctx[:arrowplot] = XMakie.arrows!(
855-
ctx[:scene],
856-
map(data -> data.qc[1, :], ctx[:arrowdata]),
857-
map(data -> data.qc[2, :], ctx[:arrowdata]),
858-
map(data -> data.qv[1, :], ctx[:arrowdata]),
859-
map(data -> data.qv[2, :], ctx[:arrowdata]);
860-
color = :black,
861-
linewidth = ctx[:linewidth],
862-
)
853+
if isdefined(XMakie, :arrows2d!) # Makie >=0.23
854+
ctx[:arrowplot] = XMakie.arrows2d!(
855+
ctx[:scene],
856+
map(data -> data.qc[1, :], ctx[:arrowdata]),
857+
map(data -> data.qc[2, :], ctx[:arrowdata]),
858+
map(data -> data.qv[1, :], ctx[:arrowdata]),
859+
map(data -> data.qv[2, :], ctx[:arrowdata]);
860+
color = :black,
861+
shaftwidth = ctx[:linewidth],
862+
tipwidth = 3 * ctx[:linewidth],
863+
)
864+
else
865+
ctx[:arrowplot] = XMakie.arrows!(
866+
ctx[:scene],
867+
map(data -> data.qc[1, :], ctx[:arrowdata]),
868+
map(data -> data.qc[2, :], ctx[:arrowdata]),
869+
map(data -> data.qv[1, :], ctx[:arrowdata]),
870+
map(data -> data.qv[2, :], ctx[:arrowdata]);
871+
color = :black,
872+
linewidth = ctx[:linewidth],
873+
)
874+
end
863875
XMakie.reset_limits!(ctx[:scene])
864876
end
865877
return reveal(ctx, TP)

0 commit comments

Comments
 (0)