@@ -12,9 +12,13 @@ import { makeStyles } from '@material-ui/core/styles';
12
12
import Select from '@material-ui/core/Select' ;
13
13
import MenuItem from '@material-ui/core/MenuItem' ;
14
14
import FormControl from '@material-ui/core/FormControl' ;
15
- import { onHover , onHoverExit , deleteSeries , setCurrentTabInApp } from '../../../actions/actions' ;
15
+ import {
16
+ onHover , onHoverExit , deleteSeries , setCurrentTabInApp ,
17
+ } from '../../../actions/actions' ;
16
18
import { useStoreContext } from '../../../store' ;
17
- import { snapshot , TooltipData , margin , BarGraphComparisonProps } from '../../FrontendTypes' ;
19
+ import {
20
+ snapshot , TooltipData , margin , BarGraphComparisonProps ,
21
+ } from '../../FrontendTypes' ;
18
22
19
23
/* DEFAULTS */
20
24
const margin = {
@@ -78,15 +82,15 @@ const BarGraphComparison = (props: BarGraphComparisonProps): JSX.Element => {
78
82
// We'll then use it in the renderingScale function and compare
79
83
// with the render time of the current tab.
80
84
// The max render time will determine the Y-axis's highest number.
81
- const calculateMaxTotalRender = serie => {
82
- const currentSeriesBarStacks = ! comparison [ serie ]
85
+ const calculateMaxTotalRender = ( serie : string ) => {
86
+ const currentSeriesBarStacks : number [ ] = ! comparison [ serie ]
83
87
? [ ]
84
88
: comparison [ serie ] . data . barStack ;
85
89
if ( currentSeriesBarStacks . length === 0 ) return 0 ;
86
90
let currentMax = - Infinity ;
87
91
for ( let i = 0 ; i < currentSeriesBarStacks . length ; i += 1 ) {
88
92
const renderTimes = Object . values ( currentSeriesBarStacks [ i ] ) . slice ( 1 ) ;
89
- const renderTotal = renderTimes . reduce ( ( acc , curr ) => acc + curr ) ;
93
+ const renderTotal : number = renderTimes . reduce ( ( acc , curr ) => acc + curr ) ;
90
94
if ( renderTotal > currentMax ) currentMax = renderTotal ;
91
95
}
92
96
return currentMax ;
0 commit comments