-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.R
28 lines (26 loc) · 948 Bytes
/
server.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
library(shiny)
library(zeallot)
source("helpers.R")
shinyServer(function(input, output) {
values <- reactiveValues()
output$deploy_plot <- renderPlot({ plot_deployment() },
height = 100)
output$zoom_plot <- renderPlot({ plot_zoom(input$zoom_brush, values$dive_data) },
height = 100)
output$dive_plot <- renderPlotly({
if (!is.null(input$dive_click)) {
values$dive_click <- input$dive_click
}
c(dive_data = NULL, lunge_data = NULL, plot = NULL) %<-% plot_dive(values$dive_click)
values$dive_data <- dive_data
values$lunge_data <- lunge_data
plot
})
output$lunge_plots <- renderPlot({
which_lunge <- event_data("plotly_click", source = "dive")
if (!is.null(which_lunge) && which_lunge$curveNumber == 1) {
lunge_time <- values$lunge_data$datetime[which_lunge$pointNumber + 1]
plot_lunge(lunge_time)
}
})
})