@@ -79,6 +79,8 @@ const BarGraphComparison = props => {
7979 const [ maxRender , setMaxRender ] = React . useState ( data . maxTotalRender ) ;
8080
8181 function titleFilter ( comparisonArray ) {
82+ // const comparisonArrayModded = comparisonArray[0];
83+ console . log ( 'titleFilter' , comparisonArray ) ;
8284 return comparisonArray . filter (
8385 elem => elem . title . split ( '-' ) [ 1 ] === tabs [ currentTab ] . title . split ( '-' ) [ 1 ] ,
8486 ) ;
@@ -119,6 +121,9 @@ const BarGraphComparison = props => {
119121 // with the render time of the current tab.
120122 // The max render time will determine the Y-axis's highest number.
121123 const calculateMaxTotalRender = series => {
124+ console . log ( comparison )
125+ console . log ( series )
126+ // let currentMax = 5
122127 const currentSeriesBarStacks = ! comparison [ series ]
123128 ? [ ]
124129 : comparison [ series ] . data . barStack ;
@@ -206,6 +211,9 @@ const BarGraphComparison = props => {
206211 elem . currentTab = 'comparison' ;
207212 } ) ;
208213 // comparison[series].data.barStack.currentTab = currentTab;
214+ console . log ( comparison )
215+ console . log ( series )
216+ console . log ( comparison [ series ] . data . barStack )
209217 return comparison [ series ] . data . barStack ;
210218 }
211219 function setXpointsCurrentTab ( ) {
@@ -227,6 +235,17 @@ const BarGraphComparison = props => {
227235 for ( let i = 0 ; i < classname . length ; i ++ ) {
228236 classname [ i ] . addEventListener ( 'click' , animateButton , false ) ;
229237 }
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+
230249 return (
231250 < div >
232251 < div className = "series-options-container" >
@@ -240,7 +259,7 @@ const BarGraphComparison = props => {
240259 >
241260 Clear All Series
242261 </ button >
243- < h4 style = { { padding : '0 1rem' } } > Comparison Series: </ h4 >
262+ < h4 style = { { padding : '0 1rem' } } > Compare Series: </ h4 >
244263 < FormControl variant = "outlined" className = { classes . formControl } >
245264 < Select
246265 style = { { color : 'white' } }
@@ -256,13 +275,16 @@ const BarGraphComparison = props => {
256275 { ! comparison [ series ] ? (
257276 < MenuItem > No series available</ MenuItem >
258277 ) : (
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 >
261283 ) )
262284 ) }
263285 </ Select >
264286 </ FormControl >
265- { /* <h4 style={{ padding: '0 1rem' }}>Comparator Snapshot? </h4>
287+ < h4 style = { { padding : '0 1rem' } } > Compare Actions </ h4 >
266288 < FormControl variant = "outlined" className = { classes . formControl } >
267289 < Select
268290 style = { { color : 'white' } }
@@ -278,14 +300,13 @@ const BarGraphComparison = props => {
278300 { ! comparison [ snapshots ] ? (
279301 < MenuItem > No snapshots available</ MenuItem >
280302 ) : (
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+ }
287308 </ Select >
288- </FormControl> */ }
309+ </ FormControl >
289310 </ div >
290311 </ div >
291312
@@ -324,7 +345,7 @@ const BarGraphComparison = props => {
324345 // Uses map method to iterate through all components,
325346 // creating a rect component (from visx) for each iteration.
326347 // 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
328349 // will run it on the array thats outputted by data
329350 const bar = barStack . bars [ currentIndex ] ;
330351 if ( Number . isNaN ( bar . bar [ 1 ] ) || bar . height < 0 ) {
@@ -368,6 +389,8 @@ const BarGraphComparison = props => {
368389 // Comparison Barstack (populates based on series selected)
369390 // to set X and Y scale, it will used the passed in function and
370391 // will run it on the array thats outputted by data
392+ // setXpointsComparison() }
393+ // comparison[series].data.barStack
371394 data = { ! comparison [ series ] ? [ ] : setXpointsComparison ( ) }
372395 keys = { keys }
373396 x = { getCurrentTab }
0 commit comments