We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ad65c23 commit f986703Copy full SHA for f986703
test/jasmine/tests/transform_sort_test.js
@@ -134,6 +134,21 @@ describe('Test sort transform calc:', function() {
134
expect(out[0].y).toEqual([0, 2, 4, 3, 1]);
135
});
136
137
+ it('should sort via categorical targets', function() {
138
+ var trace = extend({
139
+ transforms: [{ target: 'marker.size' }]
140
+ });
141
+ trace.x = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'];
142
+
143
+ var out = _transform([trace]);
144
145
+ expect(out[0].x).toEqual(['F', 'D', 'C', 'E', 'A', 'G', 'B']);
146
+ expect(out[0].y).toEqual([3, 1, 3, 2, 1, 1, 2]);
147
+ expect(out[0].ids).toEqual(['p2', 'z', 'n2', 'p1', 'n0', 'p3', 'n1']);
148
+ expect(out[0].marker.size).toEqual([0, 1, 5, 6, 10, 10, 20]);
149
+ expect(out[0].marker.color).toEqual([0.3, 0.1, 0.3, 0.2, 0.1, 0.4, 0.2]);
150
151
152
it('should sort via custom targets', function() {
153
var out = _transform([extend({
154
transforms: [{
0 commit comments