server for adding views/cards to the Report.
For more details see the vignette: vignette("simpleReporter", "teal.reporter").
Arguments
- id
character(1)thisshinymodule's id.- reporter
Reporterinstance.- card_fun
functionwhich returns aReportCardinstance. It can have optionalcard,commentandlabelparameters. Ifcardparameter is added, then theReportCardinstance is created for the user. Usecommentparameter to pass it's value whenever you prefer withcard$append_text()- ifcard_fundoes not havecommentparameter, thencommentfromAdd Card UImodule will be added at the end of the content of the card. Iflabelparameter is provided, you can use it to customize appearance of thecard nameand use if to specifycardcontent withcard$append_text()- ifcard_fundoes not havelabelparameter, thencard namewill be set to the name passed inAdd Card UImodule, but no text will be added to the content of thecard.
Details
This module allows using a child of ReportCard instead of ReportCard.
To properly support this, an instance of the child class must be passed
as the default value of the card argument in the card_fun function.
See below:
CustomReportCard <- R6::R6Class( # nolint: object_name_linter.
classname = "CustomReportCard",
inherit = teal.reporter::ReportCard
)
custom_function <- function(card = CustomReportCard$new()) {
card
}