genesys-spark-chart-components 4.117.1 → 4.119.0

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.
Files changed (27) hide show
  1. package/dist/cjs/{color-palette-bd94968f.js → color-palette-f6443e0c.js} +5 -7
  2. package/dist/cjs/gux-chart-column-beta.cjs.entry.js +1 -1
  3. package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +1 -1
  4. package/dist/cjs/gux-chart-line-beta.cjs.entry.js +1 -1
  5. package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +1 -1
  6. package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +1 -1
  7. package/dist/cjs/gux-visualization-beta.cjs.entry.js +521 -1247
  8. package/dist/esm/{color-palette-2c4363f3.js → color-palette-7ac8a54e.js} +5 -7
  9. package/dist/esm/gux-chart-column-beta.entry.js +1 -1
  10. package/dist/esm/gux-chart-donut-beta.entry.js +1 -1
  11. package/dist/esm/gux-chart-line-beta.entry.js +1 -1
  12. package/dist/esm/gux-chart-pie-beta.entry.js +1 -1
  13. package/dist/esm/gux-chart-scatter-plot-beta.entry.js +1 -1
  14. package/dist/esm/gux-visualization-beta.entry.js +521 -1247
  15. package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
  16. package/dist/genesys-chart-webcomponents/{p-585ea609.entry.js → p-18cc7993.entry.js} +1 -1
  17. package/dist/genesys-chart-webcomponents/{p-de4b7d31.entry.js → p-52c0b734.entry.js} +1 -1
  18. package/dist/genesys-chart-webcomponents/{p-52ae245e.entry.js → p-6b6034dc.entry.js} +1 -1
  19. package/dist/genesys-chart-webcomponents/{p-9737d797.entry.js → p-76e11cad.entry.js} +1 -1
  20. package/dist/genesys-chart-webcomponents/{p-124a46e1.entry.js → p-9c4197d7.entry.js} +1 -1
  21. package/dist/genesys-chart-webcomponents/p-aefbcea6.entry.js +11 -0
  22. package/dist/genesys-chart-webcomponents/{p-eb2043dc.js → p-f652102e.js} +1 -1
  23. package/dist/stencil-wrapper.js +1 -1
  24. package/dist/types/stencil-wrapper.d.ts +1 -1
  25. package/dist/types/utils/tracking/usage.d.ts +6 -2
  26. package/package.json +5 -7
  27. package/dist/genesys-chart-webcomponents/p-b73c68d1.entry.js +0 -11
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h as h$1, g as getElement } from './index-d8134161.js';
2
- import { D as DEFAULT_LABEL_COLOR, a as DEFAULT_DOMAIN_COLOR, t as trackComponent } from './color-palette-2c4363f3.js';
2
+ import { D as DEFAULT_LABEL_COLOR, a as DEFAULT_DOMAIN_COLOR, t as trackComponent } from './color-palette-7ac8a54e.js';
3
3
 
4
4
  // Note: This regex matches even invalid JSON strings, but since we’re
5
5
  // working on the output of `JSON.stringify` we know that only valid strings
@@ -314,7 +314,7 @@ function toNumber (_) {
314
314
  }
315
315
 
316
316
  const exp$2 = sign => x => sign * Math.exp(x);
317
- const log$5 = sign => x => Math.log(sign * x);
317
+ const log$4 = sign => x => Math.log(sign * x);
318
318
  const symlog$1 = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));
319
319
  const symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;
320
320
  const pow$4 = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
@@ -329,7 +329,7 @@ function panLinear(domain, delta) {
329
329
  }
330
330
  function panLog(domain, delta) {
331
331
  var sign = Math.sign(domain[0]);
332
- return pan(domain, delta, log$5(sign), exp$2(sign));
332
+ return pan(domain, delta, log$4(sign), exp$2(sign));
333
333
  }
334
334
  function panPow(domain, delta, exponent) {
335
335
  return pan(domain, delta, pow$4(exponent), pow$4(1 / exponent));
@@ -348,7 +348,7 @@ function zoomLinear(domain, anchor, scale) {
348
348
  }
349
349
  function zoomLog(domain, anchor, scale) {
350
350
  const sign = Math.sign(domain[0]);
351
- return zoom$2(domain, anchor, scale, log$5(sign), exp$2(sign));
351
+ return zoom$2(domain, anchor, scale, log$4(sign), exp$2(sign));
352
352
  }
353
353
  function zoomPow(domain, anchor, scale, exponent) {
354
354
  return zoom$2(domain, anchor, scale, pow$4(exponent), pow$4(1 / exponent));
@@ -364,7 +364,7 @@ function utcquarter(date) {
364
364
  return 1 + ~~(new Date(date).getUTCMonth() / 3);
365
365
  }
366
366
 
367
- function array$6 (_) {
367
+ function array$5 (_) {
368
368
  return _ != null ? isArray(_) ? _ : [_] : [];
369
369
  }
370
370
 
@@ -395,12 +395,12 @@ function isFunction (_) {
395
395
  const DESCENDING = 'descending';
396
396
  function compare$2 (fields, orders, opt) {
397
397
  opt = opt || {};
398
- orders = array$6(orders) || [];
398
+ orders = array$5(orders) || [];
399
399
  const ord = [],
400
400
  get = [],
401
401
  fmap = {},
402
402
  gen = opt.comparator || comparator$1;
403
- array$6(fields).forEach((f, i) => {
403
+ array$5(fields).forEach((f, i) => {
404
404
  if (f == null) return;
405
405
  ord.push(orders[i] === DESCENDING ? -1 : 1);
406
406
  get.push(f = isFunction(f) ? f : field$1(f, null, opt));
@@ -697,7 +697,7 @@ function isString (_) {
697
697
 
698
698
  function key (fields, flat, opt) {
699
699
  if (fields) {
700
- fields = flat ? array$6(fields).map(f => f.replace(/\\(.)/g, '$1')) : array$6(fields);
700
+ fields = flat ? array$5(fields).map(f => f.replace(/\\(.)/g, '$1')) : array$5(fields);
701
701
  }
702
702
  const len = fields && fields.length,
703
703
  gen = opt && opt.get || getter$1,
@@ -759,7 +759,7 @@ function lruCache (maxsize) {
759
759
  };
760
760
  }
761
761
 
762
- function merge$4 (compare, array0, array1, output) {
762
+ function merge$3 (compare, array0, array1, output) {
763
763
  const n0 = array0.length,
764
764
  n1 = array1.length;
765
765
  if (!n1) return array0;
@@ -1038,7 +1038,7 @@ function transform$3(transform) {
1038
1038
  };
1039
1039
  }
1040
1040
 
1041
- function reverse$3(array, n) {
1041
+ function reverse$2(array, n) {
1042
1042
  var t, j = array.length, i = j - n;
1043
1043
  while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
1044
1044
  }
@@ -1069,7 +1069,7 @@ function object$1(topology, o) {
1069
1069
  for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {
1070
1070
  points.push(transformPoint(a[k], k));
1071
1071
  }
1072
- if (i < 0) reverse$3(points, n);
1072
+ if (i < 0) reverse$2(points, n);
1073
1073
  }
1074
1074
 
1075
1075
  function point(p) {
@@ -1687,11 +1687,11 @@ function* flatten(arrays) {
1687
1687
  }
1688
1688
  }
1689
1689
 
1690
- function merge$3(arrays) {
1690
+ function merge$2(arrays) {
1691
1691
  return Array.from(flatten(arrays));
1692
1692
  }
1693
1693
 
1694
- function range$6(start, stop, step) {
1694
+ function range$5(start, stop, step) {
1695
1695
  start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
1696
1696
 
1697
1697
  var i = -1,
@@ -2050,7 +2050,7 @@ function formatLocale$3(locale) {
2050
2050
  }
2051
2051
 
2052
2052
  var locale$4;
2053
- var format$5;
2053
+ var format$4;
2054
2054
  var formatPrefix$1;
2055
2055
 
2056
2056
  defaultLocale$4({
@@ -2061,7 +2061,7 @@ defaultLocale$4({
2061
2061
 
2062
2062
  function defaultLocale$4(definition) {
2063
2063
  locale$4 = formatLocale$3(definition);
2064
- format$5 = locale$4.format;
2064
+ format$4 = locale$4.format;
2065
2065
  formatPrefix$1 = locale$4.formatPrefix;
2066
2066
  return locale$4;
2067
2067
  }
@@ -2372,7 +2372,7 @@ const MILLISECONDS = 'milliseconds';
2372
2372
  const TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];
2373
2373
  const UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});
2374
2374
  function timeUnits(units) {
2375
- const u = array$6(units).slice(),
2375
+ const u = array$5(units).slice(),
2376
2376
  m = {};
2377
2377
 
2378
2378
  // check validity
@@ -2610,14 +2610,14 @@ function timeOffset(unit, date, step) {
2610
2610
  function utcOffset(unit, date, step) {
2611
2611
  return offset$3(utcInterval(unit), date, step);
2612
2612
  }
2613
- function sequence$2(ival, start, stop, step) {
2613
+ function sequence$1(ival, start, stop, step) {
2614
2614
  return ival ? ival.range(start, stop, step) : undefined;
2615
2615
  }
2616
2616
  function timeSequence(unit, start, stop, step) {
2617
- return sequence$2(timeInterval$1(unit), start, stop, step);
2617
+ return sequence$1(timeInterval$1(unit), start, stop, step);
2618
2618
  }
2619
2619
  function utcSequence(unit, start, stop, step) {
2620
- return sequence$2(utcInterval(unit), start, stop, step);
2620
+ return sequence$1(utcInterval(unit), start, stop, step);
2621
2621
  }
2622
2622
 
2623
2623
  const durationSecond$1 = 1000,
@@ -3530,10 +3530,10 @@ function formatUnixTimestampSeconds$1(d) {
3530
3530
  }
3531
3531
 
3532
3532
  var locale$3;
3533
- var timeFormat$4;
3534
- var timeParse$2;
3535
- var utcFormat$3;
3536
- var utcParse$2;
3533
+ var timeFormat$3;
3534
+ var timeParse$1;
3535
+ var utcFormat$2;
3536
+ var utcParse$1;
3537
3537
 
3538
3538
  defaultLocale$3({
3539
3539
  dateTime: "%x, %X",
@@ -3548,10 +3548,10 @@ defaultLocale$3({
3548
3548
 
3549
3549
  function defaultLocale$3(definition) {
3550
3550
  locale$3 = formatLocale$2(definition);
3551
- timeFormat$4 = locale$3.format;
3552
- timeParse$2 = locale$3.parse;
3553
- utcFormat$3 = locale$3.utcFormat;
3554
- utcParse$2 = locale$3.utcParse;
3551
+ timeFormat$3 = locale$3.format;
3552
+ timeParse$1 = locale$3.parse;
3553
+ utcFormat$2 = locale$3.utcFormat;
3554
+ utcParse$1 = locale$3.utcParse;
3555
3555
  return locale$3;
3556
3556
  }
3557
3557
 
@@ -3652,7 +3652,7 @@ let defaultNumberLocale;
3652
3652
  resetNumberFormatDefaultLocale();
3653
3653
  function resetNumberFormatDefaultLocale() {
3654
3654
  return defaultNumberLocale = numberLocale({
3655
- format: format$5,
3655
+ format: format$4,
3656
3656
  formatPrefix: formatPrefix$1
3657
3657
  });
3658
3658
  }
@@ -3701,10 +3701,10 @@ let defaultTimeLocale;
3701
3701
  resetTimeFormatDefaultLocale();
3702
3702
  function resetTimeFormatDefaultLocale() {
3703
3703
  return defaultTimeLocale = timeLocale({
3704
- format: timeFormat$4,
3705
- parse: timeParse$2,
3706
- utcFormat: utcFormat$3,
3707
- utcParse: utcParse$2
3704
+ format: timeFormat$3,
3705
+ parse: timeParse$1,
3706
+ utcFormat: utcFormat$2,
3707
+ utcParse: utcParse$1
3708
3708
  });
3709
3709
  }
3710
3710
  function timeFormatLocale(definition) {
@@ -3999,7 +3999,7 @@ function topojson(data, format) {
3999
3999
  }
4000
4000
  topojson.responseType = 'json';
4001
4001
 
4002
- const format$4 = {
4002
+ const format$3 = {
4003
4003
  dsv: dsv,
4004
4004
  csv: delimitedFormat(','),
4005
4005
  tsv: delimitedFormat('\t'),
@@ -4008,10 +4008,10 @@ const format$4 = {
4008
4008
  };
4009
4009
  function formats$1(name, reader) {
4010
4010
  if (arguments.length > 1) {
4011
- format$4[name] = reader;
4011
+ format$3[name] = reader;
4012
4012
  return this;
4013
4013
  } else {
4014
- return has$1(format$4, name) ? format$4[name] : null;
4014
+ return has$1(format$3, name) ? format$3[name] : null;
4015
4015
  }
4016
4016
  }
4017
4017
  function responseType(type) {
@@ -4188,7 +4188,7 @@ function rederive(t, d) {
4188
4188
  * @param {object} d - The new tuple that replaces the old.
4189
4189
  * @return {object} The new tuple.
4190
4190
  */
4191
- function replace$2(t, d) {
4191
+ function replace$1(t, d) {
4192
4192
  return setid(d, tupleid(t));
4193
4193
  }
4194
4194
 
@@ -4221,14 +4221,14 @@ function changeset() {
4221
4221
  return {
4222
4222
  constructor: changeset,
4223
4223
  insert(t) {
4224
- const d = array$6(t),
4224
+ const d = array$5(t),
4225
4225
  n = d.length;
4226
4226
  for (let i = 0; i < n; ++i) add.push(d[i]);
4227
4227
  return this;
4228
4228
  },
4229
4229
  remove(t) {
4230
4230
  const a = isFunction(t) ? remp : rem,
4231
- d = array$6(t),
4231
+ d = array$5(t),
4232
4232
  n = d.length;
4233
4233
  for (let i = 0; i < n; ++i) a.push(d[i]);
4234
4234
  return this;
@@ -4560,7 +4560,7 @@ Operator.prototype = {
4560
4560
  for (name in params) {
4561
4561
  value = params[name];
4562
4562
  if (name === PULSE) {
4563
- array$6(value).forEach(op => {
4563
+ array$5(value).forEach(op => {
4564
4564
  if (!(op instanceof Operator)) {
4565
4565
  error$1('Pulse parameters must be operator instances.');
4566
4566
  } else if (op !== this) {
@@ -4871,7 +4871,7 @@ function events$1 (source, type, filter, apply) {
4871
4871
  if (typeof source === 'string' && typeof document !== 'undefined') {
4872
4872
  sources = document.querySelectorAll(source);
4873
4873
  } else {
4874
- sources = array$6(source);
4874
+ sources = array$5(source);
4875
4875
  }
4876
4876
  const n = sources.length;
4877
4877
  for (let i = 0; i < n; ++i) {
@@ -5124,7 +5124,7 @@ function materialize(data, filter) {
5124
5124
  visitArray(data, filter, _ => out.push(_));
5125
5125
  return out;
5126
5126
  }
5127
- function filter$2(pulse, flags) {
5127
+ function filter$1(pulse, flags) {
5128
5128
  const map = {};
5129
5129
  pulse.visit(flags, t => {
5130
5130
  map[tupleid(t)] = 1;
@@ -5317,7 +5317,7 @@ Pulse.prototype = {
5317
5317
  src = this.source && this.source.length;
5318
5318
  if (src && src !== len) {
5319
5319
  this.mod = this.source;
5320
- if (len) this.filter(MOD$1, filter$2(this, ADD));
5320
+ if (len) this.filter(MOD$1, filter$1(this, ADD));
5321
5321
  }
5322
5322
  return this;
5323
5323
  },
@@ -5434,7 +5434,7 @@ Pulse.prototype = {
5434
5434
  if (flags & REFLOW && src) {
5435
5435
  const sum = p.add.length + p.mod.length;
5436
5436
  if (sum === src.length) ; else if (sum) {
5437
- visitArray(src, filter$2(p, ADD_MOD), v);
5437
+ visitArray(src, filter$1(p, ADD_MOD), v);
5438
5438
  } else {
5439
5439
  // if no add/rem/mod tuples, visit source
5440
5440
  visitArray(src, p.srcF, v);
@@ -6903,7 +6903,7 @@ function linear$2 (data, x, y) {
6903
6903
 
6904
6904
  // Adapted from d3-regression by Harry Stevens
6905
6905
  // License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE
6906
- function log$4 (data, x, y) {
6906
+ function log$3 (data, x, y) {
6907
6907
  let X = 0,
6908
6908
  Y = 0,
6909
6909
  XY = 0,
@@ -7830,7 +7830,7 @@ inherits(Aggregate$1, Transform, {
7830
7830
  outputs = this._outputs = [],
7831
7831
  inputMap = {};
7832
7832
  function inputVisit(get) {
7833
- const fields = array$6(accessorFields(get)),
7833
+ const fields = array$5(accessorFields(get)),
7834
7834
  n = fields.length;
7835
7835
  let i = 0,
7836
7836
  f;
@@ -7843,7 +7843,7 @@ inherits(Aggregate$1, Transform, {
7843
7843
  }
7844
7844
 
7845
7845
  // initialize group-by dimensions
7846
- this._dims = array$6(_.groupby);
7846
+ this._dims = array$5(_.groupby);
7847
7847
  this._dnames = this._dims.map(d => {
7848
7848
  const dname = accessorName(d);
7849
7849
  inputVisit(d);
@@ -7940,7 +7940,7 @@ inherits(Aggregate$1, Transform, {
7940
7940
  for (let i = 0; i < n; ++i) {
7941
7941
  x[names[i]] = dims[i](t);
7942
7942
  }
7943
- return p ? replace$2(p.tuple, x) : ingest$1(x);
7943
+ return p ? replace$1(p.tuple, x) : ingest$1(x);
7944
7944
  },
7945
7945
  clean() {
7946
7946
  const cells = this.value;
@@ -8175,7 +8175,7 @@ function SortedList (idFunc, source, input) {
8175
8175
  data.sort(compare);
8176
8176
  }
8177
8177
  if (add.length) {
8178
- data = compare ? merge$4(compare, data, add.sort(compare)) : data.concat(add);
8178
+ data = compare ? merge$3(compare, data, add.sort(compare)) : data.concat(add);
8179
8179
  add = [];
8180
8180
  }
8181
8181
  return data;
@@ -9038,7 +9038,7 @@ function Field$1(params) {
9038
9038
  }
9039
9039
  inherits(Field$1, Operator);
9040
9040
  function update$3(_) {
9041
- return this.value && !_.modified() ? this.value : isArray(_.name) ? array$6(_.name).map(f => field$1(f)) : field$1(_.name, _.as);
9041
+ return this.value && !_.modified() ? this.value : isArray(_.name) ? array$5(_.name).map(f => field$1(f)) : field$1(_.name, _.as);
9042
9042
  }
9043
9043
 
9044
9044
  /**
@@ -9723,7 +9723,7 @@ inherits(Load$1, Transform, {
9723
9723
  } else if (_.async) {
9724
9724
  // return promise for non-blocking async loading
9725
9725
  const p = df.request(_.url, _.format).then(res => {
9726
- this._pending = array$6(res.data);
9726
+ this._pending = array$5(res.data);
9727
9727
  return df => df.touch(this);
9728
9728
  });
9729
9729
  return {
@@ -9731,7 +9731,7 @@ inherits(Load$1, Transform, {
9731
9731
  };
9732
9732
  } else {
9733
9733
  // return promise for synchronous loading
9734
- return df.request(_.url, _.format).then(res => output(this, pulse, array$6(res.data)));
9734
+ return df.request(_.url, _.format).then(res => output(this, pulse, array$5(res.data)));
9735
9735
  }
9736
9736
  }
9737
9737
  });
@@ -10201,7 +10201,7 @@ inherits(Quantile$1, Transform, {
10201
10201
  names = (_.groupby || []).map(accessorName),
10202
10202
  values = [],
10203
10203
  step = _.step || 0.01,
10204
- p = _.probs || range$6(step / 2, 1 - EPSILON$2, step),
10204
+ p = _.probs || range$5(step / 2, 1 - EPSILON$2, step),
10205
10205
  n = p.length;
10206
10206
  groups.forEach(g => {
10207
10207
  const q = quantiles(g, p);
@@ -10407,7 +10407,7 @@ inherits(Sequence, Transform, {
10407
10407
  const out = pulse.materialize().fork(pulse.MOD),
10408
10408
  as = _.as || 'data';
10409
10409
  out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;
10410
- this.value = range$6(_.start, _.stop, _.step || 1).map(v => {
10410
+ this.value = range$5(_.start, _.stop, _.step || 1).map(v => {
10411
10411
  const t = {};
10412
10412
  t[as] = v;
10413
10413
  return ingest$1(t);
@@ -10747,11 +10747,11 @@ function find$2(field, data, index) {
10747
10747
  const ValidWindowOps = Object.keys(WindowOps);
10748
10748
 
10749
10749
  function WindowState(_) {
10750
- const ops = array$6(_.ops),
10751
- fields = array$6(_.fields),
10752
- params = array$6(_.params),
10753
- aggregate_params = array$6(_.aggregate_params),
10754
- as = array$6(_.as),
10750
+ const ops = array$5(_.ops),
10751
+ fields = array$5(_.fields),
10752
+ params = array$5(_.params),
10753
+ aggregate_params = array$5(_.aggregate_params),
10754
+ as = array$5(_.as),
10755
10755
  outputs = this.outputs = [],
10756
10756
  windows = this.windows = [],
10757
10757
  inputs = {},
@@ -10760,7 +10760,7 @@ function WindowState(_) {
10760
10760
  measures = [];
10761
10761
  let countOnly = true;
10762
10762
  function visitInputs(f) {
10763
- array$6(accessorFields(f)).forEach(_ => inputs[_] = 1);
10763
+ array$5(accessorFields(f)).forEach(_ => inputs[_] = 1);
10764
10764
  }
10765
10765
  visitInputs(_.sort);
10766
10766
  ops.forEach((op, i) => {
@@ -11293,7 +11293,7 @@ function arcPadAngle(d) {
11293
11293
  return d && d.padAngle; // Note: optional!
11294
11294
  }
11295
11295
 
11296
- function intersect$4(x0, y0, x1, y1, x2, y2, x3, y3) {
11296
+ function intersect$3(x0, y0, x1, y1, x2, y2, x3, y3) {
11297
11297
  var x10 = x1 - x0, y10 = y1 - y0,
11298
11298
  x32 = x3 - x2, y32 = y3 - y2,
11299
11299
  t = y32 * x10 - x32 * y10;
@@ -11427,7 +11427,7 @@ function arc$2$1() {
11427
11427
  // intersection fails, it’s probably because the arc is too small, so
11428
11428
  // disable the corner radius entirely.
11429
11429
  if (da < pi$3) {
11430
- if (oc = intersect$4(x01, y01, x00, y00, x11, y11, x10, y10)) {
11430
+ if (oc = intersect$3(x01, y01, x00, y00, x11, y11, x10, y10)) {
11431
11431
  var ax = x01 - oc[0],
11432
11432
  ay = y01 - oc[1],
11433
11433
  bx = x11 - oc[0],
@@ -11538,7 +11538,7 @@ function arc$2$1() {
11538
11538
  return arc;
11539
11539
  }
11540
11540
 
11541
- function array$5(x) {
11541
+ function array$4(x) {
11542
11542
  return typeof x === "object" && "length" in x
11543
11543
  ? x // Array, TypedArray, NodeList, array-like
11544
11544
  : Array.from(x); // Map, Set, iterable, string, or anything else
@@ -11596,7 +11596,7 @@ function line$2$1(x, y) {
11596
11596
 
11597
11597
  function line(data) {
11598
11598
  var i,
11599
- n = (data = array$5(data)).length,
11599
+ n = (data = array$4(data)).length,
11600
11600
  d,
11601
11601
  defined0 = false,
11602
11602
  buffer;
@@ -11653,7 +11653,7 @@ function area$2$1(x0, y0, y1) {
11653
11653
  var i,
11654
11654
  j,
11655
11655
  k,
11656
- n = (data = array$5(data)).length,
11656
+ n = (data = array$4(data)).length,
11657
11657
  d,
11658
11658
  defined0 = false,
11659
11659
  buffer,
@@ -13403,7 +13403,7 @@ function isNumberArray(x) {
13403
13403
  return ArrayBuffer.isView(x) && !(x instanceof DataView);
13404
13404
  }
13405
13405
 
13406
- function array$4(a, b) {
13406
+ function array$3(a, b) {
13407
13407
  return (isNumberArray(b) ? numberArray : genericArray)(a, b);
13408
13408
  }
13409
13409
 
@@ -13830,7 +13830,7 @@ function quantize$2(interpolator, n) {
13830
13830
  const $$1 = /*#__PURE__*/Object.freeze({
13831
13831
  __proto__: null,
13832
13832
  interpolate: interpolate$1$1,
13833
- interpolateArray: array$4,
13833
+ interpolateArray: array$3,
13834
13834
  interpolateBasis: basis$1,
13835
13835
  interpolateBasisClosed: basisClosed,
13836
13836
  interpolateDate: date$1,
@@ -13918,7 +13918,7 @@ function polymap(domain, range, interpolate) {
13918
13918
  };
13919
13919
  }
13920
13920
 
13921
- function copy$3(source, target) {
13921
+ function copy$2(source, target) {
13922
13922
  return target
13923
13923
  .domain(source.domain())
13924
13924
  .range(source.range())
@@ -14287,7 +14287,7 @@ function formatLocale$1(locale) {
14287
14287
  }
14288
14288
 
14289
14289
  var locale$1;
14290
- var format$3;
14290
+ var format$2;
14291
14291
  var formatPrefix;
14292
14292
 
14293
14293
  defaultLocale$1({
@@ -14300,7 +14300,7 @@ defaultLocale$1({
14300
14300
 
14301
14301
  function defaultLocale$1(definition) {
14302
14302
  locale$1 = formatLocale$1(definition);
14303
- format$3 = locale$1.format;
14303
+ format$2 = locale$1.format;
14304
14304
  formatPrefix = locale$1.formatPrefix;
14305
14305
  return locale$1;
14306
14306
  }
@@ -14342,7 +14342,7 @@ function tickFormat$1(start, stop, count, specifier) {
14342
14342
  break;
14343
14343
  }
14344
14344
  }
14345
- return format$3(specifier);
14345
+ return format$2(specifier);
14346
14346
  }
14347
14347
 
14348
14348
  function linearish(scale) {
@@ -14403,7 +14403,7 @@ function linear() {
14403
14403
  var scale = continuous$1();
14404
14404
 
14405
14405
  scale.copy = function() {
14406
- return copy$3(scale, linear());
14406
+ return copy$2(scale, linear());
14407
14407
  };
14408
14408
 
14409
14409
  initRange.apply(scale, arguments);
@@ -14563,7 +14563,7 @@ function loggish(transform) {
14563
14563
  if (specifier == null) specifier = base === 10 ? "s" : ",";
14564
14564
  if (typeof specifier !== "function") {
14565
14565
  if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
14566
- specifier = format$3(specifier);
14566
+ specifier = format$2(specifier);
14567
14567
  }
14568
14568
  if (count === Infinity) return specifier;
14569
14569
  const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
@@ -14584,9 +14584,9 @@ function loggish(transform) {
14584
14584
  return scale;
14585
14585
  }
14586
14586
 
14587
- function log$3() {
14587
+ function log$2() {
14588
14588
  const scale = loggish(transformer$3()).domain([1, 10]);
14589
- scale.copy = () => copy$3(scale, log$3()).base(scale.base());
14589
+ scale.copy = () => copy$2(scale, log$2()).base(scale.base());
14590
14590
  initRange.apply(scale, arguments);
14591
14591
  return scale;
14592
14592
  }
@@ -14617,7 +14617,7 @@ function symlog() {
14617
14617
  var scale = symlogish(transformer$3());
14618
14618
 
14619
14619
  scale.copy = function() {
14620
- return copy$3(scale, symlog()).constant(scale.constant());
14620
+ return copy$2(scale, symlog()).constant(scale.constant());
14621
14621
  };
14622
14622
 
14623
14623
  return initRange.apply(scale, arguments);
@@ -14658,7 +14658,7 @@ function pow$2() {
14658
14658
  var scale = powish(transformer$3());
14659
14659
 
14660
14660
  scale.copy = function() {
14661
- return copy$3(scale, pow$2()).exponent(scale.exponent());
14661
+ return copy$2(scale, pow$2()).exponent(scale.exponent());
14662
14662
  };
14663
14663
 
14664
14664
  initRange.apply(scale, arguments);
@@ -15830,8 +15830,8 @@ function formatUnixTimestampSeconds(d) {
15830
15830
  }
15831
15831
 
15832
15832
  var locale;
15833
- var timeFormat$3;
15834
- var utcFormat$2;
15833
+ var timeFormat$2;
15834
+ var utcFormat$1;
15835
15835
 
15836
15836
  defaultLocale({
15837
15837
  dateTime: "%x, %X",
@@ -15846,8 +15846,8 @@ defaultLocale({
15846
15846
 
15847
15847
  function defaultLocale(definition) {
15848
15848
  locale = formatLocale(definition);
15849
- timeFormat$3 = locale.format;
15850
- utcFormat$2 = locale.utcFormat;
15849
+ timeFormat$2 = locale.format;
15850
+ utcFormat$1 = locale.utcFormat;
15851
15851
  return locale;
15852
15852
  }
15853
15853
 
@@ -15907,18 +15907,18 @@ function calendar(ticks, tickInterval, year, month, week, day, hour, minute, sec
15907
15907
  };
15908
15908
 
15909
15909
  scale.copy = function() {
15910
- return copy$3(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
15910
+ return copy$2(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
15911
15911
  };
15912
15912
 
15913
15913
  return scale;
15914
15914
  }
15915
15915
 
15916
- function time$2() {
15917
- return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat$3).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
15916
+ function time$1() {
15917
+ return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat$2).domain([new Date(2000, 0, 1), new Date(2000, 0, 2)]), arguments);
15918
15918
  }
15919
15919
 
15920
15920
  function utcTime() {
15921
- return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat$2).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
15921
+ return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat$1).domain([Date.UTC(2000, 0, 1), Date.UTC(2000, 0, 2)]), arguments);
15922
15922
  }
15923
15923
 
15924
15924
  function transformer$2() {
@@ -15969,7 +15969,7 @@ function transformer$2() {
15969
15969
  };
15970
15970
  }
15971
15971
 
15972
- function copy$2(source, target) {
15972
+ function copy$1(source, target) {
15973
15973
  return target
15974
15974
  .domain(source.domain())
15975
15975
  .interpolator(source.interpolator())
@@ -15981,7 +15981,7 @@ function sequential() {
15981
15981
  var scale = linearish(transformer$2()(identity$3));
15982
15982
 
15983
15983
  scale.copy = function() {
15984
- return copy$2(scale, sequential());
15984
+ return copy$1(scale, sequential());
15985
15985
  };
15986
15986
 
15987
15987
  return initInterpolator.apply(scale, arguments);
@@ -15991,7 +15991,7 @@ function sequentialLog() {
15991
15991
  var scale = loggish(transformer$2()).domain([1, 10]);
15992
15992
 
15993
15993
  scale.copy = function() {
15994
- return copy$2(scale, sequentialLog()).base(scale.base());
15994
+ return copy$1(scale, sequentialLog()).base(scale.base());
15995
15995
  };
15996
15996
 
15997
15997
  return initInterpolator.apply(scale, arguments);
@@ -16001,7 +16001,7 @@ function sequentialSymlog() {
16001
16001
  var scale = symlogish(transformer$2());
16002
16002
 
16003
16003
  scale.copy = function() {
16004
- return copy$2(scale, sequentialSymlog()).constant(scale.constant());
16004
+ return copy$1(scale, sequentialSymlog()).constant(scale.constant());
16005
16005
  };
16006
16006
 
16007
16007
  return initInterpolator.apply(scale, arguments);
@@ -16011,7 +16011,7 @@ function sequentialPow() {
16011
16011
  var scale = powish(transformer$2());
16012
16012
 
16013
16013
  scale.copy = function() {
16014
- return copy$2(scale, sequentialPow()).exponent(scale.exponent());
16014
+ return copy$1(scale, sequentialPow()).exponent(scale.exponent());
16015
16015
  };
16016
16016
 
16017
16017
  return initInterpolator.apply(scale, arguments);
@@ -16077,7 +16077,7 @@ function diverging() {
16077
16077
  var scale = linearish(transformer$1()(identity$3));
16078
16078
 
16079
16079
  scale.copy = function() {
16080
- return copy$2(scale, diverging());
16080
+ return copy$1(scale, diverging());
16081
16081
  };
16082
16082
 
16083
16083
  return initInterpolator.apply(scale, arguments);
@@ -16087,7 +16087,7 @@ function divergingLog() {
16087
16087
  var scale = loggish(transformer$1()).domain([0.1, 1, 10]);
16088
16088
 
16089
16089
  scale.copy = function() {
16090
- return copy$2(scale, divergingLog()).base(scale.base());
16090
+ return copy$1(scale, divergingLog()).base(scale.base());
16091
16091
  };
16092
16092
 
16093
16093
  return initInterpolator.apply(scale, arguments);
@@ -16097,7 +16097,7 @@ function divergingSymlog() {
16097
16097
  var scale = symlogish(transformer$1());
16098
16098
 
16099
16099
  scale.copy = function() {
16100
- return copy$2(scale, divergingSymlog()).constant(scale.constant());
16100
+ return copy$1(scale, divergingSymlog()).constant(scale.constant());
16101
16101
  };
16102
16102
 
16103
16103
  return initInterpolator.apply(scale, arguments);
@@ -16107,7 +16107,7 @@ function divergingPow() {
16107
16107
  var scale = powish(transformer$1());
16108
16108
 
16109
16109
  scale.copy = function() {
16110
- return copy$2(scale, divergingPow()).exponent(scale.exponent());
16110
+ return copy$1(scale, divergingPow()).exponent(scale.exponent());
16111
16111
  };
16112
16112
 
16113
16113
  return initInterpolator.apply(scale, arguments);
@@ -16243,7 +16243,7 @@ function band() {
16243
16243
  start = Math.round(start);
16244
16244
  bandwidth = Math.round(bandwidth);
16245
16245
  }
16246
- const values = range$6(n).map(i => start + step * i);
16246
+ const values = range$5(n).map(i => start + step * i);
16247
16247
  return ordinalRange(reverse ? values.reverse() : values);
16248
16248
  }
16249
16249
  scale.domain = function (_) {
@@ -16378,7 +16378,7 @@ function numbers(_) {
16378
16378
  return map.call(_, toNumber);
16379
16379
  }
16380
16380
 
16381
- const slice$3 = Array.prototype.slice;
16381
+ const slice$2 = Array.prototype.slice;
16382
16382
 
16383
16383
  function scaleBinOrdinal() {
16384
16384
  let domain = [],
@@ -16396,7 +16396,7 @@ function scaleBinOrdinal() {
16396
16396
  };
16397
16397
  scale.range = function (_) {
16398
16398
  if (arguments.length) {
16399
- range = slice$3.call(_);
16399
+ range = slice$2.call(_);
16400
16400
  return scale;
16401
16401
  } else {
16402
16402
  return range.slice();
@@ -16438,7 +16438,7 @@ function create$2(type, constructor, metadata) {
16438
16438
  s.type = type;
16439
16439
  return registerScale(s);
16440
16440
  };
16441
- ctr.metadata = toSet(array$6(metadata));
16441
+ ctr.metadata = toSet(array$5(metadata));
16442
16442
  return ctr;
16443
16443
  }
16444
16444
 
@@ -16458,7 +16458,7 @@ function create$2(type, constructor, metadata) {
16458
16458
  * - `"log"` - the scale performs a logarithmic transform of the continuous domain.
16459
16459
  * - `"temporal"` - the scale domain is defined over date-time values.
16460
16460
  */
16461
- function scale$5(type, scale, metadata) {
16461
+ function scale$4(type, scale, metadata) {
16462
16462
  if (arguments.length > 1) {
16463
16463
  scales.set(type, create$2(type, scale, metadata));
16464
16464
  return this;
@@ -16468,42 +16468,42 @@ function scale$5(type, scale, metadata) {
16468
16468
  }
16469
16469
 
16470
16470
  // identity scale
16471
- scale$5(Identity, identity$1);
16471
+ scale$4(Identity, identity$1);
16472
16472
 
16473
16473
  // continuous scales
16474
- scale$5(Linear, linear, Continuous);
16475
- scale$5(Log, log$3, [Continuous, Log]);
16476
- scale$5(Pow, pow$2, Continuous);
16477
- scale$5(Sqrt, sqrt$2, Continuous);
16478
- scale$5(Symlog, symlog, Continuous);
16479
- scale$5(Time, time$2, [Continuous, Temporal]);
16480
- scale$5(UTC, utcTime, [Continuous, Temporal]);
16474
+ scale$4(Linear, linear, Continuous);
16475
+ scale$4(Log, log$2, [Continuous, Log]);
16476
+ scale$4(Pow, pow$2, Continuous);
16477
+ scale$4(Sqrt, sqrt$2, Continuous);
16478
+ scale$4(Symlog, symlog, Continuous);
16479
+ scale$4(Time, time$1, [Continuous, Temporal]);
16480
+ scale$4(UTC, utcTime, [Continuous, Temporal]);
16481
16481
 
16482
16482
  // sequential scales
16483
- scale$5(Sequential, sequential, [Continuous, Interpolating]); // backwards compat
16484
- scale$5(`${Sequential}-${Linear}`, sequential, [Continuous, Interpolating]);
16485
- scale$5(`${Sequential}-${Log}`, sequentialLog, [Continuous, Interpolating, Log]);
16486
- scale$5(`${Sequential}-${Pow}`, sequentialPow, [Continuous, Interpolating]);
16487
- scale$5(`${Sequential}-${Sqrt}`, sequentialSqrt, [Continuous, Interpolating]);
16488
- scale$5(`${Sequential}-${Symlog}`, sequentialSymlog, [Continuous, Interpolating]);
16483
+ scale$4(Sequential, sequential, [Continuous, Interpolating]); // backwards compat
16484
+ scale$4(`${Sequential}-${Linear}`, sequential, [Continuous, Interpolating]);
16485
+ scale$4(`${Sequential}-${Log}`, sequentialLog, [Continuous, Interpolating, Log]);
16486
+ scale$4(`${Sequential}-${Pow}`, sequentialPow, [Continuous, Interpolating]);
16487
+ scale$4(`${Sequential}-${Sqrt}`, sequentialSqrt, [Continuous, Interpolating]);
16488
+ scale$4(`${Sequential}-${Symlog}`, sequentialSymlog, [Continuous, Interpolating]);
16489
16489
 
16490
16490
  // diverging scales
16491
- scale$5(`${Diverging}-${Linear}`, diverging, [Continuous, Interpolating]);
16492
- scale$5(`${Diverging}-${Log}`, divergingLog, [Continuous, Interpolating, Log]);
16493
- scale$5(`${Diverging}-${Pow}`, divergingPow, [Continuous, Interpolating]);
16494
- scale$5(`${Diverging}-${Sqrt}`, divergingSqrt, [Continuous, Interpolating]);
16495
- scale$5(`${Diverging}-${Symlog}`, divergingSymlog, [Continuous, Interpolating]);
16491
+ scale$4(`${Diverging}-${Linear}`, diverging, [Continuous, Interpolating]);
16492
+ scale$4(`${Diverging}-${Log}`, divergingLog, [Continuous, Interpolating, Log]);
16493
+ scale$4(`${Diverging}-${Pow}`, divergingPow, [Continuous, Interpolating]);
16494
+ scale$4(`${Diverging}-${Sqrt}`, divergingSqrt, [Continuous, Interpolating]);
16495
+ scale$4(`${Diverging}-${Symlog}`, divergingSymlog, [Continuous, Interpolating]);
16496
16496
 
16497
16497
  // discretizing scales
16498
- scale$5(Quantile, quantile, [Discretizing, Quantile]);
16499
- scale$5(Quantize, quantize$1, Discretizing);
16500
- scale$5(Threshold, threshold, Discretizing);
16498
+ scale$4(Quantile, quantile, [Discretizing, Quantile]);
16499
+ scale$4(Quantize, quantize$1, Discretizing);
16500
+ scale$4(Threshold, threshold, Discretizing);
16501
16501
 
16502
16502
  // discrete scales
16503
- scale$5(BinOrdinal, scaleBinOrdinal, [Discrete$1, Discretizing]);
16504
- scale$5(Ordinal, ordinal, Discrete$1);
16505
- scale$5(Band, band, Discrete$1);
16506
- scale$5(Point, point$3, Discrete$1);
16503
+ scale$4(BinOrdinal, scaleBinOrdinal, [Discrete$1, Discretizing]);
16504
+ scale$4(Ordinal, ordinal, Discrete$1);
16505
+ scale$4(Band, band, Discrete$1);
16506
+ scale$4(Point, point$3, Discrete$1);
16507
16507
  function isValidScaleType(type) {
16508
16508
  return scales.has(type);
16509
16509
  }
@@ -16558,7 +16558,7 @@ function scaleFraction(scale$1, min, max) {
16558
16558
  } else {
16559
16559
  i = (t = scale$1.type).indexOf('-');
16560
16560
  t = i < 0 ? t : t.slice(i + 1);
16561
- s = scale$5(t)().domain([min, max]).range([0, 1]);
16561
+ s = scale$4(t)().domain([min, max]).range([0, 1]);
16562
16562
  scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);
16563
16563
  return s;
16564
16564
  }
@@ -16873,7 +16873,7 @@ function labelFraction(scale) {
16873
16873
  return value => (value - lo) / span;
16874
16874
  }
16875
16875
 
16876
- function format$2(locale, scale, specifier, formatType) {
16876
+ function format$1(locale, scale, specifier, formatType) {
16877
16877
  const type = formatType || scale.type;
16878
16878
 
16879
16879
  // replace abbreviated time specifiers to improve screen reader experience
@@ -16885,7 +16885,7 @@ function format$2(locale, scale, specifier, formatType) {
16885
16885
  function domainCaption(locale, scale, opt) {
16886
16886
  opt = opt || {};
16887
16887
  const max = Math.max(3, opt.maxlen || 7),
16888
- fmt = format$2(locale, scale, opt.format, opt.formatType);
16888
+ fmt = format$1(locale, scale, opt.format, opt.formatType);
16889
16889
 
16890
16890
  // if scale breaks domain into bins, describe boundaries
16891
16891
  if (isDiscretizing$1(scale.type)) {
@@ -17131,11 +17131,11 @@ const HalfSqrt3 = Math.sqrt(3) / 2;
17131
17131
 
17132
17132
  var segmentCache = {};
17133
17133
  var bezierCache = {};
17134
- var join$2 = [].join;
17134
+ var join$1 = [].join;
17135
17135
 
17136
17136
  // Copied from Inkscape svgtopdf, thanks!
17137
17137
  function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
17138
- const key = join$2.call(arguments);
17138
+ const key = join$1.call(arguments);
17139
17139
  if (segmentCache[key]) {
17140
17140
  return segmentCache[key];
17141
17141
  }
@@ -17185,7 +17185,7 @@ function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
17185
17185
  return segmentCache[key] = result;
17186
17186
  }
17187
17187
  function bezier(params) {
17188
- const key = join$2.call(params);
17188
+ const key = join$1.call(params);
17189
17189
  if (bezierCache[key]) {
17190
17190
  return bezierCache[key];
17191
17191
  }
@@ -18590,7 +18590,7 @@ function translate$2(x, y) {
18590
18590
  function rotate(a) {
18591
18591
  return 'rotate(' + a + ')';
18592
18592
  }
18593
- function scale$4(scaleX, scaleY) {
18593
+ function scale$3(scaleX, scaleY) {
18594
18594
  return 'scale(' + scaleX + ',' + scaleY + ')';
18595
18595
  }
18596
18596
  function translateItem(item) {
@@ -18600,7 +18600,7 @@ function rotateItem(item) {
18600
18600
  return translate$2(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');
18601
18601
  }
18602
18602
  function transformItem(item) {
18603
- return translate$2(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale$4(item.scaleX || 1, item.scaleY || 1) : '');
18603
+ return translate$2(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale$3(item.scaleX || 1, item.scaleY || 1) : '');
18604
18604
  }
18605
18605
 
18606
18606
  function markItemPath (type, shape, isect) {
@@ -20507,7 +20507,7 @@ function ariaGuide(mark, opt) {
20507
20507
  }
20508
20508
  }
20509
20509
  function titleCaption(item) {
20510
- return array$6(item.text).join(' ');
20510
+ return array$5(item.text).join(' ');
20511
20511
  }
20512
20512
  function axisCaption(item) {
20513
20513
  const datum = item.datum,
@@ -20533,7 +20533,7 @@ function legendCaption(item) {
20533
20533
  }
20534
20534
  function extractTitle(item) {
20535
20535
  try {
20536
- return array$6(peek$1(item.items).items[0].text).join(' ');
20536
+ return array$5(peek$1(item.items).items[0].text).join(' ');
20537
20537
  } catch (err) {
20538
20538
  return null;
20539
20539
  }
@@ -21766,7 +21766,7 @@ function renderModule(name, _) {
21766
21766
  }
21767
21767
  }
21768
21768
 
21769
- function intersect$3(scene, bounds, filter) {
21769
+ function intersect$2(scene, bounds, filter) {
21770
21770
  const hits = [],
21771
21771
  // intersection results
21772
21772
  box = new Bounds().union(bounds),
@@ -22091,16 +22091,16 @@ const methods = {
22091
22091
  parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),
22092
22092
  greedy: (items, sep) => {
22093
22093
  let a;
22094
- return items.filter((b, i) => !i || !intersect$2(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);
22094
+ return items.filter((b, i) => !i || !intersect$1(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);
22095
22095
  }
22096
22096
  };
22097
22097
 
22098
22098
  // compute bounding box intersection
22099
22099
  // including padding pixels of separation
22100
- const intersect$2 = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
22100
+ const intersect$1 = (a, b, sep) => sep > Math.max(b.x1 - a.x2, a.x1 - b.x2, b.y1 - a.y2, a.y1 - b.y2);
22101
22101
  const hasOverlap = (items, pad) => {
22102
22102
  for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {
22103
- if (intersect$2(a, b = items[i].bounds, pad)) return true;
22103
+ if (intersect$1(a, b = items[i].bounds, pad)) return true;
22104
22104
  }
22105
22105
  };
22106
22106
  const hasBounds = item => {
@@ -23688,7 +23688,7 @@ inherits(Pie, Transform, {
23688
23688
  n = values.length,
23689
23689
  a = start,
23690
23690
  k = (stop - start) / sum$1(values),
23691
- index = range$6(n),
23691
+ index = range$5(n),
23692
23692
  i,
23693
23693
  t,
23694
23694
  v;
@@ -23731,7 +23731,7 @@ inherits(Scale$1, Transform, {
23731
23731
  scale$1 = this.value,
23732
23732
  key = scaleKey(_);
23733
23733
  if (!scale$1 || key !== scale$1.type) {
23734
- this.value = scale$1 = scale$5(key)();
23734
+ this.value = scale$1 = scale$4(key)();
23735
23735
  }
23736
23736
  for (key in _) if (!SKIP$1[key]) {
23737
23737
  // padding is a scale property for band/point but not others
@@ -23851,7 +23851,7 @@ function configureBins(scale, _, count) {
23851
23851
  if (!step) error$1('Scale bins parameter missing step property.');
23852
23852
  if (start < lo) start = step * Math.ceil(lo / step);
23853
23853
  if (stop > hi) stop = step * Math.floor(hi / step);
23854
- bins = range$6(start, stop + step / 2, step);
23854
+ bins = range$5(start, stop + step / 2, step);
23855
23855
  }
23856
23856
  if (bins) {
23857
23857
  // assign bin boundaries to scale instance
@@ -24121,7 +24121,7 @@ function partition$3(data, groupby, sort, field) {
24121
24121
  return groups;
24122
24122
  }
24123
24123
 
24124
- const encode$2 = /*#__PURE__*/Object.freeze({
24124
+ const encode$1 = /*#__PURE__*/Object.freeze({
24125
24125
  __proto__: null,
24126
24126
  axisticks: AxisTicks$1,
24127
24127
  datajoin: DataJoin$1,
@@ -24151,7 +24151,7 @@ var cos$1 = Math.cos;
24151
24151
  var ceil = Math.ceil;
24152
24152
  var exp = Math.exp;
24153
24153
  var hypot = Math.hypot;
24154
- var log$2 = Math.log;
24154
+ var log$1 = Math.log;
24155
24155
  var pow$1 = Math.pow;
24156
24156
  var sin$1 = Math.sin;
24157
24157
  var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
@@ -24304,7 +24304,7 @@ function areaPoint$1(lambda, phi) {
24304
24304
  lambda0$1 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
24305
24305
  }
24306
24306
 
24307
- function geoArea$1$1(object) {
24307
+ function geoArea$1(object) {
24308
24308
  areaSum$1 = new Adder();
24309
24309
  geoStream(object, areaStream$1);
24310
24310
  return areaSum$1 * 2;
@@ -24348,7 +24348,7 @@ var lambda0, phi0, lambda1, phi1, // bounds
24348
24348
  p0, // previous 3D point
24349
24349
  deltaSum,
24350
24350
  ranges,
24351
- range$5;
24351
+ range$4;
24352
24352
 
24353
24353
  var boundsStream$2 = {
24354
24354
  point: boundsPoint$1,
@@ -24369,7 +24369,7 @@ var boundsStream$2 = {
24369
24369
  if (areaRingSum$1 < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
24370
24370
  else if (deltaSum > epsilon$3) phi1 = 90;
24371
24371
  else if (deltaSum < -epsilon$3) phi0 = -90;
24372
- range$5[0] = lambda0, range$5[1] = lambda1;
24372
+ range$4[0] = lambda0, range$4[1] = lambda1;
24373
24373
  },
24374
24374
  sphere: function() {
24375
24375
  lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
@@ -24377,7 +24377,7 @@ var boundsStream$2 = {
24377
24377
  };
24378
24378
 
24379
24379
  function boundsPoint$1(lambda, phi) {
24380
- ranges.push(range$5 = [lambda0 = lambda, lambda1 = lambda]);
24380
+ ranges.push(range$4 = [lambda0 = lambda, lambda1 = lambda]);
24381
24381
  if (phi < phi0) phi0 = phi;
24382
24382
  if (phi > phi1) phi1 = phi;
24383
24383
  }
@@ -24424,7 +24424,7 @@ function linePoint(lambda, phi) {
24424
24424
  }
24425
24425
  }
24426
24426
  } else {
24427
- ranges.push(range$5 = [lambda0 = lambda, lambda1 = lambda]);
24427
+ ranges.push(range$4 = [lambda0 = lambda, lambda1 = lambda]);
24428
24428
  }
24429
24429
  if (phi < phi0) phi0 = phi;
24430
24430
  if (phi > phi1) phi1 = phi;
@@ -24436,7 +24436,7 @@ function boundsLineStart() {
24436
24436
  }
24437
24437
 
24438
24438
  function boundsLineEnd() {
24439
- range$5[0] = lambda0, range$5[1] = lambda1;
24439
+ range$4[0] = lambda0, range$4[1] = lambda1;
24440
24440
  boundsStream$2.point = boundsPoint$1;
24441
24441
  p0 = null;
24442
24442
  }
@@ -24460,7 +24460,7 @@ function boundsRingEnd() {
24460
24460
  boundsRingPoint(lambda00$1, phi00$1);
24461
24461
  areaStream$1.lineEnd();
24462
24462
  if (abs$1(deltaSum) > epsilon$3) lambda0 = -(lambda1 = 180);
24463
- range$5[0] = lambda0, range$5[1] = lambda1;
24463
+ range$4[0] = lambda0, range$4[1] = lambda1;
24464
24464
  p0 = null;
24465
24465
  }
24466
24466
 
@@ -24479,7 +24479,7 @@ function rangeContains(range, x) {
24479
24479
  return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
24480
24480
  }
24481
24481
 
24482
- function geoBounds$1$1(feature) {
24482
+ function geoBounds$1(feature) {
24483
24483
  var i, n, a, b, merged, deltaMax, delta;
24484
24484
 
24485
24485
  phi1 = lambda1 = -(lambda0 = phi0 = Infinity);
@@ -24509,7 +24509,7 @@ function geoBounds$1$1(feature) {
24509
24509
  }
24510
24510
  }
24511
24511
 
24512
- ranges = range$5 = null;
24512
+ ranges = range$4 = null;
24513
24513
 
24514
24514
  return lambda0 === Infinity || phi0 === Infinity
24515
24515
  ? [[NaN, NaN], [NaN, NaN]]
@@ -24628,7 +24628,7 @@ function centroidRingPoint(lambda, phi) {
24628
24628
  centroidPointCartesian(x0$4, y0$4, z0);
24629
24629
  }
24630
24630
 
24631
- function geoCentroid$1$1(object) {
24631
+ function geoCentroid$1(object) {
24632
24632
  W0 = W1 =
24633
24633
  X0$1 = Y0$1 = Z0$1 =
24634
24634
  X1$1 = Y1$1 = Z1$1 = 0;
@@ -24997,7 +24997,7 @@ function clip$1(pointVisible, clipLine, interpolate, start) {
24997
24997
  clip.point = point;
24998
24998
  clip.lineStart = lineStart;
24999
24999
  clip.lineEnd = lineEnd;
25000
- segments = merge$3(segments);
25000
+ segments = merge$2(segments);
25001
25001
  var startInside = polygonContains(polygon, start);
25002
25002
  if (segments.length) {
25003
25003
  if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
@@ -25509,7 +25509,7 @@ function clipRectangle(x0, y0, x1, y1) {
25509
25509
  function polygonEnd() {
25510
25510
  var startInside = polygonInside(),
25511
25511
  cleanInside = clean && startInside,
25512
- visible = (segments = merge$3(segments)).length;
25512
+ visible = (segments = merge$2(segments)).length;
25513
25513
  if (cleanInside || visible) {
25514
25514
  stream.polygonStart();
25515
25515
  if (cleanInside) {
@@ -25584,12 +25584,12 @@ function clipRectangle(x0, y0, x1, y1) {
25584
25584
  }
25585
25585
 
25586
25586
  function graticuleX(y0, y1, dy) {
25587
- var y = range$6(y0, y1 - epsilon$3, dy).concat(y1);
25587
+ var y = range$5(y0, y1 - epsilon$3, dy).concat(y1);
25588
25588
  return function(x) { return y.map(function(y) { return [x, y]; }); };
25589
25589
  }
25590
25590
 
25591
25591
  function graticuleY(x0, x1, dx) {
25592
- var x = range$6(x0, x1 - epsilon$3, dx).concat(x1);
25592
+ var x = range$5(x0, x1 - epsilon$3, dx).concat(x1);
25593
25593
  return function(y) { return x.map(function(x) { return [x, y]; }); };
25594
25594
  }
25595
25595
 
@@ -25605,10 +25605,10 @@ function graticule() {
25605
25605
  }
25606
25606
 
25607
25607
  function lines() {
25608
- return range$6(ceil(X0 / DX) * DX, X1, DX).map(X)
25609
- .concat(range$6(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
25610
- .concat(range$6(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs$1(x % DX) > epsilon$3; }).map(x))
25611
- .concat(range$6(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs$1(y % DY) > epsilon$3; }).map(y));
25608
+ return range$5(ceil(X0 / DX) * DX, X1, DX).map(X)
25609
+ .concat(range$5(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
25610
+ .concat(range$5(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs$1(x % DX) > epsilon$3; }).map(x))
25611
+ .concat(range$5(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs$1(y % DY) > epsilon$3; }).map(y));
25612
25612
  }
25613
25613
 
25614
25614
  graticule.lines = function() {
@@ -26657,7 +26657,7 @@ function geoAzimuthalEquidistant() {
26657
26657
  }
26658
26658
 
26659
26659
  function mercatorRaw(lambda, phi) {
26660
- return [lambda, log$2(tan((halfPi$1 + phi) / 2))];
26660
+ return [lambda, log$1(tan((halfPi$1 + phi) / 2))];
26661
26661
  }
26662
26662
 
26663
26663
  mercatorRaw.invert = function(x, y) {
@@ -26711,7 +26711,7 @@ function tany(y) {
26711
26711
 
26712
26712
  function conicConformalRaw(y0, y1) {
26713
26713
  var cy0 = cos$1(y0),
26714
- n = y0 === y1 ? sin$1(y0) : log$2(cy0 / cos$1(y1)) / log$2(tany(y1) / tany(y0)),
26714
+ n = y0 === y1 ? sin$1(y0) : log$1(cy0 / cos$1(y1)) / log$1(tany(y1) / tany(y0)),
26715
26715
  f = cy0 * pow$1(tany(y0), n) / n;
26716
26716
 
26717
26717
  if (!n) return mercatorRaw;
@@ -26961,7 +26961,7 @@ function geoStereographic() {
26961
26961
  }
26962
26962
 
26963
26963
  function transverseMercatorRaw(lambda, phi) {
26964
- return [log$2(tan((halfPi$1 + phi) / 2)), -lambda];
26964
+ return [log$1(tan((halfPi$1 + phi) / 2)), -lambda];
26965
26965
  }
26966
26966
 
26967
26967
  transverseMercatorRaw.invert = function(x, y) {
@@ -27311,7 +27311,7 @@ function quantize (k, nice, zero) {
27311
27311
  stop = ex[1],
27312
27312
  span = stop - start,
27313
27313
  step = nice ? tickStep(start, stop, k) : span / (k + 1);
27314
- return range$6(start + step, stop, step);
27314
+ return range$5(start + step, stop, step);
27315
27315
  };
27316
27316
  }
27317
27317
 
@@ -27563,7 +27563,7 @@ function density2D () {
27563
27563
  };
27564
27564
  density.bandwidth = function (_) {
27565
27565
  if (!arguments.length) return bandwidth;
27566
- _ = array$6(_);
27566
+ _ = array$5(_);
27567
27567
  if (_.length === 1) _ = [+_[0], +_[0]];
27568
27568
  if (_.length !== 2) error$1('invalid bandwidth');
27569
27569
  return bandwidth = _, density;
@@ -28193,7 +28193,7 @@ inherits(Graticule, Transform, {
28193
28193
  }
28194
28194
  t = gen();
28195
28195
  if (src.length) {
28196
- pulse.mod.push(replace$2(src[0], t));
28196
+ pulse.mod.push(replace$1(src[0], t));
28197
28197
  } else {
28198
28198
  pulse.add.push(ingest$1(t));
28199
28199
  }
@@ -28390,14 +28390,14 @@ function set$2(proj, key, value) {
28390
28390
  if (isFunction(proj[key])) proj[key](value);
28391
28391
  }
28392
28392
  function collectGeoJSON(data) {
28393
- data = array$6(data);
28393
+ data = array$5(data);
28394
28394
  return data.length === 1 ? data[0] : {
28395
28395
  type: FeatureCollection,
28396
28396
  features: data.reduce((a, f) => a.concat(featurize(f)), [])
28397
28397
  };
28398
28398
  }
28399
28399
  function featurize(f) {
28400
- return f.type === FeatureCollection ? f.features : array$6(f).filter(d => d != null).map(d => d.type === Feature ? d : {
28400
+ return f.type === FeatureCollection ? f.features : array$5(f).filter(d => d != null).map(d => d.type === Feature ? d : {
28401
28401
  type: Feature,
28402
28402
  geometry: d
28403
28403
  });
@@ -29892,7 +29892,7 @@ function simulation(nodes, _) {
29892
29892
  return setup(sim, _, true).on('end', () => stopped = true);
29893
29893
  }
29894
29894
  function setup(sim, _, init, pulse) {
29895
- var f = array$6(_.forces),
29895
+ var f = array$5(_.forces),
29896
29896
  i,
29897
29897
  n,
29898
29898
  p,
@@ -30286,7 +30286,7 @@ function lcg() {
30286
30286
  return () => (s = (a * s + c) % m) / m;
30287
30287
  }
30288
30288
 
30289
- function array$3(x) {
30289
+ function array$2(x) {
30290
30290
  return typeof x === "object" && "length" in x
30291
30291
  ? x // Array, TypedArray, NodeList, array-like
30292
30292
  : Array.from(x); // Map, Set, iterable, string, or anything else
@@ -30469,7 +30469,7 @@ function Node(circle) {
30469
30469
  }
30470
30470
 
30471
30471
  function packSiblingsRandom(circles, random) {
30472
- if (!(n = (circles = array$3(circles)).length)) return 0;
30472
+ if (!(n = (circles = array$2(circles)).length)) return 0;
30473
30473
 
30474
30474
  var a, b, c, n, aa, ca, i, j, k, sj, sk;
30475
30475
 
@@ -31374,7 +31374,7 @@ inherits(Nest, Transform, {
31374
31374
 
31375
31375
  // generate new tree structure
31376
31376
  this.value = tree = hierarchy({
31377
- values: array$6(_.keys).reduce((n, k) => {
31377
+ values: array$5(_.keys).reduce((n, k) => {
31378
31378
  n.key(k);
31379
31379
  return n;
31380
31380
  }, nest()).entries(out.source)
@@ -32734,7 +32734,7 @@ inherits(Label$1, Transform, {
32734
32734
  const as = _.as || Output$1;
32735
32735
 
32736
32736
  // run label layout
32737
- labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array$6(_.offset == null ? 1 : _.offset), array$6(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {
32737
+ labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array$5(_.offset == null ? 1 : _.offset), array$5(_.anchor || Anchors), _.avoidMarks || [], _.avoidBaseMark !== false, _.lineAnchor || 'end', _.markIndex || 0, _.padding === undefined ? 0 : _.padding, _.method || 'naive').forEach(l => {
32738
32738
  // write layout results to data stream
32739
32739
  const t = l.datum;
32740
32740
  t[as[0]] = l.x;
@@ -32853,7 +32853,7 @@ inherits(Loess, Transform, {
32853
32853
  const Methods = {
32854
32854
  constant: constant$4,
32855
32855
  linear: linear$2,
32856
- log: log$4,
32856
+ log: log$3,
32857
32857
  exp: exp$1,
32858
32858
  pow: pow$3,
32859
32859
  quad: quad,
@@ -34939,7 +34939,7 @@ inherits(Wordcloud, Transform, {
34939
34939
  // create font size scaling function as needed
34940
34940
  if (range) {
34941
34941
  const fsize = fontSize,
34942
- sizeScale = scale$5('sqrt')().domain(extent(data, fsize)).range(range);
34942
+ sizeScale = scale$4('sqrt')().domain(extent(data, fsize)).range(range);
34943
34943
  fontSize = x => sizeScale(fsize(x));
34944
34944
  }
34945
34945
  data.forEach(t => {
@@ -34985,8 +34985,8 @@ function Bitmaps() {
34985
34985
  let width = 8,
34986
34986
  data = [],
34987
34987
  seen = array32(0),
34988
- curr = array$2(0, width),
34989
- prev = array$2(0, width);
34988
+ curr = array$1(0, width),
34989
+ prev = array$1(0, width);
34990
34990
  return {
34991
34991
  data: () => data,
34992
34992
  seen: () => seen = lengthen(seen, data.length),
@@ -35042,8 +35042,8 @@ function Bitmaps() {
35042
35042
  const k = curr.length;
35043
35043
  if (n > k || m > width) {
35044
35044
  width = Math.max(m, width);
35045
- curr = array$2(n, width, curr);
35046
- prev = array$2(n, width);
35045
+ curr = array$1(n, width, curr);
35046
+ prev = array$1(n, width);
35047
35047
  }
35048
35048
  }
35049
35049
  };
@@ -35054,7 +35054,7 @@ function lengthen(array, length, copy) {
35054
35054
  copy.set(array);
35055
35055
  return copy;
35056
35056
  }
35057
- function array$2(n, m, array) {
35057
+ function array$1(n, m, array) {
35058
35058
  const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);
35059
35059
  if (array) copy.set(array);
35060
35060
  return copy;
@@ -35110,7 +35110,7 @@ function SortedIndex() {
35110
35110
  oldi = index;
35111
35111
  value = Array(n0 + n1);
35112
35112
  index = array32(n0 + n1);
35113
- merge$2(base, oldv, oldi, n0, addv, addi, n1, value, index);
35113
+ merge$1(base, oldv, oldi, n0, addv, addi, n1, value, index);
35114
35114
  } else {
35115
35115
  if (base > 0) for (i = 0; i < n1; ++i) {
35116
35116
  addi[i] += base;
@@ -35174,7 +35174,7 @@ function sort$1(values, index) {
35174
35174
  });
35175
35175
  return permute(values, index);
35176
35176
  }
35177
- function merge$2(base, value0, index0, n0, value1, index1, n1, value, index) {
35177
+ function merge$1(base, value0, index0, n0, value1, index1, n1, value, index) {
35178
35178
  let i0 = 0,
35179
35179
  i1 = 0,
35180
35180
  i;
@@ -37438,7 +37438,7 @@ function selectionResolve(name, op, isMulti, vl5) {
37438
37438
  resUnit = res[unit] || (res[unit] = []);
37439
37439
  types[field.field] = type = field.type.charAt(0);
37440
37440
  union = ops[`${type}_union`];
37441
- res[unit] = union(resUnit, array$6(values[j]));
37441
+ res[unit] = union(resUnit, array$5(values[j]));
37442
37442
  }
37443
37443
 
37444
37444
  // If the same multi-selection is repeated over views and projected over
@@ -37449,7 +37449,7 @@ function selectionResolve(name, op, isMulti, vl5) {
37449
37449
  // a more human-friendly one.
37450
37450
  if (isMulti) {
37451
37451
  resUnit = multiRes[unit] || (multiRes[unit] = []);
37452
- resUnit.push(array$6(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));
37452
+ resUnit.push(array$5(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));
37453
37453
  }
37454
37454
  } else {
37455
37455
  // Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.
@@ -37532,15 +37532,15 @@ var ops = {
37532
37532
  }
37533
37533
  };
37534
37534
 
37535
- const DataPrefix$2 = ':',
37536
- IndexPrefix$2 = '@';
37535
+ const DataPrefix$1 = ':',
37536
+ IndexPrefix$1 = '@';
37537
37537
  function selectionVisitor(name, args, scope, params) {
37538
37538
  if (args[0].type !== Literal) error$1('First argument to selection functions must be a string literal.');
37539
37539
  const data = args[0].value,
37540
37540
  op = args.length >= 2 && peek$1(args).value,
37541
37541
  field = 'unit',
37542
- indexName = IndexPrefix$2 + field,
37543
- dataName = DataPrefix$2 + data;
37542
+ indexName = IndexPrefix$1 + field,
37543
+ dataName = DataPrefix$1 + data;
37544
37544
 
37545
37545
  // eslint-disable-next-line no-prototype-builtins
37546
37546
  if (op === Intersect && !has$1(params, indexName)) {
@@ -37553,16 +37553,16 @@ function selectionVisitor(name, args, scope, params) {
37553
37553
  }
37554
37554
  }
37555
37555
 
37556
- function data$2(name) {
37556
+ function data$1(name) {
37557
37557
  const data = this.context.data[name];
37558
37558
  return data ? data.values.value : [];
37559
37559
  }
37560
- function indata$1(name, field, value) {
37560
+ function indata(name, field, value) {
37561
37561
  const index = this.context.data[name]['index:' + field],
37562
37562
  entry = index ? index.value.get(value) : undefined;
37563
37563
  return entry ? entry.count : entry;
37564
37564
  }
37565
- function setdata$1(name, tuples) {
37565
+ function setdata(name, tuples) {
37566
37566
  const df = this.context.dataflow,
37567
37567
  data = this.context.data[name],
37568
37568
  input = data.input;
@@ -37570,7 +37570,7 @@ function setdata$1(name, tuples) {
37570
37570
  return 1;
37571
37571
  }
37572
37572
 
37573
- function encode$1 (item, name, retval) {
37573
+ function encode (item, name, retval) {
37574
37574
  if (item) {
37575
37575
  const df = this.context.dataflow,
37576
37576
  target = item.mark.source;
@@ -37579,47 +37579,47 @@ function encode$1 (item, name, retval) {
37579
37579
  return retval !== undefined ? retval : item;
37580
37580
  }
37581
37581
 
37582
- const wrap$1 = method => function (value, spec) {
37582
+ const wrap = method => function (value, spec) {
37583
37583
  const locale = this.context.dataflow.locale();
37584
37584
  return value === null ? 'null' : locale[method](spec)(value);
37585
37585
  };
37586
- const format$1 = wrap$1('format');
37587
- const timeFormat$2 = wrap$1('timeFormat');
37588
- const utcFormat$1 = wrap$1('utcFormat');
37589
- const timeParse$1 = wrap$1('timeParse');
37590
- const utcParse$1 = wrap$1('utcParse');
37591
- const dateObj$1 = new Date(2000, 0, 1);
37592
- function time$1(month, day, specifier) {
37586
+ const format = wrap('format');
37587
+ const timeFormat$1 = wrap('timeFormat');
37588
+ const utcFormat = wrap('utcFormat');
37589
+ const timeParse = wrap('timeParse');
37590
+ const utcParse = wrap('utcParse');
37591
+ const dateObj = new Date(2000, 0, 1);
37592
+ function time(month, day, specifier) {
37593
37593
  if (!Number.isInteger(month) || !Number.isInteger(day)) return '';
37594
- dateObj$1.setYear(2000);
37595
- dateObj$1.setMonth(month);
37596
- dateObj$1.setDate(day);
37597
- return timeFormat$2.call(this, dateObj$1, specifier);
37594
+ dateObj.setYear(2000);
37595
+ dateObj.setMonth(month);
37596
+ dateObj.setDate(day);
37597
+ return timeFormat$1.call(this, dateObj, specifier);
37598
37598
  }
37599
- function monthFormat$1(month) {
37600
- return time$1.call(this, month, 1, '%B');
37599
+ function monthFormat(month) {
37600
+ return time.call(this, month, 1, '%B');
37601
37601
  }
37602
- function monthAbbrevFormat$1(month) {
37603
- return time$1.call(this, month, 1, '%b');
37602
+ function monthAbbrevFormat(month) {
37603
+ return time.call(this, month, 1, '%b');
37604
37604
  }
37605
- function dayFormat$1(day) {
37606
- return time$1.call(this, 0, 2 + day, '%A');
37605
+ function dayFormat(day) {
37606
+ return time.call(this, 0, 2 + day, '%A');
37607
37607
  }
37608
- function dayAbbrevFormat$1(day) {
37609
- return time$1.call(this, 0, 2 + day, '%a');
37608
+ function dayAbbrevFormat(day) {
37609
+ return time.call(this, 0, 2 + day, '%a');
37610
37610
  }
37611
37611
 
37612
- const DataPrefix$1 = ':';
37613
- const IndexPrefix$1 = '@';
37614
- const ScalePrefix$1 = '%';
37615
- const SignalPrefix$1 = '$';
37612
+ const DataPrefix = ':';
37613
+ const IndexPrefix = '@';
37614
+ const ScalePrefix = '%';
37615
+ const SignalPrefix = '$';
37616
37616
 
37617
- function dataVisitor$1(name, args, scope, params) {
37617
+ function dataVisitor(name, args, scope, params) {
37618
37618
  if (args[0].type !== Literal) {
37619
37619
  error$1('First argument to data functions must be a string literal.');
37620
37620
  }
37621
37621
  const data = args[0].value,
37622
- dataName = DataPrefix$1 + data;
37622
+ dataName = DataPrefix + data;
37623
37623
  if (!has$1(dataName, params)) {
37624
37624
  try {
37625
37625
  params[dataName] = scope.getData(data).tuplesRef();
@@ -37628,29 +37628,29 @@ function dataVisitor$1(name, args, scope, params) {
37628
37628
  }
37629
37629
  }
37630
37630
  }
37631
- function indataVisitor$1(name, args, scope, params) {
37631
+ function indataVisitor(name, args, scope, params) {
37632
37632
  if (args[0].type !== Literal) error$1('First argument to indata must be a string literal.');
37633
37633
  if (args[1].type !== Literal) error$1('Second argument to indata must be a string literal.');
37634
37634
  const data = args[0].value,
37635
37635
  field = args[1].value,
37636
- indexName = IndexPrefix$1 + field;
37636
+ indexName = IndexPrefix + field;
37637
37637
  if (!has$1(indexName, params)) {
37638
37638
  params[indexName] = scope.getData(data).indataRef(scope, field);
37639
37639
  }
37640
37640
  }
37641
- function scaleVisitor$1(name, args, scope, params) {
37641
+ function scaleVisitor(name, args, scope, params) {
37642
37642
  if (args[0].type === Literal) {
37643
37643
  // add scale dependency
37644
- addScaleDependency$1(scope, params, args[0].value);
37644
+ addScaleDependency(scope, params, args[0].value);
37645
37645
  } else {
37646
37646
  // indirect scale lookup; add all scales as parameters
37647
37647
  for (name in scope.scales) {
37648
- addScaleDependency$1(scope, params, name);
37648
+ addScaleDependency(scope, params, name);
37649
37649
  }
37650
37650
  }
37651
37651
  }
37652
- function addScaleDependency$1(scope, params, name) {
37653
- const scaleName = ScalePrefix$1 + name;
37652
+ function addScaleDependency(scope, params, name) {
37653
+ const scaleName = ScalePrefix + name;
37654
37654
  if (!has$1(params, scaleName)) {
37655
37655
  try {
37656
37656
  params[scaleName] = scope.scaleRef(name);
@@ -37660,27 +37660,27 @@ function addScaleDependency$1(scope, params, name) {
37660
37660
  }
37661
37661
  }
37662
37662
 
37663
- function getScale$1(nameOrFunction, ctx) {
37664
- if (isFunction(nameOrFunction)) {
37665
- return nameOrFunction;
37666
- }
37667
- if (isString(nameOrFunction)) {
37668
- const maybeScale = ctx.scales[nameOrFunction];
37663
+ /**
37664
+ * Name must be a string. Return undefined if the scale is not registered.
37665
+ */
37666
+ function getScale(name, ctx) {
37667
+ if (isString(name)) {
37668
+ const maybeScale = ctx.scales[name];
37669
37669
  return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;
37670
37670
  }
37671
37671
  return undefined;
37672
37672
  }
37673
- function internalScaleFunctions$1(codegen, fnctx, visitors) {
37673
+ function internalScaleFunctions(codegen, fnctx, visitors) {
37674
37674
  // add helper method to the 'this' expression function context
37675
37675
  fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;
37676
37676
 
37677
37677
  // register AST visitors for internal scale functions
37678
- visitors._bandwidth = scaleVisitor$1;
37679
- visitors._range = scaleVisitor$1;
37680
- visitors._scale = scaleVisitor$1;
37678
+ visitors._bandwidth = scaleVisitor;
37679
+ visitors._range = scaleVisitor;
37680
+ visitors._scale = scaleVisitor;
37681
37681
 
37682
37682
  // resolve scale reference directly to the signal hash argument
37683
- const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix$1 + arg.value) : $(ScalePrefix$1) + '+' + codegen(arg)) + ']';
37683
+ const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix + arg.value) : $(ScalePrefix) + '+' + codegen(arg)) + ']';
37684
37684
 
37685
37685
  // define and return internal scale function code generators
37686
37686
  // these internal functions are called by mark encoders
@@ -37691,11 +37691,11 @@ function internalScaleFunctions$1(codegen, fnctx, visitors) {
37691
37691
  };
37692
37692
  }
37693
37693
 
37694
- function geoMethod$1(methodName, globalMethod) {
37694
+ function geoMethod(methodName, globalMethod) {
37695
37695
  return function (projection, geojson, group) {
37696
37696
  if (projection) {
37697
37697
  // projection defined, use it
37698
- const p = getScale$1(projection, (group || this).context);
37698
+ const p = getScale(projection, (group || this).context);
37699
37699
  return p && p.path[methodName](geojson);
37700
37700
  } else {
37701
37701
  // projection undefined, use global method
@@ -37703,15 +37703,15 @@ function geoMethod$1(methodName, globalMethod) {
37703
37703
  }
37704
37704
  };
37705
37705
  }
37706
- const geoArea$1 = geoMethod$1('area', geoArea$1$1);
37707
- const geoBounds$1 = geoMethod$1('bounds', geoBounds$1$1);
37708
- const geoCentroid$1 = geoMethod$1('centroid', geoCentroid$1$1);
37709
- function geoScale$1(projection, group) {
37710
- const p = getScale$1(projection, (group || this).context);
37706
+ const geoArea = geoMethod('area', geoArea$1);
37707
+ const geoBounds = geoMethod('bounds', geoBounds$1);
37708
+ const geoCentroid = geoMethod('centroid', geoCentroid$1);
37709
+ function geoScale(projection, group) {
37710
+ const p = getScale(projection, (group || this).context);
37711
37711
  return p && p.scale();
37712
37712
  }
37713
37713
 
37714
- function inScope$1 (item) {
37714
+ function inScope (item) {
37715
37715
  const group = this.context.group;
37716
37716
  let value = false;
37717
37717
  if (group) while (item) {
@@ -37724,7 +37724,7 @@ function inScope$1 (item) {
37724
37724
  return value;
37725
37725
  }
37726
37726
 
37727
- function log$1(df, method, args) {
37727
+ function log(df, method, args) {
37728
37728
  try {
37729
37729
  df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));
37730
37730
  } catch (err) {
@@ -37732,66 +37732,66 @@ function log$1(df, method, args) {
37732
37732
  }
37733
37733
  return args[args.length - 1];
37734
37734
  }
37735
- function warn$2() {
37736
- return log$1(this.context.dataflow, 'warn', arguments);
37735
+ function warn$1() {
37736
+ return log(this.context.dataflow, 'warn', arguments);
37737
37737
  }
37738
- function info$1() {
37739
- return log$1(this.context.dataflow, 'info', arguments);
37738
+ function info() {
37739
+ return log(this.context.dataflow, 'info', arguments);
37740
37740
  }
37741
- function debug$2() {
37742
- return log$1(this.context.dataflow, 'debug', arguments);
37741
+ function debug$1() {
37742
+ return log(this.context.dataflow, 'debug', arguments);
37743
37743
  }
37744
37744
 
37745
37745
  // https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
37746
- function channel_luminance_value$1(channelValue) {
37746
+ function channel_luminance_value(channelValue) {
37747
37747
  const val = channelValue / 255;
37748
37748
  if (val <= 0.03928) {
37749
37749
  return val / 12.92;
37750
37750
  }
37751
37751
  return Math.pow((val + 0.055) / 1.055, 2.4);
37752
37752
  }
37753
- function luminance$1(color) {
37753
+ function luminance(color) {
37754
37754
  const c = rgb$1(color),
37755
- r = channel_luminance_value$1(c.r),
37756
- g = channel_luminance_value$1(c.g),
37757
- b = channel_luminance_value$1(c.b);
37755
+ r = channel_luminance_value(c.r),
37756
+ g = channel_luminance_value(c.g),
37757
+ b = channel_luminance_value(c.b);
37758
37758
  return 0.2126 * r + 0.7152 * g + 0.0722 * b;
37759
37759
  }
37760
37760
 
37761
37761
  // https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
37762
- function contrast$1(color1, color2) {
37763
- const lum1 = luminance$1(color1),
37764
- lum2 = luminance$1(color2),
37762
+ function contrast(color1, color2) {
37763
+ const lum1 = luminance(color1),
37764
+ lum2 = luminance(color2),
37765
37765
  lumL = Math.max(lum1, lum2),
37766
37766
  lumD = Math.min(lum1, lum2);
37767
37767
  return (lumL + 0.05) / (lumD + 0.05);
37768
37768
  }
37769
37769
 
37770
- function merge$1 () {
37770
+ function merge () {
37771
37771
  const args = [].slice.call(arguments);
37772
37772
  args.unshift({});
37773
37773
  return extend$1(...args);
37774
37774
  }
37775
37775
 
37776
- function equal$1(a, b) {
37777
- return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray$1(a, b) : false : isObject(a) && isObject(b) ? equalObject$1(a, b) : false;
37776
+ function equal(a, b) {
37777
+ return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;
37778
37778
  }
37779
- function equalArray$1(a, b) {
37779
+ function equalArray(a, b) {
37780
37780
  for (let i = 0, n = a.length; i < n; ++i) {
37781
- if (!equal$1(a[i], b[i])) return false;
37781
+ if (!equal(a[i], b[i])) return false;
37782
37782
  }
37783
37783
  return true;
37784
37784
  }
37785
- function equalObject$1(a, b) {
37785
+ function equalObject(a, b) {
37786
37786
  for (const key in a) {
37787
- if (!equal$1(a[key], b[key])) return false;
37787
+ if (!equal(a[key], b[key])) return false;
37788
37788
  }
37789
37789
  return true;
37790
37790
  }
37791
- function removePredicate$1(props) {
37792
- return _ => equalObject$1(props, _);
37791
+ function removePredicate(props) {
37792
+ return _ => equalObject(props, _);
37793
37793
  }
37794
- function modify$1 (name, insert, remove, toggle, modify, values) {
37794
+ function modify (name, insert, remove, toggle, modify, values) {
37795
37795
  const df = this.context.dataflow,
37796
37796
  data = this.context.data[name],
37797
37797
  input = data.input,
@@ -37812,14 +37812,14 @@ function modify$1 (name, insert, remove, toggle, modify, values) {
37812
37812
  }, true, 1);
37813
37813
  }
37814
37814
  if (remove) {
37815
- predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate$1(remove);
37815
+ predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);
37816
37816
  changes.remove(predicate);
37817
37817
  }
37818
37818
  if (insert) {
37819
37819
  changes.insert(insert);
37820
37820
  }
37821
37821
  if (toggle) {
37822
- predicate = removePredicate$1(toggle);
37822
+ predicate = removePredicate(toggle);
37823
37823
  if (input.value.some(predicate)) {
37824
37824
  changes.remove(predicate);
37825
37825
  } else {
@@ -37834,92 +37834,99 @@ function modify$1 (name, insert, remove, toggle, modify, values) {
37834
37834
  return 1;
37835
37835
  }
37836
37836
 
37837
- function pinchDistance$1(event) {
37837
+ function pinchDistance(event) {
37838
37838
  const t = event.touches,
37839
37839
  dx = t[0].clientX - t[1].clientX,
37840
37840
  dy = t[0].clientY - t[1].clientY;
37841
37841
  return Math.hypot(dx, dy);
37842
37842
  }
37843
- function pinchAngle$1(event) {
37843
+ function pinchAngle(event) {
37844
37844
  const t = event.touches;
37845
37845
  return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);
37846
37846
  }
37847
37847
 
37848
37848
  // memoize accessor functions
37849
- const accessors$1 = {};
37850
- function pluck$1 (data, name) {
37851
- const accessor = accessors$1[name] || (accessors$1[name] = field$1(name));
37849
+ const accessors = {};
37850
+ function pluck (data, name) {
37851
+ const accessor = accessors[name] || (accessors[name] = field$1(name));
37852
37852
  return isArray(data) ? data.map(accessor) : accessor(data);
37853
37853
  }
37854
37854
 
37855
- function array$1(seq) {
37855
+ function array(seq) {
37856
37856
  return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;
37857
37857
  }
37858
- function sequence$1(seq) {
37859
- return array$1(seq) || (isString(seq) ? seq : null);
37858
+ function sequence(seq) {
37859
+ return array(seq) || (isString(seq) ? seq : null);
37860
37860
  }
37861
- function join$1(seq) {
37861
+ function join(seq) {
37862
37862
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
37863
37863
  args[_key - 1] = arguments[_key];
37864
37864
  }
37865
- return array$1(seq).join(...args);
37865
+ return array(seq).join(...args);
37866
37866
  }
37867
- function indexof$1(seq) {
37867
+ function indexof(seq) {
37868
37868
  for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
37869
37869
  args[_key2 - 1] = arguments[_key2];
37870
37870
  }
37871
- return sequence$1(seq).indexOf(...args);
37871
+ return sequence(seq).indexOf(...args);
37872
37872
  }
37873
- function lastindexof$1(seq) {
37873
+ function lastindexof(seq) {
37874
37874
  for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
37875
37875
  args[_key3 - 1] = arguments[_key3];
37876
37876
  }
37877
- return sequence$1(seq).lastIndexOf(...args);
37877
+ return sequence(seq).lastIndexOf(...args);
37878
37878
  }
37879
- function slice$2(seq) {
37879
+ function slice$1(seq) {
37880
37880
  for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
37881
37881
  args[_key4 - 1] = arguments[_key4];
37882
37882
  }
37883
- return sequence$1(seq).slice(...args);
37883
+ return sequence(seq).slice(...args);
37884
37884
  }
37885
- function replace$1(str, pattern, repl) {
37885
+ function replace(str, pattern, repl) {
37886
37886
  if (isFunction(repl)) error$1('Function argument passed to replace.');
37887
37887
  return String(str).replace(pattern, repl);
37888
37888
  }
37889
- function reverse$2(seq) {
37890
- return array$1(seq).slice().reverse();
37889
+ function reverse$1(seq) {
37890
+ return array(seq).slice().reverse();
37891
+ }
37892
+ function sort(seq) {
37893
+ return array(seq).slice().sort(ascending$2);
37891
37894
  }
37892
37895
 
37893
- function bandspace$1(count, paddingInner, paddingOuter) {
37896
+ function bandspace(count, paddingInner, paddingOuter) {
37894
37897
  return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);
37895
37898
  }
37896
- function bandwidth$1(name, group) {
37897
- const s = getScale$1(name, (group || this).context);
37899
+ function bandwidth(name, group) {
37900
+ const s = getScale(name, (group || this).context);
37898
37901
  return s && s.bandwidth ? s.bandwidth() : 0;
37899
37902
  }
37900
- function copy$1(name, group) {
37901
- const s = getScale$1(name, (group || this).context);
37903
+ function copy(name, group) {
37904
+ const s = getScale(name, (group || this).context);
37902
37905
  return s ? s.copy() : undefined;
37903
37906
  }
37904
- function domain$3(name, group) {
37905
- const s = getScale$1(name, (group || this).context);
37907
+ function domain$2(name, group) {
37908
+ const s = getScale(name, (group || this).context);
37906
37909
  return s ? s.domain() : [];
37907
37910
  }
37908
- function invert$1(name, range, group) {
37909
- const s = getScale$1(name, (group || this).context);
37911
+ function invert(name, range, group) {
37912
+ const s = getScale(name, (group || this).context);
37910
37913
  return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);
37911
37914
  }
37912
- function range$4(name, group) {
37913
- const s = getScale$1(name, (group || this).context);
37915
+ function range$3(name, group) {
37916
+ const s = getScale(name, (group || this).context);
37914
37917
  return s && s.range ? s.range() : [];
37915
37918
  }
37916
- function scale$3(name, value, group) {
37917
- const s = getScale$1(name, (group || this).context);
37919
+ function scale$2(name, value, group) {
37920
+ const s = getScale(name, (group || this).context);
37918
37921
  return s ? s(value) : undefined;
37919
37922
  }
37920
37923
 
37921
- function scaleGradient$1 (scale, p0, p1, count, group) {
37922
- scale = getScale$1(scale, (group || this).context);
37924
+ /**
37925
+ * Passing a function is only used for for testing.
37926
+ * Outside of tests, the first argument should be a string.
37927
+ */
37928
+ function scaleGradient (scaleOrFunction, p0, p1, count, group) {
37929
+ let scale = typeof scaleOrFunction === 'string' ? getScale(scaleOrFunction, (group || this).context) : scaleOrFunction;
37923
37930
  const gradient = Gradient$1(p0, p1);
37924
37931
  let stops = scale.domain(),
37925
37932
  min = stops[0],
@@ -37927,7 +37934,7 @@ function scaleGradient$1 (scale, p0, p1, count, group) {
37927
37934
  fraction = identity$7;
37928
37935
  if (!(max - min)) {
37929
37936
  // expand scale if domain has zero span, fix #1479
37930
- scale = (scale.interpolator ? scale$5('sequential')().interpolator(scale.interpolator()) : scale$5('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);
37937
+ scale = (scale.interpolator ? scale$4('sequential')().interpolator(scale.interpolator()) : scale$4('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);
37931
37938
  } else {
37932
37939
  fraction = scaleFraction(scale, min, max);
37933
37940
  }
@@ -37940,62 +37947,62 @@ function scaleGradient$1 (scale, p0, p1, count, group) {
37940
37947
  return gradient;
37941
37948
  }
37942
37949
 
37943
- function geoShape$1(projection, geojson, group) {
37944
- const p = getScale$1(projection, (group || this).context);
37950
+ function geoShape(projection, geojson, group) {
37951
+ const p = getScale(projection, (group || this).context);
37945
37952
  return function (context) {
37946
37953
  return p ? p.path.context(context)(geojson) : '';
37947
37954
  };
37948
37955
  }
37949
- function pathShape$1(path) {
37956
+ function pathShape(path) {
37950
37957
  let p = null;
37951
37958
  return function (context) {
37952
37959
  return context ? pathRender(context, p = p || parse$3(path)) : path;
37953
37960
  };
37954
37961
  }
37955
37962
 
37956
- const datum$1 = d => d.data;
37957
- function treeNodes$1(name, context) {
37958
- const tree = data$2.call(context, name);
37963
+ const datum = d => d.data;
37964
+ function treeNodes(name, context) {
37965
+ const tree = data$1.call(context, name);
37959
37966
  return tree.root && tree.root.lookup || {};
37960
37967
  }
37961
- function treePath$1(name, source, target) {
37962
- const nodes = treeNodes$1(name, this),
37968
+ function treePath(name, source, target) {
37969
+ const nodes = treeNodes(name, this),
37963
37970
  s = nodes[source],
37964
37971
  t = nodes[target];
37965
- return s && t ? s.path(t).map(datum$1) : undefined;
37972
+ return s && t ? s.path(t).map(datum) : undefined;
37966
37973
  }
37967
- function treeAncestors$1(name, node) {
37968
- const n = treeNodes$1(name, this)[node];
37969
- return n ? n.ancestors().map(datum$1) : undefined;
37974
+ function treeAncestors(name, node) {
37975
+ const n = treeNodes(name, this)[node];
37976
+ return n ? n.ancestors().map(datum) : undefined;
37970
37977
  }
37971
37978
 
37972
- const _window$1 = () => typeof window !== 'undefined' && window || null;
37973
- function screen$1() {
37974
- const w = _window$1();
37979
+ const _window = () => typeof window !== 'undefined' && window || null;
37980
+ function screen() {
37981
+ const w = _window();
37975
37982
  return w ? w.screen : {};
37976
37983
  }
37977
- function windowSize$1() {
37978
- const w = _window$1();
37984
+ function windowSize() {
37985
+ const w = _window();
37979
37986
  return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];
37980
37987
  }
37981
- function containerSize$1() {
37988
+ function containerSize() {
37982
37989
  const view = this.context.dataflow,
37983
37990
  el = view.container && view.container();
37984
37991
  return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];
37985
37992
  }
37986
37993
 
37987
- function intersect$1 (b, opt, group) {
37994
+ function intersect (b, opt, group) {
37988
37995
  if (!b) return [];
37989
37996
  const [u, v] = b,
37990
37997
  box = new Bounds().set(u[0], u[1], v[0], v[1]),
37991
37998
  scene = group || this.context.dataflow.scenegraph().root;
37992
- return intersect$3(scene, box, filter$1(opt));
37999
+ return intersect$2(scene, box, filter(opt));
37993
38000
  }
37994
- function filter$1(opt) {
38001
+ function filter(opt) {
37995
38002
  let p = null;
37996
38003
  if (opt) {
37997
- const types = array$6(opt.marktype),
37998
- names = array$6(opt.markname);
38004
+ const types = array$5(opt.marktype),
38005
+ names = array$5(opt.markname);
37999
38006
  p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));
38000
38007
  }
38001
38008
  return p;
@@ -38010,9 +38017,9 @@ function filter$1(opt) {
38010
38017
  * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point
38011
38018
  * @returns a new array containing the lasso with the new point
38012
38019
  */
38013
- function lassoAppend$1(lasso, x, y) {
38020
+ function lassoAppend(lasso, x, y) {
38014
38021
  let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
38015
- lasso = array$6(lasso);
38022
+ lasso = array$5(lasso);
38016
38023
  const last = lasso[lasso.length - 1];
38017
38024
 
38018
38025
  // Add point to lasso if its the first point or distance to last point exceed minDist
@@ -38025,8 +38032,8 @@ function lassoAppend$1(lasso, x, y) {
38025
38032
  * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]
38026
38033
  * @returns the svg path command that draws the lasso
38027
38034
  */
38028
- function lassoPath$1(lasso) {
38029
- return array$6(lasso).reduce((svg, _ref, i) => {
38035
+ function lassoPath(lasso) {
38036
+ return array$5(lasso).reduce((svg, _ref, i) => {
38030
38037
  let [x, y] = _ref;
38031
38038
  return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;
38032
38039
  }, '');
@@ -38041,7 +38048,7 @@ function lassoPath$1(lasso) {
38041
38048
  *
38042
38049
  * @returns an array of vega scenegraph tuples
38043
38050
  */
38044
- function intersectLasso$1(markname, pixelLasso, unit) {
38051
+ function intersectLasso(markname, pixelLasso, unit) {
38045
38052
  const {
38046
38053
  x,
38047
38054
  y,
@@ -38059,10 +38066,10 @@ function intersectLasso$1(markname, pixelLasso, unit) {
38059
38066
 
38060
38067
  // Translate bb against unit coordinates
38061
38068
  bb.translate(x, y);
38062
- const intersection = intersect$1([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);
38069
+ const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);
38063
38070
 
38064
38071
  // Check every point against the lasso
38065
- return intersection.filter(tuple => pointInPolygon$1(tuple.x, tuple.y, pixelLasso));
38072
+ return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));
38066
38073
  }
38067
38074
 
38068
38075
  /**
@@ -38075,7 +38082,7 @@ function intersectLasso$1(markname, pixelLasso, unit) {
38075
38082
  * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]
38076
38083
  * @returns true if the point lies inside the polygon, false otherwise
38077
38084
  */
38078
- function pointInPolygon$1(testx, testy, polygon) {
38085
+ function pointInPolygon(testx, testy, polygon) {
38079
38086
  let intersections = 0;
38080
38087
  for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
38081
38088
  const [prevX, prevY] = polygon[j];
@@ -38092,7 +38099,7 @@ function pointInPolygon$1(testx, testy, polygon) {
38092
38099
  }
38093
38100
 
38094
38101
  // Expression function context object
38095
- const functionContext$1 = {
38102
+ const functionContext = {
38096
38103
  random() {
38097
38104
  return random();
38098
38105
  },
@@ -38130,18 +38137,19 @@ const functionContext$1 = {
38130
38137
  // suppress extra arguments
38131
38138
  toNumber,
38132
38139
  toString,
38133
- indexof: indexof$1,
38134
- join: join$1,
38135
- lastindexof: lastindexof$1,
38136
- replace: replace$1,
38137
- reverse: reverse$2,
38138
- slice: slice$2,
38140
+ indexof,
38141
+ join,
38142
+ lastindexof,
38143
+ replace,
38144
+ reverse: reverse$1,
38145
+ sort,
38146
+ slice: slice$1,
38139
38147
  flush,
38140
38148
  lerp,
38141
- merge: merge$1,
38149
+ merge,
38142
38150
  pad: pad$3,
38143
38151
  peek: peek$1,
38144
- pluck: pluck$1,
38152
+ pluck,
38145
38153
  span,
38146
38154
  inrange,
38147
38155
  truncate: truncate$1,
@@ -38149,47 +38157,47 @@ const functionContext$1 = {
38149
38157
  lab: lab$1,
38150
38158
  hcl: hcl$2,
38151
38159
  hsl: hsl$2,
38152
- luminance: luminance$1,
38153
- contrast: contrast$1,
38154
- sequence: range$6,
38155
- format: format$1,
38156
- utcFormat: utcFormat$1,
38157
- utcParse: utcParse$1,
38160
+ luminance,
38161
+ contrast,
38162
+ sequence: range$5,
38163
+ format,
38164
+ utcFormat,
38165
+ utcParse,
38158
38166
  utcOffset,
38159
38167
  utcSequence,
38160
- timeFormat: timeFormat$2,
38161
- timeParse: timeParse$1,
38168
+ timeFormat: timeFormat$1,
38169
+ timeParse,
38162
38170
  timeOffset,
38163
38171
  timeSequence,
38164
38172
  timeUnitSpecifier,
38165
- monthFormat: monthFormat$1,
38166
- monthAbbrevFormat: monthAbbrevFormat$1,
38167
- dayFormat: dayFormat$1,
38168
- dayAbbrevFormat: dayAbbrevFormat$1,
38173
+ monthFormat,
38174
+ monthAbbrevFormat,
38175
+ dayFormat,
38176
+ dayAbbrevFormat,
38169
38177
  quarter,
38170
38178
  utcquarter,
38171
38179
  week,
38172
38180
  utcweek,
38173
38181
  dayofyear,
38174
38182
  utcdayofyear,
38175
- warn: warn$2,
38176
- info: info$1,
38177
- debug: debug$2,
38183
+ warn: warn$1,
38184
+ info,
38185
+ debug: debug$1,
38178
38186
  extent(_) {
38179
38187
  return extent(_);
38180
38188
  },
38181
38189
  // suppress extra arguments
38182
- inScope: inScope$1,
38183
- intersect: intersect$1,
38190
+ inScope,
38191
+ intersect,
38184
38192
  clampRange,
38185
- pinchDistance: pinchDistance$1,
38186
- pinchAngle: pinchAngle$1,
38187
- screen: screen$1,
38188
- containerSize: containerSize$1,
38189
- windowSize: windowSize$1,
38190
- bandspace: bandspace$1,
38191
- setdata: setdata$1,
38192
- pathShape: pathShape$1,
38193
+ pinchDistance,
38194
+ pinchAngle,
38195
+ screen,
38196
+ containerSize,
38197
+ windowSize,
38198
+ bandspace,
38199
+ setdata,
38200
+ pathShape,
38193
38201
  panLinear,
38194
38202
  panLog,
38195
38203
  panPow,
@@ -38198,86 +38206,129 @@ const functionContext$1 = {
38198
38206
  zoomLog,
38199
38207
  zoomPow,
38200
38208
  zoomSymlog,
38201
- encode: encode$1,
38202
- modify: modify$1,
38203
- lassoAppend: lassoAppend$1,
38204
- lassoPath: lassoPath$1,
38205
- intersectLasso: intersectLasso$1
38209
+ encode,
38210
+ modify,
38211
+ lassoAppend,
38212
+ lassoPath,
38213
+ intersectLasso
38206
38214
  };
38207
- const eventFunctions$1 = ['view', 'item', 'group', 'xy', 'x', 'y'],
38215
+ const eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],
38208
38216
  // event functions
38209
- eventPrefix$1 = 'event.vega.',
38217
+ eventPrefix = 'event.vega.',
38210
38218
  // event function prefix
38211
- thisPrefix$1 = 'this.',
38219
+ thisPrefix = 'this.',
38212
38220
  // function context prefix
38213
- astVisitors$1 = {}; // AST visitors for dependency analysis
38221
+ astVisitors = {}; // AST visitors for dependency analysis
38214
38222
 
38215
38223
  // export code generator parameters
38216
- const codegenParams$1 = {
38224
+ const codegenParams = {
38217
38225
  forbidden: ['_'],
38218
38226
  allowed: ['datum', 'event', 'item'],
38219
38227
  fieldvar: 'datum',
38220
- globalvar: id => `_[${$(SignalPrefix$1 + id)}]`,
38221
- functions: buildFunctions$1,
38228
+ globalvar: id => `_[${$(SignalPrefix + id)}]`,
38229
+ functions: buildFunctions,
38222
38230
  constants: Constants$1,
38223
- visitors: astVisitors$1
38231
+ visitors: astVisitors
38224
38232
  };
38225
38233
 
38226
38234
  // export code generator
38227
- const codeGenerator$1 = codegen(codegenParams$1);
38235
+ const codeGenerator = codegen(codegenParams);
38228
38236
 
38229
38237
  // Build expression function registry
38230
- function buildFunctions$1(codegen) {
38238
+ function buildFunctions(codegen) {
38231
38239
  const fn = Functions$1(codegen);
38232
- eventFunctions$1.forEach(name => fn[name] = eventPrefix$1 + name);
38233
- for (const name in functionContext$1) {
38234
- fn[name] = thisPrefix$1 + name;
38240
+ eventFunctions.forEach(name => fn[name] = eventPrefix + name);
38241
+ for (const name in functionContext) {
38242
+ fn[name] = thisPrefix + name;
38235
38243
  }
38236
- extend$1(fn, internalScaleFunctions$1(codegen, functionContext$1, astVisitors$1));
38244
+ extend$1(fn, internalScaleFunctions(codegen, functionContext, astVisitors));
38237
38245
  return fn;
38238
38246
  }
38239
38247
 
38240
38248
  // Register an expression function
38241
- function expressionFunction$1(name, fn, visitor) {
38249
+ function expressionFunction(name, fn, visitor) {
38242
38250
  if (arguments.length === 1) {
38243
- return functionContext$1[name];
38251
+ return functionContext[name];
38244
38252
  }
38245
38253
 
38246
38254
  // register with the functionContext
38247
- functionContext$1[name] = fn;
38255
+ functionContext[name] = fn;
38248
38256
 
38249
38257
  // if there is an astVisitor register that, too
38250
- if (visitor) astVisitors$1[name] = visitor;
38258
+ if (visitor) astVisitors[name] = visitor;
38251
38259
 
38252
38260
  // if the code generator has already been initialized,
38253
38261
  // we need to also register the function with it
38254
- if (codeGenerator$1) codeGenerator$1.functions[name] = thisPrefix$1 + name;
38262
+ if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;
38255
38263
  return this;
38256
38264
  }
38257
38265
 
38258
38266
  // register expression functions with ast visitors
38259
- expressionFunction$1('bandwidth', bandwidth$1, scaleVisitor$1);
38260
- expressionFunction$1('copy', copy$1, scaleVisitor$1);
38261
- expressionFunction$1('domain', domain$3, scaleVisitor$1);
38262
- expressionFunction$1('range', range$4, scaleVisitor$1);
38263
- expressionFunction$1('invert', invert$1, scaleVisitor$1);
38264
- expressionFunction$1('scale', scale$3, scaleVisitor$1);
38265
- expressionFunction$1('gradient', scaleGradient$1, scaleVisitor$1);
38266
- expressionFunction$1('geoArea', geoArea$1, scaleVisitor$1);
38267
- expressionFunction$1('geoBounds', geoBounds$1, scaleVisitor$1);
38268
- expressionFunction$1('geoCentroid', geoCentroid$1, scaleVisitor$1);
38269
- expressionFunction$1('geoShape', geoShape$1, scaleVisitor$1);
38270
- expressionFunction$1('geoScale', geoScale$1, scaleVisitor$1);
38271
- expressionFunction$1('indata', indata$1, indataVisitor$1);
38272
- expressionFunction$1('data', data$2, dataVisitor$1);
38273
- expressionFunction$1('treePath', treePath$1, dataVisitor$1);
38274
- expressionFunction$1('treeAncestors', treeAncestors$1, dataVisitor$1);
38267
+ expressionFunction('bandwidth', bandwidth, scaleVisitor);
38268
+ expressionFunction('copy', copy, scaleVisitor);
38269
+ expressionFunction('domain', domain$2, scaleVisitor);
38270
+ expressionFunction('range', range$3, scaleVisitor);
38271
+ expressionFunction('invert', invert, scaleVisitor);
38272
+ expressionFunction('scale', scale$2, scaleVisitor);
38273
+ expressionFunction('gradient', scaleGradient, scaleVisitor);
38274
+ expressionFunction('geoArea', geoArea, scaleVisitor);
38275
+ expressionFunction('geoBounds', geoBounds, scaleVisitor);
38276
+ expressionFunction('geoCentroid', geoCentroid, scaleVisitor);
38277
+ expressionFunction('geoShape', geoShape, scaleVisitor);
38278
+ expressionFunction('geoScale', geoScale, scaleVisitor);
38279
+ expressionFunction('indata', indata, indataVisitor);
38280
+ expressionFunction('data', data$1, dataVisitor);
38281
+ expressionFunction('treePath', treePath, dataVisitor);
38282
+ expressionFunction('treeAncestors', treeAncestors, dataVisitor);
38275
38283
 
38276
38284
  // register Vega-Lite selection functions
38277
- expressionFunction$1('vlSelectionTest', selectionTest, selectionVisitor);
38278
- expressionFunction$1('vlSelectionIdTest', selectionIdTest, selectionVisitor);
38279
- expressionFunction$1('vlSelectionResolve', selectionResolve, selectionVisitor);
38280
- expressionFunction$1('vlSelectionTuples', selectionTuples);
38285
+ expressionFunction('vlSelectionTest', selectionTest, selectionVisitor);
38286
+ expressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);
38287
+ expressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);
38288
+ expressionFunction('vlSelectionTuples', selectionTuples);
38289
+
38290
+ function parser (expr, scope) {
38291
+ const params = {};
38292
+
38293
+ // parse the expression to an abstract syntax tree (ast)
38294
+ let ast;
38295
+ try {
38296
+ expr = isString(expr) ? expr : $(expr) + '';
38297
+ ast = parser$1(expr);
38298
+ } catch (err) {
38299
+ error$1('Expression parse error: ' + expr);
38300
+ }
38301
+
38302
+ // analyze ast function calls for dependencies
38303
+ ast.visit(node => {
38304
+ if (node.type !== CallExpression) return;
38305
+ const name = node.callee.name,
38306
+ visit = codegenParams.visitors[name];
38307
+ if (visit) visit(name, node.arguments, scope, params);
38308
+ });
38309
+
38310
+ // perform code generation
38311
+ const gen = codeGenerator(ast);
38312
+
38313
+ // collect signal dependencies
38314
+ gen.globals.forEach(name => {
38315
+ const signalName = SignalPrefix + name;
38316
+ if (!has$1(params, signalName) && scope.getSignal(name)) {
38317
+ params[signalName] = scope.signalRef(name);
38318
+ }
38319
+ });
38320
+
38321
+ // return generated expression code and dependencies
38322
+ return {
38323
+ $expr: extend$1({
38324
+ code: gen.code
38325
+ }, scope.options.ast ? {
38326
+ ast
38327
+ } : null),
38328
+ $fields: gen.fields,
38329
+ $params: params
38330
+ };
38331
+ }
38281
38332
 
38282
38333
  /**
38283
38334
  * Parse a serialized dataflow specification.
@@ -38566,7 +38617,7 @@ function getCompare(_, ctx) {
38566
38617
  // As of Vega 5.5.3, $tupleid sort is no longer used.
38567
38618
  // Keep here for now for backwards compatibility.
38568
38619
  const k = 'c:' + _.$compare + '_' + _.$order,
38569
- c = array$6(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);
38620
+ c = array$5(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);
38570
38621
  return ctx.fn[k] || (ctx.fn[k] = compare$2(c, _.$order, ctx.expr.codegen));
38571
38622
  }
38572
38623
 
@@ -38934,7 +38985,7 @@ function dataref(view, name) {
38934
38985
  }
38935
38986
  return data[name];
38936
38987
  }
38937
- function data$1(name, values) {
38988
+ function data(name, values) {
38938
38989
  return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));
38939
38990
  }
38940
38991
  function change(name, changes) {
@@ -39087,7 +39138,7 @@ function initializeEventConfig(config) {
39087
39138
  function trackEventListener(view, sources, type, handler) {
39088
39139
  view._eventListeners.push({
39089
39140
  type: type,
39090
- sources: array$6(sources),
39141
+ sources: array$5(sources),
39091
39142
  handler: handler
39092
39143
  });
39093
39144
  }
@@ -39332,7 +39383,7 @@ function generate$1(bind, el, param, view) {
39332
39383
  input = radio;
39333
39384
  break;
39334
39385
  case 'range':
39335
- input = range$3;
39386
+ input = range$2;
39336
39387
  break;
39337
39388
  }
39338
39389
  input(bind, wrapper, param, value);
@@ -39438,7 +39489,7 @@ function radio(bind, el, param, value) {
39438
39489
  /**
39439
39490
  * Generates a slider input element.
39440
39491
  */
39441
- function range$3(bind, el, param, value) {
39492
+ function range$2(bind, el, param, value) {
39442
39493
  value = value !== undefined ? value : (+param.max + +param.min) / 2;
39443
39494
  const max = param.max != null ? param.max : Math.max(100, +value) || 100,
39444
39495
  min = param.min || Math.min(0, max, +value) || 0,
@@ -39635,10 +39686,10 @@ async function renderToSVG (scaleFactor) {
39635
39686
  }
39636
39687
 
39637
39688
  function runtime (view, spec, expr) {
39638
- return context(view, transforms, functionContext$1, expr).parse(spec);
39689
+ return context(view, transforms, functionContext, expr).parse(spec);
39639
39690
  }
39640
39691
 
39641
- function scale$2(name) {
39692
+ function scale$1(name) {
39642
39693
  var scales = this._runtime.scales;
39643
39694
  if (!has$1(scales, name)) {
39644
39695
  error$1('Unrecognized scale or projection: ' + name);
@@ -40136,12 +40187,12 @@ inherits(View$1, Dataflow, {
40136
40187
  finalize,
40137
40188
  hover,
40138
40189
  // -- DATA ----
40139
- data: data$1,
40190
+ data,
40140
40191
  change,
40141
40192
  insert,
40142
40193
  remove,
40143
40194
  // -- SCALES --
40144
- scale: scale$2,
40195
+ scale: scale$1,
40145
40196
  // -- INITIALIZATION ----
40146
40197
  initialize,
40147
40198
  // -- HEADLESS RENDERING ----
@@ -40155,783 +40206,6 @@ inherits(View$1, Dataflow, {
40155
40206
  _watchPixelRatio: watchPixelRatio
40156
40207
  });
40157
40208
 
40158
- function data(name) {
40159
- const data = this.context.data[name];
40160
- return data ? data.values.value : [];
40161
- }
40162
- function indata(name, field, value) {
40163
- const index = this.context.data[name]['index:' + field],
40164
- entry = index ? index.value.get(value) : undefined;
40165
- return entry ? entry.count : entry;
40166
- }
40167
- function setdata(name, tuples) {
40168
- const df = this.context.dataflow,
40169
- data = this.context.data[name],
40170
- input = data.input;
40171
- df.pulse(input, df.changeset().remove(truthy).insert(tuples));
40172
- return 1;
40173
- }
40174
-
40175
- function encode (item, name, retval) {
40176
- if (item) {
40177
- const df = this.context.dataflow,
40178
- target = item.mark.source;
40179
- df.pulse(target, df.changeset().encode(item, name));
40180
- }
40181
- return retval !== undefined ? retval : item;
40182
- }
40183
-
40184
- const wrap = method => function (value, spec) {
40185
- const locale = this.context.dataflow.locale();
40186
- return value === null ? 'null' : locale[method](spec)(value);
40187
- };
40188
- const format = wrap('format');
40189
- const timeFormat$1 = wrap('timeFormat');
40190
- const utcFormat = wrap('utcFormat');
40191
- const timeParse = wrap('timeParse');
40192
- const utcParse = wrap('utcParse');
40193
- const dateObj = new Date(2000, 0, 1);
40194
- function time(month, day, specifier) {
40195
- if (!Number.isInteger(month) || !Number.isInteger(day)) return '';
40196
- dateObj.setYear(2000);
40197
- dateObj.setMonth(month);
40198
- dateObj.setDate(day);
40199
- return timeFormat$1.call(this, dateObj, specifier);
40200
- }
40201
- function monthFormat(month) {
40202
- return time.call(this, month, 1, '%B');
40203
- }
40204
- function monthAbbrevFormat(month) {
40205
- return time.call(this, month, 1, '%b');
40206
- }
40207
- function dayFormat(day) {
40208
- return time.call(this, 0, 2 + day, '%A');
40209
- }
40210
- function dayAbbrevFormat(day) {
40211
- return time.call(this, 0, 2 + day, '%a');
40212
- }
40213
-
40214
- const DataPrefix = ':';
40215
- const IndexPrefix = '@';
40216
- const ScalePrefix = '%';
40217
- const SignalPrefix = '$';
40218
-
40219
- function dataVisitor(name, args, scope, params) {
40220
- if (args[0].type !== Literal) {
40221
- error$1('First argument to data functions must be a string literal.');
40222
- }
40223
- const data = args[0].value,
40224
- dataName = DataPrefix + data;
40225
- if (!has$1(dataName, params)) {
40226
- try {
40227
- params[dataName] = scope.getData(data).tuplesRef();
40228
- } catch (err) {
40229
- // if data set does not exist, there's nothing to track
40230
- }
40231
- }
40232
- }
40233
- function indataVisitor(name, args, scope, params) {
40234
- if (args[0].type !== Literal) error$1('First argument to indata must be a string literal.');
40235
- if (args[1].type !== Literal) error$1('Second argument to indata must be a string literal.');
40236
- const data = args[0].value,
40237
- field = args[1].value,
40238
- indexName = IndexPrefix + field;
40239
- if (!has$1(indexName, params)) {
40240
- params[indexName] = scope.getData(data).indataRef(scope, field);
40241
- }
40242
- }
40243
- function scaleVisitor(name, args, scope, params) {
40244
- if (args[0].type === Literal) {
40245
- // add scale dependency
40246
- addScaleDependency(scope, params, args[0].value);
40247
- } else {
40248
- // indirect scale lookup; add all scales as parameters
40249
- for (name in scope.scales) {
40250
- addScaleDependency(scope, params, name);
40251
- }
40252
- }
40253
- }
40254
- function addScaleDependency(scope, params, name) {
40255
- const scaleName = ScalePrefix + name;
40256
- if (!has$1(params, scaleName)) {
40257
- try {
40258
- params[scaleName] = scope.scaleRef(name);
40259
- } catch (err) {
40260
- // TODO: error handling? warning?
40261
- }
40262
- }
40263
- }
40264
-
40265
- /**
40266
- * Name must be a string. Return undefined if the scale is not registered.
40267
- */
40268
- function getScale(name, ctx) {
40269
- if (isString(name)) {
40270
- const maybeScale = ctx.scales[name];
40271
- return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;
40272
- }
40273
- return undefined;
40274
- }
40275
- function internalScaleFunctions(codegen, fnctx, visitors) {
40276
- // add helper method to the 'this' expression function context
40277
- fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;
40278
-
40279
- // register AST visitors for internal scale functions
40280
- visitors._bandwidth = scaleVisitor;
40281
- visitors._range = scaleVisitor;
40282
- visitors._scale = scaleVisitor;
40283
-
40284
- // resolve scale reference directly to the signal hash argument
40285
- const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix + arg.value) : $(ScalePrefix) + '+' + codegen(arg)) + ']';
40286
-
40287
- // define and return internal scale function code generators
40288
- // these internal functions are called by mark encoders
40289
- return {
40290
- _bandwidth: args => `this.__bandwidth(${ref(args[0])})`,
40291
- _range: args => `${ref(args[0])}.range()`,
40292
- _scale: args => `${ref(args[0])}(${codegen(args[1])})`
40293
- };
40294
- }
40295
-
40296
- function geoMethod(methodName, globalMethod) {
40297
- return function (projection, geojson, group) {
40298
- if (projection) {
40299
- // projection defined, use it
40300
- const p = getScale(projection, (group || this).context);
40301
- return p && p.path[methodName](geojson);
40302
- } else {
40303
- // projection undefined, use global method
40304
- return globalMethod(geojson);
40305
- }
40306
- };
40307
- }
40308
- const geoArea = geoMethod('area', geoArea$1$1);
40309
- const geoBounds = geoMethod('bounds', geoBounds$1$1);
40310
- const geoCentroid = geoMethod('centroid', geoCentroid$1$1);
40311
- function geoScale(projection, group) {
40312
- const p = getScale(projection, (group || this).context);
40313
- return p && p.scale();
40314
- }
40315
-
40316
- function inScope (item) {
40317
- const group = this.context.group;
40318
- let value = false;
40319
- if (group) while (item) {
40320
- if (item === group) {
40321
- value = true;
40322
- break;
40323
- }
40324
- item = item.mark.group;
40325
- }
40326
- return value;
40327
- }
40328
-
40329
- function log(df, method, args) {
40330
- try {
40331
- df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));
40332
- } catch (err) {
40333
- df.warn(err);
40334
- }
40335
- return args[args.length - 1];
40336
- }
40337
- function warn$1() {
40338
- return log(this.context.dataflow, 'warn', arguments);
40339
- }
40340
- function info() {
40341
- return log(this.context.dataflow, 'info', arguments);
40342
- }
40343
- function debug$1() {
40344
- return log(this.context.dataflow, 'debug', arguments);
40345
- }
40346
-
40347
- // https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
40348
- function channel_luminance_value(channelValue) {
40349
- const val = channelValue / 255;
40350
- if (val <= 0.03928) {
40351
- return val / 12.92;
40352
- }
40353
- return Math.pow((val + 0.055) / 1.055, 2.4);
40354
- }
40355
- function luminance(color) {
40356
- const c = rgb$1(color),
40357
- r = channel_luminance_value(c.r),
40358
- g = channel_luminance_value(c.g),
40359
- b = channel_luminance_value(c.b);
40360
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
40361
- }
40362
-
40363
- // https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
40364
- function contrast(color1, color2) {
40365
- const lum1 = luminance(color1),
40366
- lum2 = luminance(color2),
40367
- lumL = Math.max(lum1, lum2),
40368
- lumD = Math.min(lum1, lum2);
40369
- return (lumL + 0.05) / (lumD + 0.05);
40370
- }
40371
-
40372
- function merge () {
40373
- const args = [].slice.call(arguments);
40374
- args.unshift({});
40375
- return extend$1(...args);
40376
- }
40377
-
40378
- function equal(a, b) {
40379
- return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray(a, b) : false : isObject(a) && isObject(b) ? equalObject(a, b) : false;
40380
- }
40381
- function equalArray(a, b) {
40382
- for (let i = 0, n = a.length; i < n; ++i) {
40383
- if (!equal(a[i], b[i])) return false;
40384
- }
40385
- return true;
40386
- }
40387
- function equalObject(a, b) {
40388
- for (const key in a) {
40389
- if (!equal(a[key], b[key])) return false;
40390
- }
40391
- return true;
40392
- }
40393
- function removePredicate(props) {
40394
- return _ => equalObject(props, _);
40395
- }
40396
- function modify (name, insert, remove, toggle, modify, values) {
40397
- const df = this.context.dataflow,
40398
- data = this.context.data[name],
40399
- input = data.input,
40400
- stamp = df.stamp();
40401
- let changes = data.changes,
40402
- predicate,
40403
- key;
40404
- if (df._trigger === false || !(input.value.length || insert || toggle)) {
40405
- // nothing to do!
40406
- return 0;
40407
- }
40408
- if (!changes || changes.stamp < stamp) {
40409
- data.changes = changes = df.changeset();
40410
- changes.stamp = stamp;
40411
- df.runAfter(() => {
40412
- data.modified = true;
40413
- df.pulse(input, changes).run();
40414
- }, true, 1);
40415
- }
40416
- if (remove) {
40417
- predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);
40418
- changes.remove(predicate);
40419
- }
40420
- if (insert) {
40421
- changes.insert(insert);
40422
- }
40423
- if (toggle) {
40424
- predicate = removePredicate(toggle);
40425
- if (input.value.some(predicate)) {
40426
- changes.remove(predicate);
40427
- } else {
40428
- changes.insert(toggle);
40429
- }
40430
- }
40431
- if (modify) {
40432
- for (key in values) {
40433
- changes.modify(modify, key, values[key]);
40434
- }
40435
- }
40436
- return 1;
40437
- }
40438
-
40439
- function pinchDistance(event) {
40440
- const t = event.touches,
40441
- dx = t[0].clientX - t[1].clientX,
40442
- dy = t[0].clientY - t[1].clientY;
40443
- return Math.hypot(dx, dy);
40444
- }
40445
- function pinchAngle(event) {
40446
- const t = event.touches;
40447
- return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);
40448
- }
40449
-
40450
- // memoize accessor functions
40451
- const accessors = {};
40452
- function pluck (data, name) {
40453
- const accessor = accessors[name] || (accessors[name] = field$1(name));
40454
- return isArray(data) ? data.map(accessor) : accessor(data);
40455
- }
40456
-
40457
- function array(seq) {
40458
- return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;
40459
- }
40460
- function sequence(seq) {
40461
- return array(seq) || (isString(seq) ? seq : null);
40462
- }
40463
- function join(seq) {
40464
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
40465
- args[_key - 1] = arguments[_key];
40466
- }
40467
- return array(seq).join(...args);
40468
- }
40469
- function indexof(seq) {
40470
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
40471
- args[_key2 - 1] = arguments[_key2];
40472
- }
40473
- return sequence(seq).indexOf(...args);
40474
- }
40475
- function lastindexof(seq) {
40476
- for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
40477
- args[_key3 - 1] = arguments[_key3];
40478
- }
40479
- return sequence(seq).lastIndexOf(...args);
40480
- }
40481
- function slice$1(seq) {
40482
- for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
40483
- args[_key4 - 1] = arguments[_key4];
40484
- }
40485
- return sequence(seq).slice(...args);
40486
- }
40487
- function replace(str, pattern, repl) {
40488
- if (isFunction(repl)) error$1('Function argument passed to replace.');
40489
- return String(str).replace(pattern, repl);
40490
- }
40491
- function reverse$1(seq) {
40492
- return array(seq).slice().reverse();
40493
- }
40494
- function sort(seq) {
40495
- return array(seq).slice().sort(ascending$2);
40496
- }
40497
-
40498
- function bandspace(count, paddingInner, paddingOuter) {
40499
- return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);
40500
- }
40501
- function bandwidth(name, group) {
40502
- const s = getScale(name, (group || this).context);
40503
- return s && s.bandwidth ? s.bandwidth() : 0;
40504
- }
40505
- function copy(name, group) {
40506
- const s = getScale(name, (group || this).context);
40507
- return s ? s.copy() : undefined;
40508
- }
40509
- function domain$2(name, group) {
40510
- const s = getScale(name, (group || this).context);
40511
- return s ? s.domain() : [];
40512
- }
40513
- function invert(name, range, group) {
40514
- const s = getScale(name, (group || this).context);
40515
- return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);
40516
- }
40517
- function range$2(name, group) {
40518
- const s = getScale(name, (group || this).context);
40519
- return s && s.range ? s.range() : [];
40520
- }
40521
- function scale$1(name, value, group) {
40522
- const s = getScale(name, (group || this).context);
40523
- return s ? s(value) : undefined;
40524
- }
40525
-
40526
- /**
40527
- * Passing a function is only used for for testing.
40528
- * Outside of tests, the first argument should be a string.
40529
- */
40530
- function scaleGradient (scaleOrFunction, p0, p1, count, group) {
40531
- let scale = typeof scaleOrFunction === 'string' ? getScale(scaleOrFunction, (group || this).context) : scaleOrFunction;
40532
- const gradient = Gradient$1(p0, p1);
40533
- let stops = scale.domain(),
40534
- min = stops[0],
40535
- max = peek$1(stops),
40536
- fraction = identity$7;
40537
- if (!(max - min)) {
40538
- // expand scale if domain has zero span, fix #1479
40539
- scale = (scale.interpolator ? scale$5('sequential')().interpolator(scale.interpolator()) : scale$5('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);
40540
- } else {
40541
- fraction = scaleFraction(scale, min, max);
40542
- }
40543
- if (scale.ticks) {
40544
- stops = scale.ticks(+count || 15);
40545
- if (min !== stops[0]) stops.unshift(min);
40546
- if (max !== peek$1(stops)) stops.push(max);
40547
- }
40548
- stops.forEach(_ => gradient.stop(fraction(_), scale(_)));
40549
- return gradient;
40550
- }
40551
-
40552
- function geoShape(projection, geojson, group) {
40553
- const p = getScale(projection, (group || this).context);
40554
- return function (context) {
40555
- return p ? p.path.context(context)(geojson) : '';
40556
- };
40557
- }
40558
- function pathShape(path) {
40559
- let p = null;
40560
- return function (context) {
40561
- return context ? pathRender(context, p = p || parse$3(path)) : path;
40562
- };
40563
- }
40564
-
40565
- const datum = d => d.data;
40566
- function treeNodes(name, context) {
40567
- const tree = data.call(context, name);
40568
- return tree.root && tree.root.lookup || {};
40569
- }
40570
- function treePath(name, source, target) {
40571
- const nodes = treeNodes(name, this),
40572
- s = nodes[source],
40573
- t = nodes[target];
40574
- return s && t ? s.path(t).map(datum) : undefined;
40575
- }
40576
- function treeAncestors(name, node) {
40577
- const n = treeNodes(name, this)[node];
40578
- return n ? n.ancestors().map(datum) : undefined;
40579
- }
40580
-
40581
- const _window = () => typeof window !== 'undefined' && window || null;
40582
- function screen() {
40583
- const w = _window();
40584
- return w ? w.screen : {};
40585
- }
40586
- function windowSize() {
40587
- const w = _window();
40588
- return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];
40589
- }
40590
- function containerSize() {
40591
- const view = this.context.dataflow,
40592
- el = view.container && view.container();
40593
- return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];
40594
- }
40595
-
40596
- function intersect (b, opt, group) {
40597
- if (!b) return [];
40598
- const [u, v] = b,
40599
- box = new Bounds().set(u[0], u[1], v[0], v[1]),
40600
- scene = group || this.context.dataflow.scenegraph().root;
40601
- return intersect$3(scene, box, filter(opt));
40602
- }
40603
- function filter(opt) {
40604
- let p = null;
40605
- if (opt) {
40606
- const types = array$6(opt.marktype),
40607
- names = array$6(opt.markname);
40608
- p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));
40609
- }
40610
- return p;
40611
- }
40612
-
40613
- /**
40614
- * Appends a new point to the lasso
40615
- *
40616
- * @param {*} lasso the lasso in pixel space
40617
- * @param {*} x the x coordinate in pixel space
40618
- * @param {*} y the y coordinate in pixel space
40619
- * @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point
40620
- * @returns a new array containing the lasso with the new point
40621
- */
40622
- function lassoAppend(lasso, x, y) {
40623
- let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
40624
- lasso = array$6(lasso);
40625
- const last = lasso[lasso.length - 1];
40626
-
40627
- // Add point to lasso if its the first point or distance to last point exceed minDist
40628
- return last === undefined || Math.hypot(last[0] - x, last[1] - y) > minDist ? [...lasso, [x, y]] : lasso;
40629
- }
40630
-
40631
- /**
40632
- * Generates a svg path command which draws a lasso
40633
- *
40634
- * @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]
40635
- * @returns the svg path command that draws the lasso
40636
- */
40637
- function lassoPath(lasso) {
40638
- return array$6(lasso).reduce((svg, _ref, i) => {
40639
- let [x, y] = _ref;
40640
- return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;
40641
- }, '');
40642
- }
40643
-
40644
- /**
40645
- * Inverts the lasso from pixel space to an array of vega scenegraph tuples
40646
- *
40647
- * @param {*} data the dataset
40648
- * @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]
40649
- * @param {*} unit the unit where the lasso is defined
40650
- *
40651
- * @returns an array of vega scenegraph tuples
40652
- */
40653
- function intersectLasso(markname, pixelLasso, unit) {
40654
- const {
40655
- x,
40656
- y,
40657
- mark
40658
- } = unit;
40659
- const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
40660
-
40661
- // Get bounding box around lasso
40662
- for (const [px, py] of pixelLasso) {
40663
- if (px < bb.x1) bb.x1 = px;
40664
- if (px > bb.x2) bb.x2 = px;
40665
- if (py < bb.y1) bb.y1 = py;
40666
- if (py > bb.y2) bb.y2 = py;
40667
- }
40668
-
40669
- // Translate bb against unit coordinates
40670
- bb.translate(x, y);
40671
- const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);
40672
-
40673
- // Check every point against the lasso
40674
- return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));
40675
- }
40676
-
40677
- /**
40678
- * Performs a test if a point is inside a polygon based on the idea from
40679
- * https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html
40680
- *
40681
- * This method will not need the same start/end point since it wraps around the edges of the array
40682
- *
40683
- * @param {*} test a point to test against
40684
- * @param {*} polygon a polygon in the form [[x,y], [x,y], ...]
40685
- * @returns true if the point lies inside the polygon, false otherwise
40686
- */
40687
- function pointInPolygon(testx, testy, polygon) {
40688
- let intersections = 0;
40689
- for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
40690
- const [prevX, prevY] = polygon[j];
40691
- const [x, y] = polygon[i];
40692
-
40693
- // count intersections
40694
- if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {
40695
- intersections++;
40696
- }
40697
- }
40698
-
40699
- // point is in polygon if intersection count is odd
40700
- return intersections & 1;
40701
- }
40702
-
40703
- // Expression function context object
40704
- const functionContext = {
40705
- random() {
40706
- return random();
40707
- },
40708
- // override default
40709
- cumulativeNormal,
40710
- cumulativeLogNormal,
40711
- cumulativeUniform,
40712
- densityNormal,
40713
- densityLogNormal,
40714
- densityUniform,
40715
- quantileNormal,
40716
- quantileLogNormal,
40717
- quantileUniform,
40718
- sampleNormal,
40719
- sampleLogNormal,
40720
- sampleUniform,
40721
- isArray,
40722
- isBoolean: isBoolean$2,
40723
- isDate: isDate$1,
40724
- isDefined(_) {
40725
- return _ !== undefined;
40726
- },
40727
- isNumber: isNumber$1,
40728
- isObject,
40729
- isRegExp,
40730
- isString,
40731
- isTuple,
40732
- isValid(_) {
40733
- return _ != null && _ === _;
40734
- },
40735
- toBoolean,
40736
- toDate(_) {
40737
- return toDate(_);
40738
- },
40739
- // suppress extra arguments
40740
- toNumber,
40741
- toString,
40742
- indexof,
40743
- join,
40744
- lastindexof,
40745
- replace,
40746
- reverse: reverse$1,
40747
- sort,
40748
- slice: slice$1,
40749
- flush,
40750
- lerp,
40751
- merge,
40752
- pad: pad$3,
40753
- peek: peek$1,
40754
- pluck,
40755
- span,
40756
- inrange,
40757
- truncate: truncate$1,
40758
- rgb: rgb$1,
40759
- lab: lab$1,
40760
- hcl: hcl$2,
40761
- hsl: hsl$2,
40762
- luminance,
40763
- contrast,
40764
- sequence: range$6,
40765
- format,
40766
- utcFormat,
40767
- utcParse,
40768
- utcOffset,
40769
- utcSequence,
40770
- timeFormat: timeFormat$1,
40771
- timeParse,
40772
- timeOffset,
40773
- timeSequence,
40774
- timeUnitSpecifier,
40775
- monthFormat,
40776
- monthAbbrevFormat,
40777
- dayFormat,
40778
- dayAbbrevFormat,
40779
- quarter,
40780
- utcquarter,
40781
- week,
40782
- utcweek,
40783
- dayofyear,
40784
- utcdayofyear,
40785
- warn: warn$1,
40786
- info,
40787
- debug: debug$1,
40788
- extent(_) {
40789
- return extent(_);
40790
- },
40791
- // suppress extra arguments
40792
- inScope,
40793
- intersect,
40794
- clampRange,
40795
- pinchDistance,
40796
- pinchAngle,
40797
- screen,
40798
- containerSize,
40799
- windowSize,
40800
- bandspace,
40801
- setdata,
40802
- pathShape,
40803
- panLinear,
40804
- panLog,
40805
- panPow,
40806
- panSymlog,
40807
- zoomLinear,
40808
- zoomLog,
40809
- zoomPow,
40810
- zoomSymlog,
40811
- encode,
40812
- modify,
40813
- lassoAppend,
40814
- lassoPath,
40815
- intersectLasso
40816
- };
40817
- const eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],
40818
- // event functions
40819
- eventPrefix = 'event.vega.',
40820
- // event function prefix
40821
- thisPrefix = 'this.',
40822
- // function context prefix
40823
- astVisitors = {}; // AST visitors for dependency analysis
40824
-
40825
- // export code generator parameters
40826
- const codegenParams = {
40827
- forbidden: ['_'],
40828
- allowed: ['datum', 'event', 'item'],
40829
- fieldvar: 'datum',
40830
- globalvar: id => `_[${$(SignalPrefix + id)}]`,
40831
- functions: buildFunctions,
40832
- constants: Constants$1,
40833
- visitors: astVisitors
40834
- };
40835
-
40836
- // export code generator
40837
- const codeGenerator = codegen(codegenParams);
40838
-
40839
- // Build expression function registry
40840
- function buildFunctions(codegen) {
40841
- const fn = Functions$1(codegen);
40842
- eventFunctions.forEach(name => fn[name] = eventPrefix + name);
40843
- for (const name in functionContext) {
40844
- fn[name] = thisPrefix + name;
40845
- }
40846
- extend$1(fn, internalScaleFunctions(codegen, functionContext, astVisitors));
40847
- return fn;
40848
- }
40849
-
40850
- // Register an expression function
40851
- function expressionFunction(name, fn, visitor) {
40852
- if (arguments.length === 1) {
40853
- return functionContext[name];
40854
- }
40855
-
40856
- // register with the functionContext
40857
- functionContext[name] = fn;
40858
-
40859
- // if there is an astVisitor register that, too
40860
- if (visitor) astVisitors[name] = visitor;
40861
-
40862
- // if the code generator has already been initialized,
40863
- // we need to also register the function with it
40864
- if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;
40865
- return this;
40866
- }
40867
-
40868
- // register expression functions with ast visitors
40869
- expressionFunction('bandwidth', bandwidth, scaleVisitor);
40870
- expressionFunction('copy', copy, scaleVisitor);
40871
- expressionFunction('domain', domain$2, scaleVisitor);
40872
- expressionFunction('range', range$2, scaleVisitor);
40873
- expressionFunction('invert', invert, scaleVisitor);
40874
- expressionFunction('scale', scale$1, scaleVisitor);
40875
- expressionFunction('gradient', scaleGradient, scaleVisitor);
40876
- expressionFunction('geoArea', geoArea, scaleVisitor);
40877
- expressionFunction('geoBounds', geoBounds, scaleVisitor);
40878
- expressionFunction('geoCentroid', geoCentroid, scaleVisitor);
40879
- expressionFunction('geoShape', geoShape, scaleVisitor);
40880
- expressionFunction('geoScale', geoScale, scaleVisitor);
40881
- expressionFunction('indata', indata, indataVisitor);
40882
- expressionFunction('data', data, dataVisitor);
40883
- expressionFunction('treePath', treePath, dataVisitor);
40884
- expressionFunction('treeAncestors', treeAncestors, dataVisitor);
40885
-
40886
- // register Vega-Lite selection functions
40887
- expressionFunction('vlSelectionTest', selectionTest, selectionVisitor);
40888
- expressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);
40889
- expressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);
40890
- expressionFunction('vlSelectionTuples', selectionTuples);
40891
-
40892
- function parser (expr, scope) {
40893
- const params = {};
40894
-
40895
- // parse the expression to an abstract syntax tree (ast)
40896
- let ast;
40897
- try {
40898
- expr = isString(expr) ? expr : $(expr) + '';
40899
- ast = parser$1(expr);
40900
- } catch (err) {
40901
- error$1('Expression parse error: ' + expr);
40902
- }
40903
-
40904
- // analyze ast function calls for dependencies
40905
- ast.visit(node => {
40906
- if (node.type !== CallExpression) return;
40907
- const name = node.callee.name,
40908
- visit = codegenParams.visitors[name];
40909
- if (visit) visit(name, node.arguments, scope, params);
40910
- });
40911
-
40912
- // perform code generation
40913
- const gen = codeGenerator(ast);
40914
-
40915
- // collect signal dependencies
40916
- gen.globals.forEach(name => {
40917
- const signalName = SignalPrefix + name;
40918
- if (!has$1(params, signalName) && scope.getSignal(name)) {
40919
- params[signalName] = scope.signalRef(name);
40920
- }
40921
- });
40922
-
40923
- // return generated expression code and dependencies
40924
- return {
40925
- $expr: extend$1({
40926
- code: gen.code
40927
- }, scope.options.ast ? {
40928
- ast
40929
- } : null),
40930
- $fields: gen.fields,
40931
- $params: params
40932
- };
40933
- }
40934
-
40935
40209
  const VIEW = 'view',
40936
40210
  LBRACK = '[',
40937
40211
  RBRACK = ']',
@@ -41227,7 +40501,7 @@ function applyDefaults (encode, type, role, style, config) {
41227
40501
  }
41228
40502
 
41229
40503
  // resolve styles, apply with increasing precedence
41230
- array$6(style).forEach(name => {
40504
+ array$5(style).forEach(name => {
41231
40505
  const props = config.style && config.style[name];
41232
40506
  for (const key in props) {
41233
40507
  if (!has(key, encode)) {
@@ -41609,7 +40883,7 @@ function parseUpdate (spec, scope, target) {
41609
40883
  }
41610
40884
 
41611
40885
  // separate event streams from signal updates
41612
- events = array$6(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);
40886
+ events = array$5(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);
41613
40887
 
41614
40888
  // merge internal operator listeners
41615
40889
  if (sources.length > 1) {
@@ -42733,7 +42007,7 @@ function parseData$1 (from, group, scope) {
42733
42007
  if (!from.data) {
42734
42008
  op = parseTransform(extend$1({
42735
42009
  type: 'aggregate',
42736
- groupby: array$6(facet.groupby)
42010
+ groupby: array$5(facet.groupby)
42737
42011
  }, facet.aggregate), scope);
42738
42012
  op.params.key = scope.keyRef(facet.groupby);
42739
42013
  op.params.pulse = getDataRef(facet, scope);
@@ -43503,7 +42777,7 @@ function analyze(data, scope, ops) {
43503
42777
  }
43504
42778
  } else if (data.source) {
43505
42779
  // derives from one or more other data sets
43506
- source = upstream = array$6(data.source).map(d => ref(scope.getData(d).output));
42780
+ source = upstream = array$5(data.source).map(d => ref(scope.getData(d).output));
43507
42781
  output.push(null); // populate later
43508
42782
  }
43509
42783
 
@@ -44138,20 +43412,20 @@ function buildAxisEncode(_, spec) {
44138
43412
  }
44139
43413
 
44140
43414
  function parseScope (spec, scope, preprocessed) {
44141
- const signals = array$6(spec.signals),
44142
- scales = array$6(spec.scales);
43415
+ const signals = array$5(spec.signals),
43416
+ scales = array$5(spec.scales);
44143
43417
 
44144
43418
  // parse signal definitions, if not already preprocessed
44145
43419
  if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));
44146
43420
 
44147
43421
  // parse cartographic projection definitions
44148
- array$6(spec.projections).forEach(_ => parseProjection$1(_, scope));
43422
+ array$5(spec.projections).forEach(_ => parseProjection$1(_, scope));
44149
43423
 
44150
43424
  // initialize scale references
44151
43425
  scales.forEach(_ => initScale(_, scope));
44152
43426
 
44153
43427
  // parse data sources
44154
- array$6(spec.data).forEach(_ => parseData$2(_, scope));
43428
+ array$5(spec.data).forEach(_ => parseData$2(_, scope));
44155
43429
 
44156
43430
  // parse scale definitions
44157
43431
  scales.forEach(_ => parseScale(_, scope));
@@ -44160,13 +43434,13 @@ function parseScope (spec, scope, preprocessed) {
44160
43434
  (preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));
44161
43435
 
44162
43436
  // parse axis definitions
44163
- array$6(spec.axes).forEach(_ => parseAxis$1(_, scope));
43437
+ array$5(spec.axes).forEach(_ => parseAxis$1(_, scope));
44164
43438
 
44165
43439
  // parse mark definitions
44166
- array$6(spec.marks).forEach(_ => parseMark(_, scope));
43440
+ array$5(spec.marks).forEach(_ => parseMark(_, scope));
44167
43441
 
44168
43442
  // parse legend definitions
44169
- array$6(spec.legends).forEach(_ => parseLegend$1(_, scope));
43443
+ array$5(spec.legends).forEach(_ => parseLegend$1(_, scope));
44170
43444
 
44171
43445
  // parse title, if defined
44172
43446
  if (spec.title) parseTitle(spec.title, scope);
@@ -44280,7 +43554,7 @@ function collectSignals(spec, config) {
44280
43554
  map = {};
44281
43555
 
44282
43556
  // add spec signal array
44283
- array$6(spec.signals).forEach(s => {
43557
+ array$5(spec.signals).forEach(s => {
44284
43558
  if (has$1(pre, s.name)) {
44285
43559
  // merge if built-in signal
44286
43560
  s = extend$1(pre[s.name], s);
@@ -44292,7 +43566,7 @@ function collectSignals(spec, config) {
44292
43566
  });
44293
43567
 
44294
43568
  // add config signal array
44295
- array$6(config.signals).forEach(s => {
43569
+ array$5(config.signals).forEach(s => {
44296
43570
  if (!has$1(map, s.name) && !has$1(pre, s.name)) {
44297
43571
  // add to signal list if not already defined
44298
43572
  signals.push(s);
@@ -44484,8 +43758,8 @@ Scope.prototype = Subscope.prototype = {
44484
43758
  compareRef(cmp) {
44485
43759
  let signal = false;
44486
43760
  const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;
44487
- const fields = array$6(cmp.field).map(check),
44488
- orders = array$6(cmp.order).map(check);
43761
+ const fields = array$5(cmp.field).map(check),
43762
+ orders = array$5(cmp.order).map(check);
44489
43763
  return signal ? ref(this.add(Compare({
44490
43764
  fields: fields,
44491
43765
  orders: orders
@@ -44495,7 +43769,7 @@ Scope.prototype = Subscope.prototype = {
44495
43769
  let signal = false;
44496
43770
  const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;
44497
43771
  const sig = this.signals;
44498
- fields = array$6(fields).map(check);
43772
+ fields = array$5(fields).map(check);
44499
43773
  return signal ? ref(this.add(Key({
44500
43774
  fields: fields,
44501
43775
  flat: flat
@@ -44897,11 +44171,11 @@ function parse (spec, config, options) {
44897
44171
  return parseView(spec, new Scope(config, options)).toRuntime();
44898
44172
  }
44899
44173
 
44900
- var version$4 = "5.30.0";
44174
+ var version$4 = "5.31.0";
44901
44175
 
44902
44176
  // -- Transforms -----
44903
44177
 
44904
- extend$1(transforms, tx, vtx, encode$2, geo, force, label, tree, reg, voronoi, wordcloud, xf);
44178
+ extend$1(transforms, tx, vtx, encode$1, geo, force, label, tree, reg, voronoi, wordcloud, xf);
44905
44179
 
44906
44180
  const vegaImport = /*#__PURE__*/Object.freeze({
44907
44181
  __proto__: null,
@@ -44924,7 +44198,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
44924
44198
  interpolateColors: interpolateColors,
44925
44199
  interpolateRange: interpolateRange$1,
44926
44200
  quantizeInterpolator: quantizeInterpolator,
44927
- scale: scale$5,
44201
+ scale: scale$4,
44928
44202
  scheme: scheme$1,
44929
44203
  projection: projection,
44930
44204
  View: View$1,
@@ -44933,7 +44207,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
44933
44207
  locale: locale$2,
44934
44208
  resetDefaultLocale: resetDefaultLocale,
44935
44209
  timeFormatLocale: timeFormatDefaultLocale,
44936
- expressionFunction: expressionFunction$1,
44210
+ expressionFunction: expressionFunction,
44937
44211
  parse: parse,
44938
44212
  runtimeContext: context,
44939
44213
  codegenExpression: codegen,
@@ -44947,7 +44221,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
44947
44221
  accessor: accessor,
44948
44222
  accessorFields: accessorFields,
44949
44223
  accessorName: accessorName,
44950
- array: array$6,
44224
+ array: array$5,
44951
44225
  ascending: ascending$2,
44952
44226
  clampRange: clampRange,
44953
44227
  compare: compare$2,
@@ -44979,7 +44253,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
44979
44253
  lerp: lerp,
44980
44254
  logger: logger,
44981
44255
  lruCache: lruCache,
44982
- merge: merge$4,
44256
+ merge: merge$3,
44983
44257
  mergeConfig: mergeConfig,
44984
44258
  one: one$2,
44985
44259
  pad: pad$3,
@@ -45035,7 +44309,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
45035
44309
  regressionExp: exp$1,
45036
44310
  regressionLinear: linear$2,
45037
44311
  regressionLoess: loess,
45038
- regressionLog: log$4,
44312
+ regressionLog: log$3,
45039
44313
  regressionPoly: poly,
45040
44314
  regressionPow: pow$3,
45041
44315
  regressionQuad: quad,
@@ -45071,7 +44345,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
45071
44345
  utcdayofyear: utcdayofyear,
45072
44346
  utcweek: utcweek,
45073
44347
  week: week,
45074
- format: format$4,
44348
+ format: format$3,
45075
44349
  formats: formats$1,
45076
44350
  inferType: inferType,
45077
44351
  inferTypes: inferTypes,
@@ -45109,7 +44383,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
45109
44383
  font: font$1,
45110
44384
  fontFamily: fontFamily,
45111
44385
  fontSize: fontSize,
45112
- intersect: intersect$3,
44386
+ intersect: intersect$2,
45113
44387
  intersectBoxLine: intersectBoxLine,
45114
44388
  intersectPath: intersectPath,
45115
44389
  intersectPoint: intersectPoint,
@@ -47028,7 +46302,7 @@ function getMarkStyleConfig(prop, mark, styleConfigIndex) {
47028
46302
  return getStyleConfig(prop, getStyles(mark), styleConfigIndex);
47029
46303
  }
47030
46304
  function getStyleConfig(p, styles, styleConfigIndex) {
47031
- styles = array$6(styles);
46305
+ styles = array$5(styles);
47032
46306
  let value;
47033
46307
  for (const style of styles) {
47034
46308
  const styleConfig = styleConfigIndex[style];
@@ -47042,7 +46316,7 @@ function getStyleConfig(p, styles, styleConfigIndex) {
47042
46316
  * Return Vega sort parameters (tuple of field and order).
47043
46317
  */
47044
46318
  function sortParams(orderDef, fieldRefOption) {
47045
- return array$6(orderDef).reduce((s, orderChannelDef) => {
46319
+ return array$5(orderDef).reduce((s, orderChannelDef) => {
47046
46320
  s.field.push(vgField(orderChannelDef, fieldRefOption));
47047
46321
  s.order.push(orderChannelDef.sort ?? 'ascending');
47048
46322
  return s;
@@ -47071,7 +46345,7 @@ function mergeTitle(title1, title2) {
47071
46345
  return title2;
47072
46346
  }
47073
46347
  else {
47074
- return [...array$6(title1), ...array$6(title2)].join(', ');
46348
+ return [...array$5(title1), ...array$5(title2)].join(', ');
47075
46349
  }
47076
46350
  }
47077
46351
  function mergeTitleComponent(v1, v2) {
@@ -50183,7 +49457,7 @@ function initEncoding(encoding, mark, filled, config) {
50183
49457
  }
50184
49458
  }
50185
49459
  // Array of fieldDefs for detail channel (or production rule)
50186
- normalizedEncoding[channel] = array$6(channelDef).reduce((defs, fieldDef) => {
49460
+ normalizedEncoding[channel] = array$5(channelDef).reduce((defs, fieldDef) => {
50187
49461
  if (!isFieldDef(fieldDef)) {
50188
49462
  warn(emptyFieldDef(fieldDef, channel));
50189
49463
  }
@@ -50228,7 +49502,7 @@ function fieldDefs(encoding) {
50228
49502
  for (const channel of keys(encoding)) {
50229
49503
  if (channelHasField(encoding, channel)) {
50230
49504
  const channelDef = encoding[channel];
50231
- const channelDefArray = array$6(channelDef);
49505
+ const channelDefArray = array$5(channelDef);
50232
49506
  for (const def of channelDefArray) {
50233
49507
  if (isFieldDef(def)) {
50234
49508
  arr.push(def);
@@ -50318,7 +49592,7 @@ function pathGroupingFields(mark, encoding) {
50318
49592
  case KEY: {
50319
49593
  const channelDef = encoding[channel];
50320
49594
  if (isArray(channelDef) || isFieldDef(channelDef)) {
50321
- for (const fieldDef of array$6(channelDef)) {
49595
+ for (const fieldDef of array$5(channelDef)) {
50322
49596
  if (!fieldDef.aggregate) {
50323
49597
  details.push(vgField(fieldDef, {}));
50324
49598
  }
@@ -52147,7 +51421,7 @@ function stack(m, encoding) {
52147
51421
  // Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)
52148
51422
  if (channel !== 'tooltip' && channelHasField(encoding, channel)) {
52149
51423
  const channelDef = encoding[channel];
52150
- for (const cDef of array$6(channelDef)) {
51424
+ for (const cDef of array$5(channelDef)) {
52151
51425
  const fieldDef = getFieldDef(cDef);
52152
51426
  if (fieldDef.aggregate) {
52153
51427
  continue;
@@ -53917,7 +53191,7 @@ const project = {
53917
53191
  const type = selCmpt.type;
53918
53192
  const cfg = model.config.selection[type];
53919
53193
  const init = selDef.value !== undefined
53920
- ? array$6(selDef.value)
53194
+ ? array$5(selDef.value)
53921
53195
  : null;
53922
53196
  // If no explicit projection (either fields or encodings) is specified, set some defaults.
53923
53197
  // If an initial value is set, try to infer projections.
@@ -54443,7 +53717,7 @@ const interval = {
54443
53717
  warn(`${evt} is not an ordered event stream for interval selections.`);
54444
53718
  continue;
54445
53719
  }
54446
- const filters = array$6(((_a = evt.between[0]).filter ?? (_a.filter = [])));
53720
+ const filters = array$5(((_a = evt.between[0]).filter ?? (_a.filter = [])));
54447
53721
  if (!filters.includes(filterExpr)) {
54448
53722
  filters.push(filterExpr);
54449
53723
  }
@@ -54722,7 +53996,7 @@ function wrapCondition({ model, channelDef, vgChannel, invalidValueRef, mainRefF
54722
53996
  const condition = isConditionalDef(channelDef) && channelDef.condition;
54723
53997
  let valueRefs = [];
54724
53998
  if (condition) {
54725
- const conditions = array$6(condition);
53999
+ const conditions = array$5(condition);
54726
54000
  valueRefs = conditions.map(c => {
54727
54001
  const conditionValueRef = mainRefFn(c);
54728
54002
  if (isConditionalParameter(c)) {
@@ -54840,7 +54114,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
54840
54114
  type: encoding[mainChannel].type // for secondary field def, copy type from main channel
54841
54115
  };
54842
54116
  const title = fieldDef.title || defaultTitle(fieldDef, formatConfig);
54843
- const key = array$6(title).join(', ').replaceAll(/"/g, '\\"');
54117
+ const key = array$5(title).join(', ').replaceAll(/"/g, '\\"');
54844
54118
  let value;
54845
54119
  if (isXorY(channel)) {
54846
54120
  const channel2 = channel === 'x' ? 'x2' : 'y2';
@@ -55947,14 +55221,14 @@ const legendBindings = {
55947
55221
  if (isObject(selDef.select) && (selDef.select.on || selDef.select.clear)) {
55948
55222
  const legendFilter = 'event.item && indexof(event.item.mark.role, "legend") < 0';
55949
55223
  for (const evt of selCmpt.events) {
55950
- evt.filter = array$6(evt.filter ?? []);
55224
+ evt.filter = array$5(evt.filter ?? []);
55951
55225
  if (!evt.filter.includes(legendFilter)) {
55952
55226
  evt.filter.push(legendFilter);
55953
55227
  }
55954
55228
  }
55955
55229
  }
55956
55230
  const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';
55957
- const stream = isString(evt) ? eventSelector(evt, 'view') : array$6(evt);
55231
+ const stream = isString(evt) ? eventSelector(evt, 'view') : array$5(evt);
55958
55232
  selCmpt.bind = { legend: { merge: stream } };
55959
55233
  },
55960
55234
  topLevelSignals: (model, selCmpt, signals) => {
@@ -56359,7 +55633,7 @@ function parseUnitSelection(model, selDefs) {
56359
55633
  type,
56360
55634
  init: def.value,
56361
55635
  bind: def.bind,
56362
- events: isString(defaults.on) ? eventSelector(defaults.on, 'scope') : array$6(duplicate(defaults.on))
55636
+ events: isString(defaults.on) ? eventSelector(defaults.on, 'scope') : array$5(duplicate(defaults.on))
56363
55637
  });
56364
55638
  if (isTimerSelection(selCmpt)) {
56365
55639
  nTimerSelections++;
@@ -56499,7 +55773,7 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
56499
55773
  else if (isConditionalAxisValue(propValue)) {
56500
55774
  // deal with conditional axis value
56501
55775
  const { condition, ...valueOrSignalRef } = propValue;
56502
- const conditions = array$6(condition);
55776
+ const conditions = array$5(condition);
56503
55777
  const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];
56504
55778
  if (propIndex) {
56505
55779
  const { vgProp, part } = propIndex;
@@ -56705,7 +55979,7 @@ function getAxisConfigStyle(axisConfigTypes, config) {
56705
55979
  // TODO: add special casing to add conditional value based on orient signal
56706
55980
  let style = config[configType]?.style;
56707
55981
  if (style) {
56708
- style = array$6(style);
55982
+ style = array$5(style);
56709
55983
  for (const s of style) {
56710
55984
  toMerge.push(config.style[s]);
56711
55985
  }
@@ -57544,7 +56818,7 @@ function getFirstConditionValue(channelDef) {
57544
56818
  }
57545
56819
  function getConditionValue(channelDef, reducer) {
57546
56820
  if (hasConditionalValueDef(channelDef)) {
57547
- return array$6(channelDef.condition).reduce(reducer, channelDef.value);
56821
+ return array$5(channelDef.condition).reduce(reducer, channelDef.value);
57548
56822
  }
57549
56823
  else if (isValueDef(channelDef)) {
57550
56824
  return channelDef.value;
@@ -62679,7 +61953,7 @@ class LookupNode extends DataFlowNode {
62679
61953
  return new Set([this.transform.lookup]);
62680
61954
  }
62681
61955
  producedFields() {
62682
- return new Set(this.transform.as ? array$6(this.transform.as) : this.transform.from.fields);
61956
+ return new Set(this.transform.as ? array$5(this.transform.as) : this.transform.from.fields);
62683
61957
  }
62684
61958
  hash() {
62685
61959
  return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;
@@ -62690,7 +61964,7 @@ class LookupNode extends DataFlowNode {
62690
61964
  // lookup a few fields and add create a flat output
62691
61965
  foreign = {
62692
61966
  values: this.transform.from.fields,
62693
- ...(this.transform.as ? { as: array$6(this.transform.as) } : {})
61967
+ ...(this.transform.as ? { as: array$5(this.transform.as) } : {})
62694
61968
  };
62695
61969
  }
62696
61970
  else {
@@ -65376,7 +64650,7 @@ class LayerModel extends Model {
65376
64650
  assembleGroupStyle() {
65377
64651
  const uniqueStyles = new Set();
65378
64652
  for (const child of this.children) {
65379
- for (const style of array$6(child.assembleGroupStyle())) {
64653
+ for (const style of array$5(child.assembleGroupStyle())) {
65380
64654
  uniqueStyles.add(style);
65381
64655
  }
65382
64656
  }