{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://graph-paper.io/docs/schema/plot-document.strict.schema.json",
  "title": "Graph Paper plot document (strict)",
  "description": "A Graph Paper plot document, strict: use this schema to catch a misspelled or unknown field name before the document is sent to the /new link, the POST /plot-link service or the MCP tool make_plot_link. The format is at https://graph-paper.io/plot-document-format/en/. This schema is https://graph-paper.io/docs/schema/plot-document.schema.json with one difference: it refuses every key that the validator warns about (an unknown or misspelled key, a key that is internal to Graph Paper or that holds a function, a data key of a series that has a formula in \"fn\", the domain of the other dimension, and a key of the stage axis written on an axis of \"domain\", which the service keeps but warns about: write it under \"stage.<axis>Axis\"). The service does not refuse such a key: it ignores the key, or keeps it, and gives a warning. So a document that fails this schema only because of such a key is still accepted by the service; https://graph-paper.io/docs/schema/plot-document.schema.json is the schema of what the service accepts. This schema also refuses the keys \"__proto__\", \"constructor\" and \"prototype\" in its closed objects; the service removes them with no warning. The values that the validator keeps without a check (the values of the stage keys, the style values of a series, the fields of a preset) are not checked here either, and an unknown key inside them is accepted. The validator also checks what a JSON Schema cannot express, so a document that passes this schema can still be refused: the size of the document (at most 65536 bytes of UTF-8 JSON) and its depth (at most 32 levels of arrays and objects); the LaTeX text of the formulas and of the names; the rules that compare two values (arrays of one length, min < max, a face index smaller than the number of vertices); and the rules between rows (the source of a derived series and the series that a fill goes to must name the id of a series). Send the document to https://graph-paper.io/plot-link to get every error and warning with its path.",
  "type": "object",
  "required": [
    "title",
    "series"
  ],
  "properties": {
    "actions": {
      "type": "array",
      "maxItems": 50,
      "items": {
        "$ref": "#/definitions/action"
      },
      "description": "Assignments that run on a click or on a timer."
    },
    "category": {
      "enum": [
        "2d",
        "3d",
        "data"
      ],
      "description": "Absent: derived from the series. It must agree with the dimension of the series."
    },
    "definitions": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "$ref": "#/definitions/definition"
      },
      "description": "Functions and constants."
    },
    "domain": {
      "$ref": "#/definitions/domain"
    },
    "domain3d": {
      "$ref": "#/definitions/domain3d"
    },
    "markers": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/definitions/marker"
      },
      "description": "Annotations on the plot."
    },
    "points": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/definitions/point"
      },
      "description": "Draggable points."
    },
    "preset": {
      "type": "object",
      "required": [
        "base"
      ],
      "properties": {
        "base": {
          "enum": [
            "academic",
            "basel",
            "slides",
            "vellum"
          ]
        },
        "colors": {},
        "fonts": {},
        "label": {},
        "mathScale": {},
        "palette": {},
        "styles": {}
      },
      "description": "The look of the document: a base preset and optional overrides.",
      "additionalProperties": false
    },
    "series": {
      "type": "array",
      "minItems": 1,
      "maxItems": 100,
      "items": {
        "$ref": "#/definitions/series"
      },
      "description": "The rows that draw. All series of a document are 2D, or all are 3D."
    },
    "stage": {
      "$ref": "#/definitions/stage"
    },
    "stage3d": {
      "$ref": "#/definitions/stage3d"
    },
    "title": {
      "type": "string",
      "pattern": "^\\s*\\S(?:[\\s\\S]{0,198}\\S)?\\s*$",
      "description": "The document title, plain text, 1 to 200 characters after the white space at its ends is removed. The pattern permits white space at the two ends and counts only the characters between them."
    },
    "variables": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/definitions/variable"
      },
      "description": "Sliders."
    }
  },
  "anyOf": [
    {
      "properties": {
        "series": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "bar",
                  "boxplot",
                  "candlestick",
                  "derived",
                  "domainColoring",
                  "heatmap",
                  "histogram",
                  "implicit",
                  "line",
                  "parametric",
                  "polar",
                  "polygon-list",
                  "scatter",
                  "vector-field"
                ]
              }
            }
          }
        },
        "category": {
          "enum": [
            "2d",
            "data"
          ]
        },
        "domain": {
          "type": "object",
          "properties": {
            "x": {
              "$ref": "#/definitions/axis-domain"
            },
            "y": {
              "$ref": "#/definitions/axis-domain"
            }
          }
        },
        "markers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "band",
                  "ellipse",
                  "label",
                  "line",
                  "point",
                  "rect",
                  "rule"
                ]
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "label"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "z": false
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "line"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "z0": false,
                    "z1": false
                  }
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "point"
                    }
                  }
                },
                "then": {
                  "properties": {
                    "z": false
                  }
                }
              }
            ]
          }
        },
        "domain3d": false
      }
    },
    {
      "properties": {
        "series": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "analyticLandscape",
                  "implicit-surface",
                  "mesh",
                  "parametric-curve",
                  "parametric-surface",
                  "primitives3d",
                  "scatter3d",
                  "spherical-surface",
                  "surface"
                ]
              }
            }
          }
        },
        "category": {
          "enum": [
            "3d"
          ]
        },
        "domain3d": {
          "type": "object",
          "properties": {
            "x": {
              "$ref": "#/definitions/axis-domain3d"
            },
            "y": {
              "$ref": "#/definitions/axis-domain3d"
            },
            "z": {
              "$ref": "#/definitions/axis-domain3d"
            }
          }
        },
        "markers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "kind": {
                "enum": [
                  "label",
                  "line",
                  "plane-band",
                  "point"
                ]
              }
            },
            "allOf": [
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "label"
                    }
                  }
                },
                "then": {
                  "required": [
                    "z"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "line"
                    }
                  }
                },
                "then": {
                  "required": [
                    "z0",
                    "z1"
                  ]
                }
              },
              {
                "if": {
                  "properties": {
                    "kind": {
                      "const": "point"
                    }
                  }
                },
                "then": {
                  "required": [
                    "z"
                  ]
                }
              }
            ]
          }
        },
        "domain": false
      }
    }
  ],
  "definitions": {
    "action": {
      "type": "object",
      "required": [
        "latex"
      ],
      "properties": {
        "autoplay": {
          "type": "boolean"
        },
        "interval": {
          "description": "Run the action on a timer: the interval in milliseconds.",
          "allOf": [
            {
              "$ref": "#/definitions/latexOrNumber"
            }
          ]
        },
        "latex": {
          "type": "string"
        },
        "note": {
          "$ref": "#/definitions/note"
        }
      },
      "additionalProperties": false
    },
    "axis-domain": {
      "type": "object",
      "properties": {
        "range": {
          "description": "The visible range [min, max].",
          "allOf": [
            {
              "$ref": "#/definitions/interval"
            }
          ]
        },
        "scale": {
          "enum": [
            "linear",
            "log",
            "symlog",
            "asinh"
          ]
        }
      },
      "description": "An axis of the 2D view, for example { \"range\": [0, 10], \"scale\": \"log\" }. \"min\" and \"max\" are not keys of an axis and are ignored with a warning.",
      "additionalProperties": false
    },
    "axis-domain3d": {
      "type": "object",
      "properties": {
        "range": {
          "description": "The visible range [min, max].",
          "allOf": [
            {
              "$ref": "#/definitions/interval"
            }
          ]
        }
      },
      "description": "An axis of the 3D view, for example { \"range\": [0, 10] }. A 3D axis is always linear.",
      "additionalProperties": false
    },
    "colorBar": {
      "type": "object",
      "properties": {
        "anchor": {
          "enum": [
            "bottom",
            "bottom-left",
            "bottom-right",
            "left",
            "right",
            "top",
            "top-left",
            "top-right"
          ]
        },
        "label": {
          "type": "string",
          "maxLength": 2000
        },
        "placement": {
          "enum": [
            "inside",
            "outside"
          ]
        },
        "visible": {
          "type": "boolean"
        }
      },
      "description": "Where the color bar of a series with a colormap color is drawn, and its label. Every series type takes it.",
      "additionalProperties": false
    },
    "coordinate": {
      "type": "object",
      "required": [
        "name",
        "value"
      ],
      "properties": {
        "name": {
          "$ref": "#/definitions/name"
        },
        "value": {
          "$ref": "#/definitions/latexOrNumber"
        }
      },
      "additionalProperties": false
    },
    "dataColor": {
      "type": "string",
      "pattern": "\\S",
      "maxLength": 64,
      "description": "A CSS color, such as \"#1e88e5\", of at most 64 characters."
    },
    "definition": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "object",
          "required": [
            "latex"
          ],
          "properties": {
            "hidden": {
              "type": "boolean"
            },
            "latex": {
              "type": "string"
            },
            "note": {
              "$ref": "#/definitions/note"
            }
          },
          "additionalProperties": false
        }
      ],
      "description": "A definition as LaTeX (\"f(x) = x^{2}\"), or { \"latex\": …, \"hidden\": …, \"note\": … }. The validator also checks the LaTeX text; this schema cannot."
    },
    "domain": {
      "type": "object",
      "properties": {
        "aspect": {},
        "barMode": {},
        "barNorm": {},
        "coordinateSystem": {},
        "rangePadding": {},
        "x": {},
        "y": {}
      },
      "description": "The 2D view: the visible range and scale of the axes x and y. \"viewportFrame\" and \"viewportFrozen\" are internal and ignored with a warning.",
      "additionalProperties": false
    },
    "domain3d": {
      "type": "object",
      "properties": {
        "aspectMode": {},
        "clipPlane": {},
        "clipToBox": {},
        "x": {},
        "y": {},
        "z": {}
      },
      "description": "The 3D view: the visible range of the axes x, y and z.",
      "additionalProperties": false
    },
    "formula": {
      "type": "string",
      "pattern": "\\S",
      "description": "A LaTeX formula with at least one character that is not white space. In JSON, a backslash is written twice: \"\\\\sin(x)\". The validator also refuses a function name or a power written as plain text (\"sin(x)\", \"x**2\"); this schema cannot check that."
    },
    "interval": {
      "type": "array",
      "minItems": 2,
      "maxItems": 2,
      "items": {
        "type": "number"
      },
      "description": "[min, max]: two numbers. The validator also requires min < max; this schema cannot check that."
    },
    "latexOrNumber": {
      "type": [
        "string",
        "number"
      ],
      "description": "A LaTeX expression (\"0.5\", \"\\\\frac{1}{2}\") or a number, which is read as its decimal text. The validator also checks the LaTeX text; this schema cannot."
    },
    "marker": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "enum": [
            "band",
            "ellipse",
            "label",
            "line",
            "plane-band",
            "point",
            "rect",
            "rule"
          ],
          "description": "The marker kind. \"special-value\" is refused."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "kind": {
                "const": "band"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-band"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "ellipse"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-ellipse"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "label"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-label"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "line"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-line"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "plane-band"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-plane-band"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "point"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-point"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "rect"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-rect"
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "rule"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/marker-rule"
          }
        }
      ],
      "description": "An annotation that the reader can move, style and delete. Coordinates are numbers, not formulas. \"id\" and \"note\" are ignored with a warning."
    },
    "marker-band": {
      "type": "object",
      "required": [
        "from",
        "to",
        "axis"
      ],
      "properties": {
        "axis": {
          "enum": [
            "x",
            "y"
          ]
        },
        "from": {
          "type": "number"
        },
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "fill": {
              "$ref": "#/definitions/markerColor"
            },
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        },
        "to": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-ellipse": {
      "type": "object",
      "required": [
        "cx",
        "cy",
        "rx",
        "ry"
      ],
      "properties": {
        "angle": {
          "type": "number",
          "description": "Degrees."
        },
        "cx": {
          "type": "number"
        },
        "cy": {
          "type": "number"
        },
        "kind": {},
        "rx": {
          "$ref": "#/definitions/positiveNumber"
        },
        "ry": {
          "$ref": "#/definitions/positiveNumber"
        },
        "style": {
          "type": "object",
          "properties": {
            "fill": {
              "$ref": "#/definitions/markerColor"
            },
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "marker-label": {
      "type": "object",
      "required": [
        "x",
        "y",
        "text"
      ],
      "properties": {
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "background": {
              "$ref": "#/definitions/markerColor"
            },
            "color": {
              "$ref": "#/definitions/markerColor"
            },
            "fontSizeOffset": {
              "type": "integer",
              "minimum": -3,
              "maximum": 3
            }
          },
          "additionalProperties": false
        },
        "text": {
          "type": "string",
          "pattern": "\\S",
          "maxLength": 500
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-line": {
      "type": "object",
      "required": [
        "x0",
        "y0",
        "x1",
        "y1"
      ],
      "properties": {
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "arrowFrom": {
              "type": "boolean"
            },
            "arrowTo": {
              "type": "boolean"
            },
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        },
        "x0": {
          "type": "number"
        },
        "x1": {
          "type": "number"
        },
        "y0": {
          "type": "number"
        },
        "y1": {
          "type": "number"
        },
        "z0": {
          "type": "number"
        },
        "z1": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-plane-band": {
      "type": "object",
      "required": [
        "from",
        "to",
        "axis"
      ],
      "properties": {
        "axis": {
          "enum": [
            "x",
            "y",
            "z"
          ]
        },
        "from": {
          "type": "number"
        },
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "fill": {
              "$ref": "#/definitions/markerColor"
            },
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        },
        "to": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-point": {
      "type": "object",
      "required": [
        "x",
        "y"
      ],
      "properties": {
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "fill": {
              "$ref": "#/definitions/markerColor"
            },
            "size": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "stroke": {
              "$ref": "#/definitions/pointMarkerStroke"
            },
            "symbol": {
              "enum": [
                "circle",
                "cross",
                "diamond",
                "plus",
                "square",
                "triangle"
              ]
            }
          },
          "additionalProperties": false
        },
        "x": {
          "type": "number"
        },
        "y": {
          "type": "number"
        },
        "z": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-rect": {
      "type": "object",
      "required": [
        "x0",
        "y0",
        "x1",
        "y1"
      ],
      "properties": {
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "fill": {
              "$ref": "#/definitions/markerColor"
            },
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        },
        "x0": {
          "type": "number"
        },
        "x1": {
          "type": "number"
        },
        "y0": {
          "type": "number"
        },
        "y1": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "marker-rule": {
      "type": "object",
      "required": [
        "value",
        "axis"
      ],
      "properties": {
        "axis": {
          "enum": [
            "x",
            "y"
          ]
        },
        "kind": {},
        "style": {
          "type": "object",
          "properties": {
            "stroke": {
              "$ref": "#/definitions/markerStroke"
            }
          },
          "additionalProperties": false
        },
        "value": {
          "type": "number"
        }
      },
      "additionalProperties": false
    },
    "markerColor": {
      "anyOf": [
        {
          "type": "string",
          "pattern": "^#(?:[0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$"
        },
        {
          "const": "transparent"
        }
      ],
      "description": "A hex color (\"#rgb\", \"#rgba\", \"#rrggbb\" or \"#rrggbbaa\") or \"transparent\"."
    },
    "markerStroke": {
      "type": "object",
      "properties": {
        "color": {
          "$ref": "#/definitions/markerColor"
        },
        "dash": {
          "type": "array",
          "items": {
            "type": "number",
            "minimum": 0
          },
          "description": "Lengths in pixels, such as [4, 4]."
        },
        "width": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "name": {
      "type": "string",
      "pattern": "\\S",
      "description": "The name of a variable, as LaTeX (\"a\", \"x_0\", \"\\\\alpha\"). The validator also refuses a name that Graph Paper cannot make a variable of; this schema cannot check that."
    },
    "nonEmptyNumberArray": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "number"
      }
    },
    "note": {
      "type": "string",
      "maxLength": 2000,
      "description": "Text shown above the row: Markdown with inline $…$ math, at most 2000 characters. A blank note is ignored."
    },
    "numberArray": {
      "type": "array",
      "items": {
        "type": "number"
      }
    },
    "playback": {
      "type": "object",
      "required": [
        "mode",
        "direction",
        "duration"
      ],
      "properties": {
        "direction": {
          "enum": [
            "forward",
            "reverse"
          ]
        },
        "duration": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Milliseconds for one traversal."
        },
        "mode": {
          "enum": [
            "all-at-once",
            "bounce",
            "loop",
            "once"
          ]
        }
      },
      "description": "How the slider animates. Absent: the playback of a new variable in Graph Paper.",
      "additionalProperties": false
    },
    "point": {
      "type": "object",
      "required": [
        "x",
        "y"
      ],
      "properties": {
        "drag": {
          "enum": [
            "none",
            "x",
            "y"
          ]
        },
        "note": {
          "$ref": "#/definitions/note"
        },
        "x": {
          "$ref": "#/definitions/coordinate"
        },
        "y": {
          "$ref": "#/definitions/coordinate"
        }
      },
      "additionalProperties": false
    },
    "point3": {
      "type": "array",
      "minItems": 3,
      "maxItems": 3,
      "items": {
        "type": "number"
      },
      "description": "[x, y, z]: three numbers."
    },
    "pointMarkerStroke": {
      "type": "object",
      "properties": {
        "color": {
          "$ref": "#/definitions/markerColor"
        },
        "width": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false
    },
    "positiveNumber": {
      "type": "number",
      "exclusiveMinimum": 0
    },
    "series": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "enum": [
            "analyticLandscape",
            "bar",
            "boxplot",
            "candlestick",
            "derived",
            "domainColoring",
            "heatmap",
            "histogram",
            "implicit",
            "implicit-surface",
            "line",
            "mesh",
            "parametric",
            "parametric-curve",
            "parametric-surface",
            "polar",
            "polygon-list",
            "primitives3d",
            "scatter",
            "scatter3d",
            "spherical-surface",
            "surface",
            "vector-field"
          ],
          "description": "The series type. \"derived-marker\" is refused."
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "analyticLandscape"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-analyticLandscape"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "bar"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-bar"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "boxplot"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-boxplot"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "candlestick"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-candlestick"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "derived"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-derived"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "domainColoring"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-domainColoring"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "heatmap"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-heatmap"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "histogram"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-histogram"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "implicit"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-implicit"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "implicit-surface"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-implicit-surface"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "line"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-line"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "mesh"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-mesh"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "parametric"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-parametric"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "parametric-curve"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-parametric-curve"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "parametric-surface"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-parametric-surface"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "polar"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-polar"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "polygon-list"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-polygon-list"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "primitives3d"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-primitives3d"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "scatter"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-scatter"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "scatter3d"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-scatter3d"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "spherical-surface"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-spherical-surface"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "surface"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-surface"
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "vector-field"
              }
            }
          },
          "then": {
            "$ref": "#/definitions/series-vector-field"
          }
        }
      ],
      "description": "One curve, surface or data set. The keys of each type are listed in its definition (series-<type>); a key of another type, an unknown key, \"note\", and the keys that are internal to Graph Paper (\"axisBounds\", \"complexMode\", \"definitionEpoch\", \"domainExprs\", \"domainFromClips\", \"floorPlane\", \"fnExpandedJson\", \"fnSource\", \"fnTemplate\", \"fnTemplateArgs\", \"geometryKey\", \"gpuColorDeclined\", \"mask\", \"maskDocumentVars\", \"maskPredicate\", \"maskPredicateExpandedJson\", \"maskPredicateFns\", \"maskPredicateJson\" and \"sourceData\") or hold a function in the plot types (\"fnFallbackJson\", \"maskIntervalPredicate\", \"maskPredicateFallbackJson\", \"onColorVectorResolved\", \"onCompileBand\" and \"onPartialResolve\") are ignored with a warning. When a row has \"fn\", its data keys (such as \"x\" and \"y\" of a line) are ignored with a warning."
    },
    "series-analyticLandscape": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "coloring": {},
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "heightMode": {},
        "heightRange": {},
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "resolution": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {}
      },
      "additionalProperties": false
    },
    "series-bar": {
      "type": "object",
      "required": [
        "x",
        "y"
      ],
      "properties": {
        "base": {},
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "colors": {},
        "cornerRadius": {},
        "error": {},
        "fill": {},
        "fillOpacity": {},
        "id": {},
        "labelPosition": {},
        "labelStyle": {},
        "labels": {},
        "legend": {},
        "legendLabel": {},
        "monochromaticBar": {},
        "name": {},
        "orientation": {},
        "stroke": {},
        "type": {},
        "visible": {},
        "x": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "The categories or positions, each a string or a number."
        },
        "y": {
          "$ref": "#/definitions/numberArray"
        }
      },
      "additionalProperties": false
    },
    "series-boxplot": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "borderRadius": {},
        "boxWidth": {},
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "data": {
          "type": "array",
          "minItems": 1,
          "items": {
            "anyOf": [
              {
                "$ref": "#/definitions/numberArray"
              },
              {
                "type": "object",
                "required": [
                  "min",
                  "q1",
                  "median",
                  "q3",
                  "max"
                ],
                "properties": {
                  "min": {
                    "type": "number"
                  },
                  "q1": {
                    "type": "number"
                  },
                  "median": {
                    "type": "number"
                  },
                  "q3": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  },
                  "outliers": {
                    "$ref": "#/definitions/numberArray"
                  }
                }
              }
            ]
          },
          "description": "Items: a summary { \"min\", \"q1\", \"median\", \"q3\" and \"max\" } with numbers (and \"outliers\", an array of numbers), or an array of the samples."
        },
        "fillOpacity": {},
        "id": {},
        "legend": {},
        "legendLabel": {},
        "medianColor": {},
        "name": {},
        "orientation": {},
        "outlierSize": {},
        "strokeColor": {},
        "strokeOpacity": {},
        "type": {},
        "visible": {},
        "x": {
          "type": "array",
          "items": {
            "type": [
              "string",
              "number"
            ]
          },
          "description": "The labels of the boxes."
        }
      },
      "additionalProperties": false
    },
    "series-candlestick": {
      "type": "object",
      "required": [
        "data"
      ],
      "properties": {
        "barWidth": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "data": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "required": [
              "x",
              "open",
              "high",
              "low",
              "close"
            ],
            "properties": {
              "x": {
                "type": "number"
              },
              "open": {
                "type": "number"
              },
              "high": {
                "type": "number"
              },
              "low": {
                "type": "number"
              },
              "close": {
                "type": "number"
              }
            }
          },
          "description": "Items { \"x\", \"open\", \"high\", \"low\" and \"close\" }, each a number."
        },
        "downColor": {},
        "fillOpacity": {},
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "type": {},
        "upColor": {},
        "visible": {},
        "wickWidth": {}
      },
      "additionalProperties": false
    },
    "series-derived": {
      "type": "object",
      "required": [
        "source",
        "transform"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "id": {},
        "legend": {},
        "legendEquation": {},
        "legendLabel": {},
        "legendShowR2": {},
        "name": {},
        "source": {
          "type": "string",
          "description": "The \"id\" of the series this one is computed from. The validator also requires that one other series has this id, that it comes first when it is derived too, and that it takes the transform; this schema cannot check that."
        },
        "stroke": {},
        "transform": {
          "$ref": "#/definitions/transform"
        },
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-domainColoring": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "coloring": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "magnitudeRange": {},
        "magnitudeScale": {},
        "modularGrid": {},
        "name": {},
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-heatmap": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "x": false,
          "y": false,
          "z": false
        }
      },
      "else": {
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          },
          "y": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          },
          "z": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "contains": {
              "type": "array",
              "contains": {
                "type": "number"
              }
            },
            "description": "Rows of values: each a number, or null for a hole. At least 1 row of at least 1 value, and at least one number. The validator also requires rows of one length; this schema cannot check that."
          }
        }
      },
      "properties": {
        "cellSize": {},
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "opacity": {},
        "type": {},
        "visible": {},
        "x": {},
        "y": {},
        "z": {},
        "zRange": {}
      },
      "additionalProperties": false
    },
    "series-histogram": {
      "type": "object",
      "required": [
        "values"
      ],
      "properties": {
        "barWidth": {},
        "binEdges": {},
        "bins": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "cornerRadius": {},
        "fill": {},
        "fillOpacity": {},
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "normalize": {},
        "stroke": {},
        "type": {},
        "values": {
          "$ref": "#/definitions/numberArray"
        },
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-implicit": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fill": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "predicate": {},
        "sampling": {},
        "stroke": {},
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-implicit-surface": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                },
                "z": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\", \"y\" and \"z\", each optional, or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "predicate": {},
        "resolution": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {}
      },
      "additionalProperties": false
    },
    "series-line": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "x": false,
          "y": false
        }
      },
      "else": {
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          },
          "y": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "$ref": "#/definitions/interval"
            }
          ],
          "description": "An interval [min, max] of the parameter or of x, or one positive number n for [-n, n]."
        },
        "fill": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "sampling": {},
        "stroke": {},
        "type": {},
        "unresolvedSpansFromScalarLeg": {
          "description": "When the time budget stops the sampling of the curve before it is complete, true (the default) draws the whole curve again with a faster, less exact evaluation of the formula. Only the JSON value false keeps the incomplete curve, with gaps where the sampling did not reach (hatched, unless they cover most of the plot); any other value is read as true."
        },
        "visible": {},
        "x": {},
        "y": {}
      },
      "additionalProperties": false
    },
    "series-mesh": {
      "type": "object",
      "required": [
        "vertices",
        "faces"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "faces": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "array",
            "minItems": 3,
            "maxItems": 3,
            "items": {
              "type": "integer",
              "minimum": 0
            }
          },
          "description": "Triangles [i, j, k], each an index into vertices. The validator also requires each index to be smaller than the number of vertices; this schema cannot check that."
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "normals": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/point3"
          },
          "description": "One normal for each vertex. The validator also requires one for each vertex; this schema cannot check the count."
        },
        "outline": {},
        "sampling": {},
        "type": {},
        "vertices": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/definitions/point3"
          }
        },
        "visible": {},
        "wireframe": {}
      },
      "additionalProperties": false
    },
    "series-parametric": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "arrowTo": {},
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "$ref": "#/definitions/interval"
            }
          ],
          "description": "An interval [min, max] of the parameter or of x, or one positive number n for [-n, n]."
        },
        "fill": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "sampling": {},
        "stroke": {},
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-parametric-curve": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "$ref": "#/definitions/interval"
            }
          ],
          "description": "An interval [min, max] of the parameter or of x, or one positive number n for [-n, n]."
        },
        "fill": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "lineWidth": {},
        "material": {},
        "name": {},
        "outline": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {}
      },
      "additionalProperties": false
    },
    "series-parametric-surface": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "u",
                "v"
              ],
              "properties": {
                "u": {
                  "$ref": "#/definitions/interval"
                },
                "v": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"u\" and \"v\", or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {},
        "zRange": {}
      },
      "additionalProperties": false
    },
    "series-polar": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "theta": false,
          "r": false
        }
      },
      "else": {
        "required": [
          "theta",
          "r"
        ],
        "properties": {
          "theta": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          },
          "r": {
            "$ref": "#/definitions/nonEmptyNumberArray"
          }
        }
      },
      "properties": {
        "angleUnit": {},
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "$ref": "#/definitions/interval"
            }
          ],
          "description": "An interval [min, max] of the parameter or of x, or one positive number n for [-n, n]."
        },
        "fill": {},
        "fillSide": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "r": {},
        "sampling": {},
        "stroke": {},
        "theta": {},
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-polygon-list": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "polygons": false
        }
      },
      "else": {
        "required": [
          "polygons"
        ],
        "properties": {
          "fillColors": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/dataColor"
            },
            "description": "One color for each polygon. The validator also requires one color for each polygon; this schema cannot check the count."
          },
          "polygons": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "arrowTo": {
                  "type": "boolean"
                },
                "strokeClosed": {
                  "type": "boolean"
                },
                "x": {
                  "type": "array",
                  "minItems": 2,
                  "items": {
                    "type": "number"
                  }
                },
                "y": {
                  "type": "array",
                  "minItems": 2,
                  "items": {
                    "type": "number"
                  }
                }
              },
              "additionalProperties": false
            },
            "description": "Each polygon is { \"x\": […], \"y\": […] } with at least 2 vertices. The validator also requires \"x\" and \"y\" of one length; this schema cannot check that."
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "fill": {},
        "fillColors": {},
        "fillOpacity": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "polygons": {},
        "stroke": {},
        "type": {},
        "visible": {}
      },
      "additionalProperties": false
    },
    "series-primitives3d": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "items": false
        }
      },
      "else": {
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "object",
              "required": [
                "shape"
              ],
              "properties": {
                "shape": {
                  "enum": [
                    "arrow",
                    "cone",
                    "cube",
                    "cylinder",
                    "line",
                    "sphere",
                    "triangle",
                    "tube"
                  ]
                }
              },
              "allOf": [
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "arrow"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "from",
                      "to"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "from": {
                        "$ref": "#/definitions/point3"
                      },
                      "headLength": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "headRadius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "radius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "shape": {},
                      "to": {
                        "$ref": "#/definitions/point3"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "cone"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "from",
                      "to",
                      "radius"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "from": {
                        "$ref": "#/definitions/point3"
                      },
                      "radius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "shape": {},
                      "to": {
                        "$ref": "#/definitions/point3"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "cube"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "center",
                      "size"
                    ],
                    "properties": {
                      "center": {
                        "$ref": "#/definitions/point3"
                      },
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "shape": {},
                      "size": {
                        "anyOf": [
                          {
                            "$ref": "#/definitions/positiveNumber"
                          },
                          {
                            "type": "array",
                            "minItems": 3,
                            "maxItems": 3,
                            "items": {
                              "$ref": "#/definitions/positiveNumber"
                            }
                          }
                        ]
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "cylinder"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "from",
                      "to",
                      "radius"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "from": {
                        "$ref": "#/definitions/point3"
                      },
                      "radius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "shape": {},
                      "to": {
                        "$ref": "#/definitions/point3"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "line"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "from",
                      "to"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "from": {
                        "$ref": "#/definitions/point3"
                      },
                      "shape": {},
                      "to": {
                        "$ref": "#/definitions/point3"
                      },
                      "width": {
                        "$ref": "#/definitions/positiveNumber"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "sphere"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "center",
                      "radius"
                    ],
                    "properties": {
                      "center": {
                        "$ref": "#/definitions/point3"
                      },
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "radius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "shape": {}
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "triangle"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "vertices"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "shape": {},
                      "vertices": {
                        "type": "array",
                        "minItems": 3,
                        "maxItems": 3,
                        "items": {
                          "$ref": "#/definitions/point3"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                },
                {
                  "if": {
                    "properties": {
                      "shape": {
                        "const": "tube"
                      }
                    }
                  },
                  "then": {
                    "required": [
                      "shape",
                      "from",
                      "to",
                      "radius"
                    ],
                    "properties": {
                      "color": {
                        "$ref": "#/definitions/dataColor"
                      },
                      "from": {
                        "$ref": "#/definitions/point3"
                      },
                      "radius": {
                        "$ref": "#/definitions/positiveNumber"
                      },
                      "shape": {},
                      "to": {
                        "$ref": "#/definitions/point3"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              ]
            }
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "items": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "resolution": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {}
      },
      "additionalProperties": false
    },
    "series-scatter": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "x": false,
          "y": false
        }
      },
      "else": {
        "required": [
          "x",
          "y"
        ],
        "properties": {
          "x": {
            "$ref": "#/definitions/numberArray"
          },
          "y": {
            "$ref": "#/definitions/numberArray"
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "colors": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "labelAnchor": {},
        "labelStyle": {},
        "labels": {},
        "legend": {},
        "legendLabel": {},
        "line": {},
        "marker": {},
        "name": {},
        "points": {},
        "sizes": {},
        "type": {},
        "visible": {},
        "x": {},
        "xError": {},
        "y": {},
        "yError": {},
        "z": {}
      },
      "additionalProperties": false
    },
    "series-scatter3d": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "x": false,
          "y": false,
          "z": false
        }
      },
      "else": {
        "required": [
          "x",
          "y",
          "z"
        ],
        "properties": {
          "x": {
            "$ref": "#/definitions/numberArray"
          },
          "y": {
            "$ref": "#/definitions/numberArray"
          },
          "z": {
            "$ref": "#/definitions/numberArray"
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "colors": {},
        "contours": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "line": {},
        "marker": {},
        "material": {},
        "name": {},
        "outline": {},
        "points": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {},
        "x": {},
        "y": {},
        "z": {}
      },
      "additionalProperties": false
    },
    "series-spherical-surface": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "type": "object",
          "required": [
            "theta",
            "phi"
          ],
          "properties": {
            "theta": {
              "$ref": "#/definitions/interval"
            },
            "phi": {
              "$ref": "#/definitions/interval"
            }
          },
          "additionalProperties": false,
          "description": "An object of intervals [min, max] for \"theta\" and \"phi\"."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {},
        "zRange": {}
      },
      "additionalProperties": false
    },
    "series-surface": {
      "type": "object",
      "if": {
        "required": [
          "fn"
        ]
      },
      "then": {
        "properties": {
          "z": false
        }
      },
      "else": {
        "required": [
          "z"
        ],
        "properties": {
          "z": {
            "type": "array",
            "minItems": 2,
            "items": {
              "type": "array",
              "minItems": 2,
              "items": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "contains": {
              "type": "array",
              "contains": {
                "type": "number"
              }
            },
            "description": "Rows of values: each a number, or null for a hole. At least 2 rows of at least 2 values, and at least one number. The validator also requires rows of one length; this schema cannot check that."
          }
        }
      },
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "contours": {},
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fill": {},
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "id": {},
        "legend": {},
        "legendLabel": {},
        "material": {},
        "name": {},
        "outline": {},
        "sampling": {},
        "type": {},
        "visible": {},
        "wireframe": {},
        "z": {},
        "zRange": {}
      },
      "additionalProperties": false
    },
    "series-vector-field": {
      "type": "object",
      "required": [
        "fn"
      ],
      "properties": {
        "color": {},
        "colorBar": {
          "$ref": "#/definitions/colorBar"
        },
        "domain": {
          "anyOf": [
            {
              "$ref": "#/definitions/positiveNumber"
            },
            {
              "type": "object",
              "required": [
                "x",
                "y"
              ],
              "properties": {
                "x": {
                  "$ref": "#/definitions/interval"
                },
                "y": {
                  "$ref": "#/definitions/interval"
                }
              },
              "additionalProperties": false
            }
          ],
          "description": "An object of intervals [min, max] for \"x\" and \"y\", or one positive number n for [-n, n] on each variable."
        },
        "fn": {
          "$ref": "#/definitions/formula"
        },
        "gridSize": {},
        "headStyle": {},
        "id": {},
        "legend": {},
        "legendLabel": {},
        "name": {},
        "normalize": {},
        "opacity": {},
        "scale": {},
        "type": {},
        "visible": {},
        "width": {}
      },
      "additionalProperties": false
    },
    "stage": {
      "type": "object",
      "properties": {
        "barSpacing": {},
        "barWidth": {},
        "crosshair": {},
        "decorations": {},
        "frame": {},
        "gridStyle": {
          "description": "The grid: one of true, false, \"lines\", \"lines-x\", \"lines-y\", \"dots\", \"isometric\". The validator keeps the value without a check, so this schema does not refuse another value."
        },
        "layout": {},
        "playback": {},
        "showTimeline": {},
        "specialValues": {},
        "transitions": {},
        "xAxis": {
          "description": "An axis of the plot. Its keys: \"arrows\", \"axisLineStroke\", \"gridStroke\", \"label\", \"labelPlacement\", \"labelPosition\", \"position\", \"showAxisLine\", \"showTicks\", \"subGrid\", \"tickLabels\", \"tickMarkValues\", \"tickValues\", \"ticks\", \"writingMode\", \"zeroLine\" and \"zeroLineStroke\". The validator keeps the value without a check."
        },
        "yAxis": {
          "description": "An axis of the plot. Its keys: \"arrows\", \"axisLineStroke\", \"gridStroke\", \"label\", \"labelPlacement\", \"labelPosition\", \"position\", \"showAxisLine\", \"showTicks\", \"subGrid\", \"tickLabels\", \"tickMarkValues\", \"tickValues\", \"ticks\", \"writingMode\", \"zeroLine\" and \"zeroLineStroke\". The validator keeps the value without a check."
        }
      },
      "description": "The 2D stage: grid, axes, frame, layout. The values are kept without a check. \"markers\" is ignored with a warning: the markers of a document are in the top-level \"markers\" list.",
      "additionalProperties": false
    },
    "stage3d": {
      "type": "object",
      "properties": {
        "axes": {},
        "camera": {},
        "decorations": {},
        "environment": {},
        "floor": {},
        "frame": {},
        "grid": {},
        "ground": {},
        "lighting": {},
        "orbit": {},
        "playback": {},
        "projection": {},
        "shadowMapBias": {},
        "shadowMapDebug": {},
        "shadowMapIntensity": {},
        "shadowMapLights": {},
        "shadowMapNormalOffset": {},
        "shadowMapPCSS": {},
        "shadowMapPCSSLightSize": {},
        "shadowMapResolution": {},
        "tooltips": {},
        "transitions": {},
        "walls": {},
        "zeroLine": {}
      },
      "description": "The 3D scene: camera, lighting, axes, grid. The values are kept without a check. \"markers\" is ignored with a warning.",
      "additionalProperties": false
    },
    "transform": {
      "type": "object",
      "required": [
        "kind"
      ],
      "properties": {
        "kind": {
          "enum": [
            "derivative",
            "ema",
            "integral",
            "sma",
            "smooth",
            "trendline"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "kind": {
                "const": "derivative"
              }
            }
          },
          "then": {
            "properties": {
              "kind": {}
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "ema"
              }
            }
          },
          "then": {
            "required": [
              "alpha"
            ],
            "properties": {
              "alpha": {
                "type": "number",
                "exclusiveMinimum": 0,
                "maximum": 1
              },
              "kind": {}
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "integral"
              }
            }
          },
          "then": {
            "properties": {
              "kind": {}
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "sma"
              }
            }
          },
          "then": {
            "required": [
              "window"
            ],
            "properties": {
              "kind": {},
              "window": {
                "type": "integer",
                "minimum": 1,
                "description": "The number of points of the moving average."
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "smooth"
              }
            }
          },
          "then": {
            "properties": {
              "kind": {},
              "method": {
                "const": "spline"
              },
              "tension": {
                "type": "number",
                "minimum": 0,
                "maximum": 1
              }
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "kind": {
                "const": "trendline"
              }
            }
          },
          "then": {
            "required": [
              "model"
            ],
            "properties": {
              "degree": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10,
                "description": "The degree of a polynomial model."
              },
              "kind": {},
              "model": {
                "enum": [
                  "exponential",
                  "linear",
                  "logarithmic",
                  "polynomial",
                  "power",
                  "quadratic"
                ]
              }
            },
            "additionalProperties": false
          }
        }
      ],
      "description": "How the series is computed from its source, for example { \"kind\": \"sma\", \"window\": 5 }."
    },
    "variable": {
      "type": "object",
      "required": [
        "name",
        "value",
        "domain"
      ],
      "properties": {
        "autoplay": {
          "type": "boolean"
        },
        "domain": {
          "$ref": "#/definitions/variableDomain"
        },
        "name": {
          "$ref": "#/definitions/name"
        },
        "note": {
          "$ref": "#/definitions/note"
        },
        "playback": {
          "$ref": "#/definitions/playback"
        },
        "value": {
          "description": "The initial value.",
          "allOf": [
            {
              "$ref": "#/definitions/latexOrNumber"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "variableDomain": {
      "type": "object",
      "required": [
        "type"
      ],
      "properties": {
        "type": {
          "enum": [
            "range",
            "values"
          ]
        }
      },
      "allOf": [
        {
          "if": {
            "properties": {
              "type": {
                "const": "range"
              }
            }
          },
          "then": {
            "type": "object",
            "required": [
              "min",
              "max"
            ],
            "properties": {
              "hardMax": {
                "type": "boolean"
              },
              "hardMin": {
                "type": "boolean"
              },
              "max": {
                "$ref": "#/definitions/latexOrNumber"
              },
              "min": {
                "$ref": "#/definitions/latexOrNumber"
              },
              "step": {
                "$ref": "#/definitions/latexOrNumber"
              },
              "type": {}
            },
            "additionalProperties": false
          }
        },
        {
          "if": {
            "properties": {
              "type": {
                "const": "values"
              }
            }
          },
          "then": {
            "type": "object",
            "required": [
              "values"
            ],
            "properties": {
              "type": {},
              "values": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "$ref": "#/definitions/latexOrNumber"
                }
              }
            },
            "additionalProperties": false
          }
        }
      ]
    }
  },
  "additionalProperties": false
}
