diff --git a/src/wgl.jl b/src/wgl.jl index ea16c8c2622ebb22478e9ad425d11447b8fd2b83..8a3d87e0975a355a91efa26ecb3e212916ac9af1 100644 --- a/src/wgl.jl +++ b/src/wgl.jl @@ -127,8 +127,8 @@ struct AssayPlot homebutton::HomeButton end -function AssayPlot(ctrl, larvae::DecoratedLarvae) - fig = Figure() +function AssayPlot(ctrl, larvae::DecoratedLarvae; size=(1000, 750)) + fig = Figure(resolution=size) ax = Axis(fig.layout[1, 1], aspect=DataAspect()) larvaplot!(ax, larvae) setbounds!(ax, ctrl, larvae) @@ -139,21 +139,22 @@ function AssayPlot(ctrl, larvae::DecoratedLarvae) AssayPlot(ctrl, fig, ax, larvae, button) end -function AssayPlot(ctrl, larvae::Vector{LarvaModel}) +function AssayPlot(ctrl, larvae::Vector{LarvaModel}; kwargs...) sample = downsampler() plot = AssayPlot(ctrl, DecoratedLarvae(sample.(larvae), gettags(ctrl), - gettimestep(ctrl))) + gettimestep(ctrl)); + kwargs...) return plot end -function AssayPlot(ctrl, larvae::Dict{LarvaID, LarvaModel}, args...) - AssayPlot(ctrl, collect(values(larvae)), args...) +function AssayPlot(ctrl, larvae::Dict{LarvaID, LarvaModel}, args...; kwargs...) + AssayPlot(ctrl, collect(values(larvae)), args...; kwargs...) end -function assayplot(data, ctrl) - plot = AssayPlot(ctrl, data) +function assayplot(data, ctrl; kwargs...) + plot = AssayPlot(ctrl, data; kwargs...) setmouseevents!(plot; consume=true) return plot end @@ -178,9 +179,9 @@ struct TrackPlot homebutton::HomeButton end -function TrackPlot(controller, larvae::Vector{LarvaModel}) +function TrackPlot(controller, larvae::Vector{LarvaModel}; size=(1000, 750)) view = SingleLarvaView(larvae, controller) - fig = Figure() + fig = Figure(resolution=size) ax = Axis(fig.layout[1, 1], aspect=DataAspect()) larvaplot!(ax, view) setbounds!(ax, controller, larvae) @@ -201,9 +202,9 @@ function TrackPlot(controller, larvae::Vector{LarvaModel}) TrackPlot(controller, fig, ax, larvae, view, button) 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) r(session,