8000 fix · maun/plotly.js@4ce3c0f · GitHub
[go: up one dir, main page]

Skip to content

Commit 4ce3c0f

Browse files
committed
fix
1 parent b8e1814 commit 4ce3c0f

File tree

2 files changed

+10
-14
lines changed

2 files changed

+10
-14
lines changed

src/plots/cartesian/set_convert.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,7 @@ module.exports = function setConvert(ax, fullLayout) {
613613
};
614614

615615
// sort the axis (and all the matching ones) by _initialCategories
616+
// returns the indices of the traces affected by the reordering
616617
ax.sortByInitialCategories = function() {
617618
var affectedTraces = [];
618619
var emptyCategories = function() {
@@ -630,19 +631,14 @@ module.exports = function setConvert(ax, fullLayout) {
630631

631632
affectedTraces = affectedTraces.concat(ax._traceIndices);
632633

633-
var matchGroups = fullLayout._axisMatchGroups;
634-
635-
if(matchGroups && matchGroups.length) {
636-
for(var i = 0; i < matchGroups.length; i++) {
637-
var group = matchGroups[i];
638-
for(var axId2 in group) {
639-
if(axId === axId2) continue;
640-
var ax2 = fullLayout[axisIds.id2name(axId2)];
641-
ax2._categories = ax._categories;
642-
ax2._categoriesMap = ax._categoriesMap;
643-
affectedTraces = affectedTraces.concat(ax2._traceIndices);
644-
}
645-
}
634+
// Propagate to matching axes
635+
var group = ax._matchGroup;
636+
for(var axId2 in group) {
637+
if(axId === axId2) continue;
638+
var ax2 = fullLayout[axisIds.id2name(axId2)];
639+
ax2._categories = ax._categories;
640+
ax2._categoriesMap = ax._categoriesMap;
641+
affectedTraces = affectedTraces.concat(ax2._traceIndices);
646642
}
647643
return affectedTraces;
648644
};

src/plots/plots.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ function sortAxisCategoriesByValue(axList, gd) {
30013001
}
30023002

30033003
// Sort all matching axes
3004-
affectedTraces = ax.sortByInitialCategories();
3004+
affectedTraces = affectedTraces.concat(ax.sortByInitialCategories());
30053005
}
30063006
}
30073007
return affectedTraces;

0 commit comments

Comments
 (0)
0