SafetyGraphics / safetyGraphics

Clinical Trial Safety Graphics with R
https://safetygraphics.github.io/safetyGraphics/
Other
93 stars 24 forks source link

Capture output from modules. #694

Open samussiah opened 2 years ago

samussiah commented 2 years ago

@jwildfire, is this the functionality you were thinking?

mod_server <- function(input, output, session, params) {
    run_code_and_stuff <- reactive({
        # code and stuff
        return(something)
    })

    output$chart <- renderSomething({ run_code_and_stuff()$display })

    # Return reactive output that will be accessible across the application.
    return(run_code_and_stuff)
}
jwildfire commented 2 years ago

Yeah, something like that could definitely work!

We might also want to tie this in to some of the new and improved chart render functions in safetyCharts. See https://github.com/SafetyGraphics/safetyCharts/pull/101 and https://github.com/SafetyGraphics/safetyCharts/pull/109