@spider-analyzer/timeline 5.0.1 → 5.0.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spider-analyzer/timeline",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "React graphical component to display metric over time with a time selection feature.",
5
5
  "author": "Thibaut Raballand <spider.analyzer@gmail.com> (https://spider-analyzer.io)",
6
6
  "license": "MIT",
package/src/TimeLine.tsx CHANGED
@@ -886,9 +886,15 @@ const TimeLine = forwardRef<TimeLineHandle, any>(function TimeLineWrapper(props,
886
886
  else if (ret) apply(ret);
887
887
  }, [props.onLoadDefaultDomain, props.onDomainChange, zone]);
888
888
 
889
- // Build the moment-typed props the inner expects.
889
+ // Build the moment-typed props the inner expects. Apply the same
890
+ // defaults the inner destructures locally so that ref-path accesses
891
+ // (propsRef.current.xAxis.spaceBetweenTicks etc.) never trip on an
892
+ // undefined consumer prop.
890
893
  const innerProps: any = {
891
894
  ...props,
895
+ xAxis: { ...xAxisDefault, ...(props.xAxis ?? {}) },
896
+ yAxis: props.yAxis ?? {},
897
+ margin: { ...marginDefault, ...(props.margin ?? {}) },
892
898
  domains: stack,
893
899
  timeSpan: props.timeSpan ? timeSpanToMoments(props.timeSpan, zone) : undefined,
894
900
  maxDomain: props.maxDomain ? domainToMoments(props.maxDomain, zone) : undefined,