import {
select,
json,
zoom,
drag,
event,
tree,
hierarchy,
} from 'd3';
function makeLink(start, end, radius) {
const path = d3.path();
const dh = (4 / 3) * Math.tan(Math.PI / 8); // tangent handle offset
//flip curve
let fx, fy;
if (end[0] - start[0] == 0) {
fx = 0;
} else if (end[0] - start[0] > 0) {
fx = 1;
} else {
fx = -1;
}
if (end[1] - start[1] == 0) {
fy = 0;
} else if (end[1] - start[1] > 0) {
fy = 1;
} else {
fy = -1;
}
//scale curve when dx or dy is less than the radius
if (radius == 0) {
fx = 0;
fy = 0;
} else {