Skip to content

Commit ec96ed2

Browse files
Kevin NgoC-STYRCourageWolfDennisLpzdemircaner
committed
Clean up UI on Map and Performance tabs
- [x] New feature (change which adds functionality) - [x] Bug fix - Clean up UI - Modify toggle components to become React Router links on PerformanceVisx file - Update "Save Series" button styling on Snapshot ID - Add on-hover state information on Map screen Co-authored-by: C-STYR <[email protected]> Co-authored-by: CourageWolf <[email protected]> Co-authored-by: DennisLpz <[email protected]> Co-authored-by: demircaner <[email protected]>
1 parent c199139 commit ec96ed2

File tree

6 files changed

+289
-344
lines changed

6 files changed

+289
-344
lines changed

src/app/components/BarGraph.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ const BarGraph = (props) => {
142142
if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
143143
bar.height = 0;
144144
}
145-
console.log('bar in BarGraph.tsx', bar);
146145
return (
147146
<rect
148147
key={`bar-stack-${barStack.id}-${bar.id}`}
@@ -214,12 +213,10 @@ const BarGraph = (props) => {
214213
fontSize={12}
215214
fill="#FFFFFF"
216215
>
217-
{' '}
218-
Rendering Time (ms){' '}
216+
Rendering Time (ms)
219217
</Text>
220218
<Text x={xMax / 2} y={yMax + 65} fontSize={12} fill="#FFFFFF">
221-
{' '}
222-
Snapshot Id{' '}
219+
Snapshot Id
223220
</Text>
224221
</svg>
225222
{/* FOR HOVER OVER DISPLAY */}

src/app/components/BarGraphComparison.tsx

Lines changed: 7 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,18 @@ const tooltipStyles = {
7272
const BarGraphComparison = (props) => {
7373
const [{ tabs, currentTab }, dispatch] = useStoreContext();
7474
const { width, height, data, comparison } = props;
75-
7675
const [series, setSeries] = React.useState(0);
7776
const [open, setOpen] = React.useState(false);
7877
const [maxRender, setMaxRender] = React.useState(data.maxTotalRender);
7978

80-
// console.log('comparison >>>', comparison);
81-
// console.log('tabs[currentTab] >>>', tabs[currentTab]);
82-
// console.log('props in comparison graph >>>', props);
83-
// console.log('data >>>>>', data);
84-
// change scale of graph based on clicking of forward and backwards buttons effect
85-
// useEffect(() => {
86-
// console.log('setSeries is changing everytime currentIndex changes');
87-
// //change the state with setChangeSeries
88-
// setSeries(tabs[currentTab].sliderIndex);
89-
// }, [tabs[currentTab].sliderIndex]);
90-
91-
// console.log('tabs in Bargraphs comparison >>', tabs);
9279
function titleFilter(comparisonArray) {
9380
return comparisonArray.filter(
9481
(elem) => elem.title === tabs[currentTab].title
9582
);
9683
}
97-
// console.log('tabs in BGComp >>>', tabs);
84+
9885
const currentIndex = tabs[currentTab].sliderIndex;
99-
// console.log('sliderIndx outside of bargraph >>>', currentIndex);
86+
10087
const {
10188
tooltipOpen,
10289
tooltipLeft,
@@ -117,16 +104,15 @@ const BarGraphComparison = (props) => {
117104
const formatRenderTime = (time) => `${time} ms `;
118105

119106
// create visualization SCALES with cleaned data
107+
//the domain array elements will place the bars along the x-axis
120108
const snapshotIdScale = scaleBand<string>({
121-
// domain: getSnapshotId(data.barStack[currentIndex]),
122-
// domain: [currentTab, comparison[series].currentTab],
123109
domain: [
124110
`Current Tab Series`,
125111
`Series ${!comparison[series] ? null : series + 1}`,
126112
],
127113
padding: 0.2,
128114
});
129-
115+
// calculateMax
130116
const calculateMaxTotalRender = (series) => {
131117
const currentSeriesBarStacks = !comparison[series]
132118
? []
@@ -151,24 +137,17 @@ const BarGraphComparison = (props) => {
151137
range: schemeSet3,
152138
});
153139

154-
// console.log('rendering scale invocation', renderingScale);
155140
// setting max dimensions and scale ranges
156141
const xMax = width - margin.left - margin.right;
157142
const yMax = height - margin.top - 200;
158143
snapshotIdScale.rangeRound([0, xMax]);
159144
renderingScale.range([yMax, 0]);
160145

161-
// const filterSeries = (comparisonArray) => {
162-
// return comparisonArray.map((sessionName, idx) => {
163-
// return <MenuItem>{sessionName}</MenuItem>;
164-
// });
165-
// };
166146
// Dropdown to select series.
167147
const useStyles = makeStyles((theme) => ({
168148
formControl: {
169149
margin: theme.spacing(1),
170150
minWidth: 80,
171-
// padding: '0.5rem',
172151
height: 30,
173152
},
174153
select: {
@@ -186,9 +165,6 @@ const BarGraphComparison = (props) => {
186165

187166
const handleChange = (event) => {
188167
setSeries(event.target.value);
189-
// console.log('handleCh renderTime', renderTime);
190-
// // setMaxRender(renderTime);
191-
// console.log('maxRender', maxRender);
192168
};
193169

194170
const handleClose = () => {
@@ -205,27 +181,8 @@ const BarGraphComparison = (props) => {
205181
data,
206182
};
207183

208-
//this function creates a dropdown selection for each series of snapshots saved
209-
// const filterSeries = (comparisonArray) => {
210-
// return comparisonArray.map((sessionName, idx) => {
211-
// return <MenuItem>{sessionName}</MenuItem>;
212-
// });
213-
// };
214-
215184
return (
216185
<div>
217-
{/* <h1>{`Current Snapshot: ${currentIndex + 1}`}</h1> */}
218-
{/* <div class="dropdown dropdown-dark">
219-
<select name="two" class="dropdown-select">
220-
{!comparison[series] ? (
221-
<option value={series}>No series available</option>
222-
) : (
223-
titleFilter(comparison).map((tabElem, index) => {
224-
return <option value={index}>{`Series ${index + 1}`}</option>;
225-
})
226-
)}
227-
</select>
228-
</div> */}
229186
<div className="series-options-container">
230187
<div className="snapshotId-header">
231188
{' '}
@@ -243,8 +200,6 @@ const BarGraphComparison = (props) => {
243200
onClose={handleClose}
244201
onOpen={handleOpen}
245202
value={series}
246-
//data={data.barStack}
247-
// value={titleFilter(comparison)}
248203
onChange={handleChange}
249204
>
250205
{!comparison[series] ? (
@@ -292,22 +247,16 @@ const BarGraphComparison = (props) => {
292247
<Group top={margin.top} left={margin.left}>
293248
<BarStack
294249
// OG Barstack
295-
// data={!comparison ? [] : comparison}
296250
data={data.barStack}
297251
keys={keys}
298-
// x={getSnapshotId}
299252
x={getSnapshotId}
300253
xScale={snapshotIdScale}
301254
yScale={renderingScale}
302255
color={colorScale}
303256
>
304257
{(barStacks) =>
305258
barStacks.map((barStack, idx) => {
306-
console.log('maxTotalRender 1st Barstack', data.maxTotalRender);
307259
const bar = barStack.bars[currentIndex];
308-
// console.log('Y SCALEEE', barStacks);
309-
// console.log('data.barStack >>>', data.barStack);
310-
console.log('OG bar.x', bar.x);
311260

312261
return (
313262
<rect
@@ -347,10 +296,8 @@ const BarGraphComparison = (props) => {
347296
<BarStack
348297
// Comparison Barstack
349298
data={!comparison[series] ? [] : comparison[series].data.barStack}
350-
// data={data.barStack}
351299
keys={keys}
352300
x={getSnapshotId}
353-
// x={getSeriesId}
354301
xScale={snapshotIdScale}
355302
yScale={renderingScale}
356303
color={colorScale}
@@ -360,9 +307,8 @@ const BarGraphComparison = (props) => {
360307
if (!barStack.bars[currentIndex]) {
361308
return <h1>No Comparison</h1>;
362309
}
363-
// console.log('barStacks in Comparison', barStacks);
364310
const bar = barStack.bars[currentIndex];
365-
console.log('Comparison bar.x', bar.x);
311+
366312
return (
367313
<rect
368314
key={`bar-stack-${idx}-${bar.index}`}
@@ -433,12 +379,10 @@ const BarGraphComparison = (props) => {
433379
fontSize={12}
434380
fill="#FFFFFF"
435381
>
436-
{' '}
437-
Rendering Time (ms){' '}
382+
Rendering Time (ms)
438383
</Text>
439384
<Text x={xMax / 2} y={yMax + 65} fontSize={12} fill="#FFFFFF">
440-
{' '}
441-
Series ID{' '}
385+
Series ID
442386
</Text>
443387
</svg>
444388
{/* FOR HOVER OVER DISPLAY */}

src/app/components/ComponentMap.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@ export default function ComponentMap({
198198
const tooltipObj = Object.assign({}, node.data);
199199
if (typeof tooltipObj.state === 'object')
200200
tooltipObj.state = 'stateful';
201-
console.log('tooltipObj', tooltipObj);
202201
showTooltip({
203202
tooltipLeft: coords.x,
204203
tooltipTop: coords.y,

0 commit comments

Comments
 (0)