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

implements #16

parent f0da1f0d
No related branches found
No related tags found
No related merge requests found
...@@ -127,8 +127,8 @@ struct AssayPlot ...@@ -127,8 +127,8 @@ struct AssayPlot
homebutton::HomeButton homebutton::HomeButton
end end
function AssayPlot(ctrl, larvae::DecoratedLarvae) function AssayPlot(ctrl, larvae::DecoratedLarvae; size=(1000, 750))
fig = Figure() fig = Figure(resolution=size)
ax = Axis(fig.layout[1, 1], aspect=DataAspect()) ax = Axis(fig.layout[1, 1], aspect=DataAspect())
larvaplot!(ax, larvae) larvaplot!(ax, larvae)
setbounds!(ax, ctrl, larvae) setbounds!(ax, ctrl, larvae)
...@@ -139,21 +139,22 @@ function AssayPlot(ctrl, larvae::DecoratedLarvae) ...@@ -139,21 +139,22 @@ function AssayPlot(ctrl, larvae::DecoratedLarvae)
AssayPlot(ctrl, fig, ax, larvae, button) AssayPlot(ctrl, fig, ax, larvae, button)
end end
function AssayPlot(ctrl, larvae::Vector{LarvaModel}) function AssayPlot(ctrl, larvae::Vector{LarvaModel}; kwargs...)
sample = downsampler() sample = downsampler()
plot = AssayPlot(ctrl, plot = AssayPlot(ctrl,
DecoratedLarvae(sample.(larvae), DecoratedLarvae(sample.(larvae),
gettags(ctrl), gettags(ctrl),
gettimestep(ctrl))) gettimestep(ctrl));
kwargs...)
return plot return plot
end end
function AssayPlot(ctrl, larvae::Dict{LarvaID, LarvaModel}, args...) function AssayPlot(ctrl, larvae::Dict{LarvaID, LarvaModel}, args...; kwargs...)
AssayPlot(ctrl, collect(values(larvae)), args...) AssayPlot(ctrl, collect(values(larvae)), args...; kwargs...)
end end
function assayplot(data, ctrl) function assayplot(data, ctrl; kwargs...)
plot = AssayPlot(ctrl, data) plot = AssayPlot(ctrl, data; kwargs...)
setmouseevents!(plot; consume=true) setmouseevents!(plot; consume=true)
return plot return plot
end end
...@@ -178,9 +179,9 @@ struct TrackPlot ...@@ -178,9 +179,9 @@ struct TrackPlot
homebutton::HomeButton homebutton::HomeButton
end end
function TrackPlot(controller, larvae::Vector{LarvaModel}) function TrackPlot(controller, larvae::Vector{LarvaModel}; size=(1000, 750))
view = SingleLarvaView(larvae, controller) view = SingleLarvaView(larvae, controller)
fig = Figure() fig = Figure(resolution=size)
ax = Axis(fig.layout[1, 1], aspect=DataAspect()) ax = Axis(fig.layout[1, 1], aspect=DataAspect())
larvaplot!(ax, view) larvaplot!(ax, view)
setbounds!(ax, controller, larvae) setbounds!(ax, controller, larvae)
...@@ -201,9 +202,9 @@ function TrackPlot(controller, larvae::Vector{LarvaModel}) ...@@ -201,9 +202,9 @@ function TrackPlot(controller, larvae::Vector{LarvaModel})
TrackPlot(controller, fig, ax, larvae, view, button) TrackPlot(controller, fig, ax, larvae, view, button)
end end
TrackPlot(ctrl, model::Dict{<:Integer, LarvaModel}, args...) = TrackPlot(ctrl, collect(values(model)), args...) TrackPlot(ctrl, model::Dict{<:Integer, LarvaModel}, args...; kwargs...) = TrackPlot(ctrl, collect(values(model)), args...; kwargs...)
trackplot(model, controller) = TrackPlot(controller, model) trackplot(model, controller; kwargs...) = TrackPlot(controller, model; kwargs...)
function JSServe.jsrender(session::Session, p::TrackPlot) function JSServe.jsrender(session::Session, p::TrackPlot)
r(session, r(session,
......
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