Skip to content

Commit 21570bb

Browse files
Samuel  TranSamuel  Tran
authored andcommitted
Merge branch 'dev' into samtran/feature
2 parents 69acc74 + a1ab6e5 commit 21570bb

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/app/components/FrontendTypes.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export interface BarGraphBase {
5757
width: number,
5858
height: number,
5959
data: PerfData,
60-
comparison: string | Series[],
60+
comparison: Series[] | string,
6161
}
6262

6363
export interface BarGraphComparisonProps extends BarGraphBase {

src/app/components/StateRoute/PerformanceVisx/BarGraphComparison.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { useStoreContext } from '../../../store';
2020
import {
2121
snapshot, TooltipData, margin, BarGraphComparisonProps, ActionObj,
2222
} from '../../FrontendTypes';
23+
import { BarStack } from '@visx/shape/lib/types';
2324

2425
/* DEFAULTS */
2526
const 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

Comments
 (0)