[
  { "id": "browser-zoomed-drag", "kind": "browser-node-drag", "layers": ["browser"], "gesture": "node-drag", "nodeId": "A", "viewport": { "x": 0, "y": 0, "zoom": 2 }, "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "width": 100, "height": 40 }], "delta": { "x": 40, "y": 20 }, "expect": { "left": 60 } },
  { "id": "browser-zoomed-resize", "kind": "browser-resizer", "layers": ["browser"], "gesture": "resize", "nodeId": "A", "viewport": { "x": 0, "y": 0, "zoom": 2 }, "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "width": 100, "height": 40 }] },
  { "id": "host-zoomed-resize", "kind": "host-hardening", "layers": ["host"], "viewport": { "x": 0, "y": 0, "zoom": 2 }, "nodes": [{ "id": "A", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }] },
  { "id": "host-minimap-geometry", "kind": "host-hardening", "layers": ["host"], "viewport": { "x": 100, "y": 40, "zoom": 2 }, "nodes": [{ "id": "A", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }] },
  { "id": "host-public-provider", "kind": "host-hardening", "layers": ["host"], "nodes": [{ "id": "A", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }] },
  { "id": "host-zoomed-drag", "kind": "host-hardening", "layers": ["host"], "viewport": { "x": 0, "y": 0, "zoom": 2 }, "nodes": [{ "id": "A", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }] },
  { "id": "host-edge-paths", "kind": "host-hardening", "layers": ["host"], "nodes": [{ "id": "A", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }, { "id": "B", "position": { "x": 300, "y": 160 }, "width": 100, "height": 40 }] },
  { "id": "host-custom-handle", "kind": "host-hardening", "layers": ["host"], "nodes": [{ "id": "A", "type": "special", "position": { "x": 10, "y": 20 }, "width": 100, "height": 40 }, { "id": "B", "position": { "x": 300, "y": 160 }, "width": 100, "height": 40 }] },
  {
    "id": "graph-position-one-node",
    "layers": ["code"],
    "kind": "graph",
    "nodes": [{ "id": "A", "x": 1, "y": 2 }, { "id": "B", "x": 3, "y": 4 }],
    "change": { "id": "A", "x": 9, "y": 8 },
    "expect": [{ "id": "A", "x": 9, "y": 8 }, { "id": "B", "x": 3, "y": 4 }]
  },
  {
    "id": "sample-code-layer",
    "layers": ["code"],
    "kind": "ping"
  },
  {
    "id": "bezier-right-left",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "bezier",
    "source": { "x": 0, "y": 20, "position": "right" },
    "target": { "x": 150, "y": 100, "position": "left" },
    "curvature": 0.25,
    "expect": { "labelX": 75, "labelY": 60, "offsetX": 75, "offsetY": 40 }
  },
  {
    "id": "simple-bezier-right-left",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "simplebezier",
    "source": { "x": 0, "y": 20, "position": "right" },
    "target": { "x": 150, "y": 100, "position": "left" },
    "expect": { "labelX": 75, "labelY": 60, "offsetX": 75, "offsetY": 40 }
  },
  {
    "id": "straight",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "straight",
    "source": { "x": 0, "y": 20, "position": "right" },
    "target": { "x": 150, "y": 100, "position": "left" },
    "expect": { "labelX": 75, "labelY": 60, "offsetX": 75, "offsetY": 40 }
  },
  {
    "id": "step-right-left",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "step",
    "source": { "x": 0, "y": 20, "position": "right" },
    "target": { "x": 150, "y": 100, "position": "left" },
    "expect": { "labelX": 75, "labelY": 60, "offsetX": 75, "offsetY": 40 }
  },
  {
    "id": "smoothstep-right-left",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "smoothstep",
    "source": { "x": 0, "y": 20, "position": "right" },
    "target": { "x": 150, "y": 100, "position": "left" },
    "expect": { "labelX": 75, "labelY": 60, "offsetX": 75, "offsetY": 40 }
  },
  {
    "id": "zero-length",
    "layers": ["code"],
    "kind": "edge-path",
    "edge": "bezier",
    "source": { "x": 4, "y": 4, "position": "right" },
    "target": { "x": 4, "y": 4, "position": "left" },
    "curvature": 0.25,
    "expect": { "labelX": 4, "labelY": 4, "offsetX": 0, "offsetY": 0 }
  },
  {
    "id": "two-boxes",
    "layers": ["code"],
    "kind": "bounds",
    "origin": [0, 0],
    "nodes": [
      { "id": "a", "x": 0, "y": 0, "width": 50, "height": 25 },
      { "id": "b", "x": 100, "y": 100, "width": 50, "height": 25 }
    ],
    "expect": { "x": 0, "y": 0, "width": 150, "height": 125 }
  },
  {
    "id": "center-origin",
    "layers": ["code"],
    "kind": "bounds",
    "origin": [0.5, 0.5],
    "nodes": [{ "id": "a", "x": 0, "y": 0, "width": 40, "height": 20 }],
    "expect": { "x": -20, "y": -10, "width": 40, "height": 20 }
  },
  {
    "id": "empty-bounds",
    "layers": ["code"],
    "kind": "bounds",
    "origin": [0, 0],
    "nodes": [],
    "expect": { "x": 0, "y": 0, "width": 0, "height": 0 }
  },
  {
    "id": "unresolved-id",
    "layers": ["code"],
    "kind": "bounds-optional",
    "origin": [0, 0],
    "missing": 1,
    "expect": { "x": 0, "y": 0, "width": 0, "height": 0 }
  },
  {
    "id": "padded-fit",
    "layers": ["code"],
    "kind": "viewport",
    "bounds": { "x": 0, "y": 0, "width": 200, "height": 200 },
    "width": 200,
    "height": 200,
    "minZoom": 0.5,
    "maxZoom": 2,
    "padding": 0.1,
    "expectZoomLessThan": 1
  },
  {
    "id": "zoom-clamp",
    "layers": ["code"],
    "kind": "viewport",
    "bounds": { "x": 0, "y": 0, "width": 10, "height": 10 },
    "width": 1000,
    "height": 1000,
    "minZoom": 0.5,
    "maxZoom": 2,
    "padding": 0.1,
    "expectZoom": 2
  },
  {
    "id": "empty-fit",
    "layers": ["code"],
    "kind": "viewport",
    "bounds": { "x": 0, "y": 0, "width": 0, "height": 0 },
    "width": 200,
    "height": 200,
    "minZoom": 0.5,
    "maxZoom": 2,
    "padding": 0.1,
    "expectFitted": false
  },
  {
    "id": "round-trip",
    "layers": ["code"],
    "kind": "coordinates",
    "viewport": { "x": 12, "y": -4, "zoom": 1.5 },
    "screen": { "x": 40, "y": 70 }
  },
  {
    "id": "partial-versus-full",
    "layers": ["code"],
    "kind": "visibility"
  },
  {
    "id": "hidden-node",
    "layers": ["code"],
    "kind": "visibility"
  },
  {
    "id": "dragging-outside",
    "layers": ["code"],
    "kind": "visibility"
  },
  {
    "id": "arrow-end",
    "layers": ["code"],
    "kind": "marker"
  },
  {
    "id": "custom-marker-color",
    "layers": ["code"],
    "kind": "marker"
  },
  {
    "id": "host-empty",
    "layers": ["host"],
    "kind": "host-empty"
  },
  {
    "id": "host-controlled-drag",
    "layers": ["host"],
    "kind": "host-controlled-drag",
    "nodes": [{ "id": "A", "position": { "x": 5, "y": 6 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "expect": { "left": 5 }
  },
  {
    "id": "host-controlled-pan",
    "layers": ["host"],
    "kind": "host-controlled-pan",
    "expect": { "viewportX": 0 }
  },
  {
    "id": "host-uncontrolled-drag",
    "layers": ["host"],
    "kind": "host-uncontrolled-drag",
    "nodes": [{ "id": "A", "position": { "x": 5, "y": 6 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "expect": { "left": 5 }
  },
  {
    "id": "host-fit-view",
    "layers": ["host"],
    "kind": "host-fit-view",
    "nodes": [{ "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "viewport": { "x": 12, "y": 12, "zoom": 0.5 },
    "expect": { "zoom": 0.5 }
  },
  {
    "id": "host-unknown-node",
    "layers": ["host"],
    "kind": "host-unknown-node",
    "nodes": [
      { "id": "A", "type": "missing", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 20, "y": 20 }, "data": { "label": "B" } }
    ],
    "expect": { "error": "003" }
  },
  {
    "id": "host-custom-node",
    "layers": ["host"],
    "kind": "host-custom-node",
    "nodes": [{ "id": "A", "type": "special", "position": { "x": 0, "y": 0 }, "data": { "label": "A" }, "selected": true }]
  },
  {
    "id": "host-invalid-connection",
    "layers": ["host"],
    "kind": "host-invalid-connection",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 200, "y": 0 }, "data": { "label": "B" } }
    ]
  },
  {
    "id": "host-valid-connection",
    "layers": ["host"],
    "kind": "host-valid-connection",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 200, "y": 0 }, "data": { "label": "B" } }
    ]
  },
  {
    "id": "host-dimensions",
    "layers": ["host"],
    "kind": "host-dimensions",
    "nodes": [{ "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } }],
    "expect": { "width": 100, "height": 40 }
  },
  {
    "id": "host-handle-path",
    "layers": ["host"],
    "kind": "host-handle-path",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 220, "y": 0 }, "data": { "label": "B" } }
    ],
    "edges": [{ "id": "e", "source": "A", "target": "B", "type": "straight" }],
    "expect": { "pathStart": "M100," }
  },
  {
    "id": "host-missing-provider",
    "layers": ["host"],
    "kind": "host-missing-provider"
  },
  {
    "id": "host-viewport-subscription",
    "layers": ["host"],
    "kind": "host-viewport-subscription",
    "nodes": [{ "id": "A", "position": { "x": 8, "y": 8 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  },
  {
    "id": "host-selection-subscription",
    "layers": ["host"],
    "kind": "host-selection-subscription",
    "nodes": [{ "id": "A", "position": { "x": 8, "y": 8 }, "data": { "label": "A" } }]
  },
  {
    "id": "host-node-state",
    "layers": ["host"],
    "kind": "host-node-state",
    "nodes": [{ "id": "A", "position": { "x": 1, "y": 2 }, "data": { "label": "A" } }]
  },
  {
    "id": "host-connection-subscription",
    "layers": ["host"],
    "kind": "host-connection-subscription",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 180, "y": 0 }, "data": { "label": "B" } }
    ]
  },
  {
    "id": "host-background-dots",
    "layers": ["host"],
    "kind": "host-background-dots",
    "background": "dots"
  },
  {
    "id": "host-lock",
    "layers": ["host"],
    "kind": "host-lock",
    "nodes": [{ "id": "A", "position": { "x": 12, "y": 14 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "expect": { "left": 12, "viewportX": 0 }
  },
  {
    "id": "host-minimap",
    "layers": ["host"],
    "kind": "host-minimap",
    "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" } }]
  },
  {
    "id": "host-zoom-control",
    "layers": ["host"],
    "kind": "host-zoom-control"
  },
  {
    "id": "host-imperative-fit",
    "layers": ["host"],
    "kind": "host-imperative-fit",
    "nodes": [{ "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "viewport": { "x": 0, "y": 0, "zoom": 0.5 }
  },
  {
    "id": "host-resizer",
    "layers": ["host"],
    "kind": "host-resizer",
    "nodes": [{ "id": "A", "position": { "x": 10, "y": 12 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  },
  {
    "id": "host-resizer-nw",
    "layers": ["host"],
    "kind": "host-resizer-nw",
    "nodes": [{ "id": "A", "position": { "x": 10, "y": 12 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  },
  {
    "id": "host-toolbar",
    "layers": ["host"],
    "kind": "host-toolbar",
    "nodes": [{ "id": "A", "position": { "x": 30, "y": 40 }, "data": { "label": "A" } }],
    "viewport": { "x": 0, "y": 0, "zoom": 2 },
    "expect": { "scale": "1" }
  },
  {
    "id": "host-delete",
    "layers": ["host"],
    "kind": "host-delete",
    "nodes": [
      { "id": "A", "position": { "x": 10, "y": 10 }, "data": { "label": "A" }, "selected": true },
      { "id": "B", "position": { "x": 200, "y": 10 }, "data": { "label": "B" } }
    ],
    "edges": [{ "id": "e", "source": "A", "target": "B" }]
  },
  {
    "id": "host-focus",
    "layers": ["host"],
    "kind": "host-focus",
    "nodes": [
      { "id": "A", "position": { "x": 10, "y": 10 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 200, "y": 10 }, "data": { "label": "B" } }
    ]
  },
  {
    "id": "host-color-mode",
    "layers": ["host"],
    "kind": "host-color-mode",
    "colorMode": "dark"
  },
  {
    "id": "host-attribution",
    "layers": ["host"],
    "kind": "host-attribution"
  },
  {
    "id": "host-visibility",
    "layers": ["host"],
    "kind": "host-visibility",
    "nodes": [
      { "id": "near", "position": { "x": 10, "y": 10 }, "data": { "label": "near" }, "width": 80, "height": 40 },
      { "id": "far", "position": { "x": 5000, "y": 5000 }, "data": { "label": "far" }, "width": 80, "height": 40 }
    ]
  },
  {
    "id": "host-unknown-edge",
    "layers": ["host"],
    "kind": "host-unknown-edge",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 180, "y": 0 }, "data": { "label": "B" } }
    ],
    "edges": [{ "id": "e", "source": "A", "target": "B", "type": "missing-edge" }],
    "expect": { "error": "004" }
  },
  {
    "id": "host-custom-edge",
    "layers": ["host"],
    "kind": "host-custom-edge",
    "nodes": [
      { "id": "A", "position": { "x": 0, "y": 0 }, "data": { "label": "A" } },
      { "id": "B", "position": { "x": 180, "y": 0 }, "data": { "label": "B" } }
    ],
    "edges": [{ "id": "e", "source": "A", "target": "B", "type": "special" }]
  },
  {
    "id": "browser-pan",
    "layers": ["browser"],
    "kind": "browser-pan",
    "gesture": "pan",
    "demo": "browser-pan",
    "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "from": { "x": 360, "y": 280 },
    "to": { "x": 420, "y": 300 },
    "expect": { "viewportXGreaterThan": 10 }
  },
  {
    "id": "browser-zoom",
    "layers": ["browser"],
    "kind": "browser-zoom",
    "gesture": "zoom",
    "demo": "browser-zoom",
    "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "expect": { "zoomGreaterThan": 1 }
  },
  {
    "id": "browser-node-drag",
    "layers": ["browser"],
    "kind": "browser-node-drag",
    "gesture": "node-drag",
    "demo": "browser-node-drag",
    "nodeId": "A",
    "nodes": [{ "id": "A", "position": { "x": 20, "y": 30 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "delta": { "x": 36, "y": 0 },
    "expect": { "left": 56 }
  },
  {
    "id": "browser-box-select",
    "layers": ["browser"],
    "kind": "browser-box-select",
    "gesture": "box-select",
    "demo": "browser-box-select",
    "selectionOnDrag": true,
    "nodes": [
      { "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40 },
      { "id": "B", "position": { "x": 500, "y": 40 }, "data": { "label": "B" }, "width": 80, "height": 40 }
    ],
    "from": { "x": 20, "y": 160 },
    "to": { "x": 220, "y": 20 }
  },
  {
    "id": "browser-connect",
    "layers": ["browser"],
    "kind": "browser-connect",
    "gesture": "connect",
    "demo": "browser-connect",
    "nodes": [
      { "id": "A", "position": { "x": 40, "y": 80 }, "data": { "label": "A" }, "width": 80, "height": 40 },
      { "id": "B", "position": { "x": 280, "y": 80 }, "data": { "label": "B" }, "width": 80, "height": 40 }
    ]
  },
  {
    "id": "browser-delete",
    "layers": ["browser"],
    "kind": "browser-delete",
    "gesture": "delete",
    "demo": "browser-delete",
    "nodes": [
      { "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40, "selected": true },
      { "id": "B", "position": { "x": 240, "y": 40 }, "data": { "label": "B" }, "width": 80, "height": 40 }
    ],
    "edges": [{ "id": "e", "source": "A", "target": "B", "type": "straight" }]
  },
  {
    "id": "browser-controls",
    "layers": ["browser"],
    "kind": "browser-controls",
    "gesture": "controls",
    "demo": "browser-controls",
    "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40 }],
    "expect": { "zoomGreaterThan": 1 }
  },
  {
    "id": "browser-minimap",
    "layers": ["browser"],
    "kind": "browser-minimap",
    "gesture": "minimap",
    "demo": "browser-minimap",
    "nodes": [{ "id": "A", "position": { "x": 80, "y": 60 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  },
  {
    "id": "browser-background",
    "layers": ["browser"],
    "kind": "browser-background",
    "gesture": "background",
    "demo": "browser-background",
    "background": "dots",
    "nodes": [{ "id": "A", "position": { "x": 40, "y": 40 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  },
  {
    "id": "browser-parent-move",
    "layers": ["browser"],
    "kind": "browser-parent-move",
    "gesture": "parent-move",
    "demo": "browser-parent-move",
    "nodeId": "P",
    "nodes": [
      { "id": "P", "position": { "x": 100, "y": 80 }, "data": { "label": "P" }, "width": 220, "height": 140 },
      { "id": "C", "parentId": "P", "position": { "x": 24, "y": 28 }, "data": { "label": "C" }, "width": 80, "height": 40 }
    ],
    "delta": { "x": 40, "y": 0 },
    "expect": { "left": 164 }
  },
  {
    "id": "browser-resizer",
    "layers": ["browser"],
    "kind": "browser-resizer",
    "gesture": "resize",
    "demo": "browser-resizer",
    "nodeId": "A",
    "nodes": [{ "id": "A", "position": { "x": 48, "y": 48 }, "data": { "label": "A" }, "width": 80, "height": 40 }]
  }
]
