@@ -79,6 +79,8 @@ const BarGraphComparison = props => {
79
79
const [ maxRender , setMaxRender ] = React . useState ( data . maxTotalRender ) ;
80
80
81
81
function titleFilter ( comparisonArray ) {
82
+ // const comparisonArrayModded = comparisonArray[0];
83
+ console . log ( 'titleFilter' , comparisonArray ) ;
82
84
return comparisonArray . filter (
83
85
elem => elem . title . split ( '-' ) [ 1 ] === tabs [ currentTab ] . title . split ( '-' ) [ 1 ] ,
84
86
) ;
@@ -119,6 +121,9 @@ const BarGraphComparison = props => {
119
121
// with the render time of the current tab.
120
122
// The max render time will determine the Y-axis's highest number.
121
123
const calculateMaxTotalRender = series => {
124
+ console . log ( comparison )
125
+ console . log ( series )
126
+ // let currentMax = 5
122
127
const currentSeriesBarStacks = ! comparison [ series ]
123
128
? [ ]
124
129
: comparison [ series ] . data . barStack ;
@@ -206,6 +211,9 @@ const BarGraphComparison = props => {
206
211
elem . currentTab = 'comparison' ;
207
212
} ) ;
208
213
// comparison[series].data.barStack.currentTab = currentTab;
214
+ console . log ( comparison )
215
+ console . log ( series )
216
+ console . log ( comparison [ series ] . data . barStack )
209
217
return comparison [ series ] . data . barStack ;
210
218
}
211
219
function setXpointsCurrentTab ( ) {
@@ -227,6 +235,17 @@ const BarGraphComparison = props => {
227
235
for ( let i = 0 ; i < classname . length ; i ++ ) {
228
236
classname [ i ] . addEventListener ( 'click' , animateButton , false ) ;
229
237
}
238
+ const seriesList = comparison . map ( elem => elem . data . barStack ) ;
239
+ const actionsList = seriesList . flat ( ) ;
240
+ const testList = actionsList . map ( elem => elem . name ) ;
241
+
242
+ const finalList = [ ] ;
243
+ for ( let i = 0 ; i < testList . length ; i ++ ) {
244
+ if ( testList [ i ] !== "" ) finalList . push ( testList [ i ] ) ;
245
+ }
246
+ console . log ( 'Final List' , finalList )
247
+ // )
248
+
230
249
return (
231
250
< div >
232
251
< div className = "series-options-container" >
@@ -240,7 +259,7 @@ const BarGraphComparison = props => {
240
259
>
241
260
Clear All Series
242
261
</ button >
243
- < h4 style = { { padding : '0 1rem' } } > Comparison Series: </ h4 >
262
+ < h4 style = { { padding : '0 1rem' } } > Compare Series: </ h4 >
244
263
< FormControl variant = "outlined" className = { classes . formControl } >
245
264
< Select
246
265
style = { { color : 'white' } }
@@ -256,13 +275,16 @@ const BarGraphComparison = props => {
256
275
{ ! comparison [ series ] ? (
257
276
< MenuItem > No series available</ MenuItem >
258
277
) : (
259
- titleFilter ( comparison ) . map ( ( tabElem , index ) => (
260
- < MenuItem value = { index } > { `Series ${ index + 1 } ` } </ MenuItem >
278
+ // titleFilter(comparison).map((tabElem, index) => (
279
+ // <MenuItem value={index}>{`Series ${index + 1}`}</MenuItem>
280
+ // ))
281
+ comparison . map ( ( tabElem , index ) => (
282
+ < MenuItem value = { index } > { tabElem . name } </ MenuItem >
261
283
) )
262
284
) }
263
285
</ Select >
264
286
</ FormControl >
265
- { /* <h4 style={{ padding: '0 1rem' }}>Comparator Snapshot? </h4>
287
+ < h4 style = { { padding : '0 1rem' } } > Compare Actions </ h4 >
266
288
< FormControl variant = "outlined" className = { classes . formControl } >
267
289
< Select
268
290
style = { { color : 'white' } }
@@ -278,14 +300,13 @@ const BarGraphComparison = props => {
278
300
{ ! comparison [ snapshots ] ? (
279
301
< MenuItem > No snapshots available</ MenuItem >
280
302
) : (
281
- titleFilter(comparison).map((tabElem, index) => {
282
- return (
283
- <MenuItem value={index}>{`${index + 1}` }</MenuItem>
284
- );
285
- })
286
- )}
303
+ // finalList.map((elem, index) => (
304
+ // <MenuItem value={index}>{elem}</MenuItem>
305
+ < MenuItem value = "test" > Testing</ MenuItem >
306
+ )
307
+ }
287
308
</ Select >
288
- </FormControl> */ }
309
+ </ FormControl >
289
310
</ div >
290
311
</ div >
291
312
@@ -324,7 +345,7 @@ const BarGraphComparison = props => {
324
345
// Uses map method to iterate through all components,
325
346
// creating a rect component (from visx) for each iteration.
326
347
// height/width/etc. are calculated by visx.
327
- // to set X and Y scale, it will used the passed in function and
348
+ // to set X and Y scale, it will used the p`assed in function and
328
349
// will run it on the array thats outputted by data
329
350
const bar = barStack . bars [ currentIndex ] ;
330
351
if ( Number . isNaN ( bar . bar [ 1 ] ) || bar . height < 0 ) {
@@ -368,6 +389,8 @@ const BarGraphComparison = props => {
368
389
// Comparison Barstack (populates based on series selected)
369
390
// to set X and Y scale, it will used the passed in function and
370
391
// will run it on the array thats outputted by data
392
+ // setXpointsComparison() }
393
+ // comparison[series].data.barStack
371
394
data = { ! comparison [ series ] ? [ ] : setXpointsComparison ( ) }
372
395
keys = { keys }
373
396
x = { getCurrentTab }
0 commit comments