Graph document schemaΒΆ
A graph is a JSON document (*.graph.json) that the editor opens as nodes and
noodlelab run and noodlelab verify run headless. This is its JSON schema,
generated from noodlelab.core.graph.GraphDocument. The examples that come with
noodlelab are the best reference for real graphs, and Graphs and
reports explains how to build one.
{
"$defs": {
"ExecGraph": {
"properties": {
"nodes": {
"items": {
"$ref": "#/$defs/NodeInstance"
},
"title": "Nodes",
"type": "array"
},
"report": {
"items": {
"$ref": "#/$defs/NodeInstance"
},
"title": "Report",
"type": "array"
},
"zones": {
"items": {
"$ref": "#/$defs/Zone"
},
"title": "Zones",
"type": "array"
},
"constants": {
"additionalProperties": true,
"title": "Constants",
"type": "object"
}
},
"title": "ExecGraph",
"type": "object"
},
"InputValue": {
"description": "Either a link to another node's output, or a literal (widget) value.",
"properties": {
"link": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
},
"value": {
"default": null,
"title": "Value"
}
},
"title": "InputValue",
"type": "object"
},
"LinkRef": {
"description": "A node's output, ``\"@<input>\"`` for the value of one of its inputs, and\noptionally a path of fields into it (see :mod:`noodlelab.core.ports`).",
"properties": {
"node": {
"title": "Node",
"type": "string"
},
"output": {
"title": "Output",
"type": "string"
},
"path": {
"items": {
"type": "string"
},
"title": "Path",
"type": "array"
},
"tab": {
"anyOf": [
{
"const": "processing",
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Tab"
}
},
"required": [
"node",
"output"
],
"title": "LinkRef",
"type": "object"
},
"NodeInstance": {
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"type": {
"title": "Type",
"type": "string"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Title"
},
"inputs": {
"additionalProperties": {
"$ref": "#/$defs/InputValue"
},
"title": "Inputs",
"type": "object"
},
"subgraph": {
"anyOf": [
{
"$ref": "#/$defs/Subgraph"
},
{
"type": "null"
}
],
"default": null
},
"repeat": {
"anyOf": [
{
"$ref": "#/$defs/Repeat"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"id",
"type"
],
"title": "NodeInstance",
"type": "object"
},
"Repeat": {
"properties": {
"kind": {
"default": "repeat",
"enum": [
"repeat",
"sweep",
"optimize"
],
"title": "Kind",
"type": "string"
},
"state": {
"items": {
"$ref": "#/$defs/StateItem"
},
"title": "State",
"type": "array"
},
"until": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
},
"nodes": {
"items": {
"$ref": "#/$defs/NodeInstance"
},
"title": "Nodes",
"type": "array"
}
},
"title": "Repeat",
"type": "object"
},
"StateItem": {
"description": "A value a repeat zone feeds back from one pass to the next.",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Label"
},
"next": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
},
"collect": {
"default": false,
"title": "Collect",
"type": "boolean"
}
},
"required": [
"name"
],
"title": "StateItem",
"type": "object"
},
"Subgraph": {
"properties": {
"inputs": {
"items": {
"$ref": "#/$defs/SubgraphPort"
},
"title": "Inputs",
"type": "array"
},
"outputs": {
"items": {
"$ref": "#/$defs/SubgraphPort"
},
"title": "Outputs",
"type": "array"
},
"nodes": {
"items": {
"$ref": "#/$defs/NodeInstance"
},
"title": "Nodes",
"type": "array"
}
},
"title": "Subgraph",
"type": "object"
},
"SubgraphPort": {
"description": "An input or output of a subgraph. Outputs name the inner output they forward.",
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Label"
},
"link": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
"name"
],
"title": "SubgraphPort",
"type": "object"
},
"Zone": {
"description": "A repeat zone in a flattened graph (see :func:`flatten`).",
"properties": {
"id": {
"title": "Id",
"type": "string"
},
"members": {
"items": {
"type": "string"
},
"title": "Members",
"type": "array"
},
"state": {
"items": {
"$ref": "#/$defs/ZoneState"
},
"title": "State",
"type": "array"
},
"iteration": {
"default": "",
"title": "Iteration",
"type": "string"
},
"until": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
},
"kind": {
"default": "repeat",
"enum": [
"repeat",
"sweep",
"optimize"
],
"title": "Kind",
"type": "string"
},
"row": {
"default": "",
"title": "Row",
"type": "string"
}
},
"required": [
"id"
],
"title": "Zone",
"type": "object"
},
"ZoneState": {
"properties": {
"name": {
"title": "Name",
"type": "string"
},
"node": {
"title": "Node",
"type": "string"
},
"next": {
"anyOf": [
{
"$ref": "#/$defs/LinkRef"
},
{
"type": "null"
}
],
"default": null
},
"collect": {
"default": false,
"title": "Collect",
"type": "boolean"
}
},
"required": [
"name",
"node"
],
"title": "ZoneState",
"type": "object"
}
},
"properties": {
"format": {
"const": "noodlelab.graph",
"default": "noodlelab.graph",
"title": "Format",
"type": "string"
},
"version": {
"default": 1,
"title": "Version",
"type": "integer"
},
"revision": {
"default": 0,
"title": "Revision",
"type": "integer"
},
"name": {
"title": "Name",
"type": "string"
},
"graph": {
"$ref": "#/$defs/ExecGraph"
},
"layout": {
"additionalProperties": true,
"title": "Layout",
"type": "object"
},
"metadata": {
"additionalProperties": true,
"title": "Metadata",
"type": "object"
}
},
"required": [
"name",
"graph"
],
"title": "GraphDocument",
"type": "object"
}