Skip to content

Commit e6a7ec3

Browse files
author
Robert Crocker
committed
Formatting
1 parent 1ccef6d commit e6a7ec3

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

src/components/Rectangle.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const RectangleComp = ({
1919
fill,
2020
setTooltip,
2121
}: RectangleProps): JSX.Element => {
22-
2322
let tooltipState = {
2423
cursorX: 0,
2524
cursorY: 0,
@@ -45,7 +44,10 @@ const RectangleComp = ({
4544
cursorY: e.pageY - e.nativeEvent.offsetY + (y ?? 0),
4645
distanceFromTop: offsetFromTop + margin.top + rectTop,
4746
distanceFromRight:
48-
(margin.left + cWidth + margin.right) - (offsetFromLeft + margin.left + rectMidPoint),
47+
margin.left +
48+
cWidth +
49+
margin.right -
50+
(offsetFromLeft + margin.left + rectMidPoint),
4951
distanceFromLeft: offsetFromLeft + margin.left + rectMidPoint,
5052
data,
5153
};

src/components/VoronoiCell.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const VoronoiCell = ({
1313
margin,
1414
cWidth,
1515
}: VoronoiProps): JSX.Element => {
16-
1716
// The code below was commented out because of the performance issues we ran
1817
// into when charts are taking in large data sets
1918
// TODO: Figure out how to performantly use scroll to improve the performance.
@@ -53,7 +52,10 @@ export const VoronoiCell = ({
5352

5453
tooltipState.distanceFromTop = cellCenter.cy + margin.top;
5554
tooltipState.distanceFromRight =
56-
(margin.left + cWidth + margin.right) - (margin.left + tooltipState.cursorX);
55+
margin.left +
56+
cWidth +
57+
margin.right -
58+
(margin.left + tooltipState.cursorX);
5759
tooltipState.distanceFromLeft = margin.left + tooltipState.cursorX;
5860

5961
setTooltip ? setTooltip(tooltipState) : null;

src/components/VoronoiWrapper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const VoronoiWrapper = React.memo(
1212
yAccessor,
1313
setTooltip,
1414
margin,
15-
cWidth
15+
cWidth,
1616
}: VoronoiBody): JSX.Element => {
1717
return (
1818
<g className="voronoi-wrapper">

0 commit comments

Comments
 (0)