Skip to content

Commit 6c58cf5

Browse files
committed
ensure only 'previous' trace of same subplot are included in calcdata
- which erroneous traces in multi-violin subplots.
1 parent 0fc99c6 commit 6c58cf5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/plots/cartesian/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,12 @@ exports.plot = function(gd, traces, transitionOpts, makeOnCompleteCallback) {
6868
// traces 0 and 2. Trace 1 also needs to be updated, otherwise its fill
6969
// is outdated. So this retroactively adds the previous trace if the
7070
// traces are interdependent.
71-
if(pcd &&
72-
['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&
73-
cdSubplot.indexOf(pcd) === -1) {
71+
if(
72+
pcd &&
73+
pcd[0].trace.xaxis + pcd[0].trace.yaxis === subplot &&
74+
['tonextx', 'tonexty', 'tonext'].indexOf(trace.fill) !== -1 &&
75+
cdSubplot.indexOf(pcd) === -1
76+
) {
7477
cdSubplot.push(pcd);
7578
}
7679

0 commit comments

Comments
 (0)