@@ -70,13 +70,12 @@ const tooltipStyles = {
70
70
const BarGraphComparisonActions = props => {
71
71
const [ { tabs, currentTab } , dispatch ] = useStoreContext ( ) ;
72
72
const {
73
- width, height, data, comparison, setSeries, series, setAction
73
+ width, height, data, comparison, setSeries, series, setAction, action
74
74
} = props ;
75
75
// const [series, setSeries] = React.useState(0);
76
76
const [ snapshots , setSnapshots ] = React . useState ( 0 ) ;
77
77
const [ open , setOpen ] = React . useState ( false ) ;
78
78
const [ picOpen , setPicOpen ] = React . useState ( false ) ;
79
- const [ maxRender , setMaxRender ] = React . useState ( data . maxTotalRender ) ;
80
79
81
80
const currentIndex = tabs [ currentTab ] . sliderIndex ;
82
81
@@ -124,8 +123,8 @@ const BarGraphComparisonActions = props => {
124
123
} ;
125
124
126
125
// the domain array on rendering scale will set the coordinates for Y-aix points.
127
- const renderingScale = scaleBand < number > ( {
128
- domain : [ 0 , Math . max ( calculateMaxTotalRender ( ) , data . maxTotalRender ) ] ,
126
+ const renderingScale = scaleLinear < number > ( {
127
+ domain : [ 0 , calculateMaxTotalRender ( ) ] ,
129
128
nice : true ,
130
129
} ) ;
131
130
// the domain array will assign each key a different color to make rectangle boxes
@@ -266,14 +265,14 @@ const BarGraphComparisonActions = props => {
266
265
open = { picOpen }
267
266
onClose = { picHandleClose }
268
267
onOpen = { picHandleOpen }
269
- value = { '' } //snapshots
268
+ value = { action } //snapshots
270
269
onChange = { handleActionChange }
271
270
>
272
271
{ ! comparison [ snapshots ] ? (
273
272
< MenuItem > No snapshots available</ MenuItem >
274
273
) : (
275
274
finalList . map ( ( elem , index ) => (
276
- < MenuItem value = { index } > { elem } </ MenuItem >
275
+ < MenuItem value = { elem } > { elem } </ MenuItem >
277
276
// <MenuItem value="test">{}</MenuItem>
278
277
) ) )
279
278
}
@@ -312,13 +311,13 @@ const BarGraphComparisonActions = props => {
312
311
yScale = { renderingScale }
313
312
color = { colorScale }
314
313
>
315
- { barStacks => barStacks . map ( barStack => barStack . bars . map ( ( bar , idx ) => {
314
+ { barStacks => barStacks . map ( barStack => barStack . bars . map ( ( bar ) => {
316
315
console . log ( 'barstack' , barStack )
317
316
console . log ( 'bar' , bar )
318
317
// Hides new components if components don't exist in previous snapshots.
319
- if ( Number . isNaN ( bar . bar [ 1 ] ) || bar . height < 0 ) {
320
- bar . height = 0 ;
321
- }
318
+ // if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
319
+ // bar.height = 0;
320
+ // }
322
321
return (
323
322
< rect
324
323
key = { `bar-stack-${ barStack . id } -${ bar . id } ` }
0 commit comments