Skip to content

Commit

Permalink
Merge branch 'main' into 317_log_shiny_input_changes@main
Browse files Browse the repository at this point in the history
  • Loading branch information
donyunardi authored Oct 10, 2024
2 parents 08f80e2 + 55abf55 commit d9bd063
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 32 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal.goshawk
Title: Longitudinal Visualization `teal` Modules
Version: 0.2.0.9013
Date: 2024-10-09
Version: 0.2.0.9014
Date: 2024-10-10
Authors@R: c(
person("Nick", "Paszty", , "[email protected]", role = c("aut", "cre")),
person("Dawid", "Kaledkowski", , "[email protected]", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal.goshawk 0.2.0.9013
# teal.goshawk 0.2.0.9014

# teal.goshawk 0.2.0

Expand Down
22 changes: 11 additions & 11 deletions R/tm_g_gh_boxplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ srv_g_boxplot <- function(id,
font_size = .(font_size),
unit = .("AVALU")
)
print(p)
})
)
}), 800)
Expand All @@ -480,6 +481,7 @@ srv_g_boxplot <- function(id,
xaxis_var = .(xaxis_var),
facet_var = .(facet_var)
)
tbl
})
)
}), 800)
Expand Down Expand Up @@ -508,6 +510,13 @@ srv_g_boxplot <- function(id,
DT::formatRound(numeric_cols, 4)
})

joined_qenvs <- reactive({
req(create_plot(), create_table())
teal.code::join(create_plot(), create_table())
})

code <- reactive(teal.code::get_code(joined_qenvs()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
Expand Down Expand Up @@ -536,11 +545,7 @@ srv_g_boxplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(
teal.code::get_code(
teal.code::join(create_plot(), create_table())
)
)
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand Down Expand Up @@ -579,14 +584,9 @@ srv_g_boxplot <- function(id,
DT::formatRound(numeric_cols, 4)
})

joined_qenvs <- reactive({
req(create_plot(), create_table())
teal.code::join(create_plot(), create_table())
})

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(joined_qenvs())),
verbatim_content = reactive(code()),
title = "Show R Code for Boxplot"
)
})
Expand Down
5 changes: 3 additions & 2 deletions R/tm_g_gh_correlationplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,7 @@ srv_g_correlationplot <- function(id,
brushing = TRUE
)

code <- reactive(teal.code::get_code(plot_q()))

### REPORTER
if (with_reporter) {
Expand Down Expand Up @@ -851,7 +852,7 @@ srv_g_correlationplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(teal.code::get_code(plot_q()))
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand Down Expand Up @@ -885,7 +886,7 @@ srv_g_correlationplot <- function(id,

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(plot_q())),
verbatim_content = reactive(code()),
title = "Show R Code for Correlation Plot"
)
})
Expand Down
18 changes: 8 additions & 10 deletions R/tm_g_gh_density_distribution_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ srv_g_density_distribution_plot <- function(id, # nolint
hline_arb_color = .(hline_arb_color),
rug_plot = .(rug_plot)
)
print(p)
})
)
}), 800)
Expand All @@ -378,7 +379,7 @@ srv_g_density_distribution_plot <- function(id, # nolint

teal.code::eval_code(
object = anl_q()$qenv,
code = bquote(
code = bquote({
tbl <- goshawk::t_summarytable(
data = ANL,
trt_group = .(trt_group),
Expand All @@ -387,7 +388,8 @@ srv_g_density_distribution_plot <- function(id, # nolint
xaxis_var = .(xaxis_var),
font_size = .(font_size)
)
)
tbl
})
)
}), 800)

Expand Down Expand Up @@ -418,11 +420,11 @@ srv_g_density_distribution_plot <- function(id, # nolint
teal.code::join(create_plot(), create_table())
})

code <- reactive(teal.code::get_code(joined_qenvs()))

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(
teal.code::get_code(joined_qenvs())
),
verbatim_content = reactive(code()),
title = "Show R Code for Density Distribution Plot"
)

Expand Down Expand Up @@ -450,11 +452,7 @@ srv_g_density_distribution_plot <- function(id, # nolint
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(
teal.code::get_code(
teal.code::join(create_plot(), create_table())
)
)
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand Down
6 changes: 4 additions & 2 deletions R/tm_g_gh_lineplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -773,6 +773,8 @@ srv_lineplot <- function(id,
width = plot_width,
)

code <- reactive(teal.code::get_code(plot_q()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
Expand Down Expand Up @@ -801,7 +803,7 @@ srv_lineplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(teal.code::get_code(plot_q()))
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand All @@ -810,7 +812,7 @@ srv_lineplot <- function(id,

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(plot_q())),
verbatim_content = reactive(code()),
title = "Show R Code for Line Plot"
)
})
Expand Down
6 changes: 4 additions & 2 deletions R/tm_g_gh_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,8 @@ srv_g_scatterplot <- function(id,
brushing = TRUE
)

code <- reactive(teal.code::get_code(plot_q()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
Expand Down Expand Up @@ -395,7 +397,7 @@ srv_g_scatterplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(teal.code::get_code(plot_q()))
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand Down Expand Up @@ -435,7 +437,7 @@ srv_g_scatterplot <- function(id,

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(plot_q())),
verbatim_content = reactive(code()),
title = "Show R Code for Scatterplot"
)
})
Expand Down
6 changes: 4 additions & 2 deletions R/tm_g_gh_spaghettiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,8 @@ srv_g_spaghettiplot <- function(id,
brushing = TRUE
)

code <- reactive(teal.code::get_code(plot_q()))

### REPORTER
if (with_reporter) {
card_fun <- function(comment, label) {
Expand All @@ -545,7 +547,7 @@ srv_g_spaghettiplot <- function(id,
card$append_text("Comment", "header3")
card$append_text(comment)
}
card$append_src(teal.code::get_code(plot_q()))
card$append_src(code())
card
}
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
Expand Down Expand Up @@ -585,7 +587,7 @@ srv_g_spaghettiplot <- function(id,

teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(plot_q())),
verbatim_content = reactive(code()),
title = "Show R Code for Spaghetti Plot"
)
})
Expand Down

0 comments on commit d9bd063

Please sign in to comment.