@dcg-overseas/number-line 0.1.28 → 0.1.30
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 +2 -11
- package/dist/index.js +2 -11
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -639,7 +639,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
639
639
|
});
|
|
640
640
|
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : renderAsHalf ? 8 : 6;
|
|
641
641
|
const strokeW = renderAsGroup ? 4 : renderAsMajor ? 2 : renderAsHalf ? 2 : 1;
|
|
642
|
-
const arcIndex = renderAsGroup
|
|
642
|
+
const arcIndex = renderAsGroup ? offset > 0 ? offset / groupSize - 1 : offset === 0 ? 0 : -1 : -1;
|
|
643
643
|
const arcColored = arcIndex >= 0 && arcIndex < groupCount && !(deletedArcIndices == null ? void 0 : deletedArcIndices.has(arcIndex));
|
|
644
644
|
const color = arcColored ? arcColors[arcIndex % arcColors.length] : renderAsGroup || renderAsMajor || renderAsHalf ? "#374151" : "#4b5563";
|
|
645
645
|
return /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
|
|
@@ -1026,16 +1026,7 @@ function NumberLine({ className }) {
|
|
|
1026
1026
|
const w = containerWidth;
|
|
1027
1027
|
const h = containerHeight;
|
|
1028
1028
|
const horizontalLayout = computeHorizontalLayout(min, max);
|
|
1029
|
-
const
|
|
1030
|
-
const usable = Math.max(
|
|
1031
|
-
w - horizontalLayout.padLeft - horizontalLayout.padRight - horizontalLayout.labelInsetLeft - horizontalLayout.labelInsetRight,
|
|
1032
|
-
1
|
|
1033
|
-
);
|
|
1034
|
-
let ryTypical = MIN_ARC_HEIGHT * 0.5;
|
|
1035
|
-
if (groupSize > 0 && groupCount > 0) {
|
|
1036
|
-
const rx = usable * groupSize / range / 2;
|
|
1037
|
-
ryTypical = Math.min(rx * ARC_RY_RATIO, h * 0.48);
|
|
1038
|
-
}
|
|
1029
|
+
const ryTypical = MIN_ARC_HEIGHT * 0.5;
|
|
1039
1030
|
const minAxisY = MIN_ARC_HEIGHT + ARC_BASELINE_LIFT + ARC_LABEL_SPACE + ARC_TOP_PADDING;
|
|
1040
1031
|
const maxAxisY = h - LABEL_SPACE_BELOW_AXIS;
|
|
1041
1032
|
const axisYCentered = (h + ryTypical + LABEL_ABOVE_AXIS_SLOP - LABEL_SPACE_BELOW_AXIS) / 2;
|
package/dist/index.js
CHANGED
|
@@ -637,7 +637,7 @@ const AxisLayer = React.memo(function AxisLayer2({
|
|
|
637
637
|
});
|
|
638
638
|
const tickH = renderAsGroup ? 7 : renderAsMajor ? 10 : renderAsHalf ? 8 : 6;
|
|
639
639
|
const strokeW = renderAsGroup ? 4 : renderAsMajor ? 2 : renderAsHalf ? 2 : 1;
|
|
640
|
-
const arcIndex = renderAsGroup
|
|
640
|
+
const arcIndex = renderAsGroup ? offset > 0 ? offset / groupSize - 1 : offset === 0 ? 0 : -1 : -1;
|
|
641
641
|
const arcColored = arcIndex >= 0 && arcIndex < groupCount && !(deletedArcIndices == null ? void 0 : deletedArcIndices.has(arcIndex));
|
|
642
642
|
const color = arcColored ? arcColors[arcIndex % arcColors.length] : renderAsGroup || renderAsMajor || renderAsHalf ? "#374151" : "#4b5563";
|
|
643
643
|
return /* @__PURE__ */ jsxs("g", { children: [
|
|
@@ -1024,16 +1024,7 @@ function NumberLine({ className }) {
|
|
|
1024
1024
|
const w = containerWidth;
|
|
1025
1025
|
const h = containerHeight;
|
|
1026
1026
|
const horizontalLayout = computeHorizontalLayout(min, max);
|
|
1027
|
-
const
|
|
1028
|
-
const usable = Math.max(
|
|
1029
|
-
w - horizontalLayout.padLeft - horizontalLayout.padRight - horizontalLayout.labelInsetLeft - horizontalLayout.labelInsetRight,
|
|
1030
|
-
1
|
|
1031
|
-
);
|
|
1032
|
-
let ryTypical = MIN_ARC_HEIGHT * 0.5;
|
|
1033
|
-
if (groupSize > 0 && groupCount > 0) {
|
|
1034
|
-
const rx = usable * groupSize / range / 2;
|
|
1035
|
-
ryTypical = Math.min(rx * ARC_RY_RATIO, h * 0.48);
|
|
1036
|
-
}
|
|
1027
|
+
const ryTypical = MIN_ARC_HEIGHT * 0.5;
|
|
1037
1028
|
const minAxisY = MIN_ARC_HEIGHT + ARC_BASELINE_LIFT + ARC_LABEL_SPACE + ARC_TOP_PADDING;
|
|
1038
1029
|
const maxAxisY = h - LABEL_SPACE_BELOW_AXIS;
|
|
1039
1030
|
const axisYCentered = (h + ryTypical + LABEL_ABOVE_AXIS_SLOP - LABEL_SPACE_BELOW_AXIS) / 2;
|