Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 6 additions & 1 deletion src/traces/bar/hover.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ function hoverOnBars(pointData, xval, yval, hovermode) {
var s = di[sizeLetter];

if(isWaterfall) {
s += Math.abs(di.rawS || 0);
var rawS = Math.abs(di.rawS) || 0;
if(v > 0) {
s += rawS;
} else if(v < 0) {
s -= rawS;
}
}

// add a gradient so hovering near the end of a
Expand Down
1 change: 1 addition & 0 deletions test/image/compare_pixels_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ if(allMock || argv.filter) {
}

var FLAKY_LIST = [
'treemap_coffee',
'treemap_textposition',
'treemap_with-without_values',
'trace_metatext',
Expand Down
7 changes: 7 additions & 0 deletions test/jasmine/tests/waterfall_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,13 @@ describe('waterfall hover', function() {
expect(out.style).toBeCloseToArray([1, '#FF4136', 1, -9.47]);
assertPos(out.pos, [137, 181, 266, 266]);
});

it('should return the correct hover point data (case closest - decreasing case, below y=0)', function() {
var out = _hover(gd, 1.8, -5, 'closest');

expect(out.style).toBeCloseToArray([2, '#3D9970', 2, 16.59]);
assertPos(out.pos, [260, 304, 21, 21]);
});
});

describe('text labels', function() {
Expand Down