@@ -23,8 +23,8 @@ export class ChartExtraHighlight {
2323 // We keep track of the previously highlighted series and points to recover highlight state if needed.
2424 // The recover is necessary if the chart was re-rendered while the highlighting is set. For example,
2525 // when triggered a state update from the consumer-provided tooltip footer action.
26- private seriesState = new Map < string , Highcharts . SeriesStateValue > ( ) ;
27- private pointState = new Map < string , Map < string , Highcharts . SeriesStateValue > > ( ) ;
26+ private seriesState = new Map < string , "" | Highcharts . SeriesStateValue > ( ) ;
27+ private pointState = new Map < string , Map < string , "" | Highcharts . PointStateValue > > ( ) ;
2828
2929 public onChartRender ( ) {
3030 this . overrideStateSetters ( ) ;
@@ -42,7 +42,7 @@ export class ChartExtraHighlight {
4242 }
4343 }
4444 } else {
45- this . setSeriesState ( s , itemIds . includes ( getSeriesId ( s ) ) ? "normal " : "inactive" ) ;
45+ this . setSeriesState ( s , itemIds . includes ( getSeriesId ( s ) ) ? "" : "inactive" ) ;
4646 }
4747 }
4848 setPlotLinesState ( this . context . chart ( ) , ( lineId ) => itemIds . includes ( lineId ) ) ;
@@ -61,12 +61,12 @@ export class ChartExtraHighlight {
6161 includedSeriesIds . add ( getSeriesId ( point . series ) ) ;
6262 } ) ;
6363 for ( const s of this . context . chart ( ) . series ) {
64- this . setSeriesState ( s , includedSeries . has ( s ) ? "normal " : "inactive" ) ;
64+ this . setSeriesState ( s , includedSeries . has ( s ) ? "" : "inactive" ) ;
6565 // We use special handling for column- series to make stacks or groups of columns that have a shared X highlighted.
6666 // See: https://github.com/highcharts/highcharts/issues/23076.
6767 if ( s . type === "column" ) {
6868 for ( const d of s . data ) {
69- this . setPointState ( d , includedPoints . has ( d ) ? "normal " : "inactive" ) ;
69+ this . setPointState ( d , includedPoints . has ( d ) ? "" : "inactive" ) ;
7070 }
7171 }
7272 }
@@ -89,7 +89,7 @@ export class ChartExtraHighlight {
8989 // We override point state that could have been set for columns using this.highlightChartGroup().
9090 else if ( s . type === "column" ) {
9191 for ( const d of s . data ) {
92- this . setPointState ( d , "normal " ) ;
92+ this . setPointState ( d , "" ) ;
9393 }
9494 }
9595 }
@@ -99,24 +99,24 @@ export class ChartExtraHighlight {
9999 // Removes dimmed state from all series and points.
100100 public clearChartItemsHighlight = ( ) => {
101101 for ( const s of this . context . chart ( ) . series ?? [ ] ) {
102- this . setSeriesState ( s , "normal " ) ;
102+ this . setSeriesState ( s , "" ) ;
103103 for ( const p of s . data ) {
104- this . setPointState ( p , "normal " ) ;
104+ this . setPointState ( p , "" ) ;
105105 }
106106 }
107107 setPlotLinesState ( this . context . chart ( ) , ( ) => true ) ;
108108 } ;
109109
110110 // Makes the specified series active or dimmed.
111- private setSeriesState ( series : Highcharts . Series , state : Highcharts . SeriesStateValue ) {
111+ private setSeriesState ( series : Highcharts . Series , state : "" | Highcharts . SeriesStateValue ) {
112112 ( series . setState as SeriesSetStateWithLock ) [ SET_STATE_LOCK ] = false ;
113113 series . setState ( state , false ) ;
114114 this . updateStoredSeriesState ( series , state ) ;
115115 ( series . setState as SeriesSetStateWithLock ) [ SET_STATE_LOCK ] = true ;
116116 }
117117
118118 // Makes the specified point active or dimmed.
119- private setPointState ( point : Highcharts . Point , state : Highcharts . PointStateValue ) {
119+ private setPointState ( point : Highcharts . Point , state : "" | Highcharts . PointStateValue ) {
120120 ( point . setState as PointSetStateWithLock ) [ SET_STATE_LOCK ] = false ;
121121 point . setState ( state , true ) ;
122122 this . updateStoredPointState ( point , state ) ;
@@ -144,11 +144,11 @@ export class ChartExtraHighlight {
144144 setPlotLinesState ( this . context . chart ( ) , ( lineId ) => ! inactiveSeriesIds . has ( lineId ) ) ;
145145 }
146146
147- private updateStoredSeriesState ( series : Highcharts . Series , state : Highcharts . SeriesStateValue ) {
147+ private updateStoredSeriesState ( series : Highcharts . Series , state : "" | Highcharts . SeriesStateValue ) {
148148 this . seriesState . set ( getSeriesId ( series ) , state ) ;
149149 }
150150
151- private updateStoredPointState ( point : Highcharts . Point , state : Highcharts . PointStateValue ) {
151+ private updateStoredPointState ( point : Highcharts . Point , state : "" | Highcharts . PointStateValue ) {
152152 const pointStateInSeries = this . pointState . get ( getSeriesId ( point . series ) ) ?? new Map ( ) ;
153153 pointStateInSeries . set ( this . getPointKey ( point ) , state ) ;
154154 this . pointState . set ( getSeriesId ( point . series ) , pointStateInSeries ) ;
0 commit comments