@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/dist/index.mjs CHANGED
@@ -2079,7 +2079,7 @@ var TimeLineInner = forwardRef(function TimeLine(props, ref) {
2079
2079
  propsRef.current.smallestResolution.asMilliseconds()
2080
2080
  ]);
2081
2081
  patchState({ histoWidth: histoWidth2, isActive: true, ticks: ticks2 });
2082
- if (shouldReload && intervalMs) {
2082
+ if (shouldReload && intervalMs && histoWidth2 > 0) {
2083
2083
  widthOfLastUpdateRef.current = p.width;
2084
2084
  patchState({ waitForLoad: true });
2085
2085
  p.onLoadHisto(intervalMs, domain2.min, domain2.max);
@@ -2109,12 +2109,11 @@ var TimeLineInner = forwardRef(function TimeLine(props, ref) {
2109
2109
  return;
2110
2110
  }
2111
2111
  const s = stateRef.current;
2112
- if (s.isActive) {
2112
+ patchState(computeMarginAndWidth(props));
2113
+ if (s.domain) {
2113
2114
  const big = widthOfLastUpdateRef.current !== null && Math.abs((props.width ?? 0) - (widthOfLastUpdateRef.current ?? 0)) > 30;
2114
- getItems(props, s.domain, big);
2115
- patchState(computeMarginAndWidth(props));
2116
- } else {
2117
- patchState(computeMarginAndWidth(props));
2115
+ const shouldReload = !s.isActive || big || widthOfLastUpdateRef.current === null;
2116
+ getItems(props, s.domain, shouldReload);
2118
2117
  }
2119
2118
  if (stateRef.current.domain) {
2120
2119
  const res = checkAndCorrectDomain({ domain: stateRef.current.domain });