Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LarvaTagger.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nyx
LarvaTagger.jl
Commits
cc58a842
Commit
cc58a842
authored
2 years ago
by
François LAURENT
Browse files
Options
Downloads
Patches
Plain Diff
largely improves
#20
parent
045ffe55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#82933
passed
2 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plots.jl
+7
-7
7 additions, 7 deletions
src/plots.jl
with
7 additions
and
7 deletions
src/plots.jl
+
7
−
7
View file @
cc58a842
...
@@ -145,7 +145,7 @@ function SingleLarvaView(larvae::Vector{LarvaModel}, controller; editabletags::B
...
@@ -145,7 +145,7 @@ function SingleLarvaView(larvae::Vector{LarvaModel}, controller; editabletags::B
# TODO: move the callbacks to `plot!`
# TODO: move the callbacks to `plot!`
# callbacks
# callbacks
on
(
async_latest
(
getactivelarva
(
controller
))
)
do
id
on
(
getactivelarva
(
controller
))
do
id
if
isnothing
(
id
)
if
isnothing
(
id
)
visible
[]
=
false
visible
[]
=
false
else
else
...
@@ -184,8 +184,7 @@ function SingleLarvaView(larvae::Vector{LarvaModel}, controller; editabletags::B
...
@@ -184,8 +184,7 @@ function SingleLarvaView(larvae::Vector{LarvaModel}, controller; editabletags::B
)
do
larva
,
timestep
,
tag_lut
,
usertags
)
do
larva
,
timestep
,
tag_lut
,
usertags
first_timestep
=
larva
.
alignedsteps
[
1
]
first_timestep
=
larva
.
alignedsteps
[
1
]
last_timestep
=
larva
.
alignedsteps
[
end
]
last_timestep
=
larva
.
alignedsteps
[
end
]
if
(
first_timestep
<=
timestep
&&
if
(
first_timestep
<=
timestep
<=
last_timestep
&&
timestep
<=
last_timestep
&&
getactivelarva
(
controller
)[]
==
model
[]
.
id
getactivelarva
(
controller
)[]
==
model
[]
.
id
)
)
step
=
timestep
-
first_timestep
+
1
step
=
timestep
-
first_timestep
+
1
...
@@ -514,7 +513,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
...
@@ -514,7 +513,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
@assert
hovering_active
[]
@assert
hovering_active
[]
i
=
current_larva
[]
i
=
current_larva
[]
if
i
==
j
if
i
==
j
@warn
"moving too fast?"
@warn
"moving too fast?
- please file an issue at https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/issues
"
end
end
if
0
<
i
if
0
<
i
i_decorated
=
larvae
[
i
]
.
decorated
i_decorated
=
larvae
[
i
]
.
decorated
...
@@ -523,7 +522,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
...
@@ -523,7 +522,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
else
else
@warn
begin
@warn
begin
i_id
=
larvae
[
i
]
.
larva
.
model
.
id
i_id
=
larvae
[
i
]
.
larva
.
model
.
id
"
l
arva #
$(i_id)
's decorations already removed"
"
L
arva #
$(i_id)
's decorations already removed"
end
end
end
end
end
end
...
@@ -534,7 +533,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
...
@@ -534,7 +533,7 @@ function DecoratedLarvae(larvae::Vector{DecoratedLarva})
else
else
@error
begin
@error
begin
j_id
=
larvae
[
j
]
.
larva
.
model
.
id
j_id
=
larvae
[
j
]
.
larva
.
model
.
id
"cannot decorate invisible larva #
$(j_id)
"
"cannot decorate invisible larva #
$(j_id)
-
please file an issue at https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/issues
"
end
end
hovered_larva
.
val
=
0
hovered_larva
.
val
=
0
end
end
...
@@ -570,6 +569,7 @@ function Makie.plot!(plot::LarvaPlot{Tuple{DecoratedLarvae}})
...
@@ -570,6 +569,7 @@ function Makie.plot!(plot::LarvaPlot{Tuple{DecoratedLarvae}})
if
content
.
hovering_active
[]
if
content
.
hovering_active
[]
#pos = Makie.to_world(scene, Makie.screen_relative(scene, mp))
#pos = Makie.to_world(scene, Makie.screen_relative(scene, mp))
pos
=
mouseposition
(
scene
)
pos
=
mouseposition
(
scene
)
# both `find` and `hovered_larva` return larva indices (not IDs)
larva
=
find
(
content
,
pos
)
larva
=
find
(
content
,
pos
)
if
larva
!=
content
.
hovered_larva
[]
if
larva
!=
content
.
hovered_larva
[]
content
.
hovered_larva
[]
=
larva
content
.
hovered_larva
[]
=
larva
...
@@ -584,7 +584,7 @@ Meshes.boundingbox(larva::DecoratedLarva) = Meshes.boundingbox(larva.larva)
...
@@ -584,7 +584,7 @@ Meshes.boundingbox(larva::DecoratedLarva) = Meshes.boundingbox(larva.larva)
Meshes
.
boundingbox
(
larvae
::
DecoratedLarvae
)
=
Meshes
.
boundingbox
(
map
(
Meshes
.
boundingbox
,
larvae
.
larvae
))
Meshes
.
boundingbox
(
larvae
::
DecoratedLarvae
)
=
Meshes
.
boundingbox
(
map
(
Meshes
.
boundingbox
,
larvae
.
larvae
))
function
setmouseevents!
(
scene
,
plot
::
DecoratedLarvae
,
ctrl
;
consume
=
false
)
function
setmouseevents!
(
scene
,
plot
::
DecoratedLarvae
,
ctrl
;
consume
=
false
)
on
(
async_latest
(
events
(
scene
)
.
mousebutton
)
)
do
mb
on
(
events
(
scene
)
.
mousebutton
)
do
mb
consumed
=
consume
consumed
=
consume
if
mb
.
button
==
Mouse
.
left
&&
mb
.
action
==
Mouse
.
release
if
mb
.
button
==
Mouse
.
left
&&
mb
.
action
==
Mouse
.
release
larva_ix
=
plot
.
hovered_larva
[]
larva_ix
=
plot
.
hovered_larva
[]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment