Skip to content

Commit 1a7951f

Browse files
committed
Merge branch 'main' into poc3@spotfire_poc2
# Conflicts: # R/tm_data_table.R # R/tm_g_scatterplot.R
2 parents 25f7aac + 6540a82 commit 1a7951f

29 files changed

+385
-460
lines changed

.lintr

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
linters: linters_with_defaults(
22
line_length_linter = line_length_linter(120),
3-
cyclocomp_linter = NULL,
43
object_usage_linter = NULL,
54
object_name_linter = object_name_linter(styles = c("snake_case", "symbols"), regexes = c(ANL = "^ANL_?[0-9A-Z_]*$", ADaM = "^r?AD[A-Z]{2,3}_?[0-9]*$")),
65
indentation_linter = NULL

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ default_language_version:
66
python: python3
77
repos:
88
- repo: https://github.com/lorenzwalthert/precommit
9-
rev: v0.4.3.9005
9+
rev: v0.4.3.9013
1010
hooks:
1111
- id: style-files
1212
name: Style code with `styler`

DESCRIPTION

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
Type: Package
22
Package: teal.modules.general
33
Title: General Modules for 'teal' Applications
4-
Version: 0.4.0.9001
5-
Date: 2025-03-11
4+
Version: 0.4.1.9020
5+
Date: 2025-08-20
66
Authors@R: c(
77
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")),
88
person("Pawel", "Rucki", , "[email protected]", role = "aut"),
@@ -26,9 +26,9 @@ Depends:
2626
ggmosaic (>= 0.3.0),
2727
ggplot2 (>= 3.4.0),
2828
R (>= 4.1),
29-
shiny (>= 1.6.0),
30-
teal (>= 0.16.0.9002),
31-
teal.transform (>= 0.6.0)
29+
shiny (>= 1.8.1),
30+
teal (>= 0.16.0.9008),
31+
teal.transform (>= 0.6.0.9002)
3232
Imports:
3333
bslib (>= 0.8.0),
3434
checkmate (>= 2.1.0),
@@ -39,7 +39,7 @@ Imports:
3939
forcats (>= 1.0.0),
4040
generics (>= 0.1.3),
4141
ggExtra (>= 0.10.1),
42-
ggpmisc (>= 0.4.3),
42+
ggpmisc (>= 0.5.6),
4343
ggpp (>= 0.5.8-1),
4444
ggrepel (>= 0.9.6),
4545
goftest (>= 1.2-3),
@@ -66,19 +66,19 @@ Imports:
6666
sparkline (>= 2.0),
6767
stats,
6868
stringr (>= 1.4.1),
69-
teal.code (>= 0.6.1),
69+
teal.code (>= 0.7.0),
7070
teal.data (>= 0.7.0),
71-
teal.logger (>= 0.3.2),
72-
teal.reporter (>= 0.4.0.9004),
73-
teal.widgets (>= 0.4.3.9001),
71+
teal.logger (>= 0.4.0),
72+
teal.reporter (>= 0.5.0),
73+
teal.widgets (>= 0.4.3.9005),
7474
tern (>= 0.9.7),
7575
tibble (>= 2.0.0),
7676
tidyr (>= 0.8.3),
7777
tools,
7878
utils
7979
Suggests:
8080
knitr (>= 1.42),
81-
logger (>= 0.2.0),
81+
logger (>= 0.4.0),
8282
nestcolor (>= 0.1.0),
8383
pkgload,
8484
roxy.shinylive,
@@ -90,15 +90,15 @@ VignetteBuilder:
9090
knitr,
9191
rmarkdown
9292
Remotes:
93-
insightsengineering/teal.reporter@main,
93+
insightsengineering/teal.transform@main,
9494
insightsengineering/teal.widgets@main,
9595
insightsengineering/teal@main
9696
Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2,
9797
rstudio/shiny, insightsengineering/teal,
98-
insightsengineering/teal.slice, insightsengineering/teal.transform,
99-
mllg/checkmate, tidyverse/dplyr, rstudio/DT, tidyverse/forcats,
100-
r-lib/lifecycle, r-lib/scales, daattali/shinyjs, shinyTree/shinyTree,
101-
rstudio/shinyvalidate, dreamRs/shinyWidgets, tidyverse/stringr,
98+
insightsengineering/teal.transform, mllg/checkmate, tidyverse/dplyr,
99+
rstudio/DT, tidyverse/forcats, r-lib/lifecycle, r-lib/scales,
100+
daattali/shinyjs, shinyTree/shinyTree, rstudio/shinyvalidate,
101+
dreamRs/shinyWidgets, tidyverse/stringr,
102102
insightsengineering/teal.code, insightsengineering/teal.data,
103103
insightsengineering/teal.logger, insightsengineering/teal.reporter,
104104
insightsengineering/teal.widgets, insightsengineering/tern,

NEWS.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
# teal.modules.general 0.4.0.9001
1+
# teal.modules.general 0.4.1.9020
2+
3+
### Breaking changes
4+
5+
- Removed the `table` object decoration in `tm_missing_data` and `tm_outliers` (#899).
6+
- Removed the `summary_table` and `test_table` object decoration in `tm_g_distribution` (#897).
7+
8+
### Bug fixes
9+
10+
- Fixed "Add to Report" functionality in `tm_outliers`, `tm_missing_data` and `tm_g_distribution` modules (#899 and #897).
11+
12+
### Miscellaneous
13+
14+
- Fixed deprecation warning for `tern::stack_grobs` in `tm_g_association` (#903).
15+
16+
# teal.modules.general 0.4.1
17+
18+
### Bug fixes
19+
* Fixes output is not updated when filter is added for the modules: `tm_a_pca`, `tm_a_regression`, `tm_g_scatterplot`, `tm_g_association`, `tm_g_bivariate`, `tm_g_distribution`, `tm_g_response`, `tm_t_crosstable` (#870)
20+
21+
### Enhancements
22+
* Added `remove_zero_columns` to `tm_t_crosstable` to add an option to remove empty columns (#890)
223

324
# teal.modules.general 0.4.0
425

R/tm_a_pca.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,14 @@ ui_a_pca <- function(id, ...) {
229229
}
230230

231231
tagList(
232-
include_css_files("custom"),
233232
teal.widgets::standard_layout(
234233
output = teal.widgets::white_small_well(
235234
uiOutput(ns("all_plots"))
236235
),
237236
encoding = tags$div(
238237
### Reporter
239-
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
238+
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
239+
tags$br(), tags$br(),
240240
###
241241
tags$label("Encodings", class = "text-primary"),
242242
teal.transform::datanames_input(args["dat"]),
@@ -436,10 +436,12 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
436436
selector_list = selector_list,
437437
datasets = data
438438
)
439-
qenv <- teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tidyr")') # nolint quotes
439+
qenv <- reactive(
440+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr");library("tidyr")') # nolint quotes
441+
)
440442
anl_merged_q <- reactive({
441443
req(anl_merged_input())
442-
qenv %>%
444+
qenv() %>%
443445
teal.code::eval_code(as.expression(anl_merged_input()$expr))
444446
})
445447

@@ -1116,7 +1118,6 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
11161118

11171119
validation()
11181120
tags$div(
1119-
class = "overflow-scroll",
11201121
uiOutput(session$ns("tbl_importance_ui")),
11211122
uiOutput(session$ns("tbl_eigenvector_ui")),
11221123
teal.widgets::plot_with_settings_ui(id = session$ns("pca_plot"))
@@ -1154,7 +1155,7 @@ srv_a_pca <- function(id, data, reporter, filter_panel_api, dat, plot_height, pl
11541155
card$append_src(source_code_r())
11551156
card
11561157
}
1157-
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
1158+
teal.reporter::add_card_button_srv("add_reporter", reporter = reporter, card_fun = card_fun)
11581159
}
11591160
###
11601161
})

R/tm_a_regression.R

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ ui_a_regression <- function(id, ...) {
286286
)),
287287
encoding = tags$div(
288288
### Reporter
289-
teal.reporter::simple_reporter_ui(ns("simple_reporter")),
289+
teal.reporter::add_card_button_ui(ns("add_reporter"), label = "Add Report Card"),
290+
tags$br(), tags$br(),
290291
###
291292
tags$label("Encodings", class = "text-primary"), tags$br(),
292293
teal.transform::datanames_input(args[c("response", "regressor")]),
@@ -462,14 +463,13 @@ srv_a_regression <- function(id,
462463
)
463464
})
464465

465-
qenv <- teal.code::eval_code(
466-
data(),
467-
'library("ggplot2");library("dplyr")' # nolint quotes
466+
qenv <- reactive(
467+
teal.code::eval_code(data(), 'library("ggplot2");library("dplyr")') # nolint quotes
468468
)
469469

470470
anl_merged_q <- reactive({
471471
req(anl_merged_input())
472-
qenv %>%
472+
qenv() %>%
473473
teal.code::eval_code(as.expression(anl_merged_input()$expr))
474474
})
475475

@@ -830,18 +830,15 @@ srv_a_regression <- function(id,
830830
color = "red",
831831
linetype = "dashed"
832832
) +
833-
ggplot2::geom_text(
834-
ggplot2::aes(
835-
x = 0,
836-
y = mean(data$.cooksd, na.rm = TRUE),
837-
label = paste("mu", "=", round(mean(data$.cooksd, na.rm = TRUE), 4)),
838-
vjust = -1,
839-
hjust = 0,
840-
color = "red",
841-
angle = 90
842-
),
843-
parse = TRUE,
844-
show.legend = FALSE
833+
ggplot2::annotate(
834+
geom = "text",
835+
x = 0,
836+
y = mean(data$.cooksd, na.rm = TRUE),
837+
label = paste("mu", "=", round(mean(data$.cooksd, na.rm = TRUE), 4)),
838+
vjust = -1,
839+
hjust = 0,
840+
color = "red",
841+
angle = 90
845842
) +
846843
outlier_label,
847844
env = list(plot = plot, outlier = input$outlier, outlier_label = outlier_label())
@@ -998,7 +995,7 @@ srv_a_regression <- function(id,
998995
"decorator",
999996
data = output_q,
1000997
decorators = select_decorators(decorators, "plot"),
1001-
expr = print(plot)
998+
expr = plot
1002999
)
10031000

10041001
fitted <- reactive({
@@ -1021,9 +1018,7 @@ srv_a_regression <- function(id,
10211018
output$text <- renderText({
10221019
req(iv_r()$is_valid())
10231020
req(iv_out$is_valid())
1024-
paste(utils::capture.output(summary(teal.code::dev_suppress(fitted())))[-1],
1025-
collapse = "\n"
1026-
)
1021+
paste(utils::capture.output(summary(fitted()))[-1], collapse = "\n")
10271022
})
10281023

10291024
# Render R code.
@@ -1053,7 +1048,7 @@ srv_a_regression <- function(id,
10531048
card$append_src(source_code_r())
10541049
card
10551050
}
1056-
teal.reporter::simple_reporter_srv("simple_reporter", reporter = reporter, card_fun = card_fun)
1051+
teal.reporter::add_card_button_srv("add_reporter", reporter = reporter, card_fun = card_fun)
10571052
}
10581053
###
10591054
})

R/tm_data_table.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ tm_data_table <- function(label = "Data Table",
112112
})
113113
}
114114
if (!missing(datasets_selected)) {
115-
lifecycle::deprecate_soft(
115+
lifecycle::deprecate_stop(
116116
when = "0.4.0",
117117
what = "tm_data_table(datasets_selected)",
118118
with = "tm_data_table(datanames)",
@@ -156,7 +156,6 @@ tm_data_table <- function(label = "Data Table",
156156
ui_data_table <- function(id, pre_output = NULL, post_output = NULL) {
157157
ns <- NS(id)
158158
bslib::page_fluid(
159-
include_css_files("custom"),
160159
teal.widgets::standard_layout(
161160
output = bslib::page_fluid(
162161
div(checkboxInput(ns("if_distinct"), "Show only distinct rows:", value = FALSE)),

R/tm_file_viewer.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,21 +103,20 @@ ui_viewer <- function(id, ...) {
103103
ns <- NS(id)
104104

105105
tagList(
106-
include_css_files("custom"),
107106
teal.widgets::standard_layout(
108107
output = tags$div(
109108
uiOutput(ns("output"))
110109
),
111110
encoding = tags$div(
112-
class = "file_viewer_encoding",
111+
style = "overflow-y: hidden; overflow-x: auto;",
113112
tags$label("Encodings", class = "text-primary"),
114113
shinyTree::shinyTree(
115114
ns("tree"),
116115
dragAndDrop = FALSE,
117116
sort = FALSE,
118-
wholerow = TRUE,
119117
theme = "proton",
120-
multiple = FALSE
118+
multiple = FALSE,
119+
search = TRUE
121120
)
122121
)
123122
)
@@ -173,7 +172,7 @@ srv_viewer <- function(id, input_path) {
173172
tags$img(src = con_type$selected_path, alt = "file does not exist")
174173
} else if (file_extension == "pdf") {
175174
tags$embed(
176-
class = "embed_pdf",
175+
style = "height: 600px; width: 100%;",
177176
src = con_type$selected_path
178177
)
179178
} else if (!isFALSE(con_type$output_text[1])) {

R/tm_front_page.R

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ tm_front_page <- function(label = "Front page",
8383
checkmate::assert_multi_class(additional_tags, classes = c("shiny.tag.list", "html"))
8484
checkmate::assert_character(footnotes, min.len = 0, any.missing = FALSE)
8585
if (!missing(show_metadata)) {
86-
lifecycle::deprecate_soft(
86+
lifecycle::deprecate_stop(
8787
when = "0.4.0",
8888
what = "tm_front_page(show_metadata)",
8989
with = "tm_front_page(datanames)",
@@ -119,33 +119,32 @@ ui_front_page <- function(id, ...) {
119119
ns <- NS(id)
120120

121121
tagList(
122-
include_css_files("custom"),
123122
tags$div(
124123
id = "front_page_content",
125-
class = "ml-8",
124+
style = "margin-left: 2rem;",
126125
tags$div(
127126
id = "front_page_headers",
128127
get_header_tags(args$header_text)
129128
),
130129
tags$div(
131130
id = "front_page_tables",
132-
class = "ml-4",
131+
style = "margin-left: 2rem;",
133132
get_table_tags(args$tables, ns)
134133
),
135134
tags$div(
136135
id = "front_page_custom_html",
137-
class = "my-4",
136+
style = "margin-left: 2rem;",
138137
args$additional_tags
139138
),
140139
if (length(args$datanames) > 0L) {
141140
tags$div(
142141
id = "front_page_metabutton",
143-
class = "m-4",
142+
style = "margin: 1rem;",
144143
actionButton(ns("metadata_button"), "Show metadata")
145144
)
146145
},
147146
tags$footer(
148-
class = ".small",
147+
class = "small",
149148
get_footer_tags(args$footnotes)
150149
)
151150
)
@@ -228,7 +227,7 @@ get_table_tags <- function(tables, ns) {
228227
tableOutput(ns(paste0("table_", idx)))
229228
)
230229
}))
231-
return(table_tags)
230+
table_tags
232231
}
233232

234233
get_footer_tags <- function(footnotes) {
@@ -255,11 +254,11 @@ convert_metadata_to_dataframe <- function(raw_metadata, datanames) {
255254
if (is.null(metadata)) {
256255
return(data.frame(Dataset = character(0), Name = character(0), Value = character(0)))
257256
}
258-
return(data.frame(
257+
data.frame(
259258
Dataset = dataname,
260259
Name = names(metadata),
261260
Value = unname(unlist(lapply(metadata, as.character)))
262-
))
261+
)
263262
}, raw_metadata, datanames, SIMPLIFY = FALSE)
264263
do.call(rbind, output)
265264
}

0 commit comments

Comments
 (0)