Skip to content

Commit

Permalink
521 documentation review before the release (#530)
Browse files Browse the repository at this point in the history
Based on specification from
#521

I checked that this PR
#485
replaced all `teal.code::chunks_*` with `teal.code::eval_code` or
`teal.code::new_qenv`. This looks like backend functionality (not
exposed to the user) so `chunks` were not exposed in examples, hence
even though I reviewed examples, nothing was there to be checked.
Vignettes, nor README nor DESCRIPTION never mentioned the usage of
`chunks` so no need to update them with any deprecation notes.


---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
m7pr and github-actions[bot] authored Jun 29, 2023
1 parent cfa5bcc commit ed981c4
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
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

0 comments on commit ed981c4

Please sign in to comment.