Skip to content

Commit eb2747c

Browse files
authored
use package extensions for Makie dep (#22)
1 parent b1f2a25 commit eb2747c

4 files changed

Lines changed: 41 additions & 73 deletions

File tree

Project.toml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ version = "0.2.3"
66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
88
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
9-
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
109
ImageIO = "82e4d734-157c-48bb-816b-45c225c6df19"
1110
ImageShow = "4e3cecfd-b093-5904-9786-8bbb286a6a31"
1211
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
13-
MakieCore = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
1412
OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
1513
Transducers = "28d57a85-8fef-5791-bfe6-a80928e7c999"
1614

@@ -21,7 +19,14 @@ GeometryBasics = "0.4"
2119
ImageIO = "0.6"
2220
ImageShow = "0.3"
2321
KernelAbstractions = "0.9"
24-
MakieCore = "0.8"
22+
Makie = "0.21"
2523
OffsetArrays = "1"
2624
Transducers = "0.4"
27-
julia = "1.8"
25+
julia = "1.9"
26+
27+
[extensions]
28+
MakieExtension = ["Makie", "GeometryBasics"]
29+
30+
[weakdeps]
31+
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
32+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"

docs/Manifest.toml

Lines changed: 13 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,17 @@ uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
7474
version = "0.4.7"
7575

7676
[[deps.AztecDiamonds]]
77-
deps = ["Adapt", "Colors", "GeometryBasics", "ImageIO", "ImageShow", "KernelAbstractions", "MakieCore", "OffsetArrays", "Transducers"]
77+
deps = ["Adapt", "Colors", "ImageIO", "ImageShow", "KernelAbstractions", "OffsetArrays", "Transducers"]
7878
path = ".."
7979
uuid = "8762d9c5-fcab-4007-8fd1-c6de73397726"
80-
version = "0.2.0"
80+
version = "0.2.3"
81+
82+
[deps.AztecDiamonds.extensions]
83+
MakieExtension = ["Makie", "GeometryBasics"]
84+
85+
[deps.AztecDiamonds.weakdeps]
86+
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
87+
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
8188

8289
[[deps.BangBang]]
8390
deps = ["Accessors", "ConstructionBase", "InitialValues", "LinearAlgebra", "Requires"]
@@ -231,23 +238,12 @@ deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"]
231238
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
232239
version = "1.6.0"
233240

234-
[[deps.EarCut_jll]]
235-
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
236-
git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053"
237-
uuid = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"
238-
version = "2.2.4+0"
239-
240241
[[deps.Expat_jll]]
241242
deps = ["Artifacts", "JLLWrappers", "Libdl"]
242243
git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7"
243244
uuid = "2e619515-83b5-522b-bb60-26c02a35a201"
244245
version = "2.6.2+0"
245246

246-
[[deps.Extents]]
247-
git-tree-sha1 = "81023caa0021a41712685887db1fc03db26f41f5"
248-
uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910"
249-
version = "0.1.4"
250-
251247
[[deps.FileIO]]
252248
deps = ["Pkg", "Requires", "UUIDs"]
253249
git-tree-sha1 = "82d8afa92ecf4b52d78d869f038ebfb881267322"
@@ -267,23 +263,6 @@ version = "0.8.5"
267263
deps = ["Random"]
268264
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
269265

270-
[[deps.GeoFormatTypes]]
271-
git-tree-sha1 = "59107c179a586f0fe667024c5eb7033e81333271"
272-
uuid = "68eda718-8dee-11e9-39e7-89f7f65f511f"
273-
version = "0.4.2"
274-
275-
[[deps.GeoInterface]]
276-
deps = ["Extents", "GeoFormatTypes"]
277-
git-tree-sha1 = "5921fc0704e40c024571eca551800c699f86ceb4"
278-
uuid = "cf35fbd7-0cd7-5166-be24-54bfbe79505f"
279-
version = "1.3.6"
280-
281-
[[deps.GeometryBasics]]
282-
deps = ["EarCut_jll", "Extents", "GeoInterface", "IterTools", "LinearAlgebra", "StaticArrays", "StructArrays", "Tables"]
283-
git-tree-sha1 = "b62f2b2d76cee0d61a2ef2b3118cd2a3215d3134"
284-
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
285-
version = "0.4.11"
286-
287266
[[deps.Git]]
288267
deps = ["Git_jll"]
289268
git-tree-sha1 = "04eff47b1354d702c3a85e8ab23d539bb7d5957e"
@@ -424,9 +403,9 @@ version = "3.0.3+0"
424403

425404
[[deps.KernelAbstractions]]
426405
deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"]
427-
git-tree-sha1 = "045d41a364a81e357757c566b5a69fd4a2a2c445"
406+
git-tree-sha1 = "5126765c5847f74758c411c994312052eb7117ef"
428407
uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
429-
version = "0.9.26"
408+
version = "0.9.27"
430409

431410
[deps.KernelAbstractions.extensions]
432411
EnzymeExt = "EnzymeCore"
@@ -516,12 +495,6 @@ git-tree-sha1 = "2fa9ee3e63fd3a4f7a9a4f4744a52f4856de82df"
516495
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
517496
version = "0.5.13"
518497

519-
[[deps.MakieCore]]
520-
deps = ["ColorTypes", "GeometryBasics", "IntervalSets", "Observables"]
521-
git-tree-sha1 = "22fed09860ca73537a36d4e5a9bce0d9e80ee8a8"
522-
uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b"
523-
version = "0.8.8"
524-
525498
[[deps.MappedArrays]]
526499
git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e"
527500
uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900"
@@ -571,11 +544,6 @@ version = "1.1.1"
571544
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
572545
version = "1.2.0"
573546

574-
[[deps.Observables]]
575-
git-tree-sha1 = "7438a59546cf62428fc9d1bc94729146d37a7225"
576-
uuid = "510215fc-4207-5dde-b226-833fc4488ee2"
577-
version = "0.5.5"
578-
579547
[[deps.OffsetArrays]]
580548
git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e"
581549
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
@@ -604,9 +572,9 @@ version = "3.2.4+0"
604572

605573
[[deps.OpenSSL_jll]]
606574
deps = ["Artifacts", "JLLWrappers", "Libdl"]
607-
git-tree-sha1 = "1b35263570443fdd9e76c76b7062116e2f374ab8"
575+
git-tree-sha1 = "7493f61f55a6cce7325f197443aa80d32554ba10"
608576
uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95"
609-
version = "3.0.15+0"
577+
version = "3.0.15+1"
610578

611579
[[deps.OrderedCollections]]
612580
git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5"
@@ -780,24 +748,6 @@ deps = ["LinearAlgebra", "SparseArrays"]
780748
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
781749
version = "1.10.0"
782750

783-
[[deps.StructArrays]]
784-
deps = ["ConstructionBase", "DataAPI", "Tables"]
785-
git-tree-sha1 = "f4dc295e983502292c4c3f951dbb4e985e35b3be"
786-
uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
787-
version = "0.6.18"
788-
789-
[deps.StructArrays.extensions]
790-
StructArraysAdaptExt = "Adapt"
791-
StructArraysGPUArraysCoreExt = "GPUArraysCore"
792-
StructArraysSparseArraysExt = "SparseArrays"
793-
StructArraysStaticArraysExt = "StaticArrays"
794-
795-
[deps.StructArrays.weakdeps]
796-
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
797-
GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
798-
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
799-
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
800-
801751
[[deps.SuiteSparse_jll]]
802752
deps = ["Artifacts", "Libdl", "libblastrampoline_jll"]
803753
uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c"

src/makie.jl renamed to ext/MakieExtension.jl

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
using MakieCore
1+
module MakieExtension
2+
3+
using Makie
24
using GeometryBasics: Vec2f, Point2f, Rect2f
5+
using Colors
6+
using Adapt: adapt
7+
8+
using AztecDiamonds: Tiling, faces, UP, RIGHT
9+
import AztecDiamonds: tilingplot, tilingplot!
310

411
function prepare_plot(t::Tiling; pad = 0.1f0)
512
tiles = Rect2f[]
@@ -27,20 +34,22 @@ function prepare_plot(t::Tiling; pad = 0.1f0)
2734
return tiles, colors, arrow_pts, arrows
2835
end
2936

30-
MakieCore.@recipe(TilingPlot, t) do scene
31-
MakieCore.Attributes(
37+
@recipe(TilingPlot, t) do scene
38+
Attributes(
3239
show_arrows = false,
3340
domino_padding = 0.1f0,
3441
domino_stroke = 0,
3542
)
3643
end
3744

38-
MakieCore.plottype(::Tiling) = TilingPlot
45+
Makie.plottype(::Tiling) = TilingPlot
3946

40-
function MakieCore.plot!(x::TilingPlot{<:Tuple{Tiling}})
47+
function Makie.plot!(x::TilingPlot{<:Tuple{Tiling}})
4148
t = adapt(Array, x[:t][])
4249
tiles, colors, arrow_pts, arrows = prepare_plot(t; pad = x.domino_padding[])
4350
poly!(x, tiles; color = colors, strokewidth = x.domino_stroke)
4451
x.show_arrows[] && arrows!(x, arrow_pts, arrows)
4552
return x
4653
end
54+
55+
end

src/AztecDiamonds.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ end
153153
include("ka.jl")
154154
include("show.jl")
155155
include("dr_path.jl")
156-
include("makie.jl")
156+
157+
# stubs for plotting functions
158+
159+
function tilingplot end
160+
function tilingplot! end
157161

158162
end

0 commit comments

Comments
 (0)