Skip to content

Commit e38a940

Browse files
committed
Update app server and UI with descriptions
1 parent f8c2b80 commit e38a940

File tree

2 files changed

+19
-5
lines changed

2 files changed

+19
-5
lines changed

R/app_server.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@ app_server <- function(input, output, session) {
99
app_sys("app", "data", "datasets.json"),
1010
simplify_vector = TRUE
1111
)
12-
1312
strategies_lookup <- jsonlite::read_json(
1413
app_sys("app", "data", "mitigators.json"),
1514
simplify_vector = TRUE
1615
)
16+
descriptions_lookup <- jsonlite::read_json(
17+
"inst/app/data/descriptions.json",
18+
simplifyVector = TRUE
19+
)
1720

1821
selected_provider <- mod_select_provider_server(
1922
"mod_select_provider",
@@ -24,6 +27,11 @@ app_server <- function(input, output, session) {
2427
strategies_lookup
2528
)
2629

30+
mod_show_description_server(
31+
"mod_show_description",
32+
descriptions_lookup,
33+
selected_strategy
34+
)
2735
mod_plot_trend_server(
2836
"mod_plot_trend",
2937
rates_data,

R/app_ui.R

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ app_ui <- function(request) {
2020
The information presented here should not be relied on as fact."
2121
),
2222

23-
bslib::card(
24-
bslib::card_header("Trend in rates"),
25-
bslib::card_body(mod_plot_trend_ui("mod_plot_trend")),
26-
full_screen = TRUE
23+
bslib::layout_columns(
24+
bslib::card(
25+
bslib::card_header("Description"),
26+
bslib::card_body(mod_show_description_ui("mod_show_description"))
27+
),
28+
bslib::card(
29+
bslib::card_header("Trend in rates"),
30+
bslib::card_body(mod_plot_trend_ui("mod_plot_trend")),
31+
full_screen = TRUE
32+
)
2733
)
2834
)
2935
}

0 commit comments

Comments
 (0)