@@ -72,31 +72,18 @@ const tooltipStyles = {
72
72
const BarGraphComparison = ( props ) => {
73
73
const [ { tabs, currentTab } , dispatch ] = useStoreContext ( ) ;
74
74
const { width, height, data, comparison } = props ;
75
-
76
75
const [ series , setSeries ] = React . useState ( 0 ) ;
77
76
const [ open , setOpen ] = React . useState ( false ) ;
78
77
const [ maxRender , setMaxRender ] = React . useState ( data . maxTotalRender ) ;
79
78
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);
92
79
function titleFilter ( comparisonArray ) {
93
80
return comparisonArray . filter (
94
81
( elem ) => elem . title === tabs [ currentTab ] . title
95
82
) ;
96
83
}
97
- // console.log('tabs in BGComp >>>', tabs);
84
+
98
85
const currentIndex = tabs [ currentTab ] . sliderIndex ;
99
- // console.log('sliderIndx outside of bargraph >>>', currentIndex);
86
+
100
87
const {
101
88
tooltipOpen,
102
89
tooltipLeft,
@@ -117,16 +104,15 @@ const BarGraphComparison = (props) => {
117
104
const formatRenderTime = ( time ) => `${ time } ms ` ;
118
105
119
106
// create visualization SCALES with cleaned data
107
+ //the domain array elements will place the bars along the x-axis
120
108
const snapshotIdScale = scaleBand < string > ( {
121
- // domain: getSnapshotId(data.barStack[currentIndex]),
122
- // domain: [currentTab, comparison[series].currentTab],
123
109
domain : [
124
110
`Current Tab Series` ,
125
111
`Series ${ ! comparison [ series ] ? null : series + 1 } ` ,
126
112
] ,
127
113
padding : 0.2 ,
128
114
} ) ;
129
-
115
+ // calculateMax
130
116
const calculateMaxTotalRender = ( series ) => {
131
117
const currentSeriesBarStacks = ! comparison [ series ]
132
118
? [ ]
@@ -151,24 +137,17 @@ const BarGraphComparison = (props) => {
151
137
range : schemeSet3 ,
152
138
} ) ;
153
139
154
- // console.log('rendering scale invocation', renderingScale);
155
140
// setting max dimensions and scale ranges
156
141
const xMax = width - margin . left - margin . right ;
157
142
const yMax = height - margin . top - 200 ;
158
143
snapshotIdScale . rangeRound ( [ 0 , xMax ] ) ;
159
144
renderingScale . range ( [ yMax , 0 ] ) ;
160
145
161
- // const filterSeries = (comparisonArray) => {
162
- // return comparisonArray.map((sessionName, idx) => {
163
- // return <MenuItem>{sessionName}</MenuItem>;
164
- // });
165
- // };
166
146
// Dropdown to select series.
167
147
const useStyles = makeStyles ( ( theme ) => ( {
168
148
formControl : {
169
149
margin : theme . spacing ( 1 ) ,
170
150
minWidth : 80 ,
171
- // padding: '0.5rem',
172
151
height : 30 ,
173
152
} ,
174
153
select : {
@@ -186,9 +165,6 @@ const BarGraphComparison = (props) => {
186
165
187
166
const handleChange = ( event ) => {
188
167
setSeries ( event . target . value ) ;
189
- // console.log('handleCh renderTime', renderTime);
190
- // // setMaxRender(renderTime);
191
- // console.log('maxRender', maxRender);
192
168
} ;
193
169
194
170
const handleClose = ( ) => {
@@ -205,27 +181,8 @@ const BarGraphComparison = (props) => {
205
181
data,
206
182
} ;
207
183
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
-
215
184
return (
216
185
< 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> */ }
229
186
< div className = "series-options-container" >
230
187
< div className = "snapshotId-header" >
231
188
{ ' ' }
@@ -243,8 +200,6 @@ const BarGraphComparison = (props) => {
243
200
onClose = { handleClose }
244
201
onOpen = { handleOpen }
245
202
value = { series }
246
- //data={data.barStack}
247
- // value={titleFilter(comparison)}
248
203
onChange = { handleChange }
249
204
>
250
205
{ ! comparison [ series ] ? (
@@ -292,22 +247,16 @@ const BarGraphComparison = (props) => {
292
247
< Group top = { margin . top } left = { margin . left } >
293
248
< BarStack
294
249
// OG Barstack
295
- // data={!comparison ? [] : comparison}
296
250
data = { data . barStack }
297
251
keys = { keys }
298
- // x={getSnapshotId}
299
252
x = { getSnapshotId }
300
253
xScale = { snapshotIdScale }
301
254
yScale = { renderingScale }
302
255
color = { colorScale }
303
256
>
304
257
{ ( barStacks ) =>
305
258
barStacks . map ( ( barStack , idx ) => {
306
- console . log ( 'maxTotalRender 1st Barstack' , data . maxTotalRender ) ;
307
259
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 ) ;
311
260
312
261
return (
313
262
< rect
@@ -347,10 +296,8 @@ const BarGraphComparison = (props) => {
347
296
< BarStack
348
297
// Comparison Barstack
349
298
data = { ! comparison [ series ] ? [ ] : comparison [ series ] . data . barStack }
350
- // data={data.barStack}
351
299
keys = { keys }
352
300
x = { getSnapshotId }
353
- // x={getSeriesId}
354
301
xScale = { snapshotIdScale }
355
302
yScale = { renderingScale }
356
303
color = { colorScale }
@@ -360,9 +307,8 @@ const BarGraphComparison = (props) => {
360
307
if ( ! barStack . bars [ currentIndex ] ) {
361
308
return < h1 > No Comparison</ h1 > ;
362
309
}
363
- // console.log('barStacks in Comparison', barStacks);
364
310
const bar = barStack . bars [ currentIndex ] ;
365
- console . log ( 'Comparison bar.x' , bar . x ) ;
311
+
366
312
return (
367
313
< rect
368
314
key = { `bar-stack-${ idx } -${ bar . index } ` }
@@ -433,12 +379,10 @@ const BarGraphComparison = (props) => {
433
379
fontSize = { 12 }
434
380
fill = "#FFFFFF"
435
381
>
436
- { ' ' }
437
- Rendering Time (ms){ ' ' }
382
+ Rendering Time (ms)
438
383
</ Text >
439
384
< Text x = { xMax / 2 } y = { yMax + 65 } fontSize = { 12 } fill = "#FFFFFF" >
440
- { ' ' }
441
- Series ID{ ' ' }
385
+ Series ID
442
386
</ Text >
443
387
</ svg >
444
388
{ /* FOR HOVER OVER DISPLAY */ }
0 commit comments