File tree 1 file changed +2
-7
lines changed
tensorboard/webapp/metrics/views/card_renderer
1 file changed +2
-7
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,6 @@ import {TimeSelectionView} from './utils';
58
58
59
59
type ScalarTooltipDatum = TooltipDatum <
60
60
ScalarCardSeriesMetadata & {
61
- distToCursor : number ;
62
61
closest : boolean ;
63
62
}
64
63
> ;
@@ -172,10 +171,6 @@ export class ScalarCardComponent<Downloader> {
172
171
metadata : {
173
172
...datum . metadata ,
174
173
closest : false ,
175
- distToCursor : Math . hypot (
176
- datum . point . x - cursorLocationInDataCoord . x ,
177
- datum . point . y - cursorLocationInDataCoord . y
178
- ) ,
179
174
distToCursorPixels : Math . hypot (
180
175
datum . pixelLocation . x - cursorLocation . x ,
181
176
datum . pixelLocation . y - cursorLocation . y
@@ -189,8 +184,8 @@ export class ScalarCardComponent<Downloader> {
189
184
let minDist = Infinity ;
190
185
let minIndex = 0 ;
191
186
for ( let index = 0 ; index < scalarTooltipData . length ; index ++ ) {
192
- if ( minDist > scalarTooltipData [ index ] . metadata . distToCursor ) {
193
- minDist = scalarTooltipData [ index ] . metadata . distToCursor ;
187
+ if ( minDist > scalarTooltipData [ index ] . metadata . distToCursorPixels ) {
188
+ minDist = scalarTooltipData [ index ] . metadata . distToCursorPixels ;
194
189
minIndex = index ;
195
190
}
196
191
}
You can’t perform that action at this time.
0 commit comments