Skip to content

Commit 34232e3

Browse files
committed
Style code output
1 parent bf6f6cb commit 34232e3

12 files changed

+24
-17
lines changed

R/tm_a_pca.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
11231123
})
11241124

11251125
# Render R code.
1126-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1126+
source_code_r <- reactive(prepare_code(decorated_output_q()))
11271127

11281128
teal.widgets::verbatim_popup_srv(
11291129
id = "rcode",

R/tm_a_regression.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ srv_a_regression <- function(id,
10111011
})
10121012

10131013
# Render R code.
1014-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1014+
source_code_r <- reactive(prepare_code(decorated_output_q()))
10151015

10161016
teal.widgets::verbatim_popup_srv(
10171017
id = "rcode",

R/tm_g_association.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ srv_tm_g_association <- function(id,
530530
})
531531

532532
# Render R code.
533-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_grob_q())))
533+
source_code_r <- reactive(prepare_cod(decorated_output_grob_q()))
534534

535535
teal.widgets::verbatim_popup_srv(
536536
id = "rcode",

R/tm_g_bivariate.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ srv_g_bivariate <- function(id,
536536
datasets = data
537537
)
538538
qenv <- teal.code::eval_code(data(),
539-
"library('ggplot2')")
539+
'library("ggplot2");library("dplyr")')
540540

541541
anl_merged_q <- reactive({
542542
req(anl_merged_input())
@@ -719,7 +719,8 @@ srv_g_bivariate <- function(id,
719719
)
720720

721721
# Render R code.
722-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q_facets())))
722+
723+
source_code_r <- reactive(prepare_code(decorated_output_q_facets()))
723724

724725
teal.widgets::verbatim_popup_srv(
725726
id = "rcode",
@@ -1009,15 +1010,15 @@ facet_ggplot_call <- function(row_facet = character(0),
10091010
NULL
10101011
} else if (!identical(row_facet, character(0)) && !identical(col_facet, character(0))) {
10111012
call(
1012-
"facet_grid",
1013+
"ggplot2::facet_grid",
10131014
rows = call_fun_dots("vars", row_facet),
10141015
cols = call_fun_dots("vars", col_facet),
10151016
scales = scales
10161017
)
10171018
} else if (identical(row_facet, character(0)) && !identical(col_facet, character(0))) {
1018-
call("facet_grid", cols = call_fun_dots("vars", col_facet), scales = scales)
1019+
call("ggplot2::facet_grid", cols = call_fun_dots("vars", col_facet), scales = scales)
10191020
} else if (!identical(row_facet, character(0)) && identical(col_facet, character(0))) {
1020-
call("facet_grid", rows = call_fun_dots("vars", row_facet), scales = scales)
1021+
call("ggplot2::facet_grid", rows = call_fun_dots("vars", row_facet), scales = scales)
10211022
}
10221023
}
10231024

R/tm_g_distribution.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1372,7 +1372,7 @@ srv_distribution <- function(id,
13721372
output$t_stats <- DT::renderDataTable(expr = tests_r())
13731373

13741374
# Render R code.
1375-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
1375+
source_code_r <- reactive(prepare_code(decorated_output_q()))
13761376

13771377
teal.widgets::verbatim_popup_srv(
13781378
id = "rcode",

R/tm_g_response.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ srv_g_response <- function(id,
576576
)
577577

578578
# Render R code.
579-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_plot_q())))
579+
source_code_r <- reactive(prepare_code(decorated_output_plot_q()))
580580

581581
teal.widgets::verbatim_popup_srv(
582582
id = "rcode",

R/tm_g_scatterplot.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,7 @@ srv_g_scatterplot <- function(id,
10481048
})
10491049

10501050
# Render R code.
1051-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_plot_q())))
1051+
source_code_r <- reactive(prepare_code(decorated_output_plot_q()))
10521052

10531053
teal.widgets::verbatim_popup_srv(
10541054
id = "rcode",

R/tm_g_scatterplotmatrix.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ srv_g_scatterplotmatrix <- function(id,
483483
})
484484

485485
# Render R code.
486-
source_code_r <- reactive(teal.code::get_code(req(decorated_output_q())))
486+
source_code_r <- reactive(prepare_code(decorated_output_q()))
487487

488488
teal.widgets::verbatim_popup_srv(
489489
id = "rcode",

R/tm_missing_data.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ srv_missing_data <- function(id,
13761376
})
13771377

13781378
# Render R code.
1379-
source_code_r <- reactive(styler::style_text(teal.code::get_code(req(decorated_final_q()))))
1379+
source_code_r <- reactive(prepare_code(decorated_final_q()))
13801380

13811381
teal.widgets::verbatim_popup_srv(
13821382
id = "rcode",

R/tm_outliers.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
854854
substitute(expr = plot_call, env = list(plot_call = plot_call))
855855
} else {
856856
substitute(
857-
expr = plot_call + facet_grid(~ reorder(categorical_var_name, order)),
857+
expr = plot_call + ggplot2::facet_grid(~ reorder(categorical_var_name, order)),
858858
env = list(plot_call = plot_call, categorical_var_name = as.name(categorical_var))
859859
)
860860
}
@@ -955,7 +955,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
955955
)
956956
)
957957
plot_call <- substitute(
958-
expr = plot_call + facet_grid(~ reorder(categorical_var_name, order)),
958+
expr = plot_call + ggplot2::facet_grid(~ reorder(categorical_var_name, order)),
959959
env = list(plot_call = plot_call, categorical_var_name = as.name(categorical_var))
960960
)
961961
}
@@ -1304,7 +1304,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
13041304
})
13051305

13061306
# Render R code.
1307-
source_code_r <- reactive(teal.code::get_code(req(decorated_final_q())))
1307+
source_code_r <- reactive(prepare_code(decorated_final_q()))
13081308

13091309
teal.widgets::verbatim_popup_srv(
13101310
id = "rcode",

0 commit comments

Comments
 (0)