Skip to content

Commit 7b3e7b6

Browse files
committed
added interface and typescript for BarGraph.tsx
1 parent 242a6c0 commit 7b3e7b6

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/app/components/BarGraph.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @ts-nocheck
22
import React, { useEffect, useState } from 'react';
3-
import { BarStack, Bar } from '@visx/shape';
3+
import { BarStack } from '@visx/shape';
44
import { SeriesPoint } from '@visx/shape/lib/types';
55
import { Group } from '@visx/group';
66
import { Grid } from '@visx/grid';
@@ -43,6 +43,18 @@ interface TooltipData {
4343
color: string;
4444
}
4545

46+
interface BarGraphProps {
47+
width: number,
48+
height: number,
49+
data: Record<string, unknown>,
50+
comparison: unknown,
51+
setRoute: unknown,
52+
allRoutes: unknown,
53+
filteredSnapshots: unknown,
54+
snapshot: unknown,
55+
setSnapshot: unknown
56+
}
57+
4658
/* DEFAULTS */
4759
const margin = {
4860
top: 30, right: 30, bottom: 0, left: 50,
@@ -59,7 +71,7 @@ const tooltipStyles = {
5971
fontFamily: 'Roboto',
6072
};
6173

62-
const BarGraph = props => {
74+
const BarGraph = (props: BarGraphProps): unknown => {
6375
const [{ tabs, currentTab }, dispatch] = useStoreContext();
6476
const {
6577
width,
@@ -70,7 +82,7 @@ const BarGraph = props => {
7082
allRoutes,
7183
filteredSnapshots,
7284
snapshot,
73-
setSnapshot
85+
setSnapshot,
7486
} = props;
7587
const [seriesNameInput, setSeriesNameInput] = useState(`Series ${comparison.length + 1}`);
7688
const {

0 commit comments

Comments
 (0)