@octanejs/recharts 0.1.52 → 0.1.53

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": "@octanejs/recharts",
3
- "version": "0.1.52",
3
+ "version": "0.1.53",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "engines": {
@@ -43,10 +43,10 @@
43
43
  "reselect": "5.2.0",
44
44
  "tiny-invariant": "^1.3.3",
45
45
  "victory-vendor": "^37.3.6",
46
- "@octanejs/redux": "0.1.50"
46
+ "@octanejs/redux": "0.1.51"
47
47
  },
48
48
  "peerDependencies": {
49
- "octane": "^0.1.51 || ^0.2.0"
49
+ "octane": "^0.1.51 || ^0.2.0 || ^0.3.0"
50
50
  },
51
51
  "devDependencies": {
52
52
  "@tsrx/react": "^0.3.0",
@@ -55,7 +55,7 @@
55
55
  "react-dom": "19.2.7",
56
56
  "recharts": "3.9.2",
57
57
  "vitest": "^4.1.10",
58
- "octane": "0.2.14"
58
+ "octane": "0.3.0"
59
59
  },
60
60
  "scripts": {
61
61
  "test": "vitest run"
@@ -12,7 +12,7 @@ const AnimationControllerContext = createContext(animationControllerImpl);
12
12
  * internally to drive animations.
13
13
  * @since 3.9
14
14
  */
15
- export const AnimationControllerProvider = AnimationControllerContext.Provider;
15
+ export const AnimationControllerProvider = AnimationControllerContext;
16
16
 
17
17
  export function useAnimationController(
18
18
  animationControllerFromProps?: AnimationController,
@@ -750,7 +750,7 @@ function BarImpl(props: BarImplProps) {
750
750
  dataPointFormatter={errorBarDataPointFormatter}
751
751
  errorBarOffset={errorBarOffset}
752
752
  >
753
- <CellsContext.Provider value={cellRegistry}>
753
+ <CellsContext value={cellRegistry}>
754
754
  <BarWithState
755
755
  {...props}
756
756
  layout={layout}
@@ -767,7 +767,7 @@ function BarImpl(props: BarImplProps) {
767
767
  animationEasing={animationEasing}
768
768
  isAnimationActive={isAnimationActive}
769
769
  />
770
- </CellsContext.Provider>
770
+ </CellsContext>
771
771
  </SetErrorBarContext>;
772
772
  }
773
773
 
@@ -106,10 +106,10 @@ function BarStackImpl(props: BarStackProps) @{
106
106
  resolvedStackId,
107
107
  radius,
108
108
  ]);
109
- <BarStackContext.Provider value={context}>
109
+ <BarStackContext value={context}>
110
110
  <BarStackClipPath stackId={resolvedStackId} radius={radius} />
111
111
  {children}
112
- </BarStackContext.Provider>
112
+ </BarStackContext>
113
113
  }
114
114
 
115
115
  /**
@@ -614,7 +614,7 @@ function FunnelImpl(props: WithIdRequired<RequiresDefaultProps<Props, typeof def
614
614
  }, [fill, hide, legendType, props.dataKey, trapezoids]);
615
615
 
616
616
  if (hide || !trapezoids || !trapezoids.length || !plotArea) {
617
- return <CellsContext.Provider value={cellRegistry}>
617
+ return <CellsContext value={cellRegistry}>
618
618
  <SetLegendPayload legendPayload={legendPayload} />
619
619
  <SetFunnelTooltipEntrySettings
620
620
  dataKey={props.dataKey}
@@ -631,13 +631,13 @@ function FunnelImpl(props: WithIdRequired<RequiresDefaultProps<Props, typeof def
631
631
  id={id}
632
632
  />
633
633
  {props.children}
634
- </CellsContext.Provider>;
634
+ </CellsContext>;
635
635
  }
636
636
  const { height, width } = plotArea;
637
637
 
638
638
  const layerClass = clsx('recharts-trapezoids', props.className);
639
639
 
640
- return <CellsContext.Provider value={cellRegistry}>
640
+ return <CellsContext value={cellRegistry}>
641
641
  <SetLegendPayload legendPayload={legendPayload} />
642
642
  <SetFunnelTooltipEntrySettings
643
643
  dataKey={props.dataKey}
@@ -672,7 +672,7 @@ function FunnelImpl(props: WithIdRequired<RequiresDefaultProps<Props, typeof def
672
672
  trapezoids={trapezoids}
673
673
  />
674
674
  </Layer>
675
- </CellsContext.Provider>;
675
+ </CellsContext>;
676
676
  }
677
677
 
678
678
  function normalizeFunnelValue(value: unknown): {
@@ -1005,9 +1005,9 @@ function ScatterImpl(props: WithIdRequired<Props>) {
1005
1005
  return selectScatterPoints(state, xAxisId, yAxisId, zAxisId, props.id, cells, isPanorama);
1006
1006
  });
1007
1007
  if (needClip == null || points == null) {
1008
- return <CellsContext.Provider value={cellRegistry}>{props.children}</CellsContext.Provider>;
1008
+ return <CellsContext value={cellRegistry}>{props.children}</CellsContext>;
1009
1009
  }
1010
- return <CellsContext.Provider value={cellRegistry}>
1010
+ return <CellsContext value={cellRegistry}>
1011
1011
  <SetScatterTooltipEntrySettings
1012
1012
  dataKey={props.dataKey}
1013
1013
  points={points}
@@ -1037,7 +1037,7 @@ function ScatterImpl(props: WithIdRequired<Props>) {
1037
1037
  points={points}
1038
1038
  needClip={needClip}
1039
1039
  />
1040
- </CellsContext.Provider>;
1040
+ </CellsContext>;
1041
1041
  }
1042
1042
 
1043
1043
  function ScatterFn<DataPointType = any, ValueAxisType = any>(
@@ -299,8 +299,8 @@ export function RechartsWrapper(props: RechartsWrapperProps) {
299
299
  dispatch(externalEventAction({ handler: onTouchEnd, reactEvent: e }));
300
300
  }, [dispatch, onTouchEnd]);
301
301
  const WrapperDiv = responsive ? ResponsiveDiv : NonResponsiveDiv;
302
- return <TooltipPortalContext.Provider value={tooltipPortal}>
303
- <LegendPortalContext.Provider value={legendPortal}>
302
+ return <TooltipPortalContext value={tooltipPortal}>
303
+ <LegendPortalContext value={legendPortal}>
304
304
  <WrapperDiv
305
305
  width={width ?? style?.width}
306
306
  height={height ?? style?.height}
@@ -325,6 +325,6 @@ export function RechartsWrapper(props: RechartsWrapperProps) {
325
325
  <EventSynchronizer />
326
326
  {children}
327
327
  </WrapperDiv>
328
- </LegendPortalContext.Provider>
329
- </TooltipPortalContext.Provider>;
328
+ </LegendPortalContext>
329
+ </TooltipPortalContext>;
330
330
  }
@@ -1516,7 +1516,7 @@ export function Sankey(outsideProps: Props) {
1516
1516
  onTouchMove={undefined}
1517
1517
  onTouchEnd={undefined}
1518
1518
  >
1519
- <TooltipPortalContext.Provider value={tooltipPortal}>
1519
+ <TooltipPortalContext value={tooltipPortal}>
1520
1520
  <RegisterGraphicalItemId id={externalId} type="sankey">
1521
1521
  {(id) => <>
1522
1522
  <SetSankeyTooltipEntrySettings
@@ -1532,7 +1532,7 @@ export function Sankey(outsideProps: Props) {
1532
1532
  <SankeyImpl {...props} id={id} />
1533
1533
  </>}
1534
1534
  </RegisterGraphicalItemId>
1535
- </TooltipPortalContext.Provider>
1535
+ </TooltipPortalContext>
1536
1536
  </RechartsWrapper>
1537
1537
  </RechartsStoreProvider>;
1538
1538
  }
@@ -475,7 +475,7 @@ export const SunburstChart = (outsideProps: SunburstChartProps) => {
475
475
  <ReportChartSize width={width} height={height} />
476
476
  <ReportChartMargin margin={defaultSunburstMargin} />
477
477
  <ReportEventSettings throttleDelay={throttleDelay} throttledEvents={throttledEvents} />
478
- <TooltipPortalContext.Provider value={tooltipPortal}>
478
+ <TooltipPortalContext value={tooltipPortal}>
479
479
  <RechartsWrapper
480
480
  className={className}
481
481
  width={width}
@@ -503,6 +503,6 @@ export const SunburstChart = (outsideProps: SunburstChartProps) => {
503
503
  {(id) => <SunburstChartImpl {...props} id={id} />}
504
504
  </RegisterGraphicalItemId>
505
505
  </RechartsWrapper>
506
- </TooltipPortalContext.Provider>
506
+ </TooltipPortalContext>
507
507
  </RechartsStoreProvider>;
508
508
  };
@@ -92,7 +92,7 @@ export function CartesianLabelContextProvider(props: TrapezoidViewBox & {
92
92
  width,
93
93
  height,
94
94
  ]);
95
- <CartesianLabelContext.Provider value={viewBox}>{children}</CartesianLabelContext.Provider>
95
+ <CartesianLabelContext value={viewBox}>{children}</CartesianLabelContext>
96
96
  }
97
97
 
98
98
  function useCartesianLabelContext() {
@@ -112,7 +112,7 @@ export function PolarLabelContextProvider(props: PolarViewBoxRequired & {
112
112
  () => ({ cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise }),
113
113
  [cx, cy, innerRadius, outerRadius, startAngle, endAngle, clockWise],
114
114
  );
115
- <PolarLabelContext.Provider value={viewBox}>{children}</PolarLabelContext.Provider>
115
+ <PolarLabelContext value={viewBox}>{children}</PolarLabelContext>
116
116
  }
117
117
 
118
118
  export function usePolarLabelContext() {
@@ -64,11 +64,11 @@ const defaultAccessor = (entry: LabelListEntry) => {
64
64
  const CartesianLabelListContext = createContext<ReadonlyArray<CartesianLabelListEntry> | undefined>(
65
65
  undefined,
66
66
  );
67
- export const CartesianLabelListContextProvider = CartesianLabelListContext.Provider;
67
+ export const CartesianLabelListContextProvider = CartesianLabelListContext;
68
68
  const PolarLabelListContext = createContext<ReadonlyArray<PolarLabelListEntry> | undefined>(
69
69
  undefined,
70
70
  );
71
- export const PolarLabelListContextProvider = PolarLabelListContext.Provider;
71
+ export const PolarLabelListContextProvider = PolarLabelListContext;
72
72
 
73
73
  function useCartesianLabelListContext() {
74
74
  return useContext(CartesianLabelListContext);
@@ -49,7 +49,7 @@ export interface Props extends Omit<
49
49
  const initialDimension = defaultResponsiveContainerProps.initialDimension;
50
50
  const ResponsiveContainerContext = createContext<ResponsiveContainerDimensions>(initialDimension);
51
51
 
52
- export const ResponsiveContainerContextProviderInternal = ResponsiveContainerContext.Provider;
52
+ export const ResponsiveContainerContextProviderInternal = ResponsiveContainerContext;
53
53
  export const useResponsiveContainerContext = () => useContext(ResponsiveContainerContext);
54
54
  export { initialDimension as defaultResponsiveContainerDimension };
55
55
 
@@ -18,14 +18,14 @@ export function ClipPathProvider(props: {
18
18
  return null;
19
19
  }
20
20
  const { x, y, width, height } = plotArea;
21
- <ClipPathIdContext.Provider value={clipPathId}>
21
+ <ClipPathIdContext value={clipPathId}>
22
22
  <defs>
23
23
  <clipPath id={clipPathId}>
24
24
  <rect x={x} y={y} height={height} width={width} />
25
25
  </clipPath>
26
26
  </defs>
27
27
  {children}
28
- </ClipPathIdContext.Provider>
28
+ </ClipPathIdContext>
29
29
  }
30
30
 
31
31
  export const useClipPathId = () => {
@@ -33,7 +33,7 @@ function toCellArray(map: Map<object, CellProps>): RegisteredCell[] | undefined
33
33
 
34
34
  /**
35
35
  * Owns the collected cells state. Returns `[cells, registry]`; provide the
36
- * registry via `<CellsContext.Provider value={registry}>` around the item's
36
+ * registry via `<CellsContext value={registry}>` around the item's
37
37
  * children, and pass `cells` wherever upstream passed findAllByType's result.
38
38
  * `cells` is `undefined` until the first Cell registers — matching upstream,
39
39
  * where a childless item passes an empty find result whose `cells[index]`
@@ -37,7 +37,7 @@ export function SetErrorBarContext<
37
37
  children: OctaneNode;
38
38
  }) {
39
39
  const { children, ...rest } = props;
40
- return <ErrorBarContext.Provider value={rest}>{children}</ErrorBarContext.Provider>;
40
+ return <ErrorBarContext value={rest}>{children}</ErrorBarContext>;
41
41
  }
42
42
 
43
43
  export const useErrorBarContext = () => useContext(ErrorBarContext);
@@ -17,9 +17,7 @@ const GraphicalItemIdContext = createContext<GraphicalItemId | undefined>(undefi
17
17
  export function RegisterGraphicalItemId(props: IdSetter) {
18
18
  const { id, type, children } = props;
19
19
  const resolvedId = useUniqueId('recharts-' + type, id);
20
- return <GraphicalItemIdContext.Provider value={resolvedId}>{children(
21
- resolvedId,
22
- )}</GraphicalItemIdContext.Provider>;
20
+ return <GraphicalItemIdContext value={resolvedId}>{children(resolvedId)}</GraphicalItemIdContext>;
23
21
  }
24
22
 
25
23
  export function useGraphicalItemId() {
@@ -1154,17 +1154,17 @@ function PieImpl(props: WithIdRequired<PropsWithResolvedDefaults>) {
1154
1154
 
1155
1155
  if (sectors == null) {
1156
1156
  previousSectorsRef.current = null;
1157
- return <CellsContext.Provider value={cellRegistry}>
1157
+ return <CellsContext value={cellRegistry}>
1158
1158
  <SetPiePayloadLegend cells={cells} id={id} />
1159
1159
  <Layer tabIndex={rootTabIndex} className={layerClass}>{props.children}</Layer>
1160
- </CellsContext.Provider>;
1160
+ </CellsContext>;
1161
1161
  }
1162
1162
 
1163
1163
  if (hide) {
1164
1164
  previousSectorsRef.current = null;
1165
1165
  }
1166
1166
 
1167
- return <CellsContext.Provider value={cellRegistry}>
1167
+ return <CellsContext value={cellRegistry}>
1168
1168
  <SetPiePayloadLegend cells={cells} id={id} />
1169
1169
  <ZIndexLayer zIndex={props.zIndex}>
1170
1170
  <SetPieTooltipEntrySettings
@@ -1191,7 +1191,7 @@ function PieImpl(props: WithIdRequired<PropsWithResolvedDefaults>) {
1191
1191
  : props.children}
1192
1192
  </Layer>
1193
1193
  </ZIndexLayer>
1194
- </CellsContext.Provider>;
1194
+ </CellsContext>;
1195
1195
  }
1196
1196
 
1197
1197
  type PropsWithResolvedDefaults = RequiresDefaultProps<Props, typeof defaultPieProps>;
@@ -687,7 +687,7 @@ function RadialBarImpl(props: WithIdRequired<PropsWithDefaults>) {
687
687
  ),
688
688
  ) ??
689
689
  STABLE_EMPTY_ARRAY;
690
- return <CellsContext.Provider value={cellRegistry}>
690
+ return <CellsContext value={cellRegistry}>
691
691
  <SetRadialBarTooltipEntrySettings
692
692
  dataKey={props.dataKey}
693
693
  sectors={sectors}
@@ -701,7 +701,7 @@ function RadialBarImpl(props: WithIdRequired<PropsWithDefaults>) {
701
701
  id={props.id}
702
702
  />
703
703
  <RadialBarWithState {...props} sectors={sectors} />
704
- </CellsContext.Provider>;
704
+ </CellsContext>;
705
705
  }
706
706
 
707
707
  export const defaultRadialBarProps = {