# plot all events, both in and not in database. Selected events should be added in database upon button click, and plot updated to reflect that
output$plot <- renderPlot({
data = cell_info()$cell_data
ggplot(data, aes(... , col = in_database)
})
cell_info <- reactive({
input$submit_new_cells #actionButton
# input to select case
case = input$case
# database call
# ...
cell_data <- fetch(results, n=-1)
return(cell_data)
})
# select new events in plot to submit to database
new_hits = reactive({
new <- brushedPoints(cell_info()$cell_data, input$plot1_brush)
return(new)
})
# write new events to database
observeEvent(input$submit_new_cells, {
dbWriteTable( ... subset(new_hits(), in_database == FALSE ), ...)
})