@dcg-overseas/number-line 0.1.20 → 0.1.22
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 +20 -8
- package/dist/index.js +20 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -616,16 +616,25 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
616
616
|
const isOnMinorGrid = minorStep > 0 && Math.abs(offset % minorStep) < 1e-9;
|
|
617
617
|
const maxGroupBoundary = min + groupCount * groupSize;
|
|
618
618
|
const isGroupBoundary = groupSize > 0 && offset % groupSize === 0 && v <= maxGroupBoundary;
|
|
619
|
-
const
|
|
620
|
-
const
|
|
619
|
+
const groupActive = isGroupBoundary && showGroupTicks;
|
|
620
|
+
const majorActive = isMajor && showMajorTicks;
|
|
621
|
+
const minorActive = isOnMinorGrid && showMinorTicks;
|
|
622
|
+
const visible = groupActive || majorActive || minorActive;
|
|
621
623
|
if (!visible) return null;
|
|
622
|
-
const renderAsGroup =
|
|
623
|
-
const renderAsMajor = !renderAsGroup &&
|
|
624
|
+
const renderAsGroup = groupActive;
|
|
625
|
+
const renderAsMajor = !renderAsGroup && majorActive;
|
|
624
626
|
const showLabel = (renderAsGroup || renderAsMajor) && offset % labelStep === 0;
|
|
625
|
-
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({
|
|
626
|
-
|
|
627
|
+
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({
|
|
628
|
+
viewMin,
|
|
629
|
+
viewMax,
|
|
630
|
+
offset,
|
|
631
|
+
labelStep,
|
|
632
|
+
length,
|
|
633
|
+
v
|
|
634
|
+
});
|
|
635
|
+
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 6;
|
|
627
636
|
const strokeW = renderAsGroup ? 4 : renderAsMajor ? 2 : 1;
|
|
628
|
-
const color = renderAsGroup || renderAsMajor ? "#374151" : "#
|
|
637
|
+
const color = renderAsGroup || renderAsMajor ? "#374151" : "#4b5563";
|
|
629
638
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
630
639
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
631
640
|
"line",
|
|
@@ -648,7 +657,10 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
648
657
|
fill: "#472E17",
|
|
649
658
|
pointerEvents: "none",
|
|
650
659
|
"data-type": "2",
|
|
651
|
-
style: {
|
|
660
|
+
style: {
|
|
661
|
+
userSelect: "none",
|
|
662
|
+
WebkitUserSelect: "none"
|
|
663
|
+
},
|
|
652
664
|
children: v
|
|
653
665
|
}
|
|
654
666
|
)
|
package/dist/index.js
CHANGED
|
@@ -614,16 +614,25 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
614
614
|
const isOnMinorGrid = minorStep > 0 && Math.abs(offset % minorStep) < 1e-9;
|
|
615
615
|
const maxGroupBoundary = min + groupCount * groupSize;
|
|
616
616
|
const isGroupBoundary = groupSize > 0 && offset % groupSize === 0 && v <= maxGroupBoundary;
|
|
617
|
-
const
|
|
618
|
-
const
|
|
617
|
+
const groupActive = isGroupBoundary && showGroupTicks;
|
|
618
|
+
const majorActive = isMajor && showMajorTicks;
|
|
619
|
+
const minorActive = isOnMinorGrid && showMinorTicks;
|
|
620
|
+
const visible = groupActive || majorActive || minorActive;
|
|
619
621
|
if (!visible) return null;
|
|
620
|
-
const renderAsGroup =
|
|
621
|
-
const renderAsMajor = !renderAsGroup &&
|
|
622
|
+
const renderAsGroup = groupActive;
|
|
623
|
+
const renderAsMajor = !renderAsGroup && majorActive;
|
|
622
624
|
const showLabel = (renderAsGroup || renderAsMajor) && offset % labelStep === 0;
|
|
623
|
-
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({
|
|
624
|
-
|
|
625
|
+
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({
|
|
626
|
+
viewMin,
|
|
627
|
+
viewMax,
|
|
628
|
+
offset,
|
|
629
|
+
labelStep,
|
|
630
|
+
length,
|
|
631
|
+
v
|
|
632
|
+
});
|
|
633
|
+
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 6;
|
|
625
634
|
const strokeW = renderAsGroup ? 4 : renderAsMajor ? 2 : 1;
|
|
626
|
-
const color = renderAsGroup || renderAsMajor ? "#374151" : "#
|
|
635
|
+
const color = renderAsGroup || renderAsMajor ? "#374151" : "#4b5563";
|
|
627
636
|
return /* @__PURE__ */ jsxs("g", { children: [
|
|
628
637
|
/* @__PURE__ */ jsx(
|
|
629
638
|
"line",
|
|
@@ -646,7 +655,10 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
646
655
|
fill: "#472E17",
|
|
647
656
|
pointerEvents: "none",
|
|
648
657
|
"data-type": "2",
|
|
649
|
-
style: {
|
|
658
|
+
style: {
|
|
659
|
+
userSelect: "none",
|
|
660
|
+
WebkitUserSelect: "none"
|
|
661
|
+
},
|
|
650
662
|
children: v
|
|
651
663
|
}
|
|
652
664
|
)
|