Skip to content

Commit cb55c08

Browse files
committed
introduce null range and new autorange options
1 parent d787b9f commit cb55c08

File tree

2 files changed

+51
-21
lines changed

2 files changed

+51
-21
lines changed

src/plots/cartesian/layout_attributes.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,15 +272,20 @@ module.exports = {
272272
},
273273
autorange: {
274274
valType: 'enumerated',
275-
values: [true, false, 'reversed'],
275+
values: [true, false, 'reversed', 'min reversed', 'max reversed', 'min', 'max'],
276276
dflt: true,
277277
editType: 'axrange',
278278
impliedEdits: {'range[0]': undefined, 'range[1]': undefined},
279279
description: [
280280
'Determines whether or not the range of this axis is',
281281
'computed in relation to the input data.',
282282
'See `rangemode` for more info.',
283-
'If `range` is provided, then `autorange` is set to *false*.'
283+
'If `range` is provided, then `autorange` is set to *false*.',
284+
'Using *min* applys autorange only to set the minimum.',
285+
'Using *max* applys autorange only to set the maximum.',
286+
'Using *min reversed* applys autorange only to set the minimum on a reversed axis.',
287+
'Using *max reversed* applys autorange only to set the maximum on a reversed axis.',
288+
'Using *reversed* applys autorange on both ends and reverse the axis direction.',
284289
].join(' ')
285290
},
286291
autorangeoptions: {
@@ -363,7 +368,8 @@ module.exports = {
363368
'will be accepted and converted to strings.',
364369
'If the axis `type` is *category*, it should be numbers,',
365370
'using the scale where each category is assigned a serial',
366-
'number from zero in the order it appears.'
371+
'number from zero in the order it appears.',
372+
'Leaving either or both elements `null` impacts the default `autorange`.',
367373
].join(' ')
368374
},
369375
minallowed: {

test/plot-schema.json

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4297,15 +4297,19 @@
42974297
"valType": "angle"
42984298
},
42994299
"autorange": {
4300-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
4300+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
43014301
"dflt": true,
43024302
"editType": "plot",
43034303
"impliedEdits": {},
43044304
"valType": "enumerated",
43054305
"values": [
43064306
true,
43074307
false,
4308-
"reversed"
4308+
"reversed",
4309+
"min reversed",
4310+
"max reversed",
4311+
"min",
4312+
"max"
43094313
]
43104314
},
43114315
"autorangeoptions": {
@@ -4539,7 +4543,7 @@
45394543
},
45404544
"range": {
45414545
"anim": true,
4542-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
4546+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
45434547
"editType": "plot",
45444548
"impliedEdits": {
45454549
"autorange": false
@@ -5464,15 +5468,19 @@
54645468
}
54655469
},
54665470
"autorange": {
5467-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
5471+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
54685472
"dflt": true,
54695473
"editType": "plot",
54705474
"impliedEdits": {},
54715475
"valType": "enumerated",
54725476
"values": [
54735477
true,
54745478
false,
5475-
"reversed"
5479+
"reversed",
5480+
"min reversed",
5481+
"max reversed",
5482+
"min",
5483+
"max"
54765484
]
54775485
},
54785486
"autorangeoptions": {
@@ -5701,7 +5709,7 @@
57015709
},
57025710
"range": {
57035711
"anim": false,
5704-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
5712+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
57055713
"editType": "plot",
57065714
"impliedEdits": {
57075715
"autorange": false
@@ -6088,15 +6096,19 @@
60886096
}
60896097
},
60906098
"autorange": {
6091-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
6099+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
60926100
"dflt": true,
60936101
"editType": "plot",
60946102
"impliedEdits": {},
60956103
"valType": "enumerated",
60966104
"values": [
60976105
true,
60986106
false,
6099-
"reversed"
6107+
"reversed",
6108+
"min reversed",
6109+
"max reversed",
6110+
"min",
6111+
"max"
61006112
]
61016113
},
61026114
"autorangeoptions": {
@@ -6325,7 +6337,7 @@
63256337
},
63266338
"range": {
63276339
"anim": false,
6328-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
6340+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
63296341
"editType": "plot",
63306342
"impliedEdits": {
63316343
"autorange": false
@@ -6712,15 +6724,19 @@
67126724
}
67136725
},
67146726
"autorange": {
6715-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
6727+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
67166728
"dflt": true,
67176729
"editType": "plot",
67186730
"impliedEdits": {},
67196731
"valType": "enumerated",
67206732
"values": [
67216733
true,
67226734
false,
6723-
"reversed"
6735+
"reversed",
6736+
"min reversed",
6737+
"max reversed",
6738+
"min",
6739+
"max"
67246740
]
67256741
},
67266742
"autorangeoptions": {
@@ -6949,7 +6965,7 @@
69496965
},
69506966
"range": {
69516967
"anim": false,
6952-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
6968+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
69536969
"editType": "plot",
69546970
"impliedEdits": {
69556971
"autorange": false
@@ -10450,15 +10466,19 @@
1045010466
"valType": "flaglist"
1045110467
},
1045210468
"autorange": {
10453-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
10469+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
1045410470
"dflt": true,
1045510471
"editType": "axrange",
1045610472
"impliedEdits": {},
1045710473
"valType": "enumerated",
1045810474
"values": [
1045910475
true,
1046010476
false,
10461-
"reversed"
10477+
"reversed",
10478+
"min reversed",
10479+
"max reversed",
10480+
"min",
10481+
"max"
1046210482
]
1046310483
},
1046410484
"autorangeoptions": {
@@ -10902,7 +10922,7 @@
1090210922
},
1090310923
"range": {
1090410924
"anim": true,
10905-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
10925+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
1090610926
"editType": "axrange",
1090710927
"impliedEdits": {
1090810928
"autorange": false
@@ -11764,15 +11784,19 @@
1176411784
"valType": "flaglist"
1176511785
},
1176611786
"autorange": {
11767-
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*.",
11787+
"description": "Determines whether or not the range of this axis is computed in relation to the input data. See `rangemode` for more info. If `range` is provided, then `autorange` is set to *false*. Using *min* applys autorange only to set the minimum. Using *max* applys autorange only to set the maximum. Using *min reversed* applys autorange only to set the minimum on a reversed axis. Using *max reversed* applys autorange only to set the maximum on a reversed axis. Using *reversed* applys autorange on both ends and reverse the axis direction.",
1176811788
"dflt": true,
1176911789
"editType": "axrange",
1177011790
"impliedEdits": {},
1177111791
"valType": "enumerated",
1177211792
"values": [
1177311793
true,
1177411794
false,
11775-
"reversed"
11795+
"reversed",
11796+
"min reversed",
11797+
"max reversed",
11798+
"min",
11799+
"max"
1177611800
]
1177711801
},
1177811802
"autorangeoptions": {
@@ -12222,7 +12246,7 @@
1222212246
},
1222312247
"range": {
1222412248
"anim": true,
12225-
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears.",
12249+
"description": "Sets the range of this axis. If the axis `type` is *log*, then you must take the log of your desired range (e.g. to set the range from 1 to 100, set the range from 0 to 2). If the axis `type` is *date*, it should be date strings, like date data, though Date objects and unix milliseconds will be accepted and converted to strings. If the axis `type` is *category*, it should be numbers, using the scale where each category is assigned a serial number from zero in the order it appears. Leaving either or both elements `null` impacts the default `autorange`.",
1222612250
"editType": "axrange",
1222712251
"impliedEdits": {
1222812252
"autorange": false

0 commit comments

Comments
 (0)