-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
use Makie 0.21 #12
use Makie 0.21 #12
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "MakieDraw" | ||
uuid = "8315f7d3-d5d2-4d16-bebe-3aa4ef51e4f8" | ||
authors = ["Rafael Schouten <[email protected]>"] | ||
version = "0.2.1" | ||
version = "0.2.2" | ||
|
||
[deps] | ||
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" | ||
|
@@ -10,7 +10,7 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" | |
|
||
[compat] | ||
GeometryBasics = "0.4" | ||
Makie = "0.20" | ||
Makie = "0.21" | ||
Tables = "1" | ||
julia = "1.6" | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,16 +163,17 @@ function GeometryCanvas{T}(obj=Observable(_geomtype(T)[]); | |
draw!(figure, axis, canvas; | ||
scatter_kw, lines_kw, poly_kw, current_point_kw, show_current_point | ||
) | ||
addtoswitchers!(canvas) | ||
add_events!(canvas; mouse_property) | ||
return canvas | ||
end | ||
|
||
_current_point_obs(::Type{<:Point}) = Observable(1) | ||
_current_point_obs(::Type) = Observable((1, 1)) | ||
|
||
_geomtype(T) = T | ||
_geomtype(::Type{<:Point}) = Point2f | ||
_geomtype(T::Type) = T | ||
_geomtype(::Type{LineString}) = LineString{2,Float64,Point{2,Float64}} | ||
_geomtype(::Type{Polygon}) = Polygon{2,Float64,Point{2,Float64}} | ||
_geomtype(::Type{<:Point}) = Point2{Float64} | ||
|
||
function _initialise_properties(figure, properties, propertynames, current_point, input_layout, text_input) | ||
properties = if isnothing(properties) && propertynames isa Tuple | ||
|
@@ -328,6 +329,7 @@ function draw!(fig, ax::Axis, c::GeometryCanvas{<:LineString}; | |
scatter_kw=(;), lines_kw=(;), poly_kw=(;), current_point_kw=(;), | ||
show_current_point=false, | ||
) | ||
@show typeof(c.geoms) | ||
l = if isnothing(c.color) | ||
lines!(ax, c.geoms; lines_kw...) | ||
else | ||
|
@@ -365,9 +367,9 @@ function draw!(fig, ax::Axis, c::GeometryCanvas{<:Polygon}; | |
# This will need all new polygons to be a line stored in a separate Observable | ||
# that we plot like LineString. | ||
p = if isnothing(c.color) | ||
mesh!(ax, c.geoms) | ||
poly!(ax, c.geoms) | ||
else | ||
mesh!(ax, c.geoms; color=c.color, poly_kw...) | ||
poly!(ax, c.geoms; color=c.color, poly_kw...) | ||
end | ||
translate!(p, 0, 0, 98) | ||
draw_points!(fig, ax, c; scatter_kw) | ||
|
@@ -425,7 +427,7 @@ function add_events!(c::GeometryCanvas{<:Point}; | |
|
||
|
||
# Mouse down event | ||
on(events(ax.scene).mousebutton, priority=100) do event | ||
on(events(ax.scene).mousebutton, priority=-100) do event | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does this fix the issue you posted about? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It might create other issues though... like you wont be able to draw over Tyler.jl maps There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was hoping that popups were somehow separate from this system - because they are style as being above any other layer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's just a plot then no...and it looks like you are using Consume(true) in places as well so it shouldn't be an issue there. Why would Tyler be a problem here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like shouldn't popups have a priority of How can MakieDraw layers be always above the other layers but below There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Menu has a priority of 65 ^^ so I guess it needs to below that? And all others should have 1 as a default... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh good maybe MakieDraw can be 50 then rather than 100 |
||
# If this canvas is not active dont respond to mouse events | ||
(; geoms, points, dragging, active, section) = c | ||
active[] || return Consume(false) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be breaking? It will cause a lot of workflows using eg CanvasSelect to fail...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I bumped the version before I broke everything