{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "The kpis block (data). Reads: each tile's `source`: its row count, or a column's sum or average, or the first row's cell. Shape: any rows; a sum or avg column holds numbers.",
  "properties": {
    "kpis": {
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "The block's id: its Markdown anchor and its actions' route (`/act/<id>/<action>`). Default `<type>-<n>`, n counting blocks of this type depth-first from 1.",
          "pattern": "^[a-z][a-z0-9-]{1,38}$",
          "type": "string"
        },
        "tiles": {
          "description": "The tiles, in order.",
          "items": {
            "additionalProperties": false,
            "properties": {
              "badge": {
                "description": "A short badge beside the figure.",
                "maxLength": 30,
                "minLength": 1,
                "type": "string"
              },
              "caption": {
                "description": "A line under the figure.",
                "maxLength": 120,
                "minLength": 1,
                "type": "string"
              },
              "column": {
                "description": "The column the figure reads; required unless figure is count.",
                "pattern": "^[a-z][a-z0-9_]{0,62}$",
                "type": "string"
              },
              "figure": {
                "default": "count",
                "description": "count: the rows; sum and avg: `column` over the rows; value and text: the first row's `column`.",
                "enum": [
                  "count",
                  "sum",
                  "avg",
                  "value",
                  "text"
                ],
                "type": "string"
              },
              "format": {
                "default": "number",
                "description": "How the figure is written.",
                "enum": [
                  "number",
                  "usd",
                  "percent",
                  "duration",
                  "bytes"
                ],
                "type": "string"
              },
              "label": {
                "description": "The tile's label.",
                "maxLength": 60,
                "minLength": 1,
                "type": "string"
              },
              "source": {
                "description": "The source the figure reads.",
                "pattern": "^[a-z][a-z0-9_]{0,62}$",
                "type": "string"
              },
              "tone": {
                "default": "neutral",
                "description": "The tile's tone.",
                "enum": [
                  "neutral",
                  "ok",
                  "warn",
                  "bad",
                  "info"
                ],
                "type": "string"
              }
            },
            "required": [
              "label",
              "source"
            ],
            "type": "object"
          },
          "maxItems": 8,
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "tiles"
      ],
      "type": "object"
    }
  },
  "required": [
    "kpis"
  ],
  "title": "kpis",
  "type": "object"
}