Skip to content

Commit 95ecdce

Browse files
committed
fix scatter fill restyle regression
... by setting trace._ownfill on every linkTraces call, so we don't let relinkPrivateKeys mess things up. Previously, the scatter fill restyle test did not fail, but did log a error as Drawing.fillGroupStyle logs in a try-catch when things go wrong instead of errorring out.
1 parent 0a310c9 commit 95ecdce

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/traces/scatter/link_traces.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,11 @@ module.exports = function linkTraces(gd, plotinfo, cdscatter) {
7575
}
7676
}
7777

78-
if(trace.fill && (
79-
trace.fill.substr(0, 6) === 'tozero' || trace.fill === 'toself' ||
80-
(trace.fill.substr(0, 2) === 'to' && !trace._prevtrace))
81-
) {
82-
trace._ownfill = true;
83-
}
78+
trace._ownfill = (trace.fill && (
79+
trace.fill.substr(0, 6) === 'tozero' ||
80+
trace.fill === 'toself' ||
81+
(trace.fill.substr(0, 2) === 'to' && !trace._prevtrace)
82+
));
8483

8584
prevtraces[group] = trace;
8685
} else {

test/jasmine/tests/scatter_test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,10 @@ describe('end-to-end scatter tests', function() {
658658
// from any case to any other case.
659659
var indices = transitions(cases.length);
660660

661+
// Drawing.fillGroupStyle logs an error in a try-catch when
662+
// things go wrong
663+
spyOn(Lib, 'error');
664+
661665
var p = Plotly.plot(gd, [
662666
{y: [1, 2], text: 'a'},
663667
{y: [2, 3], text: 'b'},
@@ -707,6 +711,7 @@ describe('end-to-end scatter tests', function() {
707711
var msg = i ? ('from ' + cases[indices[i - 1]].name + ' to ') : 'from default to ';
708712
msg += name;
709713
assertMultiNodeOrder(selectorArray, msg);
714+
expect(Lib.error).not.toHaveBeenCalled();
710715
}; }
711716

712717
for(i = 0; i < indices.length; i++) {

0 commit comments

Comments
 (0)