fix: straight edge routing and handler section edge extraction
Backend: - Set POLYLINE edge routing on ELK root — eliminates curved/bent edges between horizontally aligned nodes - Collect edges from handler section roots (not just main root) so internal handler edges are included in the layout output - Use correct root reference for coordinate calculation per edge Frontend: - Render ALL edge points as line segments (polylines), not cubic bezier. ELK bend points are waypoints, not bezier control points — the cubic bezier interpretation caused false curves. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,19 +11,11 @@ export function DiagramEdge({ edge, offsetY = 0, traversed }: DiagramEdgeProps)
|
||||
const pts = edge.points;
|
||||
if (!pts || pts.length < 2) return null;
|
||||
|
||||
// Build SVG path: move to first point, then cubic bezier or line to rest
|
||||
// Build SVG path: move to first point, then line segments through all waypoints.
|
||||
// ELK bend points are waypoints, not bezier control points.
|
||||
let d = `M ${pts[0][0]} ${pts[0][1] + offsetY}`;
|
||||
|
||||
if (pts.length === 2) {
|
||||
d += ` L ${pts[1][0]} ${pts[1][1] + offsetY}`;
|
||||
} else if (pts.length === 4) {
|
||||
// 4 points: start, control1, control2, end → cubic bezier
|
||||
d += ` C ${pts[1][0]} ${pts[1][1] + offsetY}, ${pts[2][0]} ${pts[2][1] + offsetY}, ${pts[3][0]} ${pts[3][1] + offsetY}`;
|
||||
} else {
|
||||
// Multiple points: connect with line segments through intermediate points
|
||||
for (let i = 1; i < pts.length; i++) {
|
||||
d += ` L ${pts[i][0]} ${pts[i][1] + offsetY}`;
|
||||
}
|
||||
for (let i = 1; i < pts.length; i++) {
|
||||
d += ` L ${pts[i][0]} ${pts[i][1] + offsetY}`;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user