Skip to content

Commit 9a53250

Browse files
committed
fixup hoverinfo: 'all' for cone traces
1 parent ca7c022 commit 9a53250

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/plots/gl3d/scene.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function render(scene) {
102102
if(isHoverinfoAll || hoverinfoParts.indexOf('norm') !== -1) {
103103
vectorTx.push('norm: ' + selection.traceCoordinate[6].toPrecision(3));
104104
}
105-
if(isHoverinfoAll || hoverinfoParts.indexOf('divergence') !== -1) {
105+
if(trace.type === 'streamtube' && (isHoverinfoAll || hoverinfoParts.indexOf('divergence') !== -1)) {
106106
vectorTx.push('divergence: ' + selection.traceCoordinate[7].toPrecision(3));
107107
}
108108
if(selection.textLabel) {

test/jasmine/tests/cone_test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,18 @@ describe('@gl Test cone interactions', function() {
261261
assertHoverLabelContent({
262262
nums: ['u: 0', 'v: 3', 'w: 0'].join('\n')
263263
});
264+
265+
return Plotly.restyle(gd, 'hoverinfo', 'all');
266+
})
267+
.then(function() {
268+
assertHoverLabelContent({
269+
name: 'trace 0',
270+
nums: [
271+
'x: 2', 'y: 2', 'z: 2',
272+
'u: 0', 'v: 3', 'w: 0',
273+
'norm: 3.00'
274+
].join('\n')
275+
});
264276
})
265277
.catch(failTest)
266278
.then(done);

0 commit comments

Comments
 (0)