Skip to content

Commit 05aeb65

Browse files
use roxy.shinylive (#775)
test with insightsengineering/roxy.shinylive#1 Implementation of `roxy.shinylive`. Please run `pkgdown::build_site()` to see the difference. ![image](https://github.com/user-attachments/assets/96283a55-5c2a-493f-a855-5ef17425ac34) Extra: - for a few examples: remove dependency on `teal.widgets` so that the example code is simpler - for a few examples: replace `@examples` with `@examplesIf`. This is for our incorrect implementation of soft dependencies - add a new "Playground" section in the README with links to the shinylive - include shinylive iframe in the vignettes --------- Signed-off-by: Pawel Rucki <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com>
1 parent 56dc3d6 commit 05aeb65

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+663
-291
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ vignettes/*.R
2929
coverage.*
3030
tests/testthat/_snaps/**/*.new.md
3131
tests/testthat/_snaps/**/*.new.svg
32+
/doc/
33+
/Meta/

DESCRIPTION

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Suggests:
7171
pkgload,
7272
rlang (>= 1.0.0),
7373
rmarkdown (>= 2.23),
74+
roxy.shinylive,
7475
rtables (>= 0.6.8),
7576
rvest,
7677
shinytest2,
@@ -92,12 +93,12 @@ Config/Needs/verdepcheck: haleyjeppson/ggmosaic, tidyverse/ggplot2,
9293
aphalo/ggpmisc, aphalo/ggpp, slowkow/ggrepel, baddstats/goftest,
9394
ramnathv/htmlwidgets, jeroen/jsonlite, yihui/knitr, daroczig/logger,
9495
deepayan/lattice, insightsengineering/nestcolor, r-lib/pkgload,
95-
r-lib/rlang, rstudio/rmarkdown, insightsengineering/rtables,
96+
r-lib/rlang, rstudio/rmarkdown, insightsengineering/roxy.shinylive, insightsengineering/rtables,
9697
tidyverse/rvest, htmlwidgets/sparkline, rstudio/shinytest2,
9798
r-lib/testthat, r-lib/withr
9899
Config/Needs/website: insightsengineering/nesttemplate
99100
Encoding: UTF-8
100101
Language: en-US
101102
LazyData: true
102-
Roxygen: list(markdown = TRUE)
103+
Roxygen: list(markdown = TRUE, packages = c("roxy.shinylive"))
103104
RoxygenNote: 7.3.2

R/tm_a_pca.R

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
#'
1919
#' @inherit shared_params return
2020
#'
21+
#' @examplesShinylive
22+
#' library(teal.modules.general)
23+
#' interactive <- function() TRUE
24+
#' {{ next_example }}
2125
#' @examples
22-
#' library(teal.widgets)
23-
#'
2426
#' # general data example
2527
#' data <- teal_data()
2628
#' data <- within(data, {
@@ -45,9 +47,6 @@
4547
#' multiple = TRUE
4648
#' ),
4749
#' filter = NULL
48-
#' ),
49-
#' ggplot2_args = ggplot2_args(
50-
#' labs = list(subtitle = "Plot generated by PCA Module")
5150
#' )
5251
#' )
5352
#' )
@@ -56,6 +55,11 @@
5655
#' shinyApp(app$ui, app$server)
5756
#' }
5857
#'
58+
#' @examplesShinylive
59+
#' library(teal.modules.general)
60+
#' interactive <- function() TRUE
61+
#' {{ next_example }}
62+
#' @examples
5963
#' # CDISC data example
6064
#' data <- teal_data()
6165
#' data <- within(data, {
@@ -80,9 +84,6 @@
8084
#' multiple = TRUE
8185
#' ),
8286
#' filter = NULL
83-
#' ),
84-
#' ggplot2_args = ggplot2_args(
85-
#' labs = list(subtitle = "Plot generated by PCA Module")
8687
#' )
8788
#' )
8889
#' )

R/tm_a_regression.R

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@
4242
#'
4343
#' @inherit shared_params return
4444
#'
45+
#' @examplesShinylive
46+
#' library(teal.modules.general)
47+
#' interactive <- function() TRUE
48+
#' {{ next_example }}
4549
#' @examples
4650
#' # general data example
47-
#' library(teal.widgets)
48-
#'
4951
#' data <- teal_data()
5052
#' data <- within(data, {
5153
#' require(nestcolor)
@@ -77,9 +79,6 @@
7779
#' multiple = TRUE,
7880
#' fixed = FALSE
7981
#' )
80-
#' ),
81-
#' ggplot2_args = ggplot2_args(
82-
#' labs = list(subtitle = "Plot generated by Regression Module")
8382
#' )
8483
#' )
8584
#' )
@@ -88,9 +87,12 @@
8887
#' shinyApp(app$ui, app$server)
8988
#' }
9089
#'
90+
#' @examplesShinylive
91+
#' library(teal.modules.general)
92+
#' interactive <- function() TRUE
93+
#' {{ next_example }}
94+
#' @examples
9195
#' # CDISC data example
92-
#' library(teal.widgets)
93-
#'
9496
#' data <- teal_data()
9597
#' data <- within(data, {
9698
#' require(nestcolor)
@@ -123,9 +125,6 @@
123125
#' multiple = TRUE,
124126
#' fixed = FALSE
125127
#' )
126-
#' ),
127-
#' ggplot2_args = ggplot2_args(
128-
#' labs = list(subtitle = "Plot generated by Regression Module")
129128
#' )
130129
#' )
131130
#' )

R/tm_data_table.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
#'
3030
#' @inherit shared_params return
3131
#'
32+
#' @examplesShinylive
33+
#' library(teal.modules.general)
34+
#' interactive <- function() TRUE
35+
#' {{ next_example }}
3236
#' @examples
3337
#' # general data example
3438
#' data <- teal_data()
@@ -53,6 +57,11 @@
5357
#' shinyApp(app$ui, app$server)
5458
#' }
5559
#'
60+
#' @examplesShinylive
61+
#' library(teal.modules.general)
62+
#' interactive <- function() TRUE
63+
#' {{ next_example }}
64+
#' @examples
5665
#' # CDISC data example
5766
#' data <- teal_data()
5867
#' data <- within(data, {

R/tm_file_viewer.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#'
1414
#' @inherit shared_params return
1515
#'
16+
#' @examplesShinylive
17+
#' library(teal.modules.general)
18+
#' interactive <- function() TRUE
19+
#' {{ next_example }}
1620
#' @examples
1721
#' data <- teal_data()
1822
#' data <- within(data, {

R/tm_front_page.R

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#'
1818
#' @inherit shared_params return
1919
#'
20+
#' @examplesShinylive
21+
#' library(teal.modules.general)
22+
#' interactive <- function() TRUE
23+
#' {{ next_example }}
2024
#' @examples
2125
#' data <- teal_data()
2226
#' data <- within(data, {

R/tm_g_association.R

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@
2525
#'
2626
#' @inherit shared_params return
2727
#'
28+
#' @examplesShinylive
29+
#' library(teal.modules.general)
30+
#' interactive <- function() TRUE
31+
#' {{ next_example }}
2832
#' @examples
29-
#' library(teal.widgets)
30-
#'
3133
#' # general data example
3234
#' data <- teal_data()
3335
#' data <- within(data, {
@@ -60,9 +62,6 @@
6062
#' multiple = TRUE,
6163
#' fixed = FALSE
6264
#' )
63-
#' ),
64-
#' ggplot2_args = ggplot2_args(
65-
#' labs = list(subtitle = "Plot generated by Association Module")
6665
#' )
6766
#' )
6867
#' )
@@ -71,6 +70,11 @@
7170
#' shinyApp(app$ui, app$server)
7271
#' }
7372
#'
73+
#' @examplesShinylive
74+
#' library(teal.modules.general)
75+
#' interactive <- function() TRUE
76+
#' {{ next_example }}
77+
#' @examples
7478
#' # CDISC data example
7579
#' data <- teal_data()
7680
#' data <- within(data, {
@@ -108,9 +112,6 @@
108112
#' multiple = TRUE,
109113
#' fixed = FALSE
110114
#' )
111-
#' ),
112-
#' ggplot2_args = ggplot2_args(
113-
#' labs = list(subtitle = "Plot generated by Association Module")
114115
#' )
115116
#' )
116117
#' )

R/tm_g_bivariate.R

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@
4646
#'
4747
#' @inherit shared_params return
4848
#'
49+
#' @examplesShinylive
50+
#' library(teal.modules.general)
51+
#' interactive <- function() TRUE
52+
#' {{ next_example }}
4953
#' @examples
50-
#' library(teal.widgets)
51-
#'
5254
#' # general data example
5355
#' data <- teal_data()
5456
#' data <- within(data, {
@@ -96,17 +98,18 @@
9698
#' selected = "Treatment",
9799
#' fixed = FALSE
98100
#' )
99-
#' ),
100-
#' ggplot2_args = ggplot2_args(
101-
#' labs = list(subtitle = "Plot generated by Bivariate Module")
102101
#' )
103102
#' )
104103
#' )
105104
#' if (interactive()) {
106105
#' shinyApp(app$ui, app$server)
107106
#' }
108107
#'
109-
#'
108+
#' @examplesShinylive
109+
#' library(teal.modules.general)
110+
#' interactive <- function() TRUE
111+
#' {{ next_example }}
112+
#' @examples
110113
#' # CDISC data example
111114
#' data <- teal_data()
112115
#' data <- within(data, {
@@ -155,9 +158,6 @@
155158
#' selected = "COUNTRY",
156159
#' fixed = FALSE
157160
#' )
158-
#' ),
159-
#' ggplot2_args = ggplot2_args(
160-
#' labs = list(subtitle = "Plot generated by Bivariate Module")
161161
#' )
162162
#' )
163163
#' )

R/tm_g_distribution.R

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,13 @@
2727
#'
2828
#' @inherit shared_params return
2929
#'
30-
#' @examples
31-
#' library(teal.widgets)
32-
#'
30+
#' @examplesShinylive
31+
#' library(teal.modules.general)
32+
#' interactive <- function() TRUE
33+
#' {{ next_example }}
34+
# nolint start: line_length_linter.
35+
#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE)
36+
# nolint end: line_length_linter.
3337
#' # general data example
3438
#' data <- teal_data()
3539
#' data <- within(data, {
@@ -44,9 +48,6 @@
4448
#' dist_var = data_extract_spec(
4549
#' dataname = "iris",
4650
#' select = select_spec(variable_choices("iris"), "Petal.Length")
47-
#' ),
48-
#' ggplot2_args = ggplot2_args(
49-
#' labs = list(subtitle = "Plot generated by Distribution Module")
5051
#' )
5152
#' )
5253
#' )
@@ -55,6 +56,13 @@
5556
#' shinyApp(app$ui, app$server)
5657
#' }
5758
#'
59+
#' @examplesShinylive
60+
#' library(teal.modules.general)
61+
#' interactive <- function() TRUE
62+
#' {{ next_example }}
63+
# nolint start: line_length_linter.
64+
#' @examplesIf require("ggpmisc", quietly = TRUE) && require("ggpp", quietly = TRUE) && require("goftest", quietly = TRUE) && require("MASS", quietly = TRUE) && require("broom", quietly = TRUE)
65+
# nolint end: line_length_linter.
5866
#' # CDISC data example
5967
#' data <- teal_data()
6068
#' data <- within(data, {
@@ -94,9 +102,6 @@
94102
#' vars = vars1,
95103
#' multiple = TRUE
96104
#' )
97-
#' ),
98-
#' ggplot2_args = ggplot2_args(
99-
#' labs = list(subtitle = "Plot generated by Distribution Module")
100105
#' )
101106
#' )
102107
#' )

0 commit comments

Comments
 (0)