Loosen dataflow graph layout

This commit is contained in:
Meta Vens 2026-04-29 22:00:10 +01:00
commit c42ab624c2
3 changed files with 17 additions and 6 deletions

View file

@ -58,7 +58,7 @@ export function Screen() {
- the viewer lays out each graph with `elkjs` on the client
- `architecture` defaults to layered layout
- `dataflow` defaults to stress layout
- `dataflow` defaults to a rightward layered layout with wider stage spacing
- links are exposed in the detail pane and through node badges
- zoom gates title, purpose, and metadata visibility

View file

@ -389,10 +389,16 @@ export function EpiphanyGraphViewer({
strokeLinejoin="round"
vectorEffect="non-scaling-stroke"
/>
{activeTransform.scale > 1.25 && edge.label?.trim() && (
{(isSelected || isConnected || activeTransform.scale > 1.75) &&
edge.label?.trim() && (
<g
transform={`translate(${edge.midpoint.x} ${edge.midpoint.y})`}
pointerEvents="none"
opacity={
isSelected || isConnected
? 1
: fadeBetween(activeTransform.scale, 1.75, 2.05)
}
>
<rect
x={-44}

View file

@ -76,7 +76,7 @@ async function layoutGraph(
id: graphKey,
layoutOptions: {
"elk.algorithm":
graphKey === "architecture" ? "org.eclipse.elk.layered" : "org.eclipse.elk.stress",
"org.eclipse.elk.layered",
...(graphKey === "architecture"
? {
"elk.direction": "DOWN",
@ -87,10 +87,15 @@ async function layoutGraph(
"elk.padding": "[top=40,left=40,bottom=40,right=40]",
}
: {
"elk.spacing.nodeNode": "80",
"elk.direction": "RIGHT",
"elk.edgeRouting": "SPLINES",
"elk.padding": "[top=60,left=60,bottom=60,right=60]",
"elk.stress.desiredEdgeLength": "128",
"elk.spacing.nodeNode": "88",
"elk.layered.spacing.nodeNodeBetweenLayers": "176",
"elk.layered.nodePlacement.strategy": "NETWORK_SIMPLEX",
"elk.layered.crossingMinimization.strategy": "LAYER_SWEEP",
"elk.layered.considerModelOrder.strategy": "NODES_AND_EDGES",
"elk.layered.unnecessaryBendpoints": "true",
"elk.padding": "[top=72,left=84,bottom=72,right=96]",
}),
},
children: nodes,