UNPKG

@mui/x-charts

Version:

The community edition of MUI X Charts components.

65 lines 2.33 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import * as React from 'react'; import PropTypes from 'prop-types'; import { useRadarSeriesData } from "./useRadarSeriesData.js"; import { useInteractionAllItemProps } from "../../hooks/useInteractionItemProps.js"; import { useItemHighlightedGetter } from "../../hooks/useItemHighlightedGetter.js"; import { useUtilityClasses } from "./radarSeriesPlotClasses.js"; import { getPathProps } from "./RadarSeriesArea.js"; import { getCircleProps } from "./RadarSeriesMarks.js"; import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; function RadarSeriesPlot(props) { const seriesCoordinates = useRadarSeriesData(props.seriesId); const interactionProps = useInteractionAllItemProps(seriesCoordinates); const { isFaded, isHighlighted } = useItemHighlightedGetter(); const classes = useUtilityClasses(props.classes); return /*#__PURE__*/_jsx("g", { className: classes.root, children: seriesCoordinates?.map(({ seriesId, points, color, hideMark, fillArea }, seriesIndex) => { return /*#__PURE__*/_jsxs("g", { children: [/*#__PURE__*/_jsx("path", _extends({}, getPathProps({ seriesId, points, color, fillArea, isFaded, isHighlighted, classes }), interactionProps[seriesIndex]), seriesId), !hideMark && points.map((point, index) => /*#__PURE__*/_jsx("circle", _extends({}, getCircleProps({ seriesId, point, color, fillArea, isFaded, isHighlighted, classes })), index))] }, seriesId); }) }); } process.env.NODE_ENV !== "production" ? RadarSeriesPlot.propTypes = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the TypeScript types and run "pnpm proptypes" | // ---------------------------------------------------------------------- /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * The id of the series to display. * If undefined all series are displayed. */ seriesId: PropTypes.string } : void 0; export { RadarSeriesPlot };