Skip to content

Commit 3559c76

Browse files
committed
add hovertemplate to splom traces
1 parent b49e13f commit 3559c76

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

src/traces/splom/attributes.js

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
var scatterAttrs = require('../scatter/attributes');
1212
var colorAttrs = require('../../components/colorscale/attributes');
13+
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
1314
var scatterGlAttrs = require('../scattergl/attributes');
1415
var cartesianIdRegex = require('../../plots/cartesian/constants').idRegex;
1516
var templatedArray = require('../../plot_api/plot_template').templatedArray;
@@ -123,6 +124,7 @@ module.exports = {
123124
'this trace\'s (x,y) coordinates.'
124125
].join(' ')
125126
}),
127+
hovertemplate: hovertemplateAttrs(),
126128

127129
marker: markerAttrs,
128130

src/traces/splom/defaults.js

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
3939
}
4040

4141
coerce('text');
42+
coerce('hovertemplate');
4243

4344
handleMarkerDefaults(traceIn, traceOut, defaultColor, layout, coerce);
4445

test/jasmine/tests/splom_test.js

+12
Original file line numberDiff line numberDiff line change
@@ -1360,6 +1360,18 @@ describe('Test splom hover:', function() {
13601360
nums: 'Apr 2003',
13611361
axis: 'Jan 2000',
13621362
evtPts: [{x: '2000-01-01', y: '2003-04-21', pointNumber: 0}]
1363+
}, {
1364+
desc: 'with a hovertemplate',
1365+
patch: function(fig) {
1366+
fig.data.forEach(function(t) {
1367+
t.hovertemplate = '%{x}|%{y}<extra>pt %{pointNumber}</extra>'
1368+
});
1369+
fig.layout.hovermode = 'closest';
1370+
return fig;
1371+
},
1372+
nums: '2.6|7.7',
1373+
name: 'pt 18',
1374+
evtPts: [{x: 2.6, y: 7.7, pointNumber: 18, curveNumber: 2}]
13631375
}];
13641376

13651377
specs.forEach(function(s) {

0 commit comments

Comments
 (0)