Skip to content

Commit c6d44d9

Browse files
committed
plotly#189 comment update
1 parent 34a5054 commit c6d44d9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plots/cartesian/ordered_categories.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ function flattenUnique(axisLetter, data) {
1616
var traceLines = data.map(function(d) {return d[axisLetter];});
1717
// Can't use a hashmap, which is O(1), because ES5 maps coerce keys to strings. If it ever becomes a bottleneck,
1818
// code can be separated: a hashmap (JS object) based version if all values encountered are strings; and
19-
// downgrading to this O(log(n)) array on the first encounter of a non-string value.
19+
// downgrading to this O(n) array on the first encounter of a non-string value.
20+
// Another possible speedup is bisection, but it's probably slower on the small array
21+
// sizes typical of categorical axis values.
2022
var categoryArray = [];
2123
var i, j, tracePoints, category;
2224
for(i = 0; i < traceLines.length; i++) {

0 commit comments

Comments
 (0)