Skip to content

Commit 571950e

Browse files
committed
wip work for !diagonal.visible + !show(upper|lower)half
1 parent b283919 commit 571950e

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

src/plots/plots.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ plots.supplyDefaults = function(gd) {
291291

292292
var context = gd._context || {};
293293

294-
var i, j;
294+
var i;
295295

296296
// Create all the storage space for frames, but only if doesn't already exist
297297
if(!gd._transitionData) plots.createTransitionData(gd);
@@ -366,8 +366,10 @@ plots.supplyDefaults = function(gd) {
366366
newFullLayout._modules = [];
367367
newFullLayout._basePlotModules = [];
368368
var subplots = newFullLayout._subplots = emptySubplotLists();
369+
370+
// initialize axis and subplot hash objects for splom-generated grids
369371
var splomAxes = newFullLayout._splomAxes = {x: {}, y: {}};
370-
var splomSubplots = newFullLayout._splomSubplots = {}
372+
var splomSubplots = newFullLayout._splomSubplots = {};
371373

372374
// then do the data
373375
newFullLayout._globalTransforms = (gd._context || {}).globalTransforms;

src/traces/splom/defaults.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,20 @@ function handleDimensionsDefaults(traceIn, traceOut) {
108108
function handleAxisDefaults(traceIn, traceOut, layout, coerce) {
109109
var dimensions = traceOut.dimensions;
110110
var dimLength = dimensions.length;
111-
var xaxesDflt = new Array(dimLength);
112-
var yaxesDflt = new Array(dimLength);
113111
var i, j;
114112

115113
var showUpper = traceOut.showupperhalf;
116114
var showLower = traceOut.showlowerhalf;
117115
var showDiagonal = traceOut.diagonal.visible;
118116

119-
// var axLen = !showDiagonal && (!showUpper || !showLower) ?
120-
// dimLength - 1 :
121-
// dimLength;
117+
var axLength = !showDiagonal && (!showUpper || !showLower) ?
118+
dimLength - 1 :
119+
dimLength;
122120

123-
for(i = 0; i < dimLength; i++) {
121+
var xaxesDflt = new Array(axLength);
122+
var yaxesDflt = new Array(axLength);
123+
124+
for(i = 0; i < axLength; i++) {
124125
xaxesDflt[i] = 'x' + (i ? i + 1 : '');
125126
yaxesDflt[i] = 'y' + (i ? i + 1 : '');
126127
}
@@ -168,5 +169,6 @@ function handleAxisDefaults(traceIn, traceOut, layout, coerce) {
168169
}
169170
}
170171

171-
// console.log(Object.keys(layout._splomSubplots))
172+
console.log(xaxes, yaxes);
173+
console.log(Object.keys(layout._splomSubplots))
172174
}

0 commit comments

Comments
 (0)