@uwdata/vgplot 0.6.1 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vgplot.js CHANGED
@@ -12884,6 +12884,15 @@ var Query = class _Query {
12884
12884
  static except(...queries) {
12885
12885
  return new SetOperation("EXCEPT", queries.flat());
12886
12886
  }
12887
+ static describe(query) {
12888
+ const q2 = query.clone();
12889
+ const { clone, toString } = q2;
12890
+ return Object.assign(q2, {
12891
+ describe: true,
12892
+ clone: () => _Query.describe(clone.call(q2)),
12893
+ toString: () => `DESCRIBE ${toString.call(q2)}`
12894
+ });
12895
+ }
12887
12896
  constructor() {
12888
12897
  this.query = {
12889
12898
  with: [],
@@ -13118,6 +13127,7 @@ var Query = class _Query {
13118
13127
  }
13119
13128
  toString() {
13120
13129
  const {
13130
+ with: cte,
13121
13131
  select: select2,
13122
13132
  distinct: distinct2,
13123
13133
  from: from2,
@@ -13129,8 +13139,7 @@ var Query = class _Query {
13129
13139
  qualify,
13130
13140
  orderby,
13131
13141
  limit,
13132
- offset: offset2,
13133
- with: cte
13142
+ offset: offset2
13134
13143
  } = this.query;
13135
13144
  const sql2 = [];
13136
13145
  if (cte.length) {
@@ -13252,6 +13261,9 @@ var SetOperation = class _SetOperation {
13252
13261
  function isQuery(value) {
13253
13262
  return value instanceof Query || value instanceof SetOperation;
13254
13263
  }
13264
+ function isDescribeQuery(value) {
13265
+ return isQuery(value) && value.describe;
13266
+ }
13255
13267
  function unquote(s2) {
13256
13268
  return isDoubleQuoted(s2) ? s2.slice(1, -1) : s2;
13257
13269
  }
@@ -13433,131 +13445,6 @@ function toDuckDBValue(value) {
13433
13445
  }
13434
13446
  }
13435
13447
 
13436
- // ../core/src/util/js-type.js
13437
- function jsType(type2) {
13438
- switch (type2) {
13439
- case "BIGINT":
13440
- case "HUGEINT":
13441
- case "INTEGER":
13442
- case "SMALLINT":
13443
- case "TINYINT":
13444
- case "UBIGINT":
13445
- case "UINTEGER":
13446
- case "USMALLINT":
13447
- case "UTINYINT":
13448
- case "DOUBLE":
13449
- case "FLOAT":
13450
- case "REAL":
13451
- case "DECIMAL":
13452
- return "number";
13453
- case "DATE":
13454
- case "TIMESTAMP":
13455
- case "TIMESTAMPTZ":
13456
- case "TIMESTAMP WITH TIME ZONE":
13457
- case "TIME":
13458
- case "TIMESTAMP_NS":
13459
- return "date";
13460
- case "BOOLEAN":
13461
- return "boolean";
13462
- case "VARCHAR":
13463
- case "UUID":
13464
- return "string";
13465
- case "LIST":
13466
- return "array";
13467
- case "BLOB":
13468
- case "STRUCT":
13469
- case "MAP":
13470
- return "object";
13471
- default:
13472
- throw new Error(`Unsupported type: ${type2}`);
13473
- }
13474
- }
13475
-
13476
- // ../core/src/util/summarize.js
13477
- var Count = "count";
13478
- var Nulls = "nulls";
13479
- var Max = "max";
13480
- var Min = "min";
13481
- var Distinct = "distinct";
13482
- var statMap = {
13483
- [Count]: count,
13484
- [Distinct]: (column3) => count(column3).distinct(),
13485
- [Max]: max,
13486
- [Min]: min,
13487
- [Nulls]: (column3) => count().where(isNull(column3))
13488
- };
13489
- function summarize({ table: table3, column: column3 }, stats) {
13490
- return Query.from(table3).select(stats.map((s2) => [s2, statMap[s2](column3)]));
13491
- }
13492
-
13493
- // ../core/src/Catalog.js
13494
- var object = () => /* @__PURE__ */ Object.create(null);
13495
- var Catalog = class {
13496
- constructor(coordinator2) {
13497
- this.mc = coordinator2;
13498
- this.clear();
13499
- }
13500
- clear() {
13501
- this.tables = object();
13502
- }
13503
- tableInfo(table3) {
13504
- const cache = this.tables;
13505
- if (cache[table3]) {
13506
- return cache[table3];
13507
- }
13508
- const infoPromise = getTableInfo(this.mc, table3).catch((err) => {
13509
- cache[table3] = null;
13510
- throw err;
13511
- });
13512
- return cache[table3] = infoPromise;
13513
- }
13514
- async fieldInfo({ table: table3, column: column3, stats }) {
13515
- const tableInfo = await this.tableInfo(table3);
13516
- const colInfo = tableInfo[column3];
13517
- if (colInfo == null)
13518
- return;
13519
- if (!stats?.length)
13520
- return colInfo;
13521
- const result = await this.mc.query(
13522
- summarize(colInfo, stats),
13523
- { persist: true }
13524
- );
13525
- const info = { ...colInfo, ...Array.from(result)[0] };
13526
- for (const key in info) {
13527
- const value = info[key];
13528
- if (typeof value === "bigint") {
13529
- info[key] = Number(value);
13530
- }
13531
- }
13532
- return info;
13533
- }
13534
- async queryFields(fields) {
13535
- const list = await resolveFields(this, fields);
13536
- const data = await Promise.all(list.map((f2) => this.fieldInfo(f2)));
13537
- return data.filter((x4) => x4);
13538
- }
13539
- };
13540
- async function getTableInfo(mc, table3) {
13541
- const result = await mc.query(
13542
- `DESCRIBE ${asRelation(table3)}`,
13543
- { type: "json", cache: false }
13544
- );
13545
- const columns = object();
13546
- for (const entry of result) {
13547
- columns[entry.column_name] = {
13548
- table: table3,
13549
- column: entry.column_name,
13550
- sqlType: entry.column_type,
13551
- type: jsType(entry.column_type),
13552
- nullable: entry.null === "YES"
13553
- };
13554
- }
13555
- return columns;
13556
- }
13557
- async function resolveFields(catalog, list) {
13558
- return list.length === 1 && list[0].column === "*" ? Object.values(await catalog.tableInfo(list[0].table)) : list;
13559
- }
13560
-
13561
13448
  // ../core/src/util/hash.js
13562
13449
  function fnv_hash(v3) {
13563
13450
  let a3 = 2166136261;
@@ -13917,7 +13804,7 @@ function consolidate(group3, enqueue, record) {
13917
13804
  type: "arrow",
13918
13805
  cache: false,
13919
13806
  record: false,
13920
- query: consolidatedQuery(group3, record)
13807
+ query: group3.query = consolidatedQuery(group3, record)
13921
13808
  },
13922
13809
  result: group3.result = queryResult()
13923
13810
  });
@@ -13965,7 +13852,7 @@ function consolidatedQuery(group3, record) {
13965
13852
  return query.$select(Array.from(fields.values()));
13966
13853
  }
13967
13854
  async function processResults(group3, cache) {
13968
- const { maps, result } = group3;
13855
+ const { maps, query, result } = group3;
13969
13856
  if (!maps)
13970
13857
  return;
13971
13858
  let data;
@@ -13977,25 +13864,33 @@ async function processResults(group3, cache) {
13977
13864
  }
13978
13865
  return;
13979
13866
  }
13867
+ const describe = isDescribeQuery(query);
13980
13868
  group3.forEach(({ entry }, index2) => {
13981
13869
  const { request, result: result2 } = entry;
13982
- const projected = projectResult(data, maps[index2]);
13870
+ const map4 = maps[index2];
13871
+ const extract = describe && map4 ? filterResult(data, map4) : map4 ? projectResult(data, map4) : data;
13983
13872
  if (request.cache) {
13984
- cache.set(String(request.query), projected);
13873
+ cache.set(String(request.query), extract);
13985
13874
  }
13986
- result2.fulfill(projected);
13875
+ result2.fulfill(extract);
13987
13876
  });
13988
13877
  }
13989
13878
  function projectResult(data, map4) {
13990
- if (map4) {
13991
- const cols = {};
13992
- for (const [name2, as] of map4) {
13993
- cols[as] = data.getChild(name2);
13879
+ const cols = {};
13880
+ for (const [name2, as] of map4) {
13881
+ cols[as] = data.getChild(name2);
13882
+ }
13883
+ return new data.constructor(cols);
13884
+ }
13885
+ function filterResult(data, map4) {
13886
+ const lookup = new Map(map4);
13887
+ const result = [];
13888
+ for (const d of data) {
13889
+ if (lookup.has(d.column_name)) {
13890
+ result.push({ ...d, column_name: lookup.get(d.column_name) });
13994
13891
  }
13995
- return new data.constructor(cols);
13996
- } else {
13997
- return data;
13998
13892
  }
13893
+ return result;
13999
13894
  }
14000
13895
 
14001
13896
  // ../core/src/util/cache.js
@@ -14242,6 +14137,197 @@ function QueryManager() {
14242
14137
  };
14243
14138
  }
14244
14139
 
14140
+ // ../core/src/util/js-type.js
14141
+ function jsType(type2) {
14142
+ switch (type2) {
14143
+ case "BIGINT":
14144
+ case "HUGEINT":
14145
+ case "INTEGER":
14146
+ case "SMALLINT":
14147
+ case "TINYINT":
14148
+ case "UBIGINT":
14149
+ case "UINTEGER":
14150
+ case "USMALLINT":
14151
+ case "UTINYINT":
14152
+ case "DOUBLE":
14153
+ case "FLOAT":
14154
+ case "REAL":
14155
+ return "number";
14156
+ case "DATE":
14157
+ case "TIMESTAMP":
14158
+ case "TIMESTAMPTZ":
14159
+ case "TIMESTAMP WITH TIME ZONE":
14160
+ case "TIME":
14161
+ case "TIMESTAMP_NS":
14162
+ return "date";
14163
+ case "BOOLEAN":
14164
+ return "boolean";
14165
+ case "VARCHAR":
14166
+ case "UUID":
14167
+ return "string";
14168
+ case "ARRAY":
14169
+ case "LIST":
14170
+ return "array";
14171
+ case "BLOB":
14172
+ case "STRUCT":
14173
+ case "MAP":
14174
+ case "GEOMETRY":
14175
+ return "object";
14176
+ default:
14177
+ if (type2.startsWith("DECIMAL")) {
14178
+ return "number";
14179
+ } else if (type2.startsWith("STRUCT") || type2.startsWith("MAP")) {
14180
+ return "object";
14181
+ } else if (type2.endsWith("]")) {
14182
+ return "array";
14183
+ }
14184
+ throw new Error(`Unsupported type: ${type2}`);
14185
+ }
14186
+ }
14187
+
14188
+ // ../core/src/util/convert-arrow.js
14189
+ var INTEGER = 2;
14190
+ var FLOAT = 3;
14191
+ var DECIMAL = 7;
14192
+ var TIMESTAMP = 10;
14193
+ function isArrowTable(values2) {
14194
+ return typeof values2?.getChild === "function";
14195
+ }
14196
+ function convertArrowArrayType(type2) {
14197
+ switch (type2.typeId) {
14198
+ case INTEGER:
14199
+ case FLOAT:
14200
+ case DECIMAL:
14201
+ return Float64Array;
14202
+ default:
14203
+ return Array;
14204
+ }
14205
+ }
14206
+ function convertArrowValue(type2) {
14207
+ const { typeId } = type2;
14208
+ if (typeId === TIMESTAMP) {
14209
+ return (v3) => v3 == null ? v3 : new Date(v3);
14210
+ }
14211
+ if (typeId === INTEGER && type2.bitWidth >= 64) {
14212
+ return (v3) => v3 == null ? v3 : Number(v3);
14213
+ }
14214
+ if (typeId === DECIMAL) {
14215
+ const scale3 = 1 / Math.pow(10, type2.scale);
14216
+ return (v3) => v3 == null ? v3 : decimalToNumber(v3, scale3);
14217
+ }
14218
+ return (v3) => v3;
14219
+ }
14220
+ function convertArrowColumn(column3) {
14221
+ const { type: type2 } = column3;
14222
+ const { typeId } = type2;
14223
+ if (typeId === TIMESTAMP) {
14224
+ const size = column3.length;
14225
+ const array3 = new Array(size);
14226
+ for (let row = 0; row < size; ++row) {
14227
+ const v3 = column3.get(row);
14228
+ array3[row] = v3 == null ? null : new Date(v3);
14229
+ }
14230
+ return array3;
14231
+ }
14232
+ if (typeId === INTEGER && type2.bitWidth >= 64) {
14233
+ const size = column3.length;
14234
+ const array3 = new Float64Array(size);
14235
+ for (let row = 0; row < size; ++row) {
14236
+ const v3 = column3.get(row);
14237
+ array3[row] = v3 == null ? NaN : Number(v3);
14238
+ }
14239
+ return array3;
14240
+ }
14241
+ if (typeId === DECIMAL) {
14242
+ const scale3 = 1 / Math.pow(10, type2.scale);
14243
+ const size = column3.length;
14244
+ const array3 = new Float64Array(size);
14245
+ for (let row = 0; row < size; ++row) {
14246
+ const v3 = column3.get(row);
14247
+ array3[row] = v3 == null ? NaN : decimalToNumber(v3, scale3);
14248
+ }
14249
+ return array3;
14250
+ }
14251
+ return column3.toArray();
14252
+ }
14253
+ var BASE32 = Array.from(
14254
+ { length: 8 },
14255
+ (_2, i) => Math.pow(2, i * 32)
14256
+ );
14257
+ function decimalToNumber(v3, scale3) {
14258
+ const n = v3.length;
14259
+ let x4 = 0;
14260
+ if (v3.signed && (v3[n - 1] | 0) < 0) {
14261
+ for (let i = 0; i < n; ++i) {
14262
+ x4 += ~v3[i] * BASE32[i];
14263
+ }
14264
+ x4 = -(x4 + 1);
14265
+ } else {
14266
+ for (let i = 0; i < n; ++i) {
14267
+ x4 += v3[i] * BASE32[i];
14268
+ }
14269
+ }
14270
+ return x4 * scale3;
14271
+ }
14272
+
14273
+ // ../core/src/util/field-info.js
14274
+ var Count = "count";
14275
+ var Nulls = "nulls";
14276
+ var Max = "max";
14277
+ var Min = "min";
14278
+ var Distinct = "distinct";
14279
+ var statMap = {
14280
+ [Count]: count,
14281
+ [Distinct]: (column3) => count(column3).distinct(),
14282
+ [Max]: max,
14283
+ [Min]: min,
14284
+ [Nulls]: (column3) => count().where(isNull(column3))
14285
+ };
14286
+ function summarize(table3, column3, stats) {
14287
+ return Query.from(table3).select(Array.from(stats, (s2) => [s2, statMap[s2](column3)]));
14288
+ }
14289
+ async function queryFieldInfo(mc, fields) {
14290
+ if (fields.length === 1 && `${fields[0].column}` === "*") {
14291
+ return getTableInfo(mc, fields[0].table);
14292
+ } else {
14293
+ return (await Promise.all(fields.map((f2) => getFieldInfo(mc, f2)))).filter((x4) => x4);
14294
+ }
14295
+ }
14296
+ async function getFieldInfo(mc, { table: table3, column: column3, stats }) {
14297
+ const q2 = Query.from({ source: table3 }).select({ column: column3 }).groupby(column3.aggregate ? sql`ALL` : []);
14298
+ const [desc2] = Array.from(await mc.query(Query.describe(q2)));
14299
+ const info = {
14300
+ table: table3,
14301
+ column: `${column3}`,
14302
+ sqlType: desc2.column_type,
14303
+ type: jsType(desc2.column_type),
14304
+ nullable: desc2.null === "YES"
14305
+ };
14306
+ if (!(stats?.length || stats?.size))
14307
+ return info;
14308
+ const result = await mc.query(
14309
+ summarize(table3, column3, stats),
14310
+ { persist: true }
14311
+ );
14312
+ for (let i = 0; i < result.numCols; ++i) {
14313
+ const { name: name2 } = result.schema.fields[i];
14314
+ const child = result.getChildAt(i);
14315
+ const convert = convertArrowValue(child.type);
14316
+ info[name2] = convert(child.get(0));
14317
+ }
14318
+ return info;
14319
+ }
14320
+ async function getTableInfo(mc, table3) {
14321
+ const result = await mc.query(`DESCRIBE ${asRelation(table3)}`);
14322
+ return Array.from(result).map((desc2) => ({
14323
+ table: table3,
14324
+ column: desc2.column_name,
14325
+ sqlType: desc2.column_type,
14326
+ type: jsType(desc2.column_type),
14327
+ nullable: desc2.null === "YES"
14328
+ }));
14329
+ }
14330
+
14245
14331
  // ../core/src/util/void-logger.js
14246
14332
  function voidLogger() {
14247
14333
  return {
@@ -14274,7 +14360,6 @@ var Coordinator = class {
14274
14360
  logger = console,
14275
14361
  manager = QueryManager()
14276
14362
  } = options;
14277
- this.catalog = new Catalog(this);
14278
14363
  this.manager = manager;
14279
14364
  this.logger(logger);
14280
14365
  this.configure(options);
@@ -14293,7 +14378,7 @@ var Coordinator = class {
14293
14378
  this.manager.consolidate(consolidate2);
14294
14379
  this.indexes = indexes2;
14295
14380
  }
14296
- clear({ clients = true, cache = true, catalog = false } = {}) {
14381
+ clear({ clients = true, cache = true } = {}) {
14297
14382
  this.manager.clear();
14298
14383
  if (clients) {
14299
14384
  this.clients?.forEach((client) => this.disconnect(client));
@@ -14303,8 +14388,6 @@ var Coordinator = class {
14303
14388
  }
14304
14389
  if (cache)
14305
14390
  this.manager.cache().clear();
14306
- if (catalog)
14307
- this.catalog.clear();
14308
14391
  }
14309
14392
  databaseConnector(db) {
14310
14393
  return this.manager.connector(db);
@@ -14357,7 +14440,7 @@ var Coordinator = class {
14357
14440
  * @param {import('./MosaicClient.js').MosaicClient} client the client to disconnect
14358
14441
  */
14359
14442
  async connect(client) {
14360
- const { catalog, clients, filterGroups, indexes: indexes2 } = this;
14443
+ const { clients, filterGroups, indexes: indexes2 } = this;
14361
14444
  if (clients.has(client)) {
14362
14445
  throw new Error("Client already connected.");
14363
14446
  }
@@ -14365,7 +14448,7 @@ var Coordinator = class {
14365
14448
  client.coordinator = this;
14366
14449
  const fields = client.fields();
14367
14450
  if (fields?.length) {
14368
- client.fieldInfo(await catalog.queryFields(fields));
14451
+ client.fieldInfo(await queryFieldInfo(this, fields));
14369
14452
  }
14370
14453
  const filter3 = client.filterBy;
14371
14454
  if (filter3) {
@@ -26211,7 +26294,7 @@ var C = () => (async (s2) => {
26211
26294
  return false;
26212
26295
  }
26213
26296
  })(new Uint8Array([0, 97, 115, 109, 1, 0, 0, 0, 1, 4, 1, 96, 0, 0, 3, 2, 1, 0, 5, 4, 1, 3, 1, 1, 10, 11, 1, 9, 0, 65, 0, 254, 16, 2, 0, 26, 11]));
26214
- var _ = { name: "@duckdb/duckdb-wasm", version: "1.28.1-dev106.0", description: "DuckDB powered by WebAssembly", license: "MIT", repository: { type: "git", url: "https://github.com/duckdb/duckdb-wasm.git" }, keywords: ["sql", "duckdb", "relational", "database", "data", "query", "wasm", "analytics", "olap", "arrow", "parquet", "json", "csv"], dependencies: { "apache-arrow": "^14.0.1" }, devDependencies: { "@types/emscripten": "^1.39.10", "@types/jasmine": "^5.1.4", "@typescript-eslint/eslint-plugin": "^6.18.0", "@typescript-eslint/parser": "^6.18.0", esbuild: "^0.20.0", eslint: "^8.56.0", "eslint-plugin-jasmine": "^4.1.3", "eslint-plugin-react": "^7.33.2", "fast-glob": "^3.3.2", jasmine: "^5.1.0", "jasmine-core": "^5.1.1", "jasmine-spec-reporter": "^7.0.0", "js-sha256": "^0.11.0", karma: "^6.4.2", "karma-chrome-launcher": "^3.2.0", "karma-coverage": "^2.2.1", "karma-firefox-launcher": "^2.1.2", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^2.1.0", "karma-sourcemap-loader": "^0.4.0", "karma-spec-reporter": "^0.0.36", "make-dir": "^4.0.0", nyc: "^15.1.0", prettier: "^3.2.4", puppeteer: "^21.7.0", rimraf: "^5.0.5", s3rver: "^3.7.1", typedoc: "^0.25.7", typescript: "^5.3.3", "wasm-feature-detect": "^1.6.1", "web-worker": "^1.2.0" }, scripts: { "build:debug": "node bundle.mjs debug && tsc --emitDeclarationOnly", "build:release": "node bundle.mjs release && tsc --emitDeclarationOnly", docs: "typedoc", report: "node ./coverage.mjs", "test:node": "node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:node:debug": "node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:node:coverage": "nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:firefox": "karma start ./karma/tests-firefox.cjs", "test:chrome": "karma start ./karma/tests-chrome.cjs", "test:chrome:eh": "karma start ./karma/tests-chrome-eh.cjs", "test:chrome:coverage": "karma start ./karma/tests-chrome-coverage.cjs", "test:browser": "karma start ./karma/tests-all.cjs", "test:browser:debug": "karma start ./karma/tests-debug.cjs", test: "npm run test:chrome && npm run test:node", "test:coverage": "npm run test:chrome:coverage && npm run test:node:coverage && npm run report", lint: "eslint src test" }, files: ["dist", "!dist/types/test"], main: "dist/duckdb-browser.cjs", module: "dist/duckdb-browser.mjs", types: "dist/duckdb-browser.d.ts", jsdelivr: "dist/duckdb-browser.cjs", unpkg: "dist/duckdb-browser.mjs", sideEffects: false, browser: { fs: false, path: false, perf_hooks: false, os: false, worker_threads: false }, exports: { "./dist/duckdb-mvp.wasm": "./dist/duckdb-mvp.wasm", "./dist/duckdb-eh.wasm": "./dist/duckdb-eh.wasm", "./dist/duckdb-coi.wasm": "./dist/duckdb-coi.wasm", "./dist/duckdb-browser": "./dist/duckdb-browser.mjs", "./dist/duckdb-browser.cjs": "./dist/duckdb-browser.cjs", "./dist/duckdb-browser.mjs": "./dist/duckdb-browser.mjs", "./dist/duckdb-browser-blocking": "./dist/duckdb-browser-blocking.mjs", "./dist/duckdb-browser-blocking.mjs": "./dist/duckdb-browser-blocking.mjs", "./dist/duckdb-browser-blocking.cjs": "./dist/duckdb-browser-blocking.cjs", "./dist/duckdb-browser-coi.pthread.worker.js": "./dist/duckdb-browser-coi.pthread.worker.js", "./dist/duckdb-browser-coi.worker.js": "./dist/duckdb-browser-coi.worker.js", "./dist/duckdb-browser-eh.worker.js": "./dist/duckdb-browser-eh.worker.js", "./dist/duckdb-browser-mvp.worker.js": "./dist/duckdb-browser-mvp.worker.js", "./dist/duckdb-node": "./dist/duckdb-node.cjs", "./dist/duckdb-node.cjs": "./dist/duckdb-node.cjs", "./dist/duckdb-node-blocking": "./dist/duckdb-node-blocking.cjs", "./dist/duckdb-node-blocking.cjs": "./dist/duckdb-node-blocking.cjs", "./dist/duckdb-node-eh.worker.cjs": "./dist/duckdb-node-eh.worker.cjs", "./dist/duckdb-node-mvp.worker.cjs": "./dist/duckdb-node-mvp.worker.cjs", "./blocking": { browser: { types: "./dist/duckdb-browser-blocking.d.ts", import: "./dist/duckdb-browser-blocking.mjs", require: "./dist/duckdb-browser-blocking.cjs" }, node: { types: "./dist/duckdb-node-blocking.d.ts", require: "./dist/duckdb-node-blocking.cjs", import: "./dist/duckdb-node-blocking.cjs" }, types: "./dist/duckdb-browser-blocking.d.ts", import: "./dist/duckdb-browser-blocking.mjs", require: "./dist/duckdb-browser-blocking.cjs" }, ".": { browser: { types: "./dist/duckdb-browser.d.ts", import: "./dist/duckdb-browser.mjs", require: "./dist/duckdb-browser.cjs" }, node: { types: "./dist/duckdb-node.d.ts", import: "./dist/duckdb-node.cjs", require: "./dist/duckdb-node.cjs" }, types: "./dist/duckdb-browser.d.ts", import: "./dist/duckdb-browser.mjs", require: "./dist/duckdb-browser.cjs" } } };
26297
+ var _ = { name: "@duckdb/duckdb-wasm", version: "1.28.1-dev99.0", description: "DuckDB powered by WebAssembly", license: "MIT", repository: { type: "git", url: "https://github.com/duckdb/duckdb-wasm.git" }, keywords: ["sql", "duckdb", "relational", "database", "data", "query", "wasm", "analytics", "olap", "arrow", "parquet", "json", "csv"], dependencies: { "apache-arrow": "^14.0.1" }, devDependencies: { "@types/emscripten": "^1.39.10", "@types/jasmine": "^5.1.4", "@typescript-eslint/eslint-plugin": "^6.18.0", "@typescript-eslint/parser": "^6.18.0", esbuild: "^0.19.10", eslint: "^8.56.0", "eslint-plugin-jasmine": "^4.1.3", "eslint-plugin-react": "^7.33.2", "fast-glob": "^3.3.2", jasmine: "^5.1.0", "jasmine-core": "^5.1.1", "jasmine-spec-reporter": "^7.0.0", "js-sha256": "^0.10.1", karma: "^6.4.2", "karma-chrome-launcher": "^3.2.0", "karma-coverage": "^2.2.1", "karma-firefox-launcher": "^2.1.2", "karma-jasmine": "^5.1.0", "karma-jasmine-html-reporter": "^2.1.0", "karma-sourcemap-loader": "^0.4.0", "karma-spec-reporter": "^0.0.36", "make-dir": "^4.0.0", nyc: "^15.1.0", prettier: "^3.2.2", puppeteer: "^21.7.0", rimraf: "^5.0.5", s3rver: "^3.7.1", typedoc: "^0.25.7", typescript: "^5.3.3", "wasm-feature-detect": "^1.6.1", "web-worker": "^1.2.0" }, scripts: { "build:debug": "node bundle.mjs debug && tsc --emitDeclarationOnly", "build:release": "node bundle.mjs release && tsc --emitDeclarationOnly", docs: "typedoc", report: "node ./coverage.mjs", "test:node": "node --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:node:debug": "node --inspect-brk --enable-source-maps ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:node:coverage": "nyc -r json --report-dir ./coverage/node node ../../node_modules/jasmine/bin/jasmine ./dist/tests-node.cjs", "test:firefox": "karma start ./karma/tests-firefox.cjs", "test:chrome": "karma start ./karma/tests-chrome.cjs", "test:chrome:eh": "karma start ./karma/tests-chrome-eh.cjs", "test:chrome:coverage": "karma start ./karma/tests-chrome-coverage.cjs", "test:browser": "karma start ./karma/tests-all.cjs", "test:browser:debug": "karma start ./karma/tests-debug.cjs", test: "npm run test:chrome && npm run test:node", "test:coverage": "npm run test:chrome:coverage && npm run test:node:coverage && npm run report", lint: "eslint src test" }, files: ["dist", "!dist/types/test"], main: "dist/duckdb-browser.cjs", module: "dist/duckdb-browser.mjs", types: "dist/duckdb-browser.d.ts", jsdelivr: "dist/duckdb-browser.cjs", unpkg: "dist/duckdb-browser.mjs", sideEffects: false, browser: { fs: false, path: false, perf_hooks: false, os: false, worker_threads: false }, exports: { "./dist/duckdb-mvp.wasm": "./dist/duckdb-mvp.wasm", "./dist/duckdb-eh.wasm": "./dist/duckdb-eh.wasm", "./dist/duckdb-coi.wasm": "./dist/duckdb-coi.wasm", "./dist/duckdb-browser": "./dist/duckdb-browser.mjs", "./dist/duckdb-browser.cjs": "./dist/duckdb-browser.cjs", "./dist/duckdb-browser.mjs": "./dist/duckdb-browser.mjs", "./dist/duckdb-browser-blocking": "./dist/duckdb-browser-blocking.mjs", "./dist/duckdb-browser-blocking.mjs": "./dist/duckdb-browser-blocking.mjs", "./dist/duckdb-browser-blocking.cjs": "./dist/duckdb-browser-blocking.cjs", "./dist/duckdb-browser-coi.pthread.worker.js": "./dist/duckdb-browser-coi.pthread.worker.js", "./dist/duckdb-browser-coi.worker.js": "./dist/duckdb-browser-coi.worker.js", "./dist/duckdb-browser-eh.worker.js": "./dist/duckdb-browser-eh.worker.js", "./dist/duckdb-browser-mvp.worker.js": "./dist/duckdb-browser-mvp.worker.js", "./dist/duckdb-node": "./dist/duckdb-node.cjs", "./dist/duckdb-node.cjs": "./dist/duckdb-node.cjs", "./dist/duckdb-node-blocking": "./dist/duckdb-node-blocking.cjs", "./dist/duckdb-node-blocking.cjs": "./dist/duckdb-node-blocking.cjs", "./dist/duckdb-node-eh.worker.cjs": "./dist/duckdb-node-eh.worker.cjs", "./dist/duckdb-node-mvp.worker.cjs": "./dist/duckdb-node-mvp.worker.cjs", "./blocking": { browser: { types: "./dist/duckdb-browser-blocking.d.ts", import: "./dist/duckdb-browser-blocking.mjs", require: "./dist/duckdb-browser-blocking.cjs" }, node: { types: "./dist/duckdb-node-blocking.d.ts", require: "./dist/duckdb-node-blocking.cjs", import: "./dist/duckdb-node-blocking.cjs" }, types: "./dist/duckdb-browser-blocking.d.ts", import: "./dist/duckdb-browser-blocking.mjs", require: "./dist/duckdb-browser-blocking.cjs" }, ".": { browser: { types: "./dist/duckdb-browser.d.ts", import: "./dist/duckdb-browser.mjs", require: "./dist/duckdb-browser.cjs" }, node: { types: "./dist/duckdb-node.d.ts", import: "./dist/duckdb-node.cjs", require: "./dist/duckdb-node.cjs" }, types: "./dist/duckdb-browser.d.ts", import: "./dist/duckdb-browser.mjs", require: "./dist/duckdb-browser.cjs" } } };
26215
26298
  var W = _.name;
26216
26299
  var v = _.version;
26217
26300
  var I = _.version.split(".");
@@ -33464,46 +33547,46 @@ function streamGeometry(geometry, stream) {
33464
33547
  }
33465
33548
  }
33466
33549
  var streamObjectType = {
33467
- Feature: function(object2, stream) {
33468
- streamGeometry(object2.geometry, stream);
33550
+ Feature: function(object, stream) {
33551
+ streamGeometry(object.geometry, stream);
33469
33552
  },
33470
- FeatureCollection: function(object2, stream) {
33471
- var features = object2.features, i = -1, n = features.length;
33553
+ FeatureCollection: function(object, stream) {
33554
+ var features = object.features, i = -1, n = features.length;
33472
33555
  while (++i < n)
33473
33556
  streamGeometry(features[i].geometry, stream);
33474
33557
  }
33475
33558
  };
33476
33559
  var streamGeometryType = {
33477
- Sphere: function(object2, stream) {
33560
+ Sphere: function(object, stream) {
33478
33561
  stream.sphere();
33479
33562
  },
33480
- Point: function(object2, stream) {
33481
- object2 = object2.coordinates;
33482
- stream.point(object2[0], object2[1], object2[2]);
33563
+ Point: function(object, stream) {
33564
+ object = object.coordinates;
33565
+ stream.point(object[0], object[1], object[2]);
33483
33566
  },
33484
- MultiPoint: function(object2, stream) {
33485
- var coordinates = object2.coordinates, i = -1, n = coordinates.length;
33567
+ MultiPoint: function(object, stream) {
33568
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
33486
33569
  while (++i < n)
33487
- object2 = coordinates[i], stream.point(object2[0], object2[1], object2[2]);
33570
+ object = coordinates[i], stream.point(object[0], object[1], object[2]);
33488
33571
  },
33489
- LineString: function(object2, stream) {
33490
- streamLine(object2.coordinates, stream, 0);
33572
+ LineString: function(object, stream) {
33573
+ streamLine(object.coordinates, stream, 0);
33491
33574
  },
33492
- MultiLineString: function(object2, stream) {
33493
- var coordinates = object2.coordinates, i = -1, n = coordinates.length;
33575
+ MultiLineString: function(object, stream) {
33576
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
33494
33577
  while (++i < n)
33495
33578
  streamLine(coordinates[i], stream, 0);
33496
33579
  },
33497
- Polygon: function(object2, stream) {
33498
- streamPolygon(object2.coordinates, stream);
33580
+ Polygon: function(object, stream) {
33581
+ streamPolygon(object.coordinates, stream);
33499
33582
  },
33500
- MultiPolygon: function(object2, stream) {
33501
- var coordinates = object2.coordinates, i = -1, n = coordinates.length;
33583
+ MultiPolygon: function(object, stream) {
33584
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
33502
33585
  while (++i < n)
33503
33586
  streamPolygon(coordinates[i], stream);
33504
33587
  },
33505
- GeometryCollection: function(object2, stream) {
33506
- var geometries = object2.geometries, i = -1, n = geometries.length;
33588
+ GeometryCollection: function(object, stream) {
33589
+ var geometries = object.geometries, i = -1, n = geometries.length;
33507
33590
  while (++i < n)
33508
33591
  streamGeometry(geometries[i], stream);
33509
33592
  }
@@ -33522,11 +33605,11 @@ function streamPolygon(coordinates, stream) {
33522
33605
  streamLine(coordinates[i], stream, 1);
33523
33606
  stream.polygonEnd();
33524
33607
  }
33525
- function stream_default(object2, stream) {
33526
- if (object2 && streamObjectType.hasOwnProperty(object2.type)) {
33527
- streamObjectType[object2.type](object2, stream);
33608
+ function stream_default(object, stream) {
33609
+ if (object && streamObjectType.hasOwnProperty(object.type)) {
33610
+ streamObjectType[object.type](object, stream);
33528
33611
  } else {
33529
- streamGeometry(object2, stream);
33612
+ streamGeometry(object, stream);
33530
33613
  }
33531
33614
  }
33532
33615
 
@@ -33650,12 +33733,12 @@ function centroidRingPoint(lambda, phi) {
33650
33733
  Z1 += w * (z0 + (z0 = z2));
33651
33734
  centroidPointCartesian(x0, y0, z0);
33652
33735
  }
33653
- function centroid_default(object2) {
33736
+ function centroid_default(object) {
33654
33737
  W0 = W1 = X0 = Y0 = Z0 = X1 = Y1 = Z1 = 0;
33655
33738
  X22 = new Adder();
33656
33739
  Y22 = new Adder();
33657
33740
  Z2 = new Adder();
33658
- stream_default(object2, centroidStream);
33741
+ stream_default(object, centroidStream);
33659
33742
  var x4 = +X22, y4 = +Y22, z2 = +Z2, m2 = hypot(x4, y4, z2);
33660
33743
  if (m2 < epsilon22) {
33661
33744
  x4 = X1, y4 = Y1, z2 = Z1;
@@ -34839,28 +34922,28 @@ function appendRound2(digits) {
34839
34922
  // ../../node_modules/d3-geo/src/path/index.js
34840
34923
  function path_default(projection3, context) {
34841
34924
  let digits = 3, pointRadius = 4.5, projectionStream, contextStream;
34842
- function path2(object2) {
34843
- if (object2) {
34925
+ function path2(object) {
34926
+ if (object) {
34844
34927
  if (typeof pointRadius === "function")
34845
34928
  contextStream.pointRadius(+pointRadius.apply(this, arguments));
34846
- stream_default(object2, projectionStream(contextStream));
34929
+ stream_default(object, projectionStream(contextStream));
34847
34930
  }
34848
34931
  return contextStream.result();
34849
34932
  }
34850
- path2.area = function(object2) {
34851
- stream_default(object2, projectionStream(area_default2));
34933
+ path2.area = function(object) {
34934
+ stream_default(object, projectionStream(area_default2));
34852
34935
  return area_default2.result();
34853
34936
  };
34854
- path2.measure = function(object2) {
34855
- stream_default(object2, projectionStream(measure_default));
34937
+ path2.measure = function(object) {
34938
+ stream_default(object, projectionStream(measure_default));
34856
34939
  return measure_default.result();
34857
34940
  };
34858
- path2.bounds = function(object2) {
34859
- stream_default(object2, projectionStream(bounds_default));
34941
+ path2.bounds = function(object) {
34942
+ stream_default(object, projectionStream(bounds_default));
34860
34943
  return bounds_default.result();
34861
34944
  };
34862
- path2.centroid = function(object2) {
34863
- stream_default(object2, projectionStream(centroid_default2));
34945
+ path2.centroid = function(object) {
34946
+ stream_default(object, projectionStream(centroid_default2));
34864
34947
  return centroid_default2.result();
34865
34948
  };
34866
34949
  path2.projection = function(_2) {
@@ -34941,37 +35024,37 @@ TransformStream.prototype = {
34941
35024
  };
34942
35025
 
34943
35026
  // ../../node_modules/d3-geo/src/projection/fit.js
34944
- function fit(projection3, fitBounds, object2) {
35027
+ function fit(projection3, fitBounds, object) {
34945
35028
  var clip = projection3.clipExtent && projection3.clipExtent();
34946
35029
  projection3.scale(150).translate([0, 0]);
34947
35030
  if (clip != null)
34948
35031
  projection3.clipExtent(null);
34949
- stream_default(object2, projection3.stream(bounds_default));
35032
+ stream_default(object, projection3.stream(bounds_default));
34950
35033
  fitBounds(bounds_default.result());
34951
35034
  if (clip != null)
34952
35035
  projection3.clipExtent(clip);
34953
35036
  return projection3;
34954
35037
  }
34955
- function fitExtent(projection3, extent4, object2) {
35038
+ function fitExtent(projection3, extent4, object) {
34956
35039
  return fit(projection3, function(b2) {
34957
35040
  var w = extent4[1][0] - extent4[0][0], h2 = extent4[1][1] - extent4[0][1], k3 = Math.min(w / (b2[1][0] - b2[0][0]), h2 / (b2[1][1] - b2[0][1])), x4 = +extent4[0][0] + (w - k3 * (b2[1][0] + b2[0][0])) / 2, y4 = +extent4[0][1] + (h2 - k3 * (b2[1][1] + b2[0][1])) / 2;
34958
35041
  projection3.scale(150 * k3).translate([x4, y4]);
34959
- }, object2);
35042
+ }, object);
34960
35043
  }
34961
- function fitSize(projection3, size, object2) {
34962
- return fitExtent(projection3, [[0, 0], size], object2);
35044
+ function fitSize(projection3, size, object) {
35045
+ return fitExtent(projection3, [[0, 0], size], object);
34963
35046
  }
34964
- function fitWidth(projection3, width2, object2) {
35047
+ function fitWidth(projection3, width2, object) {
34965
35048
  return fit(projection3, function(b2) {
34966
35049
  var w = +width2, k3 = w / (b2[1][0] - b2[0][0]), x4 = (w - k3 * (b2[1][0] + b2[0][0])) / 2, y4 = -k3 * b2[0][1];
34967
35050
  projection3.scale(150 * k3).translate([x4, y4]);
34968
- }, object2);
35051
+ }, object);
34969
35052
  }
34970
- function fitHeight(projection3, height2, object2) {
35053
+ function fitHeight(projection3, height2, object) {
34971
35054
  return fit(projection3, function(b2) {
34972
35055
  var h2 = +height2, k3 = h2 / (b2[1][1] - b2[0][1]), x4 = -k3 * b2[0][0], y4 = (h2 - k3 * (b2[1][1] + b2[0][1])) / 2;
34973
35056
  projection3.scale(150 * k3).translate([x4, y4]);
34974
- }, object2);
35057
+ }, object);
34975
35058
  }
34976
35059
 
34977
35060
  // ../../node_modules/d3-geo/src/projection/resample.js
@@ -35143,17 +35226,17 @@ function projectionMutator(projectAt) {
35143
35226
  projection3.precision = function(_2) {
35144
35227
  return arguments.length ? (projectResample = resample_default(projectTransform, delta2 = _2 * _2), reset()) : sqrt(delta2);
35145
35228
  };
35146
- projection3.fitExtent = function(extent4, object2) {
35147
- return fitExtent(projection3, extent4, object2);
35229
+ projection3.fitExtent = function(extent4, object) {
35230
+ return fitExtent(projection3, extent4, object);
35148
35231
  };
35149
- projection3.fitSize = function(size, object2) {
35150
- return fitSize(projection3, size, object2);
35232
+ projection3.fitSize = function(size, object) {
35233
+ return fitSize(projection3, size, object);
35151
35234
  };
35152
- projection3.fitWidth = function(width2, object2) {
35153
- return fitWidth(projection3, width2, object2);
35235
+ projection3.fitWidth = function(width2, object) {
35236
+ return fitWidth(projection3, width2, object);
35154
35237
  };
35155
- projection3.fitHeight = function(height2, object2) {
35156
- return fitHeight(projection3, height2, object2);
35238
+ projection3.fitHeight = function(height2, object) {
35239
+ return fitHeight(projection3, height2, object);
35157
35240
  };
35158
35241
  function recenter() {
35159
35242
  var center2 = scaleTranslateRotate(k3, 0, 0, sx, sy, alpha).apply(null, project2(lambda, phi)), transform3 = scaleTranslateRotate(k3, x4 - center2[0], y4 - center2[1], sx, sy, alpha);
@@ -35294,17 +35377,17 @@ function albersUsa_default() {
35294
35377
  hawaiiPoint = hawaii.translate([x4 - 0.205 * k3, y4 + 0.212 * k3]).clipExtent([[x4 - 0.214 * k3 + epsilon6, y4 + 0.166 * k3 + epsilon6], [x4 - 0.115 * k3 - epsilon6, y4 + 0.234 * k3 - epsilon6]]).stream(pointStream);
35295
35378
  return reset();
35296
35379
  };
35297
- albersUsa.fitExtent = function(extent4, object2) {
35298
- return fitExtent(albersUsa, extent4, object2);
35380
+ albersUsa.fitExtent = function(extent4, object) {
35381
+ return fitExtent(albersUsa, extent4, object);
35299
35382
  };
35300
- albersUsa.fitSize = function(size, object2) {
35301
- return fitSize(albersUsa, size, object2);
35383
+ albersUsa.fitSize = function(size, object) {
35384
+ return fitSize(albersUsa, size, object);
35302
35385
  };
35303
- albersUsa.fitWidth = function(width2, object2) {
35304
- return fitWidth(albersUsa, width2, object2);
35386
+ albersUsa.fitWidth = function(width2, object) {
35387
+ return fitWidth(albersUsa, width2, object);
35305
35388
  };
35306
- albersUsa.fitHeight = function(height2, object2) {
35307
- return fitHeight(albersUsa, height2, object2);
35389
+ albersUsa.fitHeight = function(height2, object) {
35390
+ return fitHeight(albersUsa, height2, object);
35308
35391
  };
35309
35392
  function reset() {
35310
35393
  cache = cacheStream = null;
@@ -37779,6 +37862,9 @@ var Accent_default = colors_default("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b176
37779
37862
  // ../../node_modules/d3-scale-chromatic/src/categorical/Dark2.js
37780
37863
  var Dark2_default = colors_default("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");
37781
37864
 
37865
+ // ../../node_modules/d3-scale-chromatic/src/categorical/observable10.js
37866
+ var observable10_default = colors_default("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");
37867
+
37782
37868
  // ../../node_modules/d3-scale-chromatic/src/categorical/Paired.js
37783
37869
  var Paired_default = colors_default("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");
37784
37870
 
@@ -39989,6 +40075,15 @@ function parse(string2, fallback) {
39989
40075
  return new Date(string2);
39990
40076
  }
39991
40077
 
40078
+ // ../../node_modules/@observablehq/plot/src/order.js
40079
+ function orderof(values2) {
40080
+ if (values2 == null)
40081
+ return;
40082
+ const first3 = values2[0];
40083
+ const last2 = values2[values2.length - 1];
40084
+ return descending(first3, last2);
40085
+ }
40086
+
39992
40087
  // ../../node_modules/@observablehq/plot/src/time.js
39993
40088
  var durationSecond2 = 1e3;
39994
40089
  var durationMinute2 = durationSecond2 * 60;
@@ -40582,13 +40677,6 @@ function maybeAnchor(value, name2) {
40582
40677
  function maybeFrameAnchor(value = "middle") {
40583
40678
  return maybeAnchor(value, "frameAnchor");
40584
40679
  }
40585
- function orderof(values2) {
40586
- if (values2 == null)
40587
- return;
40588
- const first3 = values2[0];
40589
- const last2 = values2[values2.length - 1];
40590
- return descending(first3, last2);
40591
- }
40592
40680
  function inherit2(options = {}, ...rest) {
40593
40681
  let o = options;
40594
40682
  for (const defaults23 of rest) {
@@ -40625,6 +40713,15 @@ function named2(things) {
40625
40713
  function maybeNamed(things) {
40626
40714
  return isIterable3(things) ? named2(things) : things;
40627
40715
  }
40716
+ function maybeClip(clip) {
40717
+ if (clip === true)
40718
+ clip = "frame";
40719
+ else if (clip === false)
40720
+ clip = null;
40721
+ else if (clip != null)
40722
+ clip = keyword(clip, "clip", ["frame", "sphere"]);
40723
+ return clip;
40724
+ }
40628
40725
 
40629
40726
  // ../../node_modules/@observablehq/plot/src/scales/index.js
40630
40727
  var position = Symbol("position");
@@ -40944,6 +41041,8 @@ function groupn(x4, y4, {
40944
41041
  extent4.x = x5;
40945
41042
  if (Y3)
40946
41043
  extent4.y = y5;
41044
+ if (G)
41045
+ extent4.z = f2;
40947
41046
  if (filter3 && !filter3.reduce(g2, extent4))
40948
41047
  continue;
40949
41048
  groupFacet.push(i++);
@@ -41042,10 +41141,7 @@ function maybeEvaluator(name2, reduce, inputs, asReduce = maybeReduce) {
41042
41141
  };
41043
41142
  }
41044
41143
  function maybeGroup(I2, X3) {
41045
- return X3 ? sort(
41046
- group(I2, (i) => X3[i]),
41047
- first2
41048
- ) : [[, I2]];
41144
+ return X3 ? group(I2, (i) => X3[i]) : [[, I2]];
41049
41145
  }
41050
41146
  function maybeReduce(reduce, value, fallback = invalidReduce) {
41051
41147
  if (reduce == null)
@@ -41117,6 +41213,8 @@ function maybeGroupReduceFallback(reduce) {
41117
41213
  return reduceX;
41118
41214
  case "y":
41119
41215
  return reduceY;
41216
+ case "z":
41217
+ return reduceZ;
41120
41218
  }
41121
41219
  throw new Error(`invalid group reduce: ${reduce}`);
41122
41220
  }
@@ -41227,6 +41325,11 @@ var reduceY = {
41227
41325
  return y4;
41228
41326
  }
41229
41327
  };
41328
+ var reduceZ = {
41329
+ reduceIndex(I2, X3, { z: z2 }) {
41330
+ return z2;
41331
+ }
41332
+ };
41230
41333
  function find2(test) {
41231
41334
  if (typeof test !== "function")
41232
41335
  throw new Error(`invalid test function: ${test}`);
@@ -41403,48 +41506,14 @@ function getSource(channels, key) {
41403
41506
  return channel.source === null ? null : channel;
41404
41507
  }
41405
41508
 
41406
- // ../../node_modules/@observablehq/plot/src/memoize.js
41407
- function memoize1(compute) {
41408
- let cacheValue, cacheKeys;
41409
- return (...keys) => {
41410
- if (cacheKeys?.length !== keys.length || cacheKeys.some((k3, i) => k3 !== keys[i])) {
41411
- cacheKeys = keys;
41412
- cacheValue = compute(...keys);
41413
- }
41414
- return cacheValue;
41415
- };
41416
- }
41417
-
41418
- // ../../node_modules/@observablehq/plot/src/format.js
41419
- var numberFormat = memoize1((locale3) => {
41420
- return new Intl.NumberFormat(locale3);
41421
- });
41422
- var monthFormat = memoize1((locale3, month) => {
41423
- return new Intl.DateTimeFormat(locale3, { timeZone: "UTC", ...month && { month } });
41424
- });
41425
- var weekdayFormat = memoize1((locale3, weekday) => {
41426
- return new Intl.DateTimeFormat(locale3, { timeZone: "UTC", ...weekday && { weekday } });
41427
- });
41428
- function formatNumber(locale3 = "en-US") {
41429
- const format3 = numberFormat(locale3);
41430
- return (i) => i != null && !isNaN(i) ? format3.format(i) : void 0;
41431
- }
41432
- function formatMonth(locale3 = "en-US", format3 = "short") {
41433
- const fmt = monthFormat(locale3, format3);
41434
- return (i) => i != null && !isNaN(i = +new Date(Date.UTC(2e3, +i))) ? fmt.format(i) : void 0;
41435
- }
41436
- function formatWeekday(locale3 = "en-US", format3 = "short") {
41437
- const fmt = weekdayFormat(locale3, format3);
41438
- return (i) => i != null && !isNaN(i = +new Date(Date.UTC(2001, 0, +i))) ? fmt.format(i) : void 0;
41439
- }
41440
- function formatIsoDate(date2) {
41441
- return format2(date2, "Invalid Date");
41509
+ // ../../node_modules/@observablehq/plot/src/context.js
41510
+ function createContext(options = {}) {
41511
+ const { document: document2 = typeof window !== "undefined" ? window.document : void 0, clip } = options;
41512
+ return { document: document2, clip: maybeClip(clip) };
41442
41513
  }
41443
- function formatAuto(locale3 = "en-US") {
41444
- const number7 = formatNumber(locale3);
41445
- return (v3) => (v3 instanceof Date ? formatIsoDate : typeof v3 === "number" ? number7 : string)(v3);
41514
+ function create3(name2, { document: document2 }) {
41515
+ return select_default2(creator_default(name2).call(document2.documentElement));
41446
41516
  }
41447
- var formatDefault = formatAuto();
41448
41517
 
41449
41518
  // ../../node_modules/@observablehq/plot/src/warnings.js
41450
41519
  var warnings = 0;
@@ -41463,387 +41532,6 @@ function warn(message) {
41463
41532
  ++warnings;
41464
41533
  }
41465
41534
 
41466
- // ../../node_modules/@observablehq/plot/src/style.js
41467
- var offset = (typeof window !== "undefined" ? window.devicePixelRatio > 1 : typeof it === "undefined") ? 0 : 0.5;
41468
- var nextClipId = 0;
41469
- function getClipId() {
41470
- return `plot-clip-${++nextClipId}`;
41471
- }
41472
- function styles(mark2, {
41473
- title,
41474
- href,
41475
- ariaLabel: variaLabel,
41476
- ariaDescription,
41477
- ariaHidden,
41478
- target,
41479
- fill,
41480
- fillOpacity,
41481
- stroke,
41482
- strokeWidth,
41483
- strokeOpacity,
41484
- strokeLinejoin,
41485
- strokeLinecap,
41486
- strokeMiterlimit,
41487
- strokeDasharray,
41488
- strokeDashoffset,
41489
- opacity: opacity2,
41490
- mixBlendMode,
41491
- imageFilter,
41492
- paintOrder,
41493
- pointerEvents,
41494
- shapeRendering,
41495
- channels
41496
- }, {
41497
- ariaLabel: cariaLabel,
41498
- fill: defaultFill = "currentColor",
41499
- fillOpacity: defaultFillOpacity,
41500
- stroke: defaultStroke = "none",
41501
- strokeOpacity: defaultStrokeOpacity,
41502
- strokeWidth: defaultStrokeWidth,
41503
- strokeLinecap: defaultStrokeLinecap,
41504
- strokeLinejoin: defaultStrokeLinejoin,
41505
- strokeMiterlimit: defaultStrokeMiterlimit,
41506
- paintOrder: defaultPaintOrder
41507
- }) {
41508
- if (defaultFill === null) {
41509
- fill = null;
41510
- fillOpacity = null;
41511
- }
41512
- if (defaultStroke === null) {
41513
- stroke = null;
41514
- strokeOpacity = null;
41515
- }
41516
- if (isNoneish(defaultFill)) {
41517
- if (!isNoneish(defaultStroke) && (!isNoneish(fill) || channels?.fill))
41518
- defaultStroke = "none";
41519
- } else {
41520
- if (isNoneish(defaultStroke) && (!isNoneish(stroke) || channels?.stroke))
41521
- defaultFill = "none";
41522
- }
41523
- const [vfill, cfill] = maybeColorChannel(fill, defaultFill);
41524
- const [vfillOpacity, cfillOpacity] = maybeNumberChannel(fillOpacity, defaultFillOpacity);
41525
- const [vstroke, cstroke] = maybeColorChannel(stroke, defaultStroke);
41526
- const [vstrokeOpacity, cstrokeOpacity] = maybeNumberChannel(strokeOpacity, defaultStrokeOpacity);
41527
- const [vopacity, copacity] = maybeNumberChannel(opacity2);
41528
- if (!isNone(cstroke)) {
41529
- if (strokeWidth === void 0)
41530
- strokeWidth = defaultStrokeWidth;
41531
- if (strokeLinecap === void 0)
41532
- strokeLinecap = defaultStrokeLinecap;
41533
- if (strokeLinejoin === void 0)
41534
- strokeLinejoin = defaultStrokeLinejoin;
41535
- if (strokeMiterlimit === void 0 && !isRound(strokeLinejoin))
41536
- strokeMiterlimit = defaultStrokeMiterlimit;
41537
- if (!isNone(cfill) && paintOrder === void 0)
41538
- paintOrder = defaultPaintOrder;
41539
- }
41540
- const [vstrokeWidth, cstrokeWidth] = maybeNumberChannel(strokeWidth);
41541
- if (defaultFill !== null) {
41542
- mark2.fill = impliedString(cfill, "currentColor");
41543
- mark2.fillOpacity = impliedNumber(cfillOpacity, 1);
41544
- }
41545
- if (defaultStroke !== null) {
41546
- mark2.stroke = impliedString(cstroke, "none");
41547
- mark2.strokeWidth = impliedNumber(cstrokeWidth, 1);
41548
- mark2.strokeOpacity = impliedNumber(cstrokeOpacity, 1);
41549
- mark2.strokeLinejoin = impliedString(strokeLinejoin, "miter");
41550
- mark2.strokeLinecap = impliedString(strokeLinecap, "butt");
41551
- mark2.strokeMiterlimit = impliedNumber(strokeMiterlimit, 4);
41552
- mark2.strokeDasharray = impliedString(strokeDasharray, "none");
41553
- mark2.strokeDashoffset = impliedString(strokeDashoffset, "0");
41554
- }
41555
- mark2.target = string(target);
41556
- mark2.ariaLabel = string(cariaLabel);
41557
- mark2.ariaDescription = string(ariaDescription);
41558
- mark2.ariaHidden = string(ariaHidden);
41559
- mark2.opacity = impliedNumber(copacity, 1);
41560
- mark2.mixBlendMode = impliedString(mixBlendMode, "normal");
41561
- mark2.imageFilter = impliedString(imageFilter, "none");
41562
- mark2.paintOrder = impliedString(paintOrder, "normal");
41563
- mark2.pointerEvents = impliedString(pointerEvents, "auto");
41564
- mark2.shapeRendering = impliedString(shapeRendering, "auto");
41565
- return {
41566
- title: { value: title, optional: true, filter: null },
41567
- href: { value: href, optional: true, filter: null },
41568
- ariaLabel: { value: variaLabel, optional: true, filter: null },
41569
- fill: { value: vfill, scale: "auto", optional: true },
41570
- fillOpacity: { value: vfillOpacity, scale: "auto", optional: true },
41571
- stroke: { value: vstroke, scale: "auto", optional: true },
41572
- strokeOpacity: { value: vstrokeOpacity, scale: "auto", optional: true },
41573
- strokeWidth: { value: vstrokeWidth, optional: true },
41574
- opacity: { value: vopacity, scale: "auto", optional: true }
41575
- };
41576
- }
41577
- function applyTitle(selection2, L2) {
41578
- if (L2)
41579
- selection2.filter((i) => nonempty(L2[i])).append("title").call(applyText, L2);
41580
- }
41581
- function applyTitleGroup(selection2, L2) {
41582
- if (L2)
41583
- selection2.filter(([i]) => nonempty(L2[i])).append("title").call(applyTextGroup, L2);
41584
- }
41585
- function applyText(selection2, T) {
41586
- if (T)
41587
- selection2.text((i) => formatDefault(T[i]));
41588
- }
41589
- function applyTextGroup(selection2, T) {
41590
- if (T)
41591
- selection2.text(([i]) => formatDefault(T[i]));
41592
- }
41593
- function applyChannelStyles(selection2, { target, tip: tip2 }, {
41594
- ariaLabel: AL,
41595
- title: T,
41596
- fill: F2,
41597
- fillOpacity: FO,
41598
- stroke: S2,
41599
- strokeOpacity: SO,
41600
- strokeWidth: SW,
41601
- opacity: O2,
41602
- href: H2
41603
- }) {
41604
- if (AL)
41605
- applyAttr(selection2, "aria-label", (i) => AL[i]);
41606
- if (F2)
41607
- applyAttr(selection2, "fill", (i) => F2[i]);
41608
- if (FO)
41609
- applyAttr(selection2, "fill-opacity", (i) => FO[i]);
41610
- if (S2)
41611
- applyAttr(selection2, "stroke", (i) => S2[i]);
41612
- if (SO)
41613
- applyAttr(selection2, "stroke-opacity", (i) => SO[i]);
41614
- if (SW)
41615
- applyAttr(selection2, "stroke-width", (i) => SW[i]);
41616
- if (O2)
41617
- applyAttr(selection2, "opacity", (i) => O2[i]);
41618
- if (H2)
41619
- applyHref(selection2, (i) => H2[i], target);
41620
- if (!tip2)
41621
- applyTitle(selection2, T);
41622
- }
41623
- function applyGroupedChannelStyles(selection2, { target, tip: tip2 }, {
41624
- ariaLabel: AL,
41625
- title: T,
41626
- fill: F2,
41627
- fillOpacity: FO,
41628
- stroke: S2,
41629
- strokeOpacity: SO,
41630
- strokeWidth: SW,
41631
- opacity: O2,
41632
- href: H2
41633
- }) {
41634
- if (AL)
41635
- applyAttr(selection2, "aria-label", ([i]) => AL[i]);
41636
- if (F2)
41637
- applyAttr(selection2, "fill", ([i]) => F2[i]);
41638
- if (FO)
41639
- applyAttr(selection2, "fill-opacity", ([i]) => FO[i]);
41640
- if (S2)
41641
- applyAttr(selection2, "stroke", ([i]) => S2[i]);
41642
- if (SO)
41643
- applyAttr(selection2, "stroke-opacity", ([i]) => SO[i]);
41644
- if (SW)
41645
- applyAttr(selection2, "stroke-width", ([i]) => SW[i]);
41646
- if (O2)
41647
- applyAttr(selection2, "opacity", ([i]) => O2[i]);
41648
- if (H2)
41649
- applyHref(selection2, ([i]) => H2[i], target);
41650
- if (!tip2)
41651
- applyTitleGroup(selection2, T);
41652
- }
41653
- function groupAesthetics({
41654
- ariaLabel: AL,
41655
- title: T,
41656
- fill: F2,
41657
- fillOpacity: FO,
41658
- stroke: S2,
41659
- strokeOpacity: SO,
41660
- strokeWidth: SW,
41661
- opacity: O2,
41662
- href: H2
41663
- }, { tip: tip2 }) {
41664
- return [AL, tip2 ? void 0 : T, F2, FO, S2, SO, SW, O2, H2].filter((c4) => c4 !== void 0);
41665
- }
41666
- function groupZ2(I2, Z3, z2) {
41667
- const G = group(I2, (i) => Z3[i]);
41668
- if (z2 === void 0 && G.size > 1 + I2.length >> 1) {
41669
- warn(
41670
- `Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null.`
41671
- );
41672
- }
41673
- return G.values();
41674
- }
41675
- function* groupIndex(I2, position3, mark2, channels) {
41676
- const { z: z2 } = mark2;
41677
- const { z: Z3 } = channels;
41678
- const A5 = groupAesthetics(channels, mark2);
41679
- const C3 = [...position3, ...A5];
41680
- for (const G of Z3 ? groupZ2(I2, Z3, z2) : [I2]) {
41681
- let Ag;
41682
- let Gg;
41683
- out:
41684
- for (const i of G) {
41685
- for (const c4 of C3) {
41686
- if (!defined(c4[i])) {
41687
- if (Gg)
41688
- Gg.push(-1);
41689
- continue out;
41690
- }
41691
- }
41692
- if (Ag === void 0) {
41693
- if (Gg)
41694
- yield Gg;
41695
- Ag = A5.map((c4) => keyof2(c4[i])), Gg = [i];
41696
- continue;
41697
- }
41698
- Gg.push(i);
41699
- for (let j2 = 0; j2 < A5.length; ++j2) {
41700
- const k3 = keyof2(A5[j2][i]);
41701
- if (k3 !== Ag[j2]) {
41702
- yield Gg;
41703
- Ag = A5.map((c4) => keyof2(c4[i])), Gg = [i];
41704
- continue out;
41705
- }
41706
- }
41707
- }
41708
- if (Gg)
41709
- yield Gg;
41710
- }
41711
- }
41712
- function maybeClip(clip) {
41713
- if (clip === true)
41714
- clip = "frame";
41715
- else if (clip === false)
41716
- clip = null;
41717
- else if (clip != null)
41718
- clip = keyword(clip, "clip", ["frame", "sphere"]);
41719
- return clip;
41720
- }
41721
- function applyClip(selection2, mark2, dimensions, context) {
41722
- let clipUrl;
41723
- const { clip = context.clip } = mark2;
41724
- switch (clip) {
41725
- case "frame": {
41726
- const { width: width2, height: height2, marginLeft: marginLeft2, marginRight: marginRight2, marginTop: marginTop2, marginBottom: marginBottom2 } = dimensions;
41727
- const id2 = getClipId();
41728
- clipUrl = `url(#${id2})`;
41729
- selection2 = create3("svg:g", context).call(
41730
- (g2) => g2.append("svg:clipPath").attr("id", id2).append("rect").attr("x", marginLeft2).attr("y", marginTop2).attr("width", width2 - marginRight2 - marginLeft2).attr("height", height2 - marginTop2 - marginBottom2)
41731
- ).each(function() {
41732
- this.appendChild(selection2.node());
41733
- selection2.node = () => this;
41734
- });
41735
- break;
41736
- }
41737
- case "sphere": {
41738
- const { projection: projection3 } = context;
41739
- if (!projection3)
41740
- throw new Error(`the "sphere" clip option requires a projection`);
41741
- const id2 = getClipId();
41742
- clipUrl = `url(#${id2})`;
41743
- selection2.append("clipPath").attr("id", id2).append("path").attr("d", path_default(projection3)({ type: "Sphere" }));
41744
- break;
41745
- }
41746
- }
41747
- applyAttr(selection2, "aria-label", mark2.ariaLabel);
41748
- applyAttr(selection2, "aria-description", mark2.ariaDescription);
41749
- applyAttr(selection2, "aria-hidden", mark2.ariaHidden);
41750
- applyAttr(selection2, "clip-path", clipUrl);
41751
- }
41752
- function applyIndirectStyles(selection2, mark2, dimensions, context) {
41753
- applyClip(selection2, mark2, dimensions, context);
41754
- applyAttr(selection2, "fill", mark2.fill);
41755
- applyAttr(selection2, "fill-opacity", mark2.fillOpacity);
41756
- applyAttr(selection2, "stroke", mark2.stroke);
41757
- applyAttr(selection2, "stroke-width", mark2.strokeWidth);
41758
- applyAttr(selection2, "stroke-opacity", mark2.strokeOpacity);
41759
- applyAttr(selection2, "stroke-linejoin", mark2.strokeLinejoin);
41760
- applyAttr(selection2, "stroke-linecap", mark2.strokeLinecap);
41761
- applyAttr(selection2, "stroke-miterlimit", mark2.strokeMiterlimit);
41762
- applyAttr(selection2, "stroke-dasharray", mark2.strokeDasharray);
41763
- applyAttr(selection2, "stroke-dashoffset", mark2.strokeDashoffset);
41764
- applyAttr(selection2, "shape-rendering", mark2.shapeRendering);
41765
- applyAttr(selection2, "filter", mark2.imageFilter);
41766
- applyAttr(selection2, "paint-order", mark2.paintOrder);
41767
- const { pointerEvents = context.pointerSticky === false ? "none" : void 0 } = mark2;
41768
- applyAttr(selection2, "pointer-events", pointerEvents);
41769
- }
41770
- function applyDirectStyles(selection2, mark2) {
41771
- applyStyle(selection2, "mix-blend-mode", mark2.mixBlendMode);
41772
- applyAttr(selection2, "opacity", mark2.opacity);
41773
- }
41774
- function applyHref(selection2, href, target) {
41775
- selection2.each(function(i) {
41776
- const h2 = href(i);
41777
- if (h2 != null) {
41778
- const a3 = this.ownerDocument.createElementNS(namespaces_default.svg, "a");
41779
- a3.setAttribute("fill", "inherit");
41780
- a3.setAttributeNS(namespaces_default.xlink, "href", h2);
41781
- if (target != null)
41782
- a3.setAttribute("target", target);
41783
- this.parentNode.insertBefore(a3, this).appendChild(this);
41784
- }
41785
- });
41786
- }
41787
- function applyAttr(selection2, name2, value) {
41788
- if (value != null)
41789
- selection2.attr(name2, value);
41790
- }
41791
- function applyStyle(selection2, name2, value) {
41792
- if (value != null)
41793
- selection2.style(name2, value);
41794
- }
41795
- function applyTransform(selection2, mark2, { x: x4, y: y4 }, tx = offset, ty = offset) {
41796
- tx += mark2.dx;
41797
- ty += mark2.dy;
41798
- if (x4?.bandwidth)
41799
- tx += x4.bandwidth() / 2;
41800
- if (y4?.bandwidth)
41801
- ty += y4.bandwidth() / 2;
41802
- if (tx || ty)
41803
- selection2.attr("transform", `translate(${tx},${ty})`);
41804
- }
41805
- function impliedString(value, impliedValue) {
41806
- if ((value = string(value)) !== impliedValue)
41807
- return value;
41808
- }
41809
- function impliedNumber(value, impliedValue) {
41810
- if ((value = number5(value)) !== impliedValue)
41811
- return value;
41812
- }
41813
- var validClassName = /^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;
41814
- function maybeClassName(name2) {
41815
- if (name2 === void 0)
41816
- return "plot-d6a7b5";
41817
- name2 = `${name2}`;
41818
- if (!validClassName.test(name2))
41819
- throw new Error(`invalid class name: ${name2}`);
41820
- return name2;
41821
- }
41822
- function applyInlineStyles(selection2, style2) {
41823
- if (typeof style2 === "string") {
41824
- selection2.property("style", style2);
41825
- } else if (style2 != null) {
41826
- for (const element of selection2) {
41827
- Object.assign(element.style, style2);
41828
- }
41829
- }
41830
- }
41831
- function applyFrameAnchor({ frameAnchor }, { width: width2, height: height2, marginTop: marginTop2, marginRight: marginRight2, marginBottom: marginBottom2, marginLeft: marginLeft2 }) {
41832
- return [
41833
- /left$/.test(frameAnchor) ? marginLeft2 : /right$/.test(frameAnchor) ? width2 - marginRight2 : (marginLeft2 + width2 - marginRight2) / 2,
41834
- /^top/.test(frameAnchor) ? marginTop2 : /^bottom/.test(frameAnchor) ? height2 - marginBottom2 : (marginTop2 + height2 - marginBottom2) / 2
41835
- ];
41836
- }
41837
-
41838
- // ../../node_modules/@observablehq/plot/src/context.js
41839
- function createContext(options = {}) {
41840
- const { document: document2 = typeof window !== "undefined" ? window.document : void 0, clip } = options;
41841
- return { document: document2, clip: maybeClip(clip) };
41842
- }
41843
- function create3(name2, { document: document2 }) {
41844
- return select_default2(creator_default(name2).call(document2.documentElement));
41845
- }
41846
-
41847
41535
  // ../../node_modules/@observablehq/plot/src/projection.js
41848
41536
  var pi4 = Math.PI;
41849
41537
  var tau5 = 2 * pi4;
@@ -42082,29 +41770,17 @@ function getGeometryChannels(channel) {
42082
41770
  sphere() {
42083
41771
  }
42084
41772
  };
42085
- for (const object2 of channel.value)
42086
- stream_default(object2, sink);
41773
+ for (const object of channel.value)
41774
+ stream_default(object, sink);
42087
41775
  return [x4, y4];
42088
41776
  }
42089
41777
 
42090
41778
  // ../../node_modules/@observablehq/plot/src/scales/schemes.js
42091
- var schemeObservable10 = [
42092
- "#4269d0",
42093
- "#efb118",
42094
- "#ff725c",
42095
- "#6cc5b0",
42096
- "#3ca951",
42097
- "#ff8ab7",
42098
- "#a463f2",
42099
- "#97bbf5",
42100
- "#9c6b4e",
42101
- "#9498a0"
42102
- ];
42103
41779
  var categoricalSchemes = /* @__PURE__ */ new Map([
42104
41780
  ["accent", Accent_default],
42105
41781
  ["category10", category10_default],
42106
41782
  ["dark2", Dark2_default],
42107
- ["observable10", schemeObservable10],
41783
+ ["observable10", observable10_default],
42108
41784
  ["paired", Paired_default],
42109
41785
  ["pastel1", Pastel1_default],
42110
41786
  ["pastel2", Pastel2_default],
@@ -43246,6 +42922,412 @@ function exposeScale({ scale: scale3, type: type2, domain, range: range3, interp
43246
42922
  };
43247
42923
  }
43248
42924
 
42925
+ // ../../node_modules/@observablehq/plot/src/memoize.js
42926
+ function memoize1(compute) {
42927
+ let cacheValue, cacheKeys;
42928
+ return (...keys) => {
42929
+ if (cacheKeys?.length !== keys.length || cacheKeys.some((k3, i) => k3 !== keys[i])) {
42930
+ cacheKeys = keys;
42931
+ cacheValue = compute(...keys);
42932
+ }
42933
+ return cacheValue;
42934
+ };
42935
+ }
42936
+
42937
+ // ../../node_modules/@observablehq/plot/src/format.js
42938
+ var numberFormat = memoize1((locale3) => {
42939
+ return new Intl.NumberFormat(locale3);
42940
+ });
42941
+ var monthFormat = memoize1((locale3, month) => {
42942
+ return new Intl.DateTimeFormat(locale3, { timeZone: "UTC", ...month && { month } });
42943
+ });
42944
+ var weekdayFormat = memoize1((locale3, weekday) => {
42945
+ return new Intl.DateTimeFormat(locale3, { timeZone: "UTC", ...weekday && { weekday } });
42946
+ });
42947
+ function formatNumber(locale3 = "en-US") {
42948
+ const format3 = numberFormat(locale3);
42949
+ return (i) => i != null && !isNaN(i) ? format3.format(i) : void 0;
42950
+ }
42951
+ function formatMonth(locale3 = "en-US", format3 = "short") {
42952
+ const fmt = monthFormat(locale3, format3);
42953
+ return (i) => i != null && !isNaN(i = +new Date(Date.UTC(2e3, +i))) ? fmt.format(i) : void 0;
42954
+ }
42955
+ function formatWeekday(locale3 = "en-US", format3 = "short") {
42956
+ const fmt = weekdayFormat(locale3, format3);
42957
+ return (i) => i != null && !isNaN(i = +new Date(Date.UTC(2001, 0, +i))) ? fmt.format(i) : void 0;
42958
+ }
42959
+ function formatIsoDate(date2) {
42960
+ return format2(date2, "Invalid Date");
42961
+ }
42962
+ function formatAuto(locale3 = "en-US") {
42963
+ const number7 = formatNumber(locale3);
42964
+ return (v3) => (v3 instanceof Date ? formatIsoDate : typeof v3 === "number" ? number7 : string)(v3);
42965
+ }
42966
+ var formatDefault = formatAuto();
42967
+
42968
+ // ../../node_modules/@observablehq/plot/src/style.js
42969
+ var offset = (typeof window !== "undefined" ? window.devicePixelRatio > 1 : typeof it === "undefined") ? 0 : 0.5;
42970
+ var nextClipId = 0;
42971
+ function getClipId() {
42972
+ return `plot-clip-${++nextClipId}`;
42973
+ }
42974
+ function styles(mark2, {
42975
+ title,
42976
+ href,
42977
+ ariaLabel: variaLabel,
42978
+ ariaDescription,
42979
+ ariaHidden,
42980
+ target,
42981
+ fill,
42982
+ fillOpacity,
42983
+ stroke,
42984
+ strokeWidth,
42985
+ strokeOpacity,
42986
+ strokeLinejoin,
42987
+ strokeLinecap,
42988
+ strokeMiterlimit,
42989
+ strokeDasharray,
42990
+ strokeDashoffset,
42991
+ opacity: opacity2,
42992
+ mixBlendMode,
42993
+ imageFilter,
42994
+ paintOrder,
42995
+ pointerEvents,
42996
+ shapeRendering,
42997
+ channels
42998
+ }, {
42999
+ ariaLabel: cariaLabel,
43000
+ fill: defaultFill = "currentColor",
43001
+ fillOpacity: defaultFillOpacity,
43002
+ stroke: defaultStroke = "none",
43003
+ strokeOpacity: defaultStrokeOpacity,
43004
+ strokeWidth: defaultStrokeWidth,
43005
+ strokeLinecap: defaultStrokeLinecap,
43006
+ strokeLinejoin: defaultStrokeLinejoin,
43007
+ strokeMiterlimit: defaultStrokeMiterlimit,
43008
+ paintOrder: defaultPaintOrder
43009
+ }) {
43010
+ if (defaultFill === null) {
43011
+ fill = null;
43012
+ fillOpacity = null;
43013
+ }
43014
+ if (defaultStroke === null) {
43015
+ stroke = null;
43016
+ strokeOpacity = null;
43017
+ }
43018
+ if (isNoneish(defaultFill)) {
43019
+ if (!isNoneish(defaultStroke) && (!isNoneish(fill) || channels?.fill))
43020
+ defaultStroke = "none";
43021
+ } else {
43022
+ if (isNoneish(defaultStroke) && (!isNoneish(stroke) || channels?.stroke))
43023
+ defaultFill = "none";
43024
+ }
43025
+ const [vfill, cfill] = maybeColorChannel(fill, defaultFill);
43026
+ const [vfillOpacity, cfillOpacity] = maybeNumberChannel(fillOpacity, defaultFillOpacity);
43027
+ const [vstroke, cstroke] = maybeColorChannel(stroke, defaultStroke);
43028
+ const [vstrokeOpacity, cstrokeOpacity] = maybeNumberChannel(strokeOpacity, defaultStrokeOpacity);
43029
+ const [vopacity, copacity] = maybeNumberChannel(opacity2);
43030
+ if (!isNone(cstroke)) {
43031
+ if (strokeWidth === void 0)
43032
+ strokeWidth = defaultStrokeWidth;
43033
+ if (strokeLinecap === void 0)
43034
+ strokeLinecap = defaultStrokeLinecap;
43035
+ if (strokeLinejoin === void 0)
43036
+ strokeLinejoin = defaultStrokeLinejoin;
43037
+ if (strokeMiterlimit === void 0 && !isRound(strokeLinejoin))
43038
+ strokeMiterlimit = defaultStrokeMiterlimit;
43039
+ if (!isNone(cfill) && paintOrder === void 0)
43040
+ paintOrder = defaultPaintOrder;
43041
+ }
43042
+ const [vstrokeWidth, cstrokeWidth] = maybeNumberChannel(strokeWidth);
43043
+ if (defaultFill !== null) {
43044
+ mark2.fill = impliedString(cfill, "currentColor");
43045
+ mark2.fillOpacity = impliedNumber(cfillOpacity, 1);
43046
+ }
43047
+ if (defaultStroke !== null) {
43048
+ mark2.stroke = impliedString(cstroke, "none");
43049
+ mark2.strokeWidth = impliedNumber(cstrokeWidth, 1);
43050
+ mark2.strokeOpacity = impliedNumber(cstrokeOpacity, 1);
43051
+ mark2.strokeLinejoin = impliedString(strokeLinejoin, "miter");
43052
+ mark2.strokeLinecap = impliedString(strokeLinecap, "butt");
43053
+ mark2.strokeMiterlimit = impliedNumber(strokeMiterlimit, 4);
43054
+ mark2.strokeDasharray = impliedString(strokeDasharray, "none");
43055
+ mark2.strokeDashoffset = impliedString(strokeDashoffset, "0");
43056
+ }
43057
+ mark2.target = string(target);
43058
+ mark2.ariaLabel = string(cariaLabel);
43059
+ mark2.ariaDescription = string(ariaDescription);
43060
+ mark2.ariaHidden = string(ariaHidden);
43061
+ mark2.opacity = impliedNumber(copacity, 1);
43062
+ mark2.mixBlendMode = impliedString(mixBlendMode, "normal");
43063
+ mark2.imageFilter = impliedString(imageFilter, "none");
43064
+ mark2.paintOrder = impliedString(paintOrder, "normal");
43065
+ mark2.pointerEvents = impliedString(pointerEvents, "auto");
43066
+ mark2.shapeRendering = impliedString(shapeRendering, "auto");
43067
+ return {
43068
+ title: { value: title, optional: true, filter: null },
43069
+ href: { value: href, optional: true, filter: null },
43070
+ ariaLabel: { value: variaLabel, optional: true, filter: null },
43071
+ fill: { value: vfill, scale: "auto", optional: true },
43072
+ fillOpacity: { value: vfillOpacity, scale: "auto", optional: true },
43073
+ stroke: { value: vstroke, scale: "auto", optional: true },
43074
+ strokeOpacity: { value: vstrokeOpacity, scale: "auto", optional: true },
43075
+ strokeWidth: { value: vstrokeWidth, optional: true },
43076
+ opacity: { value: vopacity, scale: "auto", optional: true }
43077
+ };
43078
+ }
43079
+ function applyTitle(selection2, L2) {
43080
+ if (L2)
43081
+ selection2.filter((i) => nonempty(L2[i])).append("title").call(applyText, L2);
43082
+ }
43083
+ function applyTitleGroup(selection2, L2) {
43084
+ if (L2)
43085
+ selection2.filter(([i]) => nonempty(L2[i])).append("title").call(applyTextGroup, L2);
43086
+ }
43087
+ function applyText(selection2, T) {
43088
+ if (T)
43089
+ selection2.text((i) => formatDefault(T[i]));
43090
+ }
43091
+ function applyTextGroup(selection2, T) {
43092
+ if (T)
43093
+ selection2.text(([i]) => formatDefault(T[i]));
43094
+ }
43095
+ function applyChannelStyles(selection2, { target, tip: tip2 }, {
43096
+ ariaLabel: AL,
43097
+ title: T,
43098
+ fill: F2,
43099
+ fillOpacity: FO,
43100
+ stroke: S2,
43101
+ strokeOpacity: SO,
43102
+ strokeWidth: SW,
43103
+ opacity: O2,
43104
+ href: H2
43105
+ }) {
43106
+ if (AL)
43107
+ applyAttr(selection2, "aria-label", (i) => AL[i]);
43108
+ if (F2)
43109
+ applyAttr(selection2, "fill", (i) => F2[i]);
43110
+ if (FO)
43111
+ applyAttr(selection2, "fill-opacity", (i) => FO[i]);
43112
+ if (S2)
43113
+ applyAttr(selection2, "stroke", (i) => S2[i]);
43114
+ if (SO)
43115
+ applyAttr(selection2, "stroke-opacity", (i) => SO[i]);
43116
+ if (SW)
43117
+ applyAttr(selection2, "stroke-width", (i) => SW[i]);
43118
+ if (O2)
43119
+ applyAttr(selection2, "opacity", (i) => O2[i]);
43120
+ if (H2)
43121
+ applyHref(selection2, (i) => H2[i], target);
43122
+ if (!tip2)
43123
+ applyTitle(selection2, T);
43124
+ }
43125
+ function applyGroupedChannelStyles(selection2, { target, tip: tip2 }, {
43126
+ ariaLabel: AL,
43127
+ title: T,
43128
+ fill: F2,
43129
+ fillOpacity: FO,
43130
+ stroke: S2,
43131
+ strokeOpacity: SO,
43132
+ strokeWidth: SW,
43133
+ opacity: O2,
43134
+ href: H2
43135
+ }) {
43136
+ if (AL)
43137
+ applyAttr(selection2, "aria-label", ([i]) => AL[i]);
43138
+ if (F2)
43139
+ applyAttr(selection2, "fill", ([i]) => F2[i]);
43140
+ if (FO)
43141
+ applyAttr(selection2, "fill-opacity", ([i]) => FO[i]);
43142
+ if (S2)
43143
+ applyAttr(selection2, "stroke", ([i]) => S2[i]);
43144
+ if (SO)
43145
+ applyAttr(selection2, "stroke-opacity", ([i]) => SO[i]);
43146
+ if (SW)
43147
+ applyAttr(selection2, "stroke-width", ([i]) => SW[i]);
43148
+ if (O2)
43149
+ applyAttr(selection2, "opacity", ([i]) => O2[i]);
43150
+ if (H2)
43151
+ applyHref(selection2, ([i]) => H2[i], target);
43152
+ if (!tip2)
43153
+ applyTitleGroup(selection2, T);
43154
+ }
43155
+ function groupAesthetics({
43156
+ ariaLabel: AL,
43157
+ title: T,
43158
+ fill: F2,
43159
+ fillOpacity: FO,
43160
+ stroke: S2,
43161
+ strokeOpacity: SO,
43162
+ strokeWidth: SW,
43163
+ opacity: O2,
43164
+ href: H2
43165
+ }, { tip: tip2 }) {
43166
+ return [AL, tip2 ? void 0 : T, F2, FO, S2, SO, SW, O2, H2].filter((c4) => c4 !== void 0);
43167
+ }
43168
+ function groupZ2(I2, Z3, z2) {
43169
+ const G = group(I2, (i) => Z3[i]);
43170
+ if (z2 === void 0 && G.size > 1 + I2.length >> 1) {
43171
+ warn(
43172
+ `Warning: the implicit z channel has high cardinality. This may occur when the fill or stroke channel is associated with quantitative data rather than ordinal or categorical data. You can suppress this warning by setting the z option explicitly; if this data represents a single series, set z to null.`
43173
+ );
43174
+ }
43175
+ return G.values();
43176
+ }
43177
+ function* groupIndex(I2, position3, mark2, channels) {
43178
+ const { z: z2 } = mark2;
43179
+ const { z: Z3 } = channels;
43180
+ const A5 = groupAesthetics(channels, mark2);
43181
+ const C3 = [...position3, ...A5];
43182
+ for (const G of Z3 ? groupZ2(I2, Z3, z2) : [I2]) {
43183
+ let Ag;
43184
+ let Gg;
43185
+ out:
43186
+ for (const i of G) {
43187
+ for (const c4 of C3) {
43188
+ if (!defined(c4[i])) {
43189
+ if (Gg)
43190
+ Gg.push(-1);
43191
+ continue out;
43192
+ }
43193
+ }
43194
+ if (Ag === void 0) {
43195
+ if (Gg)
43196
+ yield Gg;
43197
+ Ag = A5.map((c4) => keyof2(c4[i])), Gg = [i];
43198
+ continue;
43199
+ }
43200
+ Gg.push(i);
43201
+ for (let j2 = 0; j2 < A5.length; ++j2) {
43202
+ const k3 = keyof2(A5[j2][i]);
43203
+ if (k3 !== Ag[j2]) {
43204
+ yield Gg;
43205
+ Ag = A5.map((c4) => keyof2(c4[i])), Gg = [i];
43206
+ continue out;
43207
+ }
43208
+ }
43209
+ }
43210
+ if (Gg)
43211
+ yield Gg;
43212
+ }
43213
+ }
43214
+ function applyClip(selection2, mark2, dimensions, context) {
43215
+ let clipUrl;
43216
+ const { clip = context.clip } = mark2;
43217
+ switch (clip) {
43218
+ case "frame": {
43219
+ const { width: width2, height: height2, marginLeft: marginLeft2, marginRight: marginRight2, marginTop: marginTop2, marginBottom: marginBottom2 } = dimensions;
43220
+ const id2 = getClipId();
43221
+ clipUrl = `url(#${id2})`;
43222
+ selection2 = create3("svg:g", context).call(
43223
+ (g2) => g2.append("svg:clipPath").attr("id", id2).append("rect").attr("x", marginLeft2).attr("y", marginTop2).attr("width", width2 - marginRight2 - marginLeft2).attr("height", height2 - marginTop2 - marginBottom2)
43224
+ ).each(function() {
43225
+ this.appendChild(selection2.node());
43226
+ selection2.node = () => this;
43227
+ });
43228
+ break;
43229
+ }
43230
+ case "sphere": {
43231
+ const { projection: projection3 } = context;
43232
+ if (!projection3)
43233
+ throw new Error(`the "sphere" clip option requires a projection`);
43234
+ const id2 = getClipId();
43235
+ clipUrl = `url(#${id2})`;
43236
+ selection2.append("clipPath").attr("id", id2).append("path").attr("d", path_default(projection3)({ type: "Sphere" }));
43237
+ break;
43238
+ }
43239
+ }
43240
+ applyAttr(selection2, "aria-label", mark2.ariaLabel);
43241
+ applyAttr(selection2, "aria-description", mark2.ariaDescription);
43242
+ applyAttr(selection2, "aria-hidden", mark2.ariaHidden);
43243
+ applyAttr(selection2, "clip-path", clipUrl);
43244
+ }
43245
+ function applyIndirectStyles(selection2, mark2, dimensions, context) {
43246
+ applyClip(selection2, mark2, dimensions, context);
43247
+ applyAttr(selection2, "fill", mark2.fill);
43248
+ applyAttr(selection2, "fill-opacity", mark2.fillOpacity);
43249
+ applyAttr(selection2, "stroke", mark2.stroke);
43250
+ applyAttr(selection2, "stroke-width", mark2.strokeWidth);
43251
+ applyAttr(selection2, "stroke-opacity", mark2.strokeOpacity);
43252
+ applyAttr(selection2, "stroke-linejoin", mark2.strokeLinejoin);
43253
+ applyAttr(selection2, "stroke-linecap", mark2.strokeLinecap);
43254
+ applyAttr(selection2, "stroke-miterlimit", mark2.strokeMiterlimit);
43255
+ applyAttr(selection2, "stroke-dasharray", mark2.strokeDasharray);
43256
+ applyAttr(selection2, "stroke-dashoffset", mark2.strokeDashoffset);
43257
+ applyAttr(selection2, "shape-rendering", mark2.shapeRendering);
43258
+ applyAttr(selection2, "filter", mark2.imageFilter);
43259
+ applyAttr(selection2, "paint-order", mark2.paintOrder);
43260
+ const { pointerEvents = context.pointerSticky === false ? "none" : void 0 } = mark2;
43261
+ applyAttr(selection2, "pointer-events", pointerEvents);
43262
+ }
43263
+ function applyDirectStyles(selection2, mark2) {
43264
+ applyStyle(selection2, "mix-blend-mode", mark2.mixBlendMode);
43265
+ applyAttr(selection2, "opacity", mark2.opacity);
43266
+ }
43267
+ function applyHref(selection2, href, target) {
43268
+ selection2.each(function(i) {
43269
+ const h2 = href(i);
43270
+ if (h2 != null) {
43271
+ const a3 = this.ownerDocument.createElementNS(namespaces_default.svg, "a");
43272
+ a3.setAttribute("fill", "inherit");
43273
+ a3.setAttributeNS(namespaces_default.xlink, "href", h2);
43274
+ if (target != null)
43275
+ a3.setAttribute("target", target);
43276
+ this.parentNode.insertBefore(a3, this).appendChild(this);
43277
+ }
43278
+ });
43279
+ }
43280
+ function applyAttr(selection2, name2, value) {
43281
+ if (value != null)
43282
+ selection2.attr(name2, value);
43283
+ }
43284
+ function applyStyle(selection2, name2, value) {
43285
+ if (value != null)
43286
+ selection2.style(name2, value);
43287
+ }
43288
+ function applyTransform(selection2, mark2, { x: x4, y: y4 }, tx = offset, ty = offset) {
43289
+ tx += mark2.dx;
43290
+ ty += mark2.dy;
43291
+ if (x4?.bandwidth)
43292
+ tx += x4.bandwidth() / 2;
43293
+ if (y4?.bandwidth)
43294
+ ty += y4.bandwidth() / 2;
43295
+ if (tx || ty)
43296
+ selection2.attr("transform", `translate(${tx},${ty})`);
43297
+ }
43298
+ function impliedString(value, impliedValue) {
43299
+ if ((value = string(value)) !== impliedValue)
43300
+ return value;
43301
+ }
43302
+ function impliedNumber(value, impliedValue) {
43303
+ if ((value = number5(value)) !== impliedValue)
43304
+ return value;
43305
+ }
43306
+ var validClassName = /^-?([_a-z]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\240-\377]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*$/i;
43307
+ function maybeClassName(name2) {
43308
+ if (name2 === void 0)
43309
+ return "plot-d6a7b5";
43310
+ name2 = `${name2}`;
43311
+ if (!validClassName.test(name2))
43312
+ throw new Error(`invalid class name: ${name2}`);
43313
+ return name2;
43314
+ }
43315
+ function applyInlineStyles(selection2, style2) {
43316
+ if (typeof style2 === "string") {
43317
+ selection2.property("style", style2);
43318
+ } else if (style2 != null) {
43319
+ for (const element of selection2) {
43320
+ Object.assign(element.style, style2);
43321
+ }
43322
+ }
43323
+ }
43324
+ function applyFrameAnchor({ frameAnchor }, { width: width2, height: height2, marginTop: marginTop2, marginRight: marginRight2, marginBottom: marginBottom2, marginLeft: marginLeft2 }) {
43325
+ return [
43326
+ /left$/.test(frameAnchor) ? marginLeft2 : /right$/.test(frameAnchor) ? width2 - marginRight2 : (marginLeft2 + width2 - marginRight2) / 2,
43327
+ /^top/.test(frameAnchor) ? marginTop2 : /^bottom/.test(frameAnchor) ? height2 - marginBottom2 : (marginTop2 + height2 - marginBottom2) / 2
43328
+ ];
43329
+ }
43330
+
43249
43331
  // ../../node_modules/@observablehq/plot/src/dimensions.js
43250
43332
  function createDimensions(scales2, marks2, options = {}) {
43251
43333
  let marginTopDefault = 0.5 - offset, marginRightDefault = 0.5 + offset, marginBottomDefault = 0.5 + offset, marginLeftDefault = 0.5 - offset;
@@ -44989,19 +45071,28 @@ function axisTickKy(k3, anchor, data, {
44989
45071
  y: y4 = k3 === "y" ? void 0 : null,
44990
45072
  ...options
44991
45073
  }) {
44992
- return axisMark(vectorY, k3, anchor, `${k3}-axis tick`, data, {
44993
- strokeWidth,
44994
- strokeLinecap,
44995
- strokeLinejoin,
44996
- facetAnchor,
44997
- frameAnchor,
44998
- y: y4,
44999
- ...options,
45000
- dx: anchor === "left" ? +dx - offset + +insetLeft : +dx + offset - insetRight,
45001
- anchor: "start",
45002
- length: tickSize,
45003
- shape: anchor === "left" ? shapeTickLeft : shapeTickRight
45004
- });
45074
+ return axisMark(
45075
+ vectorY,
45076
+ k3,
45077
+ data,
45078
+ {
45079
+ ariaLabel: `${k3}-axis tick`,
45080
+ ariaHidden: true
45081
+ },
45082
+ {
45083
+ strokeWidth,
45084
+ strokeLinecap,
45085
+ strokeLinejoin,
45086
+ facetAnchor,
45087
+ frameAnchor,
45088
+ y: y4,
45089
+ ...options,
45090
+ dx: anchor === "left" ? +dx - offset + +insetLeft : +dx + offset - insetRight,
45091
+ anchor: "start",
45092
+ length: tickSize,
45093
+ shape: anchor === "left" ? shapeTickLeft : shapeTickRight
45094
+ }
45095
+ );
45005
45096
  }
45006
45097
  function axisTickKx(k3, anchor, data, {
45007
45098
  strokeWidth = 1,
@@ -45017,19 +45108,28 @@ function axisTickKx(k3, anchor, data, {
45017
45108
  x: x4 = k3 === "x" ? void 0 : null,
45018
45109
  ...options
45019
45110
  }) {
45020
- return axisMark(vectorX, k3, anchor, `${k3}-axis tick`, data, {
45021
- strokeWidth,
45022
- strokeLinejoin,
45023
- strokeLinecap,
45024
- facetAnchor,
45025
- frameAnchor,
45026
- x: x4,
45027
- ...options,
45028
- dy: anchor === "bottom" ? +dy - offset - insetBottom : +dy + offset + +insetTop,
45029
- anchor: "start",
45030
- length: tickSize,
45031
- shape: anchor === "bottom" ? shapeTickBottom : shapeTickTop
45032
- });
45111
+ return axisMark(
45112
+ vectorX,
45113
+ k3,
45114
+ data,
45115
+ {
45116
+ ariaLabel: `${k3}-axis tick`,
45117
+ ariaHidden: true
45118
+ },
45119
+ {
45120
+ strokeWidth,
45121
+ strokeLinejoin,
45122
+ strokeLinecap,
45123
+ facetAnchor,
45124
+ frameAnchor,
45125
+ x: x4,
45126
+ ...options,
45127
+ dy: anchor === "bottom" ? +dy - offset - insetBottom : +dy + offset + +insetTop,
45128
+ anchor: "start",
45129
+ length: tickSize,
45130
+ shape: anchor === "bottom" ? shapeTickBottom : shapeTickTop
45131
+ }
45132
+ );
45033
45133
  }
45034
45134
  function axisTextKy(k3, anchor, data, {
45035
45135
  facetAnchor = anchor + (k3 === "y" ? "-empty" : ""),
@@ -45051,9 +45151,8 @@ function axisTextKy(k3, anchor, data, {
45051
45151
  return axisMark(
45052
45152
  textY,
45053
45153
  k3,
45054
- anchor,
45055
- `${k3}-axis tick label`,
45056
45154
  data,
45155
+ { ariaLabel: `${k3}-axis tick label` },
45057
45156
  {
45058
45157
  facetAnchor,
45059
45158
  frameAnchor,
@@ -45094,9 +45193,8 @@ function axisTextKx(k3, anchor, data, {
45094
45193
  return axisMark(
45095
45194
  textX,
45096
45195
  k3,
45097
- anchor,
45098
- `${k3}-axis tick label`,
45099
45196
  data,
45197
+ { ariaLabel: `${k3}-axis tick label` },
45100
45198
  {
45101
45199
  facetAnchor,
45102
45200
  frameAnchor,
@@ -45140,7 +45238,7 @@ function gridKy(k3, anchor, data, {
45140
45238
  x2: x22 = anchor === "right" ? x4 : null,
45141
45239
  ...options
45142
45240
  }) {
45143
- return axisMark(ruleY, k3, anchor, `${k3}-grid`, data, { y: y4, x1: x12, x2: x22, ...gridDefaults(options) });
45241
+ return axisMark(ruleY, k3, data, { ariaLabel: `${k3}-grid`, ariaHidden: true }, { y: y4, x1: x12, x2: x22, ...gridDefaults(options) });
45144
45242
  }
45145
45243
  function gridKx(k3, anchor, data, {
45146
45244
  x: x4 = k3 === "x" ? void 0 : null,
@@ -45149,7 +45247,7 @@ function gridKx(k3, anchor, data, {
45149
45247
  y2: y22 = anchor === "bottom" ? y4 : null,
45150
45248
  ...options
45151
45249
  }) {
45152
- return axisMark(ruleX, k3, anchor, `${k3}-grid`, data, { x: x4, y1: y12, y2: y22, ...gridDefaults(options) });
45250
+ return axisMark(ruleX, k3, data, { ariaLabel: `${k3}-grid`, ariaHidden: true }, { x: x4, y1: y12, y2: y22, ...gridDefaults(options) });
45153
45251
  }
45154
45252
  function gridDefaults({
45155
45253
  color: color3 = "currentColor",
@@ -45194,7 +45292,7 @@ function labelOptions({
45194
45292
  initializer: initializer2
45195
45293
  };
45196
45294
  }
45197
- function axisMark(mark2, k3, anchor, ariaLabel, data, options, initialize) {
45295
+ function axisMark(mark2, k3, data, properties, options, initialize) {
45198
45296
  let channels;
45199
45297
  function axisInitializer(data2, facets, _channels, scales2, dimensions, context) {
45200
45298
  const initializeFacets = data2 == null && (k3 === "fx" || k3 === "fy");
@@ -45266,7 +45364,8 @@ function axisMark(mark2, k3, anchor, ariaLabel, data, options, initialize) {
45266
45364
  } else {
45267
45365
  channels = {};
45268
45366
  }
45269
- m2.ariaLabel = ariaLabel;
45367
+ if (properties !== void 0)
45368
+ Object.assign(m2, properties);
45270
45369
  if (m2.clip === void 0)
45271
45370
  m2.clip = false;
45272
45371
  return m2;
@@ -46695,6 +46794,8 @@ function binn(bx, by, gx, gy, {
46695
46794
  for (const [f2, I2] of maybeGroup(facet, G)) {
46696
46795
  for (const [k4, g2] of maybeGroup(I2, K3)) {
46697
46796
  for (const [b2, extent4] of bin3(g2)) {
46797
+ if (G)
46798
+ extent4.z = f2;
46698
46799
  if (filter3 && !filter3.reduce(b2, extent4))
46699
46800
  continue;
46700
46801
  groupFacet.push(i++);
@@ -46714,7 +46815,7 @@ function binn(bx, by, gx, gy, {
46714
46815
  for (const o of outputs)
46715
46816
  o.reduce(b2, extent4);
46716
46817
  if (sort3)
46717
- sort3.reduce(b2);
46818
+ sort3.reduce(b2, extent4);
46718
46819
  }
46719
46820
  }
46720
46821
  }
@@ -46881,6 +46982,8 @@ function maybeBinReduceFallback(reduce) {
46881
46982
  return reduceY1;
46882
46983
  case "y2":
46883
46984
  return reduceY22;
46985
+ case "z":
46986
+ return reduceZ;
46884
46987
  }
46885
46988
  throw new Error(`invalid bin reduce: ${reduce}`);
46886
46989
  }
@@ -51551,13 +51654,13 @@ var attributeMap = /* @__PURE__ */ new Map([
51551
51654
  ["projectionInsetBottom", "projection.insetBottom"],
51552
51655
  ["projectionClip", "projection.clip"]
51553
51656
  ]);
51554
- function setProperty(object2, path2, value) {
51657
+ function setProperty(object, path2, value) {
51555
51658
  for (let i = 0; i < path2.length; ++i) {
51556
51659
  const key = path2[i];
51557
51660
  if (i === path2.length - 1) {
51558
- object2[key] = value;
51661
+ object[key] = value;
51559
51662
  } else {
51560
- object2 = object2[key] || (object2[key] = {});
51663
+ object = object[key] || (object[key] = {});
51561
51664
  }
51562
51665
  }
51563
51666
  }
@@ -51627,16 +51730,16 @@ function setSymbolAttributes(plot3, svg, attributes2, symbols3) {
51627
51730
  }
51628
51731
  function inferLabels(spec, plot3) {
51629
51732
  const { marks: marks2 } = plot3;
51630
- inferLabel("x", spec, marks2, ["x", "x1", "x2"]);
51631
- inferLabel("y", spec, marks2, ["y", "y1", "y2"]);
51733
+ inferLabel("x", spec, marks2);
51734
+ inferLabel("y", spec, marks2);
51632
51735
  inferLabel("fx", spec, marks2);
51633
51736
  inferLabel("fy", spec, marks2);
51634
51737
  }
51635
- function inferLabel(key, spec, marks2, channels = [key]) {
51738
+ function inferLabel(key, spec, marks2) {
51636
51739
  const scale3 = spec[key] || {};
51637
51740
  if (scale3.axis === null || scale3.label !== void 0)
51638
51741
  return;
51639
- const fields = marks2.map((mark2) => mark2.channelField(channels)?.field);
51742
+ const fields = marks2.map((mark2) => mark2.channelField(key)?.field);
51640
51743
  if (fields.every((x4) => x4 == null))
51641
51744
  return;
51642
51745
  let candCol;
@@ -51649,7 +51752,7 @@ function inferLabel(key, spec, marks2, channels = [key]) {
51649
51752
  } else if (candCol === void 0 && candLabel === void 0) {
51650
51753
  candCol = column3;
51651
51754
  candLabel = label2;
51652
- type2 = getType(marks2[i].data, channels) || "number";
51755
+ type2 = getType(marks2[i].data, key) || "number";
51653
51756
  } else if (candLabel !== label2) {
51654
51757
  candLabel = void 0;
51655
51758
  } else if (candCol !== column3) {
@@ -51691,13 +51794,11 @@ function annotateMarks(svg, indices) {
51691
51794
  }
51692
51795
  }
51693
51796
  }
51694
- function getType(data, channels) {
51797
+ function getType(data, channel) {
51695
51798
  for (const row of data) {
51696
- for (let j2 = 0; j2 < channels.length; ++j2) {
51697
- const v3 = row[channels[j2]];
51698
- if (v3 != null) {
51699
- return v3 instanceof Date ? "date" : typeof v3;
51700
- }
51799
+ const v3 = row[channel] ?? row[channel + "1"] ?? row[channel + "2"];
51800
+ if (v3 != null) {
51801
+ return v3 instanceof Date ? "date" : typeof v3;
51701
51802
  }
51702
51803
  }
51703
51804
  }
@@ -51900,49 +52001,6 @@ function isSymbol2(value) {
51900
52001
  return symbols2.has(`${value}`.toLowerCase());
51901
52002
  }
51902
52003
 
51903
- // ../plot/src/marks/util/arrow.js
51904
- var INTEGER = 2;
51905
- var FLOAT = 3;
51906
- var DECIMAL = 7;
51907
- var TIMESTAMP = 10;
51908
- function isArrowTable(values2) {
51909
- return typeof values2?.getChild === "function";
51910
- }
51911
- function convertArrowType(type2) {
51912
- switch (type2.typeId) {
51913
- case INTEGER:
51914
- case FLOAT:
51915
- case DECIMAL:
51916
- return Float64Array;
51917
- default:
51918
- return Array;
51919
- }
51920
- }
51921
- function convertArrow(type2) {
51922
- const { typeId } = type2;
51923
- if (typeId === TIMESTAMP) {
51924
- return (v3) => v3 == null ? v3 : new Date(v3);
51925
- }
51926
- if (typeId === INTEGER && type2.bitWidth >= 64) {
51927
- return (v3) => v3 == null ? v3 : Number(v3);
51928
- }
51929
- return (v3) => v3;
51930
- }
51931
- function convertArrowColumn(column3) {
51932
- const { type: type2 } = column3;
51933
- const { typeId } = type2;
51934
- if (typeId === INTEGER && type2.bitWidth >= 64) {
51935
- const size = column3.length;
51936
- const array3 = new Float64Array(size);
51937
- for (let row = 0; row < size; ++row) {
51938
- const v3 = column3.get(row);
51939
- array3[row] = v3 == null ? NaN : Number(v3);
51940
- }
51941
- return array3;
51942
- }
51943
- return column3.toArray();
51944
- }
51945
-
51946
52004
  // ../plot/src/marks/util/to-data-array.js
51947
52005
  function toDataArray(data) {
51948
52006
  return isArrowTable(data) ? arrowToObjects(data) : data;
@@ -51958,7 +52016,7 @@ function arrowToObjects(data) {
51958
52016
  for (let j2 = 0; j2 < numCols; ++j2) {
51959
52017
  const child = batch.getChildAt(j2);
51960
52018
  const { name: name2, type: type2 } = schema.fields[j2];
51961
- const valueOf = convertArrow(type2);
52019
+ const valueOf = convertArrowValue(type2);
51962
52020
  for (let o = k3, i = 0; i < numRows; ++i, ++o) {
51963
52021
  objects[o][name2] = valueOf(child.get(i));
51964
52022
  }
@@ -52043,17 +52101,15 @@ var Mark2 = class extends MosaicClient {
52043
52101
  hasOwnData() {
52044
52102
  return this.source == null || isDataArray(this.source);
52045
52103
  }
52104
+ hasFieldInfo() {
52105
+ return !!this._fieldInfo;
52106
+ }
52046
52107
  channel(channel) {
52047
52108
  return this.channels.find((c4) => c4.channel === channel);
52048
52109
  }
52049
- channelField(...channels) {
52050
- const list = channels.flat();
52051
- for (const channel of list) {
52052
- const c4 = this.channel(channel);
52053
- if (c4?.field)
52054
- return c4;
52055
- }
52056
- return null;
52110
+ channelField(channel, { exact } = {}) {
52111
+ const c4 = exact ? this.channel(channel) : this.channels.find((c5) => c5.channel.startsWith(channel));
52112
+ return c4?.field ? c4 : null;
52057
52113
  }
52058
52114
  fields() {
52059
52115
  if (this.hasOwnData())
@@ -52061,26 +52117,25 @@ var Mark2 = class extends MosaicClient {
52061
52117
  const { source: { table: table3 }, channels, reqs } = this;
52062
52118
  const fields = /* @__PURE__ */ new Map();
52063
52119
  for (const { channel, field: field2 } of channels) {
52064
- const column3 = field2?.column;
52065
- if (!column3) {
52120
+ if (!field2)
52066
52121
  continue;
52067
- } else if (field2.stats?.length || reqs[channel]) {
52068
- if (!fields.has(column3))
52069
- fields.set(column3, /* @__PURE__ */ new Set());
52070
- const entry = fields.get(column3);
52071
- reqs[channel]?.forEach((s2) => entry.add(s2));
52072
- field2.stats?.forEach((s2) => entry.add(s2));
52073
- }
52122
+ const stats = field2.stats?.stats || [];
52123
+ const key = field2.stats?.column ?? field2;
52124
+ const entry = fields.get(key) ?? fields.set(key, /* @__PURE__ */ new Set()).get(key);
52125
+ stats.forEach((s2) => entry.add(s2));
52126
+ reqs[channel]?.forEach((s2) => entry.add(s2));
52074
52127
  }
52075
- return Array.from(fields, ([column3, stats]) => {
52076
- return { table: table3, column: column3, stats: Array.from(stats) };
52077
- });
52128
+ return Array.from(fields, ([c4, s2]) => ({ table: table3, column: c4, stats: s2 }));
52078
52129
  }
52079
52130
  fieldInfo(info) {
52080
- this.stats = info.reduce(
52081
- (o, d) => (o[d.column] = d, o),
52082
- /* @__PURE__ */ Object.create(null)
52083
- );
52131
+ const lookup = Object.fromEntries(info.map((x4) => [x4.column, x4]));
52132
+ for (const entry of this.channels) {
52133
+ const { field: field2 } = entry;
52134
+ if (field2) {
52135
+ Object.assign(entry, lookup[field2.stats?.column ?? field2]);
52136
+ }
52137
+ }
52138
+ this._fieldInfo = true;
52084
52139
  return this;
52085
52140
  }
52086
52141
  query(filter3 = []) {
@@ -52148,8 +52203,7 @@ function channelScale(mark2, channel) {
52148
52203
  const { plot: plot3 } = mark2;
52149
52204
  let scaleType = plot3.getAttribute(`${channel}Scale`);
52150
52205
  if (!scaleType) {
52151
- const { field: field2 } = mark2.channelField(channel, `${channel}1`, `${channel}2`);
52152
- const { type: type2 } = mark2.stats[field2.column];
52206
+ const { type: type2 } = mark2.channelField(channel);
52153
52207
  scaleType = type2 === "date" ? "time" : "linear";
52154
52208
  }
52155
52209
  const options = { type: scaleType };
@@ -52187,15 +52241,13 @@ var xext = { x: ["min", "max"] };
52187
52241
  var yext = { y: ["min", "max"] };
52188
52242
  var xyext = { ...xext, ...yext };
52189
52243
  function plotExtent(mark2, filter3, channel, domainAttr, niceAttr) {
52190
- const { plot: plot3, stats } = mark2;
52244
+ const { plot: plot3 } = mark2;
52191
52245
  const domain = plot3.getAttribute(domainAttr);
52192
52246
  const nice3 = plot3.getAttribute(niceAttr);
52193
52247
  if (Array.isArray(domain) && !domain[Transient]) {
52194
52248
  return domain;
52195
52249
  } else {
52196
- const { field: field2 } = mark2.channelField(channel);
52197
- const { column: column3 } = field2;
52198
- const { min: min5, max: max4 } = stats[column3];
52250
+ const { column: column3, min: min5, max: max4 } = mark2.channelField(channel);
52199
52251
  const dom = filteredExtent(filter3, column3) || (nice3 ? linear2().domain([min5, max4]).nice().domain() : [min5, max4]);
52200
52252
  if (domain !== Fixed)
52201
52253
  dom[Transient] = true;
@@ -52215,7 +52267,7 @@ function filteredExtent(filter3, column3) {
52215
52267
  let lo;
52216
52268
  let hi;
52217
52269
  const visitor = (type2, clause) => {
52218
- if (type2 === "BETWEEN" && clause.field.column === column3) {
52270
+ if (type2 === "BETWEEN" && `${clause.field}` === column3) {
52219
52271
  const { range: range3 } = clause;
52220
52272
  if (range3 && (lo == null || range3[0] < lo))
52221
52273
  lo = range3[0];
@@ -52235,26 +52287,23 @@ function filteredExtent(filter3, column3) {
52235
52287
  var ConnectedMark = class extends Mark2 {
52236
52288
  constructor(type2, source, encodings) {
52237
52289
  const dim = type2.endsWith("X") ? "y" : type2.endsWith("Y") ? "x" : null;
52238
- const req = { [dim]: ["min", "max"] };
52290
+ const req = dim ? { [dim]: ["min", "max"] } : void 0;
52239
52291
  super(type2, source, encodings, req);
52240
52292
  this.dim = dim;
52241
52293
  }
52242
52294
  query(filter3 = []) {
52243
- const { plot: plot3, dim, source, stats } = this;
52295
+ const { plot: plot3, dim, source } = this;
52244
52296
  const { optimize = true } = source.options || {};
52245
52297
  const q2 = super.query(filter3);
52246
52298
  if (!dim)
52247
52299
  return q2;
52248
52300
  const ortho = dim === "x" ? "y" : "x";
52249
- const value = this.channelField(ortho)?.as;
52250
- const { field: field2, as } = this.channelField(dim);
52251
- const { type: type2 } = stats[field2.column];
52301
+ const value = this.channelField(ortho, { exact: true })?.as;
52302
+ const { field: field2, as, type: type2, min: min5, max: max4 } = this.channelField(dim);
52252
52303
  const isContinuous = type2 === "date" || type2 === "number";
52253
52304
  if (optimize && isContinuous && value) {
52254
- const { column: column3 } = field2;
52255
- const { max: max4, min: min5 } = stats[column3];
52256
52305
  const size = dim === "x" ? plot3.innerWidth() : plot3.innerHeight();
52257
- const [lo, hi] = filteredExtent(filter3, column3) || [min5, max4];
52306
+ const [lo, hi] = filteredExtent(filter3, field2) || [min5, max4];
52258
52307
  const [expr] = binExpr(this, dim, size, [lo, hi], 1, as);
52259
52308
  const cols = q2.select().map((c4) => c4.as).filter((c4) => c4 !== as && c4 !== value);
52260
52309
  return m4(q2, expr, as, value, cols);
@@ -52276,17 +52325,10 @@ function m4(input3, bin3, x4, y4, cols = []) {
52276
52325
 
52277
52326
  // ../plot/src/marks/util/grid.js
52278
52327
  function arrayType(values2, name2 = "density") {
52279
- if (isArrowTable(values2)) {
52280
- return convertArrowType(values2.getChild(name2).type);
52281
- } else {
52282
- return typeof values2[0][name2] === "number" ? Float64Array : Array;
52283
- }
52328
+ return isArrowTable(values2) ? convertArrowArrayType(values2.getChild(name2).type) : typeof values2[0]?.[name2] === "number" ? Float64Array : Array;
52284
52329
  }
52285
- function grid1d(n, values2) {
52286
- const Type5 = arrayType(values2);
52287
- return valuesToGrid(new Type5(n), values2);
52288
- }
52289
- function valuesToGrid(grid2, values2, name2 = "density") {
52330
+ function grid1d(n, values2, name2 = "density") {
52331
+ const grid2 = new (arrayType(values2))(n);
52290
52332
  if (isArrowTable(values2)) {
52291
52333
  const numRows = values2.numRows;
52292
52334
  if (numRows === 0)
@@ -52785,7 +52827,7 @@ var Grid2DMark = class extends Mark2 {
52785
52827
  }
52786
52828
  setPlot(plot3, index2) {
52787
52829
  const update2 = () => {
52788
- if (this.stats)
52830
+ if (this.hasFieldInfo())
52789
52831
  this.requestUpdate();
52790
52832
  };
52791
52833
  plot3.addAttributeListener("domainX", update2);
@@ -53130,7 +53172,7 @@ var RasterMark = class extends Grid2DMark {
53130
53172
  }
53131
53173
  setPlot(plot3, index2) {
53132
53174
  const update2 = () => {
53133
- if (this.stats)
53175
+ if (this.hasFieldInfo())
53134
53176
  this.rasterize();
53135
53177
  };
53136
53178
  plot3.addAttributeListener("schemeColor", update2);
@@ -53331,9 +53373,12 @@ var DenseLineMark = class extends RasterMark {
53331
53373
  function stripXY(mark2, filter3) {
53332
53374
  if (Array.isArray(filter3) && !filter3.length)
53333
53375
  return filter3;
53334
- const xc = mark2.channelField("x").field.column;
53335
- const yc = mark2.channelField("y").field.column;
53336
- const test = (p2) => p2.op !== "BETWEEN" || p2.field.column !== xc && p2.field.column !== yc;
53376
+ const { column: xc } = mark2.channelField("x");
53377
+ const { column: yc } = mark2.channelField("y");
53378
+ const test = (p2) => {
53379
+ const col = `${p2.field}`;
53380
+ return p2.op !== "BETWEEN" || col !== xc && col !== yc;
53381
+ };
53337
53382
  const filterAnd = (p2) => p2.op === "AND" ? and(p2.children.filter((c4) => test(c4))) : p2;
53338
53383
  return Array.isArray(filter3) ? filter3.filter((p2) => test(p2)).map((p2) => filterAnd(p2)) : filterAnd(filter3);
53339
53384
  }
@@ -53622,7 +53667,7 @@ var RasterTileMark = class extends Grid2DMark {
53622
53667
  }
53623
53668
  setPlot(plot3, index2) {
53624
53669
  const update2 = () => {
53625
- if (this.stats)
53670
+ if (this.hasFieldInfo())
53626
53671
  this.rasterize();
53627
53672
  };
53628
53673
  plot3.addAttributeListener("schemeColor", update2);
@@ -54171,8 +54216,8 @@ function closeTo(a3, b2) {
54171
54216
  }
54172
54217
 
54173
54218
  // ../plot/src/interactors/util/get-field.js
54174
- function getField(mark2, channels) {
54175
- const field2 = mark2.channelField(channels)?.field;
54219
+ function getField(mark2, channel) {
54220
+ const field2 = mark2.channelField(channel)?.field;
54176
54221
  return field2?.basis || field2;
54177
54222
  }
54178
54223
 
@@ -54206,7 +54251,7 @@ var Interval1D = class {
54206
54251
  this.pixelSize = pixelSize || 1;
54207
54252
  this.selection = selection2;
54208
54253
  this.peers = peers;
54209
- this.field = field2 || getField(mark2, [channel, channel + "1", channel + "2"]);
54254
+ this.field = field2 || getField(mark2, channel);
54210
54255
  this.style = style2 && sanitizeStyles(style2);
54211
54256
  this.brush = channel === "y" ? brushY2() : brushX2();
54212
54257
  this.brush.on("brush end", ({ selection: selection3 }) => this.publish(selection3));
@@ -54274,8 +54319,8 @@ var Interval2D = class {
54274
54319
  this.pixelSize = pixelSize || 1;
54275
54320
  this.selection = selection2;
54276
54321
  this.peers = peers;
54277
- this.xfield = xfield || getField(mark2, ["x", "x1", "x2"]);
54278
- this.yfield = yfield || getField(mark2, ["y", "y1", "y2"]);
54322
+ this.xfield = xfield || getField(mark2, "x");
54323
+ this.yfield = yfield || getField(mark2, "y");
54279
54324
  this.style = style2 && sanitizeStyles(style2);
54280
54325
  this.brush = brush2();
54281
54326
  this.brush.on("brush end", ({ selection: selection3 }) => this.publish(selection3));
@@ -54411,8 +54456,8 @@ var PanZoom = class {
54411
54456
  this.mark = mark2;
54412
54457
  this.xsel = x4;
54413
54458
  this.ysel = y4;
54414
- this.xfield = xfield || getField(mark2, ["x", "x1", "x2"]);
54415
- this.yfield = yfield || getField(mark2, ["y", "y1", "y2"]);
54459
+ this.xfield = xfield || getField(mark2, "x");
54460
+ this.yfield = yfield || getField(mark2, "y");
54416
54461
  this.zoom = extent3(zoom2, [0, Infinity], [1, 1]);
54417
54462
  this.panx = this.xsel && panx;
54418
54463
  this.pany = this.ysel && pany;
@@ -54641,8 +54686,10 @@ function findMark({ marks: marks2 }, channel) {
54641
54686
  if (channels == null)
54642
54687
  return null;
54643
54688
  for (let i = marks2.length - 1; i > -1; --i) {
54644
- if (marks2[i].channelField(channels)) {
54645
- return marks2[i];
54689
+ for (const channel2 of channels) {
54690
+ if (marks2[i].channelField(channel2, { exact: true })) {
54691
+ return marks2[i];
54692
+ }
54646
54693
  }
54647
54694
  }
54648
54695
  return null;
@@ -54671,7 +54718,7 @@ function binField(mark2, channel, column3, options) {
54671
54718
  column: column3,
54672
54719
  label: column3,
54673
54720
  get stats() {
54674
- return ["min", "max"];
54721
+ return { column: column3, stats: ["min", "max"] };
54675
54722
  },
54676
54723
  get columns() {
54677
54724
  return [column3];
@@ -54681,7 +54728,7 @@ function binField(mark2, channel, column3, options) {
54681
54728
  },
54682
54729
  toString() {
54683
54730
  const { apply: apply2, sqlApply, sqlInvert } = channelScale(mark2, channel);
54684
- const { min: min5, max: max4 } = mark2.stats[column3];
54731
+ const { min: min5, max: max4 } = mark2.channelField(channel);
54685
54732
  const b2 = bins(apply2(min5), apply2(max4), options);
54686
54733
  const col = sqlApply(column3);
54687
54734
  const base = b2.min === 0 ? col : `(${col} - ${b2.min})`;
@@ -55550,8 +55597,8 @@ function attributes(values2) {
55550
55597
  }
55551
55598
  };
55552
55599
  }
55553
- function margins(object2) {
55554
- const { top: top2, bottom: bottom2, left: left2, right: right2 } = object2;
55600
+ function margins(object) {
55601
+ const { top: top2, bottom: bottom2, left: left2, right: right2 } = object;
55555
55602
  const attr = {};
55556
55603
  if (top2 !== void 0)
55557
55604
  attr.marginTop = top2;