Skip to content

Commit

Permalink
Merge pull request #4652 from plotly/change-rangebreak-operation-dflt
Browse files Browse the repository at this point in the history
revise rangebreak operation default
  • Loading branch information
archmoj authored Mar 16, 2020
2 parents 8f60909 + e8f4653 commit 9a75ef0
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/plots/cartesian/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ module.exports = {
operation: {
valType: 'enumerated',
values: ['[]', '()', '[)', '(]'],
dflt: '()',
dflt: '[]',
role: 'info',
editType: 'calc',
description: [
Expand Down
12 changes: 6 additions & 6 deletions test/image/mocks/axes_breaks-finance.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,11 +364,11 @@
"rangebreaks": [
{
"pattern": "%w",
"bounds": [ 6, 0 ],
"operation": "[]"
"bounds": [ 6, 0 ]
},
{
"values": ["2017-01-16"]
"values": ["2017-01-16"],
"operation": "()"
}
]
},
Expand All @@ -377,11 +377,11 @@
"rangebreaks": [
{
"pattern": "%w",
"bounds": [ 6, 0 ],
"operation": "[]"
"bounds": [ 6, 0 ]
},
{
"values": ["2017-01-16"]
"values": ["2017-01-16"],
"operation": "()"
}
]
},
Expand Down
4 changes: 2 additions & 2 deletions test/image/mocks/axes_breaks-tickvals.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion test/image/mocks/axes_breaks-values.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"layout": {
"xaxis": {
"rangebreaks": [
{ "values": [ "2020-01-04", "2020-01-05" ] }
{ "values": [ "2020-01-04", "2020-01-05" ], "operation": "()" }
]
}
}
Expand Down
34 changes: 17 additions & 17 deletions test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4179,11 +4179,11 @@ describe('Test axes', function() {
}, {
xaxis: {
rangebreaks: [
{pattern: '%H', bounds: [17, 8]}
{pattern: '%H', bounds: [17, 8], operation: '()'}
]
}
});
_assert('with dflt operation', [
_assert('with () operation', [
1577952000000, BADNUM,
1578038400000, BADNUM,
1578124800000, BADNUM,
Expand All @@ -4207,7 +4207,7 @@ describe('Test axes', function() {
}, {
xaxis: {
rangebreaks: [
{pattern: '%H', bounds: [17, 8]}
{pattern: '%H', bounds: [17, 8], operation: '()'}
]
}
});
Expand Down Expand Up @@ -4284,7 +4284,7 @@ describe('Test axes', function() {
{bounds: [
'1970-01-01 00:00:00.002',
'1970-01-01 00:00:00.003'
]}
], operation: '()'}
]
}
});
Expand Down Expand Up @@ -4466,11 +4466,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);
})
Expand Down Expand Up @@ -4506,11 +4506,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);
})
Expand Down Expand Up @@ -4611,7 +4611,7 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%w', bounds: [5, 1]}
{pattern: '%w', bounds: [5, 1], operation: '()'}
];
return Plotly.react(gd, gd.data, gd.layout);
})
Expand Down Expand Up @@ -4641,7 +4641,7 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%w', bounds: [4, 6]}
{pattern: '%w', bounds: [4, 6], operation: '()'}
];
return Plotly.react(gd, gd.data, gd.layout);
})
Expand Down Expand Up @@ -4680,7 +4680,7 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%H', bounds: [17, 8]}
{pattern: '%H', bounds: [17, 8], operation: '()'}
];
return Plotly.react(gd, gd.data, gd.layout);
})
Expand All @@ -4705,8 +4705,8 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%w', bounds: [5, 1]},
{pattern: '%H', bounds: [17, 8]}
{pattern: '%w', bounds: [5, 1], operation: '()'},
{pattern: '%H', bounds: [17, 8], operation: '()'}
];
return Plotly.react(gd, gd.data, gd.layout);
})
Expand All @@ -4728,8 +4728,8 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%H', bounds: [17, 8]},
{pattern: '%w', bounds: [5, 1]}
{pattern: '%H', bounds: [17, 8], operation: '()'},
{pattern: '%w', bounds: [5, 1], operation: '()'}
];
return Plotly.react(gd, gd.data, gd.layout);
})
Expand All @@ -4751,7 +4751,7 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%H', bounds: [17, 8]}
{pattern: '%H', bounds: [17, 8], operation: '()'}
];
// N.B. xaxis.range[0] falls within a break
gd.layout.xaxis.autorange = false;
Expand All @@ -4772,7 +4772,7 @@ describe('Test axes', function() {
})
.then(function() {
gd.layout.xaxis.rangebreaks = [
{pattern: '%w', bounds: [1, 4]}
{pattern: '%w', bounds: [1, 4], operation: '()'}
];
// N.B. xaxis.range[0] falls within a break
gd.layout.xaxis.autorange = false;
Expand Down

0 comments on commit 9a75ef0

Please sign in to comment.