@dcg-overseas/number-line 0.1.20 → 0.1.21
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 +6 -4
- package/dist/index.js +6 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -616,11 +616,13 @@ 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
627
|
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({ viewMin, viewMax, offset, labelStep, length, v });
|
|
626
628
|
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 4;
|
package/dist/index.js
CHANGED
|
@@ -614,11 +614,13 @@ 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
625
|
const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({ viewMin, viewMax, offset, labelStep, length, v });
|
|
624
626
|
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 4;
|