@mui/x-charts
Version:
The community edition of MUI X Charts components.
76 lines (75 loc) • 1.76 kB
JavaScript
'use client';
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
const _excluded = ["apiRef", "series", "radar", "width", "height", "margin", "colors", "sx", "children", "slots", "slotProps", "skipAnimation", "loading", "highlightedItem", "onHighlightChange", "hideLegend", "divisions", "shape", "stripeColor", "highlight", "showToolbar"];
/**
* A helper function that extracts RadarChartProps from the input props
* and returns an object with props for the children components of RadarChart.
*
* @param props The input props for RadarChart
* @returns An object with props for the children components of RadarChart
*/
export const useRadarChartProps = props => {
const {
apiRef,
series,
radar,
width,
height,
margin,
colors,
sx,
children,
slots,
slotProps,
skipAnimation,
loading,
highlightedItem,
onHighlightChange,
divisions,
shape,
stripeColor,
highlight = 'axis'
} = props,
other = _objectWithoutPropertiesLoose(props, _excluded);
const radarDataProviderProps = {
apiRef,
series,
radar,
highlight,
width,
height,
margin,
colors,
highlightedItem,
onHighlightChange,
skipAnimation
};
const overlayProps = {
slots,
slotProps,
loading
};
const legendProps = {
slots,
slotProps
};
const chartsWrapperProps = {
sx
};
const radarGrid = {
divisions,
shape,
stripeColor
};
const chartsSurfaceProps = other;
return {
highlight,
chartsWrapperProps,
chartsSurfaceProps,
radarDataProviderProps,
radarGrid,
overlayProps,
legendProps,
children
};
};