Skip to content

Commit 9d358ab

Browse files
committed
Comparison Actions bar graph finally done, need to cleanup
1 parent 3a53068 commit 9d358ab

File tree

2 files changed

+13
-21
lines changed

2 files changed

+13
-21
lines changed

src/app/components/BarGraph.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,13 @@ const BarGraph = props => {
181181
color={colorScale}
182182
>
183183
{barStacks => barStacks.map(barStack => barStack.bars.map((bar, idx) => {
184-
console.log(bar)
185184
// Hides new components if components don't exist in previous snapshots.
186185
if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
187186
bar.height = 0;
188187
}
189188
return (
190189
<rect
191-
key={`bar-stack-${barStack.id}-${bar.id}`}
190+
key={`bar-stack-${bar.bar.data.snapshotId}-${bar.key}`}
192191
x={bar.x}
193192
y={bar.y}
194193
height={bar.height === 0 ? null : bar.height}

src/app/components/BarGraphComparisonActions.tsx

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -312,33 +312,25 @@ const BarGraphComparisonActions = props => {
312312
color={colorScale}
313313
>
314314
{barStacks => barStacks.map(barStack => barStack.bars.map((bar) => {
315-
console.log('barstack', barStack)
316-
console.log('bar', bar)
317-
// Hides new components if components don't exist in previous snapshots.
318-
// if (Number.isNaN(bar.bar[1]) || bar.height < 0) {
319-
// bar.height = 0;
320-
// }
315+
console.log(bar)
321316
return (
322317
<rect
323-
key={`bar-stack-${barStack.id}-${bar.id}`}
318+
key={`bar-stack-${bar.bar.data.seriesName}-${bar.key}`}
324319
x={bar.x}
325320
y={bar.y}
326321
height={bar.height === 0 ? null : bar.height}
327322
width={bar.width}
328323
fill={bar.color}
329-
/* TIP TOOL EVENT HANDLERS */
330-
// Hides tool tip once cursor moves off the current rect.
324+
/* TIP TOOL EVENT HANDLERS */
325+
// Hides tool tip once cursor moves off the current rect.
331326
onMouseLeave={() => {
332-
dispatch(
333-
onHoverExit(data.componentData[bar.key].rtid),
334-
(tooltipTimeout = window.setTimeout(() => {
335-
hideTooltip();
336-
}, 300)),
337-
);
327+
tooltipTimeout = window.setTimeout(() => {
328+
hideTooltip();
329+
}, 300);
338330
}}
339-
// Cursor position in window updates position of the tool tip.
331+
// Cursor position in window updates position of the tool tip.
340332
onMouseMove={event => {
341-
dispatch(onHover(data.componentData[bar.key].rtid));
333+
// dispatch(onHover(data.componentData[bar.key].rtid));
342334
if (tooltipTimeout) clearTimeout(tooltipTimeout);
343335
const top = event.clientY - margin.top - bar.height;
344336
const left = bar.x + bar.width / 2;
@@ -404,9 +396,10 @@ const BarGraphComparisonActions = props => {
404396
<div style={{ color: colorScale(tooltipData.key) }}>
405397
{' '}
406398
<strong>{tooltipData.key}</strong>
399+
{console.log(tooltipData)}
407400
{' '}
408401
</div>
409-
<div>{data.componentData[tooltipData.key].stateType}</div>
402+
{/* <div>{data.componentData[tooltipData.key].stateType}</div> */}
410403
<div>
411404
{' '}
412405
{formatRenderTime(tooltipData.bar.data[tooltipData.key])}
@@ -415,7 +408,7 @@ const BarGraphComparisonActions = props => {
415408
<div>
416409
{' '}
417410
<small>
418-
{formatSnapshotId(getSnapshotId(tooltipData.bar.data))}
411+
{tooltipData.bar.data.seriesName}
419412
</small>
420413
</div>
421414
</TooltipInPortal>

0 commit comments

Comments
 (0)