Lay out a Garphield graph
garphield_layoutCompute and save node positions for a stored graph with the workbench's own layout recipes, and grade the result with its quality gate. Optional: a graph without positions is laid out by the browser when it opens. Use this to bake positions (for a gallery file or a stable share) or to get a quality grade. Reports which engine ran. Large graphs over the host's budget return LAYOUT_TOO_LARGE; clear: true removes saved positions. preview: true also returns a small image of the result, to check for overlaps, tangles and unreadable labels against the grade's findings; it adds a render (10-20 s on the hosted server), so ask for it when you mean to look.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"doc": "<doc>"
},
"name": "garphield_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| doc | Yes | Document reference: a stored document id, a file path, or "current" in the workbench. | |
| mode | No | force (production Blend, or ForceAtlas2 for large graphs), levels (layered), or geo (the browser places nodes by their coordinate fields). Default: the document's layout, else force. | |
| clear | No | Remove saved positions instead, so the browser lays the graph out when it opens. Pass only doc with it. | |
| aspect | No | Width over height of the frame to fit. Default 1.6. | |
| levels | No | levels mode only. | |
| preview | No | true returns a 600x400 image of the saved graph, so you can check it for overlapping nodes, tangles and unreadable labels and fix them. A render can take 10-20 s and counts toward the host's image limit; the change is saved even when no preview can be made. Default false. |