Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 760bda3

Browse files
committed
don't show 3d hover labels when scene.hovermode is false
1 parent 74e7e33 commit 760bda3

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

src/plots/gl3d/scene.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,18 +79,20 @@ function render(scene) {
7979
if(hoverinfoParts.indexOf('name') === -1) lastPicked.name = undefined;
8080
}
8181

82-
Fx.loneHover({
83-
x: (0.5 + 0.5 * pdata[0]/pdata[3]) * width,
84-
y: (0.5 - 0.5 * pdata[1]/pdata[3]) * height,
85-
xLabel: formatter('xaxis', selection.traceCoordinate[0]),
86-
yLabel: formatter('yaxis', selection.traceCoordinate[1]),
87-
zLabel: formatter('zaxis', selection.traceCoordinate[2]),
88-
text: selection.textLabel,
89-
name: lastPicked.name,
90-
color: lastPicked.color
91-
}, {
92-
container: svgContainer
93-
});
82+
if(scene.fullSceneLayout.hovermode) {
83+
Fx.loneHover({
84+
x: (0.5 + 0.5 * pdata[0]/pdata[3]) * width,
85+
y: (0.5 - 0.5 * pdata[1]/pdata[3]) * height,
86+
xLabel: formatter('xaxis', selection.traceCoordinate[0]),
87+
yLabel: formatter('yaxis', selection.traceCoordinate[1]),
88+
zLabel: formatter('zaxis', selection.traceCoordinate[2]),
89+
text: selection.textLabel,
90+
name: lastPicked.name,
91+
color: lastPicked.color
92+
}, {
93+
container: svgContainer
94+
});
95+
}
9496
}
9597
else Fx.loneUnhover(svgContainer);
9698
}

0 commit comments

Comments
 (0)