@@ -20,6 +20,7 @@ import { useStoreContext } from '../../../store';
2020import {
2121 snapshot , TooltipData , margin , BarGraphComparisonProps , ActionObj ,
2222} from '../../FrontendTypes' ;
23+ import { BarStack } from '@visx/shape/lib/types' ;
2324
2425/* DEFAULTS */
2526const margin : margin = {
@@ -136,7 +137,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
136137
137138 const classes = useStyles ( ) ;
138139
139- const handleSeriesChange = event => {
140+ const handleSeriesChange = ( event : Event ) => {
140141 if ( ! event ) return ;
141142 setSeries ( event . target . value ) ;
142143 setAction ( false ) ;
@@ -150,7 +151,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
150151 setOpen ( true ) ;
151152 } ;
152153
153- const handleActionChange = event => {
154+ const handleActionChange = ( event : Event ) => {
154155 if ( ! event . target . value ) return ;
155156 setAction ( event . target . value ) ;
156157 setSeries ( false ) ;
@@ -166,7 +167,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
166167
167168 // manually assignin X -axis points with tab ID.
168169 function setXpointsComparison ( ) {
169- comparison [ series ] . data . barStack . forEach ( elem => {
170+ comparison [ series ] . data . barStack . forEach ( ( elem : ActionObj ) => {
170171 elem . currentTab = 'comparison' ;
171172 } ) ;
172173 return comparison [ series ] . data . barStack ;
@@ -177,7 +178,7 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
177178 } ) ;
178179 return data . barStack ;
179180 }
180- const animateButton = e => {
181+ const animateButton = ( e : MouseEvent ) => {
181182 e . preventDefault ( ) ;
182183 e . target . classList . add ( 'animate' ) ;
183184 e . target . innerHTML = 'Deleted!' ;
@@ -190,9 +191,9 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
190191 for ( let i = 0 ; i < classname . length ; i += 1 ) {
191192 classname [ i ] . addEventListener ( 'click' , animateButton , false ) ;
192193 }
193- const seriesList = comparison . map ( elem => elem . data . barStack ) ;
194- const actionsList = seriesList . flat ( ) ;
195- const testList = actionsList . map ( elem => elem . name ) ;
194+ const seriesList : ActionObj [ ] [ ] = comparison . map ( ( series : Series ) => series . data . barStack ) ;
195+ const actionsList : ActionObj [ ] = seriesList . flat ( ) ;
196+ const testList : string [ ] = actionsList . map ( ( elem : ActionObj ) => elem . name ) ;
196197
197198 const finalList = [ ] ;
198199 for ( let i = 0 ; i < testList . length ; i += 1 ) {
0 commit comments