Skip to content

Conversation

@vedhav
Copy link
Contributor

@vedhav vedhav commented Feb 20, 2025

Closes #848

@vedhav vedhav added the core label Feb 20, 2025
@vedhav vedhav requested a review from m7pr February 20, 2025 06:48
@vedhav vedhav enabled auto-merge (squash) February 20, 2025 06:48
@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  ---------------------------------------
R/tm_a_pca.R                    889     889  0.00%    136-1158
R/tm_a_regression.R             777     777  0.00%    175-1057
R/tm_data_table.R               211     211  0.00%    100-359
R/tm_file_viewer.R              173     173  0.00%    47-255
R/tm_front_page.R               144     133  7.64%    77-247
R/tm_g_association.R            346     346  0.00%    156-577
R/tm_g_bivariate.R              690     426  38.26%   328-815, 856, 967, 984, 1002, 1013-1035
R/tm_g_distribution.R          1119    1119  0.00%    153-1419
R/tm_g_response.R               369     369  0.00%    174-622
R/tm_g_scatterplot.R            731     731  0.00%    257-1092
R/tm_g_scatterplotmatrix.R      296     277  6.42%    195-528, 589, 603
R/tm_missing_data.R            1133    1133  0.00%    121-1431
R/tm_outliers.R                1041    1041  0.00%    160-1352
R/tm_t_crosstable.R             261     261  0.00%    160-469
R/tm_variable_browser.R         832     827  0.60%    89-1078, 1116-1299
R/utils.R                       151     135  10.60%   89-274, 304-340, 352-361, 366, 380-399
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9165    8850  3.44%

Diff against main

Filename        Stmts    Miss  Cover
------------  -------  ------  --------
R/tm_a_pca.R       +1      +1  +100.00%
TOTAL              +1      +1  -0.00%

Results for commit: 82cd7a5

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2025

Unit Tests Summary

  1 files   22 suites   13m 4s ⏱️
144 tests 107 ✅ 37 💤 0 ❌
474 runs  437 ✅ 37 💤 0 ❌

Results for commit 82cd7a5.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 20, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
shinytest2-tm_a_pca 💚 $118.19$ $-1.09$ $0$ $0$ $0$ $0$
shinytest2-tm_a_regression 💚 $53.88$ $-1.14$ $0$ $0$ $0$ $0$
shinytest2-tm_g_scatterplotmatrix 💔 $28.47$ $+1.22$ $0$ $0$ $0$ $0$
shinytest2-tm_outliers 💔 $113.71$ $+4.39$ $0$ $0$ $0$ $0$
shinytest2-tm_variable_browser 💔 $56.98$ $+1.76$ $0$ $0$ $0$ $0$

Results for commit fa74cb0

♻️ This comment has been updated with latest results.

@vedhav
Copy link
Contributor Author

vedhav commented Feb 20, 2025

@m7pr I also realised that the Transform Module Output vignette from teal was incorrect so this PR changes it.

@m7pr
Copy link
Contributor

m7pr commented Feb 20, 2025

@vedhav I get this error when I am testing

image

with

caption_decorator <- function(default_caption = "I am a good decorator", .var_to_replace = "plot") {
  teal_transform_module(
    label = "Caption",
    ui = function(id) shiny::textInput(shiny::NS(id, "footnote"), "Footnote", value = default_caption),
    server = make_teal_transform_server(
      substitute({
        .var_to_replace <- .var_to_replace + ggplot2::labs(caption = footnote)
      }, env = list(.var_to_replace = as.name(.var_to_replace)))
    )
  )
}

# general data example
data <- teal_data()
data <- within(data, {
  require(nestcolor)
  USArrests <- USArrests
})

app <- init(
  data = data,
  modules = modules(
    tm_a_pca(
      "PCA",
      dat = data_extract_spec(
        dataname = "USArrests",
        select = select_spec(
          choices = variable_choices(
            data = data[["USArrests"]], c("Murder", "Assault", "UrbanPop", "Rape")
          ),
          selected = c("Murder", "Assault"),
          multiple = TRUE
        ),
        filter = NULL
      ),
      decorators = list(eigenvector_plot  = caption_decorator(.var_to_replace = 'eigenvector_plot '))
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

@m7pr
Copy link
Contributor

m7pr commented Feb 20, 2025

Ah sorry, there was a trailing space in one place

image

now it works like a charm

image

@vedhav vedhav merged commit eb0a14a into main Feb 20, 2025
26 checks passed
@vedhav vedhav deleted the 848-fix-tm_a_pca-decorators@main branch February 20, 2025 12:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Decorators does not work for tm_a_pca's output eigenvector_plot

3 participants