Skip to content

Commit

Permalink
Add carbon tracking tab
Browse files Browse the repository at this point in the history
  • Loading branch information
stephpenn1 committed Dec 18, 2023
1 parent b89ca78 commit c24f3e3
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 18 deletions.
1 change: 1 addition & 0 deletions h2/app.r
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ui <- fluidPage(
#download_ui("download_1"),
)
),
tabPanel(title = "Carbon Tracking"),
tabPanel(title = "About")
),
)
Expand Down
36 changes: 18 additions & 18 deletions h2/components/modules/mod_graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -59,20 +59,20 @@ graph_ui <- function(id) {
actionButton(ns("plot"), "Plot"),
plotlyOutput(ns("graph"))
)
#)
)
}

graph_server <- function(id, r6) {
moduleServer(id, function(input, output, session) {
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())
Expand All @@ -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())
Expand Down

0 comments on commit c24f3e3

Please sign in to comment.