@weasel-js/diagram 1.15.1 → 1.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1693,8 +1693,6 @@ function diagramEdgeOf(node) {
1693
1693
  if (edge === null || typeof edge !== "object") return null;
1694
1694
  return "from" in edge && "to" in edge ? edge : null;
1695
1695
  }
1696
-
1697
- // src/avoid/holds.ts
1698
1696
  var EPS2 = 1e-6;
1699
1697
  function runsAlong(d, normal, sign) {
1700
1698
  const len = Math.hypot(d.x, d.y) * Math.hypot(normal.x, normal.y);
@@ -1703,11 +1701,8 @@ function runsAlong(d, normal, sign) {
1703
1701
  return Math.abs(cross) <= EPS2 * len && sign * (d.x * normal.x + d.y * normal.y) > 0;
1704
1702
  }
1705
1703
  function onSegment(p, a, b) {
1706
- const dx = b.x - a.x;
1707
- const dy = b.y - a.y;
1708
- const len2 = dx * dx + dy * dy;
1709
- const t = len2 === 0 ? 0 : Math.max(0, Math.min(1, ((p.x - a.x) * dx + (p.y - a.y) * dy) / len2));
1710
- return Math.hypot(a.x + t * dx - p.x, a.y + t * dy - p.y) <= EPS2 * Math.max(1, Math.sqrt(len2)) ? t : null;
1704
+ const { t, dist } = nearestOnLine(p.x, p.y, a.x, a.y, b.x, b.y);
1705
+ return dist <= EPS2 * Math.max(1, Math.hypot(b.x - a.x, b.y - a.y)) ? t : null;
1711
1706
  }
1712
1707
  function routeHolds(from, to, waypoints, route) {
1713
1708
  const points = [from.point, ...route, to.point];
@@ -4172,5 +4167,5 @@ function sideColumns(branches, children, from, rankGap, sign) {
4172
4167
  }
4173
4168
 
4174
4169
  export { COMPASS, DEFAULT_GROUP_INSET, DEFAULT_NODE_GAP, DEFAULT_PORTS, DEFAULT_RANK_GAP, DEVICE_SIZE, DIAGRAM_TRAIT_KEY, DIVIDER_HEIGHT, EVENT_SIZE, GATEWAY_SIZE, PORT_LABEL_GAP, SIDE_TRACK_GAP, anchorOffset, authoredOver, axesFor, backEdges, bodyOutline, bodyTrait, boxForContent, buildBody, canvasMeasure, center, chain, contentBox, createDiagramNodes, dataKeyReader, diagramEdgeOf, diagramNodeOf, expandGroupEdges, extent, footprintNode, force, forceRelaxation, forestOf, graphOrder, grid, grownBy, insetOf, isPinned, isPromise, labelCenter, labelSpotAt, layered, layeredPlan, layeredRoutes, layoutBody, layoutOwnsPort, layoutOwnsRoute, layoutRowPorts, layoutWritesRoute, marginOf, measureBody, outlineDetail, outlineFromD, outlinePath, outlinePolyline, outlineSolid, packAcross, packClusters, pinnedSet, planOf, plannerPlan, portLabelBox, portLabelsOf, portOf, portSitesOf, portsOf, portsOnOutline, radial, rankGaps, ranksByLength, ranksOf, rayHit, registerOutline, resolveOutline, routeHolds, rowHeights, samePoints, seededOrder, settle, sizeToBody, subpathOf, subtreeBlocks, translated, tree, untilSettled, widenForMinWidth };
4175
- //# sourceMappingURL=chunk-UOFQBGJY.js.map
4176
- //# sourceMappingURL=chunk-UOFQBGJY.js.map
4170
+ //# sourceMappingURL=chunk-7BV2MBED.js.map
4171
+ //# sourceMappingURL=chunk-7BV2MBED.js.map