Skip to content

Commit 9a75ef0

Browse files
authored
Merge pull request #4652 from plotly/change-rangebreak-operation-dflt
revise rangebreak operation default
2 parents 8f60909 + e8f4653 commit 9a75ef0

File tree

5 files changed

+27
-27
lines changed

5 files changed

+27
-27
lines changed

src/plots/cartesian/layout_attributes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ module.exports = {
329329
operation: {
330330
valType: 'enumerated',
331331
values: ['[]', '()', '[)', '(]'],
332-
dflt: '()',
332+
dflt: '[]',
333333
role: 'info',
334334
editType: 'calc',
335335
description: [

test/image/mocks/axes_breaks-finance.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -364,11 +364,11 @@
364364
"rangebreaks": [
365365
{
366366
"pattern": "%w",
367-
"bounds": [ 6, 0 ],
368-
"operation": "[]"
367+
"bounds": [ 6, 0 ]
369368
},
370369
{
371-
"values": ["2017-01-16"]
370+
"values": ["2017-01-16"],
371+
"operation": "()"
372372
}
373373
]
374374
},
@@ -377,11 +377,11 @@
377377
"rangebreaks": [
378378
{
379379
"pattern": "%w",
380-
"bounds": [ 6, 0 ],
381-
"operation": "[]"
380+
"bounds": [ 6, 0 ]
382381
},
383382
{
384-
"values": ["2017-01-16"]
383+
"values": ["2017-01-16"],
384+
"operation": "()"
385385
}
386386
]
387387
},

test/image/mocks/axes_breaks-tickvals.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
{"bounds": [
2121
"1969-12-31 23:59:59.999",
2222
"1970-01-01 00:00:00.090"
23-
]},
23+
], "operation": "()"},
2424
{"bounds": [
2525
"1970-01-01 00:00:00.101",
2626
"1970-01-01 00:00:00.189"
27-
]}
27+
], "operation": "()"}
2828
],
2929
"tickvals": [
3030
"1969-12-31 23:59:59.980",

test/image/mocks/axes_breaks-values.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"layout": {
1515
"xaxis": {
1616
"rangebreaks": [
17-
{ "values": [ "2020-01-04", "2020-01-05" ] }
17+
{ "values": [ "2020-01-04", "2020-01-05" ], "operation": "()" }
1818
]
1919
}
2020
}

test/jasmine/tests/axes_test.js

+17-17
Original file line numberDiff line numberDiff line change
@@ -4179,11 +4179,11 @@ describe('Test axes', function() {
41794179
}, {
41804180
xaxis: {
41814181
rangebreaks: [
4182-
{pattern: '%H', bounds: [17, 8]}
4182+
{pattern: '%H', bounds: [17, 8], operation: '()'}
41834183
]
41844184
}
41854185
});
4186-
_assert('with dflt operation', [
4186+
_assert('with () operation', [
41874187
1577952000000, BADNUM,
41884188
1578038400000, BADNUM,
41894189
1578124800000, BADNUM,
@@ -4207,7 +4207,7 @@ describe('Test axes', function() {
42074207
}, {
42084208
xaxis: {
42094209
rangebreaks: [
4210-
{pattern: '%H', bounds: [17, 8]}
4210+
{pattern: '%H', bounds: [17, 8], operation: '()'}
42114211
]
42124212
}
42134213
});
@@ -4284,7 +4284,7 @@ describe('Test axes', function() {
42844284
{bounds: [
42854285
'1970-01-01 00:00:00.002',
42864286
'1970-01-01 00:00:00.003'
4287-
]}
4287+
], operation: '()'}
42884288
]
42894289
}
42904290
});
@@ -4466,11 +4466,11 @@ describe('Test axes', function() {
44664466
{bounds: [
44674467
'1969-12-31 23:59:59.990',
44684468
'1970-01-01 00:00:00.089'
4469-
]},
4469+
], operation: '()'},
44704470
{bounds: [
44714471
'1970-01-01 00:00:00.101',
44724472
'1970-01-01 00:00:00.189'
4473-
]}
4473+
], operation: '()'}
44744474
];
44754475
return Plotly.react(gd, gd.data, gd.layout);
44764476
})
@@ -4506,11 +4506,11 @@ describe('Test axes', function() {
45064506
{bounds: [
45074507
'1969-12-31 23:59:59.989',
45084508
'1970-01-01 00:00:00.090'
4509-
]},
4509+
], operation: '()'},
45104510
{bounds: [
45114511
'1970-01-01 00:00:00.101',
45124512
'1970-01-01 00:00:00.300'
4513-
]}
4513+
], operation: '()'}
45144514
];
45154515
return Plotly.react(gd, gd.data, gd.layout);
45164516
})
@@ -4611,7 +4611,7 @@ describe('Test axes', function() {
46114611
})
46124612
.then(function() {
46134613
gd.layout.xaxis.rangebreaks = [
4614-
{pattern: '%w', bounds: [5, 1]}
4614+
{pattern: '%w', bounds: [5, 1], operation: '()'}
46154615
];
46164616
return Plotly.react(gd, gd.data, gd.layout);
46174617
})
@@ -4641,7 +4641,7 @@ describe('Test axes', function() {
46414641
})
46424642
.then(function() {
46434643
gd.layout.xaxis.rangebreaks = [
4644-
{pattern: '%w', bounds: [4, 6]}
4644+
{pattern: '%w', bounds: [4, 6], operation: '()'}
46454645
];
46464646
return Plotly.react(gd, gd.data, gd.layout);
46474647
})
@@ -4680,7 +4680,7 @@ describe('Test axes', function() {
46804680
})
46814681
.then(function() {
46824682
gd.layout.xaxis.rangebreaks = [
4683-
{pattern: '%H', bounds: [17, 8]}
4683+
{pattern: '%H', bounds: [17, 8], operation: '()'}
46844684
];
46854685
return Plotly.react(gd, gd.data, gd.layout);
46864686
})
@@ -4705,8 +4705,8 @@ describe('Test axes', function() {
47054705
})
47064706
.then(function() {
47074707
gd.layout.xaxis.rangebreaks = [
4708-
{pattern: '%w', bounds: [5, 1]},
4709-
{pattern: '%H', bounds: [17, 8]}
4708+
{pattern: '%w', bounds: [5, 1], operation: '()'},
4709+
{pattern: '%H', bounds: [17, 8], operation: '()'}
47104710
];
47114711
return Plotly.react(gd, gd.data, gd.layout);
47124712
})
@@ -4728,8 +4728,8 @@ describe('Test axes', function() {
47284728
})
47294729
.then(function() {
47304730
gd.layout.xaxis.rangebreaks = [
4731-
{pattern: '%H', bounds: [17, 8]},
4732-
{pattern: '%w', bounds: [5, 1]}
4731+
{pattern: '%H', bounds: [17, 8], operation: '()'},
4732+
{pattern: '%w', bounds: [5, 1], operation: '()'}
47334733
];
47344734
return Plotly.react(gd, gd.data, gd.layout);
47354735
})
@@ -4751,7 +4751,7 @@ describe('Test axes', function() {
47514751
})
47524752
.then(function() {
47534753
gd.layout.xaxis.rangebreaks = [
4754-
{pattern: '%H', bounds: [17, 8]}
4754+
{pattern: '%H', bounds: [17, 8], operation: '()'}
47554755
];
47564756
// N.B. xaxis.range[0] falls within a break
47574757
gd.layout.xaxis.autorange = false;
@@ -4772,7 +4772,7 @@ describe('Test axes', function() {
47724772
})
47734773
.then(function() {
47744774
gd.layout.xaxis.rangebreaks = [
4775-
{pattern: '%w', bounds: [1, 4]}
4775+
{pattern: '%w', bounds: [1, 4], operation: '()'}
47764776
];
47774777
// N.B. xaxis.range[0] falls within a break
47784778
gd.layout.xaxis.autorange = false;

0 commit comments

Comments
 (0)