Skip to content

Commit 5f9ce12

Browse files
committed
Partial draw: Correct traces selected based on fill
1 parent 12a034e commit 5f9ce12

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/plots/cartesian/index.js

+10-11
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,19 @@ exports.plot = function(gd, traces, transitionOpts) {
5757

5858
// Skip trace if whitelist provided and it's not whitelisted:
5959
// if (Array.isArray(traces) && traces.indexOf(i) === -1) continue;
60-
6160
if(trace.xaxis + trace.yaxis === subplot) {
62-
// Okay, so example: traces 0, 1, and 2 have fill = tonext. You animate
63-
// traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill
64-
// is outdated. So this retroactively adds the previous trace if the
65-
// traces are interdependent.
66-
if(pcd &&
67-
['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&
68-
cdSubplot.indexOf(pcd) === -1) {
69-
cdSubplot.push(pcd);
70-
}
71-
7261
// If this trace is specifically requested, add it to the list:
7362
if(traces.indexOf(trace.index) !== -1) {
63+
// Okay, so example: traces 0, 1, and 2 have fill = tonext. You animate
64+
// traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill
65+
// is outdated. So this retroactively adds the previous trace if the
66+
// traces are interdependent.
67+
if(pcd &&
68+
['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&
69+
cdSubplot.indexOf(pcd) === -1) {
70+
cdSubplot.push(pcd);
71+
}
72+
7473
cdSubplot.push(cd);
7574
}
7675

0 commit comments

Comments
 (0)