Skip to content

Commit dff40cc

Browse files
authored
Merge pull request #4641 from plotly/rename-breaks-to-rangebreaks
rename axis.breaks to axis.rangebreaks
2 parents add15b1 + cc49b99 commit dff40cc

20 files changed

+242
-242
lines changed

src/components/rangeslider/draw.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ module.exports = function(gd) {
136136
return (v - rl0) / drl * opts._width;
137137
};
138138

139-
if(axisOpts.breaks) {
139+
if(axisOpts.rangebreaks) {
140140
var rsBreaks = axisOpts.locateBreaks(rl0, rl1);
141141

142142
if(rsBreaks.length) {
@@ -169,7 +169,7 @@ module.exports = function(gd) {
169169
};
170170

171171
// fill pixel (i.e. 'p') min/max here,
172-
// to not have to loop through the _breaks twice during `p2d`
172+
// to not have to loop through the _rangebreaks twice during `p2d`
173173
for(j = 0; j < rsBreaks.length; j++) {
174174
brk = rsBreaks[j];
175175
brk.pmin = opts.d2p(brk.min);
@@ -455,8 +455,8 @@ function drawRangePlot(rangeSlider, gd, axisOpts, opts) {
455455
_context: gd._context
456456
};
457457

458-
if(axisOpts.breaks) {
459-
mockFigure.layout.xaxis.breaks = axisOpts.breaks;
458+
if(axisOpts.rangebreaks) {
459+
mockFigure.layout.xaxis.rangebreaks = axisOpts.rangebreaks;
460460
}
461461

462462
mockFigure.layout[oppAxisName] = {
@@ -466,8 +466,8 @@ function drawRangePlot(rangeSlider, gd, axisOpts, opts) {
466466
calendar: oppAxisOpts.calendar
467467
};
468468

469-
if(oppAxisOpts.breaks) {
470-
mockFigure.layout[oppAxisName].breaks = oppAxisOpts.breaks;
469+
if(oppAxisOpts.rangebreaks) {
470+
mockFigure.layout[oppAxisName].rangebreaks = oppAxisOpts.rangebreaks;
471471
}
472472

473473
Plots.supplyDefaults(mockFigure);

src/plots/cartesian/autorange.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ function getAutoRange(gd, ax) {
9595
// don't allow padding to reduce the data to < 10% of the length
9696
var minSpan = axLen / 10;
9797

98-
// find axis breaks in [v0,v1] and compute its length in value space
98+
// find axis rangebreaks in [v0,v1] and compute its length in value space
9999
var calcBreaksLength = function(v0, v1) {
100100
var lBreaks = 0;
101-
if(ax.breaks) {
102-
var breaksOut = ax.locateBreaks(v0, v1);
103-
for(var i = 0; i < breaksOut.length; i++) {
104-
var brk = breaksOut[i];
101+
if(ax.rangebreaks) {
102+
var rangebreaksOut = ax.locateBreaks(v0, v1);
103+
for(var i = 0; i < rangebreaksOut.length; i++) {
104+
var brk = rangebreaksOut[i];
105105
lBreaks += brk.max - brk.min;
106106
}
107107
}

src/plots/cartesian/axes.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -610,17 +610,17 @@ axes.calcTicks = function calcTicks(ax) {
610610

611611
generateTicks();
612612

613-
if(ax.breaks) {
613+
if(ax.rangebreaks) {
614614
var nTicksBefore = tickVals.length;
615615

616-
// remove ticks falling inside breaks
616+
// remove ticks falling inside rangebreaks
617617
tickVals = tickVals.filter(function(d) {
618618
return ax.maskBreaks(d.value) !== BADNUM;
619619
});
620620

621-
// if 'numerous' ticks get placed into breaks,
621+
// if 'numerous' ticks get placed into rangebreaks,
622622
// increase dtick to generate more ticks,
623-
// so that some hopefully fall between breaks
623+
// so that some hopefully fall between rangebreaks
624624
if(ax.tickmode === 'auto' && tickVals.length < nTicksBefore / 6) {
625625
axes.autoTicks(ax, ax._roughDTick / 3);
626626
autoTickRound(ax);
@@ -706,8 +706,8 @@ function arrayTicks(ax) {
706706

707707
if(j < vals.length) ticksOut.splice(j, vals.length - j);
708708

709-
if(ax.breaks) {
710-
// remove ticks falling inside breaks
709+
if(ax.rangebreaks) {
710+
// remove ticks falling inside rangebreaks
711711
ticksOut = ticksOut.filter(function(d) {
712712
return ax.maskBreaks(d.x) !== BADNUM;
713713
});
@@ -2871,7 +2871,7 @@ axes.shouldShowZeroLine = function(gd, ax, counterAxis) {
28712871
(rng[0] * rng[1] <= 0) &&
28722872
ax.zeroline &&
28732873
(ax.type === 'linear' || ax.type === '-') &&
2874-
!(ax.breaks && ax.maskBreaks(0) === BADNUM) &&
2874+
!(ax.rangebreaks && ax.maskBreaks(0) === BADNUM) &&
28752875
(
28762876
clipEnds(ax, 0) ||
28772877
!anyCounterAxLineAtZero(gd, ax, counterAxis, rng) ||

src/plots/cartesian/axis_defaults.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,12 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
120120
}
121121

122122
if(containerOut.type === 'date') {
123-
var breaks = containerIn.breaks;
124-
if(Array.isArray(breaks) && breaks.length) {
123+
var rangebreaks = containerIn.rangebreaks;
124+
if(Array.isArray(rangebreaks) && rangebreaks.length) {
125125
handleArrayContainerDefaults(containerIn, containerOut, {
126-
name: 'breaks',
126+
name: 'rangebreaks',
127127
inclusionAttr: 'enabled',
128-
handleItemDefaults: breaksDefaults
128+
handleItemDefaults: rangebreaksDefaults
129129
});
130130
setConvert(containerOut, layoutOut);
131131

@@ -135,7 +135,7 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
135135
if(trace.type === 'scattergl' || trace.type === 'splom') {
136136
trace.visible = false;
137137
Lib.warn(trace.type +
138-
' traces do not work on axes with breaks.' +
138+
' traces do not work on axes with rangebreaks.' +
139139
' Setting trace ' + trace.index + ' to `visible: false`.');
140140
}
141141
}
@@ -146,9 +146,9 @@ module.exports = function handleAxisDefaults(containerIn, containerOut, coerce,
146146
return containerOut;
147147
};
148148

149-
function breaksDefaults(itemIn, itemOut, containerOut) {
149+
function rangebreaksDefaults(itemIn, itemOut, containerOut) {
150150
function coerce(attr, dflt) {
151-
return Lib.coerce(itemIn, itemOut, layoutAttributes.breaks, attr, dflt);
151+
return Lib.coerce(itemIn, itemOut, layoutAttributes.rangebreaks, attr, dflt);
152152
}
153153

154154
var enabled = coerce('enabled');

src/plots/cartesian/dragbox.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@ function zoomAxRanges(axList, r0Fraction, r1Fraction, updates, linkedAxes) {
986986
var axi = axList[i];
987987
if(axi.fixedrange) continue;
988988

989-
if(axi.breaks) {
989+
if(axi.rangebreaks) {
990990
var isY = axi._id.charAt(0) === 'y';
991991
var r0F = isY ? (1 - r0Fraction) : r0Fraction;
992992
var r1F = isY ? (1 - r1Fraction) : r1Fraction;
@@ -1012,7 +1012,7 @@ function dragAxList(axList, pix) {
10121012
for(var i = 0; i < axList.length; i++) {
10131013
var axi = axList[i];
10141014
if(!axi.fixedrange) {
1015-
if(axi.breaks) {
1015+
if(axi.rangebreaks) {
10161016
var p0 = 0;
10171017
var p1 = axi._length;
10181018
var d0 = axi.p2l(p0 + pix) - axi.p2l(p0);

src/plots/cartesian/layout_attributes.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,15 @@ module.exports = {
249249
].join(' ')
250250
},
251251

252-
breaks: templatedArray('break', {
252+
rangebreaks: templatedArray('rangebreak', {
253253
enabled: {
254254
valType: 'boolean',
255255
role: 'info',
256256
dflt: true,
257257
editType: 'calc',
258258
description: [
259-
'Determines whether this axis break is enabled or disabled.',
260-
'Please note that `breaks` only work for *date* axis type.'
259+
'Determines whether this axis rangebreak is enabled or disabled.',
260+
'Please note that `rangebreaks` only work for *date* axis type.'
261261
].join(' ')
262262
},
263263

@@ -270,7 +270,7 @@ module.exports = {
270270
],
271271
editType: 'calc',
272272
description: [
273-
'Sets the lower and upper bounds of this axis break.',
273+
'Sets the lower and upper bounds of this axis rangebreak.',
274274
'Can be used with `operation` to determine the behavior at the bounds.',
275275
'Can be used with `pattern`.'
276276
].join(' ')
@@ -308,7 +308,7 @@ module.exports = {
308308
editType: 'calc'
309309
},
310310
description: [
311-
'Sets the coordinate values corresponding to the breaks.',
311+
'Sets the coordinate values corresponding to the rangebreaks.',
312312
'An alternative to `bounds`.',
313313
'Use `dvalue` to set the size of the values along the axis.'
314314
].join(' ')
@@ -333,12 +333,12 @@ module.exports = {
333333
role: 'info',
334334
editType: 'calc',
335335
description: [
336-
'Determines if we include or not the bound values within the break.',
336+
'Determines if we include or not the bound values within the rangebreak.',
337337
'Closed interval bounds (i.e. starting with *[* or ending with *]*)',
338-
'include the bound value within the break and thus make coordinates',
338+
'include the bound value within the rangebreak and thus make coordinates',
339339
'equal to the bound disappear.',
340340
'Open interval bounds (i.e. starting with *(* or ending with *)*)',
341-
'does not include the bound value within the break and thus keep coordinates',
341+
'does not include the bound value within the rangebreak and thus keep coordinates',
342342
'equal to the bound on the axis.'
343343
].join(' ')
344344
},
@@ -351,7 +351,7 @@ module.exports = {
351351
editType: 'calc',
352352
role: 'info',
353353
description: [
354-
'Sets the gap distance between the start and the end of this break.',
354+
'Sets the gap distance between the start and the end of this rangebreak.',
355355
'Use with `gapmode` to set the unit of measurement.'
356356
].join(' ')
357357
},

0 commit comments

Comments
 (0)