Skip to content

Add hoverongaps to heatmap and contour for suppressing hovers on missing data #4291

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 4 commits into from
Oct 23, 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
rename hovergaps to hoverongaps
  • Loading branch information
archmoj committed Oct 21, 2019
commit dd3cfaf7984f5678a886f9ff9dc89c3d55e563e0
2 changes: 1 addition & 1 deletion src/traces/contour/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module.exports = extendFlat({
ytype: heatmapAttrs.ytype,
zhoverformat: heatmapAttrs.zhoverformat,
hovertemplate: heatmapAttrs.hovertemplate,
hovergaps: heatmapAttrs.hovergaps,
hoverongaps: heatmapAttrs.hoverongaps,
connectgaps: extendFlat({}, heatmapAttrs.connectgaps, {
description: [
'Determines whether or not gaps',
Expand Down
2 changes: 1 addition & 1 deletion src/traces/contour/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
coerce('text');
coerce('hovertext');
coerce('hovertemplate');
coerce('hovergaps');
coerce('hoverongaps');

var isConstraint = (coerce('contours.type') === 'constraint');
coerce('connectgaps', Lib.isArray1D(traceOut.z));
Expand Down
2 changes: 1 addition & 1 deletion src/traces/heatmap/attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ module.exports = extendFlat({
'Picks a smoothing algorithm use to smooth `z` data.'
].join(' ')
},
hovergaps: {
hoverongaps: {
valType: 'boolean',
dflt: true,
role: 'style',
Expand Down
2 changes: 1 addition & 1 deletion src/traces/heatmap/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout

handleStyleDefaults(traceIn, traceOut, coerce, layout);

coerce('hovergaps');
coerce('hoverongaps');
coerce('connectgaps', Lib.isArray1D(traceOut.z) && (traceOut.zsmooth !== false));

colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});
Expand Down
2 changes: 1 addition & 1 deletion src/traces/heatmap/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = function hoverPoints(pointData, xval, yval, hovermode, hoverLay
var zVal = z[ny][nx];
if(zmask && !zmask[ny][nx]) zVal = undefined;

if(zVal !== undefined || trace.hovergaps) {
if(zVal !== undefined || trace.hoverongaps) {
// dummy axis for formatting the z value
var cOpts = extractOpts(trace);
var dummyAx = {
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/contour_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -637,13 +637,13 @@ describe('contour hover', function() {
y: [100, 100, 101, 101],
z: [null, 1, 2, 3],
connectgaps: false,
hovergaps: false
hoverongaps: false
}]
}).then(done);
});
afterAll(destroyGraphDiv);

it('should not create zLabels when hovering on missing data and hovergaps is disabled', function() {
it('should not create zLabels when hovering on missing data and hoverongaps is disabled', function() {
var pt = _hover(gd, 10, 100)[0];

expect(pt.index).toEqual([0, 0], 'have correct index');
Expand Down
4 changes: 2 additions & 2 deletions test/jasmine/tests/heatmap_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,13 +988,13 @@ describe('heatmap hover', function() {
y: [100, 100, 101, 101],
z: [null, 1, 2, 3],
connectgaps: false,
hovergaps: false
hoverongaps: false
}]
}).then(done);
});
afterAll(destroyGraphDiv);

it('should not create zLabels when hovering on missing data and hovergaps is disabled', function() {
it('should not create zLabels when hovering on missing data and hoverongaps is disabled', function() {
var pt = _hover(gd, 10, 100)[0];

expect(pt.index).toEqual([0, 0], 'have correct index');
Expand Down