Skip to content

Commit c019c5c

Browse files
committed
shorten sieve option keys
1 parent 8a5c655 commit c019c5c

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/traces/bar/cross_trace_calc.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ function setGroupPositionsInOverlayMode(gd, pa, sa, calcTraces) {
165165
var calcTrace = calcTraces[i];
166166

167167
var sieve = new Sieve([calcTrace], {
168-
separateNegativeValues: false,
169-
dontMergeOverlappingData: !barnorm
168+
sepNegVal: false,
169+
overlapNoMerge: !barnorm
170170
});
171171

172172
// set bar offsets and widths, and update position axis
@@ -191,8 +191,8 @@ function setGroupPositionsInGroupMode(gd, pa, sa, calcTraces) {
191191
var barnorm = fullLayout.barnorm;
192192

193193
var sieve = new Sieve(calcTraces, {
194-
separateNegativeValues: false,
195-
dontMergeOverlappingData: !barnorm
194+
sepNegVal: false,
195+
overlapNoMerge: !barnorm
196196
});
197197

198198
// set bar offsets and widths, and update position axis
@@ -217,8 +217,8 @@ function setGroupPositionsInStackOrRelativeMode(gd, pa, sa, calcTraces) {
217217
var barnorm = fullLayout.barnorm;
218218

219219
var sieve = new Sieve(calcTraces, {
220-
separateNegativeValues: barmode === 'relative',
221-
dontMergeOverlappingData: !(barnorm || barmode === 'stack' || barmode === 'relative')
220+
sepNegVal: barmode === 'relative',
221+
overlapNoMerge: !(barnorm || barmode === 'stack' || barmode === 'relative')
222222
});
223223

224224
// set bar offsets and widths, and update position axis
@@ -591,8 +591,8 @@ function unhideBarsWithinTrace(gd, sa, sieve) {
591591

592592
if(fullTrace.base === undefined) {
593593
var inTraceSieve = new Sieve([calcTrace], {
594-
separateNegativeValues: true,
595-
dontMergeOverlappingData: true
594+
sepNegVal: true,
595+
overlapNoMerge: true
596596
});
597597

598598
for(var j = 0; j < calcTrace.length; j++) {

src/traces/bar/sieve.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ var BADNUM = require('../../constants/numerical').BADNUM;
2121
* @param {Array} traces
2222
* Array of calculated traces
2323
* @param {object} opts
24-
* - @param {boolean} [separateNegativeValues]
24+
* - @param {boolean} [sepNegVal]
2525
* If true, then split data at the same position into a bar
2626
* for positive values and another for negative values
27-
* - @param {boolean} [dontMergeOverlappingData]
27+
* - @param {boolean} [overlapNoMerge]
2828
* If true, then don't merge overlapping bars into a single bar
2929
*/
3030
function Sieve(traces, opts) {
3131
this.traces = traces;
32-
this.separateNegativeValues = opts.separateNegativeValues;
33-
this.dontMergeOverlappingData = opts.dontMergeOverlappingData;
32+
this.sepNegVal = opts.sepNegVal;
33+
this.overlapNoMerge = opts.overlapNoMerge;
3434

3535
// for single-bin histograms - see histogram/calc
3636
var width1 = Infinity;
@@ -81,7 +81,7 @@ Sieve.prototype.put = function put(position, value) {
8181
* @method
8282
* @param {number} position Position of datum
8383
* @param {number} [value] Value of datum
84-
* (required if this.separateNegativeValues is true)
84+
* (required if this.sepNegVal is true)
8585
* @returns {number} Current bin value
8686
*/
8787
Sieve.prototype.get = function put(position, value) {
@@ -95,14 +95,14 @@ Sieve.prototype.get = function put(position, value) {
9595
* @method
9696
* @param {number} position Position of datum
9797
* @param {number} [value] Value of datum
98-
* (required if this.separateNegativeValues is true)
98+
* (required if this.sepNegVal is true)
9999
* @returns {string} Bin label
100-
* (prefixed with a 'v' if value is negative and this.separateNegativeValues is
100+
* (prefixed with a 'v' if value is negative and this.sepNegVal is
101101
* true; otherwise prefixed with '^')
102102
*/
103103
Sieve.prototype.getLabel = function getLabel(position, value) {
104-
var prefix = (value < 0 && this.separateNegativeValues) ? 'v' : '^';
105-
var label = (this.dontMergeOverlappingData) ?
104+
var prefix = (value < 0 && this.sepNegVal) ? 'v' : '^';
105+
var label = (this.overlapNoMerge) ?
106106
position :
107107
Math.round(position / this.binWidth);
108108
return prefix + label;

0 commit comments

Comments
 (0)