{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://slashobserve.com/schemas/observespec.v0.json",
  "title": "Dashboard",
  "description": "ObserveSpec v0: one SlashObserve dashboard. Absent fields mean the default.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "specVersion",
    "title",
    "time",
    "panels"
  ],
  "properties": {
    "specVersion": {
      "const": "0"
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "description": {
      "type": "string",
      "maxLength": 2000
    },
    "tags": {
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "pattern": "^[a-z0-9][a-z0-9_.-]{0,39}$"
      }
    },
    "time": {
      "$ref": "#/$defs/timeRange"
    },
    "refresh": {
      "description": "Auto-refresh interval such as 30s, 1m, 1h or 1d.",
      "type": "string",
      "pattern": "^[1-9][0-9]{0,4}[smhd]$"
    },
    "timePicker": {
      "x-omitFromPrompt": true,
      "description": "What the time picker offers: hidden removes it, refreshIntervals replaces the auto-refresh choices and quickRanges the preset ranges. A refresh that is not in refreshIntervals is still allowed.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "hidden": {
          "type": "boolean"
        },
        "refreshIntervals": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,4}[smhd]$"
          }
        },
        "quickRanges": {
          "type": "array",
          "minItems": 1,
          "maxItems": 30,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": ["display", "from", "to"],
            "properties": {
              "display": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "from": {
                "$ref": "#/$defs/timeExpression"
              },
              "to": {
                "$ref": "#/$defs/timeExpression"
              }
            }
          }
        }
      }
    },
    "liveNow": {
      "x-omitFromPrompt": true,
      "description": "Refresh the dashboard every few seconds until a refresh interval is chosen, as Grafana's live now redraws time charts continuously.",
      "type": "boolean"
    },
    "timezone": {
      "description": "browser, utc or an IANA zone such as Asia/Kolkata. Relative times (now/d, now-1d) resolve in this zone.",
      "type": "string",
      "pattern": "^(browser|utc|[A-Za-z][A-Za-z0-9_+-]*(/[A-Za-z0-9_+-]+){0,2})$"
    },
    "weekStart": {
      "description": "The first day of the week for now/w. Absent means monday.",
      "enum": ["monday", "sunday", "saturday"]
    },
    "fiscalYearStartMonth": {
      "description": "The month the fiscal year starts in for now/fy and now/fQ, 0 (January) to 11 (December). Absent means 0.",
      "type": "integer",
      "minimum": 0,
      "maximum": 11
    },
    "nowDelay": {
      "description": "How far behind the real time now is for every relative time, such as 30s or 1m.",
      "type": "string",
      "pattern": "^[1-9][0-9]{0,4}[smh]$"
    },
    "cursorSync": {
      "description": "How hovering one time chart shows on the others: off, crosshair (the hovered time is marked on every time chart) or tooltip (their tooltips open too). Grafana's graphTooltip 0, 1 and 2.",
      "enum": ["off", "crosshair", "tooltip"]
    },
    "variables": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/variable"
      }
    },
    "links": {
      "type": "array",
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/dashboardLink"
      }
    },
    "panels": {
      "description": "At most 200 panels in total, row children included; ids are unique across all of them.",
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
        "$ref": "#/$defs/panel"
      }
    }
  },
  "$defs": {
    "timeRange": {
      "title": "TimeRange",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "$ref": "#/$defs/timeExpression"
        },
        "to": {
          "$ref": "#/$defs/timeExpression"
        }
      }
    },
    "timeExpression": {
      "description": "Relative (now, now-6h, now+1d, now-1d/d, now/fy for the start of the fiscal year, now/fQ for the fiscal quarter) or absolute RFC 3339 time.",
      "type": "string",
      "pattern": "^(now([+-][1-9][0-9]*[smhdwMy])?(/([smhdwMy]|fy|fQ))?|[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?(Z|[+-][0-9]{2}:[0-9]{2}))$"
    },
    "variableName": {
      "description": "Referenced in queries as $name, ${name} or ${name:format}.",
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,39}$"
    },
    "datasourceUid": {
      "title": "DatasourceUid",
      "description": "A configured datasource uid; its type comes from the server's registry.",
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,39}$"
    },
    "datasourceRef": {
      "title": "DatasourceRef",
      "description": "A configured datasource uid, or ${name} naming a datasource variable declared in variables (before this variable, when used by one); queries then run on the datasource selected in that variable, and macros follow its datasourceType.",
      "type": "string",
      "pattern": "^([A-Za-z0-9][A-Za-z0-9_-]{0,39}|\\$\\{[A-Za-z][A-Za-z0-9_]{0,39}\\})$"
    },
    "intervalRef": {
      "title": "IntervalRef",
      "description": "A minimum step such as 30s, or ${name} naming an interval variable; queries then use the step selected in that variable.",
      "type": "string",
      "pattern": "^([1-9][0-9]{0,4}(ms|[smhdwy])|\\$\\{[A-Za-z][A-Za-z0-9_]{0,39}\\})$"
    },
    "query": {
      "type": "string",
      "minLength": 1,
      "maxLength": 20000
    },
    "color": {
      "title": "Color",
      "description": "A semantic color (ok, info, warning, critical, or text, the theme's text color) or a #rrggbb hex color.",
      "type": "string",
      "pattern": "^(ok|info|warning|critical|text|#[0-9a-fA-F]{6})$"
    },
    "unit": {
      "title": "Unit",
      "description": "A Grafana unit id, or a custom suffix:, prefix:, time:, si:, count: or currency: unit.",
      "anyOf": [
        {
          "enum": [
            "none",
            "short",
            "sishort",
            "percent",
            "percentunit",
            "humidity",
            "dB",
            "hex0x",
            "hex",
            "sci",
            "locale",
            "pixel",
            "string",
            "bool",
            "bool_yes_no",
            "bool_on_off",
            "bits",
            "bytes",
            "kbytes",
            "mbytes",
            "gbytes",
            "tbytes",
            "pbytes",
            "decbits",
            "decbytes",
            "deckbytes",
            "decmbytes",
            "decgbytes",
            "dectbytes",
            "decpbytes",
            "pps",
            "binBps",
            "Bps",
            "binbps",
            "bps",
            "KiBs",
            "Kibits",
            "KBs",
            "Kbits",
            "MiBs",
            "Mibits",
            "MBs",
            "Mbits",
            "GiBs",
            "Gibits",
            "GBs",
            "Gbits",
            "TiBs",
            "Tibits",
            "TBs",
            "Tbits",
            "cps",
            "ops",
            "reqps",
            "rps",
            "wps",
            "iops",
            "eps",
            "mps",
            "recps",
            "rowsps",
            "cpm",
            "opm",
            "rpm",
            "wpm",
            "hertz",
            "ns",
            "µs",
            "ms",
            "s",
            "m",
            "h",
            "d",
            "dtdurationms",
            "dtdurations",
            "dthms",
            "dtdhms",
            "timeticks",
            "clockms",
            "clocks",
            "dateTimeAsIso",
            "dateTimeAsIsoNoDateIfToday",
            "dateTimeAsUS",
            "dateTimeAsUSNoDateIfToday",
            "dateTimeAsLocal",
            "dateTimeAsLocalNoDateIfToday",
            "dateTimeAsSystem",
            "dateTimeFromNow",
            "watt",
            "kwatt",
            "mwatt",
            "watth",
            "kwatth",
            "joule",
            "amp",
            "mamp",
            "volt",
            "mvolt",
            "dBm",
            "celsius",
            "fahrenheit",
            "kelvin",
            "currencyUSD",
            "currencyEUR",
            "currencyGBP",
            "currencyJPY",
            "currencyINR",
            "lengthmm",
            "lengthm",
            "lengthkm",
            "massg",
            "masskg"
          ]
        },
        {
          "type": "string",
          "pattern": "^(suffix|prefix):.{1,20}$"
        },
        {
          "x-omitFromPrompt": true,
          "enum": [
            "candela",
            "accMS2",
            "accFS2",
            "accG",
            "degree",
            "radian",
            "grad",
            "arcmin",
            "arcsec",
            "areaM2",
            "areaF2",
            "areaMI2",
            "areaKM2",
            "areaHa",
            "flops",
            "mflops",
            "gflops",
            "tflops",
            "pflops",
            "eflops",
            "zflops",
            "yflops",
            "ppm",
            "conppb",
            "conngm3",
            "conngNm3",
            "conμgm3",
            "conμgNm3",
            "conmgm3",
            "conmgNm3",
            "congm3",
            "congNm3",
            "conmgdL",
            "conmmolL",
            "currencyRUB",
            "currencyUAH",
            "currencyBRL",
            "currencyDKK",
            "currencyISK",
            "currencyNOK",
            "currencySEK",
            "currencyCZK",
            "currencyCHF",
            "currencyPLN",
            "currencyZAR",
            "currencyKRW",
            "currencyIDR",
            "currencyPHP",
            "currencyVND",
            "currencyTRY",
            "currencyMYR",
            "currencyXPF",
            "currencyBGN",
            "currencyPYG",
            "currencyUYU",
            "currencyILS",
            "currencyBTC",
            "currencymBTC",
            "currencyμBTC",
            "PiBs",
            "Pibits",
            "PBs",
            "Pbits",
            "megwatt",
            "gwatt",
            "Wm2",
            "voltamp",
            "kvoltamp",
            "voltampreact",
            "kvoltampreact",
            "watthperkg",
            "kwattm",
            "mwatth",
            "amph",
            "kamph",
            "mamph",
            "ev",
            "kamp",
            "kvolt",
            "ohm",
            "kohm",
            "Mohm",
            "mohm",
            "farad",
            "µfarad",
            "nfarad",
            "pfarad",
            "ffarad",
            "henry",
            "mhenry",
            "µhenry",
            "lumens",
            "flowgpm",
            "flowcms",
            "flowcfs",
            "flowcfm",
            "litreh",
            "flowlpm",
            "flowmlpm",
            "lux",
            "forceNm",
            "forcekNm",
            "forceN",
            "forcekN",
            "Hs",
            "KHs",
            "MHs",
            "GHs",
            "THs",
            "PHs",
            "EHs",
            "lengthin",
            "lengthft",
            "lengthmi",
            "massmg",
            "masslb",
            "masst",
            "pressurembar",
            "pressurebar",
            "pressurekbar",
            "pressurepa",
            "pressurehpa",
            "pressurekpa",
            "pressurehg",
            "pressurepsi",
            "radbq",
            "radci",
            "radgy",
            "radrad",
            "radsv",
            "radmsv",
            "radusv",
            "radrem",
            "radexpckg",
            "radr",
            "radsvh",
            "radmsvh",
            "radusvh",
            "rotrpm",
            "rothz",
            "rotkhz",
            "rotrads",
            "rotdegs",
            "velocityms",
            "velocitykmh",
            "velocitymph",
            "velocityknot",
            "mlitre",
            "litre",
            "m3",
            "Nm3",
            "dm3",
            "gallons"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "string",
          "pattern": "^(time|si|count|currency):.{1,40}$"
        }
      ]
    },
    "reducer": {
      "title": "Reducer",
      "anyOf": [
        {
          "enum": [
            "last",
            "lastNotNull",
            "first",
            "firstNotNull",
            "min",
            "max",
            "mean",
            "median",
            "sum",
            "count",
            "range",
            "delta",
            "diff",
            "stdDev",
            "distinctCount",
            "changeCount"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "enum": [
            "variance",
            "step",
            "diffperc",
            "logmin",
            "countAll"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "enum": [
            "p1",
            "p2",
            "p3",
            "p4",
            "p5",
            "p6",
            "p7",
            "p8",
            "p9",
            "p10",
            "p11",
            "p12",
            "p13",
            "p14",
            "p15",
            "p16",
            "p17",
            "p18",
            "p19",
            "p20",
            "p21",
            "p22",
            "p23",
            "p24",
            "p25",
            "p26",
            "p27",
            "p28",
            "p29",
            "p30",
            "p31",
            "p32",
            "p33",
            "p34",
            "p35",
            "p36",
            "p37",
            "p38",
            "p39",
            "p40",
            "p41",
            "p42",
            "p43",
            "p44",
            "p45",
            "p46",
            "p47",
            "p48",
            "p49",
            "p50",
            "p51",
            "p52",
            "p53",
            "p54",
            "p55",
            "p56",
            "p57",
            "p58",
            "p59",
            "p60",
            "p61",
            "p62",
            "p63",
            "p64",
            "p65",
            "p66",
            "p67",
            "p68",
            "p69",
            "p70",
            "p71",
            "p72",
            "p73",
            "p74",
            "p75",
            "p76",
            "p77",
            "p78",
            "p79",
            "p80",
            "p81",
            "p82",
            "p83",
            "p84",
            "p85",
            "p86",
            "p87",
            "p88",
            "p89",
            "p90",
            "p91",
            "p92",
            "p93",
            "p94",
            "p95",
            "p96",
            "p97",
            "p98",
            "p99"
          ]
        }
      ]
    },
    "anyReducer": {
      "title": "AnyReducer",
      "description": "A reducer, or one whose result is not a number: allIsNull and allIsZero answer true or false, allValues and uniqueValues list the values as one text.",
      "anyOf": [
        {
          "$ref": "#/$defs/reducer"
        },
        {
          "x-omitFromPrompt": true,
          "enum": [
            "allIsNull",
            "allIsZero",
            "allValues",
            "uniqueValues"
          ]
        }
      ]
    },
    "heatmapBuckets": {
      "x-omitFromPrompt": true,
      "title": "HeatmapBuckets",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "mode": {
          "enum": [
            "size",
            "count"
          ]
        },
        "value": {
          "type": "number",
          "exclusiveMinimum": 0
        }
      },
      "required": [
        "mode"
      ]
    },
    "selection": {
      "title": "Selection",
      "description": "Default selection: one value, several for a multi variable, or $__all.",
      "oneOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        {
          "type": "array",
          "minItems": 1,
          "maxItems": 200,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          }
        }
      ]
    },
    "queryVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "query"
        },
        "datasource": {
          "$ref": "#/$defs/datasourceRef"
        },
        "query": {
          "$ref": "#/$defs/query"
        },
        "regex": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "sort": {
          "enum": [
            "alpha",
            "alphaDesc",
            "num",
            "numDesc",
            "alphaCaseInsensitive",
            "alphaCaseInsensitiveDesc",
            "natural",
            "naturalDesc"
          ]
        },
        "refresh": {
          "anyOf": [
            {
              "enum": [
                "load",
                "timeRange"
              ]
            },
            {
              "x-omitFromPrompt": true,
              "const": "never",
              "description": "The query is not run; only staticOptions are offered."
            }
          ]
        },
        "staticOptions": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "text": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              "value": {
                "type": "string",
                "maxLength": 500
              }
            },
            "required": [
              "text",
              "value"
            ]
          },
          "description": "Options offered next to the query results."
        },
        "staticOrder": {
          "x-omitFromPrompt": true,
          "enum": [
            "before",
            "after",
            "sorted"
          ],
          "description": "Where staticOptions go: before the query results (the default), after them, or merged and sorted with the variable's sort."
        },
        "allowCustomValue": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "multi": {
          "type": "boolean"
        },
        "includeAll": {
          "type": "boolean"
        },
        "allValue": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "default": {
          "$ref": "#/$defs/selection"
        }
      },
      "required": [
        "name",
        "type",
        "datasource",
        "query"
      ],
      "title": "QueryVariable"
    },
    "customVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "custom"
        },
        "options": {
          "type": "array",
          "minItems": 1,
          "maxItems": 200,
          "items": {
            "oneOf": [
              {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              },
              {
                "x-omitFromPrompt": true,
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "value": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "text",
                  "value"
                ]
              }
            ]
          }
        },
        "allowCustomValue": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "multi": {
          "type": "boolean"
        },
        "includeAll": {
          "type": "boolean"
        },
        "allValue": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "default": {
          "$ref": "#/$defs/selection"
        }
      },
      "required": [
        "name",
        "type",
        "options"
      ],
      "title": "CustomVariable"
    },
    "constantVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "constant"
        },
        "value": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        }
      },
      "required": [
        "name",
        "type",
        "value"
      ],
      "title": "ConstantVariable"
    },
    "intervalVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "interval"
        },
        "options": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[1-9][0-9]{0,4}(ms|[smhdwy])$"
          }
        },
        "auto": {
          "type": "boolean"
        },
        "autoSteps": {
          "type": "integer",
          "minimum": 1,
          "maximum": 1000
        },
        "autoMin": {
          "type": "string",
          "pattern": "^[1-9][0-9]{0,4}(ms|[smhdwy])$"
        },
        "default": {
          "type": "string",
          "pattern": "^[1-9][0-9]{0,4}(ms|[smhdwy])$"
        }
      },
      "required": [
        "name",
        "type",
        "options"
      ],
      "title": "IntervalVariable"
    },
    "textboxVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "textbox"
        },
        "default": {
          "type": "string",
          "minLength": 0,
          "maxLength": 200
        }
      },
      "required": [
        "name",
        "type"
      ],
      "title": "TextboxVariable"
    },
    "datasourceVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "datasource"
        },
        "datasourceType": {
          "enum": [
            "prometheus",
            "clickhouse"
          ]
        },
        "regex": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "default": {
          "$ref": "#/$defs/datasourceUid"
        }
      },
      "required": [
        "name",
        "type",
        "datasourceType"
      ],
      "title": "DatasourceVariable"
    },
    "adhocFilter": {
      "x-omitFromPrompt": true,
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "key": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "operator": {
          "enum": [
            "=",
            "!=",
            "=~",
            "!~",
            "<",
            ">"
          ],
          "description": "< and > compare as numbers when both sides are numbers, else as text; ClickHouse only."
        },
        "value": {
          "type": "string",
          "maxLength": 500
        },
        "keyLabel": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 200,
          "description": "Text shown on the chip instead of the key."
        },
        "valueLabel": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 500,
          "description": "Text shown on the chip instead of the value."
        },
        "condition": {
          "x-omitFromPrompt": true,
          "enum": [
            "and",
            "or"
          ],
          "description": "How the filter joins the filters before it: and (default) extends the current group, or starts a new group, so a, b, or c means (a AND b) OR c. ClickHouse only."
        }
      },
      "required": [
        "key",
        "operator",
        "value"
      ]
    },
    "adhocVariable": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "adhoc"
        },
        "datasource": {
          "$ref": "#/$defs/datasourceRef"
        },
        "applyToAll": {
          "x-omitFromPrompt": true,
          "const": true,
          "description": "ClickHouse only: also filter every query on this datasource that does not use this variable, on each table the query reads."
        },
        "default": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/adhocFilter"
          }
        },
        "baseFilters": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/adhocFilter"
          },
          "description": "Filters always applied to this variable's queries, ANDed with the selected filters as a whole; never shown and never in the URL."
        },
        "keys": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200
          },
          "description": "The keys the filter picker offers instead of asking the datasource."
        },
        "listedValuesOnly": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "A filter's key and value must be picked from the lists the picker shows; absent means any text may be typed."
        }
      },
      "required": [
        "name",
        "type",
        "datasource"
      ],
      "title": "AdhocVariable"
    },
    "groupByVariable": {
      "x-omitFromPrompt": false,
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "name": {
          "$ref": "#/$defs/variableName"
        },
        "label": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "description": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "hide": {
          "x-omitFromPrompt": true,
          "enum": [
            "label",
            "variable"
          ]
        },
        "skipUrlSync": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "The variable's value is not read from or written to the URL."
        },
        "type": {
          "const": "groupby"
        },
        "datasource": {
          "$ref": "#/$defs/datasourceRef"
        },
        "default": {
          "x-omitFromPrompt": true,
          "type": "array",
          "maxItems": 20,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,199}$"
          }
        },
        "keys": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,199}$"
          },
          "description": "The labels the picker offers instead of asking the datasource."
        }
      },
      "required": [
        "name",
        "type",
        "datasource"
      ],
      "title": "GroupByVariable"
    },
    "variable": {
      "title": "Variable",
      "type": "object",
      "discriminator": {
        "propertyName": "type"
      },
      "oneOf": [
        {
          "$ref": "#/$defs/queryVariable"
        },
        {
          "$ref": "#/$defs/customVariable"
        },
        {
          "$ref": "#/$defs/constantVariable"
        },
        {
          "$ref": "#/$defs/intervalVariable"
        },
        {
          "$ref": "#/$defs/textboxVariable"
        },
        {
          "$ref": "#/$defs/datasourceVariable"
        },
        {
          "$ref": "#/$defs/adhocVariable"
        },
        {
          "$ref": "#/$defs/groupByVariable"
        }
      ]
    },
    "gridPos": {
      "title": "GridPos",
      "description": "Position on the 24-column grid; x + w must not exceed 24.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "x",
        "y",
        "w",
        "h"
      ],
      "properties": {
        "x": {
          "type": "integer",
          "minimum": 0,
          "maximum": 23
        },
        "y": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10000
        },
        "w": {
          "type": "integer",
          "minimum": 1,
          "maximum": 24
        },
        "h": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        }
      }
    },
    "threshold": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "value": {
          "type": "number"
        },
        "color": {
          "$ref": "#/$defs/color"
        }
      },
      "required": [
        "color"
      ],
      "title": "Threshold",
      "description": "Only the first step may omit value; it is then the base color below every other step."
    },
    "thresholds": {
      "description": "Strictly ascending by value.",
      "type": "array",
      "minItems": 1,
      "maxItems": 10,
      "items": {
        "$ref": "#/$defs/threshold"
      }
    },
    "mapping": {
      "title": "Mapping",
      "description": "Value mapping; needs text, color or both.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "value": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "color": {
              "$ref": "#/$defs/color"
            }
          },
          "required": [
            "value"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "range": {
              "type": "array",
              "prefixItems": [
                {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                {
                  "type": [
                    "number",
                    "null"
                  ]
                }
              ],
              "minItems": 2,
              "maxItems": 2
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "color": {
              "$ref": "#/$defs/color"
            }
          },
          "required": [
            "range"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "regex": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "color": {
              "$ref": "#/$defs/color"
            }
          },
          "required": [
            "regex"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "special": {
              "enum": [
                "null",
                "nan",
                "empty",
                "true",
                "false"
              ]
            },
            "text": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "color": {
              "$ref": "#/$defs/color"
            }
          },
          "required": [
            "special"
          ]
        }
      ]
    },
    "link": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "newTab": {
          "type": "boolean"
        },
        "oneClick": {
          "x-omitFromPrompt": true,
          "description": "A data link on a stat, gauge, bar gauge or table cell that makes the whole tile, bar, gauge or cell the link when it is the only data link there.",
          "type": "boolean"
        }
      },
      "required": [
        "title",
        "url"
      ],
      "title": "Link",
      "description": "Panel, dashboard or data link; ${var} and ${__data.fields.x} are interpolated."
    },
    "dashboardLink": {
      "x-omitFromPrompt": false,
      "title": "DashboardLink",
      "description": "A dashboard link, either to an address (title and url) or, with type dashboards, to the other dashboards that carry every one of the tags (all other dashboards when there are none), shown inline or as one dropdown. keepTime adds the current from and to and includeVars the var-* selections.",
      "type": "object",
      "additionalProperties": false,
      "required": ["title"],
      "properties": {
        "type": {
          "const": "dashboards"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "url": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "tags": {
          "type": "array",
          "maxItems": 20,
          "uniqueItems": true,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_.-]{0,39}$"
          }
        },
        "asDropdown": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "newTab": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "keepTime": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "includeVars": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "tooltip": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      },
      "if": {
        "type": "object",
        "properties": {
          "type": true
        },
        "required": ["type"]
      },
      "then": {
        "properties": {
          "url": false
        }
      },
      "else": {
        "required": ["url"],
        "properties": {
          "tags": false,
          "asDropdown": false
        }
      }
    },
    "fieldProps": {
      "title": "FieldProps",
      "description": "Display properties shared by a panel and its overrides.",
      "type": "object",
      "properties": {
        "unit": {
          "$ref": "#/$defs/unit"
        },
        "decimals": {
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "min": {
          "type": "number"
        },
        "max": {
          "type": "number"
        },
        "fieldMinMax": {
          "x-omitFromPrompt": true,
          "description": "Gauges and bar gauges that find their range from the data: true ranges each field by its own values, false (the default) by the values of every field shown. Other panels already range each field by its own values.",
          "type": "boolean"
        },
        "thresholds": {
          "$ref": "#/$defs/thresholds"
        },
        "thresholdMode": {
          "enum": [
            "absolute",
            "percentage"
          ]
        },
        "color": {
          "$ref": "#/$defs/color"
        },
        "colorMode": {
          "x-omitFromPrompt": true,
          "enum": [
            "palette",
            "paletteByName",
            "fixed",
            "shades",
            "thresholds",
            "scheme"
          ]
        },
        "colorScheme": {
          "x-omitFromPrompt": true,
          "enum": [
            "greenYellowRed",
            "redYellowGreen",
            "blueYellowRed",
            "yellowRed",
            "bluePurple",
            "yellowBlue",
            "blues",
            "reds",
            "greens",
            "purples",
            "oranges",
            "viridis",
            "magma",
            "plasma",
            "inferno",
            "cividis",
            "warm"
          ]
        },
        "colorBy": {
          "x-omitFromPrompt": true,
          "enum": [
            "last",
            "min",
            "max"
          ]
        },
        "displayName": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "noValue": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "mappings": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "$ref": "#/$defs/mapping"
          }
        },
        "links": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/link"
          }
        },
        "actions": {
          "x-omitFromPrompt": true,
          "description": "HTTP actions a person with Edit runs from table cells, stat tiles, gauges and bars; only people and imports write them.",
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/action"
          }
        },
        "style": {
          "enum": [
            "line",
            "bars",
            "points"
          ]
        },
        "fill": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "lineStyle": {
          "x-omitFromPrompt": true,
          "enum": [
            "solid",
            "dashed",
            "dotted",
            "square"
          ],
          "description": "The pattern of a line: dashed, dotted (round dots) or square (square dots)."
        },
        "lineDash": {
          "x-omitFromPrompt": true,
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100
          },
          "description": "The dash and gap lengths in pixels when lineStyle is dashed."
        },
        "lineColor": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/color",
          "description": "A fixed color for the line, overriding the series color for the line only."
        },
        "fillColor": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/color",
          "description": "A fixed color for the area fill, overriding the series color for the fill only."
        },
        "pointColor": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/color",
          "description": "A fixed color for the points, overriding the series color for the points only."
        },
        "showValues": {
          "x-omitFromPrompt": true,
          "type": "boolean",
          "description": "Print each point's formatted value above it."
        },
        "lineInterpolation": {
          "x-omitFromPrompt": false,
          "enum": [
            "linear",
            "smooth",
            "stepBefore",
            "stepAfter"
          ]
        },
        "lineWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 10
        },
        "points": {
          "x-omitFromPrompt": false,
          "enum": [
            "auto",
            "always",
            "never"
          ]
        },
        "pointSize": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 1,
          "maximum": 40
        },
        "pointShape": {
          "x-omitFromPrompt": true,
          "enum": [
            "circle",
            "square"
          ],
          "description": "The shape of the points on every panel that draws points."
        },
        "pointStrokeWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "spanNulls": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 31536000000
            }
          ]
        },
        "stack": {
          "enum": [
            "none",
            "normal",
            "percent"
          ]
        },
        "axis": {
          "enum": [
            "left",
            "right",
            "hidden"
          ]
        },
        "hidden": {
          "type": "boolean"
        },
        "axisLabel": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "axisSoftMin": {
          "type": "number"
        },
        "axisSoftMax": {
          "type": "number"
        },
        "scale": {
          "enum": [
            "linear",
            "log",
            "symlog"
          ]
        },
        "logBase": {
          "enum": [
            2,
            10
          ]
        },
        "linearThreshold": {
          "x-omitFromPrompt": true,
          "type": "number",
          "exclusiveMinimum": 0
        },
        "axisCenteredZero": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "axisWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 400
        },
        "axisGrid": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "axisBorder": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "axisColor": {
          "x-omitFromPrompt": true,
          "enum": [
            "text",
            "series"
          ]
        },
        "width": {
          "x-omitFromPrompt": true,
          "description": "A table column's fixed width in pixels; absent means the column shares the remaining width. Only table panels draw it.",
          "type": "integer",
          "minimum": 20,
          "maximum": 2000
        },
        "minWidth": {
          "x-omitFromPrompt": true,
          "description": "The least width in pixels a table column shrinks to. Only table panels draw it.",
          "type": "integer",
          "minimum": 20,
          "maximum": 2000
        },
        "align": {
          "x-omitFromPrompt": true,
          "description": "Where a table column puts its header and cells; auto right-aligns numbers and left-aligns the rest. Only table panels draw it.",
          "enum": [
            "auto",
            "left",
            "center",
            "right"
          ]
        },
        "filterable": {
          "x-omitFromPrompt": true,
          "description": "Adds a value filter to the table column's header. Only table panels draw it.",
          "type": "boolean"
        },
        "inspect": {
          "x-omitFromPrompt": true,
          "description": "Adds a button to every cell of the table column that opens its value in a dialog. Only table panels draw it.",
          "type": "boolean"
        },
        "hideHeader": {
          "x-omitFromPrompt": true,
          "description": "Hides the text of the table column's header; screen readers still read it. Only table panels draw it.",
          "type": "boolean"
        },
        "wrapHeader": {
          "x-omitFromPrompt": true,
          "description": "Wraps the text of the table column's header onto several lines. Only table panels draw it.",
          "type": "boolean"
        },
        "fieldDescription": {
          "x-omitFromPrompt": true,
          "description": "Describes the field; a table shows it as a tooltip on the column header. Named apart from the panel's own description because field props sit beside it on the panel. Only table panels draw it.",
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "tooltipField": {
          "x-omitFromPrompt": true,
          "description": "The name of a field whose value in the same row is shown as a tooltip on this column's cells. Only table panels draw it.",
          "$ref": "#/$defs/fieldName"
        },
        "tooltipPlacement": {
          "x-omitFromPrompt": true,
          "description": "Where the cell tooltip of tooltipField opens; auto lets the browser choose. Only table panels draw it.",
          "enum": [
            "auto",
            "top",
            "bottom",
            "left",
            "right"
          ]
        },
        "cell": {
          "x-omitFromPrompt": true,
          "description": "How a table column draws its cells; absent means the plain cell with colors from thresholds and colored mappings. Only table panels draw it.",
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "enum": [
                "auto",
                "text",
                "background",
                "gauge",
                "sparkline",
                "json",
                "image",
                "links",
                "pill",
                "markdown",
                "actions"
              ]
            },
            "gaugeStyle": {
              "enum": [
                "basic",
                "lcd"
              ]
            },
            "valueMode": {
              "enum": [
                "color",
                "text",
                "hidden"
              ]
            },
            "wholeRow": {
              "type": "boolean"
            },
            "wrap": {
              "type": "boolean"
            },
            "dynamicHeight": {
              "description": "Lets the cell grow to its content up to the table's maxRowHeight.",
              "type": "boolean"
            },
            "imageAlt": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "imageTitle": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "required": [
            "type"
          ]
        },
        "valueTransform": {
          "x-omitFromPrompt": true,
          "enum": [
            "negativeY",
            "constant"
          ]
        },
        "hideInLegend": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "hideInTooltip": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "stackGroup": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 50
        },
        "fillBelowTo": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "insertNulls": {
          "x-omitFromPrompt": true,
          "description": "Break the series where two points are further apart than this many milliseconds, or, as true, further apart than the query interval.",
          "anyOf": [
            {
              "type": "integer",
              "minimum": 1,
              "maximum": 31536000000
            },
            {
              "const": true
            }
          ]
        },
        "neutral": {
          "x-omitFromPrompt": true,
          "description": "The value a gauge or bar gauge bar grows from instead of the minimum.",
          "type": "number"
        },
        "nullAsZero": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "barAlignment": {
          "x-omitFromPrompt": true,
          "enum": [
            "before",
            "center",
            "after"
          ]
        },
        "barWidthFactor": {
          "x-omitFromPrompt": true,
          "type": "number",
          "minimum": 0.05,
          "maximum": 1
        },
        "barMaxWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 1,
          "maximum": 200
        },
        "thresholdsStyle": {
          "x-omitFromPrompt": true,
          "enum": [
            "off",
            "line",
            "dashed",
            "area",
            "line+area",
            "dashed+area",
            "series"
          ]
        }
      }
    },
    "match": {
      "title": "Match",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "query": {
              "$ref": "#/$defs/queryRef"
            }
          },
          "required": [
            "query"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "series": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "required": [
            "series"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "seriesRegex": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "required": [
            "seriesRegex"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "field": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          },
          "required": [
            "field"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "fieldType": {
              "enum": [
                "number",
                "string",
                "time",
                "boolean"
              ]
            }
          },
          "required": [
            "fieldType"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "value": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "reducer": {
                  "anyOf": [
                    {
                      "$ref": "#/$defs/reducer"
                    },
                    {
                      "x-omitFromPrompt": true,
                      "enum": [
                        "allIsNull",
                        "allIsZero"
                      ]
                    }
                  ]
                },
                "op": {
                  "enum": [
                    "eq",
                    "neq",
                    "lt",
                    "lte",
                    "gt",
                    "gte"
                  ]
                },
                "value": {
                  "type": "number"
                }
              },
              "required": [
                "reducer",
                "op",
                "value"
              ]
            }
          },
          "required": [
            "value"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "fields": {
              "enum": [
                "first",
                "firstTime",
                "all"
              ]
            }
          },
          "required": [
            "fields"
          ]
        }
      ]
    },
    "override": {
      "title": "Override",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/fieldProps"
        }
      ],
      "properties": {
        "match": {
          "$ref": "#/$defs/match"
        }
      },
      "required": [
        "match"
      ],
      "unevaluatedProperties": false,
      "minProperties": 2
    },
    "queryRef": {
      "type": "string",
      "pattern": "^[A-Za-z][A-Za-z0-9_]{0,19}$"
    },
    "panelQuery": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": {
          "$ref": "#/$defs/queryRef"
        },
        "query": {
          "$ref": "#/$defs/query"
        },
        "legend": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "datasource": {
          "$ref": "#/$defs/datasourceRef"
        },
        "instant": {
          "type": "boolean"
        },
        "format": {
          "enum": [
            "timeseries",
            "table",
            "heatmap",
            "logs"
          ]
        },
        "interval": {
          "$ref": "#/$defs/intervalRef"
        },
        "intervalFactor": {
          "description": "Grafana's resolution 1/N: the query's step is multiplied by N.",
          "type": "integer",
          "minimum": 2,
          "maximum": 10
        },
        "exemplar": {
          "description": "Prometheus only: also fetch exemplars for this range query and mark them on the chart.",
          "type": "boolean"
        },
        "hide": {
          "type": "boolean"
        }
      },
      "required": [
        "query"
      ],
      "title": "PanelQuery",
      "description": "ref defaults to A, B, C by position; datasource defaults to the panel's."
    },
    "expressionQuery": {
      "title": "ExpressionQuery",
      "description": "A server-side expression the query proxy evaluates over other queries of the same panel; it has no datasource and its ref is required so references stay stable.",
      "x-omitFromPrompt": true,
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": {
          "$ref": "#/$defs/queryRef"
        },
        "hide": {
          "type": "boolean"
        },
        "expression": {
          "type": "object",
          "discriminator": {
            "propertyName": "type"
          },
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "math"
                },
                "math": {
                  "description": "Arithmetic over query refs written $A or ${A}, such as $A * 2 or abs($A) / $B.",
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 2000
                }
              },
              "required": [
                "type",
                "math"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "reduce"
                },
                "input": {
                  "$ref": "#/$defs/queryRef"
                },
                "reducer": {
                  "enum": [
                    "mean",
                    "min",
                    "max",
                    "sum",
                    "count",
                    "last",
                    "median"
                  ]
                },
                "mode": {
                  "description": "How non-number values are treated; strict (the default) reduces a series holding one to NaN.",
                  "enum": [
                    "strict",
                    "dropNonNumbers",
                    "replaceNonNumbers"
                  ]
                },
                "replaceWith": {
                  "description": "The number that replaces non-number values; required with replaceNonNumbers and refused otherwise.",
                  "type": "number"
                }
              },
              "required": [
                "type",
                "input",
                "reducer"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "resample"
                },
                "input": {
                  "$ref": "#/$defs/queryRef"
                },
                "window": {
                  "type": "string",
                  "pattern": "^[1-9][0-9]{0,4}(ms|[smhdwy])$"
                },
                "downsampler": {
                  "enum": [
                    "mean",
                    "min",
                    "max",
                    "sum",
                    "last"
                  ]
                },
                "upsampler": {
                  "enum": [
                    "pad",
                    "backfill",
                    "fillNA"
                  ]
                }
              },
              "required": [
                "type",
                "input",
                "window",
                "downsampler",
                "upsampler"
              ]
            },
            {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "type": {
                  "const": "threshold"
                },
                "input": {
                  "$ref": "#/$defs/queryRef"
                },
                "evaluator": {
                  "enum": [
                    "gt",
                    "lt",
                    "withinRange",
                    "outsideRange",
                    "withinRangeIncluded",
                    "outsideRangeIncluded"
                  ]
                },
                "params": {
                  "description": "One number for gt and lt, a lower and an upper number for the range evaluators.",
                  "type": "array",
                  "minItems": 1,
                  "maxItems": 2,
                  "items": {
                    "type": "number"
                  }
                }
              },
              "required": [
                "type",
                "input",
                "evaluator",
                "params"
              ]
            }
          ]
        }
      },
      "required": [
        "ref",
        "expression"
      ]
    },
    "dashboardQuery": {
      "title": "DashboardQuery",
      "description": "Reuses the results of another data panel of this dashboard (Grafana's -- Dashboard -- source); a panel that has one has exactly this query and no datasource, interval, maxDataPoints, timeFrom or timeShift of its own.",
      "x-omitFromPrompt": true,
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "ref": {
          "$ref": "#/$defs/queryRef"
        },
        "hide": {
          "type": "boolean"
        },
        "source": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "panel": {
              "description": "The id of the data panel whose results are reused; it must not itself reuse another panel or repeat.",
              "type": "string",
              "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
            },
            "withTransforms": {
              "description": "Apply the source panel's transforms to its results before this panel's own.",
              "type": "boolean"
            },
            "adHocFilters": {
              "description": "Filter the reused rows by the dashboard's ad hoc filters, after the source panel's transforms (when withTransforms is set) and before this panel's own: a filter applies to the rows of a frame that has a field named by its key.",
              "type": "boolean",
              "x-omitFromPrompt": true
            }
          },
          "required": [
            "panel"
          ]
        }
      },
      "required": [
        "source"
      ]
    },
    "transformQueries": {
      "description": "The queries a transformation applies to: only their frames go through it, the other frames pass through unchanged, and absent means every query.",
      "type": "array",
      "minItems": 1,
      "maxItems": 26,
      "uniqueItems": true,
      "items": {
        "$ref": "#/$defs/queryRef"
      }
    },
    "transform": {
      "title": "Transform",
      "type": "object",
      "discriminator": {
        "propertyName": "type"
      },
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "merge"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "seriesToRows"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "organize"
            },
            "exclude": {
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "rename": {
              "type": "object",
              "maxProperties": 100,
              "additionalProperties": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "order": {
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "include": {
              "x-omitFromPrompt": true,
              "description": "Keep only the fields with these names; exclude then removes from them.",
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "reduce"
            },
            "reducers": {
              "type": "array",
              "minItems": 1,
              "maxItems": 10,
              "items": {
                "$ref": "#/$defs/anyReducer"
              }
            },
            "mode": {
              "enum": [
                "seriesToRows",
                "reduceFields"
              ]
            },
            "includeTime": {
              "x-omitFromPrompt": true,
              "description": "Reduce the time field too.",
              "type": "boolean"
            },
            "labelsToFields": {
              "x-omitFromPrompt": true,
              "description": "Add one text field per label key: a column in seriesToRows mode, a one-row field in reduceFields mode.",
              "type": "boolean"
            },
            "fields": {
              "x-omitFromPrompt": true,
              "description": "Reduce only the number fields with these names; absent reduces every number field.",
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "fieldsRegex": {
              "x-omitFromPrompt": true,
              "description": "Reduce only the number fields whose name matches this pattern, anchored unless written /re/flags.",
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "reducers"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "joinByField"
            },
            "field": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "mode": {
              "anyOf": [
                {
                  "enum": [
                    "outer",
                    "inner"
                  ]
                },
                {
                  "x-omitFromPrompt": true,
                  "description": "A SQL-like outer join in row order: repeated keys pair up with every match and nothing is sorted.",
                  "enum": [
                    "outerTabular"
                  ]
                }
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "filterFieldsByName"
            },
            "include": {
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "includeRegex": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "exclude": {
              "x-omitFromPrompt": true,
              "description": "Drop the fields with these names, after include.",
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "type": "string",
                "minLength": 1,
                "maxLength": 200
              }
            },
            "excludeRegex": {
              "x-omitFromPrompt": true,
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            },
            "variable": {
              "x-omitFromPrompt": true,
              "description": "Also include the fields named by the selected values of this variable; All, or no selection, adds nothing.",
              "$ref": "#/$defs/variableName"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "calculateField"
            },
            "alias": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "expr": {
              "description": "field_or_number op field_or_number, op one of + - * / % ^; put spaces around op when a field name contains spaces.",
              "type": "string",
              "pattern": "^\\s*(?:\\S+\\s*[-+*/%^]\\s*\\S+|\\S.*\\s[-+*/%^]\\s.*\\S)\\s*$",
              "maxLength": 400
            },
            "reduceRow": {
              "$ref": "#/$defs/reducer"
            },
            "include": {
              "x-omitFromPrompt": true,
              "description": "With reduceRow, reduce only the number fields with these names; names the frame lacks are skipped.",
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "unary": {
              "x-omitFromPrompt": true,
              "description": "Apply fn to a number field; absent field means the first number field, absent fn means abs.",
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "fn": {
                  "enum": [
                    "abs",
                    "exp",
                    "ln",
                    "floor",
                    "ceil",
                    "round"
                  ]
                },
                "field": {
                  "$ref": "#/$defs/fieldName"
                }
              }
            },
            "index": {
              "x-omitFromPrompt": true,
              "description": "The row number from 0, or with percentile its place from 0 to 1.",
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "percentile": {
                  "type": "boolean"
                }
              }
            },
            "cumulative": {
              "x-omitFromPrompt": true,
              "description": "A running total or running mean of a number field; absent field means the first number field, absent fn means sum.",
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "fn": {
                  "enum": [
                    "sum",
                    "mean"
                  ]
                },
                "field": {
                  "$ref": "#/$defs/fieldName"
                }
              }
            },
            "window": {
              "x-omitFromPrompt": true,
              "description": "A moving mean, standard deviation or variance of a number field over size rows or a share of the rows (0.1 when neither is written); trailing windows end at the row, centered ones surround it, and windows at the edges shrink.",
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "fn": {
                  "enum": [
                    "mean",
                    "stdDev",
                    "variance"
                  ]
                },
                "field": {
                  "$ref": "#/$defs/fieldName"
                },
                "size": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 10000
                },
                "share": {
                  "type": "number",
                  "exclusiveMinimum": 0,
                  "maximum": 1
                },
                "align": {
                  "enum": [
                    "trailing",
                    "centered"
                  ]
                }
              }
            },
            "replace": {
              "x-omitFromPrompt": true,
              "description": "Keep only the time field and the new field.",
              "type": "boolean"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "alias"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "sortBy"
            },
            "field": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "desc": {
              "type": "boolean"
            },
            "then": {
              "x-omitFromPrompt": true,
              "description": "Further sort keys, applied in order to rows that tie on field.",
              "type": "array",
              "minItems": 1,
              "maxItems": 10,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "desc": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "field"
                ]
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "field"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "limit"
            },
            "count": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 100000
                },
                {
                  "x-omitFromPrompt": true,
                  "description": "${name} naming a variable whose selected value is the row count; All, or no selection, keeps every row.",
                  "type": "string",
                  "pattern": "^\\$\\{[A-Za-z][A-Za-z0-9_]{0,39}\\}$"
                }
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "count"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "convertFieldType"
            },
            "conversions": {
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "to": {
                    "anyOf": [
                      {
                        "enum": [
                          "number",
                          "string",
                          "time",
                          "boolean"
                        ]
                      },
                      {
                        "x-omitFromPrompt": true,
                        "enum": [
                          "enum",
                          "other"
                        ]
                      }
                    ]
                  },
                  "dateFormat": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 60
                  },
                  "joinWith": {
                    "type": "string",
                    "minLength": 0,
                    "maxLength": 10
                  }
                },
                "required": [
                  "field",
                  "to"
                ]
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "conversions"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "formatString"
            },
            "field": {
              "$ref": "#/$defs/fieldName"
            },
            "format": {
              "anyOf": [
                {
                  "enum": [
                    "upper",
                    "lower",
                    "title",
                    "trim",
                    "substring"
                  ]
                },
                {
                  "x-omitFromPrompt": true,
                  "enum": [
                    "sentence",
                    "pascal",
                    "camel",
                    "snake",
                    "kebab"
                  ]
                }
              ]
            },
            "start": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            },
            "end": {
              "type": "integer",
              "minimum": 0,
              "maximum": 10000
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "field",
            "format"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "formatTime"
            },
            "field": {
              "$ref": "#/$defs/fieldName"
            },
            "format": {
              "type": "string",
              "minLength": 1,
              "maxLength": 60
            },
            "utc": {
              "type": "boolean"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "field",
            "format"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "renameByRegex"
            },
            "regex": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "renameTo": {
              "type": "string",
              "minLength": 0,
              "maxLength": 200
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "regex",
            "renameTo"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "filterByValue"
            },
            "keep": {
              "enum": [
                "include",
                "exclude"
              ]
            },
            "match": {
              "enum": [
                "any",
                "all"
              ]
            },
            "filters": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "op": {
                    "enum": [
                      "gt",
                      "gte",
                      "lt",
                      "lte",
                      "eq",
                      "neq",
                      "null",
                      "notNull",
                      "regex",
                      "range"
                    ]
                  },
                  "value": {
                    "anyOf": [
                      {
                        "type": "number"
                      },
                      {
                        "type": "string",
                        "minLength": 0,
                        "maxLength": 200
                      }
                    ]
                  },
                  "from": {
                    "type": "number"
                  },
                  "to": {
                    "type": "number"
                  }
                },
                "required": [
                  "field",
                  "op"
                ]
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "filters"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "filterByRefId"
            },
            "include": {
              "type": "array",
              "minItems": 1,
              "maxItems": 26,
              "items": {
                "$ref": "#/$defs/queryRef"
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "include"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "extractFields"
            },
            "field": {
              "$ref": "#/$defs/fieldName"
            },
            "format": {
              "anyOf": [
                {
                  "enum": [
                    "auto",
                    "json",
                    "kvp"
                  ]
                },
                {
                  "x-omitFromPrompt": true,
                  "enum": [
                    "delimiter",
                    "regexp"
                  ]
                }
              ]
            },
            "replace": {
              "type": "boolean"
            },
            "keepTime": {
              "type": "boolean"
            },
            "paths": {
              "type": "array",
              "minItems": 1,
              "maxItems": 50,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "path": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "alias": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  }
                },
                "required": [
                  "path"
                ]
              }
            },
            "delimiter": {
              "x-omitFromPrompt": true,
              "type": "string",
              "minLength": 1,
              "maxLength": 10
            },
            "regex": {
              "x-omitFromPrompt": true,
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "field"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "labelsToFields"
            },
            "mode": {
              "enum": [
                "columns",
                "rows"
              ]
            },
            "include": {
              "type": "array",
              "minItems": 1,
              "maxItems": 100,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "valueLabel": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "joinByLabels"
            },
            "value": {
              "$ref": "#/$defs/fieldName"
            },
            "on": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "value"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "partitionByValues"
            },
            "fields": {
              "type": "array",
              "minItems": 1,
              "maxItems": 10,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "keepFields": {
              "type": "boolean"
            },
            "naming": {
              "anyOf": [
                {
                  "enum": [
                    "labels"
                  ]
                },
                {
                  "x-omitFromPrompt": true,
                  "enum": [
                    "name",
                    "append"
                  ]
                }
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "fields"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "prepareTimeSeries"
            },
            "format": {
              "enum": [
                "wide",
                "many",
                "long"
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "format"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "timeSeriesTable"
            },
            "stats": {
              "type": "object",
              "maxProperties": 26,
              "propertyNames": {
                "$ref": "#/$defs/queryRef"
              },
              "additionalProperties": {
                "$ref": "#/$defs/reducer"
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "rowsToFields"
            },
            "mappings": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "to": {
                    "enum": [
                      "name",
                      "value",
                      "unit",
                      "min",
                      "max",
                      "decimals",
                      "displayName",
                      "noValue",
                      "color"
                    ]
                  }
                },
                "required": [
                  "field",
                  "to"
                ]
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "configFromData"
            },
            "configQuery": {
              "$ref": "#/$defs/queryRef"
            },
            "mappings": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "to": {
                    "enum": [
                      "unit",
                      "min",
                      "max",
                      "decimals",
                      "displayName",
                      "noValue",
                      "color"
                    ]
                  },
                  "reducer": {
                    "$ref": "#/$defs/reducer"
                  }
                },
                "required": [
                  "field",
                  "to"
                ]
              }
            },
            "applyTo": {
              "$ref": "#/$defs/match"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type",
            "configQuery",
            "mappings"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "concatenate"
            },
            "nameMode": {
              "enum": [
                "drop",
                "field",
                "label"
              ]
            },
            "nameLabel": {
              "x-omitFromPrompt": true,
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": false,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "groupBy"
            },
            "by": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "aggregate": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "reducers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  }
                },
                "required": [
                  "field",
                  "reducers"
                ]
              }
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "groupingToMatrix"
            },
            "column": {
              "$ref": "#/$defs/fieldName"
            },
            "row": {
              "$ref": "#/$defs/fieldName"
            },
            "value": {
              "$ref": "#/$defs/fieldName"
            },
            "empty": {
              "enum": [
                "empty",
                "zero",
                "true",
                "false"
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "groupToNestedTable"
            },
            "by": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "$ref": "#/$defs/fieldName"
              }
            },
            "aggregate": {
              "type": "array",
              "minItems": 1,
              "maxItems": 20,
              "items": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "field": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "reducers": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 10,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  }
                },
                "required": [
                  "field",
                  "reducers"
                ]
              }
            },
            "hideHeaders": {
              "type": "boolean"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "histogram"
            },
            "bucketCount": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "bucketSize": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "bucketOffset": {
              "type": "number"
            },
            "combine": {
              "type": "boolean"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "regression"
            },
            "model": {
              "enum": [
                "linear",
                "polynomial"
              ]
            },
            "degree": {
              "type": "integer",
              "minimum": 1,
              "maximum": 5
            },
            "x": {
              "$ref": "#/$defs/fieldName"
            },
            "y": {
              "$ref": "#/$defs/fieldName"
            },
            "predictions": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "transpose"
            },
            "firstName": {
              "$ref": "#/$defs/fieldName"
            },
            "restName": {
              "$ref": "#/$defs/fieldName"
            },
            "empty": {
              "enum": [
                "empty",
                "zero",
                "true",
                "false"
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "heatmap"
            },
            "xBuckets": {
              "$ref": "#/$defs/heatmapBuckets"
            },
            "yBuckets": {
              "$ref": "#/$defs/heatmapBuckets"
            },
            "yScale": {
              "x-omitFromPrompt": true,
              "description": "Spacing of the value rows; ordinal gives each distinct value its own row, in order of first appearance.",
              "enum": [
                "linear",
                "log",
                "symlog",
                "ordinal"
              ]
            },
            "yLogBase": {
              "enum": [
                2,
                10
              ]
            },
            "xScale": {
              "x-omitFromPrompt": true,
              "description": "Spacing of the time columns; log and symlog space them by the logarithm of the time, with 16 columns when xBuckets has no count, and a size is then a step in scaled units, not seconds. Absent is linear.",
              "enum": [
                "linear",
                "log",
                "symlog"
              ]
            },
            "xLogBase": {
              "x-omitFromPrompt": true,
              "description": "Base of a logarithmic xScale; 2 when absent.",
              "enum": [
                2,
                10
              ]
            },
            "keepOriginalData": {
              "type": "boolean"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "spatial"
            },
            "action": {
              "description": "prepare (the default) adds lat and lon fields from the source location; calculate adds the heading or distance from the previous row, or the area of the polygon the rows outline; modify builds lines.",
              "enum": [
                "prepare",
                "calculate",
                "modify"
              ]
            },
            "source": {
              "$ref": "#/$defs/spatialLocation"
            },
            "calc": {
              "description": "For calculate: heading in degrees and distance in meters from the previous located row, or area in square meters of the polygon whose corners are the located rows in order. Absent means heading.",
              "enum": [
                "heading",
                "distance",
                "area"
              ]
            },
            "field": {
              "description": "The name of the calculated field. Absent means Heading, Distance or Area.",
              "$ref": "#/$defs/fieldName"
            },
            "modify": {
              "description": "For modify: lineBuilder draws one line per row from the source to the target location; asLine keeps the located rows, in order, as the points of one line. Absent means lineBuilder.",
              "enum": [
                "lineBuilder",
                "asLine"
              ]
            },
            "target": {
              "$ref": "#/$defs/spatialLocation"
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        },
        {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "type": {
              "const": "fieldLookup"
            },
            "lookupField": {
              "description": "The text field holding the names or codes to look up. Absent means the first text field.",
              "$ref": "#/$defs/fieldName"
            },
            "gazetteer": {
              "description": "The built-in list the names are looked up in. Absent means countries.",
              "enum": [
                "countries",
                "usa-states"
              ]
            },
            "queries": {
              "x-omitFromPrompt": true,
              "$ref": "#/$defs/transformQueries"
            }
          },
          "required": [
            "type"
          ]
        }
      ]
    },
    "spatialLocation": {
      "x-omitFromPrompt": true,
      "title": "SpatialLocation",
      "description": "Where a row is: auto (the default) takes latitude and longitude fields named lat, latitude, lon, lng or longitude, else a field named geohash; coords names the latitude and longitude fields; geohash names the geohash field; lookup names the text field looked up in the gazetteer (countries by default).",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "mode": {
          "enum": [
            "auto",
            "coords",
            "geohash",
            "lookup"
          ]
        },
        "latitude": {
          "$ref": "#/$defs/fieldName"
        },
        "longitude": {
          "$ref": "#/$defs/fieldName"
        },
        "geohash": {
          "$ref": "#/$defs/fieldName"
        },
        "lookup": {
          "$ref": "#/$defs/fieldName"
        },
        "gazetteer": {
          "enum": [
            "countries",
            "usa-states"
          ]
        }
      }
    },
    "dataPanel": {
      "title": "DataPanel",
      "type": "object",
      "required": [
        "id",
        "type",
        "title",
        "gridPos",
        "queries"
      ],
      "allOf": [
        {
          "$ref": "#/$defs/fieldProps"
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "timeseries"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "legendValues": {
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendMode": {
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendSortBy": {
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "legendHideZero": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendHideEmpty": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipSort": {
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipCumulative": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "xAxis": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "shown",
                      "hidden"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "stat"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reduce": {
                    "$ref": "#/$defs/reducer"
                  },
                  "allValues": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "x-omitFromPrompt": true
                  },
                  "fields": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "x-omitFromPrompt": true
                  },
                  "colorMode": {
                    "enum": [
                      "value",
                      "background",
                      "none"
                    ]
                  },
                  "graph": {
                    "type": "boolean"
                  },
                  "graphStyle": {
                    "enum": [
                      "area",
                      "line"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "textMode": {
                    "enum": [
                      "value",
                      "name",
                      "valueAndName",
                      "none"
                    ]
                  },
                  "orientation": {
                    "enum": [
                      "auto",
                      "horizontal",
                      "vertical"
                    ]
                  },
                  "justify": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "auto",
                      "center"
                    ]
                  },
                  "titleSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "valueSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "percentSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "percentChange": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "percentChangeColor": {
                    "enum": [
                      "standard",
                      "inverted",
                      "value"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "wideLayout": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "gauge"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reduce": {
                    "$ref": "#/$defs/reducer"
                  },
                  "allValues": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "x-omitFromPrompt": true
                  },
                  "fields": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "x-omitFromPrompt": true
                  },
                  "thresholdMarkers": {
                    "type": "boolean"
                  },
                  "thresholdLabels": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "minWidth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "minHeight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "titleSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "valueSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "bargauge"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reduce": {
                    "$ref": "#/$defs/reducer"
                  },
                  "allValues": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "x-omitFromPrompt": true
                  },
                  "fields": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "x-omitFromPrompt": true
                  },
                  "orientation": {
                    "enum": [
                      "auto",
                      "horizontal",
                      "vertical"
                    ]
                  },
                  "barStyle": {
                    "enum": [
                      "basic",
                      "lcd"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "valueMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "color",
                      "text",
                      "hidden"
                    ]
                  },
                  "namePlacement": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "auto",
                      "top",
                      "left",
                      "hidden"
                    ]
                  },
                  "showUnfilled": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "minWidth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "minHeight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "maxHeight": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "titleSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "valueSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "table"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "header": {
                    "type": "boolean"
                  },
                  "footer": {
                    "type": "array",
                    "maxItems": 5,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/reducer"
                    }
                  },
                  "footerFields": {
                    "x-omitFromPrompt": true,
                    "description": "Limits the footer to the columns with these field names; absent means every number column.",
                    "type": "array",
                    "maxItems": 50,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    }
                  },
                  "footerCountRows": {
                    "x-omitFromPrompt": true,
                    "description": "Adds a footer row with the number of rows.",
                    "type": "boolean"
                  },
                  "cellHeight": {
                    "x-omitFromPrompt": true,
                    "description": "The height of a table row: sm is the compact row, md and lg add padding, and auto fits each row to its content up to maxRowHeight.",
                    "enum": [
                      "sm",
                      "md",
                      "lg",
                      "auto"
                    ]
                  },
                  "maxRowHeight": {
                    "x-omitFromPrompt": true,
                    "description": "The tallest a row may grow, in pixels, when cellHeight is auto or a cell has dynamicHeight.",
                    "type": "integer",
                    "minimum": 20,
                    "maximum": 1000
                  },
                  "frameIndex": {
                    "x-omitFromPrompt": true,
                    "description": "Shows only this frame when the data has several and no transform merges them (the last frame when the index is past it); absent shows every frame, one after another.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 99
                  },
                  "pagination": {
                    "x-omitFromPrompt": true,
                    "description": "Shows the rows in pages sized to the panel, with previous and next buttons.",
                    "type": "boolean"
                  },
                  "frozenColumns": {
                    "x-omitFromPrompt": true,
                    "description": "The number of columns from the left that stay in view while the table scrolls sideways.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "sortBy": {
                    "x-omitFromPrompt": true,
                    "description": "The name of the column the table starts sorted by.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "sortDesc": {
                    "x-omitFromPrompt": true,
                    "description": "Sorts the starting sort from the largest value down.",
                    "type": "boolean"
                  },
                  "typeIcons": {
                    "x-omitFromPrompt": true,
                    "description": "Shows an icon for the column type before each header.",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "piechart"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reduce": {
                    "$ref": "#/$defs/reducer"
                  },
                  "allValues": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 5000,
                    "x-omitFromPrompt": true
                  },
                  "fields": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200,
                    "x-omitFromPrompt": true
                  },
                  "sort": {
                    "enum": [
                      "desc",
                      "asc",
                      "none"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "pieType": {
                    "enum": [
                      "pie",
                      "donut"
                    ]
                  },
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "sliceLabels": {
                    "type": "array",
                    "maxItems": 3,
                    "uniqueItems": true,
                    "items": {
                      "enum": [
                        "name",
                        "value",
                        "percent"
                      ]
                    },
                    "x-omitFromPrompt": false
                  },
                  "titleSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "valueSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200,
                    "x-omitFromPrompt": true
                  },
                  "legendShow": {
                    "type": "array",
                    "maxItems": 2,
                    "uniqueItems": true,
                    "items": {
                      "enum": [
                        "value",
                        "percent"
                      ]
                    },
                    "x-omitFromPrompt": true
                  },
                  "legendMode": {
                    "enum": [
                      "list",
                      "table"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "legendSortBy": {
                    "enum": [
                      "name",
                      "value"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "legendSortDesc": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "legendWidth": {
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ],
                    "x-omitFromPrompt": false
                  },
                  "tooltipSort": {
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "tooltipHideZeros": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "tooltipMaxWidth": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  },
                  "tooltipMaxHeight": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000,
                    "x-omitFromPrompt": true
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "heatmap"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "calculate": {
                    "type": "boolean"
                  },
                  "yScale": {
                    "enum": [
                      "linear",
                      "log",
                      "symlog"
                    ]
                  },
                  "colorMode": {
                    "x-omitFromPrompt": true,
                    "description": "scheme colors the cells with colorScheme; opacity varies the opacity of colorFill. Absent means opacity.",
                    "enum": [
                      "scheme",
                      "opacity"
                    ]
                  },
                  "colorScheme": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "greenYellowRed",
                      "redYellowGreen",
                      "blueYellowRed",
                      "yellowRed",
                      "bluePurple",
                      "yellowBlue",
                      "blues",
                      "reds",
                      "greens",
                      "purples",
                      "oranges",
                      "viridis",
                      "magma",
                      "plasma",
                      "inferno",
                      "cividis",
                      "warm"
                    ]
                  },
                  "colorSteps": {
                    "x-omitFromPrompt": true,
                    "description": "Number of distinct colors in scheme mode; absent means a continuous ramp.",
                    "type": "integer",
                    "minimum": 2,
                    "maximum": 128
                  },
                  "colorScale": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "linear",
                      "exponential"
                    ]
                  },
                  "colorExponent": {
                    "x-omitFromPrompt": true,
                    "description": "Exponent of an exponential colorScale; 0.5 when absent.",
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 2
                  },
                  "colorFill": {
                    "x-omitFromPrompt": true,
                    "description": "The color whose opacity varies in opacity mode; absent means the first series color.",
                    "$ref": "#/$defs/color"
                  },
                  "colorMin": {
                    "x-omitFromPrompt": true,
                    "type": "number"
                  },
                  "colorMax": {
                    "x-omitFromPrompt": true,
                    "type": "number"
                  },
                  "colorReverse": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "cellGap": {
                    "x-omitFromPrompt": true,
                    "description": "Pixels between cells.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 25
                  },
                  "cellRadius": {
                    "x-omitFromPrompt": true,
                    "description": "Cell corner radius in pixels.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "cellUnit": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/unit"
                  },
                  "cellDecimals": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "legend": {
                    "x-omitFromPrompt": true,
                    "description": "Whether the color scale is shown under the chart; bottom when absent.",
                    "enum": [
                      "bottom",
                      "hidden"
                    ]
                  },
                  "hideBelow": {
                    "x-omitFromPrompt": true,
                    "description": "Cells with a value at or below this are not drawn; 0 when absent.",
                    "type": "number"
                  },
                  "hideAbove": {
                    "x-omitFromPrompt": true,
                    "description": "Cells with a value at or above this are not drawn.",
                    "type": "number"
                  },
                  "showValues": {
                    "x-omitFromPrompt": true,
                    "description": "Whether cells carry their value as text: auto only where it fits, always, or never (the default).",
                    "enum": [
                      "auto",
                      "always",
                      "never"
                    ]
                  },
                  "xBuckets": {
                    "x-omitFromPrompt": true,
                    "description": "How calculate groups time into columns: size is seconds per column and count is the number of columns; without a value the size is the data step and the count is one column per sample time. Absent keeps one column per sample time.",
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "enum": [
                          "size",
                          "count"
                        ]
                      },
                      "value": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "mode"
                    ]
                  },
                  "yBuckets": {
                    "x-omitFromPrompt": true,
                    "description": "How calculate groups values into rows: size is the value range of a row (the exponent step on a log scale) and count is the number of rows; without a value the size is a round step that gives about 16 rows and the count is 16. Absent means 16 rows.",
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                      "mode": {
                        "enum": [
                          "size",
                          "count"
                        ]
                      },
                      "value": {
                        "type": "number",
                        "exclusiveMinimum": 0
                      }
                    },
                    "required": [
                      "mode"
                    ]
                  },
                  "yBucketScale": {
                    "x-omitFromPrompt": true,
                    "description": "Spacing of calculated rows; absent follows yScale.",
                    "enum": [
                      "linear",
                      "log",
                      "symlog"
                    ]
                  },
                  "yBucketLogBase": {
                    "x-omitFromPrompt": true,
                    "description": "Base of a logarithmic yBucketScale; 2 when absent.",
                    "enum": [
                      2,
                      10
                    ]
                  },
                  "xBucketScale": {
                    "x-omitFromPrompt": true,
                    "description": "Spacing of calculated columns; log and symlog space them by the logarithm of the time, with 16 columns when xBuckets has no count, and a size is then a step in scaled units, not seconds. Absent is linear.",
                    "enum": [
                      "linear",
                      "log",
                      "symlog"
                    ]
                  },
                  "xBucketLogBase": {
                    "x-omitFromPrompt": true,
                    "description": "Base of a logarithmic xBucketScale; 2 when absent.",
                    "enum": [
                      2,
                      10
                    ]
                  },
                  "rowsLayout": {
                    "x-omitFromPrompt": true,
                    "description": "How pre-bucketed series are read: le takes each bound as the upper edge of its row, ge as the lower edge, unknown draws one ordinary row per series, and auto uses le for series with an le label.",
                    "enum": [
                      "auto",
                      "le",
                      "ge",
                      "unknown"
                    ]
                  },
                  "rowsValue": {
                    "x-omitFromPrompt": true,
                    "description": "The field holding the cell value when the data is already bucketed in rows; a frame without a field of this name keeps all its number fields.",
                    "$ref": "#/$defs/fieldName"
                  },
                  "yUnit": {
                    "x-omitFromPrompt": true,
                    "description": "Unit of the row labels; absent uses the field's unit.",
                    "$ref": "#/$defs/unit"
                  },
                  "yDecimals": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 10
                  },
                  "yMin": {
                    "x-omitFromPrompt": true,
                    "description": "Rows that end at or below this value are not drawn.",
                    "type": "number"
                  },
                  "yMax": {
                    "x-omitFromPrompt": true,
                    "description": "Rows that start at or above this value are not drawn.",
                    "type": "number"
                  },
                  "yReverse": {
                    "x-omitFromPrompt": true,
                    "description": "Draws the lowest row at the top.",
                    "type": "boolean"
                  },
                  "yAxis": {
                    "x-omitFromPrompt": true,
                    "description": "Side of the row labels; left when absent.",
                    "enum": [
                      "left",
                      "right",
                      "hidden"
                    ]
                  },
                  "yAxisWidth": {
                    "x-omitFromPrompt": true,
                    "description": "Width of the row labels in pixels; absent fits the longest label.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 400
                  },
                  "yAxisLabel": {
                    "x-omitFromPrompt": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "tooltip": {
                    "x-omitFromPrompt": true,
                    "description": "single shows the hovered cell, all lists every row of its column, hidden shows no tooltip; single when absent.",
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipHistogram": {
                    "x-omitFromPrompt": true,
                    "description": "Adds a small histogram of the hovered column's rows to the tooltip.",
                    "type": "boolean"
                  },
                  "tooltipColorScale": {
                    "x-omitFromPrompt": true,
                    "description": "Adds the color scale to the tooltip with a marker at the hovered value.",
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "exemplars": {
                    "x-omitFromPrompt": true,
                    "description": "Whether the exemplars of queries that ask for them are drawn; true when absent.",
                    "type": "boolean"
                  },
                  "exemplarColor": {
                    "x-omitFromPrompt": true,
                    "description": "The color of exemplar diamonds; absent means the foreground color.",
                    "$ref": "#/$defs/color"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "histogram"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "bucketSize": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "bucketCount": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1000
                  },
                  "bucketOffset": {
                    "x-omitFromPrompt": true,
                    "type": "number"
                  },
                  "combine": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "stack": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "normal",
                      "percent"
                    ]
                  },
                  "legend": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "tooltip": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendValues": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendSortBy": {
                    "x-omitFromPrompt": true,
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "state-timeline"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mergeValues": {
                    "type": "boolean"
                  },
                  "showValues": {
                    "enum": [
                      "auto",
                      "always",
                      "never"
                    ]
                  },
                  "rowHeight": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 1
                  },
                  "perPage": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "alignValue": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "left",
                      "center",
                      "right"
                    ]
                  },
                  "legend": {
                    "x-omitFromPrompt": false,
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltip": {
                    "x-omitFromPrompt": false,
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "logs"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "wrap": {
                    "type": "boolean"
                  },
                  "showTime": {
                    "type": "boolean"
                  },
                  "order": {
                    "enum": [
                      "newest",
                      "oldest"
                    ]
                  },
                  "showLabels": {
                    "type": "boolean"
                  },
                  "showCommonLabels": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "details": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "prettify": {
                    "type": "boolean"
                  },
                  "dedup": {
                    "enum": [
                      "none",
                      "exact",
                      "numbers",
                      "signature"
                    ]
                  },
                  "controls": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "fontSize": {
                    "enum": [
                      "default",
                      "small"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "highlight": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "lineFields": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "$ref": "#/$defs/fieldName"
                    },
                    "x-omitFromPrompt": true
                  },
                  "showAttributes": {
                    "type": "boolean",
                    "x-omitFromPrompt": true
                  },
                  "timePrecision": {
                    "enum": [
                      "ms",
                      "ns"
                    ],
                    "x-omitFromPrompt": true
                  },
                  "detailsMode": {
                    "enum": [
                      "inline",
                      "sidebar"
                    ],
                    "x-omitFromPrompt": true
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "barchart"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "orientation": {
                    "enum": [
                      "auto",
                      "horizontal",
                      "vertical"
                    ]
                  },
                  "xField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "showValues": {
                    "enum": [
                      "auto",
                      "always",
                      "never"
                    ]
                  },
                  "barWidth": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1
                  },
                  "groupWidth": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "exclusiveMinimum": 0,
                    "maximum": 1
                  },
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendValues": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendSortBy": {
                    "x-omitFromPrompt": true,
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "xTickRotation": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": -90,
                    "maximum": 90
                  },
                  "xTickSpacing": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 500
                  },
                  "xTickMaxLength": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 200
                  },
                  "barRadius": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0,
                    "maximum": 0.5
                  },
                  "fullHighlight": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "colorByField": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/fieldName"
                  },
                  "valueSize": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 6,
                    "maximum": 100
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "status-history"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "showValues": {
                    "enum": [
                      "auto",
                      "always",
                      "never"
                    ]
                  },
                  "rowHeight": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 1
                  },
                  "perPage": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "columnWidth": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0.1,
                    "maximum": 1
                  },
                  "legend": {
                    "x-omitFromPrompt": false,
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltip": {
                    "x-omitFromPrompt": false,
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "trend"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "xField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "legendValues": {
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendMode": {
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendSortBy": {
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "legendHideZero": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendHideEmpty": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipCumulative": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "xAxis": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "shown",
                      "hidden"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "xychart"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "xField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "show": {
                    "enum": [
                      "points",
                      "lines",
                      "points+lines"
                    ]
                  },
                  "pointSize": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 40
                  },
                  "pointSizeMin": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "pointSizeMax": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "series": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 20,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "properties": {
                        "query": {
                          "$ref": "#/$defs/queryRef"
                        },
                        "frame": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "x": {
                          "$ref": "#/$defs/fieldName"
                        },
                        "y": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 500
                        },
                        "size": {
                          "$ref": "#/$defs/fieldName"
                        },
                        "color": {
                          "$ref": "#/$defs/fieldName"
                        },
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        }
                      }
                    }
                  },
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendValues": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendSortBy": {
                    "x-omitFromPrompt": true,
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "candlestick"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "mode": {
                    "enum": [
                      "candles+volume",
                      "candles",
                      "volume"
                    ]
                  },
                  "candleStyle": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "candles",
                      "ohlcbars"
                    ]
                  },
                  "colorStrategy": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "open-close",
                      "close-close"
                    ]
                  },
                  "flatColor": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/color"
                  },
                  "upColor": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/color"
                  },
                  "downColor": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/color"
                  },
                  "open": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "high": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "low": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "close": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "volume": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "legend": {
                    "enum": [
                      "bottom",
                      "right",
                      "hidden"
                    ]
                  },
                  "legendMode": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "list",
                      "table"
                    ]
                  },
                  "legendValues": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "maxItems": 8,
                    "uniqueItems": true,
                    "items": {
                      "$ref": "#/$defs/anyReducer"
                    }
                  },
                  "legendSortBy": {
                    "x-omitFromPrompt": true,
                    "anyOf": [
                      {
                        "const": "name"
                      },
                      {
                        "$ref": "#/$defs/reducer"
                      }
                    ]
                  },
                  "legendSortDesc": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "legendWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 40,
                    "maximum": 2000
                  },
                  "tooltip": {
                    "enum": [
                      "single",
                      "all",
                      "hidden"
                    ]
                  },
                  "tooltipSort": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "none",
                      "asc",
                      "desc"
                    ]
                  },
                  "tooltipHideZeros": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipCumulative": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltipMaxWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "tooltipMaxHeight": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 2000
                  },
                  "includeAllFields": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "xAxis": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "shown",
                      "hidden"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "nodeGraph"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "layout": {
                    "enum": [
                      "layered",
                      "grid",
                      "force"
                    ]
                  },
                  "wheelZoom": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "traces"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "spanSearch": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when this text, in any case, appears in their service, operation, id, attribute keys or attribute values.",
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "serviceNames": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when their service is one of these names, or none of them with excludeServices.",
                    "type": "array",
                    "maxItems": 50,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    }
                  },
                  "excludeServices": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when their service is not one of serviceNames.",
                    "type": "boolean"
                  },
                  "spanNames": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when their operation is one of these names, or none of them with excludeSpanNames.",
                    "type": "array",
                    "maxItems": 50,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 200
                    }
                  },
                  "excludeSpanNames": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when their operation is not one of spanNames.",
                    "type": "boolean"
                  },
                  "minSpanDuration": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when they last at least this many milliseconds.",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 86400000
                  },
                  "maxSpanDuration": {
                    "x-omitFromPrompt": true,
                    "description": "Spans match when they last at most this many milliseconds.",
                    "type": "number",
                    "minimum": 0,
                    "maximum": 86400000
                  },
                  "matchesOnly": {
                    "x-omitFromPrompt": true,
                    "description": "Shows only the spans that match the search, service, operation and duration filters; otherwise the other spans are dimmed.",
                    "type": "boolean"
                  },
                  "criticalPathOnly": {
                    "x-omitFromPrompt": true,
                    "description": "Shows only the spans on the critical path, the chain of spans that decides how long the trace takes.",
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "flamegraph"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {}
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "geomap"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "view": {
                    "enum": [
                      "fit",
                      "world",
                      "coords",
                      "north-america",
                      "south-america",
                      "europe",
                      "africa",
                      "west-asia",
                      "south-asia",
                      "south-east-asia",
                      "east-asia",
                      "australia",
                      "oceania"
                    ]
                  },
                  "lat": {
                    "type": "number",
                    "minimum": -85,
                    "maximum": 85
                  },
                  "lon": {
                    "type": "number",
                    "minimum": -180,
                    "maximum": 180
                  },
                  "zoom": {
                    "type": "number",
                    "minimum": 1,
                    "maximum": 18
                  },
                  "location": {
                    "enum": [
                      "auto",
                      "coords",
                      "geohash"
                    ]
                  },
                  "latField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "lonField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "geohashField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "sizeField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "colorField": {
                    "$ref": "#/$defs/fieldName"
                  },
                  "markerSize": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "markerSizeMax": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "basemap": {
                    "enum": [
                      "outline",
                      "carto",
                      "esri",
                      "osm",
                      "xyz",
                      "none"
                    ]
                  },
                  "basemapTheme": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "auto",
                      "light",
                      "dark"
                    ]
                  },
                  "basemapLabels": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "esriServer": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "streets",
                      "world-imagery",
                      "world-physical",
                      "topo",
                      "usa-topo",
                      "ocean"
                    ]
                  },
                  "basemapUrl": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/httpsUrl"
                  },
                  "basemapAttribution": {
                    "x-omitFromPrompt": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 200
                  },
                  "basemapOpacity": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                  },
                  "noRepeat": {
                    "x-omitFromPrompt": true,
                    "description": "The basemap and tile layers draw one world, never repeated sideways.",
                    "type": "boolean"
                  },
                  "basemapMinZoom": {
                    "x-omitFromPrompt": true,
                    "description": "The lowest zoom level the XYZ tile server serves; below it the nearest served level is scaled.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 18
                  },
                  "basemapMaxZoom": {
                    "x-omitFromPrompt": true,
                    "description": "The highest zoom level the XYZ tile server serves; above it the nearest served level is scaled.",
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 18
                  },
                  "minZoom": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0,
                    "maximum": 18
                  },
                  "maxZoom": {
                    "x-omitFromPrompt": true,
                    "type": "number",
                    "minimum": 0,
                    "maximum": 18
                  },
                  "fitLayer": {
                    "x-omitFromPrompt": true,
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 100
                  },
                  "fitLastOnly": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "fitPadding": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 50
                  },
                  "sharedView": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "showZoom": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "mouseWheelZoom": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "showAttribution": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "showScale": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "showMeasure": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "showDebug": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltip": {
                    "enum": [
                      "details",
                      "none"
                    ]
                  },
                  "layers": {
                    "x-omitFromPrompt": true,
                    "type": "array",
                    "maxItems": 10,
                    "items": {
                      "$ref": "#/$defs/geomapLayer"
                    }
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "canvas"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "reduce": {
                    "$ref": "#/$defs/reducer"
                  },
                  "elements": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "$ref": "#/$defs/canvasElement"
                    }
                  },
                  "connections": {
                    "type": "array",
                    "maxItems": 100,
                    "items": {
                      "$ref": "#/$defs/canvasConnection"
                    }
                  },
                  "backgroundColor": {
                    "$ref": "#/$defs/color"
                  },
                  "backgroundImage": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/imageRef"
                  },
                  "backgroundSize": {
                    "x-omitFromPrompt": true,
                    "enum": [
                      "original",
                      "contain",
                      "cover",
                      "fill",
                      "tile"
                    ]
                  },
                  "borderColor": {
                    "x-omitFromPrompt": true,
                    "$ref": "#/$defs/color"
                  },
                  "borderWidth": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 20
                  },
                  "borderRadius": {
                    "x-omitFromPrompt": true,
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 100
                  },
                  "panZoom": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "infinitePan": {
                    "x-omitFromPrompt": true,
                    "type": "boolean"
                  },
                  "tooltip": {
                    "enum": [
                      "details",
                      "none"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "alertlist"
              }
            }
          },
          "then": {
            "properties": {
              "display": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "limit": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 100
                  },
                  "sort": {
                    "enum": [
                      "alphaAsc",
                      "alphaDesc",
                      "importance",
                      "timeAsc",
                      "timeDesc"
                    ]
                  },
                  "viewMode": {
                    "enum": [
                      "list",
                      "stat"
                    ]
                  }
                }
              }
            }
          }
        },
        {
          "if": {
            "required": [
              "queries"
            ],
            "properties": {
              "queries": {
                "type": "array",
                "contains": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "object"
                    }
                  },
                  "required": [
                    "source"
                  ]
                }
              }
            }
          },
          "else": {
            "properties": {
              "datasource": {
                "x-omitFromPrompt": false
              }
            },
            "required": [
              "datasource"
            ]
          }
        }
      ],
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "type": {
          "enum": [
            "timeseries",
            "stat",
            "gauge",
            "bargauge",
            "table",
            "piechart",
            "heatmap",
            "histogram",
            "state-timeline",
            "logs",
            "barchart",
            "status-history",
            "trend",
            "xychart",
            "candlestick",
            "nodeGraph",
            "traces",
            "flamegraph",
            "geomap",
            "canvas",
            "alertlist"
          ]
        },
        "datasource": {
          "$ref": "#/$defs/datasourceRef"
        },
        "queries": {
          "type": "array",
          "minItems": 1,
          "maxItems": 26,
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/panelQuery"
              },
              {
                "$ref": "#/$defs/expressionQuery",
                "x-omitFromPrompt": true
              },
              {
                "$ref": "#/$defs/dashboardQuery",
                "x-omitFromPrompt": true
              }
            ]
          }
        },
        "overrides": {
          "type": "array",
          "maxItems": 50,
          "items": {
            "$ref": "#/$defs/override"
          }
        },
        "transform": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/transform"
          }
        },
        "repeat": {
          "$ref": "#/$defs/variableName"
        },
        "repeatDirection": {
          "enum": [
            "h",
            "v"
          ]
        },
        "maxPerRow": {
          "type": "integer",
          "minimum": 1,
          "maximum": 24
        },
        "timeFrom": {
          "type": "string",
          "pattern": "^now-[1-9][0-9]*[smhdwMy]$"
        },
        "timeShift": {
          "type": "string",
          "pattern": "^[1-9][0-9]*[smhdwMy]$"
        },
        "timezone": {
          "x-omitFromPrompt": true,
          "description": "browser, utc or an IANA zone such as Asia/Kolkata. The times this panel draws are shown in this zone instead of the dashboard's.",
          "type": "string",
          "pattern": "^(browser|utc|[A-Za-z][A-Za-z0-9_+-]*(/[A-Za-z0-9_+-]+){0,2})$"
        },
        "hideTimeOverride": {
          "x-omitFromPrompt": true,
          "description": "Do not show the time override note (from timeFrom and timeShift) in the panel header. The override still applies to the queries. Absent means shown.",
          "type": "boolean"
        },
        "interval": {
          "$ref": "#/$defs/intervalRef"
        },
        "maxDataPoints": {
          "type": "integer",
          "minimum": 10,
          "maximum": 11000
        },
        "transparent": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "titleHidden": {
          "x-omitFromPrompt": true,
          "description": "Keep the title as the panel's name for menus and screen readers but do not show it. Absent means shown.",
          "type": "boolean"
        },
        "display": {
          "type": "object"
        }
      },
      "unevaluatedProperties": false
    },
    "textPanel": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "type": {
          "const": "text"
        },
        "transparent": {
          "x-omitFromPrompt": true,
          "type": "boolean"
        },
        "content": {
          "type": "string",
          "maxLength": 20000,
          "description": "Markdown, rendered sanitized."
        },
        "mode": {
          "enum": [
            "markdown",
            "html",
            "code"
          ],
          "description": "markdown (default): Markdown with sanitized inline HTML. html: sanitized HTML. code: the content shown as code. The agent never writes HTML."
        },
        "code": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "language": {
              "enum": [
                "plaintext",
                "json",
                "yaml",
                "xml",
                "sql",
                "go",
                "typescript",
                "markdown",
                "html"
              ]
            },
            "lineNumbers": {
              "type": "boolean"
            }
          }
        }
      },
      "required": [
        "id",
        "type",
        "gridPos",
        "content"
      ],
      "title": "TextPanel"
    },
    "placeholderPanel": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "type": {
          "const": "placeholder"
        },
        "reason": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "sourceType": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        }
      },
      "required": [
        "id",
        "type",
        "gridPos",
        "reason"
      ],
      "title": "PlaceholderPanel",
      "description": "Written only by the importer for a Grafana panel we cannot render yet; the agent may move or delete it but not create one."
    },
    "rowPanel": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "type": {
          "const": "row"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "collapsed": {
          "type": "boolean"
        },
        "repeat": {
          "$ref": "#/$defs/variableName"
        },
        "panels": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "oneOf": [
              {
                "$ref": "#/$defs/dataPanel"
              },
              {
                "$ref": "#/$defs/textPanel"
              },
              {
                "$ref": "#/$defs/placeholderPanel"
              },
              {
                "$ref": "#/$defs/dashlistPanel"
              },
              {
                "$ref": "#/$defs/newsPanel"
              }
            ]
          }
        }
      },
      "required": [
        "id",
        "type",
        "title",
        "gridPos"
      ],
      "title": "RowPanel",
      "description": "Child panels are always nested, collapsed or not."
    },
    "panel": {
      "title": "Panel",
      "type": "object",
      "oneOf": [
        {
          "$ref": "#/$defs/dataPanel"
        },
        {
          "$ref": "#/$defs/textPanel"
        },
        {
          "$ref": "#/$defs/placeholderPanel"
        },
        {
          "$ref": "#/$defs/rowPanel"
        },
        {
          "$ref": "#/$defs/dashlistPanel"
        },
        {
          "$ref": "#/$defs/newsPanel"
        }
      ]
    },
    "fieldName": {
      "title": "FieldName",
      "description": "A field name or series name in the panel's frames.",
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "canvasColor": {
      "title": "CanvasColor",
      "description": "A color, or field to take the bound field's threshold or mapping color.",
      "anyOf": [
        {
          "$ref": "#/$defs/color"
        },
        {
          "const": "field"
        }
      ]
    },
    "canvasElement": {
      "title": "CanvasElement",
      "type": "object",
      "additionalProperties": false,
      "dependentSchemas": {
        "textTemplate": {
          "properties": {
            "text": false
          }
        }
      },
      "required": [
        "id",
        "kind",
        "left",
        "top",
        "width",
        "height"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "kind": {
          "enum": [
            "metric",
            "text",
            "rectangle",
            "ellipse",
            "icon",
            "button",
            "server",
            "triangle",
            "cloud",
            "parallelogram",
            "windTurbine",
            "droneTop",
            "droneFront",
            "droneSide"
          ]
        },
        "left": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "top": {
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "width": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 100
        },
        "height": {
          "type": "number",
          "exclusiveMinimum": 0,
          "maximum": 100
        },
        "text": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "textTemplate": {
          "x-omitFromPrompt": true,
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "field": {
          "$ref": "#/$defs/fieldName"
        },
        "fill": {
          "$ref": "#/$defs/canvasColor"
        },
        "stroke": {
          "$ref": "#/$defs/canvasColor"
        },
        "textColor": {
          "$ref": "#/$defs/canvasColor"
        },
        "fontSize": {
          "type": "integer",
          "minimum": 8,
          "maximum": 72
        },
        "align": {
          "enum": [
            "left",
            "center",
            "right"
          ]
        },
        "placement": {
          "x-omitFromPrompt": true,
          "type": "object",
          "additionalProperties": false,
          "required": [
            "horizontal",
            "vertical"
          ],
          "properties": {
            "horizontal": {
              "enum": [
                "left",
                "right",
                "leftright",
                "center",
                "scale"
              ]
            },
            "vertical": {
              "enum": [
                "top",
                "bottom",
                "topbottom",
                "center",
                "scale"
              ]
            },
            "left": {
              "type": "number"
            },
            "right": {
              "type": "number"
            },
            "top": {
              "type": "number"
            },
            "bottom": {
              "type": "number"
            },
            "width": {
              "type": "number",
              "minimum": 0
            },
            "height": {
              "type": "number",
              "minimum": 0
            }
          }
        },
        "rotation": {
          "x-omitFromPrompt": true,
          "type": "number",
          "minimum": -360,
          "maximum": 360
        },
        "valign": {
          "x-omitFromPrompt": true,
          "enum": [
            "top",
            "middle",
            "bottom"
          ]
        },
        "strokeWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "borderWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "radius": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "backgroundImage": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/imageRef"
        },
        "backgroundSize": {
          "x-omitFromPrompt": true,
          "enum": [
            "original",
            "contain",
            "cover",
            "fill",
            "tile"
          ]
        },
        "icon": {
          "type": "string",
          "pattern": "^[a-z0-9-]{1,64}$"
        },
        "image": {
          "$ref": "#/$defs/imageRef"
        },
        "iconColor": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/canvasColor"
        },
        "server": {
          "x-omitFromPrompt": true,
          "enum": [
            "single",
            "stack",
            "database",
            "terminal"
          ]
        },
        "buttonStyle": {
          "x-omitFromPrompt": true,
          "enum": [
            "primary",
            "secondary",
            "success",
            "destructive"
          ]
        },
        "accentColor": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/canvasColor"
        },
        "rateField": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/fieldName"
        },
        "yawField": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/fieldName"
        },
        "pitchField": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/fieldName"
        },
        "rollField": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/fieldName"
        },
        "links": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/link"
          }
        },
        "actions": {
          "x-omitFromPrompt": true,
          "type": "array",
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/action"
          }
        },
        "oneClick": {
          "x-omitFromPrompt": true,
          "enum": [
            "link",
            "action"
          ]
        }
      }
    },
    "canvasConnection": {
      "title": "CanvasConnection",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "from",
        "to"
      ],
      "properties": {
        "from": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "to": {
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "color": {
          "$ref": "#/$defs/canvasColor"
        },
        "field": {
          "$ref": "#/$defs/fieldName"
        },
        "width": {
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "path": {
          "x-omitFromPrompt": true,
          "enum": [
            "straight",
            "curved"
          ]
        },
        "vertices": {
          "x-omitFromPrompt": true,
          "type": "array",
          "maxItems": 20,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "x",
              "y"
            ],
            "properties": {
              "x": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              },
              "y": {
                "type": "number",
                "minimum": 0,
                "maximum": 100
              }
            }
          }
        },
        "lineStyle": {
          "x-omitFromPrompt": true,
          "enum": [
            "solid",
            "dashed",
            "dotted"
          ]
        },
        "arrow": {
          "enum": [
            "none",
            "forward",
            "reverse",
            "both"
          ]
        },
        "widthField": {
          "x-omitFromPrompt": true,
          "$ref": "#/$defs/fieldName"
        },
        "minWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        },
        "maxWidth": {
          "x-omitFromPrompt": true,
          "type": "integer",
          "minimum": 1,
          "maximum": 10
        }
      }
    },
    "httpsUrl": {
      "type": "string",
      "maxLength": 2000,
      "pattern": "^https://[A-Za-z0-9.-]+(:443)?(/[^\\s]*)?$",
      "description": "An https address whose host is written out; ${var} references may appear only after the host."
    },
    "imageRef": {
      "title": "ImageRef",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "url"
          ],
          "properties": {
            "url": {
              "$ref": "#/$defs/httpsUrl"
            }
          }
        },
        {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "field"
          ],
          "properties": {
            "field": {
              "$ref": "#/$defs/fieldName"
            }
          }
        }
      ]
    },
    "actionParam": {
      "x-omitFromPrompt": true,
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "type": "string",
          "pattern": "^[A-Za-z0-9!#$%&'*+.^_`|~-]{1,64}$"
        },
        "value": {
          "type": "string",
          "maxLength": 1000
        }
      }
    },
    "action": {
      "x-omitFromPrompt": true,
      "title": "Action",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "url"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "method": {
          "enum": [
            "GET",
            "POST",
            "PUT",
            "PATCH",
            "DELETE"
          ]
        },
        "url": {
          "$ref": "#/$defs/httpsUrl"
        },
        "contentType": {
          "enum": [
            "application/json",
            "text/plain",
            "application/x-www-form-urlencoded"
          ]
        },
        "body": {
          "type": "string",
          "maxLength": 10000
        },
        "headers": {
          "type": "array",
          "maxItems": 10,
          "items": {
            "$ref": "#/$defs/actionParam"
          }
        },
        "query": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/actionParam"
          }
        },
        "confirm": {
          "type": "string",
          "minLength": 1,
          "maxLength": 500
        },
        "variables": {
          "description": "Values the person types when running the action; ${key} in url, body, header values and query values refers to the typed value. Keys are unique.",
          "type": "array",
          "minItems": 1,
          "maxItems": 10,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "key",
              "name"
            ],
            "properties": {
              "key": {
                "type": "string",
                "pattern": "^[A-Za-z][A-Za-z0-9_]{0,63}$"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              }
            }
          }
        },
        "color": {
          "description": "The color of the action's button.",
          "$ref": "#/$defs/color"
        },
        "oneClick": {
          "description": "Field actions only: a click on the cell, tile, gauge or bar runs this action when it is the field's only link or action.",
          "type": "boolean"
        }
      }
    },
    "geomapRule": {
      "x-omitFromPrompt": true,
      "type": "object",
      "additionalProperties": false,
      "required": [
        "property",
        "operation",
        "value"
      ],
      "properties": {
        "property": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "operation": {
          "enum": [
            "eq",
            "neq",
            "lt",
            "lte",
            "gt",
            "gte"
          ]
        },
        "value": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            }
          ]
        },
        "color": {
          "$ref": "#/$defs/color"
        },
        "opacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        }
      }
    },
    "geomapLayer": {
      "x-omitFromPrompt": true,
      "title": "GeomapLayer",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "enum": [
            "markers",
            "heatmap",
            "geojson",
            "dayNight",
            "route",
            "photos",
            "network",
            "carto",
            "esri",
            "osm",
            "xyz"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "query": {
          "$ref": "#/$defs/queryRef"
        },
        "opacity": {
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "tooltip": {
          "type": "boolean"
        },
        "location": {
          "enum": [
            "auto",
            "coords",
            "geohash",
            "lookup",
            "wkt"
          ]
        },
        "latField": {
          "$ref": "#/$defs/fieldName"
        },
        "lonField": {
          "$ref": "#/$defs/fieldName"
        },
        "geohashField": {
          "$ref": "#/$defs/fieldName"
        },
        "lookupField": {
          "$ref": "#/$defs/fieldName"
        },
        "wktField": {
          "x-omitFromPrompt": true,
          "description": "The field holding WKT text; only POINT geometries place a marker.",
          "$ref": "#/$defs/fieldName"
        },
        "gazetteer": {
          "enum": [
            "countries",
            "usa-states",
            "airports"
          ]
        },
        "sizeField": {
          "$ref": "#/$defs/fieldName"
        },
        "colorField": {
          "$ref": "#/$defs/fieldName"
        },
        "markerSize": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "markerSizeMax": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "color": {
          "$ref": "#/$defs/color"
        },
        "fillOpacity": {
          "x-omitFromPrompt": true,
          "description": "The fill opacity of marker symbols; 0.8 when absent.",
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "symbol": {
          "enum": [
            "circle",
            "square",
            "triangle",
            "star",
            "cross",
            "x"
          ]
        },
        "symbolAlign": {
          "x-omitFromPrompt": true,
          "description": "Where the marker symbol sits horizontally against its point; center when absent.",
          "enum": [
            "left",
            "center",
            "right"
          ]
        },
        "symbolVerticalAlign": {
          "x-omitFromPrompt": true,
          "description": "Where the marker symbol sits vertically against its point; center when absent.",
          "enum": [
            "top",
            "center",
            "bottom"
          ]
        },
        "symbolField": {
          "x-omitFromPrompt": true,
          "description": "A field whose values name the symbol of each marker; ignored when symbol is set.",
          "$ref": "#/$defs/fieldName"
        },
        "text": {
          "x-omitFromPrompt": true,
          "description": "A fixed label drawn on every marker; ignored when textField is set.",
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "textField": {
          "$ref": "#/$defs/fieldName"
        },
        "textSize": {
          "type": "integer",
          "minimum": 6,
          "maximum": 48
        },
        "textOffsetX": {
          "x-omitFromPrompt": true,
          "description": "Label offset to the right, in pixels.",
          "type": "integer",
          "minimum": -100,
          "maximum": 100
        },
        "textOffsetY": {
          "x-omitFromPrompt": true,
          "description": "Label offset downward, in pixels.",
          "type": "integer",
          "minimum": -100,
          "maximum": 100
        },
        "textAlign": {
          "x-omitFromPrompt": true,
          "description": "Horizontal label anchor against the marker center; center when absent.",
          "enum": [
            "left",
            "center",
            "right"
          ]
        },
        "textBaseline": {
          "x-omitFromPrompt": true,
          "description": "Vertical label anchor against the marker center; the label sits below the marker when absent.",
          "enum": [
            "top",
            "middle",
            "bottom"
          ]
        },
        "rotation": {
          "x-omitFromPrompt": true,
          "description": "A fixed rotation of every marker in degrees; ignored when rotationField is set.",
          "type": "number",
          "minimum": -360,
          "maximum": 360
        },
        "rotationField": {
          "$ref": "#/$defs/fieldName"
        },
        "rotationMode": {
          "x-omitFromPrompt": true,
          "description": "How field angles outside -360 to 360 are treated: wrap turns them around, clamp stops them at the ends; wrap when absent.",
          "enum": [
            "wrap",
            "clamp"
          ]
        },
        "weightField": {
          "$ref": "#/$defs/fieldName"
        },
        "weight": {
          "x-omitFromPrompt": true,
          "description": "The weight of every point of a heatmap layer without weightField; 1 when absent.",
          "type": "number",
          "minimum": 0,
          "maximum": 1
        },
        "weightMin": {
          "x-omitFromPrompt": true,
          "description": "With weightField, the weight of the smallest value; 0 when absent.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "weightMax": {
          "x-omitFromPrompt": true,
          "description": "With weightField, the weight of the largest value; a weight above 1 draws as 1; 1 when absent.",
          "type": "number",
          "minimum": 0,
          "maximum": 100
        },
        "radius": {
          "type": "integer",
          "minimum": 1,
          "maximum": 100
        },
        "blur": {
          "type": "integer",
          "minimum": 0,
          "maximum": 100
        },
        "url": {
          "$ref": "#/$defs/httpsUrl"
        },
        "source": {
          "enum": [
            "countries",
            "usa-states"
          ]
        },
        "rules": {
          "type": "array",
          "maxItems": 20,
          "items": {
            "$ref": "#/$defs/geomapRule"
          }
        },
        "showSun": {
          "type": "boolean"
        },
        "nightColor": {
          "$ref": "#/$defs/color"
        },
        "nightAt": {
          "x-omitFromPrompt": true,
          "description": "The end of the dashboard range a day/night layer shows; to when absent.",
          "enum": [
            "from",
            "to"
          ]
        },
        "edgeColor": {
          "x-omitFromPrompt": true,
          "description": "The color of network edges; the node color when absent.",
          "$ref": "#/$defs/color"
        },
        "arrow": {
          "enum": [
            "none",
            "forward",
            "reverse",
            "both"
          ]
        },
        "lineWidth": {
          "type": "integer",
          "minimum": 1,
          "maximum": 20
        },
        "imageField": {
          "$ref": "#/$defs/fieldName"
        },
        "shape": {
          "enum": [
            "square",
            "circle"
          ]
        },
        "border": {
          "type": "integer",
          "minimum": 0,
          "maximum": 20
        },
        "crop": {
          "x-omitFromPrompt": true,
          "description": "Photos fill their frame and are cut to it; the whole photo is shown inside the frame when absent.",
          "type": "boolean"
        },
        "shadow": {
          "x-omitFromPrompt": true,
          "description": "Photos cast a drop shadow.",
          "type": "boolean"
        },
        "showLegend": {
          "x-omitFromPrompt": true,
          "description": "A markers layer lists its colors in the map legend; absent means no legend.",
          "type": "boolean"
        },
        "theme": {
          "enum": [
            "auto",
            "light",
            "dark"
          ]
        },
        "labels": {
          "type": "boolean"
        },
        "server": {
          "enum": [
            "streets",
            "world-imagery",
            "world-physical",
            "topo",
            "usa-topo",
            "ocean"
          ]
        },
        "attribution": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        }
      }
    },
    "dashlistPanel": {
      "title": "DashlistPanel",
      "description": "Links to other dashboards on this server; no datasource or queries.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "type",
        "gridPos"
      ],
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "type": {
          "const": "dashlist"
        },
        "display": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "query": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "tags": {
              "type": "array",
              "maxItems": 10,
              "uniqueItems": true,
              "items": {
                "type": "string",
                "pattern": "^[a-z0-9][a-z0-9_.-]{0,39}$"
              }
            },
            "limit": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "keepTime": {
              "type": "boolean"
            },
            "includeVars": {
              "type": "boolean"
            }
          }
        }
      }
    },
    "newsPanel": {
      "title": "NewsPanel",
      "description": "The latest items of one RSS or Atom feed, fetched by the server for allowlisted domains; no datasource or queries.",
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "type",
        "gridPos"
      ],
      "properties": {
        "id": {
          "description": "Stable across versions; comments anchor to it.",
          "type": "string",
          "pattern": "^[A-Za-z][A-Za-z0-9_-]{0,63}$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 200
        },
        "description": {
          "type": "string",
          "minLength": 1,
          "maxLength": 2000
        },
        "gridPos": {
          "$ref": "#/$defs/gridPos"
        },
        "type": {
          "const": "news"
        },
        "display": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "feedUrl": {
              "description": "An https RSS or Atom feed URL. The server fetches it only when its domain is on the outbound allowlist.",
              "type": "string",
              "minLength": 9,
              "maxLength": 2000,
              "pattern": "^https://[^\\s]+$"
            }
          }
        }
      }
    }
  }
}
