render_canvas
Render a system diagram as a PNG image from a YAML recipe string, with automatic layout and support for hierarchical or flat node structures.
Instructions
Render a canvas diagram from a YAML recipe string. Supports hierarchical format (networks/factories/machines/nodes) or a simplified format (flat list of nodes with inputs/outputs). Returns the path to the rendered PNG file.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| scale | No | Render scale factor (default 2.0 for crisp, legible output) | |
| filename | No | Output filename (without extension). Default: auto-generated UUID. | |
| organize | No | Apply the hierarchical organize algorithm for automatic layout with proper breathing room. Organizes nodes within machines, machines within factories, factories within networks — each with appropriate spacing. Default: true. | |
| orientation | No | Layout direction: 'horizontal' (left→right, default) or 'vertical' (top→bottom tree). Applied at all hierarchy levels. | horizontal |
| yaml_recipe | Yes | YAML string defining the canvas. Simplified format example: title: My Diagram nodes: - id: start type: input content: 'Begin here' - id: process type: process content: 'Do work' inputs: [start] Node types: static, input, ai, source, output, decision, process, default Coordinates (x, y) are optional — auto-layout is applied if all are 0. | |
| spacing_level | No | Spacing level for organize layout: 'node' (tight: 60h/110v), 'container' (medium: 150h/190v, default), 'network' (spacious: 190h/250v). | container |