-
Notifications
You must be signed in to change notification settings - Fork 24
Adding a default chart
jwildfire edited this page Dec 4, 2019
·
2 revisions
-
Make a new branch of the safetyGraphics master repository.
-
Create a new charting function using the guidelines in the Create new charts vignette, unless you're making an htmlwidget. Htmlwidgets are drawn using a custom process, and must follow the structure by the existing widgets. To add a widget , do the following:
- add the js library to
inst/htmlwidgets/lib
- update
inst/htmlwidgets/chartRenderer.yaml
-
Drop the file containing the charting function in the
inst/custom
directory, under the subfolder that matches the chart type (static, plotly, or Shiny module). -
Update metadata
- Update metadata files:
- For all custom charts:
- Add a row for the new chart to
data-raw/chartsMetadata.csv
- Add a column for the new chart to
data-raw/settingsMetadataCharts.csv
.
- Add a row for the new chart to
- For charts that contain new settings:
- Add rows for new settings to
data-raw/settingsMetadata.csv
- Add defaults for new settings in
data-raw/generateSettingsMetadataDefaults.R
and re-run the file. - Add rows for new settings in
data-raw/settingsMetadataCharts.csv
. - Add rows for new settings in the data standard mappings in
data_raw/standardsMetaData.csv
- Add rows for new settings to
- For all custom charts:
- Run
data-raw/csv_to_rda.R
to save the files todata/
. - Add chart to documentation file for settingsMetadata:
R/settingsMetadata.R
. Appendchart_
to the name of your chart function/file and add it as an item in the list.
- Update metadata files:
-
Update package dependencies. For example, if you've added a plotly chart:
- Add plotly to DESCRIPTION file Imports
- Add
library(plotly)
to top ofglobal.R
file underinst/safetyGraphics_app
-
Update package documentation with
devtools::document()
. -
Rebuild the R package, test out the Shiny app, and make a PR to the safetyGraphics repo.