1
1
/* eslint-disable react-hooks/exhaustive-deps */
2
+ /* eslint-disable */
2
3
// @ts -nocheck
3
4
import React , { useEffect } from 'react' ;
4
5
// formatting findDiff return data to show the changes with colors, aligns with actions.tsx
@@ -182,7 +183,8 @@ function History(props: Record<string, unknown>): JSX.Element {
182
183
dispatch ( changeSlider ( d . data . index ) ) ;
183
184
} )
184
185
// added to display state change information to node tree
185
- . on ( 'mouseover' , ( d ) => {
186
+ . on ( 'mouseover' , ( event , d ) => {
187
+ const [ x , y ] = d3 . pointer ( event ) ;
186
188
// created popup div and appended it to display div(returned in this function)
187
189
// D3 doesn't utilize z-index for priority,
188
190
// rather decides on placement by order of rendering
@@ -192,8 +194,8 @@ function History(props: Record<string, unknown>): JSX.Element {
192
194
. select ( '.display' )
193
195
. append ( 'div' )
194
196
. attr ( 'class' , 'tooltip' )
195
- . style ( 'left' , `${ d3 . event . pageX } px` )
196
- . style ( 'top' , `${ d3 . event . pageY } px` ) ;
197
+ . style ( 'left' , `${ x } px` )
198
+ . style ( 'top' , `${ y } px` ) ;
197
199
d3 . selectAll ( '.tooltip' ) . html ( findDiff ( d . data . index ) ) ;
198
200
} )
199
201
. on ( 'mouseout' , ( d ) => {
0 commit comments