{ "$id": "https://github.com/Geo-AID/Geo-AID/blob/v0.4/figure.schema.json", "title": "Geo-AID JSON Figure", "description": "Geo-AID's JSON export format", "type": "object", "properties": { "width": { "description": "The width of the image", "type": "number", "exclusiveMinimum": 0 }, "height": { "description": "The height of the image", "type": "number", "exclusiveMinimum": 0 }, "expressions": { "description": "Expressions used by the image", "type": "array", "items": { "type": "object", "description": "A single expression", "properties": { "hint": { "description": "The calculated value of this expression", "$ref": "#/$defs/value" }, "kind": { "description": "The kind of expression this is", "oneOf": [ { "type": "object", "description": "An entity", "properties": { "type": { "const": "entity" }, "id": { "description": "The index of the entity", "$ref": "#/$defs/index" } }, "required": ["type", "id"] }, { "type": "object", "description": "Intersection of k and l", "properties": { "type": { "const": "line-line-intersection" }, "k": { "$ref": "#/$defs/index" }, "l": { "$ref": "#/$defs/index" } }, "required": ["type", "k", "l"] }, { "type": "object", "description": "The arithmetic average of points as complex numbers", "properties": { "type": { "const": "average-point" }, "items": { "type": "array", "items": { "$ref": "#/$defs/index" }, "minItems": 1 } }, "required": ["type", "items"] }, { "type": "object", "description": "Center of a circle", "properties": { "type": { "const": "circle-center" }, "circle": { "$ref": "#/$defs/index" } }, "required": ["type", "circle"] }, { "type": "object", "description": "Summation of numbers", "properties": { "type": {"const": "sum"}, "plus": { "type": "array", "items": { "$ref": "#/$defs/index" } }, "minus": { "type": "array", "items": { "$ref": "#/$defs/index" } } }, "required": ["type", "plus", "minus"] }, { "type": "object", "description": "Multiplication of numbers", "properties": { "type": {"const": "product"}, "times": { "type": "array", "items": { "$ref": "#/$defs/index" } }, "by": { "type": "array", "items": { "$ref": "#/$defs/index" } } }, "required": ["type", "times", "by"] }, { "type": "object", "description": "A constant number value", "properties": { "type": {"const": "const"}, "value": {"$ref": "#/$defs/complex"} }, "required": ["type", "value"] }, { "type": "object", "description": "Raising a value to a rational power", "properties": { "type": {"const": "power"}, "value": {"$ref": "#/$defs/index"}, "exponent": {"$ref": "#/$defs/ratio"} }, "required": ["type", "value", "exponent"] }, { "type": "object", "description": "Distance between `p` and `q`", "properties": { "type": { "const": "point-point-distance" }, "p": { "$ref": "#/$defs/index" }, "q": { "$ref": "#/$defs/index" } }, "required": ["type", "p", "q"] }, { "type": "object", "description": "Distance between `point` and `line`", "properties": { "type": { "const": "point-line-distance" }, "point": { "$ref": "#/$defs/index" }, "line": { "$ref": "#/$defs/index" } }, "required": ["type", "point", "line"] }, { "type": "object", "description": "Angle `abc`", "properties": { "type": { "const": "three-point-angle" }, "a": { "$ref": "#/$defs/index" }, "b": { "$ref": "#/$defs/index" }, "c": {"$ref": "#/$defs/index"} }, "required": ["type", "a", "b", "c"] }, { "type": "object", "description": "Directed angle `abc`", "properties": { "type": { "const": "three-point-angle-dir" }, "a": { "$ref": "#/$defs/index" }, "b": { "$ref": "#/$defs/index" }, "c": {"$ref": "#/$defs/index"} }, "required": ["type", "a", "b", "c"] }, { "type": "object", "description": "Angle between `k` and `l`", "properties": { "type": { "const": "two-line-angle" }, "k": { "$ref": "#/$defs/index" }, "l": { "$ref": "#/$defs/index" } }, "required": ["type", "k", "l"] }, { "type": "object", "description": "X coordinate of a point", "properties": { "type": { "const": "point-x" }, "point": { "$ref": "#/$defs/index" } }, "required": ["type", "point"] }, { "type": "object", "description": "Y coordinate of a point", "properties": { "type": { "const": "point-y" }, "point": { "$ref": "#/$defs/index" } }, "required": ["type", "point"] }, { "type": "object", "description": "Line `pq`", "properties": { "type": { "const": "point-point-line" }, "p": { "$ref": "#/$defs/index" }, "q": { "$ref": "#/$defs/index" } }, "required": ["type", "p", "q"] }, { "type": "object", "description": "Bisector of angle `abc`", "properties": { "type": { "const": "angle-bisector" }, "a": { "$ref": "#/$defs/index" }, "b": { "$ref": "#/$defs/index" }, "c": {"$ref": "#/$defs/index"} }, "required": ["type", "a", "b", "c"] }, { "type": "object", "description": "Perpendicular line going through point", "properties": { "type": { "const": "perpendicular-through" }, "point": { "$ref": "#/$defs/index" }, "line": { "$ref": "#/$defs/index" } }, "required": ["type", "point", "line"] }, { "type": "object", "description": "Parallel line going through `point`", "properties": { "type": { "const": "parallel-through" }, "point": { "$ref": "#/$defs/index" }, "line": { "$ref": "#/$defs/index" } }, "required": ["type", "point", "line"] }, { "type": "object", "description": "A circle with center and radius", "properties": { "type": { "const": "construct-circle" }, "center": { "$ref": "#/$defs/index" }, "radius": { "$ref": "#/$defs/index" } }, "required": ["type", "center", "radius"] } ] } }, "required": ["hint", "kind"] } }, "entities": { "description": "Entities in the image", "type": "array", "items": { "type": "object", "description": "A single entity", "properties": { "hint": { "description": "The calculated value of this expression", "$ref": "#/$defs/value" }, "kind": { "description": "The kind of an entity this is", "oneOf": [ { "type": "object", "description": "A free point", "properties": { "type": {"const": "free-point"} }, "required": ["type"] }, { "type": "object", "description": "Point on a line", "properties": { "type": {"const": "point-on-line"}, "line": {"$ref": "#/$defs/index"} }, "required": ["type", "line"] }, { "type": "object", "description": "Point on a circle", "properties": { "type": {"const": "point-on-circle"}, "circle": {"$ref": "#/$defs/index"} }, "required": ["type", "circle"] }, { "type": "object", "description": "A free real", "properties": { "type": {"const": "free-real"} }, "required": ["type"] } ] } }, "required": ["hint", "kind"] } }, "items": { "type": "array", "description": "Items drawn on the image", "items": { "oneOf": [ { "type": "object", "description": "A point item", "properties": { "type": {"const": "point"}, "position": { "$ref": "#/$defs/position", "description": "Where the point should be displayed" }, "label": {"$ref": "#/$defs/label"}, "id": { "$ref": "#/$defs/index", "description": "The defining expression index" }, "display-dot": { "type": "boolean", "description": "Whether the point circle should be drawn", "default": false } }, "required": ["type", "position", "id"] }, { "type": "object", "description": "A line item", "properties": { "type": {"const": "line"}, "points": { "type": "array", "description": "Delimiting points of the drawn line segment", "items": {"$ref": "#/$defs/position"}, "minItems": 2, "maxItems": 2 }, "label": {"$ref": "#/$defs/label"}, "id": { "$ref": "#/$defs/index", "description": "The defining expression index" }, "style": { "$ref": "#/$defs/style", "description": "How the line should be drawn", "default": "solid" } }, "required": ["type", "points", "id"] }, { "type": "object", "description": "A ray item", "properties": { "type": {"const": "ray"}, "points": { "type": "array", "description": "Delimiting points of the drawn ray segment", "items": {"$ref": "#/$defs/position"}, "minItems": 2, "maxItems": 2 }, "label": {"$ref": "#/$defs/label"}, "p-id": { "$ref": "#/$defs/index", "description": "The origin expression index" }, "q-id": { "$ref": "#/$defs/index", "description": "The guiding expression index" }, "style": { "$ref": "#/$defs/style", "description": "How the ray should be drawn", "default": "solid" } }, "required": ["type", "points", "p-id", "q-id"] }, { "type": "object", "description": "A segment item", "properties": { "type": {"const": "segment"}, "points": { "type": "array", "description": "Delimiting points of the drawn segment segment", "items": {"$ref": "#/$defs/position"}, "minItems": 2, "maxItems": 2 }, "label": {"$ref": "#/$defs/label"}, "p-id": { "$ref": "#/$defs/index", "description": "The first point's expression index" }, "q-id": { "$ref": "#/$defs/index", "description": "The second point's expression index" }, "style": { "$ref": "#/$defs/style", "description": "How the segment should be drawn", "default": "solid" } }, "required": ["type", "points", "p-id", "q-id"] }, { "type": "object", "description": "A circle item", "properties": { "type": {"const": "circle"}, "center": { "description": "The center of the drawn circle", "$ref": "#/$defs/position" }, "radius": { "description": "The radius of the drawn circle", "type": "number", "minimum": 0 }, "label": {"$ref": "#/$defs/label"}, "id": { "$ref": "#/$defs/index", "description": "The defining expression index" }, "style": { "$ref": "#/$defs/style", "description": "How the line should be drawn", "default": "solid" } }, "required": ["type", "center", "radius", "id"] } ] } } }, "required": ["width", "height", "expressions", "entities", "items"], "$defs": { "index": { "type": "integer", "minimum": 0, "description": "Index of an expression or an entity" }, "complex": { "type": "object", "description": "A complex number real + i*imaginary", "properties": { "real": { "type": "number", "default": 0, "description": "The real component" }, "imaginary": { "type": "number", "default": 0, "description": "The imaginary component" } } }, "ratio": { "type": "object", "properties": { "nom": { "type": "integer" }, "denom": { "type": "integer", "default": 1, "exclusiveMinimum": 0 } }, "required": ["nom"] }, "value": { "description": "A value of an expression or an entity", "oneOf": [ { "type": "object", "description": "A complex number", "properties": { "type": {"const": "complex"}, "value": {"$ref": "#/$defs/complex"} }, "required": ["type", "value"] }, { "type": "object", "description": "A line", "properties": { "type": {"const": "line"}, "value": { "type": "object", "properties": { "origin": {"$ref": "#/$defs/complex"}, "direction": {"$ref": "#/$defs/complex"} }, "required": ["origin", "direction"] } }, "required": ["type", "value"] }, { "type": "object", "description": "A circle", "properties": { "type": {"const": "circle"}, "value": { "type": "object", "properties": { "center": {"$ref": "#/$defs/complex"}, "radius": {"$ref": "#/$defs/complex"} }, "required": ["center", "radius"] } }, "required": ["type", "value"] } ] }, "style": { "enum": ["solid", "dotted", "dashed", "bold"], "default": "solid", "description": "Defines how a line should be drawn" }, "label": { "type": "object", "description": "Label-related information", "properties": { "position": { "$ref": "#/$defs/position", "description": "Where the label should be drawn (figure space)" }, "content": { "type": "string", "description": "The label contents" } }, "required": ["position", "content"] }, "position": { "type": "object", "description": "Represents a figure space position", "properties": { "x": {"type": "number"}, "y": {"type": "number"} }, "required": ["x", "y"] } } }