You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To enhance the user experience and provide a more straightforward starting point for those new to teal, there could be template functions into the application. These templates, was discussed last week into daily so I am putting this up for discussion. this template might an additional aid to tutorial videos which @vedhav is working on , aim to simplify the initial steps for new users.
The idea is to create default application templates with minimal parameters needed for initialization. These templates will include pre-written function calls from different tea_*l packages and create skeleton for teal app based on user requirement showcasing teal products. They will feature placeholders and comments guiding users on where and how to insert their logic, offering a hands-on approach to getting started with the application.
This function will encapsulate functionality from various packages and call necessary libraries Below is a sample template showcasing how a teal application template might look like.
e.g sample_teal_template(reporter =T, custom_moule = T, ...)
library(teal)
## defining teal_data
data <- within(teal_data(), {
#TODO logic to create teal_data
#TODO add reproducible code.
})
## defining custom module
# UI function for the module
ui_custom_example <- function(id) {
ns <- NS(id)
teal.widgets::standard_layout(
output = #object with the output element,
encoding = #object containing the encoding elements,
forms = teal.widgets::verbatim_popup_ui(ns("rcode"), "Show R code")
)
}
# Server function for the module
srv_custom_example <- function(id, data) {
checkmate::assert_class(data, "reactive")
checkmate::assert_class(isolate(data()), "teal_data")
moduleServer(id, function(input, output, session) {
ns <- session$ns
# Plots and data.frame display logic
#TODO
# Code upon clicking 'Show R Code' button
teal.widgets::verbatim_popup_srv(
id = "rcode",
verbatim_content = reactive(teal.code::get_code(plot_code_q())),
title = "R Code"
)
})
}
# Function that creates module instance for use in `teal` app
custom_module <- function(label = "<custom module title>") {
module(
label = label,
server = srv_custom_example,
ui = ui_custom_example,
datanames = "all"
)
}
# Define filters
filters <- teal_slices(
teal_slice(dataname = "<dataname>", varname = "<varname>", id = "<id>"),
module_specific = TRUE,
mapping = list(
global_filters = "<id>"
)
)
## App initialization
app <- init(
data = data,
modules = custom_module(),
filters = filters
)
if (interactive()) shinyApp(app$ui, app$server)
This proposal aims to streamline the learning curve for new users by providing them with a practical and editable framework to build their teal application.
I'd like to open up a discussion on whether adding these functions would be beneficial, or if our current vignettes and tutorials sufficiently meet our needs.
Code of Conduct
I agree to follow this project's Code of Conduct.
Contribution Guidelines
I agree to follow this project's Contribution Guidelines.
Security Policy
I agree to follow this project's Security Policy.
The text was updated successfully, but these errors were encountered:
Feature description
To enhance the user experience and provide a more straightforward starting point for those new to
teal
, there could be template functions into the application. These templates, was discussed last week into daily so I am putting this up for discussion. this template might an additional aid to tutorial videos which @vedhav is working on , aim to simplify the initial steps for new users.The idea is to create default application templates with minimal parameters needed for initialization. These templates will include pre-written function calls from different
tea_*l
packages and create skeleton forteal
app based on user requirement showcasingteal
products. They will feature placeholders and comments guiding users on where and how to insert their logic, offering a hands-on approach to getting started with the application.This function will encapsulate functionality from various packages and call necessary libraries Below is a sample template showcasing how a teal application template might look like.
e.g
sample_teal_template(reporter =T, custom_moule = T, ...)
This proposal aims to streamline the learning curve for new users by providing them with a practical and editable framework to build their teal application.
I'd like to open up a discussion on whether adding these functions would be beneficial, or if our current vignettes and tutorials sufficiently meet our needs.
Code of Conduct
Contribution Guidelines
Security Policy
The text was updated successfully, but these errors were encountered: