Skip to content

Commit 95e0fbf

Browse files
committed
fixes
1 parent d045e7b commit 95e0fbf

File tree

1 file changed

+8
-23
lines changed

1 file changed

+8
-23
lines changed

R/tm_outliers.R

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ ui_outliers <- function(id, ...) {
422422
)
423423
}
424424

425+
# Server function for the outliers module
425426
# Server function for the outliers module
426427
srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
427428
categorical_var, plot_height, plot_width, ggplot2_args, decorators) {
@@ -767,14 +768,13 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
767768
qenv
768769
})
769770

770-
decorated_table_q <- srv_transform_data("table_decorator", data = common_code_q, transforms = decorators$table)
771771
output$summary_table <- DT::renderDataTable(
772772
expr = {
773773
if (iv_r()$is_valid()) {
774774
categorical_var <- as.vector(merged$anl_input_r()$columns_source$categorical_var)
775775
if (!is.null(categorical_var)) {
776776
DT::datatable(
777-
decorated_table_q()[["summary_table"]],
777+
common_code_q()[["summary_table"]],
778778
options = list(
779779
dom = "t",
780780
autoWidth = TRUE,
@@ -875,8 +875,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
875875
themes = parsed_ggplot2_args$theme
876876
)
877877
)
878-
) %>%
879-
teal.code::eval_code(quote(print(g)))
878+
)
880879
})
881880

882881
# density plot
@@ -935,8 +934,7 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
935934
ggthemes = parsed_ggplot2_args$ggtheme
936935
)
937936
)
938-
) %>%
939-
teal.code::eval_code(quote(print(g)))
937+
)
940938
})
941939

942940
# Cumulative distribution plot
@@ -1041,14 +1039,13 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
10411039
ggthemes = parsed_ggplot2_args$ggtheme
10421040
)
10431041
)
1044-
) %>%
1045-
teal.code::eval_code(quote(print(g)))
1042+
)
10461043
})
10471044

10481045
decorated_boxplot_q <- srv_transform_data("boxplot_decorator", data = boxplot_q, transforms = decorators$boxplot)
1049-
decorated_violin_r <- srv_transform_data("violin_decorator", data = undecorated_boxplot_r, transforms = decorators$violin)
1046+
decorated_violin_q <- srv_transform_data("violin_decorator", data = boxplot_q, transforms = decorators$violin)
10501047
decorated_density_plot_q <- srv_transform_data("density_decorator", data = density_plot_q, transforms = decorators$density)
1051-
cumulative_plot_r <- srv_transform_data("cum_dist_decorator", data = undecorated_cumulative_plot_r, transforms = decorators$cum_dist)
1048+
decorated_cumulative_plot_q <- srv_transform_data("cum_dist_decorator", data = cumulative_plot_q, transforms = decorators$cum_dist)
10521049

10531050
final_q <- reactive({
10541051
req(input$tabs)
@@ -1132,27 +1129,15 @@ srv_outliers <- function(id, data, reporter, filter_panel_api, outlier_var,
11321129
teal::validate_inputs(iv_r())
11331130
decorated_boxplot_q()[["g"]]
11341131
})
1135-
1136-
boxplot_r <- reactive({
1137-
req(input$boxplot_alts)
1138-
if (input$boxplot_alts == "Box plot") {
1139-
decorated_boxplot_r()
1140-
} else {
1141-
decorated_violin_r()
1142-
}
1143-
})
1144-
11451132
density_plot_r <- reactive({
11461133
teal::validate_inputs(iv_r())
11471134
decorated_density_plot_q()[["g"]]
11481135
})
1149-
11501136
cumulative_plot_r <- reactive({
11511137
teal::validate_inputs(iv_r())
1152-
cumulative_plot_q()[["g"]]
1138+
decorated_cumulative_plot_q()[["g"]]
11531139
})
11541140

1155-
11561141
box_pws <- teal.widgets::plot_with_settings_srv(
11571142
id = "box_plot",
11581143
plot_r = boxplot_r,

0 commit comments

Comments
 (0)