diff --git a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/diagram/ElkDiagramRenderer.java b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/diagram/ElkDiagramRenderer.java index 56d38c4e..4ad8fbdc 100644 --- a/cameleer3-server-app/src/main/java/com/cameleer3/server/app/diagram/ElkDiagramRenderer.java +++ b/cameleer3-server-app/src/main/java/com/cameleer3/server/app/diagram/ElkDiagramRenderer.java @@ -292,11 +292,11 @@ public class ElkDiagramRenderer implements DiagramRenderer { root.setProperty(CoreOptions.HIERARCHY_HANDLING, HierarchyHandling.INCLUDE_CHILDREN); root.setProperty(CoreOptions.EDGE_ROUTING, EdgeRouting.POLYLINE); root.setProperty(org.eclipse.elk.alg.layered.options.LayeredOptions.NODE_PLACEMENT_STRATEGY, - NodePlacementStrategy.LINEAR_SEGMENTS); + NodePlacementStrategy.NETWORK_SIMPLEX); return root; } - /** Create ELK edges, skipping DO_TRY-to-descendant and cross-root edges. */ + /** Create ELK edges, skipping structural compound-to-child edges and cross-root edges. */ private void createElkEdges(RouteGraph graph, LayoutContext ctx) { if (graph.getEdges() == null) return; for (RouteEdge re : graph.getEdges()) { @@ -304,8 +304,9 @@ public class ElkDiagramRenderer implements DiagramRenderer { ElkNode targetElk = ctx.elkNodeMap.get(re.getTarget()); if (sourceElk == null || targetElk == null) continue; - // Skip edges from DO_TRY to its own children (keep continuation edges) - if (ctx.doTryNodeIds.contains(re.getSource()) && isDescendantOf(targetElk, sourceElk)) { + // Skip edges from any compound node to its own descendants + // (these are structural edges, not flow edges) + if (ctx.compoundNodeIds.contains(re.getSource()) && isDescendantOf(targetElk, sourceElk)) { continue; } // Skip edges that cross ELK root boundaries @@ -334,7 +335,7 @@ public class ElkDiagramRenderer implements DiagramRenderer { if (sections.size() < 2) continue; double startY = sections.stream().mapToDouble(ElkNode::getY).min().orElse(0); - double spacing = NODE_SPACING * 0.4; + double spacing = 20; double currentY = startY; for (ElkNode section : sections) { section.setY(currentY);