Skip to content

Commit ed65fc7

Browse files
committed
Codebase Cleanup
1 parent 41a2aab commit ed65fc7

File tree

12 files changed

+107
-172
lines changed

12 files changed

+107
-172
lines changed

src/app/components/BarGraph.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { scaleBand, scaleLinear, scaleOrdinal } from '@visx/scale';
99
import { useTooltip, useTooltipInPortal, defaultStyles } from '@visx/tooltip';
1010
import { Text } from '@visx/text';
1111
import { schemeSet3 } from 'd3-scale-chromatic';
12-
import snapshots from './snapshots';
1312
import { onHover, onHoverExit } from '../actions/actions';
1413
import { useStoreContext } from '../store';
1514
import { save } from '../actions/actions';

src/app/components/BarGraphComparison.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// @ts-nocheck
2-
import React, { useEffect, useForceUpdate } from 'react';
2+
import React from 'react';
33
import { BarStack } from '@visx/shape';
44
import { SeriesPoint } from '@visx/shape/lib/types';
55
import { Group } from '@visx/group';
@@ -8,15 +8,11 @@ import { AxisBottom, AxisLeft } from '@visx/axis';
88
import { scaleBand, scaleLinear, scaleOrdinal } from '@visx/scale';
99
import { useTooltip, useTooltipInPortal, defaultStyles } from '@visx/tooltip';
1010
import { Text } from '@visx/text';
11-
1211
import { schemeSet3 } from 'd3-scale-chromatic';
1312
import { makeStyles } from '@material-ui/core/styles';
1413
import Select from '@material-ui/core/Select';
15-
import InputLabel from '@material-ui/core/InputLabel';
1614
import MenuItem from '@material-ui/core/MenuItem';
1715
import FormControl from '@material-ui/core/FormControl';
18-
import FormHelperText from '@material-ui/core/FormHelperText';
19-
import snapshots from './snapshots';
2016
import { onHover, onHoverExit } from '../actions/actions';
2117
import { useStoreContext } from '../store';
2218
import { deleteSeries } from '../actions/actions';

src/app/components/WebMetrics.tsx

Lines changed: 96 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,102 @@
1-
import React, { useState, useEffect, Component } from 'react';
1+
import React from 'react';
22
import Charts from 'react-apexcharts';
3-
import useForceUpdate from './useForceUpdate';
43

54
const radialGraph = (props) => {
5+
const state = {
6+
series: [props.series],
7+
options: {
8+
colors: [props.color],
9+
chart: {
10+
height: 100,
11+
width: 100,
12+
type: 'radialBar',
13+
toolbar: {
14+
show: false,
15+
},
16+
},
17+
plotOptions: {
18+
radialBar: {
19+
startAngle: -135,
20+
endAngle: 135,
21+
hollow: {
22+
margin: 0,
23+
size: '75%',
24+
background: '#242529',
25+
image: undefined,
26+
imageOffsetX: 0,
27+
imageOffsetY: 0,
28+
position: 'front',
29+
dropShadow: {
30+
enabled: false,
31+
top: 3,
32+
left: 0,
33+
blur: 4,
34+
opacity: 0.24,
35+
},
36+
},
37+
track: {
38+
background: '#fff',
39+
strokeWidth: '3%',
40+
margin: 0, // margin is in pixels
41+
dropShadow: {
42+
enabled: true,
43+
top: -3,
44+
left: 0,
45+
blur: 4,
46+
opacity: 0.35,
47+
},
48+
},
649

7-
const state = {
8-
9-
series: [props.series],
10-
options: {
11-
colors: [props.color],
12-
chart: {
13-
height: 100,
14-
width: 100,
15-
type: 'radialBar',
16-
toolbar: {
17-
show: false,
18-
}
19-
},
20-
plotOptions: {
21-
radialBar: {
22-
startAngle: -135,
23-
endAngle: 135,
24-
hollow: {
25-
margin: 0,
26-
size: '75%',
27-
background: '#242529',
28-
image: undefined,
29-
imageOffsetX: 0,
30-
imageOffsetY: 0,
31-
position: 'front',
32-
dropShadow: {
33-
enabled: false,
34-
top: 3,
35-
left: 0,
36-
blur: 4,
37-
opacity: 0.24
38-
}
39-
},
40-
track: {
41-
background: '#fff',
42-
strokeWidth: '3%',
43-
margin: 0, // margin is in pixels
44-
dropShadow: {
45-
enabled: true,
46-
top: -3,
47-
left: 0,
48-
blur: 4,
49-
opacity: 0.35
50-
}
51-
},
52-
53-
dataLabels: {
54-
show: true,
55-
name: {
56-
offsetY: -10,
57-
show: true,
58-
color: '#fff',
59-
fontSize: '24px'
60-
},
61-
value: {
62-
formatter: props.formatted,
63-
color: '#fff',
64-
fontSize: '16px',
65-
show: true,
66-
}
67-
}
68-
}
69-
},
70-
fill: {
71-
type: 'solid',
72-
gradient: {
73-
shade: 'dark',
74-
type: 'horizontal',
75-
shadeIntensity: 0.1,
76-
gradientToColors: [props.color],
77-
inverseColors: false,
78-
opacityFrom: 1,
79-
opacityTo: 1,
80-
stops: [0, 100]
81-
}
82-
},
83-
stroke: {
84-
lineCap: 'flat'
85-
},
86-
labels: [props.label],
87-
},
88-
};
50+
dataLabels: {
51+
show: true,
52+
name: {
53+
offsetY: -10,
54+
show: true,
55+
color: '#fff',
56+
fontSize: '24px',
57+
},
58+
value: {
59+
formatter: props.formatted,
60+
color: '#fff',
61+
fontSize: '16px',
62+
show: true,
63+
},
64+
},
65+
},
66+
},
67+
fill: {
68+
type: 'solid',
69+
gradient: {
70+
shade: 'dark',
71+
type: 'horizontal',
72+
shadeIntensity: 0.1,
73+
gradientToColors: [props.color],
74+
inverseColors: false,
75+
opacityFrom: 1,
76+
opacityTo: 1,
77+
stops: [0, 100],
78+
},
79+
},
80+
stroke: {
81+
lineCap: 'flat',
82+
},
83+
labels: [props.label],
84+
},
85+
};
8986

87+
return (
88+
<div id='card'>
89+
<div id='chart'>
90+
<Charts
91+
options={state.options}
92+
series={state.series}
93+
type='radialBar'
94+
height={250}
95+
width={250}
96+
/>
97+
</div>
98+
</div>
99+
);
100+
};
90101

91-
return (
92-
93-
94-
<div id="card">
95-
<div id="chart">
96-
<Charts options={state.options} series={state.series} type="radialBar" height={250} width={250}/>
97-
</div>
98-
</div>
99-
100-
)
101-
}
102-
103-
104-
export default radialGraph;
102+
export default radialGraph;

src/app/containers/ActionContainer.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// @ts-nocheck
22
import React from 'react';
3-
import { diff } from 'jsondiffpatch';
43
import Action from '../components/Action';
54
import SwitchAppDropdown from '../components/SwitchApp';
6-
75
import { emptySnapshots, changeView, changeSlider } from '../actions/actions';
86
import { useStoreContext } from '../store';
97
import { useEffect } from 'react';

src/app/containers/ButtonsContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// @ts-nocheck
22
import React from 'react';
3-
43
import { importSnapshots, toggleMode } from '../actions/actions';
54
import { useStoreContext } from '../store';
65
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';

src/app/containers/StateContainer.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,21 +47,6 @@ const StateContainer = (props: StateContainerProps): JSX.Element => {
4747
<div className='state-container'>
4848
<div className='main-navbar-container'>
4949
<div className='main-navbar-text'>
50-
{' '}
51-
{/* <button
52-
id='side-bar-button'
53-
className='toggleAC'
54-
onClick={() => toggleActionContainer()}
55-
>
56-
Close
57-
</button> */}
58-
{/* <div className='toggleAC'>
59-
<aside className='no-aside'>
60-
<a className='toggle'>
61-
<i></i>
62-
</a>
63-
</aside>
64-
</div> */}
6550
</div>
6651
<div className='main-navbar'>
6752
<NavLink

src/app/reducers/mainReducer.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,23 @@ export default (state, action) =>
3131
};
3232

3333
switch (action.type) {
34+
// Save case will store the series user wants to save to the chrome local storage
3435
case types.SAVE: {
3536
const data = JSON.stringify(action.payload);
3637
localStorage.setItem(`${action.payload.currentTab}`, data);
3738
break;
3839
}
40+
// Delete case will delete ALL stored series in chrome local storage. To see chrome storage related data
41+
// Chrome Extension Manager (chrome:extensions) --> background page link --> Application Tab
3942
case types.DELETE_SERIES: {
4043
const allStorage = () => {
4144
const keys = Object.keys(localStorage);
4245
let i = keys.length;
4346
while (i--) {
4447
localStorage.removeItem(keys[i]);
4548
}
46-
//return values;
4749
};
4850
allStorage();
49-
5051
Object.keys(tabs).forEach((tab) => {
5152
tabs[tab] = {
5253
...tabs[tab],

src/app/styles/components/_buttons.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ aside {
315315
position: relative;
316316
margin-top: 1rem;
317317
}
318-
318+
/* toggle i handles arrow animation */
319319
.toggle i,
320320
.toggle i::after,
321321
.toggle i::before {
@@ -364,4 +364,5 @@ aside {
364364
height: 20px !important;
365365
margin-bottom: 40px;
366366
margin-right: 20px;
367-
}
367+
}
368+
/* ^ sidebar button open and closing functionality */

src/app/styles/layout/_stateContainer.scss

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,20 +161,9 @@
161161
.performance-nav-bar-container {
162162
background-color: $navbar-color;
163163
display: flex;
164-
// flex-direction: row;
165-
// justify-content: start;
166-
// align-items: center;
167164
height: 30px;
168165
}
169166

170-
// .router-link-performance {
171-
// width: 34%;
172-
// // justify-content: center;
173-
// // align-items: center;
174-
// background-color: $medium-background-color;
175-
// text-decoration: none;
176-
// color: $text-color;
177-
// }
178167
.router-link-performance {
179168
height: 100%;
180169
width: 34%;
@@ -196,14 +185,9 @@
196185

197186
// Web Metrics Container
198187
.web-metrics-container {
199-
200-
// padding: 3rem;
201-
// display: grid;
202188
display: flex;
203189
align-items: center;
204190
justify-content: center;
205191
flex-wrap: wrap;
206192
margin-top: 3rem;
207-
// grid-template-columns: repeat(2, 1fr);
208-
// grid-template-rows: repeat(2, 1fr);
209-
}
193+
}

src/backend/index.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,6 @@ const mode: Mode = {
2929
const linkFiber = linkFiberStart(snapShot, mode);
3030
const timeJump = timeJumpStart(snapShot, mode);
3131

32-
// function getRouteURL(node: SnapshotNode): string {
33-
// if (node.name === 'Router') {
34-
// return node.state.location.pathname;
35-
// }
36-
// if (node.children && node.children.length >= 1) {
37-
// const tempNode: any[] = node.children;
38-
// for (let index = 0; index < tempNode.length; index += 1) {
39-
// return getRouteURL(tempNode[index]); // Carlos: ???
40-
// }
41-
// }
42-
// }
43-
4432
// * Event listener for time-travel actions
4533
window.addEventListener('message', ({ data: { action, payload } }: MsgData) => {
4634
switch (action) {

0 commit comments

Comments
 (0)