Skip to content

Commit 598a67b

Browse files
committed
improve ax.clearCalc:
- mv for-else call after for loop - rename init() -> emptyCategories() - break after finding group in which ax is in - as one ax can only be in a single match group at a time.
1 parent c48ae1c commit 598a67b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/plots/cartesian/set_convert.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ module.exports = function setConvert(ax, fullLayout) {
575575

576576
// should skip if not category nor multicategory
577577
ax.clearCalc = function() {
578-
var init = function() {
578+
var emptyCategories = function() {
579579
ax._categories = [];
580580
ax._categoriesMap = {};
581581
};
@@ -606,14 +606,14 @@ module.exports = function setConvert(ax, fullLayout) {
606606
ax._categories = categories;
607607
ax._categoriesMap = categoriesMap;
608608
} else {
609-
init();
609+
emptyCategories();
610610
}
611+
break;
611612
}
612-
613-
if(!found) init();
614613
}
614+
if(!found) emptyCategories();
615615
} else {
616-
init();
616+
emptyCategories();
617617
}
618618

619619
if(ax._initialCategories) {

0 commit comments

Comments
 (0)