@@ -7,12 +7,7 @@ import { useXAxes, useYAxes } from '../hooks';
77import { useZAxes } from '../hooks/useZAxis' ;
88import { seriesConfig as scatterSeriesConfig } from './seriesConfig' ;
99import { BatchScatter } from './BatchScatter' ;
10-
11- declare module '@mui/x-charts/typeAugmentation' {
12- interface ChartsEnabledFeature {
13- colorCallback : true ;
14- }
15- }
10+ import { SeriesColorProp } from '../models/seriesType/common' ;
1611
1712export interface ScatterPlotSlots extends ScatterSlots {
1813 scatter ?: React . JSXElementConstructor < ScatterProps > ;
@@ -80,6 +75,9 @@ function ScatterPlot(props: ScatterPlotProps) {
8075 { seriesOrder . map ( ( seriesId ) => {
8176 const { id, xAxisId, yAxisId, zAxisId, color } = series [ seriesId ] ;
8277
78+ // FIXME: V9: remove this cast as it will no longer be necessary
79+ const seriesColor = color as SeriesColorProp < number | null > ;
80+
8381 const colorGetter = scatterSeriesConfig . colorProcessor (
8482 series [ seriesId ] ,
8583 xAxis [ xAxisId ?? defaultXAxisId ] ,
@@ -93,7 +91,7 @@ function ScatterPlot(props: ScatterPlotProps) {
9391 key = { id }
9492 xScale = { xScale }
9593 yScale = { yScale }
96- color = { typeof color === 'function' ? color ( null ) : color }
94+ color = { typeof seriesColor === 'function' ? seriesColor ( null ) : seriesColor }
9795 colorGetter = { colorGetter }
9896 series = { series [ seriesId ] }
9997 onItemClick = { onItemClick }
0 commit comments