u
This commit is contained in:
@@ -488,6 +488,13 @@ function assignEdgeAnchors(edges, positions) {
|
||||
});
|
||||
|
||||
group.forEach((edge, i) => {
|
||||
// Self-loops: leave via top diagonals so the arc sits above the table
|
||||
// instead of curling SE into neighboring edges.
|
||||
if (edge.from === edge.to) {
|
||||
tailCompass.set(edgeKey(edge), i % 2 === 0 ? 'ne' : 'nw');
|
||||
return;
|
||||
}
|
||||
|
||||
const fromX = positions?.get(edge.from)?.x ?? 0;
|
||||
const toX = positions?.get(edge.to)?.x ?? fromX;
|
||||
const fromY = positions?.get(edge.from)?.y ?? 0;
|
||||
@@ -641,6 +648,16 @@ function buildDot(tables, edges, positions = null) {
|
||||
attrs.push('style=dashed', 'label="inferred"');
|
||||
}
|
||||
|
||||
// Self-FK: leave the FK column, enter the PK — loop on the east side
|
||||
// of those rows (e→e). Node-level ne→nw looked above the table but
|
||||
// detached from the actual columns; column→header with :ne still dipped SE.
|
||||
if (edge.from === edge.to) {
|
||||
lines.push(
|
||||
` ${edge.from}:${sourcePort}:e -> ${edge.to}:id:e [${attrs.join(', ')}];`
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
lines.push(
|
||||
` ${edge.from}:${sourcePort}:${tail} -> ${edge.to}:${targetPort}:n [${attrs.join(', ')}];`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user