Skip to content

Commit b3fb03d

Browse files
authored
Build the lookup map for initialized categories
1 parent e8941d6 commit b3fb03d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/plots/plots.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,6 +1950,13 @@ plots.doCalcdata = function(gd, traces) {
19501950
// to be filled in later by ax.d2c
19511951
for(i = 0; i < axList.length; i++) {
19521952
axList[i]._categories = axList[i]._initialCategories.slice();
1953+
1954+
//Build the lookup map for initialized categories
1955+
axList[i]._categoriesMap = {};
1956+
for (var j = 0; j < axList[i]._categories.length; j++) {
1957+
axList[i]._categoriesMap[axList[i]._categories[j]] = j;
1958+
}
1959+
19531960
if(axList[i].type === 'category') hasCategoryAxis = true;
19541961
}
19551962

0 commit comments

Comments
 (0)