coras_edit_diagram
Edit existing CORAS .dgx diagrams: add or remove elements and arrows, rename, recolor, or reposition items, and re-run layout while preserving manual positions. A backup copy is created.
Instructions
Change an existing .dgx file in place: add or remove elements and arrows, rename things, recolour, move, add or drop whole diagrams, or re-run the automatic layout. Existing positions are kept unless you ask for a relayout, and a .bak copy is made first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | The .dgx file to change. | |
| scale | No | ||
| backup | No | Write a .bak copy (default true). | |
| layout | No | 'preserve' (default) keeps hand positions and only places new elements; 'auto' re-lays out every diagram that changed. | |
| preview | No | Return an image (default true). | |
| direction | No | ||
| operations | Yes | Edits, applied in order. Each has an 'op': add_node, add_edge, remove_node, remove_edge, rename, set, set_label, add_diagram, remove_diagram, rename_diagram, relayout. add_node takes the same fields as a node in coras_create_diagram; add_edge takes from/to/label/type/strategy; set takes id plus any of name, kind, color, font, x, y, width, height. |