@@ -102,7 +102,7 @@ const BarGraphComparison = (props) => {
102
102
const getSnapshotId = ( d : snapshot ) => d . snapshotId ;
103
103
const formatSnapshotId = ( id ) => `Snapshot ID: ${ id } ` ;
104
104
const formatRenderTime = ( time ) => `${ time } ms ` ;
105
- const getTabID = ( storedSeries ) => storedSeries . currentTab ;
105
+ const getCurrentTab = ( storedSeries ) => storedSeries . currentTab ;
106
106
// create visualization SCALES with cleaned data
107
107
//const xAxisPoints = [...titleFilter(comparison).map(getTabID), currentTab];
108
108
//the domain array elements will place the bars along the x-axis
@@ -185,14 +185,20 @@ const BarGraphComparison = (props) => {
185
185
} ;
186
186
187
187
//manually assignin X -axis points with tab ID.
188
- function setXpoints ( ) {
188
+ function setXpointsComparison ( ) {
189
189
comparison [ series ] . data . barStack . forEach ( ( elem ) => {
190
190
elem . currentTab = 'comparison' ;
191
191
} ) ;
192
192
//comparison[series].data.barStack.currentTab = currentTab;
193
193
return comparison [ series ] . data . barStack ;
194
194
}
195
-
195
+ function setXpointsCurrentTab ( ) {
196
+ data . barStack . forEach ( ( element ) => {
197
+ element . currentTab = 'currentTab' ;
198
+ } ) ;
199
+ return data . barStack ;
200
+ }
201
+ //console.log('set x on current bar', setXpointsCurrentTab());
196
202
return (
197
203
< div >
198
204
< div className = 'series-options-container' >
@@ -259,9 +265,9 @@ const BarGraphComparison = (props) => {
259
265
< Group top = { margin . top } left = { margin . left } >
260
266
< BarStack
261
267
// OG Barstack
262
- data = { data . barStack }
268
+ data = { setXpointsCurrentTab ( ) }
263
269
keys = { keys }
264
- x = { getSnapshotId }
270
+ x = { getCurrentTab }
265
271
xScale = { snapshotIdScale }
266
272
yScale = { renderingScale }
267
273
color = { colorScale }
@@ -306,9 +312,9 @@ const BarGraphComparison = (props) => {
306
312
</ BarStack >
307
313
< BarStack
308
314
// Comparison Barstack
309
- data = { ! comparison [ series ] ? [ ] : setXpoints ( ) }
315
+ data = { ! comparison [ series ] ? [ ] : setXpointsComparison ( ) }
310
316
keys = { keys }
311
- x = { getTabID }
317
+ x = { getCurrentTab }
312
318
xScale = { snapshotIdScale }
313
319
yScale = { renderingScale }
314
320
color = { colorScale }
0 commit comments