Edit a diagram
apply_opsApplies ops to a diagram as one atomic change (revert_change can revert it). Ids starting with "$" are temporary: the server assigns real ids and returns idMap. New records with caller-chosen ids make a retry after a lost response safe: a repeated batch then fails with id_taken and writes nothing (get_canvas shows what was written). References to temporary ids (parentId, source/target, props.assetId and "asset:$id" strings) are resolved at the end of the list, but ops that change or remove a record need it to exist at that point (added earlier in the list). A *.set or *.remove whose target is not there is dropped (effects.dropped, warning missing_target). If nothing changes (every op dropped, or the values were already there) nothing is written: applied false, noop true, reason (unchanged, dropped or skipped), seq unchanged. dryRun checks the batch, including embedded images, custom shapes and infographic data, against the current state without writing (isError true when it would be rejected; wouldCreate counts the new records); with dryRun, preview "light" or "dark" also returns a PNG of the custom shapes, drawings and infographic blocks (or the whole poster, as export_diagram draws it) the batch touches. People may edit at the same time; each field keeps the last write. baseSeq (the seq read with get_canvas or returned by the last write) reports which fields others changed since then (effects.conflicts, also for records a node.remove deletes with it; warning concurrent_edit); onConflict "skip" keeps their values. Warning node_being_edited means a person is typing in that node right now. A core.vector node takes one source in props: svg, elements, fromIcon, libraryRef or fromImage (read_me topic "shapes"). A palette key from search_node_types (such as infographic.chart::donut) works as the node type; chart data can be sent as data.rows, data.csv or Chart.js labels and datasets (read_me topic "infographics"). Returns applied, seq, batchId, idMap, effects (dropped / cascaded / pruned…, lists cut to the first 20 with a Count), bounds of the touched nodes, images (embedded images the server re-encoded, if any), vectors (converted shapes), infographics (converted variants and data, applied themes) and warnings: layout lint plus props that have no effect (unknown_prop with a suggestion, invalid_prop_value with the allowed values, unknown_type, icon_not_found with close icon names); the change is applied anyway. Edge style and animation keys are in read_me topic "style". status (≤ 80 characters) is shown to people next to your cursor.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ops | Yes | ||
| dryRun | No | ||
| status | No | ||
| baseSeq | No | The seq you last read (get_canvas or your previous write). Fields others changed after it are reported in effects.conflicts. | |
| preview | No | With dryRun: also render a PNG of the custom shapes, drawings and infographic blocks this batch touches (a whole poster when the batch changes one). | |
| diagramId | Yes | Diagram id (from list_diagrams or create_diagram). | |
| onConflict | No | With baseSeq: "overwrite" (default) writes your values anyway; "skip" leaves fields others changed since baseSeq as they are. |