Doc kit command
drawing.insert
Insert Drawing Object
Inserts a floating drawing object (shape, text box or chart) with geometry, a frame in page points, placement, fill, stroke and text; answers its id.
- Kit
- Doc 0.1.0 (.docx)
- Changes the document
- yes
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
body | object | no | read by the command beside its listed parameters |
chart | object | no | {kind?, title?, categories?, series?: [{name, values, color?}], legend?, dataLabels?, gridlines?, xTitle?, yTitle?} |
fill | string | object | no | the shape's fill |
frame | object | no | {x,y,w,h,rot?,flipH?,flipV?} (points on page "placement.page"; without x/y the object goes in line at the caret); points on page "placement.page"; without x/y the object goes in line at the caret |
geometry | object | no | {"preset", "adjust"?} |
kind | "shape" | "textBox" | "chart" | no | |
page | integer | no | read by the command beside its listed parameters |
paragraphs | any[] | no | read by the command beside its listed parameters |
placement | object | no | |
stroke | object | no | the outline: {color?, width? (pt), dash?} or {none: true} |
text | string | no | |
warp | object | no | read by the command beside its listed parameters |
Call through doc_run
text
doc_run {
"path": "<file>.docx",
"steps": [{ "command": "drawing.insert" }]
}The required parameters, with placeholders for their types: not a tested example. Optional: body, chart, fill, frame, geometry, kind, page, paragraphs, placement, stroke, text, warp. doc_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": {
"body": {
"additionalProperties": true,
"description": "read by the command beside its listed parameters",
"type": "object"
},
"chart": {
"additionalProperties": true,
"description": "{kind?, title?, categories?, series?: [{name, values, color?}], legend?, dataLabels?, gridlines?, xTitle?, yTitle?}",
"properties": {
"categories": {},
"dataLabels": {},
"gridlines": {},
"kind": {},
"legend": {},
"series": {
"description": "[{name, values, color?}]",
"items": {
"additionalProperties": true,
"properties": {
"color": {
"type": "string"
},
"name": {
"type": "string"
},
"values": {}
},
"type": "object"
},
"type": "array"
},
"title": {
"type": "string"
},
"xTitle": {},
"yTitle": {}
},
"type": "object"
},
"fill": {
"description": "the shape's fill",
"oneOf": [
{
"description": "a colour: \"#rrggbb\" or a theme slot such as \"accent1\"; \"none\" for no fill",
"type": "string"
},
{
"additionalProperties": true,
"description": "{color}, {gradient} or {none: true}",
"type": "object"
}
]
},
"frame": {
"additionalProperties": true,
"description": "{x,y,w,h,rot?,flipH?,flipV?} (points on page \"placement.page\"; without x/y the object goes in line at the caret); points on page \"placement.page\"; without x/y the object goes in line at the caret",
"properties": {
"flipH": {},
"flipV": {},
"h": {
"type": "number"
},
"rot": {},
"w": {
"type": "number"
},
"x": {
"type": "number"
},
"y": {
"type": "number"
}
},
"type": "object"
},
"geometry": {
"additionalProperties": true,
"description": "{\"preset\", \"adjust\"?}",
"properties": {
"adjust": {},
"preset": {
"type": "string"
}
},
"type": "object"
},
"kind": {
"enum": [
"shape",
"textBox",
"chart"
],
"type": "string"
},
"page": {
"description": "read by the command beside its listed parameters",
"type": "integer"
},
"paragraphs": {
"description": "read by the command beside its listed parameters",
"type": "array"
},
"placement": {
"additionalProperties": true,
"properties": {
"page": {
"type": "integer"
},
"wrap": {
"enum": [
"inline",
"square",
"tight",
"through",
"topAndBottom",
"behindText",
"inFrontOfText"
],
"type": "string"
}
},
"type": "object"
},
"stroke": {
"additionalProperties": true,
"description": "the outline: {color?, width? (pt), dash?} or {none: true}",
"type": "object"
},
"text": {
"type": "string"
},
"warp": {
"additionalProperties": true,
"description": "read by the command beside its listed parameters",
"type": "object"
}
},
"type": "object"
}Generated from the command list of @kition/[email protected] and the kit itself (doc_commands through @kition/[email protected], built from KitionAI/kition-doc@41e14a8). As data: commands.jsonl.