@dcg-overseas/number-line 0.1.1 → 0.1.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.
package/dist/index.cjs CHANGED
@@ -465,8 +465,9 @@ const GroupArcsLayer = React.memo(function GroupArcsLayer2({
465
465
  const rx = (x2 - x1) / 2;
466
466
  const ry = Math.min(rx * 0.7, arcMaxHeight);
467
467
  const color = arcColors[g % arcColors.length];
468
- const midX = (x1 + x2) / 2;
469
- const labelY = axisY - ry - 6;
468
+ const textY = axisY - ry - 6;
469
+ const arrowHeadH = 7;
470
+ const arrowHeadHW = 4;
470
471
  const arcPath = buildArcPath({ x1, x2, y: axisY, rx, ry });
471
472
  const isSelected = selectedArcIndices.has(g);
472
473
  const hitCursor = tool === "eraser" ? "cell" : tool === "none" ? "pointer" : "default";
@@ -514,8 +515,8 @@ const GroupArcsLayer = React.memo(function GroupArcsLayer2({
514
515
  /* @__PURE__ */ jsxRuntime.jsx(
515
516
  "text",
516
517
  {
517
- x: midX,
518
- y: labelY,
518
+ x: x2,
519
+ y: textY,
519
520
  textAnchor: "middle",
520
521
  fontSize: 10,
521
522
  fill: isSelected ? "#1d4ed8" : color,
@@ -524,6 +525,26 @@ const GroupArcsLayer = React.memo(function GroupArcsLayer2({
524
525
  style: { userSelect: "none", WebkitUserSelect: "none" },
525
526
  children: end
526
527
  }
528
+ ),
529
+ /* @__PURE__ */ jsxRuntime.jsx(
530
+ "line",
531
+ {
532
+ x1: x2,
533
+ y1: textY + 4,
534
+ x2,
535
+ y2: axisY - arrowHeadH,
536
+ stroke: isSelected ? "#1d4ed8" : color,
537
+ strokeWidth: 1.5,
538
+ pointerEvents: "none"
539
+ }
540
+ ),
541
+ /* @__PURE__ */ jsxRuntime.jsx(
542
+ "polygon",
543
+ {
544
+ points: `${x2},${axisY} ${x2 - arrowHeadHW},${axisY - arrowHeadH} ${x2 + arrowHeadHW},${axisY - arrowHeadH}`,
545
+ fill: isSelected ? "#1d4ed8" : color,
546
+ pointerEvents: "none"
547
+ }
527
548
  )
528
549
  ] }, g)
529
550
  );
package/dist/index.js CHANGED
@@ -463,8 +463,9 @@ const GroupArcsLayer = memo(function GroupArcsLayer2({
463
463
  const rx = (x2 - x1) / 2;
464
464
  const ry = Math.min(rx * 0.7, arcMaxHeight);
465
465
  const color = arcColors[g % arcColors.length];
466
- const midX = (x1 + x2) / 2;
467
- const labelY = axisY - ry - 6;
466
+ const textY = axisY - ry - 6;
467
+ const arrowHeadH = 7;
468
+ const arrowHeadHW = 4;
468
469
  const arcPath = buildArcPath({ x1, x2, y: axisY, rx, ry });
469
470
  const isSelected = selectedArcIndices.has(g);
470
471
  const hitCursor = tool === "eraser" ? "cell" : tool === "none" ? "pointer" : "default";
@@ -512,8 +513,8 @@ const GroupArcsLayer = memo(function GroupArcsLayer2({
512
513
  /* @__PURE__ */ jsx(
513
514
  "text",
514
515
  {
515
- x: midX,
516
- y: labelY,
516
+ x: x2,
517
+ y: textY,
517
518
  textAnchor: "middle",
518
519
  fontSize: 10,
519
520
  fill: isSelected ? "#1d4ed8" : color,
@@ -522,6 +523,26 @@ const GroupArcsLayer = memo(function GroupArcsLayer2({
522
523
  style: { userSelect: "none", WebkitUserSelect: "none" },
523
524
  children: end
524
525
  }
526
+ ),
527
+ /* @__PURE__ */ jsx(
528
+ "line",
529
+ {
530
+ x1: x2,
531
+ y1: textY + 4,
532
+ x2,
533
+ y2: axisY - arrowHeadH,
534
+ stroke: isSelected ? "#1d4ed8" : color,
535
+ strokeWidth: 1.5,
536
+ pointerEvents: "none"
537
+ }
538
+ ),
539
+ /* @__PURE__ */ jsx(
540
+ "polygon",
541
+ {
542
+ points: `${x2},${axisY} ${x2 - arrowHeadHW},${axisY - arrowHeadH} ${x2 + arrowHeadHW},${axisY - arrowHeadH}`,
543
+ fill: isSelected ? "#1d4ed8" : color,
544
+ pointerEvents: "none"
545
+ }
525
546
  )
526
547
  ] }, g)
527
548
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcg-overseas/number-line",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Interactive number line component with group arcs and freehand drawing",
5
5
  "type": "module",
6
6
  "license": "MIT",