Skip to content

Commit

Permalink
Merge pull request #37 from JuliaGameTheoreticPlanning/feature/makie021
Browse files Browse the repository at this point in the history
Support Makie 0.21
  • Loading branch information
lassepe authored Jun 16, 2024
2 parents 84ecfcb + 2fd6237 commit f90e9c7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"

[extensions]
MakieVizExt = "Makie"
MakieExt = "Makie"

[compat]
BlockArrays = "0.16"
Colors = "0.12"
GeometryBasics = "0.4.2"
InfiniteArrays = "0.12, 0.13"
LazySets = "1.54, 2"
Makie = "0.17, 0.18, 0.19, 0.20"
Makie = "0.17, 0.18, 0.19, 0.20, 0.21"
Polyhedra = "0.7"
julia = "1.7"

Expand Down
7 changes: 5 additions & 2 deletions ext/MakieVizExt.jl → ext/MakieExt.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
module MakieVizExt
module MakieExt
using TrajectoryGamesBase: TrajectoryGamesBase
using Makie: Makie, @recipe
using Colors: @colorant_str
using GeometryBasics: GeometryBasics

Makie.plottype(::TrajectoryGamesBase.PolygonEnvironment) = Makie.Poly

function Makie.convert_arguments(::Type{<:Makie.Poly}, environment)
function Makie.convert_arguments(
::Type{<:Makie.Poly},
environment::TrajectoryGamesBase.PolygonEnvironment,
)
geometry = GeometryBasics.Polygon(GeometryBasics.Point{2}.(environment.set.vertices))
(geometry,)
end
Expand Down
2 changes: 1 addition & 1 deletion src/TrajectoryGamesBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export to_blockvector,
unflatten_trajectory

if !isdefined(Base, :get_extension)
include("../ext/MakieVizExt.jl")
include("../ext/MakieExt.jl")
end

end

0 comments on commit f90e9c7

Please sign in to comment.