@spider-analyzer/timeline 5.0.4 → 5.0.5
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/CHANGELOG.md +17 -0
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/TimeLine.tsx +12 -2
package/dist/index.mjs
CHANGED
|
@@ -2071,9 +2071,11 @@ var TimeLineInner = forwardRef(function TimeLine(props, ref) {
|
|
|
2071
2071
|
const xAxis = scaleTime().domain([domain2.min, domain2.max]).range([0, histoWidth2]);
|
|
2072
2072
|
xAxis.clamp(true);
|
|
2073
2073
|
xAxisRef.current = xAxis;
|
|
2074
|
-
const
|
|
2074
|
+
const tickCount = floor(histoWidth2 / p.xAxis.spaceBetweenTicks);
|
|
2075
|
+
const ticks2 = xAxis.ticks(tickCount);
|
|
2076
|
+
const tickIntervalMs = ticks2.length >= 2 ? ticks2[1].getTime() - ticks2[0].getTime() : (+domain2.max - +domain2.min) / Math.max(tickCount, 1);
|
|
2075
2077
|
const intervalMs = max([
|
|
2076
|
-
round(
|
|
2078
|
+
round(tickIntervalMs / p.xAxis.barsBetweenTicks),
|
|
2077
2079
|
propsRef.current.smallestResolution.asMilliseconds()
|
|
2078
2080
|
]);
|
|
2079
2081
|
patchState({ histoWidth: histoWidth2, isActive: true, ticks: ticks2 });
|