Skip to content

Anisha download descreteplot1 #35

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 14 additions & 13 deletions app.R
@@ -1,4 +1,4 @@
# Data Incite SafeCampus App
# Data Incite SafeCampus App
# Uses Shinydashboard as a framework https://rstudio.github.io/shinydashboard/
# Created by Jennifer Zhan, Tracy Chen, Christina van Hal, and Mia Mayerhofer
# Version: 26 Jan 2021
Expand Down Expand Up @@ -46,7 +46,7 @@ allinfo <- readRDS("../COVID_RPI_WiFi_Data/allinfo.Rds")
#loading R script
source("building_info.R", local = TRUE)

ui <- dashboardPage(skin = "black", title = "COVID SafeCampus",
ui <- dashboardPage(skin = "red", title = "COVID SafeCampus",
dashboardHeader(title = tags$div(
class = "title-text",
tags$style(".logo {max-width: 80%;}"),
Expand Down Expand Up @@ -88,7 +88,7 @@ ui <- dashboardPage(skin = "black", title = "COVID SafeCampus",
tags$div(h5("Click on any bubble to view daily and weekly summaries for each building.")),
fluidRow(
column(8,
fluidRow(column(12, div(leafletOutput("bubblemap", height = 650))))),
fluidRow(column(12, div(leafletOutput("bubblemap", height = 680))))),
column(4,
fluidRow(inputPanel(
radioButtons("datatype", "Choose to view Wi-Fi access by users or devices",
Expand Down Expand Up @@ -180,12 +180,13 @@ ui <- dashboardPage(skin = "black", title = "COVID SafeCampus",
"Select a time range",
min = as_datetime(hms::parse_hm("0:00")),
max = as_datetime(hms::parse_hm("23:30")),
# value = c(as_datetime(hms::parse_hm("14:00:00")),
# as_datetime(hms::parse_hm("16:00:00"))),
#value = c(as_datetime(hms::parse_hm("14:00:00")),
# as_datetime(hms::parse_hm("16:00:00"))),
value = c(now_time-hours(2),now_time),
timeFormat = "%H:%M",
timezone = "GMT",
step = 30*60)))),
step = 30*60)
))),
fluidRow(column(9,br(),fluidRow(column(12, div(uiOutput("discrete_plot3", height = "100%")), downloadButton("downloadDiscreteplot3", "Download Graph"))),
br(),fluidRow(column(12, div(uiOutput("discrete_plot1", height = "100%")), downloadButton("downloadDiscreteplot1", "Download Graph")))),
column(3,br(),fluidRow(column(12, div(uiOutput("discrete_plot4", height = "100%")), downloadButton("downloadDiscreteplot4", "Download Graph"))),
Expand Down Expand Up @@ -372,7 +373,7 @@ server <- function(input, output, session) {
end_time <- hms::as_hms(input$time[2])

# Update other slider
updateSliderInput(session,"timeRange",value=c(input$time[1],input$time[2]))
updateSliderInput(session,"timeRange",value=c(input$time[1],input$time[2]),timeFormat = "%H:%M")

if(input$semester=="f20"){
db <- dbConnect(MySQL(), dbname = "safecampus", user = "dataincite", password = "P4Z2w@d!", host = "sequel.idea.rpi.edu")
Expand Down Expand Up @@ -920,15 +921,15 @@ server <- function(input, output, session) {
}
})
})
output$downloadDiscreteplot1 <- downloadHandler(

output$downloadDiscreteplot1 = downloadHandler(
filename = "DiscretePlot1.png",
content = function(file) {
png(file)
print(print_discrete_plot1())
dev.off()},
contentType = 'image/png'
)
w <- max(discrete_dat_fin()$Count)
ggsave(file, plot = print_discrete_plot1(), width=15, height=w*2+1, limitsize = FALSE)
dev.off
})

print_discrete_plot2 <- function(){
max_y <- max(by_device()$total)
Expand Down