UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

83 lines (82 loc) 2.05 kB
"use strict"; 'use client'; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default; Object.defineProperty(exports, "__esModule", { value: true }); exports.useRadarChartProps = void 0; var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/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 */ 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 = (0, _objectWithoutPropertiesLoose2.default)(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 }; }; exports.useRadarChartProps = useRadarChartProps;