-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Remove insertUI in the teal::init #669
Comments
We have a long talk about the splash (data loading view) location and design. |
Objective of the issue:
Later we can address:
|
There is another an use case from @ianamovsesian which requires teal to be reactive on data input. The case looks as follows.
|
I like the above but please think about this a little bit wider and more general I can imagine following scenario:
B) one stage - interactive data upload
C) two stage - interactive dir / file access D) multi stage db access to the table with value(s) in column(s) (e.g. select * from schema_id.study_data where study_id = ...) |
@pawelru Yes, I consider described process as a single module which returns reactive data at the end. Number of stages and complexity of this module is not a concern - if teal could listen to the output change.
I think we should provide flexibility to specify "DDL" module. This is solved by this proposition |
Just jumping in here - discussed with @pawelru on a use case that is coming up where a team would really benefit from an app where data can be uploaded, and teal modules exist for the analysis already. |
Closing this. It is now possible to call simple appoptions(
teal.log_level = "TRACE",
teal.show_js_log = TRUE,
# teal.bs_theme = bslib::bs_theme(version = 5),
shiny.bookmarkStore = "server"
)
library(scda)
pkgload::load_all("teal")
# pkgload::load_all("teal.slice")
ui_data <- function(id) {
ns <- NS(id)
tagList(
actionButton(ns("submit"), label = "Submit to run")
)
}
srv_data <- function(id, ...) {
moduleServer(id, function(input, output, session) {
eventReactive(input$submit, {
data <- teal_data() |>
within({
logger::log_trace("Loading data")
ADSL <- scda::synthetic_cdisc_data("latest")$adsl
ADTTE <- scda::synthetic_cdisc_data("latest")$adtte
iris <- iris
})
join_keys(data) <- default_cdisc_join_keys[c("ADSL", "ADTTE")]
data
})
})
}
modules <- modules(
teal.modules.general::tm_data_table("Data Table"),
example_module("Example Module", datanames = "ADTTE"),
module(
ui = function(id) {
ns <- NS(id)
tagList(
tableOutput(ns("filter_summary"))
)
},
server = function(id, datasets) {
moduleServer(id, function(input, output, session) {
output$filter_summary <- renderTable({
datasets$get_filter_overview(datanames = datasets$datanames())
})
})
}
)
)
shinyApp(
ui = function(request) {
fluidPage(
ui_data("data"),
ui_teal(id = "teal", modules = modules)
)
},
server = function(input, output, session) {
data_rv <- srv_data("data", data = data, modules = modules)
srv_teal(id = "teal", data = data_rv, modules = modules)
}
)
|
Wow, this looks amazing. Great work! |
@gogonzo It is a fantastic piece of work. |
Nicely done. |
Instead of waiting for DDL to load data and inserting Ui of the modules. Please make a reactive link between data and other modules and make a Data tab separately
Blocked by:
The text was updated successfully, but these errors were encountered: