Abandon whatever is being placed: the anchors so far are dropped and, unless the controller stays in drawing mode, the tool is disarmed too, so one Escape returns the chart to the cursor the way a finished shape would. With nothing pending, an armed tool is simply disarmed. Returns whether anything changed, so a host can let the key fall through when it did nothing.
The clipboard behind copy / cut / paste, for a host reporting failures.
Put drawings on the clipboard. Defaults to the selection; pass an id or a list of ids to copy something else. Resolves false when there was nothing to copy, or when the payload could not be stored anywhere.
Optionaltarget: null | string | readonly string[]Copy, then delete. The delete happens only after the clipboard write resolves successfully, so a refused write leaves the model exactly as it was rather than destroying a drawing that went nowhere.
Optionaltarget: null | string | readonly string[]End a variable-anchor shape (polyline, path) at the anchors placed so far.
Those tools declare points: 0, so nothing else can ever complete them;
without this they collected vertices forever. Bound to double-click, and
public so a host can offer Esc / Enter too. No-op when there is nothing
placeable, so a stray double-click costs nothing.
Replace every drawing. Accepts a DrawingsDocument or a 1.9.x bare
Drawing[]; both go through the migration, so an old save upgrades on
load. Clears the selection and history.
The snap mode in force, after the boolean form has been folded.
Move drawings by a screen distance, dx right and dy down in media px,
as one undo entry. Pixels rather than data units so an arrow key moves a
shape the same visible amount on every pane and scale. Locked drawings
stay put.
Paste whatever is on the clipboard into this chart, offset from the original so the copy is visibly a second object, and select the result. Each pasted drawing is a fresh object with a fresh id, never a second reference to the one copied, so editing the paste cannot alter its source (or the clipboard).
Anything that is not our payload (foreign text, a truncated or hand-edited copy, a newer format) pastes nothing and resolves to an empty array: a paste shortcut must not throw at the host because the user last copied a spreadsheet cell.
Remove the last anchor placed on a variable-anchor tool (polyline, path) still being drawn: the Backspace of placement. A fixed-anchor tool has nothing to pop, since its anchors commit the moment the last one lands, and a freehand stroke is one gesture rather than a list. Returns whether an anchor went.
Replace the selection, or with additive toggle each id into it (the
shift-click gesture). Ids that name nothing are ignored, so the selection
never refers to a drawing that is not there. Pass null to clear.
Serialisable document, the same shape ChartState.drawings carries.
Patch several drawings as one undo entry: a colour change across a multi-selection is one edit to the user, so it is one Ctrl+Z too. Ids that no longer exist are skipped; nothing is recorded when none exist.
Add a fully-specified drawing (import, or a host-authored one).