Skip to content

Commit 94e0133

Browse files
committed
plotly#189 adding axis attributes to cartesian plots and gl3d plots
1 parent c53a00a commit 94e0133

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

Diff for: src/plots/cartesian/layout_attributes.js

+30
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,36 @@ module.exports = {
465465
'Only has an effect if `anchor` is set to *free*.'
466466
].join(' ')
467467
},
468+
categorymode: {
469+
valType: 'enumerated',
470+
values: [
471+
'trace', 'category ascending', 'category descending', 'array'
472+
/*, 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
473+
],
474+
dflt: 'trace',
475+
role: 'info',
476+
description: [
477+
'Specifies the ordering logic for the case of categorical variables.',
478+
'By default, plotly uses *trace*, which specifies the order that is present in the data supplied.',
479+
'Set `categorymode` to *category ascending* or *category descending* if order should be determined by',
480+
'the alphanumerical order of the category names.',
481+
/*'Set `categorymode` to *value ascending* or *value descending* if order should be determined by the',
482+
'numerical order of the values.',*/ // // value ascending / descending to be implemented later
483+
'Set `categorymode` to *array* to derive the ordering from the attribute `categorylist`. If a category',
484+
'is not found in the `categorylist` array, the sorting behavior for that attribute will be identical to',
485+
'the *trace* mode. The unspecified categories will follow the categories in `categorylist`.'
486+
].join(' ')
487+
},
488+
categorylist: {
489+
valType: 'data_array',
490+
role: 'info',
491+
description: [
492+
'Sets the order in which categories on this axis appear.',
493+
'Only has an effect if `categorymode` is set to *array*.',
494+
'Used with `categorymode`.'
495+
].join(' ')
496+
},
497+
468498

469499
_deprecated: {
470500
autotick: {

Diff for: src/plots/gl3d/layout/axis_attributes.js

+29
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,35 @@ module.exports = {
6868
description: 'Sets whether or not this axis is labeled'
6969
},
7070
color: axesAttrs.color,
71+
categorymode: {
72+
valType: 'enumerated',
73+
values: [
74+
'trace', 'category ascending', 'category descending', 'array'
75+
/*, 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
76+
],
77+
dflt: 'trace',
78+
role: 'info',
79+
description: [
80+
'Specifies the ordering logic for the case of categorical variables.',
81+
'By default, plotly uses *trace*, which specifies the order that is present in the data supplied.',
82+
'Set `categorymode` to *category ascending* or *category descending* if order should be determined by',
83+
'the alphanumerical order of the category names.',
84+
/*'Set `categorymode` to *value ascending* or *value descending* if order should be determined by the',
85+
'numerical order of the values.',*/ // // value ascending / descending to be implemented later
86+
'Set `categorymode` to *array* to derive the ordering from the attribute `categorylist`. If a category',
87+
'is not found in the `categorylist` array, the sorting behavior for that attribute will be identical to',
88+
'the *trace* mode. The unspecified categories will follow the categories in `categorylist`.'
89+
].join(' ')
90+
},
91+
categorylist: {
92+
valType: 'data_array',
93+
role: 'info',
94+
description: [
95+
'Sets the order in which categories on this axis appear.',
96+
'Only has an effect if `categorymode` is set to *array*.',
97+
'Used with `categorymode`.'
98+
].join(' ')
99+
},
71100
title: axesAttrs.title,
72101
titlefont: axesAttrs.titlefont,
73102
type: axesAttrs.type,

0 commit comments

Comments
 (0)