Skip to content

Commit

Permalink
plotly#189 adding axis attributes to cartesian plots and gl3d plots
Browse files Browse the repository at this point in the history
  • Loading branch information
monfera committed Apr 13, 2016
1 parent c53a00a commit 94e0133
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/plots/cartesian/layout_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,36 @@ module.exports = {
'Only has an effect if `anchor` is set to *free*.'
].join(' ')
},
categorymode: {
valType: 'enumerated',
values: [
'trace', 'category ascending', 'category descending', 'array'
/*, 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
],
dflt: 'trace',
role: 'info',
description: [
'Specifies the ordering logic for the case of categorical variables.',
'By default, plotly uses *trace*, which specifies the order that is present in the data supplied.',
'Set `categorymode` to *category ascending* or *category descending* if order should be determined by',
'the alphanumerical order of the category names.',
/*'Set `categorymode` to *value ascending* or *value descending* if order should be determined by the',
'numerical order of the values.',*/ // // value ascending / descending to be implemented later
'Set `categorymode` to *array* to derive the ordering from the attribute `categorylist`. If a category',
'is not found in the `categorylist` array, the sorting behavior for that attribute will be identical to',
'the *trace* mode. The unspecified categories will follow the categories in `categorylist`.'
].join(' ')
},
categorylist: {
valType: 'data_array',
role: 'info',
description: [
'Sets the order in which categories on this axis appear.',
'Only has an effect if `categorymode` is set to *array*.',
'Used with `categorymode`.'
].join(' ')
},


_deprecated: {
autotick: {
Expand Down
29 changes: 29 additions & 0 deletions src/plots/gl3d/layout/axis_attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,35 @@ module.exports = {
description: 'Sets whether or not this axis is labeled'
},
color: axesAttrs.color,
categorymode: {
valType: 'enumerated',
values: [
'trace', 'category ascending', 'category descending', 'array'
/*, 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later
],
dflt: 'trace',
role: 'info',
description: [
'Specifies the ordering logic for the case of categorical variables.',
'By default, plotly uses *trace*, which specifies the order that is present in the data supplied.',
'Set `categorymode` to *category ascending* or *category descending* if order should be determined by',
'the alphanumerical order of the category names.',
/*'Set `categorymode` to *value ascending* or *value descending* if order should be determined by the',
'numerical order of the values.',*/ // // value ascending / descending to be implemented later
'Set `categorymode` to *array* to derive the ordering from the attribute `categorylist`. If a category',
'is not found in the `categorylist` array, the sorting behavior for that attribute will be identical to',
'the *trace* mode. The unspecified categories will follow the categories in `categorylist`.'
].join(' ')
},
categorylist: {
valType: 'data_array',
role: 'info',
description: [
'Sets the order in which categories on this axis appear.',
'Only has an effect if `categorymode` is set to *array*.',
'Used with `categorymode`.'
].join(' ')
},
title: axesAttrs.title,
titlefont: axesAttrs.titlefont,
type: axesAttrs.type,
Expand Down

0 comments on commit 94e0133

Please sign in to comment.