@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 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 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
- const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({ viewMin, viewMax, offset, labelStep, length, v });
626
- const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 4;
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" : "#6b7280";
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: { userSelect: "none", WebkitUserSelect: "none" },
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 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
- const currentShowLabelStep = typeof getShowLabelStep !== "function" ? false : getShowLabelStep == null ? void 0 : getShowLabelStep({ viewMin, viewMax, offset, labelStep, length, v });
624
- const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : 4;
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" : "#6b7280";
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: { userSelect: "none", WebkitUserSelect: "none" },
658
+ style: {
659
+ userSelect: "none",
660
+ WebkitUserSelect: "none"
661
+ },
650
662
  children: v
651
663
  }
652
664
  )
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.22",
4
4
  "description": "Interactive number line component with group arcs and freehand drawing",
5
5
  "type": "module",
6
6
  "license": "MIT",