Skip to content

Commit 7a047e7

Browse files
committed
fix the bug where the default snapshot is not all snapshot
1 parent 89bb042 commit 7a047e7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/app/components/BarGraph.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ const BarGraph = props => {
8686
detectBounds: true,
8787
scroll: true,
8888
});
89+
console.log(snapshot, '<--current snapshot');
8990

9091
const HorizontalGraph = () => {
9192
const BarArray = [];
@@ -297,7 +298,7 @@ const BarGraph = props => {
297298
setRoute(e.target.value);
298299
setSnapshot('All Snapshots');
299300
const defaultSnapShot = document.querySelector('#snapshot-select');
300-
defaultSnapShot.value = 'defaultSnapShot';
301+
defaultSnapShot.value = 'All Snapshots';
301302
}}
302303
>
303304
<option>
@@ -317,7 +318,7 @@ const BarGraph = props => {
317318
id="snapshot-select"
318319
onChange={e => setSnapshot(e.target.value)}
319320
>
320-
<option value="defaultSnapShot">
321+
<option value="All Snapshots">
321322
All Snapshots
322323
</option>
323324
{filteredSnapshots.map(route => (
@@ -339,6 +340,7 @@ const BarGraph = props => {
339340
/>
340341
{snapshot === 'All Snapshots' ? (
341342
<>
343+
{ console.log(data.barStack, 'data.barStack that gives error 1') }
342344
<Grid
343345
top={margin.top}
344346
left={margin.left}
@@ -350,6 +352,8 @@ const BarGraph = props => {
350352
strokeOpacity={0.1}
351353
xOffset={snapshotIdScale.bandwidth() / 2}
352354
/>
355+
{ console.log(data.barStack, 'data.barStack that gives error 2') }
356+
353357
<Group top={margin.top} left={margin.left}>
354358
<BarStack
355359
data={data.barStack}
@@ -420,6 +424,8 @@ const BarGraph = props => {
420424
textAnchor: 'end',
421425
})}
422426
/>
427+
{ console.log(data.barStack, 'data.barStack that gives error 3') }
428+
423429
<AxisBottom
424430
top={yMax + margin.top}
425431
left={margin.left}

0 commit comments

Comments
 (0)