diff --git a/src/plots/cartesian/axis_defaults.js b/src/plots/cartesian/axis_defaults.js index da4f7e6a97a..594ebdbaf49 100644 --- a/src/plots/cartesian/axis_defaults.js +++ b/src/plots/cartesian/axis_defaults.js @@ -187,7 +187,5 @@ function rangebreaksDefaults(itemIn, itemOut, containerOut) { return; } } - - coerce('operation'); } } diff --git a/src/plots/cartesian/layout_attributes.js b/src/plots/cartesian/layout_attributes.js index f2cef7d688a..2d219abd45c 100644 --- a/src/plots/cartesian/layout_attributes.js +++ b/src/plots/cartesian/layout_attributes.js @@ -273,7 +273,6 @@ module.exports = { editType: 'calc', description: [ 'Sets the lower and upper bounds of this axis rangebreak.', - 'Can be used with `operation` to determine the behavior at the bounds.', 'Can be used with `pattern`.' ].join(' ') }, @@ -292,7 +291,7 @@ module.exports = { 'Examples:', '- { pattern: \'' + DAY_OF_WEEK + '\', bounds: [6, 0] }', ' breaks from Saturday to Monday (i.e. skips the weekends).', - '- { pattern: \'' + HOUR + '\', bounds: [17, 8], operation: \'()\' }', // TODO: simplify after revise defaults + '- { pattern: \'' + HOUR + '\', bounds: [17, 8] }', ' breaks from 5pm to 8am (i.e. skips non-work hours).' ].join(' ') }, @@ -325,23 +324,6 @@ module.exports = { ].join(' ') }, - operation: { - valType: 'enumerated', - values: ['[]', '()', '[)', '(]'], - dflt: '[]', - role: 'info', - editType: 'calc', - description: [ - 'Determines if we include or not the bound values within the rangebreak.', - 'Closed interval bounds (i.e. starting with *[* or ending with *]*)', - 'include the bound value within the rangebreak and thus make coordinates', - 'equal to the bound disappear.', - 'Open interval bounds (i.e. starting with *(* or ending with *)*)', - 'does not include the bound value within the rangebreak and thus keep coordinates', - 'equal to the bound on the axis.' - ].join(' ') - }, - /* gap: { valType: 'number', diff --git a/src/plots/cartesian/set_convert.js b/src/plots/cartesian/set_convert.js index b03d034187c..22074c4297f 100644 --- a/src/plots/cartesian/set_convert.js +++ b/src/plots/cartesian/set_convert.js @@ -620,10 +620,6 @@ module.exports = function setConvert(ax, fullLayout) { var brk = rangebreaksIn[i]; if(brk.enabled) { - var op = brk.operation; - var op0 = op.charAt(0); - var op1 = op.charAt(1); - if(brk.bounds) { var pattern = brk.pattern; bnds = Lib.simpleMap(brk.bounds, pattern ? @@ -671,24 +667,13 @@ module.exports = function setConvert(ax, fullLayout) { break; } - if( - (op0 === '(' ? vb > b0 : vb >= b0) && - (op1 === ')' ? vb < b1 : vb <= b1) - ) return BADNUM; + if(vb >= b0 && vb < b1) return BADNUM; } else { var vals = Lib.simpleMap(brk.values, ax.d2c).sort(Lib.sorterAsc); - var onOpenBound = false; - for(var j = 0; j < vals.length; j++) { b0 = vals[j]; b1 = b0 + brk.dvalue; - if( - (op0 === '(' ? v > b0 : v >= b0) && - (op1 === ')' ? v < b1 : v <= b1) - ) return BADNUM; - - if(onOpenBound && op0 === '(' && v === b0) return BADNUM; - onOpenBound = op1 === ')' && v === b1; + if(v >= b0 && v < b1) return BADNUM; } } } @@ -737,14 +722,9 @@ module.exports = function setConvert(ax, fullLayout) { var brk = rangebreaksIn[i]; if(brk.enabled) { - var op = brk.operation; - var op0 = op.charAt(0); - var op1 = op.charAt(1); - if(brk.bounds) { if(brk.pattern) { bnds = Lib.simpleMap(brk.bounds, cleanNumber); - if(bnds[0] === bnds[1] && op === '()') continue; // r0 value as date var r0Date = new Date(r0); @@ -761,12 +741,11 @@ module.exports = function setConvert(ax, fullLayout) { switch(brk.pattern) { case WEEKDAY_PATTERN: - b0 = bnds[0] + (op0 === '(' ? 1 : 0); + b0 = bnds[0]; b1 = bnds[1]; r0Pattern = r0Date.getUTCDay(); r0PatternDelta = b0 - r0Pattern; bndDelta = (b1 >= b0 ? b1 - b0 : (b1 + 7) - b0) * ONEDAY; - if(op1 === ']') bndDelta += ONEDAY; step = 7 * ONEDAY; t = r0 + r0PatternDelta * ONEDAY - diff --git a/test/image/baselines/axes_breaks-bars.png b/test/image/baselines/axes_breaks-bars.png deleted file mode 100644 index 11469ee14a6..00000000000 Binary files a/test/image/baselines/axes_breaks-bars.png and /dev/null differ diff --git a/test/image/baselines/axes_breaks-rangeslider.png b/test/image/baselines/axes_breaks-rangeslider.png index eb3302b7d82..92d31fef552 100644 Binary files a/test/image/baselines/axes_breaks-rangeslider.png and b/test/image/baselines/axes_breaks-rangeslider.png differ diff --git a/test/image/baselines/axes_breaks-values.png b/test/image/baselines/axes_breaks-values.png index c998de4ce71..726043589b7 100644 Binary files a/test/image/baselines/axes_breaks-values.png and b/test/image/baselines/axes_breaks-values.png differ diff --git a/test/image/baselines/axes_breaks-weekends-weeknights.png b/test/image/baselines/axes_breaks-weekends-weeknights.png index fec2920693b..270bf568e4f 100644 Binary files a/test/image/baselines/axes_breaks-weekends-weeknights.png and b/test/image/baselines/axes_breaks-weekends-weeknights.png differ diff --git a/test/image/mocks/axes_breaks-bars.json b/test/image/mocks/axes_breaks-bars.json deleted file mode 100644 index addfa7ccbc0..00000000000 --- a/test/image/mocks/axes_breaks-bars.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "data": [ - { - "type": "bar", - "y": [ - "1970-01-01 00:00:00.000", - "1970-01-01 00:00:00.002" - ], - "x": [ 1, 2 ], - "orientation": "h", - "marker": { - "color": ["purple", "orange"], - "opacity": [1, 0.5] - } - } - ], - "layout": { - "title": { - "text": "Bars centered on open breaks bounds
should show bars even though pos -/+ dPos falls within break", - "x": 0, - "xref": "paper", - "font": {"size": 12} - }, - "yaxis": { - "rangebreaks": [ - { - "bounds": [ - "1970-01-01 00:00:00.000", - "1970-01-01 00:00:00.002" - ], - "operation": "()" - } - ] - } - } -} diff --git a/test/image/mocks/axes_breaks-finance.json b/test/image/mocks/axes_breaks-finance.json index 05c43622f4f..322413c6388 100644 --- a/test/image/mocks/axes_breaks-finance.json +++ b/test/image/mocks/axes_breaks-finance.json @@ -364,11 +364,10 @@ "rangebreaks": [ { "pattern": "day of week", - "bounds": [ 6, 0 ] + "bounds": [ 6, 1 ] }, { - "values": ["2017-01-16"], - "operation": "()" + "values": ["2017-01-16"] } ] }, @@ -377,11 +376,10 @@ "rangebreaks": [ { "pattern": "day of week", - "bounds": [ 6, 0 ] + "bounds": [ 6, 1 ] }, { - "values": ["2017-01-16"], - "operation": "()" + "values": ["2017-01-16"] } ] }, diff --git a/test/image/mocks/axes_breaks-night_autorange-reversed.json b/test/image/mocks/axes_breaks-night_autorange-reversed.json index fbc0dc878da..0dae491f6bf 100644 --- a/test/image/mocks/axes_breaks-night_autorange-reversed.json +++ b/test/image/mocks/axes_breaks-night_autorange-reversed.json @@ -196,8 +196,7 @@ "bounds": [ 18, 6 - ], - "operation": "[)" + ] } ], "domain": [ @@ -212,8 +211,7 @@ "bounds": [ 18, 6 - ], - "operation": "[)" + ] } ], "autorange": "reversed", @@ -257,8 +255,7 @@ "bounds": [ 18, 6 - ], - "operation": "[)" + ] } ], "anchor": "x3", @@ -274,8 +271,7 @@ "bounds": [ 18, 6 - ], - "operation": "[)" + ] } ], "autorange": "reversed", diff --git a/test/image/mocks/axes_breaks-rangeslider.json b/test/image/mocks/axes_breaks-rangeslider.json index a3c82646099..029b9158470 100644 --- a/test/image/mocks/axes_breaks-rangeslider.json +++ b/test/image/mocks/axes_breaks-rangeslider.json @@ -2655,23 +2655,19 @@ "rangebreaks": [ { "pattern": "day of week", - "bounds": [6, 0], - "operation": "[]" + "bounds": [6, 1] }, { "pattern": "hour", - "bounds": [0, 9], - "operation": "()" + "bounds": [0, 9] }, { "pattern": "hour", - "bounds": [12, 13], - "operation": "()" + "bounds": [12, 13] }, { "pattern": "hour", - "bounds": [15, 21], - "operation": "()" + "bounds": [15, 21] } ], "rangeslider": { "visible": true } diff --git a/test/image/mocks/axes_breaks-tickvals.json b/test/image/mocks/axes_breaks-tickvals.json index 83e7277ad72..ddebfa8ed8d 100644 --- a/test/image/mocks/axes_breaks-tickvals.json +++ b/test/image/mocks/axes_breaks-tickvals.json @@ -20,11 +20,11 @@ {"bounds": [ "1969-12-31 23:59:59.999", "1970-01-01 00:00:00.090" - ], "operation": "()"}, + ]}, {"bounds": [ "1970-01-01 00:00:00.101", "1970-01-01 00:00:00.189" - ], "operation": "()"} + ]} ], "tickvals": [ "1969-12-31 23:59:59.980", diff --git a/test/image/mocks/axes_breaks-values.json b/test/image/mocks/axes_breaks-values.json index a4b7bdbd5fb..beaf7de2f7c 100644 --- a/test/image/mocks/axes_breaks-values.json +++ b/test/image/mocks/axes_breaks-values.json @@ -14,7 +14,7 @@ "layout": { "xaxis": { "rangebreaks": [ - { "values": [ "2020-01-04", "2020-01-05" ], "operation": "()" } + { "values": [ "2020-01-03 23:59:59", "2020-01-05" ] } ] } } diff --git a/test/image/mocks/axes_breaks-weekends-weeknights.json b/test/image/mocks/axes_breaks-weekends-weeknights.json index a3513c42d75..29066d58ff7 100644 --- a/test/image/mocks/axes_breaks-weekends-weeknights.json +++ b/test/image/mocks/axes_breaks-weekends-weeknights.json @@ -16,13 +16,11 @@ "rangebreaks": [ { "pattern": "day of week", - "bounds": [ 6, 0 ], - "operation": "[]" + "bounds": [ 6, 1 ] }, { "pattern": "hour", - "bounds": [ 16, 8 ], - "operation": "()" + "bounds": [ 16.001, 8 ] } ] }, diff --git a/test/image/mocks/axes_breaks-weekends_autorange-reversed.json b/test/image/mocks/axes_breaks-weekends_autorange-reversed.json index cd0d5e8f59d..c5813f7bdfd 100644 --- a/test/image/mocks/axes_breaks-weekends_autorange-reversed.json +++ b/test/image/mocks/axes_breaks-weekends_autorange-reversed.json @@ -91,9 +91,8 @@ "pattern": "day of week", "bounds": [ 6, - 0 - ], - "operation": "[]" + 1 + ] } ], "domain": [ @@ -107,9 +106,8 @@ "pattern": "day of week", "bounds": [ 6, - 0 - ], - "operation": "[]" + 1 + ] } ], "autorange": "reversed", @@ -152,9 +150,8 @@ "pattern": "day of week", "bounds": [ 6, - 0 - ], - "operation": "[]" + 1 + ] } ], "anchor": "x3", @@ -169,9 +166,8 @@ "pattern": "day of week", "bounds": [ 6, - 0 - ], - "operation": "[]" + 1 + ] } ], "autorange": "reversed", diff --git a/test/jasmine/tests/axes_test.js b/test/jasmine/tests/axes_test.js index 0f18c61353c..71e4c26595e 100644 --- a/test/jasmine/tests/axes_test.js +++ b/test/jasmine/tests/axes_test.js @@ -1125,7 +1125,7 @@ describe('Test axes', function() { it('should only coerce rangebreaks *pattern* with *bounds*', function() { layoutIn = { xaxis: {type: 'date', rangebreaks: [{bounds: ['2020-01-04', '2020-01-05']}]}, - xaxis2: {type: 'date', rangebreaks: [{bounds: [6, 0], pattern: 'day of week'}]}, + xaxis2: {type: 'date', rangebreaks: [{bounds: [6, 1], pattern: 'day of week'}]}, xaxis3: {type: 'date', rangebreaks: [{values: ['2020-01-04', '2020-01-05'], pattern: 'NOP'}]}, }; layoutOut._subplots.xaxis.push('x2', 'x3'); @@ -4054,54 +4054,18 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {'operation': '()', bounds: [ - '1970-01-01 00:00:00.010', - '1970-01-01 00:00:00.090' - ]}, - {'operation': '()', bounds: [ - '1970-01-01 00:00:00.100', - '1970-01-01 00:00:00.190' - ]} - ] - } - }); - _assert('with operation:()', [0, 10, BADNUM, 90, 100, BADNUM, 190, 200]); - - _calc({ - x: x - }, { - xaxis: { - rangebreaks: [ - {'operation': '[]', bounds: [ - '1970-01-01 00:00:00.010', - '1970-01-01 00:00:00.090' - ]}, - {'operation': '[]', bounds: [ - '1970-01-01 00:00:00.100', - '1970-01-01 00:00:00.190' - ]} - ] - } - }); - _assert('with operation:[]', [0, BADNUM, BADNUM, BADNUM, BADNUM, BADNUM, BADNUM, 200]); - - _calc({ - x: x - }, { - xaxis: { - rangebreaks: [ - {'operation': '[)', bounds: [ + {bounds: [ '1970-01-01 00:00:00.010', '1970-01-01 00:00:00.090' ]}, - {'operation': '(]', bounds: [ + {bounds: [ '1970-01-01 00:00:00.100', '1970-01-01 00:00:00.190' ]} ] } }); - _assert('with mixed operation values', [0, BADNUM, BADNUM, 90, 100, BADNUM, BADNUM, 200]); + _assert('', [0, BADNUM, BADNUM, 90, BADNUM, BADNUM, 190, 200]); }); it('should discard coords within break bounds - date day of week case', function() { @@ -4132,38 +4096,11 @@ describe('Test axes', function() { _calc({x: x}, { xaxis: { rangebreaks: [ - {pattern: 'day of week', bounds: [6, 0], operation: '[]'} - ] - } - }); - _assert('[6,0]', noWeekend); - - _calc({x: x}, { - xaxis: { - rangebreaks: [ - {pattern: 'day of week', bounds: [5, 1], operation: '()'} - ] - } - }); - _assert('(5,1)', noWeekend); - - _calc({x: x}, { - xaxis: { - rangebreaks: [ - {pattern: 'day of week', bounds: [6, 1], operation: '[)'} + {pattern: 'day of week', bounds: [6, 1]} ] } }); - _assert('[6,1)', noWeekend); - - _calc({x: x}, { - xaxis: { - rangebreaks: [ - {pattern: 'day of week', bounds: [5, 0], operation: '(]'} - ] - } - }); - _assert('(5,0]', noWeekend); + _assert('[6,1]', noWeekend); }); it('should discard coords within break bounds - date hour case', function() { @@ -4179,11 +4116,11 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {pattern: 'hour', bounds: [17, 8], operation: '()'} + {pattern: 'hour', bounds: [17, 8]} ] } }); - _assert('with () operation', [ + _assert('', [ 1577952000000, BADNUM, 1578038400000, BADNUM, 1578124800000, BADNUM, @@ -4196,6 +4133,7 @@ describe('Test axes', function() { it('should discard coords within break bounds - date hour / high precision case', function() { _calc({ x: [ + '2020-01-03 16:45', '2020-01-03 17:00', '2020-01-03 17:15', '2020-01-03 17:30', @@ -4207,12 +4145,13 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {pattern: 'hour', bounds: [17, 8], operation: '()'} + {pattern: 'hour', bounds: [17, 8]} ] } }); - _assert('with dflt operation', [ - Lib.dateTime2ms('2020-01-03 17:00'), + _assert('', [ + Lib.dateTime2ms('2020-01-03 16:45'), + BADNUM, BADNUM, BADNUM, BADNUM, @@ -4241,13 +4180,13 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {pattern: 'hour', bounds: [23, 1], operation: '()'} + {pattern: 'hour', bounds: [23, 1]} ] } }); - _assert('with dflt operation', [ + _assert('', [ Lib.dateTime2ms('2020-01-01 22'), - Lib.dateTime2ms('2020-01-01 23'), + BADNUM, BADNUM, BADNUM, BADNUM, @@ -4280,13 +4219,13 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {pattern: 'hour', bounds: [23, 0], operation: '()'} + {pattern: 'hour', bounds: [23, 0]} ] } }); - _assert('with dflt operation', [ + _assert('', [ Lib.dateTime2ms('2020-01-01 22'), - Lib.dateTime2ms('2020-01-01 23'), + BADNUM, BADNUM, BADNUM, BADNUM, @@ -4319,13 +4258,13 @@ describe('Test axes', function() { }, { xaxis: { rangebreaks: [ - {pattern: 'hour', bounds: [23, 24], operation: '()'} + {pattern: 'hour', bounds: [23, 24]} ] } }); - _assert('with dflt operation', [ + _assert('', [ Lib.dateTime2ms('2020-01-01 22'), - Lib.dateTime2ms('2020-01-01 23'), + BADNUM, BADNUM, BADNUM, BADNUM, @@ -4362,7 +4301,7 @@ describe('Test axes', function() { ] } }); - _assert('with dflt operation', [ + _assert('', [ Lib.dateTime2ms('2020-01-01 22'), Lib.dateTime2ms('2020-01-01 23'), Lib.dateTime2ms('2020-01-01 23:30'), @@ -4423,10 +4362,10 @@ describe('Test axes', function() { rangebreaks: [{ values: [ '1970-01-01 00:00:00.002', '1970-01-01 00:00:00.003' - ], dvalue: 1, operation: '()' }] + ], dvalue: 1 }] } }); - _assert('', [1, 2, BADNUM, 4, 5]); + _assert('', [1, BADNUM, BADNUM, 4, 5]); }); it('should adapt coords generated from x0/dx about rangebreaks', function() { @@ -4440,11 +4379,11 @@ describe('Test axes', function() { {bounds: [ '1970-01-01 00:00:00.002', '1970-01-01 00:00:00.003' - ], operation: '()'} + ]} ] } }); - _assert('generated x=2.5 gets masked', [1, 1.5, 2, BADNUM, 3]); + _assert('generated x=2.5 gets masked', [1, 1.5, BADNUM, BADNUM, 3]); }); }); @@ -4622,11 +4561,11 @@ describe('Test axes', function() { {bounds: [ '1969-12-31 23:59:59.990', '1970-01-01 00:00:00.089' - ], operation: '()'}, + ]}, {bounds: [ '1970-01-01 00:00:00.101', '1970-01-01 00:00:00.189' - ], operation: '()'} + ]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4662,11 +4601,11 @@ describe('Test axes', function() { {bounds: [ '1969-12-31 23:59:59.989', '1970-01-01 00:00:00.090' - ], operation: '()'}, + ]}, {bounds: [ '1970-01-01 00:00:00.101', '1970-01-01 00:00:00.300' - ], operation: '()'} + ]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4767,7 +4706,7 @@ describe('Test axes', function() { }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [5, 1], operation: '()'} + {pattern: 'day of week', bounds: [6, 1]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4782,22 +4721,7 @@ describe('Test axes', function() { }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [6, 0], operation: '[]'} - ]; - return Plotly.react(gd, gd.data, gd.layout); - }) - .then(function() { - _assert('break over the weekend days (with operation:[])', 'x', { - rangebreaks: [ - ['2020-01-04', '2020-01-06'].map(Lib.dateTime2ms) - ], - m2: 0.000001640946501588664, - B: [-2589304.064, -2589587.619] - }); - }) - .then(function() { - gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [4, 6], operation: '()'} + {pattern: 'day of week', bounds: [5, 6]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4812,22 +4736,7 @@ describe('Test axes', function() { }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [5, 5], operation: '[]'} - ]; - return Plotly.react(gd, gd.data, gd.layout); - }) - .then(function() { - _assert('skip Friday (operation:[] version)', 'x', { - rangebreaks: [ - ['2020-01-03', '2020-01-04'].map(Lib.dateTime2ms) - ], - m2: 0.0000012658730158736563, - B: [-1997456.107, -1997565.478] - }); - }) - .then(function() { - gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [5, 5], operation: '()'} + {pattern: 'day of week', bounds: [5, 5]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4836,7 +4745,7 @@ describe('Test axes', function() { }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'hour', bounds: [17, 8], operation: '()'} + {pattern: 'hour', bounds: [17, 8]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4847,22 +4756,20 @@ describe('Test axes', function() { ['2020-01-03 17:00:00', '2020-01-04 08:00:00'].map(Lib.dateTime2ms), ['2020-01-04 17:00:00', '2020-01-05 08:00:00'].map(Lib.dateTime2ms), ['2020-01-05 17:00:00', '2020-01-06 08:00:00'].map(Lib.dateTime2ms), - ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms), - [Lib.dateTime2ms('2020-01-07 17:00:00'), 1578428892790] + ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms) ], - m2: 0.0000026100474550128112, + m2: 0.0000029537037039351, B: [ - -4118496.99495763, -4118637.937520201, - -4118778.8800827716, -4118919.8226453424, - -4119060.7652079132, -4119201.707770484, - -4119234.3145452295 + -4660771.917031818, -4660931.41703183, + -4661090.917031842, -4661250.417031854, + -4661409.9170318665, -4661569.417031879 ] }); }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [5, 1], operation: '()'}, - {pattern: 'hour', bounds: [17, 8], operation: '()'} + {pattern: 'day of week', bounds: [6, 1]}, + {pattern: 'hour', bounds: [17, 8]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4871,21 +4778,19 @@ describe('Test axes', function() { rangebreaks: [ ['2020-01-02 17:00:00', '2020-01-03 08:00:00'].map(Lib.dateTime2ms), ['2020-01-03 17:00:00', '2020-01-06 08:00:00'].map(Lib.dateTime2ms), - ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms), - [Lib.dateTime2ms('2020-01-07 17:00:00'), 1578424728526.6] + ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms) ], - m2: 0.000003915071184408763, + m2: 0.000004922839504765992, B: [ - -6177761.798805676, -6177973.212649634, - -6178861.150794258, -6179072.564638216, - -6179105.171412717 + -7767973.692224438, -7768239.525557696, + -7769356.025557376, -7769621.858890634 ] }); }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'hour', bounds: [17, 8], operation: '()'}, - {pattern: 'day of week', bounds: [5, 1], operation: '()'} + {pattern: 'hour', bounds: [17, 8]}, + {pattern: 'day of week', bounds: [6, 1]} ]; return Plotly.react(gd, gd.data, gd.layout); }) @@ -4894,20 +4799,18 @@ describe('Test axes', function() { rangebreaks: [ ['2020-01-02 17:00:00', '2020-01-03 08:00:00'].map(Lib.dateTime2ms), ['2020-01-03 17:00:00', '2020-01-06 08:00:00'].map(Lib.dateTime2ms), - ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms), - [Lib.dateTime2ms('2020-01-07 17:00:00'), 1578424728526.6] + ['2020-01-06 17:00:00', '2020-01-07 08:00:00'].map(Lib.dateTime2ms) ], - m2: 0.000003915071184408763, + m2: 0.000004922839504765992, B: [ - -6177761.798805676, -6177973.212649634, - -6178861.150794258, -6179072.564638216, - -6179105.171412717 + -7767973.692224438, -7768239.525557696, + -7769356.025557376, -7769621.858890634 ] }); }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'hour', bounds: [17, 8], operation: '()'} + {pattern: 'hour', bounds: [17, 8]} ]; // N.B. xaxis.range[0] falls within a break gd.layout.xaxis.autorange = false; @@ -4928,7 +4831,7 @@ describe('Test axes', function() { }) .then(function() { gd.layout.xaxis.rangebreaks = [ - {pattern: 'day of week', bounds: [1, 4], operation: '()'} + {pattern: 'day of week', bounds: [2, 4]} ]; // N.B. xaxis.range[0] falls within a break gd.layout.xaxis.autorange = false;