Skip to content

10. Layer 7 — Layout

Contents of DISL 0.1

Automatic layout arranges nodes and routes edges. DISL does not define layout algorithms; it names them, passes options, and declares when layout runs and how it interacts with user placement and bound coordinates.

{
  "layout": {
    "algorithms": {
      "flow": {
        "algorithm": "layered",
        "direction": "right",
        "spacing": { "node": 40, "layer": 80, "edge": 12 },
        "edgeRouting": "orthogonal",
        "options": { "elk.layered.crossingMinimization.strategy": "LAYER_SWEEP" },
        "doc": "Left-to-right flow; transitions become orthogonal."
      }
    },
    "default": "flow",
    "trigger": "manual",
    "respect": "pinned",
    "animate": { "durationMs": 300 }
  }
}
Property Type Description
algorithms map → LayoutConfig Named configurations.
default name Used by the "Arrange" command and trigger.
containers map TypeRef → name or LayoutConfig Layout inside containers of a type (in addition to ContainerSpec's simple layouts).
trigger "manual", "onCreate", "onChange", "onLoadIfMissing", "always" When layout runs automatically. onLoadIfMissing: when a DID definition lacks view data (for example generated by a program). always: positions are never user-controlled (pure layout-driven diagrams). Default "manual".
respect "none", "pinned", "all" Which user positions survive automatic layout: none, only pinned elements (users can pin), or all existing (incremental layout places new elements only). Default "pinned".
incremental bool Prefer stability: minimise movement of existing elements.
animate {durationMs, easing} or false
doc Doc

LayoutConfig

Property Type Description
algorithm string "none", "layered" (Sugiyama), "tree", "mrtree", "radial", "force", "stress", "orthogonal", "box", "grid", "circular", "rectpacking", "lanes" (assign nodes to ordinal bands, then layer within bands), "sequence" (sequence diagrams), "elk:<id>" (any ELK algorithm id), "plugin:<name>".
direction "right", "down", "left", "up" Main flow direction.
spacing {node, layer, edge, component, port} Canvas units.
edgeRouting Routing Routing applied to edges with routing: "layout" or when overrideRouting is true.
overrideRouting bool Layout replaces user bendpoints.
options map string → JSON Pass-through options for the algorithm (ELK option ids recommended for interoperability). Unknown options are ignored.
scope "all", "selection", "component" Default scope when invoked.
includeViewOnly bool Whether notes and annotations take part.
doc Doc

Interaction with coordinate systems. Layout only assigns coordinates whose PlacementSource is free or layout. Bound coordinates (a task's start date) are never changed by layout; algorithms receive them as fixed constraints. For example, "lanes" on a schedule keeps x (time) fixed and only packs y within bands. Layout results are snapped with the rules of the coordinate system unless options["dedl.snap"] is false.

Illustrated by

Referenced from