Skip to content

Commit ba7c05c

Browse files
committed
merging from remote DEV branch
2 parents c433fae + 433cea3 commit ba7c05c

31 files changed

+367
-406
lines changed

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
},
3434
"contributors": [
3535
"Abaas Khorrami",
36+
"Alex Gomez",
37+
"Alexander Landeros",
3638
"Ali Rahman",
3739
"Andy Tsou",
3840
"Andy Wong",
@@ -43,52 +45,71 @@
4345
"Caner Demir",
4446
"Carlos Perez",
4547
"Chris Flannery",
48+
"Chris Guizzetti",
4649
"Christopher LeBrett",
4750
"Cole Styron",
51+
"Daljit Gill",
52+
"Dane Corpion",
53+
"David Bernstein",
4854
"David Chai",
4955
"David Kim",
5056
"Dennis Lopez",
57+
"Edar Liu",
5158
"Edwin Menendez",
59+
"Eivind Del Fierro",
5260
"Ergi Shehu",
5361
"Eric Yun",
5462
"Freya Wu",
5563
"Gabriela Jardim Aquino",
5664
"Gregory Panciera",
5765
"Haejin Jo",
66+
"Harry Fox",
5867
"Hien Nguyen",
5968
"Jack Crish",
6069
"Jackie Yuan",
6170
"James McCollough",
6271
"James Nghiem",
6372
"Jasmine Noor",
73+
"Jason Victor",
6474
"Joseph Park",
75+
"Joseph Stern",
6576
"Josh Kim",
6677
"Joshua Howard",
6778
"Kevin Fey",
6879
"Kevin HoEun Lee",
6980
"Kevin Ngo",
7081
"Kim Mai Nguyen",
82+
"Kris Sorensen",
83+
"Kristina Wallen",
84+
"Kyle Bell",
7185
"Lance Ziegler",
7286
"Lina Shin",
7387
"Mark Teets",
7488
"Mike Bednarz",
7589
"Minzo Kim",
90+
"Morah Geist",
7691
"Nathanael Wa Mwenze",
92+
"Nathan Richardson",
7793
"Ngoc Zwolinski",
7894
"Nick Huemmer",
7995
"Peter Lam",
8096
"Prasanna Malla",
97+
"Quan Le",
8198
"Rajeeb Banstola",
8299
"Raymond Kwan",
83100
"Robby Tipton",
101+
"Robert Maeda",
84102
"Rocky Lin",
85103
"Ruth Anam",
86104
"Ryan Dang",
87105
"Sergei Liubchenko",
106+
"Sean Kelly",
88107
"Sierra Swaby",
89108
"Tania Lind",
90109
"Viet Nguyen",
110+
"Vincent Nguyen",
91111
"Wilton Lee",
112+
"Yididia Ketema",
92113
"Yujin Kang",
93114
"Zachary Freeman"
94115
],

src/app/components/Action.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ import { ActionProps, OptionsCursorTrueWithMargin } from '../FrontendTypes';
2929
const Action = (props: ActionProps): JSX.Element => {
3030
// We destructure the 'props' that were passed into this component
3131
const {
32-
selected, // boolean on whether the current index is the same as the viewIndex from 'ActionContainer'
33-
last, // boolean on (whether the view index is less than 0) AND if (the index is the same as the last snapshot's index value in hierarchyArr) from 'ActionContainer'
32+
selected, // boolean on whether the current index is the same as the viewIndex in 'ActionContainer'
33+
last, // boolean on (whether the view index is less than 0) AND if (the index is the same as the last snapshot's index value in hierarchyArr) in 'ActionContainer'
3434
index, // from snapshot.index in "ActionContainer's" 'hierarchyArr'
35-
sliderIndex, // from tabs[currentTab] object from 'ActionContainer'
35+
sliderIndex, // from tabs[currentTab] object in 'ActionContainer'
3636
dispatch,
3737
displayName, // from snapshot.displayName in "ActionContainer's" 'hierarchyArr'
3838
componentData, // from snapshot.componentData in "ActionContainer's" 'hierarchyArr'
39-
viewIndex, // from tabs[currentTab] object from 'ActionContainer'
39+
viewIndex, // from tabs[currentTab] object in 'ActionContainer'
4040
isCurrIndex,
4141
handleOnkeyDown, // function that allows arrows keys to jump between snapshots defined in 'ActionContainer.tsx'
4242
} = props;

src/app/components/Loader.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import React from 'react';
44
import { ClipLoader } from 'react-spinners';
5-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
6-
import { faCheck, faExclamationCircle } from '@fortawesome/free-solid-svg-icons';
5+
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
6+
import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline';
77

88
/*
99
This file is what decides what icon (loading, checkmark, exclamation point) is displayed next to the checks in the ErrorContainer loading screen:
@@ -15,9 +15,9 @@ This file is what decides what icon (loading, checkmark, exclamation point) is d
1515

1616
const handleResult = (result: boolean): JSX.Element =>
1717
result ? (
18-
<FontAwesomeIcon icon={faCheck} className='check' size='lg' /> // if result boolean is true, we display a checkmark icon
18+
<CheckCircleOutlineIcon className='check'/> // if result boolean is true, we display a checkmark icon
1919
) : (
20-
<FontAwesomeIcon icon={faExclamationCircle} className='fail' size='lg' /> // if the result boolean is false, we display a fail icon
20+
<ErrorOutlineIcon className='fail'/> // if the result boolean is false, we display a fail icon
2121
);
2222

2323
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types

src/app/components/StateRoute/ComponentMap/ComponentMap.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export default function ComponentMap({
3939
const [layout, setLayout] = useState('cartesian'); // We create a local state "layout" and set it to a string 'cartesian'
4040
const [orientation, setOrientation] = useState('vertical'); // We create a local state "orientation" and set it to a string 'vertical'.
4141
const [linkType, setLinkType] = useState('diagonal'); // We create a local state "linkType" and set it to a string 'diagonal'.
42-
const [stepPercent, setStepPercent] = useState(10); // We create a local state "stepPercent" and set it to a number '10'.
42+
const [stepPercent, setStepPercent] = useState(0.5); // We create a local state "stepPercent" and set it to a number '0.5'. This will be used to scale the Map component's link: Step to 50%
4343
const [selectedNode, setSelectedNode] = useState('root'); // We create a local state "selectedNode" and set it to a string 'root'.
4444
const [, dispatch] = useStoreContext(); // we destructure the returned context object from the invocation of the useStoreContext function to get access to our dispatch function
4545

@@ -93,9 +93,12 @@ export default function ComponentMap({
9393
hideTooltip // function to close a tooltip
9494
} = useTooltip(); // returns an object with several properties that you can use to manage the tooltip state of your component
9595

96-
const { containerRef, TooltipInPortal } = useTooltipInPortal({
97-
detectBounds: true,
98-
scroll: true,
96+
const {
97+
containerRef, // Access to the container's bounding box. This will be empty on first render.
98+
TooltipInPortal // TooltipWithBounds in a Portal, outside of your component DOM tree
99+
} = useTooltipInPortal({ // Visx hook
100+
detectBounds: true, // use TooltipWithBounds
101+
scroll: true, // when tooltip containers are scrolled, this will correctly update the Tooltip position
99102
});
100103

101104
const tooltipStyles: ToolTipStyles = {

src/app/components/StateRoute/ComponentMap/LinkControls.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const collectNodes = (node: Node): void => {
3838
export default function LinkControls({
3939
layout, // from the layout local state (initially 'cartesian') in 'ComponentMap'
4040
linkType, // from linkType local state (initially 'vertical') in 'ComponentMap'
41-
stepPercent, // from stepPercent local state (initially '10') in 'ComponentMap'
41+
stepPercent, // from stepPercent local state (initially '0.5') in 'ComponentMap'
4242
setLayout, // from the layout local state in 'ComponentMap'
4343
setOrientation, // from the orientation local state in 'ComponentMap'
4444
setLinkType, // from the linkType local state in 'ComponentMap'
@@ -63,7 +63,8 @@ export default function LinkControls({
6363
</select>
6464
&nbsp;&nbsp;
6565

66-
<label>Orientation:</label> {/* Controls for the Orientation selection, this dropdown will be disabled when the polar layout is selected as it is not needed */}
66+
<label>Orientation:</label> {/* Toggle record button to pause state changes on target application */}
67+
{/* Controls for the Orientation selection, this dropdown will be disabled when the polar layout is selected as it is not needed */}
6768
&nbsp;
6869
<select
6970
onClick={(e) => e.stopPropagation()}

src/app/components/StateRoute/History.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const defaultMargin: DefaultMargin = {
2424
// below we destructure the props
2525
function History(props: Record<string, unknown>): JSX.Element {
2626
const {
27-
width: totalWidth,
28-
height: totalHeight,
27+
width: totalWidth, // from ParentSize provided in StateRoute
28+
height: totalHeight, // from ParentSize provided in StateRoute
2929
margin = defaultMargin,
3030
hierarchy, // from 'tabs[currentTab]' object in 'MainContainer'
3131
dispatch, // from useStoreContext in 'StateRoute'

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

Lines changed: 46 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -34,49 +34,52 @@ const tooltipStyles = {
3434
const BarGraph = (props: BarGraphProps): JSX.Element => {
3535
const [{ tabs, currentTab }, dispatch] = useStoreContext();
3636
const {
37-
width,
38-
height,
39-
data,
40-
comparison,
41-
setRoute,
42-
allRoutes,
43-
filteredSnapshots,
44-
snapshot,
45-
setSnapshot,
37+
width, // from stateRoute container
38+
height, // from stateRoute container
39+
data, // Acquired from getPerfMetrics(snapshots, getSnapshotIds(hierarchy)) in 'PerformanceVisx'
40+
comparison, // result from invoking 'allStorage' in 'PerformanceVisx'
41+
setRoute, // updates the 'route' state in 'PerformanceVisx'
42+
allRoutes, // array containing urls from 'PerformanceVisx'
43+
filteredSnapshots, // array containing url's that exist and with route === url.pathname
44+
snapshot, // state that is initialized to 'All Snapshots' in 'PerformanceVisx'
45+
setSnapshot, // updates the 'snapshot' state in 'PerformanceVisx'
4646
} = props;
4747
const [seriesNameInput, setSeriesNameInput] = useState(`Series ${comparison.length + 1}`);
48-
const { tooltipOpen, tooltipLeft, tooltipTop, tooltipData, hideTooltip, showTooltip } =
49-
useTooltip<TooltipData>();
48+
const {
49+
tooltipOpen, // boolean whether the tooltip state is open or closed
50+
tooltipLeft, // number used for tooltip positioning
51+
tooltipTop, // number used for tooltip positioning
52+
tooltipData, // value/data that tooltip may need to render
53+
hideTooltip, // function to close a tooltip
54+
showTooltip // function to set tooltip state
55+
} = useTooltip<TooltipData>(); // returns an object with several properties that you can use to manage the tooltip state of your component
5056
let tooltipTimeout: number;
51-
const { containerRef, TooltipInPortal } = useTooltipInPortal({
52-
detectBounds: true,
53-
scroll: true,
57+
const {
58+
containerRef, // Access to the container's bounding box. This will be empty on first render.
59+
TooltipInPortal // TooltipWithBounds in a Portal, outside of your component DOM tree
60+
} = useTooltipInPortal({ // Visx hook
61+
detectBounds: true, // use TooltipWithBounds
62+
scroll: true, // when tooltip containers are scrolled, this will correctly update the Tooltip position
5463
});
5564

5665
const keys = Object.keys(data.componentData);
5766

58-
// data accessor (used to generate scales) and formatter (add units for on hover box)
59-
// d coming from data.barstack post filtered data
60-
const getSnapshotId = (d: snapshot) => d.snapshotId;
67+
const getSnapshotId = (d: snapshot) => d.snapshotId; // data accessor (used to generate scales) and formatter (add units for on hover box). d comes from data.barstack post filtered data
68+
const formatSnapshotId = (id) => `Snapshot ID: ${id}`; // returns snapshot id when invoked in tooltip section
69+
const formatRenderTime = (time) => `${time} ms `; // returns render time when invoked in tooltip section
6170

62-
// returns snapshot id when invoked in tooltip section
63-
const formatSnapshotId = (id) => `Snapshot ID: ${id}`;
64-
// returns render time when invoked in tooltip section
65-
const formatRenderTime = (time) => `${time} ms `;
66-
67-
// create visualization SCALES with cleaned data
68-
const snapshotIdScale = scaleBand<string>({
71+
72+
const snapshotIdScale = scaleBand<string>({ // create visualization SCALES with cleaned data
6973
domain: data.barStack.map(getSnapshotId),
7074
padding: 0.2,
7175
});
7276

73-
// Adjusts y axis to match/ bar height
74-
const renderingScale = scaleLinear<number>({
77+
const renderingScale = scaleLinear<number>({ // Adjusts y axis to match/ bar height
7578
domain: [0, data.maxTotalRender],
7679
nice: true,
7780
});
78-
// Gives each bar on the graph a color using schemeSet1 imported from D3
79-
const colorScale = scaleOrdinal<string>({
81+
82+
const colorScale = scaleOrdinal<string>({ // Gives each bar on the graph a color using schemeSet1 imported from D3
8083
domain: keys,
8184
range: schemeSet1,
8285
});
@@ -92,9 +95,9 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
9295
title: tabs[currentTab].title,
9396
data,
9497
};
95-
// use this to animate the save series button. It
96-
useEffect(() => {
97-
const saveButtons = document.getElementsByClassName('save-series-button');
98+
99+
useEffect(() => { // Animates the save series button.
100+
const saveButtons = document.getElementsByClassName('save-series-button'); // finds the buttom in the DOM
98101
for (let i = 0; i < saveButtons.length; i++) {
99102
if (tabs[currentTab].seriesSavedStatus === 'saved') {
100103
saveButtons[i].classList.add('animate');
@@ -106,22 +109,21 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
106109
}
107110
});
108111

109-
// CURRENTLY DOES NOT SAVE
110-
const saveSeriesClickHandler = () => {
112+
const saveSeriesClickHandler = () => { // function to save the currently selected series
111113
if (tabs[currentTab].seriesSavedStatus === 'inputBoxOpen') {
112114
const actionNames = document.getElementsByClassName('actionname');
113115
for (let i = 0; i < actionNames.length; i += 1) {
114116
toStorage.data.barStack[i].name = actionNames[i].value;
115117
}
116-
dispatch(save(toStorage, seriesNameInput));
117-
setSeriesNameInput(`Series ${comparison.length}`);
118+
dispatch(save(toStorage, seriesNameInput)); // saves the series under seriesName
119+
setSeriesNameInput(`Series ${comparison.length}`); // sends a reducer that saves the series/toStorage object the user wants to chrome local storage
118120
return;
119121
}
120-
dispatch(save(toStorage));
122+
dispatch(save(toStorage)); // sends a reducer that saves the series/toStorage object the user wants to chrome local storage
121123
};
122124

123-
// Need to change so textbox isn't empty before saving
124-
const textbox =
125+
126+
const textbox = // Need to change so textbox isn't empty before saving
125127
tabs[currentTab].seriesSavedStatus === 'inputBoxOpen' ? (
126128
<input
127129
type='text'
@@ -194,8 +196,7 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
194196
{(barStacks) =>
195197
barStacks.map((barStack) =>
196198
barStack.bars.map((bar) => {
197-
// Hides new components if components don't exist in previous snapshots.
198-
if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
199+
if (Number.isNaN(bar.bar[1]) || bar.height < 0) { // Hides new components if components don't exist in previous snapshots.
199200
bar.height = 0;
200201
}
201202
return (
@@ -207,17 +208,15 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
207208
width={bar.width}
208209
fill={bar.color}
209210
/* TIP TOOL EVENT HANDLERS */
210-
// Hides tool tip once cursor moves off the current rect.
211-
onMouseLeave={() => {
211+
onMouseLeave={() => { // Hides tool tip once cursor moves off the current rect.
212212
dispatch(
213213
onHoverExit(data.componentData[bar.key].rtid),
214214
(tooltipTimeout = window.setTimeout(() => {
215215
hideTooltip();
216216
}, 300)),
217217
);
218218
}}
219-
// Cursor position in window updates position of the tool tip.
220-
onMouseMove={(event) => {
219+
onMouseMove={(event) => { // Cursor position in window updates position of the tool tip.
221220
dispatch(onHover(data.componentData[bar.key].rtid));
222221
if (tooltipTimeout) clearTimeout(tooltipTimeout);
223222
const top;
@@ -283,10 +282,7 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
283282
)}
284283
</svg>
285284
{/* FOR HOVER OVER DISPLAY */}
286-
{/* Ths conditional statement displays a different tooltip
287-
configuration depending on if we are trying do display a specific
288-
snapshot through options menu or all snapshots together in bargraph */}
289-
{tooltipOpen && tooltipData && (
285+
{tooltipOpen && tooltipData && ( // Ths conditional statement displays a different tooltip configuration depending on if we are trying do display a specific snapshot through options menu or all snapshots together in bargraph
290286
<TooltipInPortal
291287
key={Math.random()} // update tooltip bounds each render
292288
top={tooltipTop}
@@ -297,8 +293,8 @@ const BarGraph = (props: BarGraphProps): JSX.Element => {
297293
{' '}
298294
<strong>{tooltipData.key}</strong>{' '}
299295
</div>
300-
<div>{data.componentData[tooltipData.key].stateType}</div>
301-
<div> {formatRenderTime(tooltipData.bar.data[tooltipData.key])} </div>
296+
<div>{'State: ' + data.componentData[tooltipData.key].stateType}</div>
297+
<div> {'Render time: ' + formatRenderTime(tooltipData.bar.data[tooltipData.key])} </div>
302298
<div>
303299
{' '}
304300
<small>{formatSnapshotId(getSnapshotId(tooltipData.bar.data))}</small>

0 commit comments

Comments
 (0)