Skip to content

Commit 2018a74

Browse files
committed
prev trace changes fill hover the same way as it changes fill itself
1 parent 876bd1d commit 2018a74

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/traces/scatter/plot.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ module.exports = function plot(gd, plotinfo, cdscatter) {
4343

4444
// BUILD LINES AND FILLS
4545
var prevpath = '',
46+
prevPolygons = [],
4647
ownFillEl3, ownFillDir, tonext, nexttonext;
4748

4849
scattertraces.each(function(d) {
@@ -131,8 +132,9 @@ module.exports = function plot(gd, plotinfo, cdscatter) {
131132
// polygons for hover on fill
132133
// TODO: can we skip this if hoveron!=fills? That would mean we
133134
// need to redraw when you change hoveron...
134-
trace._polygons = new Array(segments.length);
135-
var i;
135+
var thisPolygons = trace._polygons = new Array(segments.length),
136+
i;
137+
136138
for(i = 0; i < segments.length; i++) {
137139
trace._polygons[i] = polygonTester(segments[i]);
138140
}
@@ -197,8 +199,10 @@ module.exports = function plot(gd, plotinfo, cdscatter) {
197199
// existing curve or off the end of it
198200
tonext.attr('d', fullpath + 'L' + prevpath.substr(1) + 'Z');
199201
}
202+
trace._polygons = trace._polygons.concat(prevPolygons);
200203
}
201204
prevpath = revpath;
205+
prevPolygons = thisPolygons;
202206
}
203207
});
204208

0 commit comments

Comments
 (0)