Provides a button to add views/cards to a report.
For more details see the vignette: vignette("simpleReporter", "teal.reporter")
.
Arguments
- id
(
character(1)
) thisshiny
module's id.- reporter
(
Reporter
) instance.- card_fun
(
function
) which returns aReportCard
instance. SeeDetails
.
Details
The card_fun
function is designed to create a new ReportCard
instance and optionally customize it:
The
card
parameter allows for specifying a custom or defaultReportCard
instance.Use the
comment
parameter to add a comment to the card viacard$append_text()
- ifcard_fun
does not have thecomment
parameter, thencomment
fromAdd Card UI
module will be added at the end of the content of the card.The
label
parameter enables customization of the card's name and its content throughcard$append_text()
- ifcard_fun
does not have thelabel
parameter, then card name will be set to the name passed inAdd Card UI
module, but no text will be added to the content of thecard
.
This module supports using a subclass of ReportCard
for added flexibility.
A subclass instance should be passed as the default value of
the card
argument in the card_fun
function.
See below:
CustomReportCard <- R6::R6Class(
classname = "CustomReportCard",
inherit = teal.reporter::ReportCard
)
custom_function <- function(card = CustomReportCard$new()) {
card
}