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

introduce decorators for tm_a_pca #798

Merged
merged 11 commits into from
Nov 22, 2024

Conversation

m7pr
Copy link
Contributor

@m7pr m7pr commented Nov 19, 2024

Part of insightsengineering/teal#1370

Working Example
devtools::load_all("../teal")
devtools::load_all(".")
plot_title <- teal_transform_module(
  server = make_teal_transform_server(expression({
    plot <- plot + ggtitle("Custom title")
  }))
)

# 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(plot_title)
    )
  )
)
if (interactive()) {
  shinyApp(app$ui, app$server)
}

@m7pr m7pr added the core label Nov 19, 2024
@m7pr m7pr changed the base branch from main to 1187_decorate_output@main November 19, 2024 09:44
R/tm_a_pca.R Outdated Show resolved Hide resolved
@m7pr m7pr requested a review from averissimo November 20, 2024 10:56
@m7pr m7pr marked this pull request as ready for review November 20, 2024 10:56
R/tm_a_pca.R Outdated Show resolved Hide resolved
@m7pr m7pr requested a review from averissimo November 21, 2024 14:33
Copy link
Contributor

@averissimo averissimo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem solved, 1 suggestion

R/tm_a_pca.R Show resolved Hide resolved
@m7pr m7pr merged commit 0fcddf0 into 1187_decorate_output@main Nov 22, 2024
1 check passed
@m7pr m7pr deleted the tm_pca@1187_decorate_output@main branch November 22, 2024 10:20
@github-actions github-actions bot locked and limited conversation to collaborators Nov 22, 2024
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.

2 participants