8000 More hovertemplates! by etpinard · Pull Request #3530 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

More hovertemplates! #3530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Feb 15, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add hovertemplate to splom traces
  • Loading branch information
etpinard committed Feb 8, 2019
commit 0ab5b6f470c180de82c7c357142f1d043fd01615
2 changes: 2 additions & 0 deletions src/traces/splom/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

var scatterAttrs = require('../scatter/attributes');
var colorAttrs = require('../../components/colorscale/attributes');
var hovertemplateAttrs = require('../../components/fx/hovertemplate_attributes');
var scatterGlAttrs = require('../scattergl/attributes');
var cartesianIdRegex = require('../../plots/cartesian/constants').idRegex;
var templatedArray = require('../../plot_api/plot_template').templatedArray;
Expand Down Expand Up @@ -123,6 +124,7 @@ module.exports = {
'this trace\'s (x,y) coordinates.'
].join(' ')
}),
< 8000 span class='blob-code-inner blob-code-marker ' data-code-marker="+"> hovertemplate: hovertemplateAttrs(),

marker: markerAttrs,

Expand Down
1 change: 1 addition & 0 deletions src/traces/splom/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
}

coerce('text');
coerce('hovertemplate');

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

Expand Down
12 changes: 12 additions & 0 deletions test/jasmine/tests/splom_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,6 +1360,18 @@ describe('Test splom hover:', function() {
nums: 'Apr 2003',
axis: 'Jan 2000',
evtPts: [{x: '2000-01-01', y: '2003-04-21', pointNumber: 0}]
}, {
desc: 'with a hovertemplate',
patch: function(fig) {
fig.data.forEach(function(t) {
t.hovertemplate = '%{x}|%{y}<extra>pt %{pointNumber}</extra>';
});
fig.layout.hovermode = 'closest';
return fig;
},
nums: '2.6|7.7',
name: 'pt 18',
evtPts: [{x: 2.6, y: 7.7, pointNumber: 18, curveNumber: 2}]
}];

specs.forEach(function(s) {
Expand Down
0