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

Parameters of drawing.insert
NameTypeRequiredDescription
bodyobjectnoread by the command beside its listed parameters
chartobjectno{kind?, title?, categories?, series?: [{name, values, color?}], legend?, dataLabels?, gridlines?, xTitle?, yTitle?}
fillstring | objectnothe shape's fill
frameobjectno{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
geometryobjectno{"preset", "adjust"?}
kind"shape" | "textBox" | "chart"no
pageintegernoread by the command beside its listed parameters
paragraphsany[]noread by the command beside its listed parameters
placementobjectno
strokeobjectnothe outline: {color?, width? (pt), dash?} or {none: true}
textstringno
warpobjectnoread 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.