Skip to content

Commit ed24765

Browse files
committed
_commonLength -> _length
so aggregations and other common routines only have to look at _length
1 parent bbe3533 commit ed24765

File tree

9 files changed

+12
-12
lines changed

9 files changed

+12
-12
lines changed

src/plots/cartesian/type_defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ function getFirstNonEmptyTrace(data, id, axLetter) {
107107
var trace = data[i];
108108

109109
if(trace.type === 'splom' &&
110-
trace._commonLength > 0 &&
110+
trace._length > 0 &&
111111
trace['_' + axLetter + 'axes'][id]
112112
) {
113113
return trace;

src/traces/parcoords/calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ var wrap = require('../../lib/gup').wrap;
1515

1616
module.exports = function calc(gd, trace) {
1717
var cs = !!trace.line.colorscale && Lib.isArrayOrTypedArray(trace.line.color);
18-
var color = cs ? trace.line.color : constHalf(trace._commonLength);
18+
var color = cs ? trace.line.color : constHalf(trace._length);
1919
var cscale = cs ? trace.line.colorscale : [[0, trace.line.color], [1, trace.line.color]];
2020

2121
if(hasColorscale(trace, 'line')) {

src/traces/parcoords/defaults.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function handleLineDefaults(traceIn, traceOut, defaultColor, layout, coerce) {
2626
// TODO: I think it would be better to keep showing lines beyond the last line color
2727
// but I'm not sure what color to give these lines - probably black or white
2828
// depending on the background color?
29-
traceOut._commonLength = Math.min(traceOut._commonLength, lineColor.length);
29+
traceOut._length = Math.min(traceOut._length, lineColor.length);
3030
}
3131
else {
3232
traceOut.line.color = defaultColor;
@@ -84,7 +84,7 @@ function dimensionsDefaults(traceIn, traceOut) {
8484
dimensionsOut.push(dimensionOut);
8585
}
8686

87-
traceOut._commonLength = commonLength;
87+
traceOut._length = commonLength;
8888

8989
return dimensionsOut;
9090
}
@@ -108,7 +108,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout
108108
// but we can't do this in dimensionsDefaults (yet?) because line.color can also
109109
// truncate
110110
for(var i = 0; i < dimensions.length; i++) {
111-
if(dimensions[i].visible) dimensions[i]._length = traceOut._commonLength;
111+
if(dimensions[i].visible) dimensions[i]._length = traceOut._length;
112112
}
113113

114114
// make default font size 10px (default is 12),

src/traces/parcoords/parcoords.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function model(layout, d, i) {
142142
color: lineColor.map(d3.scale.linear().domain(dimensionExtent({
143143
values: lineColor,
144144
range: [line.cmin, line.cmax],
145-
_length: trace._commonLength
145+
_length: trace._length
146146
}))),
147147
blockLineCount: c.blockLineCount,
148148
canvasOverdrag: c.overdrag * c.canvasPixelRatio

src/traces/scattergl/convert.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function convertStyle(gd, trace) {
8787
}
8888

8989
function convertMarkerStyle(trace) {
90-
var count = trace._length || trace._commonLength;
90+
var count = trace._length;
9191
var optsIn = trace.marker;
9292
var optsOut = {};
9393
var i;

src/traces/splom/defaults.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function handleDimensionsDefaults(traceIn, traceOut) {
8686
if(dimOut.visible) dimOut._length = commonLength;
8787
}
8888

89-
traceOut._commonLength = commonLength;
89+
traceOut._length = commonLength;
9090

9191
return dimensionsOut.length;
9292
}

src/traces/splom/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ var TOO_MANY_POINTS = require('../scattergl/constants').TOO_MANY_POINTS;
2929

3030
function calc(gd, trace) {
3131
var dimensions = trace.dimensions;
32-
var commonLength = trace._commonLength;
32+
var commonLength = trace._length;
3333
var stash = {};
3434
var opts = {};
3535
// 'c' for calculated, 'l' for linear,
@@ -228,7 +228,7 @@ function plotOne(gd, cd0) {
228228
scene.unselectBatch = null;
229229

230230
if(selectMode) {
231-
var commonLength = trace._commonLength;
231+
var commonLength = trace._length;
232232

233233
if(!scene.selectBatch) {
234234
scene.selectBatch = [];

test/jasmine/tests/parcoords_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ describe('parcoords initialization tests', function() {
182182
{values: [], visible: true},
183183
{values: [1, 2], visible: false} // shouldn't be truncated to as visible: false
184184
]});
185-
expect(fullTrace._commonLength).toBe(3);
185+
expect(fullTrace._length).toBe(3);
186186
});
187187

188188
it('cleans up constraintrange', function() {

test/jasmine/tests/splom_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ describe('Test splom trace defaults:', function() {
8282
});
8383

8484
var fullTrace = gd._fullData[0];
85-
expect(fullTrace._commonLength).toBe(3, 'common length');
85+
expect(fullTrace._length).toBe(3, 'common length');
8686
expect(fullTrace.dimensions[0]._length).toBe(3, 'dim 0 length');
8787
expect(fullTrace.dimensions[1]._length).toBe(3, 'dim 1 length');
8888
expect(fullTrace.xaxes).toEqual(['x', 'x2']);

0 commit comments

Comments
 (0)