Board kit command
element.set
Update an element
Sets fields of one existing element (position, size, rotation, parent, shape type and style, text placement, mind-map fields); null clears an optional field.
- Kit
- Board 0.1.0 (.kboard)
- Changes the document
- yes
- Acts on
id(one id), which a run step’sonfills
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string | yes | The element |
set | object | yes | Fields to set: position [x, y], size [w, h], rotation, parent, key, points, shapeType, shapeStyle, style fields, labelPosition, mind-map fields; null clears an optional field |
Call through board_run
text
board_run {
"path": "<file>.kboard",
"steps": [{ "command": "element.set", "params": { "id": <string>, "set": <object> } }]
}The required parameters, with placeholders for their types: not a tested example. 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": {
"id": {
"description": "The element",
"type": "string",
"x-khp-types": [
"Element"
]
},
"set": {
"additionalProperties": true,
"description": "Fields to set: position [x, y], size [w, h], rotation, parent, key, points, shapeType, shapeStyle, style fields, labelPosition, mind-map fields; null clears an optional field",
"properties": {
"connectorType": {
"oneOf": [
{
"description": "Connector route",
"enum": [
"straight",
"elbow",
"curved"
],
"type": "string"
},
{
"type": "null"
}
]
},
"dashStyle": {
"oneOf": [
{
"description": "Line dashes",
"enum": [
"solid",
"dashed",
"dotted"
],
"type": "string"
},
{
"type": "null"
}
]
},
"endArrowhead": {
"oneOf": [
{
"description": "Arrowhead at the end",
"enum": [
"none",
"arrow",
"dot",
"triangle",
"triangle-open",
"diamond",
"diamond-open",
"circle-open",
"bar"
],
"type": "string"
},
{
"type": "null"
}
]
},
"fillColor": {
"oneOf": [
{
"description": "Fill colour: one of ink, gray, purple, green, orange, red, yellow, blue, white or #rrggbb",
"type": "string"
},
{
"type": "null"
}
]
},
"fillStyle": {
"oneOf": [
{
"description": "How the shape is filled",
"enum": [
"none",
"solid",
"semi",
"pattern"
],
"type": "string"
},
{
"type": "null"
}
]
},
"fontFamily": {
"oneOf": [
{
"description": "Typeface",
"enum": [
"sans",
"serif",
"mono"
],
"type": "string"
},
{
"type": "null"
}
]
},
"fontSize": {
"oneOf": [
{
"description": "Text size in board units",
"maximum": 1000,
"minimum": 1,
"type": "number"
},
{
"type": "null"
}
]
},
"labelPosition": {
"oneOf": [
{
"description": "Where along the route",
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
]
},
"opacity": {
"oneOf": [
{
"description": "0 to 1",
"maximum": 1,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
]
},
"parent": {
"oneOf": [
{
"description": "A frame or group UUID",
"type": "string"
},
{
"type": "null"
}
],
"x-khp-role": "object",
"x-khp-types": [
"Element"
]
},
"points": {
"oneOf": [
{
"description": "Stroke points",
"items": {
"items": {
"description": "Coordinate",
"maximum": 1000000,
"minimum": -1000000,
"type": "number"
},
"type": "array"
},
"type": "array"
},
{
"type": "null"
}
]
},
"position": {
"oneOf": [
{
"description": "[x, y] in board units",
"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": "null"
}
]
},
"rotation": {
"oneOf": [
{
"description": "Degrees about the centre",
"maximum": 3600,
"minimum": -3600,
"type": "number"
},
{
"type": "null"
}
]
},
"roundness": {
"oneOf": [
{
"description": "Corner radius in board units",
"maximum": 100000,
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
]
},
"size": {
"oneOf": [
{
"description": "[w, h] in board units",
"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"
}
]
},
{
"type": "null"
}
]
},
"startArrowhead": {
"oneOf": [
{
"description": "Arrowhead at the start",
"enum": [
"none",
"arrow",
"dot",
"triangle",
"triangle-open",
"diamond",
"diamond-open",
"circle-open",
"bar"
],
"type": "string"
},
{
"type": "null"
}
]
},
"strokeColor": {
"oneOf": [
{
"description": "Line or text colour: one of ink, gray, purple, green, orange, red, yellow, blue, white or #rrggbb",
"type": "string"
},
{
"type": "null"
}
]
},
"strokeSize": {
"oneOf": [
{
"description": "Line weight",
"enum": [
"s",
"m",
"l",
"xl"
],
"type": "string"
},
{
"type": "null"
}
]
},
"textAlign": {
"oneOf": [
{
"description": "Text alignment",
"enum": [
"left",
"center",
"right"
],
"type": "string"
},
{
"type": "null"
}
]
}
},
"type": "object"
}
},
"required": [
"id",
"set"
],
"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.