Skip to content

Commit

Permalink
[@mantine/chart] Fix incorrect types for props passed down to rechar…
Browse files Browse the repository at this point in the history
…ts components (#6820)

* fix: chart props to take partials

* fix: linting

---------

Co-authored-by: Vitaly Rtishchev <rtivital@gmail.com>
  • Loading branch information
Jones-Griffin and rtivital authored Sep 25, 2024
1 parent d9994f5 commit 2ee78ab
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/@mantine/charts/src/BubbleChart/BubbleChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export interface BubbleChartProps
tooltipProps?: Omit<TooltipProps<any, any>, 'ref'>;

/** Props passed down to the `Scatter` component */
scatterProps?: Omit<ScatterProps, 'ref'>;
scatterProps?: Partial<Omit<ScatterProps, 'ref'>>;

/** Color of the text displayed inside the chart, `'dimmed'` by default */
textColor?: MantineColor;
Expand Down
2 changes: 1 addition & 1 deletion packages/@mantine/charts/src/DonutChart/DonutChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export interface DonutChartProps
tooltipProps?: Omit<TooltipProps<any, any>, 'ref'>;

/** Props passed down to recharts `Pie` component */
pieProps?: Omit<PieProps, 'ref'>;
pieProps?: Partial<Omit<PieProps, 'ref'>>;

/** Controls color of the segments stroke, by default depends on color scheme */
strokeColor?: MantineColor;
Expand Down
2 changes: 1 addition & 1 deletion packages/@mantine/charts/src/PieChart/PieChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export interface PieChartProps
tooltipProps?: Omit<TooltipProps<any, any>, 'ref'>;

/** Props passed down to recharts `Pie` component */
pieProps?: Omit<PieProps, 'ref'>;
pieProps?: Partial<Omit<PieProps, 'ref'>>;

/** Controls color of the segments stroke, by default depends on color scheme */
strokeColor?: MantineColor;
Expand Down
4 changes: 3 additions & 1 deletion packages/@mantine/charts/src/RadarChart/RadarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export interface RadarChartProps
withPolarRadiusAxis?: boolean;

/** Props passed down to recharts Radar component */
radarProps?: ((series: RadarChartSeries) => Omit<RadarProps, 'ref'>) | Omit<RadarProps, 'ref'>;
radarProps?:
| ((series: RadarChartSeries) => Partial<Omit<RadarProps, 'ref'>>)
| Partial<Omit<RadarProps, 'ref'>>;

/** Props passed down to recharts RadarChart component */
radarChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsRadarChart>;
Expand Down
2 changes: 1 addition & 1 deletion packages/@mantine/charts/src/ScatterChart/ScatterChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export interface ScatterChartProps
scatterChartProps?: React.ComponentPropsWithoutRef<typeof ReChartsScatterChart>;

/** Props passed down to recharts `Scatter` component */
scatterProps?: Omit<ScatterProps, 'ref'>;
scatterProps?: Partial<Omit<ScatterProps, 'ref'>>;

/** If set, displays labels next to points for the given axis */
pointLabels?: 'x' | 'y';
Expand Down

0 comments on commit 2ee78ab

Please sign in to comment.