From c24f3e3670365906d36c3747ac9670580ee5454e Mon Sep 17 00:00:00 2001 From: Stephanie Pennington Date: Mon, 18 Dec 2023 13:32:47 -0500 Subject: [PATCH] Add carbon tracking tab --- h2/app.r | 1 + h2/components/modules/mod_graph.R | 36 +++++++++++++++---------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/h2/app.r b/h2/app.r index 8323bee..cf12def 100644 --- a/h2/app.r +++ b/h2/app.r @@ -15,6 +15,7 @@ ui <- fluidPage( #download_ui("download_1"), ) ), + tabPanel(title = "Carbon Tracking"), tabPanel(title = "About") ), ) diff --git a/h2/components/modules/mod_graph.R b/h2/components/modules/mod_graph.R index f4dd39d..8ea0dcb 100644 --- a/h2/components/modules/mod_graph.R +++ b/h2/components/modules/mod_graph.R @@ -24,24 +24,24 @@ graph_ui <- function(id) { "RF - Volcanic Activity" = RF_VOL(), "RF - CH4" = RF_CH4()), "Halocarbon Forcings" = list("CF4 Forcing"="RF_CF4", #function doesn't give the correct output? - "C2F6 Forcing"="RF_C2F6", - "HFC-23 Forcing"="RF_HFC23", - "HFC-4310 Forcing"="RF_HFC4310", - "HFC-125 Forcing"="RF_HFC125", + "C2F6 Forcing"="RF_C2F6", + "HFC-23 Forcing"="RF_HFC23", + "HFC-4310 Forcing"="RF_HFC4310", + "HFC-125 Forcing"="RF_HFC125", "HFC-143a Forcing"="RF_HFC143a", - "HFC-245fa Forcing"="RF_HFC245fa", - "SF6 Forcing"="RF_SF6", - "CFC-11 Forcing"="RF_CFC11", - "CFC-12 Forcing"="RF_CFC12", + "HFC-245fa Forcing"="RF_HFC245fa", + "SF6 Forcing"="RF_SF6", + "CFC-11 Forcing"="RF_CFC11", + "CFC-12 Forcing"="RF_CFC12", "CFC-113 Forcing"="RF_CFC113", "CFC-114 Forcing"="RF_CFC114", "CFC-115 Forcing"="RF_CFC115", - "CCl4 Forcing"="RF_CCl4", + "CCl4 Forcing"="RF_CCl4", "CH3CCl3 Forcing"="RF_CH3CCl3", "Halon-1211 Forcing"="RF_halon1211", - "Halon-1301 Forcing"="RF_halon1301", - "Halon-2402 Forcing"="RF_halon2402", - "CH3Cl Forcing"="RF_CH3Cl", + "Halon-1301 Forcing"="RF_halon1301", + "Halon-2402 Forcing"="RF_halon2402", + "CH3Cl Forcing"="RF_CH3Cl", "CH3Br Forcing"="RF_CH3Br"), "Methane" = list("Atmospheric CH4" = CONCENTRATIONS_CH4(), "CH4 Emissions" = EMISSIONS_CH4()), @@ -59,7 +59,7 @@ graph_ui <- function(id) { actionButton(ns("plot"), "Plot"), plotlyOutput(ns("graph")) ) - #) + ) } graph_server <- function(id, r6) { @@ -67,12 +67,12 @@ graph_server <- function(id, r6) { observe({ if (r6$save == TRUE) { - + # Get labels given input key <- reactive({input$variable}) title <- title[[key()]] ylabel <- units[[key()]] - + # Filter data for selected variable filtered_output <- filter(r6$output[[r6$run_name()]], variable == r6$selected_var()) @@ -97,15 +97,15 @@ graph_server <- function(id, r6) { ) }) } - + if (r6$save == FALSE) { r6$selected_var <- reactive({input$variable}) - + # Get labels given input key <- reactive({input$variable}) title <- title[[key()]] ylabel <- units[[key()]] - + # Filter data for selected variable filtered_output <- filter(r6$no_save, variable == r6$selected_var())