Skip to content

Commit 53f12da

Browse files
committed
plotly#189 PR feedback
1 parent 02ed858 commit 53f12da

File tree

2 files changed

+2
-76
lines changed

2 files changed

+2
-76
lines changed

src/plots/gl3d/layout/axis_attributes.js

+2-29
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,8 @@ 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-
},
71+
categorymode: axesAttrs.categorymode,
72+
categorylist: axesAttrs.categorylist,
10073
title: axesAttrs.title,
10174
titlefont: axesAttrs.titlefont,
10275
type: axesAttrs.type,

test/jasmine/tests/calcdata_test.js

-47
Original file line numberDiff line numberDiff line change
@@ -139,53 +139,6 @@ describe('calculated data and points', function() {
139139
});
140140
});
141141

142-
/*
143-
describe('codomain numerical category ordering', function() {
144-
145-
it('should output categories in ascending codomain numerical order', function() {
146-
147-
Plotly.plot(gd, [{x: ['c','a','e','b','d'], y: [15,11,12,13,14]}], { xaxis: {
148-
type: 'category',
149-
categorymode: 'value ascending'
150-
}});
151-
152-
expect(gd.calcdata[0][0].y).toEqual(11);
153-
expect(gd.calcdata[0][1].y).toEqual(12);
154-
expect(gd.calcdata[0][2].y).toEqual(13);
155-
expect(gd.calcdata[0][3].y).toEqual(14);
156-
expect(gd.calcdata[0][4].y).toEqual(15);
157-
});
158-
159-
it('should output categories in descending codomain numerical order', function() {
160-
161-
Plotly.plot(gd, [{x: ['c','a','e','b','d'], y: [15,11,12,13,14]}], { xaxis: {
162-
type: 'category',
163-
categorymode: 'value descending'
164-
}});
165-
166-
expect(gd.calcdata[0][0].y).toEqual(15);
167-
expect(gd.calcdata[0][1].y).toEqual(14);
168-
expect(gd.calcdata[0][2].y).toEqual(13);
169-
expect(gd.calcdata[0][3].y).toEqual(12);
170-
expect(gd.calcdata[0][4].y).toEqual(11);
171-
});
172-
173-
it('should output categories in descending codomain numerical order, excluding nulls', function() {
174-
175-
Plotly.plot(gd, [{x: ['c','a','e','b','d'], y: [15,11,null,13,14]}], { xaxis: {
176-
type: 'category',
177-
categorymode: 'value descending'
178-
}});
179-
180-
expect(gd.calcdata[0][0].y).toEqual(15);
181-
expect(gd.calcdata[0][1].y).toEqual(14);
182-
expect(gd.calcdata[0][2].y).toEqual(12);
183-
expect(gd.calcdata[0][3].y).toEqual(11);
184-
185-
});
186-
});
187-
*/
188-
189142
describe('explicit category ordering', function() {
190143

191144
it('should output categories in explicitly supplied order, independent of trace order', function() {

0 commit comments

Comments
 (0)