Skip to content

Commit 6226cea

Browse files
committed
rename setPositions -> crossTraceCalc
... and set_positions.js files -> cross_trace_calc.js
1 parent 2381510 commit 6226cea

File tree

12 files changed

+23
-23
lines changed

12 files changed

+23
-23
lines changed

src/plots/plots.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2576,7 +2576,7 @@ plots.doSetPositions = function(gd) {
25762576

25772577
for(j = 0; j < modules.length; j++) {
25782578
var _module = modules[j];
2579-
var fn = _module.setPositions;
2579+
var fn = _module.crossTraceCalc;
25802580
if(fn) {
25812581
var spType = _module.basePlotModule.name;
25822582
if(hash[spType]) {

src/traces/bar/set_positions.js renamed to src/traces/bar/cross_trace_calc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var Sieve = require('./sieve.js');
2424
* now doing this one subplot at a time
2525
*/
2626

27-
module.exports = function setPositions(gd, plotinfo) {
27+
module.exports = function crossTraceCalc(gd, plotinfo) {
2828
var xa = plotinfo.xaxis,
2929
ya = plotinfo.yaxis;
3030

src/traces/bar/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Bar.layoutAttributes = require('./layout_attributes');
1616
Bar.supplyDefaults = require('./defaults');
1717
Bar.supplyLayoutDefaults = require('./layout_defaults');
1818
Bar.calc = require('./calc');
19-
Bar.setPositions = require('./set_positions');
19+
Bar.crossTraceCalc = require('./cross_trace_calc');
2020
Bar.colorbar = require('../scatter/marker_colorbar');
2121
Bar.arraysToCalcdata = require('./arrays_to_calcdata');
2222
Bar.plot = require('./plot');

src/traces/box/set_positions.js renamed to src/traces/box/cross_trace_calc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var Lib = require('../../lib');
1313

1414
var orientations = ['v', 'h'];
1515

16-
function setPositions(gd, plotinfo) {
16+
function crossTraceCalc(gd, plotinfo) {
1717
var calcdata = gd.calcdata;
1818
var xa = plotinfo.xaxis;
1919
var ya = plotinfo.yaxis;
@@ -109,6 +109,6 @@ function setPositionOffset(traceType, gd, boxList, posAxis, pad) {
109109
}
110110

111111
module.exports = {
112-
setPositions: setPositions,
112+
crossTraceCalc: crossTraceCalc,
113113
setPositionOffset: setPositionOffset
114114
};

src/traces/box/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Box.layoutAttributes = require('./layout_attributes');
1515
Box.supplyDefaults = require('./defaults').supplyDefaults;
1616
Box.supplyLayoutDefaults = require('./layout_defaults').supplyLayoutDefaults;
1717
Box.calc = require('./calc');
18-
Box.setPositions = require('./set_positions').setPositions;
18+
Box.crossTraceCalc = require('./cross_trace_calc').crossTraceCalc;
1919
Box.plot = require('./plot').plot;
2020
Box.style = require('./style').style;
2121
Box.styleOnSelect = require('./style').styleOnSelect;

src/traces/candlestick/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ module.exports = {
3232
attributes: require('./attributes'),
3333
layoutAttributes: require('../box/layout_attributes'),
3434
supplyLayoutDefaults: require('../box/layout_defaults').supplyLayoutDefaults,
35-
setPositions: require('../box/set_positions').setPositions,
35+
crossTraceCalc: require('../box/cross_trace_calc').crossTraceCalc,
3636
supplyDefaults: require('./defaults'),
3737
calc: require('./calc'),
3838
plot: require('../box/plot').plot,

src/traces/histogram/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
/**
1313
* Histogram has its own attribute, defaults and calc steps,
1414
* but uses bar's plot to display
15-
* and bar's setPositions for stacking and grouping
15+
* and bar's crossTraceCalc (formally known as setPositions) for stacking and grouping
1616
*/
1717

1818
/**
@@ -30,7 +30,7 @@ Histogram.layoutAttributes = require('../bar/layout_attributes');
3030
Histogram.supplyDefaults = require('./defaults');
3131
Histogram.supplyLayoutDefaults = require('../bar/layout_defaults');
3232
Histogram.calc = require('./calc');
33-
Histogram.setPositions = require('../bar/set_positions');
33+
Histogram.crossTraceCalc = require('../bar/cross_trace_calc');
3434
Histogram.plot = require('../bar/plot');
3535
Histogram.layerName = 'barlayer';
3636
Histogram.style = require('../bar/style').style;

src/traces/violin/set_positions.js renamed to src/traces/violin/cross_trace_calc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
'use strict';
1010

11-
var setPositionOffset = require('../box/set_positions').setPositionOffset;
11+
var setPositionOffset = require('../box/cross_trace_calc').setPositionOffset;
1212
var orientations = ['v', 'h'];
1313

14-
module.exports = function setPositions(gd, plotinfo) {
14+
module.exports = function crossTraceCalc(gd, plotinfo) {
1515
var calcdata = gd.calcdata;
1616
var xa = plotinfo.xaxis;
1717
var ya = plotinfo.yaxis;

src/traces/violin/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
supplyDefaults: require('./defaults'),
1515
supplyLayoutDefaults: require('./layout_defaults'),
1616
calc: require('./calc'),
17-
setPositions: require('./set_positions'),
17+
crossTraceCalc: require('./cross_trace_calc'),
1818
plot: require('./plot'),
1919
style: require('./style'),
2020
styleOnSelect: require('../scatter/style').styleOnSelect,

test/jasmine/tests/bar_test.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ describe('Bar.supplyDefaults', function() {
171171
});
172172
});
173173

174-
describe('bar calc / setPositions', function() {
174+
describe('bar calc / crossTraceCalc (formally known as setPositions)', function() {
175175
'use strict';
176176

177177
it('should fill in calc pt fields (stack case)', function() {
@@ -337,7 +337,7 @@ describe('Bar.calc', function() {
337337
});
338338
});
339339

340-
describe('Bar.setPositions', function() {
340+
describe('Bar.crossTraceCalc (formally known as setPositions)', function() {
341341
'use strict';
342342

343343
it('should guard against invalid offset items', function() {
@@ -1347,9 +1347,9 @@ describe('bar visibility toggling:', function() {
13471347
expect(fullLayout.xaxis.range).toBeCloseToArray(xrng, 2, msg + ' xrng');
13481348
expect(fullLayout.yaxis.range).toBeCloseToArray(yrng, 2, msg + ' yrng');
13491349

1350-
var setPositions = gd._fullData[0]._module.setPositions;
1351-
expect(setPositions).toHaveBeenCalledTimes(calls);
1352-
setPositions.calls.reset();
1350+
var crossTraceCalc = gd._fullData[0]._module.crossTraceCalc;
1351+
expect(crossTraceCalc).toHaveBeenCalledTimes(calls);
1352+
crossTraceCalc.calls.reset();
13531353
}
13541354

13551355
it('should update axis range according to visible edits (group case)', function(done) {
@@ -1358,7 +1358,7 @@ describe('bar visibility toggling:', function() {
13581358
{type: 'bar', x: [1, 2, 3], y: [-1, -2, -1]}
13591359
])
13601360
.then(function() {
1361-
spyOn(gd._fullData[0]._module, 'setPositions').and.callThrough();
1361+
spyOn(gd._fullData[0]._module, 'crossTraceCalc').and.callThrough();
13621362

13631363
_assert('base', [0.5, 3.5], [-2.222, 2.222], 0);
13641364
return Plotly.restyle(gd, 'visible', false, [1]);
@@ -1388,7 +1388,7 @@ describe('bar visibility toggling:', function() {
13881388
{type: 'bar', x: [1, 2, 3], y: [2, 3, 2]}
13891389
], {barmode: 'stack'})
13901390
.then(function() {
1391-
spyOn(gd._fullData[0]._module, 'setPositions').and.callThrough();
1391+
spyOn(gd._fullData[0]._module, 'crossTraceCalc').and.callThrough();
13921392

13931393
_assert('base', [0.5, 3.5], [0, 5.263], 0);
13941394
return Plotly.restyle(gd, 'visible', false, [1]);
@@ -1806,8 +1806,8 @@ function mockBarPlot(dataWithoutTraceType, layout) {
18061806
yaxis: gd._fullLayout.yaxis
18071807
};
18081808

1809-
// call Bar.setPositions
1810-
Bar.setPositions(gd, plotinfo);
1809+
// call Bar.crossTraceCalc
1810+
Bar.crossTraceCalc(gd, plotinfo);
18111811

18121812
return gd;
18131813
}

test/jasmine/tests/finance_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ describe('finance charts calc', function() {
380380
supplyAllDefaults(gd);
381381
Plots.doCalcdata(gd);
382382
gd.calcdata.forEach(function(cd) {
383-
// fill in some stuff that happens during setPositions or plot
383+
// fill in some stuff that happens during crossTraceCalc or plot
384384
if(cd[0].trace.type === 'candlestick') {
385385
var diff = cd[1].pos - cd[0].pos;
386386
cd[0].t.wHover = diff / 2;

test/jasmine/tests/histogram_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ describe('Test histogram', function() {
237237
var d73 = Date.UTC(1973, 0, 1);
238238
expect(out).toEqual([
239239
// full calcdata has x and y too (and t in the first one),
240-
// but those come later from setPositions.
240+
// but those come later from crossTraceCalc.
241241
{i: 0, b: 0, p: d70, s: 2, pts: [0, 1], p0: d70, p1: d70},
242242
{i: 1, b: 0, p: d71, s: 1, pts: [2], p0: d71, p1: d71},
243243
{i: 2, b: 0, p: d72, s: 0, pts: [], p0: d72, p1: d72},

0 commit comments

Comments
 (0)