@spider-analyzer/timeline 5.0.2 → 5.0.3
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 +12 -0
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/TimeLine.tsx +2 -1
- package/src/time.ts +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 5.0.3
|
|
2
|
+
|
|
3
|
+
- Fix: preserve `undefined` at the Date-→-Moment boundary. Optional
|
|
4
|
+
fields like `maxDomain.min`, `maxDomain.max`, or a partially-populated
|
|
5
|
+
`timeSpan` were silently turning into `moment()` (= now) because
|
|
6
|
+
`moment(undefined)` returns the current time. That turned
|
|
7
|
+
`maxDomain.min = undefined` (the common "no lower bound" case) into an
|
|
8
|
+
active minimum of *now*, which made every visible window appear to be
|
|
9
|
+
before the minimum — triggering `minTime`/`minDomainMsg` on zoom-out,
|
|
10
|
+
blocking pan, and causing constant cursor flicker from re-emitted
|
|
11
|
+
corrections.
|
|
12
|
+
|
|
1
13
|
## 5.0.2
|
|
2
14
|
|
|
3
15
|
- Fix: apply the `xAxis` / `yAxis` / `margin` defaults inside the outer
|
package/dist/index.js
CHANGED
|
@@ -1956,15 +1956,19 @@ function toMoment(x, zone) {
|
|
|
1956
1956
|
const m = zone ? moment_shim_default.tz(x, zone) : moment_shim_default(x);
|
|
1957
1957
|
return m;
|
|
1958
1958
|
}
|
|
1959
|
+
function toMomentOpt(x, zone) {
|
|
1960
|
+
if (x == null) return void 0;
|
|
1961
|
+
return toMoment(x, zone);
|
|
1962
|
+
}
|
|
1959
1963
|
function toDuration(x) {
|
|
1960
1964
|
if (moment_shim_default.isDuration(x)) return x;
|
|
1961
1965
|
return moment_shim_default.duration(x);
|
|
1962
1966
|
}
|
|
1963
1967
|
function domainToMoments(d, zone) {
|
|
1964
|
-
return { min:
|
|
1968
|
+
return { min: toMomentOpt(d.min, zone), max: toMomentOpt(d.max, zone) };
|
|
1965
1969
|
}
|
|
1966
1970
|
function timeSpanToMoments(t, zone) {
|
|
1967
|
-
return { start:
|
|
1971
|
+
return { start: toMomentOpt(t.start, zone), stop: toMomentOpt(t.stop, zone) };
|
|
1968
1972
|
}
|
|
1969
1973
|
var Cursor2 = Cursor;
|
|
1970
1974
|
var Histogram2 = Histogram;
|
|
@@ -2758,8 +2762,9 @@ var TimeLine2 = react.forwardRef(function TimeLineWrapper(props, ref) {
|
|
|
2758
2762
|
const handleLoadDefault = react.useCallback(() => {
|
|
2759
2763
|
const ret = props.onLoadDefaultDomain?.();
|
|
2760
2764
|
const apply = (d) => {
|
|
2761
|
-
if (!d) return;
|
|
2765
|
+
if (!d || !d.min || !d.max) return;
|
|
2762
2766
|
const m = domainToMoments(d, zone);
|
|
2767
|
+
if (!m.min || !m.max) return;
|
|
2763
2768
|
setStack([m]);
|
|
2764
2769
|
if (props.onDomainChange) {
|
|
2765
2770
|
props.onDomainChange({ min: m.min.toDate(), max: m.max.toDate() });
|