Extension Response Schema

Note: this page is work in progress

Table

{
  "info": {
    "type": "table",
    "cols": [
      { "id": "from", "label": "From", "visible": true },
      { "id": "to", "label": "To" },
      { "id": "link", "label": "Link" }
    ]
  },
  "data": {
    "cols": ["from", "to", "link"],
    "rows": [
      [
        ["date", { "ts": 1733315825360 }],
        ["datetime", { "ts": 1734315825360 }],
        ["link", { "url": "https://gloodata.com", "label": "Gloodata" }]
      ]
    ]
  }
}

Infobox

{
  "info": {
    "type": "infobox",
    "cols": [
      { "id": "text", "label": "Text" },
      { "id": "number", "label": "Number" },
      { "id": "from", "label": "From", "visible": true },
      { "id": "from", "label": "From", "visible": true },
      { "id": "to", "label": "To", "visible": true },
      { "id": "link", "label": "Link", "visible": false },
      { "id": "phone", "label": "Phone", "visible": true },
      { "id": "mail", "label": "Mail", "visible": true }
    ]
  },
  "data": {
    "cols": [ "text", "number", "from", "to", "link", "phone", "mail" ],
    "row": [
      "hi",
      42,
      [ "date", { "ts": 1733316024684 } ],
      [ "datetime", { "ts": 1733315924684 } ],
      [ "link", { "url": "https://gloodata.com", "label": "Gloodata" } ],
      [ "phone", { "v": "555 1234 5678" } ],
      [ "mail", { "v": "alice@example.com" } ]
    ]
  }
}

Markdown

{
  "info": { "type": "markdown" },
  "data": { "text": "# Hi\n\n- one\n- two \n- tres" }
}

Mermaid Diagram

{
  "info": { "type": "markdown" },
  "data": { "text": "flowchart TD\n  A --> B" }
}

Mermaid Documentation

Series Chart

TODO

KPIs

{
  "info": { "type": "kpis" },
  "data": {
    "items": [
      {
        "bg": "<style>",
        "icon": {
          "id": "<icon-id>",
          "style": "<style>",
          "size": "<size>"
        },
        "value": { "text": "A", "style": "<style>", "size": "<size>" },
        "label": { "text": "B", "style": "<style>", "size": "<size>" },
        "top": { "text": "C", "style": "<style>", "size": "<size>" },
        "info": { /* ... */ }
        }
    ]
  }
}

Styles:

Sizes:

Icons: See Extension Icons

Image

{
  "info": { "type": "image" },
  "data": {
    "url": "https://example.com/image-path.png",
    "alt": "Alt Text"
  }
}

PDF

{
  "info": { "type": "pdf" },
  "data": {
    "url": "https://example.com/document-path.pdf"
  }
}

Audio Transcript

TODO

Area Map

{
    "info": {
      "type": "areamap",
      // optional, defaults to world if not set
      "mapId": "portugal",
      // optional, defaults to mapId if not set
      "infoId": "portugal",
      // optional, defaults to viridis if not set
      "colorMap": "jet"
    },
    "data": {
      "areas": [
        { "name": "PT-01", "value": 1 },
        { "name": "PT-02", "value": null },
        { "name": "PT-03", "value": 3, "color": "white" },
        { "name": "Lisboa", "value": 11 }
      ]
    }
  }

Google Map

TODO

Population Pyramid

{
    "info": { "type": "pop-pyramid" },
    "data": {
      "items": [
        {
          "label": "90-100",
          "start": 10,
          "end": 12,
          "startLabel": "ten!"
        },
        {
          "label": "80-90",
          "start": 230,
          "end": 251,
          "endLabel": "hi!"
        },
        {
          "label": "70-80",
          "start": 330,
          "end": 361,
          "endSize": 50
        },
        {
          "label": "60-70",
          "start": 430,
          "end": 471,
          "startSize": 50
        },
        { "label": "50-60", "start": 530, "end": 551 },
        { "label": "40-50", "start": 630, "end": 661 },
        { "label": "30-40", "start": 730, "end": 781 },
        { "label": "20-30", "start": 830, "end": 851 },
        { "label": "10-20", "start": 930, "end": 991 },
        { "label": "0-10", "start": 1030, "end": 1021 }
      ]
    }
  }