@dcg-overseas/number-line 0.1.14 → 0.1.15
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 +10 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.js +10 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -561,7 +561,8 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
561
561
|
tickStep,
|
|
562
562
|
showGroupTicks,
|
|
563
563
|
showMajorTicks,
|
|
564
|
-
showMinorTicks
|
|
564
|
+
showMinorTicks,
|
|
565
|
+
showLabelStep
|
|
565
566
|
}) {
|
|
566
567
|
const range = viewMax - viewMin;
|
|
567
568
|
if (range <= 0) return null;
|
|
@@ -621,7 +622,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
621
622
|
strokeWidth: strokeW
|
|
622
623
|
}
|
|
623
624
|
),
|
|
624
|
-
showLabel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
625
|
+
(showLabel || showLabelStep) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
625
626
|
"text",
|
|
626
627
|
{
|
|
627
628
|
x,
|
|
@@ -630,6 +631,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
630
631
|
fontSize: 20,
|
|
631
632
|
fill: "#472E17",
|
|
632
633
|
pointerEvents: "none",
|
|
634
|
+
"data-type": "2",
|
|
633
635
|
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
634
636
|
children: v
|
|
635
637
|
}
|
|
@@ -787,7 +789,7 @@ function AnimatedArc({
|
|
|
787
789
|
x1: x2,
|
|
788
790
|
y1: textY + 5,
|
|
789
791
|
x2,
|
|
790
|
-
y2: axisY - arrowHeadH,
|
|
792
|
+
y2: axisY - arrowHeadH - 10,
|
|
791
793
|
stroke: strokeColor,
|
|
792
794
|
strokeWidth: 1.5,
|
|
793
795
|
pointerEvents: "none"
|
|
@@ -796,7 +798,7 @@ function AnimatedArc({
|
|
|
796
798
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
797
799
|
"polygon",
|
|
798
800
|
{
|
|
799
|
-
points: `${x2},${axisY -
|
|
801
|
+
points: `${x2},${axisY - 16} ${x2 - arrowHeadHW},${axisY - arrowHeadH - 16} ${x2 + arrowHeadHW},${axisY - arrowHeadH - 16}`,
|
|
800
802
|
fill: strokeColor,
|
|
801
803
|
pointerEvents: "none"
|
|
802
804
|
}
|
|
@@ -839,7 +841,7 @@ const GroupArcsLayer = React.memo(function GroupArcsLayer2({
|
|
|
839
841
|
const ry = Math.min(rx * ARC_RY_RATIO, arcMaxHeight);
|
|
840
842
|
const color = arcColors[g % arcColors.length];
|
|
841
843
|
const MIN_ARROW_SPAN = 24;
|
|
842
|
-
const textY = Math.min(axisY - ry -
|
|
844
|
+
const textY = Math.min(axisY - ry - 26, axisY - MIN_ARROW_SPAN);
|
|
843
845
|
const arcPath = buildArcPath({ x1, x2, y: axisY, rx, ry });
|
|
844
846
|
const isSelected = selectedArcIndices.has(g);
|
|
845
847
|
const hitCursor = tool === "eraser" ? "cell" : tool === "none" ? "pointer" : "default";
|
|
@@ -957,6 +959,7 @@ function NumberLine({ className }) {
|
|
|
957
959
|
showGroupTicks,
|
|
958
960
|
showMajorTicks,
|
|
959
961
|
showMinorTicks,
|
|
962
|
+
showLabelStep,
|
|
960
963
|
viewMin,
|
|
961
964
|
viewMax,
|
|
962
965
|
enableZoom,
|
|
@@ -1166,7 +1169,8 @@ function NumberLine({ className }) {
|
|
|
1166
1169
|
tickStep,
|
|
1167
1170
|
showGroupTicks,
|
|
1168
1171
|
showMajorTicks,
|
|
1169
|
-
showMinorTicks
|
|
1172
|
+
showMinorTicks,
|
|
1173
|
+
showLabelStep
|
|
1170
1174
|
}
|
|
1171
1175
|
),
|
|
1172
1176
|
/* @__PURE__ */ jsxRuntime.jsx(
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -559,7 +559,8 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
559
559
|
tickStep,
|
|
560
560
|
showGroupTicks,
|
|
561
561
|
showMajorTicks,
|
|
562
|
-
showMinorTicks
|
|
562
|
+
showMinorTicks,
|
|
563
|
+
showLabelStep
|
|
563
564
|
}) {
|
|
564
565
|
const range = viewMax - viewMin;
|
|
565
566
|
if (range <= 0) return null;
|
|
@@ -619,7 +620,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
619
620
|
strokeWidth: strokeW
|
|
620
621
|
}
|
|
621
622
|
),
|
|
622
|
-
showLabel && /* @__PURE__ */ jsx(
|
|
623
|
+
(showLabel || showLabelStep) && /* @__PURE__ */ jsx(
|
|
623
624
|
"text",
|
|
624
625
|
{
|
|
625
626
|
x,
|
|
@@ -628,6 +629,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
628
629
|
fontSize: 20,
|
|
629
630
|
fill: "#472E17",
|
|
630
631
|
pointerEvents: "none",
|
|
632
|
+
"data-type": "2",
|
|
631
633
|
style: { userSelect: "none", WebkitUserSelect: "none" },
|
|
632
634
|
children: v
|
|
633
635
|
}
|
|
@@ -785,7 +787,7 @@ function AnimatedArc({
|
|
|
785
787
|
x1: x2,
|
|
786
788
|
y1: textY + 5,
|
|
787
789
|
x2,
|
|
788
|
-
y2: axisY - arrowHeadH,
|
|
790
|
+
y2: axisY - arrowHeadH - 10,
|
|
789
791
|
stroke: strokeColor,
|
|
790
792
|
strokeWidth: 1.5,
|
|
791
793
|
pointerEvents: "none"
|
|
@@ -794,7 +796,7 @@ function AnimatedArc({
|
|
|
794
796
|
/* @__PURE__ */ jsx(
|
|
795
797
|
"polygon",
|
|
796
798
|
{
|
|
797
|
-
points: `${x2},${axisY -
|
|
799
|
+
points: `${x2},${axisY - 16} ${x2 - arrowHeadHW},${axisY - arrowHeadH - 16} ${x2 + arrowHeadHW},${axisY - arrowHeadH - 16}`,
|
|
798
800
|
fill: strokeColor,
|
|
799
801
|
pointerEvents: "none"
|
|
800
802
|
}
|
|
@@ -837,7 +839,7 @@ const GroupArcsLayer = memo(function GroupArcsLayer2({
|
|
|
837
839
|
const ry = Math.min(rx * ARC_RY_RATIO, arcMaxHeight);
|
|
838
840
|
const color = arcColors[g % arcColors.length];
|
|
839
841
|
const MIN_ARROW_SPAN = 24;
|
|
840
|
-
const textY = Math.min(axisY - ry -
|
|
842
|
+
const textY = Math.min(axisY - ry - 26, axisY - MIN_ARROW_SPAN);
|
|
841
843
|
const arcPath = buildArcPath({ x1, x2, y: axisY, rx, ry });
|
|
842
844
|
const isSelected = selectedArcIndices.has(g);
|
|
843
845
|
const hitCursor = tool === "eraser" ? "cell" : tool === "none" ? "pointer" : "default";
|
|
@@ -955,6 +957,7 @@ function NumberLine({ className }) {
|
|
|
955
957
|
showGroupTicks,
|
|
956
958
|
showMajorTicks,
|
|
957
959
|
showMinorTicks,
|
|
960
|
+
showLabelStep,
|
|
958
961
|
viewMin,
|
|
959
962
|
viewMax,
|
|
960
963
|
enableZoom,
|
|
@@ -1164,7 +1167,8 @@ function NumberLine({ className }) {
|
|
|
1164
1167
|
tickStep,
|
|
1165
1168
|
showGroupTicks,
|
|
1166
1169
|
showMajorTicks,
|
|
1167
|
-
showMinorTicks
|
|
1170
|
+
showMinorTicks,
|
|
1171
|
+
showLabelStep
|
|
1168
1172
|
}
|
|
1169
1173
|
),
|
|
1170
1174
|
/* @__PURE__ */ jsx(
|