{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://usechartory.com/schemas/bars.json",
 "description": "The data prop of <Bars> (Chartory chart 001).",
 "type": "object",
 "title": "BarsData",
 "properties": {
  "cats": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "The category labels, in order."
  },
  "vals": {
   "type": "array",
   "items": {
    "type": "number"
   },
   "description": "The values, in order."
  },
  "toks": {
   "type": "array",
   "items": {
    "type": "string"
   },
   "description": "The colour token of each item, in order."
  },
  "max": {
   "type": "number",
   "description": "The top of the value scale."
  },
  "shape": {
   "enum": [
    "pill",
    "top"
   ],
   "description": "The bar ends."
  },
  "inside": {
   "enum": [
    "rot",
    "flat"
   ],
   "description": "How the value labels sit in the bars."
  },
  "ratio": {
   "type": "number",
   "description": "The gap between bars, as a share of the band."
  },
  "fmt": {
   "x-function": "(v: number) => string",
   "description": "A function, so not JSON: pass it in code."
  },
  "ref": {
   "type": "object",
   "title": "BarsRef",
   "properties": {
    "v": {
     "type": "number",
     "description": "The value."
    },
    "label": {
     "type": "string",
     "description": "The name shown on the chart."
    },
    "tok": {
     "type": "string",
     "description": "The colour token, e.g. \"data/primary\"."
    }
   },
   "required": [
    "v",
    "label",
    "tok"
   ],
   "description": "A reference line: value, label and colour."
  }
 },
 "required": [
  "cats",
  "vals",
  "toks",
  "max",
  "shape",
  "inside"
 ]
}
