stickyflow 0.2.0 → 0.4.0

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-KFJIFHXG.js → chunk-65IVT4GK.js} +475 -199
  4. package/dist/chunk-65IVT4GK.js.map +1 -0
  5. package/dist/{chunk-6JKNT2YC.js → chunk-BYMIYXP5.js} +17 -7
  6. package/dist/chunk-BYMIYXP5.js.map +1 -0
  7. package/dist/{chunk-N6WVHOUQ.js → chunk-CSXQD3ON.js} +28 -15
  8. package/dist/chunk-CSXQD3ON.js.map +1 -0
  9. package/dist/{chunk-YM3XFBI4.cjs → chunk-CXL254BT.cjs} +17 -6
  10. package/dist/chunk-CXL254BT.cjs.map +1 -0
  11. package/dist/{chunk-S5BVAAEF.cjs → chunk-DDCTNLLD.cjs} +989 -713
  12. package/dist/chunk-DDCTNLLD.cjs.map +1 -0
  13. package/dist/{chunk-34PK7HEU.cjs → chunk-HFOGKSNU.cjs} +18 -18
  14. package/dist/{chunk-34PK7HEU.cjs.map → chunk-HFOGKSNU.cjs.map} +1 -1
  15. package/dist/{chunk-IIOJFR73.cjs → chunk-UXDWH2JC.cjs} +56 -43
  16. package/dist/chunk-UXDWH2JC.cjs.map +1 -0
  17. package/dist/{chunk-6LQJUAD4.js → chunk-XEN5QIIJ.js} +6 -6
  18. package/dist/{chunk-6LQJUAD4.js.map → chunk-XEN5QIIJ.js.map} +1 -1
  19. package/dist/index.cjs +24 -24
  20. package/dist/index.d.cts +4 -4
  21. package/dist/index.d.ts +4 -4
  22. package/dist/index.js +4 -4
  23. package/dist/interaction/index.cjs +780 -382
  24. package/dist/interaction/index.cjs.map +1 -1
  25. package/dist/interaction/index.d.cts +12 -3
  26. package/dist/interaction/index.d.ts +12 -3
  27. package/dist/interaction/index.js +562 -165
  28. package/dist/interaction/index.js.map +1 -1
  29. package/dist/{render-r1GYvjNm.d.cts → render-C5X74hds.d.cts} +75 -4
  30. package/dist/{render-r1GYvjNm.d.ts → render-C5X74hds.d.ts} +75 -4
  31. package/dist/{runtimeTypes-ByiafBwg.d.ts → runtimeTypes-D8hPZ62T.d.ts} +1 -1
  32. package/dist/{runtimeTypes-DwLeD-em.d.cts → runtimeTypes-yTSAvtCn.d.cts} +1 -1
  33. package/dist/stickyflow-diagram.global.js +37 -35
  34. package/dist/stickyflow-diagram.global.js.map +1 -1
  35. package/dist/{types-T7W2yTQF.d.cts → types-BDKDf4zr.d.cts} +1 -1
  36. package/dist/{types-ndGA1kbl.d.ts → types-CdgGdtoD.d.ts} +1 -1
  37. package/dist/viewer/index.cjs +9 -9
  38. package/dist/viewer/index.d.cts +4 -4
  39. package/dist/viewer/index.d.ts +4 -4
  40. package/dist/viewer/index.js +4 -4
  41. package/dist/web-component/index.cjs +6 -6
  42. package/dist/web-component/index.d.cts +2 -2
  43. package/dist/web-component/index.d.ts +2 -2
  44. package/dist/web-component/index.js +4 -4
  45. package/package.json +1 -1
  46. package/dist/chunk-6JKNT2YC.js.map +0 -1
  47. package/dist/chunk-IIOJFR73.cjs.map +0 -1
  48. package/dist/chunk-KFJIFHXG.js.map +0 -1
  49. package/dist/chunk-N6WVHOUQ.js.map +0 -1
  50. package/dist/chunk-S5BVAAEF.cjs.map +0 -1
  51. package/dist/chunk-YM3XFBI4.cjs.map +0 -1
@@ -2815,12 +2815,12 @@ function radarValueAtPoint(frame, index, px, py) {
2815
2815
  const ratio = frame.radius === 0 ? 0 : Math.max(0, Math.min(1, projected / frame.radius));
2816
2816
  return frame.min + ratio * (frame.max - frame.min);
2817
2817
  }
2818
- function radarSeriesPath(points, curved) {
2818
+ function radarSeriesPath(points, curved, tension = CURVED_TENSION) {
2819
2819
  if (points.length === 0) {
2820
2820
  return "";
2821
2821
  }
2822
2822
  if (curved) {
2823
- return freeformPathData({ points, tension: CURVED_TENSION, closed: true });
2823
+ return freeformPathData({ points, tension, closed: true });
2824
2824
  }
2825
2825
  const commands = points.map((point, index) => `${index ? "L " : ""}${point.x} ${point.y}`);
2826
2826
  return `M ${commands.join(" ")} Z`;
@@ -3036,6 +3036,16 @@ function wrapText(text, width, fontSize, metrics) {
3036
3036
  }
3037
3037
  return result;
3038
3038
  }
3039
+ function ellipsizeToWidth(text, width, fontSize, bold) {
3040
+ if (estimateTextWidth(text, fontSize, bold) <= width) {
3041
+ return text;
3042
+ }
3043
+ let end = text.length;
3044
+ while (end > 1 && estimateTextWidth(`${text.slice(0, end)}\u2026`, fontSize, bold) > width) {
3045
+ end -= 1;
3046
+ }
3047
+ return `${text.slice(0, end)}\u2026`;
3048
+ }
3039
3049
  function estimateTextWidth(text, fontSize, bold) {
3040
3050
  return text.length * fontSize * (bold ? BOLD_CHAR_FACTOR : PLAIN_CHAR_FACTOR);
3041
3051
  }
@@ -3611,7 +3621,7 @@ function pieFillet(geometry, circleRadius, filletCenterRadius, edgeAngle, corner
3611
3621
  function maxPieCornerRadius(outerRadius, innerRadius, sweep) {
3612
3622
  const halfSweep = Math.min(Math.abs(sweep) / 2, Math.PI / 2);
3613
3623
  const angleFactor = Math.sin(halfSweep * CORNER_ANGLE_HEADROOM);
3614
- const outerLimit = outerRadius * angleFactor;
3624
+ const outerLimit = outerRadius * angleFactor / (1 + angleFactor);
3615
3625
  const innerLimit = innerRadius > 0 ? innerRadius * angleFactor : Number.POSITIVE_INFINITY;
3616
3626
  const ringLimit = innerRadius > 0 ? (outerRadius - innerRadius) / 2 : outerRadius / 2;
3617
3627
  return Math.max(0, Math.min(outerLimit, innerLimit, ringLimit));
@@ -3619,7 +3629,7 @@ function maxPieCornerRadius(outerRadius, innerRadius, sweep) {
3619
3629
  function maxApexCornerRadius(outerRadius, apexRadius, sweep) {
3620
3630
  const halfSweep = Math.min(Math.abs(sweep) / 2, Math.PI / 2);
3621
3631
  const angleFactor = Math.sin(halfSweep * CORNER_ANGLE_HEADROOM);
3622
- const outerLimit = outerRadius * angleFactor;
3632
+ const outerLimit = outerRadius * angleFactor / (1 + angleFactor);
3623
3633
  const depthLimit = (outerRadius * outerRadius - apexRadius * apexRadius) / (2 * outerRadius);
3624
3634
  return Math.max(0, Math.min(outerLimit, depthLimit));
3625
3635
  }
@@ -4734,6 +4744,7 @@ exports.createVerticalErrorWhiskerNode = createVerticalErrorWhiskerNode;
4734
4744
  exports.deriveFaceFills = deriveFaceFills;
4735
4745
  exports.edgePointToward = edgePointToward;
4736
4746
  exports.elementCenter = elementCenter;
4747
+ exports.ellipsizeToWidth = ellipsizeToWidth;
4737
4748
  exports.errorBarRange = errorBarRange;
4738
4749
  exports.estimateTextWidth = estimateTextWidth;
4739
4750
  exports.finite = finite;
@@ -4810,5 +4821,5 @@ exports.tokenizeSource = tokenizeSource;
4810
4821
  exports.topRoundedRectPath = topRoundedRectPath;
4811
4822
  exports.wrapText = wrapText;
4812
4823
  exports.zoneColorAtValue = zoneColorAtValue;
4813
- //# sourceMappingURL=chunk-YM3XFBI4.cjs.map
4814
- //# sourceMappingURL=chunk-YM3XFBI4.cjs.map
4824
+ //# sourceMappingURL=chunk-CXL254BT.cjs.map
4825
+ //# sourceMappingURL=chunk-CXL254BT.cjs.map