Board kit command

connector.add

Connector

Draws a connector between two ends, each attached to an element or at a free point, with route type, arrowheads, label and bends; answers its id.

Kit
Board 0.1.0 (.kboard)
Changes the document
yes

Parameters

Parameters of connector.add
NameTypeRequiredDescription
endArrowhead"none" | "arrow" | "dot" | "triangle" | "triangle-open" | "diamond" | "diamond-open" | "circle-open" | "bar"noArrowhead at the end (arrow by default)
fromobjectyesThe start: { element, anchor? } to attach to an element (anchor [0..1, 0..1] on its box, the nearest edge when absent), or { point: [x, y] }
keystringnoAn authoring id, unique on the page
labelstringnoThe label
pagestringnoThe page's id; the shown page when absent
startArrowhead"none" | "arrow" | "dot" | "triangle" | "triangle-open" | "diamond" | "diamond-open" | "circle-open" | "bar"noArrowhead at the start (none by default)
styleobjectnoThe connector's style
toobjectyesThe end: { element, anchor? } to attach to an element (anchor [0..1, 0..1] on its box, the nearest edge when absent), or { point: [x, y] }
type"straight" | "elbow" | "curved"noThe route
waypointsnumber[][]noBends in path order

Call through board_run

text
board_run {
  "path": "<file>.kboard",
  "steps": [{ "command": "connector.add", "params": { "from": <object>, "to": <object> } }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: endArrowhead, key, label, page, startArrowhead, style, type, waypoints. board_run answers the step’s result in completed[i].result.

Result

The kit gives no result schema for this command.

Parameter schema

json
{
  "additionalProperties": false,
  "properties": {
    "endArrowhead": {
      "description": "Arrowhead at the end (arrow by default)",
      "enum": [
        "none",
        "arrow",
        "dot",
        "triangle",
        "triangle-open",
        "diamond",
        "diamond-open",
        "circle-open",
        "bar"
      ],
      "type": "string"
    },
    "from": {
      "additionalProperties": false,
      "description": "The start: { element, anchor? } to attach to an element (anchor [0..1, 0..1] on its box, the nearest edge when absent), or { point: [x, y] }",
      "properties": {
        "anchor": {
          "description": "[x, y] on the element's box, clamped to 0 to 1",
          "oneOf": [
            {
              "items": {
                "description": "One component",
                "maximum": 1000000,
                "minimum": -1000000,
                "type": "number"
              },
              "type": "array"
            },
            {
              "additionalProperties": false,
              "properties": {
                "x": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                },
                "y": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "type": "object"
            }
          ]
        },
        "element": {
          "description": "The element to attach to",
          "type": "string",
          "x-khp-role": "object",
          "x-khp-types": [
            "Element"
          ]
        },
        "point": {
          "description": "A free end at [x, y]",
          "oneOf": [
            {
              "items": {
                "description": "One component",
                "maximum": 1000000,
                "minimum": -1000000,
                "type": "number"
              },
              "type": "array"
            },
            {
              "additionalProperties": false,
              "properties": {
                "x": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                },
                "y": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "type": "object"
            }
          ]
        }
      },
      "type": "object"
    },
    "key": {
      "description": "An authoring id, unique on the page",
      "type": "string"
    },
    "label": {
      "description": "The label",
      "type": "string"
    },
    "page": {
      "description": "The page's id; the shown page when absent",
      "type": "string",
      "x-khp-types": [
        "Page"
      ]
    },
    "startArrowhead": {
      "description": "Arrowhead at the start (none by default)",
      "enum": [
        "none",
        "arrow",
        "dot",
        "triangle",
        "triangle-open",
        "diamond",
        "diamond-open",
        "circle-open",
        "bar"
      ],
      "type": "string"
    },
    "style": {
      "additionalProperties": false,
      "description": "The connector's style",
      "properties": {
        "connectorType": {
          "description": "Connector route",
          "enum": [
            "straight",
            "elbow",
            "curved"
          ],
          "type": "string"
        },
        "dashStyle": {
          "description": "Line dashes",
          "enum": [
            "solid",
            "dashed",
            "dotted"
          ],
          "type": "string"
        },
        "endArrowhead": {
          "description": "Arrowhead at the end",
          "enum": [
            "none",
            "arrow",
            "dot",
            "triangle",
            "triangle-open",
            "diamond",
            "diamond-open",
            "circle-open",
            "bar"
          ],
          "type": "string"
        },
        "opacity": {
          "description": "0 to 1",
          "maximum": 1,
          "minimum": 0,
          "type": "number"
        },
        "startArrowhead": {
          "description": "Arrowhead at the start",
          "enum": [
            "none",
            "arrow",
            "dot",
            "triangle",
            "triangle-open",
            "diamond",
            "diamond-open",
            "circle-open",
            "bar"
          ],
          "type": "string"
        },
        "strokeColor": {
          "description": "Line or text colour: one of ink, gray, purple, green, orange, red, yellow, blue, white or #rrggbb",
          "type": "string"
        },
        "strokeSize": {
          "description": "Line weight",
          "enum": [
            "s",
            "m",
            "l",
            "xl"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "to": {
      "additionalProperties": false,
      "description": "The end: { element, anchor? } to attach to an element (anchor [0..1, 0..1] on its box, the nearest edge when absent), or { point: [x, y] }",
      "properties": {
        "anchor": {
          "description": "[x, y] on the element's box, clamped to 0 to 1",
          "oneOf": [
            {
              "items": {
                "description": "One component",
                "maximum": 1000000,
                "minimum": -1000000,
                "type": "number"
              },
              "type": "array"
            },
            {
              "additionalProperties": false,
              "properties": {
                "x": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                },
                "y": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "type": "object"
            }
          ]
        },
        "element": {
          "description": "The element to attach to",
          "type": "string",
          "x-khp-role": "object",
          "x-khp-types": [
            "Element"
          ]
        },
        "point": {
          "description": "A free end at [x, y]",
          "oneOf": [
            {
              "items": {
                "description": "One component",
                "maximum": 1000000,
                "minimum": -1000000,
                "type": "number"
              },
              "type": "array"
            },
            {
              "additionalProperties": false,
              "properties": {
                "x": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                },
                "y": {
                  "description": "One component",
                  "maximum": 1000000,
                  "minimum": -1000000,
                  "type": "number"
                }
              },
              "required": [
                "x",
                "y"
              ],
              "type": "object"
            }
          ]
        }
      },
      "type": "object"
    },
    "type": {
      "description": "The route",
      "enum": [
        "straight",
        "elbow",
        "curved"
      ],
      "type": "string"
    },
    "waypoints": {
      "description": "Bends in path order",
      "items": {
        "items": {
          "description": "Coordinate",
          "maximum": 1000000,
          "minimum": -1000000,
          "type": "number"
        },
        "type": "array"
      },
      "type": "array"
    }
  },
  "required": [
    "from",
    "to"
  ],
  "type": "object"
}

Generated from the command list of @kition/[email protected] and the kit itself (board_commands through @kition/[email protected], built from KitionAI/kition-board@e78c190). As data: commands.jsonl.