Skip to content

Commit 3f18627

Browse files
committed
Fix carpet indexing bug
1 parent 0136aa3 commit 3f18627

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/plots/plots.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -700,19 +700,23 @@ plots.supplyDataDefaults = function(dataIn, dataOut, layout, fullLayout) {
700700
}
701701

702702
if(Registry.traceIs(fullTrace, 'carpetDependent')) {
703-
carpetDependents.push(fullTrace._expandedIndex);
703+
carpetDependents.push(i);
704704
}
705705
}
706706

707-
708707
for(i = 0; i < carpetDependents.length; i++) {
709708
fullTrace = dataOut[carpetDependents[i]];
709+
710+
if(!fullTrace.visible) continue;
711+
710712
var carpetAxis = carpetIndex[fullTrace.carpetid];
711713
fullTrace._carpet = carpetAxis;
714+
712715
if(!carpetAxis || !carpetAxis.visible) {
713716
fullTrace.visible = false;
714717
continue;
715718
}
719+
716720
fullTrace.xaxis = carpetAxis.xaxis;
717721
fullTrace.yaxis = carpetAxis.yaxis;
718722
}

src/traces/carpet/lookup_carpetid.js

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ module.exports = function(gd, trace) {
1717
var firstAxis;
1818
for(var i = 0; i < n; i++) {
1919
var maybeCarpet = gd._fullData[i];
20+
21+
if(maybeCarpet.index === trace.index) continue;
22+
2023
if(maybeCarpet.type === 'carpet') {
2124
if(!firstAxis) {
2225
firstAxis = maybeCarpet;

0 commit comments

Comments
 (0)