@mui/x-charts
Version:
The community edition of MUI X Charts components.
15 lines • 610 B
JavaScript
/**
* Cleans an identifier by extracting only type, seriesId, and dataIndex properties.
* This is the common cleaner for most series types (bar, line, pie, scatter, radar, etc.).
*
* The generic constraint ensures this can only be used for series types whose
* identifier actually includes `dataIndex`. Series types with different identifier
* properties (like heatmap's xIndex/yIndex) must provide their own cleaner.
*/
export const identifierCleanerSeriesIdDataIndex = identifier => {
return {
type: identifier.type,
seriesId: identifier.seriesId,
dataIndex: identifier.dataIndex
};
};