Skip to content

Commit 66c90fa

Browse files
author
Jon M. Mease
committed
Fixed tests to use new categoryorder, categoryarray, categorylabels construct
1 parent 5e60062 commit 66c90fa

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

src/traces/parcats/parcats.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1143,7 +1143,7 @@ function dragDimensionEnd(d) {
11431143

11441144
restyleData['dimensions[' + d.model.containerInd + '].categoryarray'] = [newCategoryArray];
11451145
restyleData['dimensions[' + d.model.containerInd + '].categorylabels'] = [newCategoryLabels];
1146-
restyleData['dimensions[' + d.model.containerInd + '].categoryorder'] = ['array'];
1146+
restyleData['dimensions[' + d.model.containerInd + '].categoryorder'] = 'array';
11471147
}
11481148
}
11491149

test/jasmine/tests/parcats_test.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -366,22 +366,22 @@ describe('Dimension reordered parcats trace', function() {
366366
{dimensionInd: 1, displayInd: 2, dimensionLabel: 'Two'});
367367

368368
checkCategoryCalc(gd, 1, 0, {
369-
categoryLabel: 'A',
369+
categoryLabel: 'B',
370370
dimensionInd: 1,
371371
categoryInd: 0,
372-
displayInd: 1});
372+
displayInd: 0});
373373

374374
checkCategoryCalc(gd, 1, 1, {
375-
categoryLabel: 'B',
375+
categoryLabel: 'A',
376376
dimensionInd: 1,
377377
categoryInd: 1,
378-
displayInd: 2});
378+
displayInd: 1});
379379

380380
checkCategoryCalc(gd, 1, 2, {
381381
categoryLabel: 'C',
382382
dimensionInd: 1,
383383
categoryInd: 2,
384-
displayInd: 0});
384+
displayInd: 2});
385385

386386
// ### Dimension 2 ###
387387
checkDimensionCalc(gd, 2,
@@ -402,9 +402,6 @@ describe('Dimension reordered parcats trace', function() {
402402
// Define bad display indexes [0, 2, 0]
403403
mock.data[0].dimensions[2].displayindex = 0;
404404

405-
// catDisplayInds for dimension 1 as [0, 2, 0]
406-
mock.data[0].dimensions[1].catDisplayInds[0] = 0;
407-
408405
Plotly.newPlot(gd, mock)
409406
.then(function() {
410407

@@ -440,12 +437,12 @@ describe('Dimension reordered parcats trace', function() {
440437
{dimensionInd: 1, displayInd: 1, dimensionLabel: 'Two'});
441438

442439
checkCategoryCalc(gd, 1, 0, {
443-
categoryLabel: 'A',
440+
categoryLabel: 'B',
444441
categoryInd: 0,
445442
displayInd: 0});
446443

447444
checkCategoryCalc(gd, 1, 1, {
448-
categoryLabel: 'B',
445+
categoryLabel: 'A',
449446
categoryInd: 1,
450447
displayInd: 1});
451448

@@ -737,7 +734,9 @@ describe('Drag to reordered dimensions and categories', function() {
737734
{'dimensions[0].displayindex': 0,
738735
'dimensions[1].displayindex': 2,
739736
'dimensions[2].displayindex': 1,
740-
'dimensions[1].catDisplayInds': [[ 1, 2, 0 ]]},
737+
'dimensions[1].categoryorder': 'array',
738+
'dimensions[1].categoryarray': [['C', 'A', 'B' ]],
739+
'dimensions[1].categorylabels': [['C', 'A', 'B' ]]},
741740
[0]]);
742741

743742
restyleCallback.calls.reset();

0 commit comments

Comments
 (0)