File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff 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 } ;
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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" >
You can’t perform that action at this time.
0 commit comments