Sheet kit command

drawing.insert

Insert Drawing Object

Inserts a drawing object (shape, text box or chart) with geometry, a frame in sheet points, placement, fill, stroke and text; answers its id.

Kit
Sheet 0.1.0 (.xlsx (and opens .xlsm, .xls, .xltx, .csv, .ods, .xlsb))
Changes the document
yes

Parameters

Parameters of drawing.insert
NameTypeRequiredDescription
bodyanynoread by the command beside its listed parameters
chartobjectno{kind?, title?, legend?, dataLabels?, gridlines?, xTitle?, yTitle?} (a chart of the selected cells, or of `range`); a chart of the selected cells, or of `range`
fillanyno
frameobjectno{x,y,w,h,rot?,flipH?,flipV?} (sheet points); sheet points
geometryobjectno{preset, adjust?}
kind"shape" | "textBox" | "chart"no
paragraphsany[]noread by the command beside its listed parameters
placementobjectno{kind: cell, mode?}
rangestringnocells in A1 notation such as B2 or B2:D10, optionally with a sheet (Sheet2!A1); default: the selection
strokeanyno
textstringno
warpanynoread by the command beside its listed parameters

Call through sheet_run

text
sheet_run {
  "path": "<file>.xlsx",
  "steps": [{ "command": "drawing.insert" }]
}

The required parameters, with placeholders for their types: not a tested example. Optional: body, chart, fill, frame, geometry, kind, paragraphs, placement, range, stroke, text, warp. sheet_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": {
      "description": "read by the command beside its listed parameters"
    },
    "chart": {
      "additionalProperties": true,
      "description": "{kind?, title?, legend?, dataLabels?, gridlines?, xTitle?, yTitle?} (a chart of the selected cells, or of `range`); a chart of the selected cells, or of `range`",
      "properties": {
        "dataLabels": {},
        "gridlines": {},
        "kind": {},
        "legend": {},
        "title": {
          "type": "string"
        },
        "xTitle": {},
        "yTitle": {}
      },
      "type": "object"
    },
    "fill": {},
    "frame": {
      "additionalProperties": true,
      "description": "{x,y,w,h,rot?,flipH?,flipV?} (sheet points); sheet points",
      "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"
    },
    "paragraphs": {
      "description": "read by the command beside its listed parameters",
      "type": "array"
    },
    "placement": {
      "additionalProperties": true,
      "description": "{kind: cell, mode?}",
      "properties": {
        "kind": {
          "description": "cell"
        },
        "mode": {}
      },
      "type": "object"
    },
    "range": {
      "description": "cells in A1 notation such as B2 or B2:D10, optionally with a sheet (Sheet2!A1); default: the selection",
      "type": "string"
    },
    "stroke": {},
    "text": {
      "type": "string"
    },
    "warp": {
      "description": "read by the command beside its listed parameters"
    }
  },
  "type": "object"
}

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