Time slider escapes time bounds in "single larva view"
On selecting a larva in the 2D view, the view zooms in the selected larva and this larva only is drawn. The larva's track is defined on a time segment and e.g. animating the larva (Play) stops on reaching a time segment end.
In principle, the time slider should also be bounded in this mode. However, it is not.
On moving the time slider beyond a time bound, warning messages are printed in the interpreter:
┌ Warning: error in websocket handler!
└ @ JSServe ~/.julia/packages/JSServe/kIK9q/src/http.jl:84
BoundsError: attempt to access 963-element Vector{Tuple{Float64, NamedTuple{(:spine, :outline, :tags), Tuple{Meshes.Chain{2, Float64, Vector{Meshes.Point2}}, Meshes.PolyArea{2, Float64, Meshes.Chain{2, Float64, Vector{Meshes.Point2}}}, PlanarLarvae.LarvaBase.BehaviorTags}}}} at index [1303]
Stacktrace:
[1] getindex(A::Vector{Tuple{Float64, NamedTuple{(:spine, :outline, :tags), Tuple{Meshes.Chain{2, Float64, Vector{Meshes.Point2}}, Meshes.PolyArea{2, Float64, Meshes.Chain{2, Float64, Vector{Meshes.Point2}}}, PlanarLarvae.LarvaBase.BehaviorTags}}}}, i1::Int64)
@ Base ./array.jl:861
[2] getusertags(larva::LarvaTagger.LarvaModel, timestep::Int64; lut::Observables.Observable{Vector{LarvaTagger.ObservableTag}})
@ LarvaTagger ~/Projects/Nyx/LarvaTagger/src/models.jl:115
[3] refresh_selected_tag(controller::LarvaTagger.TagController, id::Int16, timestep::Int64, taglut::Observables.Observable{Vector{LarvaTagger.ObservableTag}}, selectedtags::Observables.Observable{Vector{Tuple{String, Observables.Observable{Bool}}}}, selectable::Bool)
@ LarvaTagger ~/Projects/Nyx/LarvaTagger/src/wgl.jl:794
[4] (::LarvaTagger.var"#244#254"{LarvaTagger.TagController, Bool, Observables.Observable{Vector{Tuple{String, Observables.Observable{Bool}}}}, Observables.Observable{Vector{LarvaTagger.ObservableTag}}})(timestep::Int64, id::Int16, #unused#::Bool, #unused#::Vector{LarvaTagger.ObservableTag}, multitag::Bool)
@ LarvaTagger ~/Projects/Nyx/LarvaTagger/src/wgl.jl:760
...
[16] commit!(obs::ObservationPolicies.CliqueObservable{Int64})
@ ObservationPolicies ~/.julia/packages/ObservationPolicies/nzz7S/src/ObservationPolicies.jl:91
[17] commit!(clique::ObservationPolicies.Cooldown)
@ ObservationPolicies ~/.julia/packages/ObservationPolicies/nzz7S/src/ObservationPolicies.jl:115
[18] async_update!
@ ~/.julia/packages/ObservationPolicies/nzz7S/src/ObservationPolicies.jl:136 [inlined]
[19] (::ObservationPolicies.var"#34#37"{ObservationPolicies.Cooldown})(#unused#::Int64)
@ ObservationPolicies ~/.julia/packages/ObservationPolicies/nzz7S/src/ObservationPolicies.jl:387
...
This usually does not break LarvaTagger.jl, but it seems in very few occasions it does.