From 9782575684d12368c1dcce8f26e0a1534820007e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Rivi=C3=A8re?= Date: Fri, 29 Apr 2022 13:31:20 -0700 Subject: [PATCH] bail out if the inferred ordinal domain has more than 10k values (see https://github.com/observablehq/plot/pull/849#issuecomment-1105874552) --- src/scales/ordinal.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/scales/ordinal.js b/src/scales/ordinal.js index 90ee306dec..03f19f8cc5 100644 --- a/src/scales/ordinal.js +++ b/src/scales/ordinal.js @@ -109,6 +109,7 @@ function inferDomain(channels) { if (value === undefined) continue; for (const v of value) values.add(v); } + 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."); return sort(values, ascendingDefined); }