@spider-analyzer/timeline 5.0.5 → 5.0.6
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 +5 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/TimeLine.tsx +17 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 5.0.6
|
|
2
|
+
|
|
3
|
+
- Fix: don't issue the first `onLoadHisto` with a stale `intervalMs`
|
|
4
|
+
when the consumer hasn't measured a valid width yet. `getItems` now
|
|
5
|
+
short-circuits the fetch while `histoWidth <= 0`, and the width-change
|
|
6
|
+
effect re-runs `getItems` whenever a domain exists (not only when the
|
|
7
|
+
prior call marked `isActive=true`). Previously the first call fired
|
|
8
|
+
with `histoWidth=0`, fell back to `domainSpan / 1 tick` and divided by
|
|
9
|
+
`barsBetweenTicks` — giving a coarse interval like 3 h over a 24 h
|
|
10
|
+
window; the subsequent width arrival then never retriggered the load
|
|
11
|
+
because `isActive` was already true and the delta check failed.
|
|
12
|
+
|
|
1
13
|
## 5.0.5
|
|
2
14
|
|
|
3
15
|
- Fix: compute intervalMs defensively in `getItems`. When d3's
|
package/dist/index.js
CHANGED
|
@@ -2089,7 +2089,7 @@ var TimeLineInner = react.forwardRef(function TimeLine(props, ref) {
|
|
|
2089
2089
|
propsRef.current.smallestResolution.asMilliseconds()
|
|
2090
2090
|
]);
|
|
2091
2091
|
patchState({ histoWidth: histoWidth2, isActive: true, ticks: ticks2 });
|
|
2092
|
-
if (shouldReload && intervalMs) {
|
|
2092
|
+
if (shouldReload && intervalMs && histoWidth2 > 0) {
|
|
2093
2093
|
widthOfLastUpdateRef.current = p.width;
|
|
2094
2094
|
patchState({ waitForLoad: true });
|
|
2095
2095
|
p.onLoadHisto(intervalMs, domain2.min, domain2.max);
|
|
@@ -2119,12 +2119,11 @@ var TimeLineInner = react.forwardRef(function TimeLine(props, ref) {
|
|
|
2119
2119
|
return;
|
|
2120
2120
|
}
|
|
2121
2121
|
const s = stateRef.current;
|
|
2122
|
-
|
|
2122
|
+
patchState(computeMarginAndWidth(props));
|
|
2123
|
+
if (s.domain) {
|
|
2123
2124
|
const big = widthOfLastUpdateRef.current !== null && Math.abs((props.width ?? 0) - (widthOfLastUpdateRef.current ?? 0)) > 30;
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
} else {
|
|
2127
|
-
patchState(computeMarginAndWidth(props));
|
|
2125
|
+
const shouldReload = !s.isActive || big || widthOfLastUpdateRef.current === null;
|
|
2126
|
+
getItems(props, s.domain, shouldReload);
|
|
2128
2127
|
}
|
|
2129
2128
|
if (stateRef.current.domain) {
|
|
2130
2129
|
const res = checkAndCorrectDomain({ domain: stateRef.current.domain });
|