Closed dimensi closed 5 years ago
Resolve it with custom createEdgePath function.
render.createEdgePaths(createEdgePaths);
function createEdgePaths(selection, g) {
....
calcPoints(g, e)
...
}
function calcPoints(g, e) {
const tail = g.node(e.v);
const head = g.node(e.w);
const startPoint = { x: tail.x + (tail.width / 2), y: tail.y }
const endPoint = { x: head.x - (head.width / 2), y: head.y }
return diagonal(startPoint, endPoint)
}
function diagonal(start, end) {
return `M ${start.x} ${start.y}
C ${(start.x + end.x) / 2} ${start.y},
${(start.x + end.x) / 2} ${end.y},
${end.x} ${end.y}`
}
https://github.com/dagrejs/dagre-d3/blob/master/lib/create-edge-paths.js#L68-L77
Hi, how to make the edges come out of one point? Like this?