@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 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 isMinorTick = isOnMinorGrid && !isMajor && !isGroupBoundary;
620
- const visible = isGroupBoundary && showGroupTicks || isMajor && showMajorTicks || isMinorTick && showMinorTicks;
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 = isGroupBoundary && showGroupTicks;
623
- const renderAsMajor = !renderAsGroup && isMajor && showMajorTicks;
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 isMinorTick = isOnMinorGrid && !isMajor && !isGroupBoundary;
618
- const visible = isGroupBoundary && showGroupTicks || isMajor && showMajorTicks || isMinorTick && showMinorTicks;
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 = isGroupBoundary && showGroupTicks;
621
- const renderAsMajor = !renderAsGroup && isMajor && showMajorTicks;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dcg-overseas/number-line",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Interactive number line component with group arcs and freehand drawing",
5
5
  "type": "module",
6
6
  "license": "MIT",