Format interactive plot, with possibility to download patient profiles on a click event.
formatPlotlyClinData(
pl,
data,
idVar = "USUBJID",
pathVar = NULL,
pathDownload = TRUE,
idFromDataPlot = FALSE,
idVarPlot = "key",
labelVarPlot = NULL,
highlightOn = "plotly_click",
highlightOff = "plotly_doubleclick",
id = paste0("plotClinData", sample.int(n = 1000, size = 1)),
selectVars = NULL,
selectLab = getLabelVar(selectVars, labelVars = labelVars),
keyVar = NULL,
keyHighlightBox = FALSE,
labelVars = NULL,
verbose = FALSE
)Updated plotly object.
plotly object.
Data.frame with data.
String with variable of data
containing plot element.
String with variable of data containing path
to a subject-specific report (e.g. patient profiles).
Logical, if TRUE (by default) the subject-specific report(s)
are downloaded in a zip compressed file.
If FALSE (only available if unique report per idVarPlot),
each report is opened in a new window.
Logical, if TRUE (by default) idVarPlot
is extracted from the data of the plot output object (e.g. if this plot
was created from ggplotly), otherwise
directly from the plot object
(if the plot was created from plot_ly directly).
String with variable in the plotly
output containing IDs.
String with plotly variable used to
extract label to build the file name of the zip compressed
file containing patient report.
If not specified, the label are extracted based on the idVarPlot
of the selected plot element.
String with event to turn on the selection
(on parameter of highlight),
'plotly_click' by default.
String with event to turn off the selection
(off parameter of highlight),
'plotly_doubleclick' by default.
String with general id for the plot:
'id' is used as group for the SharedData
'button:[id]' is used as button ID if table is TRUE
If not specified, a random id, as 'plotClinData[X]' is used.
(optional) Character vector with variable(s) from data
for which a selection box should be included. This enables to select the data
displayed in the plot (and associated table).
(Named) character vector with label for selectVars.
String with unique key variable, identifying unique group for which the link between the table and the plot should be done.
Logical, if TRUE (FALSE by default) a selectize box is included to highlight selected element(s) of the key variable.
Named character vector containing variable labels.
Logical, if TRUE report progress messages during execution (included in the browser 'Console').
Laure Cougnaud