Skip to content

Commit e91c3bc

Browse files
authoredNov 28, 2016
Merge pull request #1198 from plotly/fix-violins
Remove erroneous traces in multi-subplot layout containing fill-to scatter traces
2 parents b9a379b + de4aa54 commit e91c3bc

File tree

3 files changed

+3665
-3
lines changed

3 files changed

+3665
-3
lines changed
 

‎src/plots/cartesian/index.js

+6-3
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

‎test/image/baselines/violins.png

37.5 KB
Loading

‎test/image/mocks/violins.json

+3,659
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
Please sign in to comment.