| Title: | Tools to Make Modular and Interactive R Workflow Builders |
|---|---|
| Description: | Contains tools to develop and run modular and interactive shiny apps that use shinymeta to translate GUI-based pipelines into R and RMarkdown code. |
| Authors: | William Gearty [aut, cre] (ORCID: <https://orcid.org/0000-0003-0076-3262>) |
| Maintainer: | William Gearty <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.0.0.9000 |
| Built: | 2026-06-05 01:04:41 UTC |
| Source: | https://github.com/willgearty/shinypal |
Accordion panel that includes a remove button
accordion_panel_remove_button(ind, ...)accordion_panel_remove_button(ind, ...)
ind |
The index of the step. |
... |
Additional arguments passed to |
A short description...
add_shinypal_step( input, ind, fun_workflow, fun_report, code_chain_list, libs, ec_subs = NULL )add_shinypal_step( input, ind, fun_workflow, fun_report, code_chain_list, libs, ec_subs = NULL )
input |
The input object from the shiny app. |
ind |
The index of the step to be added. |
fun_workflow |
A function that generates the UI elements for the workflow. |
fun_report |
A function that generates the UI elements for the report. |
code_chain_list |
A list of quoted code bits that will be added to code_chain(). |
libs |
A character vector of R packages required for this step. |
ec_subs |
An optional list of length 2, where the first element is a metaReactive object and the second element is a callback function. This is used to substitute expansion contexts in the code chain. |
Generates an event observer that watches for when a copy button is clicked.
Upon clicking, the code_expr is evaluated and copied to the clipboard
using clipr::write_clip().
clip_observe(input, output, ind, code_expr)clip_observe(input, output, ind, code_expr)
input |
The shiny input object. |
output |
The shiny output object. |
ind |
The index of the step. |
code_expr |
An expression (generated by |
varSelectInput of data.frame column names up-to-dateKeep a varSelectInput of data.frame column names up-to-date
column_select_observe(input, ind, inputId)column_select_observe(input, ind, inputId)
input |
The shiny input object. |
ind |
The index of the step. |
inputId |
The id of the |
Generates a shiny::actionButton() that, when clicked, generates a modal
for the resulting dataset for the specified step. Make sure to set up a
corresponding observer using df_modal_observe().
df_modal_button(ind, text = "View data")df_modal_button(ind, text = "View data")
ind |
The index of the step. |
text |
The text to display on the button. |
Show a modal with a reactable data.frame
df_modal_observe(input, output, ind, df_name)df_modal_observe(input, output, ind, df_name)
input |
The shiny input object. |
output |
The shiny output object. |
ind |
The index of the step. |
df_name |
The name of the data.frame to be displayed. |
selectInput of intermediate data.frames up-to-dateKeep a selectInput of intermediate data.frames up-to-date
df_select_observe(input, ind)df_select_observe(input, ind)
input |
The shiny input object. |
ind |
The index of the step. |
Observe a file input to be included in the download bundle
file_observe(input, inputId)file_observe(input, inputId)
input |
The shiny input object. |
inputId |
The id of the |
Returns the code chunk for ind, expanded with a shared context across
all currently-registered steps. Use this inside a reactive consumer
(e.g., renderPrint(), observeEvent()) to display or copy a step's
code. The chunk is rebuilt whenever any dependency changes.
get_chunk(ind)get_chunk(ind)
ind |
The index of the step. |
A code object suitable for printing or passing to
shinymeta::displayCodeModal(), or NULL if the step is not registered.
Generate a background color and font color for a step based on its index
get_colors(ind)get_colors(ind)
ind |
The index of the step. |
A list containing the color and background CSS styles for the
step.
Get an intermediate data object
get_int_data(name)get_int_data(name)
name |
The name of the data object to retrieve. |
Get the names of all intermediate data.frames for a given step
get_int_dfs(ind)get_int_dfs(ind)
ind |
The index of the step. |
Returns a unique, monotonically increasing index for a new workflow step.
Each call increments a server-side counter. The counter is initialised by
shinypal_setup() and is deliberately never reset while the session is
running.
next_step_index()next_step_index()
A single positive integer to use as the new step's index.
This should be paired with select_dataset_input().
select_column_input(ind, label = "Choose a column:", default = NULL, ...)select_column_input(ind, label = "Choose a column:", default = NULL, ...)
ind |
The index of the step. |
label |
The label for the select input. |
default |
The default value for the select input. |
... |
Additional arguments passed to |
Select input to choose a shinypal intermediate dataset
select_dataset_input(ind, label = "Choose a dataset:")select_dataset_input(ind, label = "Choose a dataset:")
ind |
The index of the step. |
label |
The label for the select input. |
Set an intermediate data object
set_int_data(obj, name)set_int_data(obj, name)
obj |
A reactive data object to store. |
name |
A name to store data object as. |
A function to set up the shinypal environment. This function should be called at the top of the server function of your shiny app.
shinypal_setup( input, output, session, modules, download_filename = "shinypal_script.zip", download_template = "./modules/test_report.qmd" )shinypal_setup( input, output, session, modules, download_filename = "shinypal_script.zip", download_template = "./modules/test_report.qmd" )
input |
The shiny input object. |
output |
The shiny output object. |
session |
The shiny session object. |
modules |
A character vector of paths to independent modules. |
download_filename |
The name of the file to download when the user clicks the download button. |
download_template |
The path to the Quarto markdown template file that will be used to generate the report. |
Each module should have a ui-aux.R file that defines the UI elements for
that module in the "Workflow" accordion and a server.R file that defines
the server-side logic for the module.
A function to create the UI for the ShinyPal app. This function should be called in the UI function of your shiny app.
shinypal_ui(modules)shinypal_ui(modules)
modules |
A character vector of paths to independent modules. |
Each module should have a ui-main.R file that defines the UI elements for
that module in the "Steps" accordion.
Render a reactive output variable as text within an application
page. Uses shiny::verbatimTextOutput() which is usually paired with
shiny::renderPrint() and provides fixed-width text in a <pre>. Make
sure to set up a corresponding observer using clip_observe().
verbatimTextOutput_copy(ind)verbatimTextOutput_copy(ind)
ind |
The index of the step. |