Skip to content

Configuration schema

Tashrif Billah edited this page Feb 5, 2022 · 4 revisions

Configurations uploaded through the web interface must be .json files that follow this format:

{
  "name": "Name of configuration",
  "config": [
    {
      "analysis": "Name of assessment",
      "category": "Name of category", // Optional, arbitrary name for grouping variables together in the display
      "color": [
        //Optional list of hex colors
      ],
      "variable": "Name of variable"
      "label": "Label for variable",
      "range": [
        //Number for minimum value,
        //Number for maximum value
      ],
      "text": //"true" if you want the value for this variable displayed as text, "false" if not
    },
    // ... Additional curly {} bracketed objects like the above
  ]
}

Here is an example of a JSON file that matches the schema:

{
  "name": "Phone Call Durations",
  "config": [
    {
      "analysis": "phone_calls_logbook_daily",
      "category": "phone calls",
      "color": [
        "#f7fcb9",
        "#addd8e",
        "#31a354"
      ],
      "variable": "incoming_call_duration_in_seconds_sum",
      "label": "Incoming Call Duration in Seconds (sum)",
      "range": [
        0,
        2000
      ],
      "text": false
    },
    {
      "analysis": "phone_calls_logbook_daily",
      "category": "phone calls",
      "color": [
        "#f7fcb9",
        "#addd8e",
        "#31a354"
      ],
      "variable": "outgoing_call_duration_in_seconds_sum",
      "label": "Outgoing Call Duration in Seconds (sum)",
      "range": [
        0,
        2000
      ],
      "text": false
    }
  ]
}

An image representation of the above JSON file is given below:

config_schema