Ответ 1
Я нашел решение, проверив положение кривой с помощью этого кода.
if(af.x>180)
{
af.xOffset = -S;
}else
{
af.xOffset = S;
}
и проверив условие для функции push
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
})
}
Ожидаемый результат был