Update a Widget - resource-watch/ocean-watch-data GitHub Wiki
Editing Widgets
To edit an existing widget or its metadata, the Ocean Watch data team uses the advanced_chart_widget_edit
script and the advanced_chart_widget_metadata_edit
script respectively. Add the widget ID and simply fill in the properties you would like to change and comment out those that you do not. If making minor changes, it can be helpful to first make an API call to the widget endpoint, copy the properties you wish to edit, and edit them in a text editor before copying them into the script. If making larger edits, consult the wiki page for the specific type of widget you are creating.
Updating widgets
Components of widgets that are likely to need updating after an underlying dataset is updated
Map widgets
- Layers: Most recent year or other new layer
- Title and widget metadata: If the
title
ordescription
contains a year, be sure to update - Links: Please ensure the
links
are directing to the newest version of the data
Chart widget
- Post-processing clacs table: Some widgets require additional data processing outside the initial upload of a dataset. See the widget folder in the repository to see if any post-processing analysis is involved in the workflow for a given widget. If so, follow the necessary steps outlined in the
README
to update the post-processing "calculations" table as well. url
query: in thewidgetConfig
property you may need to update the query to pull in a new table, a new year, or a subset of the data- Title and widget metadata: If the
title
ordescription
contains a year, be sure to update - Links: Please ensure the
links
are directing to the newest version of the data