Skip to content

Commit b9cf721

Browse files
Filmbostock
authored andcommitted
bail out if the inferred ordinal domain has more than 10k values
(see #849 (comment))
1 parent b8eb6c1 commit b9cf721

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/scales/ordinal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ function inferDomain(channels, interval) {
121121
const [min, max] = extent(values).map(interval.floor, interval);
122122
return interval.range(min, interval.offset(max));
123123
}
124+
if (values.size > 10e3) throw new Error("This ordinal domain would have more than 10,000 values. If this is intentional, set the domain explicitly.");
124125
return sort(values, ascendingDefined);
125126
}
126127

0 commit comments

Comments
 (0)