Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

521 documentation review before the release #530

Merged
merged 9 commits into from
Jun 29, 2023
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Imports:
shinyWidgets,
stats,
stringr,
teal.code (>= 0.2.0),
teal.code (>= 0.3.0),
teal.logger (>= 0.1.1),
teal.reporter (>= 0.1.1),
teal.slice (>= 0.2.0),
Expand Down
2 changes: 1 addition & 1 deletion R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ tm_g_distribution <- function(label = "Distribution Module",
if (length(missing_packages) > 0L) {
stop(sprintf(
"Cannot load package(s): %s.\nInstall or restart your session.",
paste(missing_packages, sep = ", ")
toString(missing_packages)
))
}

Expand Down
26 changes: 15 additions & 11 deletions R/tm_g_scatterplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,10 @@ tm_g_scatterplot <- function(label = "Scatterplot",
extra_packages <- c("ggpmisc", "ggExtra", "colourpicker")
missing_packages <- Filter(function(x) !requireNamespace(x, quietly = TRUE), extra_packages)
if (length(missing_packages) > 0L) {
stop(sprintf("Cannot load package(s): %s.\nInstall or restart your session.",
paste(missing_packages, sep = ", ")))
stop(sprintf(
"Cannot load package(s): %s.\nInstall or restart your session.",
toString(missing_packages)
))
}

if (inherits(x, "data_extract_spec")) x <- list(x)
Expand Down Expand Up @@ -407,8 +409,9 @@ srv_g_scatterplot <- function(id,
function(value) {
othervalue <- selector_list()[[other]]()[["select"]]
if (!is.null(othervalue)) {
if (identical(value, othervalue))
if (identical(value, othervalue)) {
"Row and column facetting variables must be different."
}
}
}
}
Expand Down Expand Up @@ -439,9 +442,10 @@ srv_g_scatterplot <- function(id,
})
iv_facet <- shinyvalidate::InputValidator$new()
iv_facet$add_rule("add_density", ~ if (isTRUE(.) &&
(length(selector_list()$row_facet()$select) > 0L ||
length(selector_list()$col_facet()$select) > 0L))
"Cannot add marginal density when Row or Column facetting has been selected")
(length(selector_list()$row_facet()$select) > 0L ||
length(selector_list()$col_facet()$select) > 0L)) {
"Cannot add marginal density when Row or Column facetting has been selected"
})
iv_facet$enable()

anl_merged_input <- teal.transform::merge_expression_srv(
Expand Down Expand Up @@ -503,7 +507,7 @@ srv_g_scatterplot <- function(id,
eventExpr = merged$anl_input_r()$columns_source[c("col_facet", "row_facet")],
handlerExpr = {
if (length(merged$anl_input_r()$columns_source$col_facet) == 0 &&
length(merged$anl_input_r()$columns_source$row_facet) == 0) {
length(merged$anl_input_r()$columns_source$row_facet) == 0) {
shinyjs::hide("free_scales")
} else {
shinyjs::show("free_scales")
Expand Down Expand Up @@ -561,8 +565,8 @@ srv_g_scatterplot <- function(id,
))
validate(need(
!(inherits(ANL[[color_by_var]], "Date") ||
inherits(ANL[[color_by_var]], "POSIXct") ||
inherits(ANL[[color_by_var]], "POSIXlt")),
inherits(ANL[[color_by_var]], "POSIXct") ||
inherits(ANL[[color_by_var]], "POSIXlt")),
"Marginal plots cannot be produced when the points are colored by Date or POSIX variables.
\n Uncheck the 'Add marginal density' checkbox to display the plot."
))
Expand Down Expand Up @@ -900,8 +904,8 @@ srv_g_scatterplot <- function(id,
if (length(numeric_cols) > 0) {
DT::formatRound(
DT::datatable(brushed_df,
rownames = FALSE,
options = list(scrollX = TRUE, pageLength = input$data_table_rows)
rownames = FALSE,
options = list(scrollX = TRUE, pageLength = input$data_table_rows)
),
numeric_cols,
table_dec
Expand Down