Skip to content

Commit faf519f

Browse files
committed
fixup 'name' hover label part for cones
1 parent a0ed2ac commit faf519f

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

src/traces/cone/attributes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ fromMesh3d.forEach(function(k) {
170170
attrs.hoverinfo = extendFlat({}, baseAttrs.hoverinfo, {
171171
editType: 'calc',
172172
flags: ['x', 'y', 'z', 'u', 'v', 'w', 'norm', 'text', 'name'],
173-
dflt: 'x+y+z+norm+text'
173+
dflt: 'x+y+z+norm+text+name'
174174
});
175175

176176
module.exports = attrs;

test/jasmine/tests/cone_test.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,4 +265,28 @@ describe('@gl Test cone interactions', function() {
265265
.catch(failTest)
266266
.then(done);
267267
});
268+
269+
it('should display hover labels (multi-trace case)', function(done) {
270+
var fig = Lib.extendDeep({}, require('@mocks/gl3d_cone-single.json'));
271+
fig.layout.margin = {l: 0, t: 0, r: 0, b: 0};
272+
fig.layout.width = 400;
273+
fig.layout.height = 400;
274+
275+
function _hover() {
276+
mouseEvent('mouseover', 245, 230);
277+
return delay(20)();
278+
}
279+
280+
Plotly.plot(gd, fig)
281+
.then(delay(20))
282+
.then(_hover)
283+
.then(function() {
284+
assertHoverLabelContent({
285+
nums: ['x: 1', 'y: 1', 'z: 1', 'norm: 1.41'].join('\n'),
286+
name: 'blue cone'
287+
});
288+
})
289+
.catch(failTest)
290+
.then(done);
291+
});
268292
});

0 commit comments

Comments
 (0)