G-Cubed charts guide

Table of contents

Using G-Cubed charts

G-Cubed charts can be viewed using the online G-Cubed Charts application.

TIP: You can also use your browser to save the the online G-Cubed Charts web-page to your local drive if you need to use G-Cubed charts offline.

Usage instructions

The G-Cubed charts webpage requires you to upload two files:

  1. a CSV file containing the definition of the charts that you want to view (the chartpack)
  2. the CSV file containing the projections data that you want to populate the charts with (the projections)

Once both files are uploaded, the charts will be display. There will be one chart for each chart defined in the chart-pack file. In each chart, there will be one series plotted for each series associated with the chart in the chart-pack file.

You can upload new chartpacks and new projection files and the charts will dynamically update.

G-Cubed chartpack file format

One or more example chart-pack files are provided in each model’s chartpacks folder is available.

The G-Cubed chartpack file must be a CSV file. The file must have a header row. The header row must contain the following column labels:

  1. type - one of pack, chart, or series, depending on the type of chart-pack object being described by the row.
  2. attributes - The attributes of the object.
  3. variable - The full name of the variable (capitalisation matters). This must only be used in series rows.
  4. label - The text string label describing the object, used for pack and chart titles and series legends.

The file must have exactly 4 columns.

Each subsequent row in the file describes one of the following object types, as indicated by the value in the type column:

  • pack - The chart pack itself. A chart pack file must only have one row that describes the pack. It must be the first row after the header row.
  • chart - A chart. A chart pack file must have at least one row that describes a chart.
  • series - A series in a chart. Each chart in a chart pack file must have at least one row that describes a series.

The attributes column contains zero or more name-value pairs, separated by the | character. The following attributes are supported:

  • color - The color to be used for the line showing a series, overriding the default color. The color attribute can be any valid HTML color string. e.g.:
    • blue
    • red
    • #ff0000
    • #f00
    • rgb(255,0,0)
    • rgba(255,0,0,0.5)
  • start_year=YYYY the first year to show in the horizontal axis of the chart. e.g. start_year=2018.

  • end_year=YYYY the last year to show in the horizontal axis of the chart. e.g. end_year=2050.

To specify a chart from 2020 to 2030, the attributes for the chart would contain start_year=2020|end_year=2030.

  • line to specify the line style for a series. Valid values include solid, dot, dash, longdash, dashdotand longdashdot.

  • max can be added to a pack or chart to specify a maximum value for the Y-axis.

  • min can be added to a pack or chart to specify a minimum value for the Y-axis.

Labels for packs, charts and series

The pack row must specify a label for the chart pack.

Chart row labels can be omitted, in which case a suitable label will be inferred from the series in the chart. Series row labels can also be omitted, in which case a suitable label will be inferred from the variable name. Typically, chart packs will only include a label for the pack, allowing all other labels to be inferred. When a label is specified, it overrides the inferred label.

Ordering of rows in a G-Cubed Chart-Pack file

The chart pack is created in the order of the rows in the chart pack definition file. Thus, the single pack row must be the first row in the file.

The single pack row is then followed by at least one chart row.

The chart row is followed by one or more series rows.

If there is another chart in the pack, the chart row for that chart comes next and it is followed by appropriate series rows. This continues until all charts in the pack have been defined. To reorder charts in the pack, reorder the rows in the chart pack definition file.

Series compatibility

All series in a single chart must have the same units of measurement. If a chart contains series with different units of measurement, an error will be displayed.

Quick generation of chart-pack files

The chartpack folder in each model is used to store various chartpacks, typically relevant to the experiments associated with that model. Copy and adapt existing chartpack files to create new ones that are specific to your requirements.

A quick way to add new charts is to copy lists of related variables out of a database or projections CSV file to create a new chart with a new set of series, one for each of the copied variables.

Projections files

The projections file must be a CSV file created by G-Cubed as a set of charting projections or as the deviations between two sets of charting projections.

The projections file columns will be:

  1. a column of G-Cubed variable names
  2. prefix - the variable name prefix
  3. set_member_descriptions - the values associated with each of the sets that the variable is defined over
  4. description - the decription of the variable
  5. units - the units that the variable is measured in
  6. vector - The G-Cubed vector type of the variable
  7. region - The G-Cubed region that the variable describes

Remaining columns will be for each of the projection years, in order, with the column label being the year in YYYY format.