Board kit command
element.add
Create elements
Makes one or more elements (shapes, text, sticky notes, strokes, frames, connectors, cards) on a page in one step; use it to build content, element.set to change existing elements.
- Kit
- Board 0.1.0 (.kboard)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
elements | object[] | yes | The elements to make, back to front |
page | string | no | The page's id; the shown page when absent |
Call through board_run
text
board_run {
"path": "<file>.kboard",
"steps": [{ "command": "element.add", "params": { "elements": <object[]> } }]
}The required parameters, with placeholders for their types: not a tested example. Optional: page. 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": {
"elements": {
"description": "The elements to make, back to front",
"items": {
"additionalProperties": false,
"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"
},
"fillColor": {
"description": "Fill colour: one of ink, gray, purple, green, orange, red, yellow, blue, white or #rrggbb",
"type": "string"
},
"fillStyle": {
"description": "How the shape is filled",
"enum": [
"none",
"solid",
"semi",
"pattern"
],
"type": "string"
},
"fontFamily": {
"description": "Typeface",
"enum": [
"sans",
"serif",
"mono"
],
"type": "string"
},
"fontSize": {
"description": "Text size in board units",
"maximum": 1000,
"minimum": 1,
"type": "number"
},
"key": {
"description": "An authoring id, unique on the page",
"type": "string"
},
"kind": {
"description": "What to make (connectors, pictures, cards and groups have their own commands)",
"enum": [
"shape",
"text",
"frame",
"stroke"
],
"type": "string"
},
"opacity": {
"description": "0 to 1",
"maximum": 1,
"minimum": 0,
"type": "number"
},
"parent": {
"description": "A frame or group to put it in",
"type": "string",
"x-khp-role": "object",
"x-khp-types": [
"Element"
]
},
"points": {
"description": "A stroke's points, at least two",
"items": {
"items": {
"description": "Coordinate",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"type": "array"
},
"type": "array"
},
"position": {
"description": "[x, y] of the top-left corner, in board units (shape, text, frame)",
"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"
}
]
},
"rotation": {
"description": "Degrees about the centre",
"maximum": 3600,
"minimum": -3600,
"type": "number"
},
"roundness": {
"description": "Corner radius in board units",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"shapeStyle": {
"description": "The shape's role",
"enum": [
"default",
"sticky",
"mind-node",
"flow-node",
"image-placeholder"
],
"type": "string"
},
"shapeType": {
"description": "The shape (rectangle by default); a line runs along its box's longer side (rotation turns it)",
"enum": [
"rectangle",
"ellipse",
"triangle",
"diamond",
"hexagon",
"pill",
"parallelogram",
"star",
"cloud",
"heart",
"x-box",
"check-box",
"check",
"arrow-left",
"arrow-right",
"arrow-up",
"arrow-down",
"line",
"pentagon",
"octagon",
"trapezoid",
"right-triangle",
"cross",
"chevron",
"arrow-left-right",
"arrow-up-down",
"callout",
"brace-left",
"brace-right",
"document",
"multi-document",
"predefined-process",
"cylinder",
"manual-input",
"manual-operation",
"delay",
"display",
"off-page",
"stored-data",
"internal-storage",
"summing-junction",
"or-junction",
"note",
"actor"
],
"type": "string"
},
"size": {
"description": "[w, h] (shape 160 × 100 and frame 640 × 400 by default; text sizes itself)",
"oneOf": [
{
"items": {
"description": "One component",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"type": "array"
},
{
"additionalProperties": false,
"properties": {
"h": {
"description": "One component",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
"w": {
"description": "One component",
"maximum": 100000,
"minimum": 0,
"type": "number"
}
},
"required": [
"h",
"w"
],
"type": "object"
}
]
},
"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"
},
"text": {
"description": "The label, text or frame title",
"type": "string"
},
"textAlign": {
"description": "Text alignment",
"enum": [
"left",
"center",
"right"
],
"type": "string"
},
"textFormat": {
"description": "How the text is written",
"enum": [
"plain",
"markdown"
],
"type": "string"
}
},
"required": [
"kind"
],
"type": "object"
},
"type": "array"
},
"page": {
"description": "The page's id; the shown page when absent",
"type": "string",
"x-khp-types": [
"Page"
]
}
},
"required": [
"elements"
],
"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.