I am trying to implement Concept Map Network Graph using d3.js
. The sample of the graph is available here in the js-fiddle.
js-fiddle
The node direction is pointing from the left direction only. All the nodes in a right side having the lines from the back of rectangle. I want to display all the nodes point in left as well as from right side.
Expected Graph:
I found the solution by checking curve position by using this code.
if(af.x>180)
{
af.xOffset = -S;
}else
{
af.xOffset = S;
}
and by checking the condition for push function
if (ab.x > 180) {
H.push({
source: ae,
target: ab,
key: aa,
canonicalKey: aa,
x1: ae.x + (ab.type === "theme" ? 0 : U),
y1: ae.y + K / 2,
x2: Math.cos(Y) * X + ab.xOffset,
y2: Math.sin(Y) * X
})
}
else if (ae.x < 180) {
H.push({
source: ae,
target: ab,
key: aa,
canonicalKey: aa,
x1: ae.x + (ab.type === "theme" ? U : 0),
y1: ae.y + K / 2,
x2: Math.cos(Y) * X + ab.xOffset,
y2: Math.sin(Y) * X
})
}
Expected Output was
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With