export function getEdgeHandleRotation()

in src/helpers/edge-helpers.js [269:289]


export function getEdgeHandleRotation(
  negate: any = false,
  sourceNode: ITargetPosition | null,
  targetNode: ITargetPosition
): [string, boolean] {
  let rotated = false;
  const src = sourceNode;
  const trg = targetNode;
  let theta = (getTheta(src, trg) * 180) / Math.PI;

  if (negate) {
    theta = -theta;
  }

  if (theta > 90 || theta < -90) {
    theta = theta + 180;
    rotated = true;
  }

  return [`rotate(${theta})`, rotated];
}