This function updates settings objects to add a new chart to the safetyGraphics shiny app
addChart(chart, label = "", description = "", repo_url = "",
settings_url = "", main = "character", type = "static",
maxWidth = 1000, requiredSettings = c(""),
settingsLocation = getwd(), overwrite = TRUE)
Name of the chart - one word, all lower case
Nicely formatted name of the chart
Description of the chart
Homepage for chart's code repository (if any)
Homepage for chart's settings documentation
Name of the main function used to initialize the app. If the type is htmlwidgets, the js function must accept "location" and "settings" parameters (in that order) and have an .init() method, expecting a json data array. Otherwise, the r function should accept named data and settings parameters, and should be loaded in the user's namespace.
type of chart. Should be 'static', 'plotly' or 'module'
max width for the widget in pixels
array of text_key values (matching those used in settingsMetadata) for the required settings for this chart
path where the custom settings will be loaded/saved. If metadata is not found in that location, it will be read from the package (e.g. safetyGraphics::settingsMetadata), and then written to the specified location once the new chart has been added.
overwrite any existing chart metadata? Note that having multiple charts with the same name is not supported and will cause unexpected results. default = true
This function makes it easy for users to add a new chart to the safetyGraphics shiny app, by making updates to the underlying metadata used by the package. Specifically, the function adds a row to chartsMetadata.rda describing the chart and adds a column to settingsMetadata.rda specifying which settings are used with the chart. If new settings are needed for the chart, the user should call addSetting() for each new setting required.