Skip to content
Snippets Groups Projects
Commit 51cea8b1 authored by François  LAURENT's avatar François LAURENT
Browse files

bugfix for empty labels file + no outline on player focus

parent a5d1b6b3
No related branches found
No related tags found
No related merge requests found
...@@ -172,10 +172,11 @@ function loadfile(path) ...@@ -172,10 +172,11 @@ function loadfile(path)
file = Formats.load(path) file = Formats.load(path)
data = isempty(file.run) ? file.timeseries : file.run data = isempty(file.run) ? file.timeseries : file.run
# tracks # tracks
times = PlanarLarvae.times(data)
if file isa Formats.FIMTrack if file isa Formats.FIMTrack
times = PlanarLarvae.times(data)
tracks = [LarvaModel(track, times) for track in values(getrun(file))] tracks = [LarvaModel(track, times) for track in values(getrun(file))]
else else
times = PlanarLarvae.times(gettimeseries(file))
tracks = [LarvaModel(id, ts, times) for (id, ts) in pairs(gettimeseries(file))] tracks = [LarvaModel(id, ts, times) for (id, ts) in pairs(gettimeseries(file))]
end end
# dataset # dataset
......
...@@ -149,6 +149,9 @@ input[type=text]:disabled { ...@@ -149,6 +149,9 @@ input[type=text]:disabled {
.player button { .player button {
margin-left: 0.25rem; margin-left: 0.25rem;
} }
.player input[type=range]:focus {
outline: none;
}
#tag-selector { #tag-selector {
width: 1000px; width: 1000px;
......
...@@ -212,6 +212,7 @@ struct LarvaModel ...@@ -212,6 +212,7 @@ struct LarvaModel
end end
function LarvaModel(id::LarvaID, timeseries::PlanarLarvae.TimeSeries{<:NamedTuple}, times::Vector{PlanarLarvae.Time}) function LarvaModel(id::LarvaID, timeseries::PlanarLarvae.TimeSeries{<:NamedTuple}, times::Vector{PlanarLarvae.Time})
@assert !isempty(times)
alignedsteps = map(timeseries) do (t, _) alignedsteps = map(timeseries) do (t, _)
findfirst(t′-> abs(t - t′) < TIME_PRECISION, times) findfirst(t′-> abs(t - t′) < TIME_PRECISION, times)
end end
...@@ -221,6 +222,7 @@ function LarvaModel(id::LarvaID, timeseries::PlanarLarvae.TimeSeries{<:NamedTupl ...@@ -221,6 +222,7 @@ function LarvaModel(id::LarvaID, timeseries::PlanarLarvae.TimeSeries{<:NamedTupl
end end
function LarvaModel(track::Track, times::Vector{PlanarLarvae.Time}) function LarvaModel(track::Track, times::Vector{PlanarLarvae.Time})
@assert !isempty(times)
alignedsteps = map(track.timestamps) do t alignedsteps = map(track.timestamps) do t
findfirst(t′-> abs(t - t′) < TIME_PRECISION, times) findfirst(t′-> abs(t - t′) < TIME_PRECISION, times)
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment