genesys-spark-chart-components 4.117.1 → 4.118.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.
- package/dist/cjs/{color-palette-bd94968f.js → color-palette-73729ebd.js} +3 -4
- package/dist/cjs/gux-chart-column-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-donut-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-line-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-pie-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-chart-scatter-plot-beta.cjs.entry.js +1 -1
- package/dist/cjs/gux-visualization-beta.cjs.entry.js +521 -1247
- package/dist/esm/{color-palette-2c4363f3.js → color-palette-825cfa86.js} +3 -4
- package/dist/esm/gux-chart-column-beta.entry.js +1 -1
- package/dist/esm/gux-chart-donut-beta.entry.js +1 -1
- package/dist/esm/gux-chart-line-beta.entry.js +1 -1
- package/dist/esm/gux-chart-pie-beta.entry.js +1 -1
- package/dist/esm/gux-chart-scatter-plot-beta.entry.js +1 -1
- package/dist/esm/gux-visualization-beta.entry.js +521 -1247
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
- package/dist/genesys-chart-webcomponents/{p-9737d797.entry.js → p-1ad842dd.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/p-4c66da4f.entry.js +11 -0
- package/dist/genesys-chart-webcomponents/{p-124a46e1.entry.js → p-5f45d3a9.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-52ae245e.entry.js → p-80c6c9b1.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-585ea609.entry.js → p-90667e1b.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-de4b7d31.entry.js → p-b7d71476.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-eb2043dc.js → p-c0f2d392.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +3 -4
- package/dist/genesys-chart-webcomponents/p-b73c68d1.entry.js +0 -11
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index$2 = require('./index-bb73bd35.js');
|
|
6
|
-
const colorPalette = require('./color-palette-
|
|
6
|
+
const colorPalette = require('./color-palette-73729ebd.js');
|
|
7
7
|
|
|
8
8
|
// Note: This regex matches even invalid JSON strings, but since we’re
|
|
9
9
|
// working on the output of `JSON.stringify` we know that only valid strings
|
|
@@ -318,7 +318,7 @@ function toNumber (_) {
|
|
|
318
318
|
}
|
|
319
319
|
|
|
320
320
|
const exp$2 = sign => x => sign * Math.exp(x);
|
|
321
|
-
const log$
|
|
321
|
+
const log$4 = sign => x => Math.log(sign * x);
|
|
322
322
|
const symlog$1 = c => x => Math.sign(x) * Math.log1p(Math.abs(x / c));
|
|
323
323
|
const symexp = c => x => Math.sign(x) * Math.expm1(Math.abs(x)) * c;
|
|
324
324
|
const pow$4 = exponent => x => x < 0 ? -Math.pow(-x, exponent) : Math.pow(x, exponent);
|
|
@@ -333,7 +333,7 @@ function panLinear(domain, delta) {
|
|
|
333
333
|
}
|
|
334
334
|
function panLog(domain, delta) {
|
|
335
335
|
var sign = Math.sign(domain[0]);
|
|
336
|
-
return pan(domain, delta, log$
|
|
336
|
+
return pan(domain, delta, log$4(sign), exp$2(sign));
|
|
337
337
|
}
|
|
338
338
|
function panPow(domain, delta, exponent) {
|
|
339
339
|
return pan(domain, delta, pow$4(exponent), pow$4(1 / exponent));
|
|
@@ -352,7 +352,7 @@ function zoomLinear(domain, anchor, scale) {
|
|
|
352
352
|
}
|
|
353
353
|
function zoomLog(domain, anchor, scale) {
|
|
354
354
|
const sign = Math.sign(domain[0]);
|
|
355
|
-
return zoom$2(domain, anchor, scale, log$
|
|
355
|
+
return zoom$2(domain, anchor, scale, log$4(sign), exp$2(sign));
|
|
356
356
|
}
|
|
357
357
|
function zoomPow(domain, anchor, scale, exponent) {
|
|
358
358
|
return zoom$2(domain, anchor, scale, pow$4(exponent), pow$4(1 / exponent));
|
|
@@ -368,7 +368,7 @@ function utcquarter(date) {
|
|
|
368
368
|
return 1 + ~~(new Date(date).getUTCMonth() / 3);
|
|
369
369
|
}
|
|
370
370
|
|
|
371
|
-
function array$
|
|
371
|
+
function array$5 (_) {
|
|
372
372
|
return _ != null ? isArray(_) ? _ : [_] : [];
|
|
373
373
|
}
|
|
374
374
|
|
|
@@ -399,12 +399,12 @@ function isFunction (_) {
|
|
|
399
399
|
const DESCENDING = 'descending';
|
|
400
400
|
function compare$2 (fields, orders, opt) {
|
|
401
401
|
opt = opt || {};
|
|
402
|
-
orders = array$
|
|
402
|
+
orders = array$5(orders) || [];
|
|
403
403
|
const ord = [],
|
|
404
404
|
get = [],
|
|
405
405
|
fmap = {},
|
|
406
406
|
gen = opt.comparator || comparator$1;
|
|
407
|
-
array$
|
|
407
|
+
array$5(fields).forEach((f, i) => {
|
|
408
408
|
if (f == null) return;
|
|
409
409
|
ord.push(orders[i] === DESCENDING ? -1 : 1);
|
|
410
410
|
get.push(f = isFunction(f) ? f : field$1(f, null, opt));
|
|
@@ -701,7 +701,7 @@ function isString (_) {
|
|
|
701
701
|
|
|
702
702
|
function key (fields, flat, opt) {
|
|
703
703
|
if (fields) {
|
|
704
|
-
fields = flat ? array$
|
|
704
|
+
fields = flat ? array$5(fields).map(f => f.replace(/\\(.)/g, '$1')) : array$5(fields);
|
|
705
705
|
}
|
|
706
706
|
const len = fields && fields.length,
|
|
707
707
|
gen = opt && opt.get || getter$1,
|
|
@@ -763,7 +763,7 @@ function lruCache (maxsize) {
|
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
765
|
|
|
766
|
-
function merge$
|
|
766
|
+
function merge$3 (compare, array0, array1, output) {
|
|
767
767
|
const n0 = array0.length,
|
|
768
768
|
n1 = array1.length;
|
|
769
769
|
if (!n1) return array0;
|
|
@@ -1042,7 +1042,7 @@ function transform$3(transform) {
|
|
|
1042
1042
|
};
|
|
1043
1043
|
}
|
|
1044
1044
|
|
|
1045
|
-
function reverse$
|
|
1045
|
+
function reverse$2(array, n) {
|
|
1046
1046
|
var t, j = array.length, i = j - n;
|
|
1047
1047
|
while (i < --j) t = array[i], array[i++] = array[j], array[j] = t;
|
|
1048
1048
|
}
|
|
@@ -1073,7 +1073,7 @@ function object$1(topology, o) {
|
|
|
1073
1073
|
for (var a = arcs[i < 0 ? ~i : i], k = 0, n = a.length; k < n; ++k) {
|
|
1074
1074
|
points.push(transformPoint(a[k], k));
|
|
1075
1075
|
}
|
|
1076
|
-
if (i < 0) reverse$
|
|
1076
|
+
if (i < 0) reverse$2(points, n);
|
|
1077
1077
|
}
|
|
1078
1078
|
|
|
1079
1079
|
function point(p) {
|
|
@@ -1691,11 +1691,11 @@ function* flatten(arrays) {
|
|
|
1691
1691
|
}
|
|
1692
1692
|
}
|
|
1693
1693
|
|
|
1694
|
-
function merge$
|
|
1694
|
+
function merge$2(arrays) {
|
|
1695
1695
|
return Array.from(flatten(arrays));
|
|
1696
1696
|
}
|
|
1697
1697
|
|
|
1698
|
-
function range$
|
|
1698
|
+
function range$5(start, stop, step) {
|
|
1699
1699
|
start = +start, stop = +stop, step = (n = arguments.length) < 2 ? (stop = start, start = 0, 1) : n < 3 ? 1 : +step;
|
|
1700
1700
|
|
|
1701
1701
|
var i = -1,
|
|
@@ -2054,7 +2054,7 @@ function formatLocale$3(locale) {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
|
|
2056
2056
|
var locale$4;
|
|
2057
|
-
var format$
|
|
2057
|
+
var format$4;
|
|
2058
2058
|
var formatPrefix$1;
|
|
2059
2059
|
|
|
2060
2060
|
defaultLocale$4({
|
|
@@ -2065,7 +2065,7 @@ defaultLocale$4({
|
|
|
2065
2065
|
|
|
2066
2066
|
function defaultLocale$4(definition) {
|
|
2067
2067
|
locale$4 = formatLocale$3(definition);
|
|
2068
|
-
format$
|
|
2068
|
+
format$4 = locale$4.format;
|
|
2069
2069
|
formatPrefix$1 = locale$4.formatPrefix;
|
|
2070
2070
|
return locale$4;
|
|
2071
2071
|
}
|
|
@@ -2376,7 +2376,7 @@ const MILLISECONDS = 'milliseconds';
|
|
|
2376
2376
|
const TIME_UNITS = [YEAR, QUARTER, MONTH, WEEK, DATE, DAY, DAYOFYEAR, HOURS, MINUTES, SECONDS, MILLISECONDS];
|
|
2377
2377
|
const UNITS = TIME_UNITS.reduce((o, u, i) => (o[u] = 1 + i, o), {});
|
|
2378
2378
|
function timeUnits(units) {
|
|
2379
|
-
const u = array$
|
|
2379
|
+
const u = array$5(units).slice(),
|
|
2380
2380
|
m = {};
|
|
2381
2381
|
|
|
2382
2382
|
// check validity
|
|
@@ -2614,14 +2614,14 @@ function timeOffset(unit, date, step) {
|
|
|
2614
2614
|
function utcOffset(unit, date, step) {
|
|
2615
2615
|
return offset$3(utcInterval(unit), date, step);
|
|
2616
2616
|
}
|
|
2617
|
-
function sequence$
|
|
2617
|
+
function sequence$1(ival, start, stop, step) {
|
|
2618
2618
|
return ival ? ival.range(start, stop, step) : undefined;
|
|
2619
2619
|
}
|
|
2620
2620
|
function timeSequence(unit, start, stop, step) {
|
|
2621
|
-
return sequence$
|
|
2621
|
+
return sequence$1(timeInterval$1(unit), start, stop, step);
|
|
2622
2622
|
}
|
|
2623
2623
|
function utcSequence(unit, start, stop, step) {
|
|
2624
|
-
return sequence$
|
|
2624
|
+
return sequence$1(utcInterval(unit), start, stop, step);
|
|
2625
2625
|
}
|
|
2626
2626
|
|
|
2627
2627
|
const durationSecond$1 = 1000,
|
|
@@ -3534,10 +3534,10 @@ function formatUnixTimestampSeconds$1(d) {
|
|
|
3534
3534
|
}
|
|
3535
3535
|
|
|
3536
3536
|
var locale$3;
|
|
3537
|
-
var timeFormat$
|
|
3538
|
-
var timeParse$
|
|
3539
|
-
var utcFormat$
|
|
3540
|
-
var utcParse$
|
|
3537
|
+
var timeFormat$3;
|
|
3538
|
+
var timeParse$1;
|
|
3539
|
+
var utcFormat$2;
|
|
3540
|
+
var utcParse$1;
|
|
3541
3541
|
|
|
3542
3542
|
defaultLocale$3({
|
|
3543
3543
|
dateTime: "%x, %X",
|
|
@@ -3552,10 +3552,10 @@ defaultLocale$3({
|
|
|
3552
3552
|
|
|
3553
3553
|
function defaultLocale$3(definition) {
|
|
3554
3554
|
locale$3 = formatLocale$2(definition);
|
|
3555
|
-
timeFormat$
|
|
3556
|
-
timeParse$
|
|
3557
|
-
utcFormat$
|
|
3558
|
-
utcParse$
|
|
3555
|
+
timeFormat$3 = locale$3.format;
|
|
3556
|
+
timeParse$1 = locale$3.parse;
|
|
3557
|
+
utcFormat$2 = locale$3.utcFormat;
|
|
3558
|
+
utcParse$1 = locale$3.utcParse;
|
|
3559
3559
|
return locale$3;
|
|
3560
3560
|
}
|
|
3561
3561
|
|
|
@@ -3656,7 +3656,7 @@ let defaultNumberLocale;
|
|
|
3656
3656
|
resetNumberFormatDefaultLocale();
|
|
3657
3657
|
function resetNumberFormatDefaultLocale() {
|
|
3658
3658
|
return defaultNumberLocale = numberLocale({
|
|
3659
|
-
format: format$
|
|
3659
|
+
format: format$4,
|
|
3660
3660
|
formatPrefix: formatPrefix$1
|
|
3661
3661
|
});
|
|
3662
3662
|
}
|
|
@@ -3705,10 +3705,10 @@ let defaultTimeLocale;
|
|
|
3705
3705
|
resetTimeFormatDefaultLocale();
|
|
3706
3706
|
function resetTimeFormatDefaultLocale() {
|
|
3707
3707
|
return defaultTimeLocale = timeLocale({
|
|
3708
|
-
format: timeFormat$
|
|
3709
|
-
parse: timeParse$
|
|
3710
|
-
utcFormat: utcFormat$
|
|
3711
|
-
utcParse: utcParse$
|
|
3708
|
+
format: timeFormat$3,
|
|
3709
|
+
parse: timeParse$1,
|
|
3710
|
+
utcFormat: utcFormat$2,
|
|
3711
|
+
utcParse: utcParse$1
|
|
3712
3712
|
});
|
|
3713
3713
|
}
|
|
3714
3714
|
function timeFormatLocale(definition) {
|
|
@@ -4003,7 +4003,7 @@ function topojson(data, format) {
|
|
|
4003
4003
|
}
|
|
4004
4004
|
topojson.responseType = 'json';
|
|
4005
4005
|
|
|
4006
|
-
const format$
|
|
4006
|
+
const format$3 = {
|
|
4007
4007
|
dsv: dsv,
|
|
4008
4008
|
csv: delimitedFormat(','),
|
|
4009
4009
|
tsv: delimitedFormat('\t'),
|
|
@@ -4012,10 +4012,10 @@ const format$4 = {
|
|
|
4012
4012
|
};
|
|
4013
4013
|
function formats$1(name, reader) {
|
|
4014
4014
|
if (arguments.length > 1) {
|
|
4015
|
-
format$
|
|
4015
|
+
format$3[name] = reader;
|
|
4016
4016
|
return this;
|
|
4017
4017
|
} else {
|
|
4018
|
-
return has$1(format$
|
|
4018
|
+
return has$1(format$3, name) ? format$3[name] : null;
|
|
4019
4019
|
}
|
|
4020
4020
|
}
|
|
4021
4021
|
function responseType(type) {
|
|
@@ -4192,7 +4192,7 @@ function rederive(t, d) {
|
|
|
4192
4192
|
* @param {object} d - The new tuple that replaces the old.
|
|
4193
4193
|
* @return {object} The new tuple.
|
|
4194
4194
|
*/
|
|
4195
|
-
function replace$
|
|
4195
|
+
function replace$1(t, d) {
|
|
4196
4196
|
return setid(d, tupleid(t));
|
|
4197
4197
|
}
|
|
4198
4198
|
|
|
@@ -4225,14 +4225,14 @@ function changeset() {
|
|
|
4225
4225
|
return {
|
|
4226
4226
|
constructor: changeset,
|
|
4227
4227
|
insert(t) {
|
|
4228
|
-
const d = array$
|
|
4228
|
+
const d = array$5(t),
|
|
4229
4229
|
n = d.length;
|
|
4230
4230
|
for (let i = 0; i < n; ++i) add.push(d[i]);
|
|
4231
4231
|
return this;
|
|
4232
4232
|
},
|
|
4233
4233
|
remove(t) {
|
|
4234
4234
|
const a = isFunction(t) ? remp : rem,
|
|
4235
|
-
d = array$
|
|
4235
|
+
d = array$5(t),
|
|
4236
4236
|
n = d.length;
|
|
4237
4237
|
for (let i = 0; i < n; ++i) a.push(d[i]);
|
|
4238
4238
|
return this;
|
|
@@ -4564,7 +4564,7 @@ Operator.prototype = {
|
|
|
4564
4564
|
for (name in params) {
|
|
4565
4565
|
value = params[name];
|
|
4566
4566
|
if (name === PULSE) {
|
|
4567
|
-
array$
|
|
4567
|
+
array$5(value).forEach(op => {
|
|
4568
4568
|
if (!(op instanceof Operator)) {
|
|
4569
4569
|
error$1('Pulse parameters must be operator instances.');
|
|
4570
4570
|
} else if (op !== this) {
|
|
@@ -4875,7 +4875,7 @@ function events$1 (source, type, filter, apply) {
|
|
|
4875
4875
|
if (typeof source === 'string' && typeof document !== 'undefined') {
|
|
4876
4876
|
sources = document.querySelectorAll(source);
|
|
4877
4877
|
} else {
|
|
4878
|
-
sources = array$
|
|
4878
|
+
sources = array$5(source);
|
|
4879
4879
|
}
|
|
4880
4880
|
const n = sources.length;
|
|
4881
4881
|
for (let i = 0; i < n; ++i) {
|
|
@@ -5128,7 +5128,7 @@ function materialize(data, filter) {
|
|
|
5128
5128
|
visitArray(data, filter, _ => out.push(_));
|
|
5129
5129
|
return out;
|
|
5130
5130
|
}
|
|
5131
|
-
function filter$
|
|
5131
|
+
function filter$1(pulse, flags) {
|
|
5132
5132
|
const map = {};
|
|
5133
5133
|
pulse.visit(flags, t => {
|
|
5134
5134
|
map[tupleid(t)] = 1;
|
|
@@ -5321,7 +5321,7 @@ Pulse.prototype = {
|
|
|
5321
5321
|
src = this.source && this.source.length;
|
|
5322
5322
|
if (src && src !== len) {
|
|
5323
5323
|
this.mod = this.source;
|
|
5324
|
-
if (len) this.filter(MOD$1, filter$
|
|
5324
|
+
if (len) this.filter(MOD$1, filter$1(this, ADD));
|
|
5325
5325
|
}
|
|
5326
5326
|
return this;
|
|
5327
5327
|
},
|
|
@@ -5438,7 +5438,7 @@ Pulse.prototype = {
|
|
|
5438
5438
|
if (flags & REFLOW && src) {
|
|
5439
5439
|
const sum = p.add.length + p.mod.length;
|
|
5440
5440
|
if (sum === src.length) ; else if (sum) {
|
|
5441
|
-
visitArray(src, filter$
|
|
5441
|
+
visitArray(src, filter$1(p, ADD_MOD), v);
|
|
5442
5442
|
} else {
|
|
5443
5443
|
// if no add/rem/mod tuples, visit source
|
|
5444
5444
|
visitArray(src, p.srcF, v);
|
|
@@ -6907,7 +6907,7 @@ function linear$2 (data, x, y) {
|
|
|
6907
6907
|
|
|
6908
6908
|
// Adapted from d3-regression by Harry Stevens
|
|
6909
6909
|
// License: https://github.com/HarryStevens/d3-regression/blob/master/LICENSE
|
|
6910
|
-
function log$
|
|
6910
|
+
function log$3 (data, x, y) {
|
|
6911
6911
|
let X = 0,
|
|
6912
6912
|
Y = 0,
|
|
6913
6913
|
XY = 0,
|
|
@@ -7834,7 +7834,7 @@ inherits(Aggregate$1, Transform, {
|
|
|
7834
7834
|
outputs = this._outputs = [],
|
|
7835
7835
|
inputMap = {};
|
|
7836
7836
|
function inputVisit(get) {
|
|
7837
|
-
const fields = array$
|
|
7837
|
+
const fields = array$5(accessorFields(get)),
|
|
7838
7838
|
n = fields.length;
|
|
7839
7839
|
let i = 0,
|
|
7840
7840
|
f;
|
|
@@ -7847,7 +7847,7 @@ inherits(Aggregate$1, Transform, {
|
|
|
7847
7847
|
}
|
|
7848
7848
|
|
|
7849
7849
|
// initialize group-by dimensions
|
|
7850
|
-
this._dims = array$
|
|
7850
|
+
this._dims = array$5(_.groupby);
|
|
7851
7851
|
this._dnames = this._dims.map(d => {
|
|
7852
7852
|
const dname = accessorName(d);
|
|
7853
7853
|
inputVisit(d);
|
|
@@ -7944,7 +7944,7 @@ inherits(Aggregate$1, Transform, {
|
|
|
7944
7944
|
for (let i = 0; i < n; ++i) {
|
|
7945
7945
|
x[names[i]] = dims[i](t);
|
|
7946
7946
|
}
|
|
7947
|
-
return p ? replace$
|
|
7947
|
+
return p ? replace$1(p.tuple, x) : ingest$1(x);
|
|
7948
7948
|
},
|
|
7949
7949
|
clean() {
|
|
7950
7950
|
const cells = this.value;
|
|
@@ -8179,7 +8179,7 @@ function SortedList (idFunc, source, input) {
|
|
|
8179
8179
|
data.sort(compare);
|
|
8180
8180
|
}
|
|
8181
8181
|
if (add.length) {
|
|
8182
|
-
data = compare ? merge$
|
|
8182
|
+
data = compare ? merge$3(compare, data, add.sort(compare)) : data.concat(add);
|
|
8183
8183
|
add = [];
|
|
8184
8184
|
}
|
|
8185
8185
|
return data;
|
|
@@ -9042,7 +9042,7 @@ function Field$1(params) {
|
|
|
9042
9042
|
}
|
|
9043
9043
|
inherits(Field$1, Operator);
|
|
9044
9044
|
function update$3(_) {
|
|
9045
|
-
return this.value && !_.modified() ? this.value : isArray(_.name) ? array$
|
|
9045
|
+
return this.value && !_.modified() ? this.value : isArray(_.name) ? array$5(_.name).map(f => field$1(f)) : field$1(_.name, _.as);
|
|
9046
9046
|
}
|
|
9047
9047
|
|
|
9048
9048
|
/**
|
|
@@ -9727,7 +9727,7 @@ inherits(Load$1, Transform, {
|
|
|
9727
9727
|
} else if (_.async) {
|
|
9728
9728
|
// return promise for non-blocking async loading
|
|
9729
9729
|
const p = df.request(_.url, _.format).then(res => {
|
|
9730
|
-
this._pending = array$
|
|
9730
|
+
this._pending = array$5(res.data);
|
|
9731
9731
|
return df => df.touch(this);
|
|
9732
9732
|
});
|
|
9733
9733
|
return {
|
|
@@ -9735,7 +9735,7 @@ inherits(Load$1, Transform, {
|
|
|
9735
9735
|
};
|
|
9736
9736
|
} else {
|
|
9737
9737
|
// return promise for synchronous loading
|
|
9738
|
-
return df.request(_.url, _.format).then(res => output(this, pulse, array$
|
|
9738
|
+
return df.request(_.url, _.format).then(res => output(this, pulse, array$5(res.data)));
|
|
9739
9739
|
}
|
|
9740
9740
|
}
|
|
9741
9741
|
});
|
|
@@ -10205,7 +10205,7 @@ inherits(Quantile$1, Transform, {
|
|
|
10205
10205
|
names = (_.groupby || []).map(accessorName),
|
|
10206
10206
|
values = [],
|
|
10207
10207
|
step = _.step || 0.01,
|
|
10208
|
-
p = _.probs || range$
|
|
10208
|
+
p = _.probs || range$5(step / 2, 1 - EPSILON$2, step),
|
|
10209
10209
|
n = p.length;
|
|
10210
10210
|
groups.forEach(g => {
|
|
10211
10211
|
const q = quantiles(g, p);
|
|
@@ -10411,7 +10411,7 @@ inherits(Sequence, Transform, {
|
|
|
10411
10411
|
const out = pulse.materialize().fork(pulse.MOD),
|
|
10412
10412
|
as = _.as || 'data';
|
|
10413
10413
|
out.rem = this.value ? pulse.rem.concat(this.value) : pulse.rem;
|
|
10414
|
-
this.value = range$
|
|
10414
|
+
this.value = range$5(_.start, _.stop, _.step || 1).map(v => {
|
|
10415
10415
|
const t = {};
|
|
10416
10416
|
t[as] = v;
|
|
10417
10417
|
return ingest$1(t);
|
|
@@ -10751,11 +10751,11 @@ function find$2(field, data, index) {
|
|
|
10751
10751
|
const ValidWindowOps = Object.keys(WindowOps);
|
|
10752
10752
|
|
|
10753
10753
|
function WindowState(_) {
|
|
10754
|
-
const ops = array$
|
|
10755
|
-
fields = array$
|
|
10756
|
-
params = array$
|
|
10757
|
-
aggregate_params = array$
|
|
10758
|
-
as = array$
|
|
10754
|
+
const ops = array$5(_.ops),
|
|
10755
|
+
fields = array$5(_.fields),
|
|
10756
|
+
params = array$5(_.params),
|
|
10757
|
+
aggregate_params = array$5(_.aggregate_params),
|
|
10758
|
+
as = array$5(_.as),
|
|
10759
10759
|
outputs = this.outputs = [],
|
|
10760
10760
|
windows = this.windows = [],
|
|
10761
10761
|
inputs = {},
|
|
@@ -10764,7 +10764,7 @@ function WindowState(_) {
|
|
|
10764
10764
|
measures = [];
|
|
10765
10765
|
let countOnly = true;
|
|
10766
10766
|
function visitInputs(f) {
|
|
10767
|
-
array$
|
|
10767
|
+
array$5(accessorFields(f)).forEach(_ => inputs[_] = 1);
|
|
10768
10768
|
}
|
|
10769
10769
|
visitInputs(_.sort);
|
|
10770
10770
|
ops.forEach((op, i) => {
|
|
@@ -11297,7 +11297,7 @@ function arcPadAngle(d) {
|
|
|
11297
11297
|
return d && d.padAngle; // Note: optional!
|
|
11298
11298
|
}
|
|
11299
11299
|
|
|
11300
|
-
function intersect$
|
|
11300
|
+
function intersect$3(x0, y0, x1, y1, x2, y2, x3, y3) {
|
|
11301
11301
|
var x10 = x1 - x0, y10 = y1 - y0,
|
|
11302
11302
|
x32 = x3 - x2, y32 = y3 - y2,
|
|
11303
11303
|
t = y32 * x10 - x32 * y10;
|
|
@@ -11431,7 +11431,7 @@ function arc$2$1() {
|
|
|
11431
11431
|
// intersection fails, it’s probably because the arc is too small, so
|
|
11432
11432
|
// disable the corner radius entirely.
|
|
11433
11433
|
if (da < pi$3) {
|
|
11434
|
-
if (oc = intersect$
|
|
11434
|
+
if (oc = intersect$3(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
|
11435
11435
|
var ax = x01 - oc[0],
|
|
11436
11436
|
ay = y01 - oc[1],
|
|
11437
11437
|
bx = x11 - oc[0],
|
|
@@ -11542,7 +11542,7 @@ function arc$2$1() {
|
|
|
11542
11542
|
return arc;
|
|
11543
11543
|
}
|
|
11544
11544
|
|
|
11545
|
-
function array$
|
|
11545
|
+
function array$4(x) {
|
|
11546
11546
|
return typeof x === "object" && "length" in x
|
|
11547
11547
|
? x // Array, TypedArray, NodeList, array-like
|
|
11548
11548
|
: Array.from(x); // Map, Set, iterable, string, or anything else
|
|
@@ -11600,7 +11600,7 @@ function line$2$1(x, y) {
|
|
|
11600
11600
|
|
|
11601
11601
|
function line(data) {
|
|
11602
11602
|
var i,
|
|
11603
|
-
n = (data = array$
|
|
11603
|
+
n = (data = array$4(data)).length,
|
|
11604
11604
|
d,
|
|
11605
11605
|
defined0 = false,
|
|
11606
11606
|
buffer;
|
|
@@ -11657,7 +11657,7 @@ function area$2$1(x0, y0, y1) {
|
|
|
11657
11657
|
var i,
|
|
11658
11658
|
j,
|
|
11659
11659
|
k,
|
|
11660
|
-
n = (data = array$
|
|
11660
|
+
n = (data = array$4(data)).length,
|
|
11661
11661
|
d,
|
|
11662
11662
|
defined0 = false,
|
|
11663
11663
|
buffer,
|
|
@@ -13407,7 +13407,7 @@ function isNumberArray(x) {
|
|
|
13407
13407
|
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
13408
13408
|
}
|
|
13409
13409
|
|
|
13410
|
-
function array$
|
|
13410
|
+
function array$3(a, b) {
|
|
13411
13411
|
return (isNumberArray(b) ? numberArray : genericArray)(a, b);
|
|
13412
13412
|
}
|
|
13413
13413
|
|
|
@@ -13834,7 +13834,7 @@ function quantize$2(interpolator, n) {
|
|
|
13834
13834
|
const $$1 = /*#__PURE__*/Object.freeze({
|
|
13835
13835
|
__proto__: null,
|
|
13836
13836
|
interpolate: interpolate$1$1,
|
|
13837
|
-
interpolateArray: array$
|
|
13837
|
+
interpolateArray: array$3,
|
|
13838
13838
|
interpolateBasis: basis$1,
|
|
13839
13839
|
interpolateBasisClosed: basisClosed,
|
|
13840
13840
|
interpolateDate: date$1,
|
|
@@ -13922,7 +13922,7 @@ function polymap(domain, range, interpolate) {
|
|
|
13922
13922
|
};
|
|
13923
13923
|
}
|
|
13924
13924
|
|
|
13925
|
-
function copy$
|
|
13925
|
+
function copy$2(source, target) {
|
|
13926
13926
|
return target
|
|
13927
13927
|
.domain(source.domain())
|
|
13928
13928
|
.range(source.range())
|
|
@@ -14291,7 +14291,7 @@ function formatLocale$1(locale) {
|
|
|
14291
14291
|
}
|
|
14292
14292
|
|
|
14293
14293
|
var locale$1;
|
|
14294
|
-
var format$
|
|
14294
|
+
var format$2;
|
|
14295
14295
|
var formatPrefix;
|
|
14296
14296
|
|
|
14297
14297
|
defaultLocale$1({
|
|
@@ -14304,7 +14304,7 @@ defaultLocale$1({
|
|
|
14304
14304
|
|
|
14305
14305
|
function defaultLocale$1(definition) {
|
|
14306
14306
|
locale$1 = formatLocale$1(definition);
|
|
14307
|
-
format$
|
|
14307
|
+
format$2 = locale$1.format;
|
|
14308
14308
|
formatPrefix = locale$1.formatPrefix;
|
|
14309
14309
|
return locale$1;
|
|
14310
14310
|
}
|
|
@@ -14346,7 +14346,7 @@ function tickFormat$1(start, stop, count, specifier) {
|
|
|
14346
14346
|
break;
|
|
14347
14347
|
}
|
|
14348
14348
|
}
|
|
14349
|
-
return format$
|
|
14349
|
+
return format$2(specifier);
|
|
14350
14350
|
}
|
|
14351
14351
|
|
|
14352
14352
|
function linearish(scale) {
|
|
@@ -14407,7 +14407,7 @@ function linear() {
|
|
|
14407
14407
|
var scale = continuous$1();
|
|
14408
14408
|
|
|
14409
14409
|
scale.copy = function() {
|
|
14410
|
-
return copy$
|
|
14410
|
+
return copy$2(scale, linear());
|
|
14411
14411
|
};
|
|
14412
14412
|
|
|
14413
14413
|
initRange.apply(scale, arguments);
|
|
@@ -14567,7 +14567,7 @@ function loggish(transform) {
|
|
|
14567
14567
|
if (specifier == null) specifier = base === 10 ? "s" : ",";
|
|
14568
14568
|
if (typeof specifier !== "function") {
|
|
14569
14569
|
if (!(base % 1) && (specifier = formatSpecifier(specifier)).precision == null) specifier.trim = true;
|
|
14570
|
-
specifier = format$
|
|
14570
|
+
specifier = format$2(specifier);
|
|
14571
14571
|
}
|
|
14572
14572
|
if (count === Infinity) return specifier;
|
|
14573
14573
|
const k = Math.max(1, base * count / scale.ticks().length); // TODO fast estimate?
|
|
@@ -14588,9 +14588,9 @@ function loggish(transform) {
|
|
|
14588
14588
|
return scale;
|
|
14589
14589
|
}
|
|
14590
14590
|
|
|
14591
|
-
function log$
|
|
14591
|
+
function log$2() {
|
|
14592
14592
|
const scale = loggish(transformer$3()).domain([1, 10]);
|
|
14593
|
-
scale.copy = () => copy$
|
|
14593
|
+
scale.copy = () => copy$2(scale, log$2()).base(scale.base());
|
|
14594
14594
|
initRange.apply(scale, arguments);
|
|
14595
14595
|
return scale;
|
|
14596
14596
|
}
|
|
@@ -14621,7 +14621,7 @@ function symlog() {
|
|
|
14621
14621
|
var scale = symlogish(transformer$3());
|
|
14622
14622
|
|
|
14623
14623
|
scale.copy = function() {
|
|
14624
|
-
return copy$
|
|
14624
|
+
return copy$2(scale, symlog()).constant(scale.constant());
|
|
14625
14625
|
};
|
|
14626
14626
|
|
|
14627
14627
|
return initRange.apply(scale, arguments);
|
|
@@ -14662,7 +14662,7 @@ function pow$2() {
|
|
|
14662
14662
|
var scale = powish(transformer$3());
|
|
14663
14663
|
|
|
14664
14664
|
scale.copy = function() {
|
|
14665
|
-
return copy$
|
|
14665
|
+
return copy$2(scale, pow$2()).exponent(scale.exponent());
|
|
14666
14666
|
};
|
|
14667
14667
|
|
|
14668
14668
|
initRange.apply(scale, arguments);
|
|
@@ -15834,8 +15834,8 @@ function formatUnixTimestampSeconds(d) {
|
|
|
15834
15834
|
}
|
|
15835
15835
|
|
|
15836
15836
|
var locale;
|
|
15837
|
-
var timeFormat$
|
|
15838
|
-
var utcFormat$
|
|
15837
|
+
var timeFormat$2;
|
|
15838
|
+
var utcFormat$1;
|
|
15839
15839
|
|
|
15840
15840
|
defaultLocale({
|
|
15841
15841
|
dateTime: "%x, %X",
|
|
@@ -15850,8 +15850,8 @@ defaultLocale({
|
|
|
15850
15850
|
|
|
15851
15851
|
function defaultLocale(definition) {
|
|
15852
15852
|
locale = formatLocale(definition);
|
|
15853
|
-
timeFormat$
|
|
15854
|
-
utcFormat$
|
|
15853
|
+
timeFormat$2 = locale.format;
|
|
15854
|
+
utcFormat$1 = locale.utcFormat;
|
|
15855
15855
|
return locale;
|
|
15856
15856
|
}
|
|
15857
15857
|
|
|
@@ -15911,18 +15911,18 @@ function calendar(ticks, tickInterval, year, month, week, day, hour, minute, sec
|
|
|
15911
15911
|
};
|
|
15912
15912
|
|
|
15913
15913
|
scale.copy = function() {
|
|
15914
|
-
return copy$
|
|
15914
|
+
return copy$2(scale, calendar(ticks, tickInterval, year, month, week, day, hour, minute, second, format));
|
|
15915
15915
|
};
|
|
15916
15916
|
|
|
15917
15917
|
return scale;
|
|
15918
15918
|
}
|
|
15919
15919
|
|
|
15920
|
-
function time$
|
|
15921
|
-
return initRange.apply(calendar(timeTicks, timeTickInterval, timeYear, timeMonth, timeSunday, timeDay, timeHour, timeMinute, second, timeFormat$
|
|
15920
|
+
function time$1() {
|
|
15921
|
+
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);
|
|
15922
15922
|
}
|
|
15923
15923
|
|
|
15924
15924
|
function utcTime() {
|
|
15925
|
-
return initRange.apply(calendar(utcTicks, utcTickInterval, utcYear, utcMonth, utcSunday, utcDay, utcHour, utcMinute, second, utcFormat$
|
|
15925
|
+
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);
|
|
15926
15926
|
}
|
|
15927
15927
|
|
|
15928
15928
|
function transformer$2() {
|
|
@@ -15973,7 +15973,7 @@ function transformer$2() {
|
|
|
15973
15973
|
};
|
|
15974
15974
|
}
|
|
15975
15975
|
|
|
15976
|
-
function copy$
|
|
15976
|
+
function copy$1(source, target) {
|
|
15977
15977
|
return target
|
|
15978
15978
|
.domain(source.domain())
|
|
15979
15979
|
.interpolator(source.interpolator())
|
|
@@ -15985,7 +15985,7 @@ function sequential() {
|
|
|
15985
15985
|
var scale = linearish(transformer$2()(identity$3));
|
|
15986
15986
|
|
|
15987
15987
|
scale.copy = function() {
|
|
15988
|
-
return copy$
|
|
15988
|
+
return copy$1(scale, sequential());
|
|
15989
15989
|
};
|
|
15990
15990
|
|
|
15991
15991
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -15995,7 +15995,7 @@ function sequentialLog() {
|
|
|
15995
15995
|
var scale = loggish(transformer$2()).domain([1, 10]);
|
|
15996
15996
|
|
|
15997
15997
|
scale.copy = function() {
|
|
15998
|
-
return copy$
|
|
15998
|
+
return copy$1(scale, sequentialLog()).base(scale.base());
|
|
15999
15999
|
};
|
|
16000
16000
|
|
|
16001
16001
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16005,7 +16005,7 @@ function sequentialSymlog() {
|
|
|
16005
16005
|
var scale = symlogish(transformer$2());
|
|
16006
16006
|
|
|
16007
16007
|
scale.copy = function() {
|
|
16008
|
-
return copy$
|
|
16008
|
+
return copy$1(scale, sequentialSymlog()).constant(scale.constant());
|
|
16009
16009
|
};
|
|
16010
16010
|
|
|
16011
16011
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16015,7 +16015,7 @@ function sequentialPow() {
|
|
|
16015
16015
|
var scale = powish(transformer$2());
|
|
16016
16016
|
|
|
16017
16017
|
scale.copy = function() {
|
|
16018
|
-
return copy$
|
|
16018
|
+
return copy$1(scale, sequentialPow()).exponent(scale.exponent());
|
|
16019
16019
|
};
|
|
16020
16020
|
|
|
16021
16021
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16081,7 +16081,7 @@ function diverging() {
|
|
|
16081
16081
|
var scale = linearish(transformer$1()(identity$3));
|
|
16082
16082
|
|
|
16083
16083
|
scale.copy = function() {
|
|
16084
|
-
return copy$
|
|
16084
|
+
return copy$1(scale, diverging());
|
|
16085
16085
|
};
|
|
16086
16086
|
|
|
16087
16087
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16091,7 +16091,7 @@ function divergingLog() {
|
|
|
16091
16091
|
var scale = loggish(transformer$1()).domain([0.1, 1, 10]);
|
|
16092
16092
|
|
|
16093
16093
|
scale.copy = function() {
|
|
16094
|
-
return copy$
|
|
16094
|
+
return copy$1(scale, divergingLog()).base(scale.base());
|
|
16095
16095
|
};
|
|
16096
16096
|
|
|
16097
16097
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16101,7 +16101,7 @@ function divergingSymlog() {
|
|
|
16101
16101
|
var scale = symlogish(transformer$1());
|
|
16102
16102
|
|
|
16103
16103
|
scale.copy = function() {
|
|
16104
|
-
return copy$
|
|
16104
|
+
return copy$1(scale, divergingSymlog()).constant(scale.constant());
|
|
16105
16105
|
};
|
|
16106
16106
|
|
|
16107
16107
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16111,7 +16111,7 @@ function divergingPow() {
|
|
|
16111
16111
|
var scale = powish(transformer$1());
|
|
16112
16112
|
|
|
16113
16113
|
scale.copy = function() {
|
|
16114
|
-
return copy$
|
|
16114
|
+
return copy$1(scale, divergingPow()).exponent(scale.exponent());
|
|
16115
16115
|
};
|
|
16116
16116
|
|
|
16117
16117
|
return initInterpolator.apply(scale, arguments);
|
|
@@ -16247,7 +16247,7 @@ function band() {
|
|
|
16247
16247
|
start = Math.round(start);
|
|
16248
16248
|
bandwidth = Math.round(bandwidth);
|
|
16249
16249
|
}
|
|
16250
|
-
const values = range$
|
|
16250
|
+
const values = range$5(n).map(i => start + step * i);
|
|
16251
16251
|
return ordinalRange(reverse ? values.reverse() : values);
|
|
16252
16252
|
}
|
|
16253
16253
|
scale.domain = function (_) {
|
|
@@ -16382,7 +16382,7 @@ function numbers(_) {
|
|
|
16382
16382
|
return map.call(_, toNumber);
|
|
16383
16383
|
}
|
|
16384
16384
|
|
|
16385
|
-
const slice$
|
|
16385
|
+
const slice$2 = Array.prototype.slice;
|
|
16386
16386
|
|
|
16387
16387
|
function scaleBinOrdinal() {
|
|
16388
16388
|
let domain = [],
|
|
@@ -16400,7 +16400,7 @@ function scaleBinOrdinal() {
|
|
|
16400
16400
|
};
|
|
16401
16401
|
scale.range = function (_) {
|
|
16402
16402
|
if (arguments.length) {
|
|
16403
|
-
range = slice$
|
|
16403
|
+
range = slice$2.call(_);
|
|
16404
16404
|
return scale;
|
|
16405
16405
|
} else {
|
|
16406
16406
|
return range.slice();
|
|
@@ -16442,7 +16442,7 @@ function create$2(type, constructor, metadata) {
|
|
|
16442
16442
|
s.type = type;
|
|
16443
16443
|
return registerScale(s);
|
|
16444
16444
|
};
|
|
16445
|
-
ctr.metadata = toSet(array$
|
|
16445
|
+
ctr.metadata = toSet(array$5(metadata));
|
|
16446
16446
|
return ctr;
|
|
16447
16447
|
}
|
|
16448
16448
|
|
|
@@ -16462,7 +16462,7 @@ function create$2(type, constructor, metadata) {
|
|
|
16462
16462
|
* - `"log"` - the scale performs a logarithmic transform of the continuous domain.
|
|
16463
16463
|
* - `"temporal"` - the scale domain is defined over date-time values.
|
|
16464
16464
|
*/
|
|
16465
|
-
function scale$
|
|
16465
|
+
function scale$4(type, scale, metadata) {
|
|
16466
16466
|
if (arguments.length > 1) {
|
|
16467
16467
|
scales.set(type, create$2(type, scale, metadata));
|
|
16468
16468
|
return this;
|
|
@@ -16472,42 +16472,42 @@ function scale$5(type, scale, metadata) {
|
|
|
16472
16472
|
}
|
|
16473
16473
|
|
|
16474
16474
|
// identity scale
|
|
16475
|
-
scale$
|
|
16475
|
+
scale$4(Identity, identity$1);
|
|
16476
16476
|
|
|
16477
16477
|
// continuous scales
|
|
16478
|
-
scale$
|
|
16479
|
-
scale$
|
|
16480
|
-
scale$
|
|
16481
|
-
scale$
|
|
16482
|
-
scale$
|
|
16483
|
-
scale$
|
|
16484
|
-
scale$
|
|
16478
|
+
scale$4(Linear, linear, Continuous);
|
|
16479
|
+
scale$4(Log, log$2, [Continuous, Log]);
|
|
16480
|
+
scale$4(Pow, pow$2, Continuous);
|
|
16481
|
+
scale$4(Sqrt, sqrt$2, Continuous);
|
|
16482
|
+
scale$4(Symlog, symlog, Continuous);
|
|
16483
|
+
scale$4(Time, time$1, [Continuous, Temporal]);
|
|
16484
|
+
scale$4(UTC, utcTime, [Continuous, Temporal]);
|
|
16485
16485
|
|
|
16486
16486
|
// sequential scales
|
|
16487
|
-
scale$
|
|
16488
|
-
scale$
|
|
16489
|
-
scale$
|
|
16490
|
-
scale$
|
|
16491
|
-
scale$
|
|
16492
|
-
scale$
|
|
16487
|
+
scale$4(Sequential, sequential, [Continuous, Interpolating]); // backwards compat
|
|
16488
|
+
scale$4(`${Sequential}-${Linear}`, sequential, [Continuous, Interpolating]);
|
|
16489
|
+
scale$4(`${Sequential}-${Log}`, sequentialLog, [Continuous, Interpolating, Log]);
|
|
16490
|
+
scale$4(`${Sequential}-${Pow}`, sequentialPow, [Continuous, Interpolating]);
|
|
16491
|
+
scale$4(`${Sequential}-${Sqrt}`, sequentialSqrt, [Continuous, Interpolating]);
|
|
16492
|
+
scale$4(`${Sequential}-${Symlog}`, sequentialSymlog, [Continuous, Interpolating]);
|
|
16493
16493
|
|
|
16494
16494
|
// diverging scales
|
|
16495
|
-
scale$
|
|
16496
|
-
scale$
|
|
16497
|
-
scale$
|
|
16498
|
-
scale$
|
|
16499
|
-
scale$
|
|
16495
|
+
scale$4(`${Diverging}-${Linear}`, diverging, [Continuous, Interpolating]);
|
|
16496
|
+
scale$4(`${Diverging}-${Log}`, divergingLog, [Continuous, Interpolating, Log]);
|
|
16497
|
+
scale$4(`${Diverging}-${Pow}`, divergingPow, [Continuous, Interpolating]);
|
|
16498
|
+
scale$4(`${Diverging}-${Sqrt}`, divergingSqrt, [Continuous, Interpolating]);
|
|
16499
|
+
scale$4(`${Diverging}-${Symlog}`, divergingSymlog, [Continuous, Interpolating]);
|
|
16500
16500
|
|
|
16501
16501
|
// discretizing scales
|
|
16502
|
-
scale$
|
|
16503
|
-
scale$
|
|
16504
|
-
scale$
|
|
16502
|
+
scale$4(Quantile, quantile, [Discretizing, Quantile]);
|
|
16503
|
+
scale$4(Quantize, quantize$1, Discretizing);
|
|
16504
|
+
scale$4(Threshold, threshold, Discretizing);
|
|
16505
16505
|
|
|
16506
16506
|
// discrete scales
|
|
16507
|
-
scale$
|
|
16508
|
-
scale$
|
|
16509
|
-
scale$
|
|
16510
|
-
scale$
|
|
16507
|
+
scale$4(BinOrdinal, scaleBinOrdinal, [Discrete$1, Discretizing]);
|
|
16508
|
+
scale$4(Ordinal, ordinal, Discrete$1);
|
|
16509
|
+
scale$4(Band, band, Discrete$1);
|
|
16510
|
+
scale$4(Point, point$3, Discrete$1);
|
|
16511
16511
|
function isValidScaleType(type) {
|
|
16512
16512
|
return scales.has(type);
|
|
16513
16513
|
}
|
|
@@ -16562,7 +16562,7 @@ function scaleFraction(scale$1, min, max) {
|
|
|
16562
16562
|
} else {
|
|
16563
16563
|
i = (t = scale$1.type).indexOf('-');
|
|
16564
16564
|
t = i < 0 ? t : t.slice(i + 1);
|
|
16565
|
-
s = scale$
|
|
16565
|
+
s = scale$4(t)().domain([min, max]).range([0, 1]);
|
|
16566
16566
|
scaleProps.forEach(m => scale$1[m] ? s[m](scale$1[m]()) : 0);
|
|
16567
16567
|
return s;
|
|
16568
16568
|
}
|
|
@@ -16877,7 +16877,7 @@ function labelFraction(scale) {
|
|
|
16877
16877
|
return value => (value - lo) / span;
|
|
16878
16878
|
}
|
|
16879
16879
|
|
|
16880
|
-
function format$
|
|
16880
|
+
function format$1(locale, scale, specifier, formatType) {
|
|
16881
16881
|
const type = formatType || scale.type;
|
|
16882
16882
|
|
|
16883
16883
|
// replace abbreviated time specifiers to improve screen reader experience
|
|
@@ -16889,7 +16889,7 @@ function format$2(locale, scale, specifier, formatType) {
|
|
|
16889
16889
|
function domainCaption(locale, scale, opt) {
|
|
16890
16890
|
opt = opt || {};
|
|
16891
16891
|
const max = Math.max(3, opt.maxlen || 7),
|
|
16892
|
-
fmt = format$
|
|
16892
|
+
fmt = format$1(locale, scale, opt.format, opt.formatType);
|
|
16893
16893
|
|
|
16894
16894
|
// if scale breaks domain into bins, describe boundaries
|
|
16895
16895
|
if (isDiscretizing$1(scale.type)) {
|
|
@@ -17135,11 +17135,11 @@ const HalfSqrt3 = Math.sqrt(3) / 2;
|
|
|
17135
17135
|
|
|
17136
17136
|
var segmentCache = {};
|
|
17137
17137
|
var bezierCache = {};
|
|
17138
|
-
var join$
|
|
17138
|
+
var join$1 = [].join;
|
|
17139
17139
|
|
|
17140
17140
|
// Copied from Inkscape svgtopdf, thanks!
|
|
17141
17141
|
function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
17142
|
-
const key = join$
|
|
17142
|
+
const key = join$1.call(arguments);
|
|
17143
17143
|
if (segmentCache[key]) {
|
|
17144
17144
|
return segmentCache[key];
|
|
17145
17145
|
}
|
|
@@ -17189,7 +17189,7 @@ function segments(x, y, rx, ry, large, sweep, rotateX, ox, oy) {
|
|
|
17189
17189
|
return segmentCache[key] = result;
|
|
17190
17190
|
}
|
|
17191
17191
|
function bezier(params) {
|
|
17192
|
-
const key = join$
|
|
17192
|
+
const key = join$1.call(params);
|
|
17193
17193
|
if (bezierCache[key]) {
|
|
17194
17194
|
return bezierCache[key];
|
|
17195
17195
|
}
|
|
@@ -18594,7 +18594,7 @@ function translate$2(x, y) {
|
|
|
18594
18594
|
function rotate(a) {
|
|
18595
18595
|
return 'rotate(' + a + ')';
|
|
18596
18596
|
}
|
|
18597
|
-
function scale$
|
|
18597
|
+
function scale$3(scaleX, scaleY) {
|
|
18598
18598
|
return 'scale(' + scaleX + ',' + scaleY + ')';
|
|
18599
18599
|
}
|
|
18600
18600
|
function translateItem(item) {
|
|
@@ -18604,7 +18604,7 @@ function rotateItem(item) {
|
|
|
18604
18604
|
return translate$2(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '');
|
|
18605
18605
|
}
|
|
18606
18606
|
function transformItem(item) {
|
|
18607
|
-
return translate$2(item.x || 0, item.y || 0) + (item.angle ? ' ' + rotate(item.angle) : '') + (item.scaleX || item.scaleY ? ' ' + scale$
|
|
18607
|
+
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) : '');
|
|
18608
18608
|
}
|
|
18609
18609
|
|
|
18610
18610
|
function markItemPath (type, shape, isect) {
|
|
@@ -20511,7 +20511,7 @@ function ariaGuide(mark, opt) {
|
|
|
20511
20511
|
}
|
|
20512
20512
|
}
|
|
20513
20513
|
function titleCaption(item) {
|
|
20514
|
-
return array$
|
|
20514
|
+
return array$5(item.text).join(' ');
|
|
20515
20515
|
}
|
|
20516
20516
|
function axisCaption(item) {
|
|
20517
20517
|
const datum = item.datum,
|
|
@@ -20537,7 +20537,7 @@ function legendCaption(item) {
|
|
|
20537
20537
|
}
|
|
20538
20538
|
function extractTitle(item) {
|
|
20539
20539
|
try {
|
|
20540
|
-
return array$
|
|
20540
|
+
return array$5(peek$1(item.items).items[0].text).join(' ');
|
|
20541
20541
|
} catch (err) {
|
|
20542
20542
|
return null;
|
|
20543
20543
|
}
|
|
@@ -21770,7 +21770,7 @@ function renderModule(name, _) {
|
|
|
21770
21770
|
}
|
|
21771
21771
|
}
|
|
21772
21772
|
|
|
21773
|
-
function intersect$
|
|
21773
|
+
function intersect$2(scene, bounds, filter) {
|
|
21774
21774
|
const hits = [],
|
|
21775
21775
|
// intersection results
|
|
21776
21776
|
box = new Bounds().union(bounds),
|
|
@@ -22095,16 +22095,16 @@ const methods = {
|
|
|
22095
22095
|
parity: items => items.filter((item, i) => i % 2 ? item.opacity = 0 : 1),
|
|
22096
22096
|
greedy: (items, sep) => {
|
|
22097
22097
|
let a;
|
|
22098
|
-
return items.filter((b, i) => !i || !intersect$
|
|
22098
|
+
return items.filter((b, i) => !i || !intersect$1(a.bounds, b.bounds, sep) ? (a = b, 1) : b.opacity = 0);
|
|
22099
22099
|
}
|
|
22100
22100
|
};
|
|
22101
22101
|
|
|
22102
22102
|
// compute bounding box intersection
|
|
22103
22103
|
// including padding pixels of separation
|
|
22104
|
-
const intersect$
|
|
22104
|
+
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);
|
|
22105
22105
|
const hasOverlap = (items, pad) => {
|
|
22106
22106
|
for (var i = 1, n = items.length, a = items[0].bounds, b; i < n; a = b, ++i) {
|
|
22107
|
-
if (intersect$
|
|
22107
|
+
if (intersect$1(a, b = items[i].bounds, pad)) return true;
|
|
22108
22108
|
}
|
|
22109
22109
|
};
|
|
22110
22110
|
const hasBounds = item => {
|
|
@@ -23692,7 +23692,7 @@ inherits(Pie, Transform, {
|
|
|
23692
23692
|
n = values.length,
|
|
23693
23693
|
a = start,
|
|
23694
23694
|
k = (stop - start) / sum$1(values),
|
|
23695
|
-
index = range$
|
|
23695
|
+
index = range$5(n),
|
|
23696
23696
|
i,
|
|
23697
23697
|
t,
|
|
23698
23698
|
v;
|
|
@@ -23735,7 +23735,7 @@ inherits(Scale$1, Transform, {
|
|
|
23735
23735
|
scale$1 = this.value,
|
|
23736
23736
|
key = scaleKey(_);
|
|
23737
23737
|
if (!scale$1 || key !== scale$1.type) {
|
|
23738
|
-
this.value = scale$1 = scale$
|
|
23738
|
+
this.value = scale$1 = scale$4(key)();
|
|
23739
23739
|
}
|
|
23740
23740
|
for (key in _) if (!SKIP$1[key]) {
|
|
23741
23741
|
// padding is a scale property for band/point but not others
|
|
@@ -23855,7 +23855,7 @@ function configureBins(scale, _, count) {
|
|
|
23855
23855
|
if (!step) error$1('Scale bins parameter missing step property.');
|
|
23856
23856
|
if (start < lo) start = step * Math.ceil(lo / step);
|
|
23857
23857
|
if (stop > hi) stop = step * Math.floor(hi / step);
|
|
23858
|
-
bins = range$
|
|
23858
|
+
bins = range$5(start, stop + step / 2, step);
|
|
23859
23859
|
}
|
|
23860
23860
|
if (bins) {
|
|
23861
23861
|
// assign bin boundaries to scale instance
|
|
@@ -24125,7 +24125,7 @@ function partition$3(data, groupby, sort, field) {
|
|
|
24125
24125
|
return groups;
|
|
24126
24126
|
}
|
|
24127
24127
|
|
|
24128
|
-
const encode$
|
|
24128
|
+
const encode$1 = /*#__PURE__*/Object.freeze({
|
|
24129
24129
|
__proto__: null,
|
|
24130
24130
|
axisticks: AxisTicks$1,
|
|
24131
24131
|
datajoin: DataJoin$1,
|
|
@@ -24155,7 +24155,7 @@ var cos$1 = Math.cos;
|
|
|
24155
24155
|
var ceil = Math.ceil;
|
|
24156
24156
|
var exp = Math.exp;
|
|
24157
24157
|
var hypot = Math.hypot;
|
|
24158
|
-
var log$
|
|
24158
|
+
var log$1 = Math.log;
|
|
24159
24159
|
var pow$1 = Math.pow;
|
|
24160
24160
|
var sin$1 = Math.sin;
|
|
24161
24161
|
var sign = Math.sign || function(x) { return x > 0 ? 1 : x < 0 ? -1 : 0; };
|
|
@@ -24308,7 +24308,7 @@ function areaPoint$1(lambda, phi) {
|
|
|
24308
24308
|
lambda0$1 = lambda, cosPhi0 = cosPhi, sinPhi0 = sinPhi;
|
|
24309
24309
|
}
|
|
24310
24310
|
|
|
24311
|
-
function geoArea$1
|
|
24311
|
+
function geoArea$1(object) {
|
|
24312
24312
|
areaSum$1 = new Adder();
|
|
24313
24313
|
geoStream(object, areaStream$1);
|
|
24314
24314
|
return areaSum$1 * 2;
|
|
@@ -24352,7 +24352,7 @@ var lambda0, phi0, lambda1, phi1, // bounds
|
|
|
24352
24352
|
p0, // previous 3D point
|
|
24353
24353
|
deltaSum,
|
|
24354
24354
|
ranges,
|
|
24355
|
-
range$
|
|
24355
|
+
range$4;
|
|
24356
24356
|
|
|
24357
24357
|
var boundsStream$2 = {
|
|
24358
24358
|
point: boundsPoint$1,
|
|
@@ -24373,7 +24373,7 @@ var boundsStream$2 = {
|
|
|
24373
24373
|
if (areaRingSum$1 < 0) lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
|
|
24374
24374
|
else if (deltaSum > epsilon$3) phi1 = 90;
|
|
24375
24375
|
else if (deltaSum < -epsilon$3) phi0 = -90;
|
|
24376
|
-
range$
|
|
24376
|
+
range$4[0] = lambda0, range$4[1] = lambda1;
|
|
24377
24377
|
},
|
|
24378
24378
|
sphere: function() {
|
|
24379
24379
|
lambda0 = -(lambda1 = 180), phi0 = -(phi1 = 90);
|
|
@@ -24381,7 +24381,7 @@ var boundsStream$2 = {
|
|
|
24381
24381
|
};
|
|
24382
24382
|
|
|
24383
24383
|
function boundsPoint$1(lambda, phi) {
|
|
24384
|
-
ranges.push(range$
|
|
24384
|
+
ranges.push(range$4 = [lambda0 = lambda, lambda1 = lambda]);
|
|
24385
24385
|
if (phi < phi0) phi0 = phi;
|
|
24386
24386
|
if (phi > phi1) phi1 = phi;
|
|
24387
24387
|
}
|
|
@@ -24428,7 +24428,7 @@ function linePoint(lambda, phi) {
|
|
|
24428
24428
|
}
|
|
24429
24429
|
}
|
|
24430
24430
|
} else {
|
|
24431
|
-
ranges.push(range$
|
|
24431
|
+
ranges.push(range$4 = [lambda0 = lambda, lambda1 = lambda]);
|
|
24432
24432
|
}
|
|
24433
24433
|
if (phi < phi0) phi0 = phi;
|
|
24434
24434
|
if (phi > phi1) phi1 = phi;
|
|
@@ -24440,7 +24440,7 @@ function boundsLineStart() {
|
|
|
24440
24440
|
}
|
|
24441
24441
|
|
|
24442
24442
|
function boundsLineEnd() {
|
|
24443
|
-
range$
|
|
24443
|
+
range$4[0] = lambda0, range$4[1] = lambda1;
|
|
24444
24444
|
boundsStream$2.point = boundsPoint$1;
|
|
24445
24445
|
p0 = null;
|
|
24446
24446
|
}
|
|
@@ -24464,7 +24464,7 @@ function boundsRingEnd() {
|
|
|
24464
24464
|
boundsRingPoint(lambda00$1, phi00$1);
|
|
24465
24465
|
areaStream$1.lineEnd();
|
|
24466
24466
|
if (abs$1(deltaSum) > epsilon$3) lambda0 = -(lambda1 = 180);
|
|
24467
|
-
range$
|
|
24467
|
+
range$4[0] = lambda0, range$4[1] = lambda1;
|
|
24468
24468
|
p0 = null;
|
|
24469
24469
|
}
|
|
24470
24470
|
|
|
@@ -24483,7 +24483,7 @@ function rangeContains(range, x) {
|
|
|
24483
24483
|
return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
|
|
24484
24484
|
}
|
|
24485
24485
|
|
|
24486
|
-
function geoBounds$1
|
|
24486
|
+
function geoBounds$1(feature) {
|
|
24487
24487
|
var i, n, a, b, merged, deltaMax, delta;
|
|
24488
24488
|
|
|
24489
24489
|
phi1 = lambda1 = -(lambda0 = phi0 = Infinity);
|
|
@@ -24513,7 +24513,7 @@ function geoBounds$1$1(feature) {
|
|
|
24513
24513
|
}
|
|
24514
24514
|
}
|
|
24515
24515
|
|
|
24516
|
-
ranges = range$
|
|
24516
|
+
ranges = range$4 = null;
|
|
24517
24517
|
|
|
24518
24518
|
return lambda0 === Infinity || phi0 === Infinity
|
|
24519
24519
|
? [[NaN, NaN], [NaN, NaN]]
|
|
@@ -24632,7 +24632,7 @@ function centroidRingPoint(lambda, phi) {
|
|
|
24632
24632
|
centroidPointCartesian(x0$4, y0$4, z0);
|
|
24633
24633
|
}
|
|
24634
24634
|
|
|
24635
|
-
function geoCentroid$1
|
|
24635
|
+
function geoCentroid$1(object) {
|
|
24636
24636
|
W0 = W1 =
|
|
24637
24637
|
X0$1 = Y0$1 = Z0$1 =
|
|
24638
24638
|
X1$1 = Y1$1 = Z1$1 = 0;
|
|
@@ -25001,7 +25001,7 @@ function clip$1(pointVisible, clipLine, interpolate, start) {
|
|
|
25001
25001
|
clip.point = point;
|
|
25002
25002
|
clip.lineStart = lineStart;
|
|
25003
25003
|
clip.lineEnd = lineEnd;
|
|
25004
|
-
segments = merge$
|
|
25004
|
+
segments = merge$2(segments);
|
|
25005
25005
|
var startInside = polygonContains(polygon, start);
|
|
25006
25006
|
if (segments.length) {
|
|
25007
25007
|
if (!polygonStarted) sink.polygonStart(), polygonStarted = true;
|
|
@@ -25513,7 +25513,7 @@ function clipRectangle(x0, y0, x1, y1) {
|
|
|
25513
25513
|
function polygonEnd() {
|
|
25514
25514
|
var startInside = polygonInside(),
|
|
25515
25515
|
cleanInside = clean && startInside,
|
|
25516
|
-
visible = (segments = merge$
|
|
25516
|
+
visible = (segments = merge$2(segments)).length;
|
|
25517
25517
|
if (cleanInside || visible) {
|
|
25518
25518
|
stream.polygonStart();
|
|
25519
25519
|
if (cleanInside) {
|
|
@@ -25588,12 +25588,12 @@ function clipRectangle(x0, y0, x1, y1) {
|
|
|
25588
25588
|
}
|
|
25589
25589
|
|
|
25590
25590
|
function graticuleX(y0, y1, dy) {
|
|
25591
|
-
var y = range$
|
|
25591
|
+
var y = range$5(y0, y1 - epsilon$3, dy).concat(y1);
|
|
25592
25592
|
return function(x) { return y.map(function(y) { return [x, y]; }); };
|
|
25593
25593
|
}
|
|
25594
25594
|
|
|
25595
25595
|
function graticuleY(x0, x1, dx) {
|
|
25596
|
-
var x = range$
|
|
25596
|
+
var x = range$5(x0, x1 - epsilon$3, dx).concat(x1);
|
|
25597
25597
|
return function(y) { return x.map(function(x) { return [x, y]; }); };
|
|
25598
25598
|
}
|
|
25599
25599
|
|
|
@@ -25609,10 +25609,10 @@ function graticule() {
|
|
|
25609
25609
|
}
|
|
25610
25610
|
|
|
25611
25611
|
function lines() {
|
|
25612
|
-
return range$
|
|
25613
|
-
.concat(range$
|
|
25614
|
-
.concat(range$
|
|
25615
|
-
.concat(range$
|
|
25612
|
+
return range$5(ceil(X0 / DX) * DX, X1, DX).map(X)
|
|
25613
|
+
.concat(range$5(ceil(Y0 / DY) * DY, Y1, DY).map(Y))
|
|
25614
|
+
.concat(range$5(ceil(x0 / dx) * dx, x1, dx).filter(function(x) { return abs$1(x % DX) > epsilon$3; }).map(x))
|
|
25615
|
+
.concat(range$5(ceil(y0 / dy) * dy, y1, dy).filter(function(y) { return abs$1(y % DY) > epsilon$3; }).map(y));
|
|
25616
25616
|
}
|
|
25617
25617
|
|
|
25618
25618
|
graticule.lines = function() {
|
|
@@ -26661,7 +26661,7 @@ function geoAzimuthalEquidistant() {
|
|
|
26661
26661
|
}
|
|
26662
26662
|
|
|
26663
26663
|
function mercatorRaw(lambda, phi) {
|
|
26664
|
-
return [lambda, log$
|
|
26664
|
+
return [lambda, log$1(tan((halfPi$1 + phi) / 2))];
|
|
26665
26665
|
}
|
|
26666
26666
|
|
|
26667
26667
|
mercatorRaw.invert = function(x, y) {
|
|
@@ -26715,7 +26715,7 @@ function tany(y) {
|
|
|
26715
26715
|
|
|
26716
26716
|
function conicConformalRaw(y0, y1) {
|
|
26717
26717
|
var cy0 = cos$1(y0),
|
|
26718
|
-
n = y0 === y1 ? sin$1(y0) : log$
|
|
26718
|
+
n = y0 === y1 ? sin$1(y0) : log$1(cy0 / cos$1(y1)) / log$1(tany(y1) / tany(y0)),
|
|
26719
26719
|
f = cy0 * pow$1(tany(y0), n) / n;
|
|
26720
26720
|
|
|
26721
26721
|
if (!n) return mercatorRaw;
|
|
@@ -26965,7 +26965,7 @@ function geoStereographic() {
|
|
|
26965
26965
|
}
|
|
26966
26966
|
|
|
26967
26967
|
function transverseMercatorRaw(lambda, phi) {
|
|
26968
|
-
return [log$
|
|
26968
|
+
return [log$1(tan((halfPi$1 + phi) / 2)), -lambda];
|
|
26969
26969
|
}
|
|
26970
26970
|
|
|
26971
26971
|
transverseMercatorRaw.invert = function(x, y) {
|
|
@@ -27315,7 +27315,7 @@ function quantize (k, nice, zero) {
|
|
|
27315
27315
|
stop = ex[1],
|
|
27316
27316
|
span = stop - start,
|
|
27317
27317
|
step = nice ? tickStep(start, stop, k) : span / (k + 1);
|
|
27318
|
-
return range$
|
|
27318
|
+
return range$5(start + step, stop, step);
|
|
27319
27319
|
};
|
|
27320
27320
|
}
|
|
27321
27321
|
|
|
@@ -27567,7 +27567,7 @@ function density2D () {
|
|
|
27567
27567
|
};
|
|
27568
27568
|
density.bandwidth = function (_) {
|
|
27569
27569
|
if (!arguments.length) return bandwidth;
|
|
27570
|
-
_ = array$
|
|
27570
|
+
_ = array$5(_);
|
|
27571
27571
|
if (_.length === 1) _ = [+_[0], +_[0]];
|
|
27572
27572
|
if (_.length !== 2) error$1('invalid bandwidth');
|
|
27573
27573
|
return bandwidth = _, density;
|
|
@@ -28197,7 +28197,7 @@ inherits(Graticule, Transform, {
|
|
|
28197
28197
|
}
|
|
28198
28198
|
t = gen();
|
|
28199
28199
|
if (src.length) {
|
|
28200
|
-
pulse.mod.push(replace$
|
|
28200
|
+
pulse.mod.push(replace$1(src[0], t));
|
|
28201
28201
|
} else {
|
|
28202
28202
|
pulse.add.push(ingest$1(t));
|
|
28203
28203
|
}
|
|
@@ -28394,14 +28394,14 @@ function set$2(proj, key, value) {
|
|
|
28394
28394
|
if (isFunction(proj[key])) proj[key](value);
|
|
28395
28395
|
}
|
|
28396
28396
|
function collectGeoJSON(data) {
|
|
28397
|
-
data = array$
|
|
28397
|
+
data = array$5(data);
|
|
28398
28398
|
return data.length === 1 ? data[0] : {
|
|
28399
28399
|
type: FeatureCollection,
|
|
28400
28400
|
features: data.reduce((a, f) => a.concat(featurize(f)), [])
|
|
28401
28401
|
};
|
|
28402
28402
|
}
|
|
28403
28403
|
function featurize(f) {
|
|
28404
|
-
return f.type === FeatureCollection ? f.features : array$
|
|
28404
|
+
return f.type === FeatureCollection ? f.features : array$5(f).filter(d => d != null).map(d => d.type === Feature ? d : {
|
|
28405
28405
|
type: Feature,
|
|
28406
28406
|
geometry: d
|
|
28407
28407
|
});
|
|
@@ -29896,7 +29896,7 @@ function simulation(nodes, _) {
|
|
|
29896
29896
|
return setup(sim, _, true).on('end', () => stopped = true);
|
|
29897
29897
|
}
|
|
29898
29898
|
function setup(sim, _, init, pulse) {
|
|
29899
|
-
var f = array$
|
|
29899
|
+
var f = array$5(_.forces),
|
|
29900
29900
|
i,
|
|
29901
29901
|
n,
|
|
29902
29902
|
p,
|
|
@@ -30290,7 +30290,7 @@ function lcg() {
|
|
|
30290
30290
|
return () => (s = (a * s + c) % m) / m;
|
|
30291
30291
|
}
|
|
30292
30292
|
|
|
30293
|
-
function array$
|
|
30293
|
+
function array$2(x) {
|
|
30294
30294
|
return typeof x === "object" && "length" in x
|
|
30295
30295
|
? x // Array, TypedArray, NodeList, array-like
|
|
30296
30296
|
: Array.from(x); // Map, Set, iterable, string, or anything else
|
|
@@ -30473,7 +30473,7 @@ function Node(circle) {
|
|
|
30473
30473
|
}
|
|
30474
30474
|
|
|
30475
30475
|
function packSiblingsRandom(circles, random) {
|
|
30476
|
-
if (!(n = (circles = array$
|
|
30476
|
+
if (!(n = (circles = array$2(circles)).length)) return 0;
|
|
30477
30477
|
|
|
30478
30478
|
var a, b, c, n, aa, ca, i, j, k, sj, sk;
|
|
30479
30479
|
|
|
@@ -31378,7 +31378,7 @@ inherits(Nest, Transform, {
|
|
|
31378
31378
|
|
|
31379
31379
|
// generate new tree structure
|
|
31380
31380
|
this.value = tree = hierarchy({
|
|
31381
|
-
values: array$
|
|
31381
|
+
values: array$5(_.keys).reduce((n, k) => {
|
|
31382
31382
|
n.key(k);
|
|
31383
31383
|
return n;
|
|
31384
31384
|
}, nest()).entries(out.source)
|
|
@@ -32738,7 +32738,7 @@ inherits(Label$1, Transform, {
|
|
|
32738
32738
|
const as = _.as || Output$1;
|
|
32739
32739
|
|
|
32740
32740
|
// run label layout
|
|
32741
|
-
labelLayout(pulse.materialize(pulse.SOURCE).source || [], _.size, _.sort, array$
|
|
32741
|
+
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 => {
|
|
32742
32742
|
// write layout results to data stream
|
|
32743
32743
|
const t = l.datum;
|
|
32744
32744
|
t[as[0]] = l.x;
|
|
@@ -32857,7 +32857,7 @@ inherits(Loess, Transform, {
|
|
|
32857
32857
|
const Methods = {
|
|
32858
32858
|
constant: constant$4,
|
|
32859
32859
|
linear: linear$2,
|
|
32860
|
-
log: log$
|
|
32860
|
+
log: log$3,
|
|
32861
32861
|
exp: exp$1,
|
|
32862
32862
|
pow: pow$3,
|
|
32863
32863
|
quad: quad,
|
|
@@ -34943,7 +34943,7 @@ inherits(Wordcloud, Transform, {
|
|
|
34943
34943
|
// create font size scaling function as needed
|
|
34944
34944
|
if (range) {
|
|
34945
34945
|
const fsize = fontSize,
|
|
34946
|
-
sizeScale = scale$
|
|
34946
|
+
sizeScale = scale$4('sqrt')().domain(extent(data, fsize)).range(range);
|
|
34947
34947
|
fontSize = x => sizeScale(fsize(x));
|
|
34948
34948
|
}
|
|
34949
34949
|
data.forEach(t => {
|
|
@@ -34989,8 +34989,8 @@ function Bitmaps() {
|
|
|
34989
34989
|
let width = 8,
|
|
34990
34990
|
data = [],
|
|
34991
34991
|
seen = array32(0),
|
|
34992
|
-
curr = array$
|
|
34993
|
-
prev = array$
|
|
34992
|
+
curr = array$1(0, width),
|
|
34993
|
+
prev = array$1(0, width);
|
|
34994
34994
|
return {
|
|
34995
34995
|
data: () => data,
|
|
34996
34996
|
seen: () => seen = lengthen(seen, data.length),
|
|
@@ -35046,8 +35046,8 @@ function Bitmaps() {
|
|
|
35046
35046
|
const k = curr.length;
|
|
35047
35047
|
if (n > k || m > width) {
|
|
35048
35048
|
width = Math.max(m, width);
|
|
35049
|
-
curr = array$
|
|
35050
|
-
prev = array$
|
|
35049
|
+
curr = array$1(n, width, curr);
|
|
35050
|
+
prev = array$1(n, width);
|
|
35051
35051
|
}
|
|
35052
35052
|
}
|
|
35053
35053
|
};
|
|
@@ -35058,7 +35058,7 @@ function lengthen(array, length, copy) {
|
|
|
35058
35058
|
copy.set(array);
|
|
35059
35059
|
return copy;
|
|
35060
35060
|
}
|
|
35061
|
-
function array$
|
|
35061
|
+
function array$1(n, m, array) {
|
|
35062
35062
|
const copy = (m < 0x101 ? array8 : m < 0x10001 ? array16 : array32)(n);
|
|
35063
35063
|
if (array) copy.set(array);
|
|
35064
35064
|
return copy;
|
|
@@ -35114,7 +35114,7 @@ function SortedIndex() {
|
|
|
35114
35114
|
oldi = index;
|
|
35115
35115
|
value = Array(n0 + n1);
|
|
35116
35116
|
index = array32(n0 + n1);
|
|
35117
|
-
merge$
|
|
35117
|
+
merge$1(base, oldv, oldi, n0, addv, addi, n1, value, index);
|
|
35118
35118
|
} else {
|
|
35119
35119
|
if (base > 0) for (i = 0; i < n1; ++i) {
|
|
35120
35120
|
addi[i] += base;
|
|
@@ -35178,7 +35178,7 @@ function sort$1(values, index) {
|
|
|
35178
35178
|
});
|
|
35179
35179
|
return permute(values, index);
|
|
35180
35180
|
}
|
|
35181
|
-
function merge$
|
|
35181
|
+
function merge$1(base, value0, index0, n0, value1, index1, n1, value, index) {
|
|
35182
35182
|
let i0 = 0,
|
|
35183
35183
|
i1 = 0,
|
|
35184
35184
|
i;
|
|
@@ -37442,7 +37442,7 @@ function selectionResolve(name, op, isMulti, vl5) {
|
|
|
37442
37442
|
resUnit = res[unit] || (res[unit] = []);
|
|
37443
37443
|
types[field.field] = type = field.type.charAt(0);
|
|
37444
37444
|
union = ops[`${type}_union`];
|
|
37445
|
-
res[unit] = union(resUnit, array$
|
|
37445
|
+
res[unit] = union(resUnit, array$5(values[j]));
|
|
37446
37446
|
}
|
|
37447
37447
|
|
|
37448
37448
|
// If the same multi-selection is repeated over views and projected over
|
|
@@ -37453,7 +37453,7 @@ function selectionResolve(name, op, isMulti, vl5) {
|
|
|
37453
37453
|
// a more human-friendly one.
|
|
37454
37454
|
if (isMulti) {
|
|
37455
37455
|
resUnit = multiRes[unit] || (multiRes[unit] = []);
|
|
37456
|
-
resUnit.push(array$
|
|
37456
|
+
resUnit.push(array$5(values).reduce((obj, curr, j) => (obj[fields[j].field] = curr, obj), {}));
|
|
37457
37457
|
}
|
|
37458
37458
|
} else {
|
|
37459
37459
|
// Short circuit extensional selectionId stores which hold sorted IDs unique to each unit.
|
|
@@ -37536,15 +37536,15 @@ var ops = {
|
|
|
37536
37536
|
}
|
|
37537
37537
|
};
|
|
37538
37538
|
|
|
37539
|
-
const DataPrefix$
|
|
37540
|
-
IndexPrefix$
|
|
37539
|
+
const DataPrefix$1 = ':',
|
|
37540
|
+
IndexPrefix$1 = '@';
|
|
37541
37541
|
function selectionVisitor(name, args, scope, params) {
|
|
37542
37542
|
if (args[0].type !== Literal) error$1('First argument to selection functions must be a string literal.');
|
|
37543
37543
|
const data = args[0].value,
|
|
37544
37544
|
op = args.length >= 2 && peek$1(args).value,
|
|
37545
37545
|
field = 'unit',
|
|
37546
|
-
indexName = IndexPrefix$
|
|
37547
|
-
dataName = DataPrefix$
|
|
37546
|
+
indexName = IndexPrefix$1 + field,
|
|
37547
|
+
dataName = DataPrefix$1 + data;
|
|
37548
37548
|
|
|
37549
37549
|
// eslint-disable-next-line no-prototype-builtins
|
|
37550
37550
|
if (op === Intersect && !has$1(params, indexName)) {
|
|
@@ -37557,16 +37557,16 @@ function selectionVisitor(name, args, scope, params) {
|
|
|
37557
37557
|
}
|
|
37558
37558
|
}
|
|
37559
37559
|
|
|
37560
|
-
function data$
|
|
37560
|
+
function data$1(name) {
|
|
37561
37561
|
const data = this.context.data[name];
|
|
37562
37562
|
return data ? data.values.value : [];
|
|
37563
37563
|
}
|
|
37564
|
-
function indata
|
|
37564
|
+
function indata(name, field, value) {
|
|
37565
37565
|
const index = this.context.data[name]['index:' + field],
|
|
37566
37566
|
entry = index ? index.value.get(value) : undefined;
|
|
37567
37567
|
return entry ? entry.count : entry;
|
|
37568
37568
|
}
|
|
37569
|
-
function setdata
|
|
37569
|
+
function setdata(name, tuples) {
|
|
37570
37570
|
const df = this.context.dataflow,
|
|
37571
37571
|
data = this.context.data[name],
|
|
37572
37572
|
input = data.input;
|
|
@@ -37574,7 +37574,7 @@ function setdata$1(name, tuples) {
|
|
|
37574
37574
|
return 1;
|
|
37575
37575
|
}
|
|
37576
37576
|
|
|
37577
|
-
function encode
|
|
37577
|
+
function encode (item, name, retval) {
|
|
37578
37578
|
if (item) {
|
|
37579
37579
|
const df = this.context.dataflow,
|
|
37580
37580
|
target = item.mark.source;
|
|
@@ -37583,47 +37583,47 @@ function encode$1 (item, name, retval) {
|
|
|
37583
37583
|
return retval !== undefined ? retval : item;
|
|
37584
37584
|
}
|
|
37585
37585
|
|
|
37586
|
-
const wrap
|
|
37586
|
+
const wrap = method => function (value, spec) {
|
|
37587
37587
|
const locale = this.context.dataflow.locale();
|
|
37588
37588
|
return value === null ? 'null' : locale[method](spec)(value);
|
|
37589
37589
|
};
|
|
37590
|
-
const format
|
|
37591
|
-
const timeFormat$
|
|
37592
|
-
const utcFormat
|
|
37593
|
-
const timeParse
|
|
37594
|
-
const utcParse
|
|
37595
|
-
const dateObj
|
|
37596
|
-
function time
|
|
37590
|
+
const format = wrap('format');
|
|
37591
|
+
const timeFormat$1 = wrap('timeFormat');
|
|
37592
|
+
const utcFormat = wrap('utcFormat');
|
|
37593
|
+
const timeParse = wrap('timeParse');
|
|
37594
|
+
const utcParse = wrap('utcParse');
|
|
37595
|
+
const dateObj = new Date(2000, 0, 1);
|
|
37596
|
+
function time(month, day, specifier) {
|
|
37597
37597
|
if (!Number.isInteger(month) || !Number.isInteger(day)) return '';
|
|
37598
|
-
dateObj
|
|
37599
|
-
dateObj
|
|
37600
|
-
dateObj
|
|
37601
|
-
return timeFormat$
|
|
37598
|
+
dateObj.setYear(2000);
|
|
37599
|
+
dateObj.setMonth(month);
|
|
37600
|
+
dateObj.setDate(day);
|
|
37601
|
+
return timeFormat$1.call(this, dateObj, specifier);
|
|
37602
37602
|
}
|
|
37603
|
-
function monthFormat
|
|
37604
|
-
return time
|
|
37603
|
+
function monthFormat(month) {
|
|
37604
|
+
return time.call(this, month, 1, '%B');
|
|
37605
37605
|
}
|
|
37606
|
-
function monthAbbrevFormat
|
|
37607
|
-
return time
|
|
37606
|
+
function monthAbbrevFormat(month) {
|
|
37607
|
+
return time.call(this, month, 1, '%b');
|
|
37608
37608
|
}
|
|
37609
|
-
function dayFormat
|
|
37610
|
-
return time
|
|
37609
|
+
function dayFormat(day) {
|
|
37610
|
+
return time.call(this, 0, 2 + day, '%A');
|
|
37611
37611
|
}
|
|
37612
|
-
function dayAbbrevFormat
|
|
37613
|
-
return time
|
|
37612
|
+
function dayAbbrevFormat(day) {
|
|
37613
|
+
return time.call(this, 0, 2 + day, '%a');
|
|
37614
37614
|
}
|
|
37615
37615
|
|
|
37616
|
-
const DataPrefix
|
|
37617
|
-
const IndexPrefix
|
|
37618
|
-
const ScalePrefix
|
|
37619
|
-
const SignalPrefix
|
|
37616
|
+
const DataPrefix = ':';
|
|
37617
|
+
const IndexPrefix = '@';
|
|
37618
|
+
const ScalePrefix = '%';
|
|
37619
|
+
const SignalPrefix = '$';
|
|
37620
37620
|
|
|
37621
|
-
function dataVisitor
|
|
37621
|
+
function dataVisitor(name, args, scope, params) {
|
|
37622
37622
|
if (args[0].type !== Literal) {
|
|
37623
37623
|
error$1('First argument to data functions must be a string literal.');
|
|
37624
37624
|
}
|
|
37625
37625
|
const data = args[0].value,
|
|
37626
|
-
dataName = DataPrefix
|
|
37626
|
+
dataName = DataPrefix + data;
|
|
37627
37627
|
if (!has$1(dataName, params)) {
|
|
37628
37628
|
try {
|
|
37629
37629
|
params[dataName] = scope.getData(data).tuplesRef();
|
|
@@ -37632,29 +37632,29 @@ function dataVisitor$1(name, args, scope, params) {
|
|
|
37632
37632
|
}
|
|
37633
37633
|
}
|
|
37634
37634
|
}
|
|
37635
|
-
function indataVisitor
|
|
37635
|
+
function indataVisitor(name, args, scope, params) {
|
|
37636
37636
|
if (args[0].type !== Literal) error$1('First argument to indata must be a string literal.');
|
|
37637
37637
|
if (args[1].type !== Literal) error$1('Second argument to indata must be a string literal.');
|
|
37638
37638
|
const data = args[0].value,
|
|
37639
37639
|
field = args[1].value,
|
|
37640
|
-
indexName = IndexPrefix
|
|
37640
|
+
indexName = IndexPrefix + field;
|
|
37641
37641
|
if (!has$1(indexName, params)) {
|
|
37642
37642
|
params[indexName] = scope.getData(data).indataRef(scope, field);
|
|
37643
37643
|
}
|
|
37644
37644
|
}
|
|
37645
|
-
function scaleVisitor
|
|
37645
|
+
function scaleVisitor(name, args, scope, params) {
|
|
37646
37646
|
if (args[0].type === Literal) {
|
|
37647
37647
|
// add scale dependency
|
|
37648
|
-
addScaleDependency
|
|
37648
|
+
addScaleDependency(scope, params, args[0].value);
|
|
37649
37649
|
} else {
|
|
37650
37650
|
// indirect scale lookup; add all scales as parameters
|
|
37651
37651
|
for (name in scope.scales) {
|
|
37652
|
-
addScaleDependency
|
|
37652
|
+
addScaleDependency(scope, params, name);
|
|
37653
37653
|
}
|
|
37654
37654
|
}
|
|
37655
37655
|
}
|
|
37656
|
-
function addScaleDependency
|
|
37657
|
-
const scaleName = ScalePrefix
|
|
37656
|
+
function addScaleDependency(scope, params, name) {
|
|
37657
|
+
const scaleName = ScalePrefix + name;
|
|
37658
37658
|
if (!has$1(params, scaleName)) {
|
|
37659
37659
|
try {
|
|
37660
37660
|
params[scaleName] = scope.scaleRef(name);
|
|
@@ -37664,27 +37664,27 @@ function addScaleDependency$1(scope, params, name) {
|
|
|
37664
37664
|
}
|
|
37665
37665
|
}
|
|
37666
37666
|
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
|
|
37670
|
-
|
|
37671
|
-
if (isString(
|
|
37672
|
-
const maybeScale = ctx.scales[
|
|
37667
|
+
/**
|
|
37668
|
+
* Name must be a string. Return undefined if the scale is not registered.
|
|
37669
|
+
*/
|
|
37670
|
+
function getScale(name, ctx) {
|
|
37671
|
+
if (isString(name)) {
|
|
37672
|
+
const maybeScale = ctx.scales[name];
|
|
37673
37673
|
return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;
|
|
37674
37674
|
}
|
|
37675
37675
|
return undefined;
|
|
37676
37676
|
}
|
|
37677
|
-
function internalScaleFunctions
|
|
37677
|
+
function internalScaleFunctions(codegen, fnctx, visitors) {
|
|
37678
37678
|
// add helper method to the 'this' expression function context
|
|
37679
37679
|
fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;
|
|
37680
37680
|
|
|
37681
37681
|
// register AST visitors for internal scale functions
|
|
37682
|
-
visitors._bandwidth = scaleVisitor
|
|
37683
|
-
visitors._range = scaleVisitor
|
|
37684
|
-
visitors._scale = scaleVisitor
|
|
37682
|
+
visitors._bandwidth = scaleVisitor;
|
|
37683
|
+
visitors._range = scaleVisitor;
|
|
37684
|
+
visitors._scale = scaleVisitor;
|
|
37685
37685
|
|
|
37686
37686
|
// resolve scale reference directly to the signal hash argument
|
|
37687
|
-
const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix
|
|
37687
|
+
const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix + arg.value) : $(ScalePrefix) + '+' + codegen(arg)) + ']';
|
|
37688
37688
|
|
|
37689
37689
|
// define and return internal scale function code generators
|
|
37690
37690
|
// these internal functions are called by mark encoders
|
|
@@ -37695,11 +37695,11 @@ function internalScaleFunctions$1(codegen, fnctx, visitors) {
|
|
|
37695
37695
|
};
|
|
37696
37696
|
}
|
|
37697
37697
|
|
|
37698
|
-
function geoMethod
|
|
37698
|
+
function geoMethod(methodName, globalMethod) {
|
|
37699
37699
|
return function (projection, geojson, group) {
|
|
37700
37700
|
if (projection) {
|
|
37701
37701
|
// projection defined, use it
|
|
37702
|
-
const p = getScale
|
|
37702
|
+
const p = getScale(projection, (group || this).context);
|
|
37703
37703
|
return p && p.path[methodName](geojson);
|
|
37704
37704
|
} else {
|
|
37705
37705
|
// projection undefined, use global method
|
|
@@ -37707,15 +37707,15 @@ function geoMethod$1(methodName, globalMethod) {
|
|
|
37707
37707
|
}
|
|
37708
37708
|
};
|
|
37709
37709
|
}
|
|
37710
|
-
const geoArea
|
|
37711
|
-
const geoBounds
|
|
37712
|
-
const geoCentroid
|
|
37713
|
-
function geoScale
|
|
37714
|
-
const p = getScale
|
|
37710
|
+
const geoArea = geoMethod('area', geoArea$1);
|
|
37711
|
+
const geoBounds = geoMethod('bounds', geoBounds$1);
|
|
37712
|
+
const geoCentroid = geoMethod('centroid', geoCentroid$1);
|
|
37713
|
+
function geoScale(projection, group) {
|
|
37714
|
+
const p = getScale(projection, (group || this).context);
|
|
37715
37715
|
return p && p.scale();
|
|
37716
37716
|
}
|
|
37717
37717
|
|
|
37718
|
-
function inScope
|
|
37718
|
+
function inScope (item) {
|
|
37719
37719
|
const group = this.context.group;
|
|
37720
37720
|
let value = false;
|
|
37721
37721
|
if (group) while (item) {
|
|
@@ -37728,7 +37728,7 @@ function inScope$1 (item) {
|
|
|
37728
37728
|
return value;
|
|
37729
37729
|
}
|
|
37730
37730
|
|
|
37731
|
-
function log
|
|
37731
|
+
function log(df, method, args) {
|
|
37732
37732
|
try {
|
|
37733
37733
|
df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));
|
|
37734
37734
|
} catch (err) {
|
|
@@ -37736,66 +37736,66 @@ function log$1(df, method, args) {
|
|
|
37736
37736
|
}
|
|
37737
37737
|
return args[args.length - 1];
|
|
37738
37738
|
}
|
|
37739
|
-
function warn$
|
|
37740
|
-
return log
|
|
37739
|
+
function warn$1() {
|
|
37740
|
+
return log(this.context.dataflow, 'warn', arguments);
|
|
37741
37741
|
}
|
|
37742
|
-
function info
|
|
37743
|
-
return log
|
|
37742
|
+
function info() {
|
|
37743
|
+
return log(this.context.dataflow, 'info', arguments);
|
|
37744
37744
|
}
|
|
37745
|
-
function debug$
|
|
37746
|
-
return log
|
|
37745
|
+
function debug$1() {
|
|
37746
|
+
return log(this.context.dataflow, 'debug', arguments);
|
|
37747
37747
|
}
|
|
37748
37748
|
|
|
37749
37749
|
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
37750
|
-
function channel_luminance_value
|
|
37750
|
+
function channel_luminance_value(channelValue) {
|
|
37751
37751
|
const val = channelValue / 255;
|
|
37752
37752
|
if (val <= 0.03928) {
|
|
37753
37753
|
return val / 12.92;
|
|
37754
37754
|
}
|
|
37755
37755
|
return Math.pow((val + 0.055) / 1.055, 2.4);
|
|
37756
37756
|
}
|
|
37757
|
-
function luminance
|
|
37757
|
+
function luminance(color) {
|
|
37758
37758
|
const c = rgb$1(color),
|
|
37759
|
-
r = channel_luminance_value
|
|
37760
|
-
g = channel_luminance_value
|
|
37761
|
-
b = channel_luminance_value
|
|
37759
|
+
r = channel_luminance_value(c.r),
|
|
37760
|
+
g = channel_luminance_value(c.g),
|
|
37761
|
+
b = channel_luminance_value(c.b);
|
|
37762
37762
|
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
37763
37763
|
}
|
|
37764
37764
|
|
|
37765
37765
|
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
|
|
37766
|
-
function contrast
|
|
37767
|
-
const lum1 = luminance
|
|
37768
|
-
lum2 = luminance
|
|
37766
|
+
function contrast(color1, color2) {
|
|
37767
|
+
const lum1 = luminance(color1),
|
|
37768
|
+
lum2 = luminance(color2),
|
|
37769
37769
|
lumL = Math.max(lum1, lum2),
|
|
37770
37770
|
lumD = Math.min(lum1, lum2);
|
|
37771
37771
|
return (lumL + 0.05) / (lumD + 0.05);
|
|
37772
37772
|
}
|
|
37773
37773
|
|
|
37774
|
-
function merge
|
|
37774
|
+
function merge () {
|
|
37775
37775
|
const args = [].slice.call(arguments);
|
|
37776
37776
|
args.unshift({});
|
|
37777
37777
|
return extend$1(...args);
|
|
37778
37778
|
}
|
|
37779
37779
|
|
|
37780
|
-
function equal
|
|
37781
|
-
return a === b || a !== a && b !== b ? true : isArray(a) ? isArray(b) && a.length === b.length ? equalArray
|
|
37780
|
+
function equal(a, b) {
|
|
37781
|
+
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;
|
|
37782
37782
|
}
|
|
37783
|
-
function equalArray
|
|
37783
|
+
function equalArray(a, b) {
|
|
37784
37784
|
for (let i = 0, n = a.length; i < n; ++i) {
|
|
37785
|
-
if (!equal
|
|
37785
|
+
if (!equal(a[i], b[i])) return false;
|
|
37786
37786
|
}
|
|
37787
37787
|
return true;
|
|
37788
37788
|
}
|
|
37789
|
-
function equalObject
|
|
37789
|
+
function equalObject(a, b) {
|
|
37790
37790
|
for (const key in a) {
|
|
37791
|
-
if (!equal
|
|
37791
|
+
if (!equal(a[key], b[key])) return false;
|
|
37792
37792
|
}
|
|
37793
37793
|
return true;
|
|
37794
37794
|
}
|
|
37795
|
-
function removePredicate
|
|
37796
|
-
return _ => equalObject
|
|
37795
|
+
function removePredicate(props) {
|
|
37796
|
+
return _ => equalObject(props, _);
|
|
37797
37797
|
}
|
|
37798
|
-
function modify
|
|
37798
|
+
function modify (name, insert, remove, toggle, modify, values) {
|
|
37799
37799
|
const df = this.context.dataflow,
|
|
37800
37800
|
data = this.context.data[name],
|
|
37801
37801
|
input = data.input,
|
|
@@ -37816,14 +37816,14 @@ function modify$1 (name, insert, remove, toggle, modify, values) {
|
|
|
37816
37816
|
}, true, 1);
|
|
37817
37817
|
}
|
|
37818
37818
|
if (remove) {
|
|
37819
|
-
predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate
|
|
37819
|
+
predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);
|
|
37820
37820
|
changes.remove(predicate);
|
|
37821
37821
|
}
|
|
37822
37822
|
if (insert) {
|
|
37823
37823
|
changes.insert(insert);
|
|
37824
37824
|
}
|
|
37825
37825
|
if (toggle) {
|
|
37826
|
-
predicate = removePredicate
|
|
37826
|
+
predicate = removePredicate(toggle);
|
|
37827
37827
|
if (input.value.some(predicate)) {
|
|
37828
37828
|
changes.remove(predicate);
|
|
37829
37829
|
} else {
|
|
@@ -37838,92 +37838,99 @@ function modify$1 (name, insert, remove, toggle, modify, values) {
|
|
|
37838
37838
|
return 1;
|
|
37839
37839
|
}
|
|
37840
37840
|
|
|
37841
|
-
function pinchDistance
|
|
37841
|
+
function pinchDistance(event) {
|
|
37842
37842
|
const t = event.touches,
|
|
37843
37843
|
dx = t[0].clientX - t[1].clientX,
|
|
37844
37844
|
dy = t[0].clientY - t[1].clientY;
|
|
37845
37845
|
return Math.hypot(dx, dy);
|
|
37846
37846
|
}
|
|
37847
|
-
function pinchAngle
|
|
37847
|
+
function pinchAngle(event) {
|
|
37848
37848
|
const t = event.touches;
|
|
37849
37849
|
return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);
|
|
37850
37850
|
}
|
|
37851
37851
|
|
|
37852
37852
|
// memoize accessor functions
|
|
37853
|
-
const accessors
|
|
37854
|
-
function pluck
|
|
37855
|
-
const accessor = accessors
|
|
37853
|
+
const accessors = {};
|
|
37854
|
+
function pluck (data, name) {
|
|
37855
|
+
const accessor = accessors[name] || (accessors[name] = field$1(name));
|
|
37856
37856
|
return isArray(data) ? data.map(accessor) : accessor(data);
|
|
37857
37857
|
}
|
|
37858
37858
|
|
|
37859
|
-
function array
|
|
37859
|
+
function array(seq) {
|
|
37860
37860
|
return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;
|
|
37861
37861
|
}
|
|
37862
|
-
function sequence
|
|
37863
|
-
return array
|
|
37862
|
+
function sequence(seq) {
|
|
37863
|
+
return array(seq) || (isString(seq) ? seq : null);
|
|
37864
37864
|
}
|
|
37865
|
-
function join
|
|
37865
|
+
function join(seq) {
|
|
37866
37866
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
37867
37867
|
args[_key - 1] = arguments[_key];
|
|
37868
37868
|
}
|
|
37869
|
-
return array
|
|
37869
|
+
return array(seq).join(...args);
|
|
37870
37870
|
}
|
|
37871
|
-
function indexof
|
|
37871
|
+
function indexof(seq) {
|
|
37872
37872
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
37873
37873
|
args[_key2 - 1] = arguments[_key2];
|
|
37874
37874
|
}
|
|
37875
|
-
return sequence
|
|
37875
|
+
return sequence(seq).indexOf(...args);
|
|
37876
37876
|
}
|
|
37877
|
-
function lastindexof
|
|
37877
|
+
function lastindexof(seq) {
|
|
37878
37878
|
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
37879
37879
|
args[_key3 - 1] = arguments[_key3];
|
|
37880
37880
|
}
|
|
37881
|
-
return sequence
|
|
37881
|
+
return sequence(seq).lastIndexOf(...args);
|
|
37882
37882
|
}
|
|
37883
|
-
function slice$
|
|
37883
|
+
function slice$1(seq) {
|
|
37884
37884
|
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
37885
37885
|
args[_key4 - 1] = arguments[_key4];
|
|
37886
37886
|
}
|
|
37887
|
-
return sequence
|
|
37887
|
+
return sequence(seq).slice(...args);
|
|
37888
37888
|
}
|
|
37889
|
-
function replace
|
|
37889
|
+
function replace(str, pattern, repl) {
|
|
37890
37890
|
if (isFunction(repl)) error$1('Function argument passed to replace.');
|
|
37891
37891
|
return String(str).replace(pattern, repl);
|
|
37892
37892
|
}
|
|
37893
|
-
function reverse$
|
|
37894
|
-
return array
|
|
37893
|
+
function reverse$1(seq) {
|
|
37894
|
+
return array(seq).slice().reverse();
|
|
37895
|
+
}
|
|
37896
|
+
function sort(seq) {
|
|
37897
|
+
return array(seq).slice().sort(ascending$2);
|
|
37895
37898
|
}
|
|
37896
37899
|
|
|
37897
|
-
function bandspace
|
|
37900
|
+
function bandspace(count, paddingInner, paddingOuter) {
|
|
37898
37901
|
return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);
|
|
37899
37902
|
}
|
|
37900
|
-
function bandwidth
|
|
37901
|
-
const s = getScale
|
|
37903
|
+
function bandwidth(name, group) {
|
|
37904
|
+
const s = getScale(name, (group || this).context);
|
|
37902
37905
|
return s && s.bandwidth ? s.bandwidth() : 0;
|
|
37903
37906
|
}
|
|
37904
|
-
function copy
|
|
37905
|
-
const s = getScale
|
|
37907
|
+
function copy(name, group) {
|
|
37908
|
+
const s = getScale(name, (group || this).context);
|
|
37906
37909
|
return s ? s.copy() : undefined;
|
|
37907
37910
|
}
|
|
37908
|
-
function domain$
|
|
37909
|
-
const s = getScale
|
|
37911
|
+
function domain$2(name, group) {
|
|
37912
|
+
const s = getScale(name, (group || this).context);
|
|
37910
37913
|
return s ? s.domain() : [];
|
|
37911
37914
|
}
|
|
37912
|
-
function invert
|
|
37913
|
-
const s = getScale
|
|
37915
|
+
function invert(name, range, group) {
|
|
37916
|
+
const s = getScale(name, (group || this).context);
|
|
37914
37917
|
return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);
|
|
37915
37918
|
}
|
|
37916
|
-
function range$
|
|
37917
|
-
const s = getScale
|
|
37919
|
+
function range$3(name, group) {
|
|
37920
|
+
const s = getScale(name, (group || this).context);
|
|
37918
37921
|
return s && s.range ? s.range() : [];
|
|
37919
37922
|
}
|
|
37920
|
-
function scale$
|
|
37921
|
-
const s = getScale
|
|
37923
|
+
function scale$2(name, value, group) {
|
|
37924
|
+
const s = getScale(name, (group || this).context);
|
|
37922
37925
|
return s ? s(value) : undefined;
|
|
37923
37926
|
}
|
|
37924
37927
|
|
|
37925
|
-
|
|
37926
|
-
|
|
37928
|
+
/**
|
|
37929
|
+
* Passing a function is only used for for testing.
|
|
37930
|
+
* Outside of tests, the first argument should be a string.
|
|
37931
|
+
*/
|
|
37932
|
+
function scaleGradient (scaleOrFunction, p0, p1, count, group) {
|
|
37933
|
+
let scale = typeof scaleOrFunction === 'string' ? getScale(scaleOrFunction, (group || this).context) : scaleOrFunction;
|
|
37927
37934
|
const gradient = Gradient$1(p0, p1);
|
|
37928
37935
|
let stops = scale.domain(),
|
|
37929
37936
|
min = stops[0],
|
|
@@ -37931,7 +37938,7 @@ function scaleGradient$1 (scale, p0, p1, count, group) {
|
|
|
37931
37938
|
fraction = identity$7;
|
|
37932
37939
|
if (!(max - min)) {
|
|
37933
37940
|
// expand scale if domain has zero span, fix #1479
|
|
37934
|
-
scale = (scale.interpolator ? scale$
|
|
37941
|
+
scale = (scale.interpolator ? scale$4('sequential')().interpolator(scale.interpolator()) : scale$4('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);
|
|
37935
37942
|
} else {
|
|
37936
37943
|
fraction = scaleFraction(scale, min, max);
|
|
37937
37944
|
}
|
|
@@ -37944,62 +37951,62 @@ function scaleGradient$1 (scale, p0, p1, count, group) {
|
|
|
37944
37951
|
return gradient;
|
|
37945
37952
|
}
|
|
37946
37953
|
|
|
37947
|
-
function geoShape
|
|
37948
|
-
const p = getScale
|
|
37954
|
+
function geoShape(projection, geojson, group) {
|
|
37955
|
+
const p = getScale(projection, (group || this).context);
|
|
37949
37956
|
return function (context) {
|
|
37950
37957
|
return p ? p.path.context(context)(geojson) : '';
|
|
37951
37958
|
};
|
|
37952
37959
|
}
|
|
37953
|
-
function pathShape
|
|
37960
|
+
function pathShape(path) {
|
|
37954
37961
|
let p = null;
|
|
37955
37962
|
return function (context) {
|
|
37956
37963
|
return context ? pathRender(context, p = p || parse$3(path)) : path;
|
|
37957
37964
|
};
|
|
37958
37965
|
}
|
|
37959
37966
|
|
|
37960
|
-
const datum
|
|
37961
|
-
function treeNodes
|
|
37962
|
-
const tree = data$
|
|
37967
|
+
const datum = d => d.data;
|
|
37968
|
+
function treeNodes(name, context) {
|
|
37969
|
+
const tree = data$1.call(context, name);
|
|
37963
37970
|
return tree.root && tree.root.lookup || {};
|
|
37964
37971
|
}
|
|
37965
|
-
function treePath
|
|
37966
|
-
const nodes = treeNodes
|
|
37972
|
+
function treePath(name, source, target) {
|
|
37973
|
+
const nodes = treeNodes(name, this),
|
|
37967
37974
|
s = nodes[source],
|
|
37968
37975
|
t = nodes[target];
|
|
37969
|
-
return s && t ? s.path(t).map(datum
|
|
37976
|
+
return s && t ? s.path(t).map(datum) : undefined;
|
|
37970
37977
|
}
|
|
37971
|
-
function treeAncestors
|
|
37972
|
-
const n = treeNodes
|
|
37973
|
-
return n ? n.ancestors().map(datum
|
|
37978
|
+
function treeAncestors(name, node) {
|
|
37979
|
+
const n = treeNodes(name, this)[node];
|
|
37980
|
+
return n ? n.ancestors().map(datum) : undefined;
|
|
37974
37981
|
}
|
|
37975
37982
|
|
|
37976
|
-
const _window
|
|
37977
|
-
function screen
|
|
37978
|
-
const w = _window
|
|
37983
|
+
const _window = () => typeof window !== 'undefined' && window || null;
|
|
37984
|
+
function screen() {
|
|
37985
|
+
const w = _window();
|
|
37979
37986
|
return w ? w.screen : {};
|
|
37980
37987
|
}
|
|
37981
|
-
function windowSize
|
|
37982
|
-
const w = _window
|
|
37988
|
+
function windowSize() {
|
|
37989
|
+
const w = _window();
|
|
37983
37990
|
return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];
|
|
37984
37991
|
}
|
|
37985
|
-
function containerSize
|
|
37992
|
+
function containerSize() {
|
|
37986
37993
|
const view = this.context.dataflow,
|
|
37987
37994
|
el = view.container && view.container();
|
|
37988
37995
|
return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];
|
|
37989
37996
|
}
|
|
37990
37997
|
|
|
37991
|
-
function intersect
|
|
37998
|
+
function intersect (b, opt, group) {
|
|
37992
37999
|
if (!b) return [];
|
|
37993
38000
|
const [u, v] = b,
|
|
37994
38001
|
box = new Bounds().set(u[0], u[1], v[0], v[1]),
|
|
37995
38002
|
scene = group || this.context.dataflow.scenegraph().root;
|
|
37996
|
-
return intersect$
|
|
38003
|
+
return intersect$2(scene, box, filter(opt));
|
|
37997
38004
|
}
|
|
37998
|
-
function filter
|
|
38005
|
+
function filter(opt) {
|
|
37999
38006
|
let p = null;
|
|
38000
38007
|
if (opt) {
|
|
38001
|
-
const types = array$
|
|
38002
|
-
names = array$
|
|
38008
|
+
const types = array$5(opt.marktype),
|
|
38009
|
+
names = array$5(opt.markname);
|
|
38003
38010
|
p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));
|
|
38004
38011
|
}
|
|
38005
38012
|
return p;
|
|
@@ -38014,9 +38021,9 @@ function filter$1(opt) {
|
|
|
38014
38021
|
* @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point
|
|
38015
38022
|
* @returns a new array containing the lasso with the new point
|
|
38016
38023
|
*/
|
|
38017
|
-
function lassoAppend
|
|
38024
|
+
function lassoAppend(lasso, x, y) {
|
|
38018
38025
|
let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
|
|
38019
|
-
lasso = array$
|
|
38026
|
+
lasso = array$5(lasso);
|
|
38020
38027
|
const last = lasso[lasso.length - 1];
|
|
38021
38028
|
|
|
38022
38029
|
// Add point to lasso if its the first point or distance to last point exceed minDist
|
|
@@ -38029,8 +38036,8 @@ function lassoAppend$1(lasso, x, y) {
|
|
|
38029
38036
|
* @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]
|
|
38030
38037
|
* @returns the svg path command that draws the lasso
|
|
38031
38038
|
*/
|
|
38032
|
-
function lassoPath
|
|
38033
|
-
return array$
|
|
38039
|
+
function lassoPath(lasso) {
|
|
38040
|
+
return array$5(lasso).reduce((svg, _ref, i) => {
|
|
38034
38041
|
let [x, y] = _ref;
|
|
38035
38042
|
return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;
|
|
38036
38043
|
}, '');
|
|
@@ -38045,7 +38052,7 @@ function lassoPath$1(lasso) {
|
|
|
38045
38052
|
*
|
|
38046
38053
|
* @returns an array of vega scenegraph tuples
|
|
38047
38054
|
*/
|
|
38048
|
-
function intersectLasso
|
|
38055
|
+
function intersectLasso(markname, pixelLasso, unit) {
|
|
38049
38056
|
const {
|
|
38050
38057
|
x,
|
|
38051
38058
|
y,
|
|
@@ -38063,10 +38070,10 @@ function intersectLasso$1(markname, pixelLasso, unit) {
|
|
|
38063
38070
|
|
|
38064
38071
|
// Translate bb against unit coordinates
|
|
38065
38072
|
bb.translate(x, y);
|
|
38066
|
-
const intersection = intersect
|
|
38073
|
+
const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);
|
|
38067
38074
|
|
|
38068
38075
|
// Check every point against the lasso
|
|
38069
|
-
return intersection.filter(tuple => pointInPolygon
|
|
38076
|
+
return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));
|
|
38070
38077
|
}
|
|
38071
38078
|
|
|
38072
38079
|
/**
|
|
@@ -38079,7 +38086,7 @@ function intersectLasso$1(markname, pixelLasso, unit) {
|
|
|
38079
38086
|
* @param {*} polygon a polygon in the form [[x,y], [x,y], ...]
|
|
38080
38087
|
* @returns true if the point lies inside the polygon, false otherwise
|
|
38081
38088
|
*/
|
|
38082
|
-
function pointInPolygon
|
|
38089
|
+
function pointInPolygon(testx, testy, polygon) {
|
|
38083
38090
|
let intersections = 0;
|
|
38084
38091
|
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
38085
38092
|
const [prevX, prevY] = polygon[j];
|
|
@@ -38096,7 +38103,7 @@ function pointInPolygon$1(testx, testy, polygon) {
|
|
|
38096
38103
|
}
|
|
38097
38104
|
|
|
38098
38105
|
// Expression function context object
|
|
38099
|
-
const functionContext
|
|
38106
|
+
const functionContext = {
|
|
38100
38107
|
random() {
|
|
38101
38108
|
return random();
|
|
38102
38109
|
},
|
|
@@ -38134,18 +38141,19 @@ const functionContext$1 = {
|
|
|
38134
38141
|
// suppress extra arguments
|
|
38135
38142
|
toNumber,
|
|
38136
38143
|
toString,
|
|
38137
|
-
indexof
|
|
38138
|
-
join
|
|
38139
|
-
lastindexof
|
|
38140
|
-
replace
|
|
38141
|
-
reverse: reverse$
|
|
38142
|
-
|
|
38144
|
+
indexof,
|
|
38145
|
+
join,
|
|
38146
|
+
lastindexof,
|
|
38147
|
+
replace,
|
|
38148
|
+
reverse: reverse$1,
|
|
38149
|
+
sort,
|
|
38150
|
+
slice: slice$1,
|
|
38143
38151
|
flush,
|
|
38144
38152
|
lerp,
|
|
38145
|
-
merge
|
|
38153
|
+
merge,
|
|
38146
38154
|
pad: pad$3,
|
|
38147
38155
|
peek: peek$1,
|
|
38148
|
-
pluck
|
|
38156
|
+
pluck,
|
|
38149
38157
|
span,
|
|
38150
38158
|
inrange,
|
|
38151
38159
|
truncate: truncate$1,
|
|
@@ -38153,47 +38161,47 @@ const functionContext$1 = {
|
|
|
38153
38161
|
lab: lab$1,
|
|
38154
38162
|
hcl: hcl$2,
|
|
38155
38163
|
hsl: hsl$2,
|
|
38156
|
-
luminance
|
|
38157
|
-
contrast
|
|
38158
|
-
sequence: range$
|
|
38159
|
-
format
|
|
38160
|
-
utcFormat
|
|
38161
|
-
utcParse
|
|
38164
|
+
luminance,
|
|
38165
|
+
contrast,
|
|
38166
|
+
sequence: range$5,
|
|
38167
|
+
format,
|
|
38168
|
+
utcFormat,
|
|
38169
|
+
utcParse,
|
|
38162
38170
|
utcOffset,
|
|
38163
38171
|
utcSequence,
|
|
38164
|
-
timeFormat: timeFormat$
|
|
38165
|
-
timeParse
|
|
38172
|
+
timeFormat: timeFormat$1,
|
|
38173
|
+
timeParse,
|
|
38166
38174
|
timeOffset,
|
|
38167
38175
|
timeSequence,
|
|
38168
38176
|
timeUnitSpecifier,
|
|
38169
|
-
monthFormat
|
|
38170
|
-
monthAbbrevFormat
|
|
38171
|
-
dayFormat
|
|
38172
|
-
dayAbbrevFormat
|
|
38177
|
+
monthFormat,
|
|
38178
|
+
monthAbbrevFormat,
|
|
38179
|
+
dayFormat,
|
|
38180
|
+
dayAbbrevFormat,
|
|
38173
38181
|
quarter,
|
|
38174
38182
|
utcquarter,
|
|
38175
38183
|
week,
|
|
38176
38184
|
utcweek,
|
|
38177
38185
|
dayofyear,
|
|
38178
38186
|
utcdayofyear,
|
|
38179
|
-
warn: warn$
|
|
38180
|
-
info
|
|
38181
|
-
debug: debug$
|
|
38187
|
+
warn: warn$1,
|
|
38188
|
+
info,
|
|
38189
|
+
debug: debug$1,
|
|
38182
38190
|
extent(_) {
|
|
38183
38191
|
return extent(_);
|
|
38184
38192
|
},
|
|
38185
38193
|
// suppress extra arguments
|
|
38186
|
-
inScope
|
|
38187
|
-
intersect
|
|
38194
|
+
inScope,
|
|
38195
|
+
intersect,
|
|
38188
38196
|
clampRange,
|
|
38189
|
-
pinchDistance
|
|
38190
|
-
pinchAngle
|
|
38191
|
-
screen
|
|
38192
|
-
containerSize
|
|
38193
|
-
windowSize
|
|
38194
|
-
bandspace
|
|
38195
|
-
setdata
|
|
38196
|
-
pathShape
|
|
38197
|
+
pinchDistance,
|
|
38198
|
+
pinchAngle,
|
|
38199
|
+
screen,
|
|
38200
|
+
containerSize,
|
|
38201
|
+
windowSize,
|
|
38202
|
+
bandspace,
|
|
38203
|
+
setdata,
|
|
38204
|
+
pathShape,
|
|
38197
38205
|
panLinear,
|
|
38198
38206
|
panLog,
|
|
38199
38207
|
panPow,
|
|
@@ -38202,86 +38210,129 @@ const functionContext$1 = {
|
|
|
38202
38210
|
zoomLog,
|
|
38203
38211
|
zoomPow,
|
|
38204
38212
|
zoomSymlog,
|
|
38205
|
-
encode
|
|
38206
|
-
modify
|
|
38207
|
-
lassoAppend
|
|
38208
|
-
lassoPath
|
|
38209
|
-
intersectLasso
|
|
38213
|
+
encode,
|
|
38214
|
+
modify,
|
|
38215
|
+
lassoAppend,
|
|
38216
|
+
lassoPath,
|
|
38217
|
+
intersectLasso
|
|
38210
38218
|
};
|
|
38211
|
-
const eventFunctions
|
|
38219
|
+
const eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],
|
|
38212
38220
|
// event functions
|
|
38213
|
-
eventPrefix
|
|
38221
|
+
eventPrefix = 'event.vega.',
|
|
38214
38222
|
// event function prefix
|
|
38215
|
-
thisPrefix
|
|
38223
|
+
thisPrefix = 'this.',
|
|
38216
38224
|
// function context prefix
|
|
38217
|
-
astVisitors
|
|
38225
|
+
astVisitors = {}; // AST visitors for dependency analysis
|
|
38218
38226
|
|
|
38219
38227
|
// export code generator parameters
|
|
38220
|
-
const codegenParams
|
|
38228
|
+
const codegenParams = {
|
|
38221
38229
|
forbidden: ['_'],
|
|
38222
38230
|
allowed: ['datum', 'event', 'item'],
|
|
38223
38231
|
fieldvar: 'datum',
|
|
38224
|
-
globalvar: id => `_[${$(SignalPrefix
|
|
38225
|
-
functions: buildFunctions
|
|
38232
|
+
globalvar: id => `_[${$(SignalPrefix + id)}]`,
|
|
38233
|
+
functions: buildFunctions,
|
|
38226
38234
|
constants: Constants$1,
|
|
38227
|
-
visitors: astVisitors
|
|
38235
|
+
visitors: astVisitors
|
|
38228
38236
|
};
|
|
38229
38237
|
|
|
38230
38238
|
// export code generator
|
|
38231
|
-
const codeGenerator
|
|
38239
|
+
const codeGenerator = codegen(codegenParams);
|
|
38232
38240
|
|
|
38233
38241
|
// Build expression function registry
|
|
38234
|
-
function buildFunctions
|
|
38242
|
+
function buildFunctions(codegen) {
|
|
38235
38243
|
const fn = Functions$1(codegen);
|
|
38236
|
-
eventFunctions
|
|
38237
|
-
for (const name in functionContext
|
|
38238
|
-
fn[name] = thisPrefix
|
|
38244
|
+
eventFunctions.forEach(name => fn[name] = eventPrefix + name);
|
|
38245
|
+
for (const name in functionContext) {
|
|
38246
|
+
fn[name] = thisPrefix + name;
|
|
38239
38247
|
}
|
|
38240
|
-
extend$1(fn, internalScaleFunctions
|
|
38248
|
+
extend$1(fn, internalScaleFunctions(codegen, functionContext, astVisitors));
|
|
38241
38249
|
return fn;
|
|
38242
38250
|
}
|
|
38243
38251
|
|
|
38244
38252
|
// Register an expression function
|
|
38245
|
-
function expressionFunction
|
|
38253
|
+
function expressionFunction(name, fn, visitor) {
|
|
38246
38254
|
if (arguments.length === 1) {
|
|
38247
|
-
return functionContext
|
|
38255
|
+
return functionContext[name];
|
|
38248
38256
|
}
|
|
38249
38257
|
|
|
38250
38258
|
// register with the functionContext
|
|
38251
|
-
functionContext
|
|
38259
|
+
functionContext[name] = fn;
|
|
38252
38260
|
|
|
38253
38261
|
// if there is an astVisitor register that, too
|
|
38254
|
-
if (visitor) astVisitors
|
|
38262
|
+
if (visitor) astVisitors[name] = visitor;
|
|
38255
38263
|
|
|
38256
38264
|
// if the code generator has already been initialized,
|
|
38257
38265
|
// we need to also register the function with it
|
|
38258
|
-
if (codeGenerator
|
|
38266
|
+
if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;
|
|
38259
38267
|
return this;
|
|
38260
38268
|
}
|
|
38261
38269
|
|
|
38262
38270
|
// register expression functions with ast visitors
|
|
38263
|
-
expressionFunction
|
|
38264
|
-
expressionFunction
|
|
38265
|
-
expressionFunction
|
|
38266
|
-
expressionFunction
|
|
38267
|
-
expressionFunction
|
|
38268
|
-
expressionFunction
|
|
38269
|
-
expressionFunction
|
|
38270
|
-
expressionFunction
|
|
38271
|
-
expressionFunction
|
|
38272
|
-
expressionFunction
|
|
38273
|
-
expressionFunction
|
|
38274
|
-
expressionFunction
|
|
38275
|
-
expressionFunction
|
|
38276
|
-
expressionFunction
|
|
38277
|
-
expressionFunction
|
|
38278
|
-
expressionFunction
|
|
38271
|
+
expressionFunction('bandwidth', bandwidth, scaleVisitor);
|
|
38272
|
+
expressionFunction('copy', copy, scaleVisitor);
|
|
38273
|
+
expressionFunction('domain', domain$2, scaleVisitor);
|
|
38274
|
+
expressionFunction('range', range$3, scaleVisitor);
|
|
38275
|
+
expressionFunction('invert', invert, scaleVisitor);
|
|
38276
|
+
expressionFunction('scale', scale$2, scaleVisitor);
|
|
38277
|
+
expressionFunction('gradient', scaleGradient, scaleVisitor);
|
|
38278
|
+
expressionFunction('geoArea', geoArea, scaleVisitor);
|
|
38279
|
+
expressionFunction('geoBounds', geoBounds, scaleVisitor);
|
|
38280
|
+
expressionFunction('geoCentroid', geoCentroid, scaleVisitor);
|
|
38281
|
+
expressionFunction('geoShape', geoShape, scaleVisitor);
|
|
38282
|
+
expressionFunction('geoScale', geoScale, scaleVisitor);
|
|
38283
|
+
expressionFunction('indata', indata, indataVisitor);
|
|
38284
|
+
expressionFunction('data', data$1, dataVisitor);
|
|
38285
|
+
expressionFunction('treePath', treePath, dataVisitor);
|
|
38286
|
+
expressionFunction('treeAncestors', treeAncestors, dataVisitor);
|
|
38279
38287
|
|
|
38280
38288
|
// register Vega-Lite selection functions
|
|
38281
|
-
expressionFunction
|
|
38282
|
-
expressionFunction
|
|
38283
|
-
expressionFunction
|
|
38284
|
-
expressionFunction
|
|
38289
|
+
expressionFunction('vlSelectionTest', selectionTest, selectionVisitor);
|
|
38290
|
+
expressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);
|
|
38291
|
+
expressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);
|
|
38292
|
+
expressionFunction('vlSelectionTuples', selectionTuples);
|
|
38293
|
+
|
|
38294
|
+
function parser (expr, scope) {
|
|
38295
|
+
const params = {};
|
|
38296
|
+
|
|
38297
|
+
// parse the expression to an abstract syntax tree (ast)
|
|
38298
|
+
let ast;
|
|
38299
|
+
try {
|
|
38300
|
+
expr = isString(expr) ? expr : $(expr) + '';
|
|
38301
|
+
ast = parser$1(expr);
|
|
38302
|
+
} catch (err) {
|
|
38303
|
+
error$1('Expression parse error: ' + expr);
|
|
38304
|
+
}
|
|
38305
|
+
|
|
38306
|
+
// analyze ast function calls for dependencies
|
|
38307
|
+
ast.visit(node => {
|
|
38308
|
+
if (node.type !== CallExpression) return;
|
|
38309
|
+
const name = node.callee.name,
|
|
38310
|
+
visit = codegenParams.visitors[name];
|
|
38311
|
+
if (visit) visit(name, node.arguments, scope, params);
|
|
38312
|
+
});
|
|
38313
|
+
|
|
38314
|
+
// perform code generation
|
|
38315
|
+
const gen = codeGenerator(ast);
|
|
38316
|
+
|
|
38317
|
+
// collect signal dependencies
|
|
38318
|
+
gen.globals.forEach(name => {
|
|
38319
|
+
const signalName = SignalPrefix + name;
|
|
38320
|
+
if (!has$1(params, signalName) && scope.getSignal(name)) {
|
|
38321
|
+
params[signalName] = scope.signalRef(name);
|
|
38322
|
+
}
|
|
38323
|
+
});
|
|
38324
|
+
|
|
38325
|
+
// return generated expression code and dependencies
|
|
38326
|
+
return {
|
|
38327
|
+
$expr: extend$1({
|
|
38328
|
+
code: gen.code
|
|
38329
|
+
}, scope.options.ast ? {
|
|
38330
|
+
ast
|
|
38331
|
+
} : null),
|
|
38332
|
+
$fields: gen.fields,
|
|
38333
|
+
$params: params
|
|
38334
|
+
};
|
|
38335
|
+
}
|
|
38285
38336
|
|
|
38286
38337
|
/**
|
|
38287
38338
|
* Parse a serialized dataflow specification.
|
|
@@ -38570,7 +38621,7 @@ function getCompare(_, ctx) {
|
|
|
38570
38621
|
// As of Vega 5.5.3, $tupleid sort is no longer used.
|
|
38571
38622
|
// Keep here for now for backwards compatibility.
|
|
38572
38623
|
const k = 'c:' + _.$compare + '_' + _.$order,
|
|
38573
|
-
c = array$
|
|
38624
|
+
c = array$5(_.$compare).map(_ => _ && _.$tupleid ? tupleid : _);
|
|
38574
38625
|
return ctx.fn[k] || (ctx.fn[k] = compare$2(c, _.$order, ctx.expr.codegen));
|
|
38575
38626
|
}
|
|
38576
38627
|
|
|
@@ -38938,7 +38989,7 @@ function dataref(view, name) {
|
|
|
38938
38989
|
}
|
|
38939
38990
|
return data[name];
|
|
38940
38991
|
}
|
|
38941
|
-
function data
|
|
38992
|
+
function data(name, values) {
|
|
38942
38993
|
return arguments.length < 2 ? dataref(this, name).values.value : change.call(this, name, changeset().remove(truthy).insert(values));
|
|
38943
38994
|
}
|
|
38944
38995
|
function change(name, changes) {
|
|
@@ -39091,7 +39142,7 @@ function initializeEventConfig(config) {
|
|
|
39091
39142
|
function trackEventListener(view, sources, type, handler) {
|
|
39092
39143
|
view._eventListeners.push({
|
|
39093
39144
|
type: type,
|
|
39094
|
-
sources: array$
|
|
39145
|
+
sources: array$5(sources),
|
|
39095
39146
|
handler: handler
|
|
39096
39147
|
});
|
|
39097
39148
|
}
|
|
@@ -39336,7 +39387,7 @@ function generate$1(bind, el, param, view) {
|
|
|
39336
39387
|
input = radio;
|
|
39337
39388
|
break;
|
|
39338
39389
|
case 'range':
|
|
39339
|
-
input = range$
|
|
39390
|
+
input = range$2;
|
|
39340
39391
|
break;
|
|
39341
39392
|
}
|
|
39342
39393
|
input(bind, wrapper, param, value);
|
|
@@ -39442,7 +39493,7 @@ function radio(bind, el, param, value) {
|
|
|
39442
39493
|
/**
|
|
39443
39494
|
* Generates a slider input element.
|
|
39444
39495
|
*/
|
|
39445
|
-
function range$
|
|
39496
|
+
function range$2(bind, el, param, value) {
|
|
39446
39497
|
value = value !== undefined ? value : (+param.max + +param.min) / 2;
|
|
39447
39498
|
const max = param.max != null ? param.max : Math.max(100, +value) || 100,
|
|
39448
39499
|
min = param.min || Math.min(0, max, +value) || 0,
|
|
@@ -39639,10 +39690,10 @@ async function renderToSVG (scaleFactor) {
|
|
|
39639
39690
|
}
|
|
39640
39691
|
|
|
39641
39692
|
function runtime (view, spec, expr) {
|
|
39642
|
-
return context(view, transforms, functionContext
|
|
39693
|
+
return context(view, transforms, functionContext, expr).parse(spec);
|
|
39643
39694
|
}
|
|
39644
39695
|
|
|
39645
|
-
function scale$
|
|
39696
|
+
function scale$1(name) {
|
|
39646
39697
|
var scales = this._runtime.scales;
|
|
39647
39698
|
if (!has$1(scales, name)) {
|
|
39648
39699
|
error$1('Unrecognized scale or projection: ' + name);
|
|
@@ -40140,12 +40191,12 @@ inherits(View$1, Dataflow, {
|
|
|
40140
40191
|
finalize,
|
|
40141
40192
|
hover,
|
|
40142
40193
|
// -- DATA ----
|
|
40143
|
-
data
|
|
40194
|
+
data,
|
|
40144
40195
|
change,
|
|
40145
40196
|
insert,
|
|
40146
40197
|
remove,
|
|
40147
40198
|
// -- SCALES --
|
|
40148
|
-
scale: scale$
|
|
40199
|
+
scale: scale$1,
|
|
40149
40200
|
// -- INITIALIZATION ----
|
|
40150
40201
|
initialize,
|
|
40151
40202
|
// -- HEADLESS RENDERING ----
|
|
@@ -40159,783 +40210,6 @@ inherits(View$1, Dataflow, {
|
|
|
40159
40210
|
_watchPixelRatio: watchPixelRatio
|
|
40160
40211
|
});
|
|
40161
40212
|
|
|
40162
|
-
function data(name) {
|
|
40163
|
-
const data = this.context.data[name];
|
|
40164
|
-
return data ? data.values.value : [];
|
|
40165
|
-
}
|
|
40166
|
-
function indata(name, field, value) {
|
|
40167
|
-
const index = this.context.data[name]['index:' + field],
|
|
40168
|
-
entry = index ? index.value.get(value) : undefined;
|
|
40169
|
-
return entry ? entry.count : entry;
|
|
40170
|
-
}
|
|
40171
|
-
function setdata(name, tuples) {
|
|
40172
|
-
const df = this.context.dataflow,
|
|
40173
|
-
data = this.context.data[name],
|
|
40174
|
-
input = data.input;
|
|
40175
|
-
df.pulse(input, df.changeset().remove(truthy).insert(tuples));
|
|
40176
|
-
return 1;
|
|
40177
|
-
}
|
|
40178
|
-
|
|
40179
|
-
function encode (item, name, retval) {
|
|
40180
|
-
if (item) {
|
|
40181
|
-
const df = this.context.dataflow,
|
|
40182
|
-
target = item.mark.source;
|
|
40183
|
-
df.pulse(target, df.changeset().encode(item, name));
|
|
40184
|
-
}
|
|
40185
|
-
return retval !== undefined ? retval : item;
|
|
40186
|
-
}
|
|
40187
|
-
|
|
40188
|
-
const wrap = method => function (value, spec) {
|
|
40189
|
-
const locale = this.context.dataflow.locale();
|
|
40190
|
-
return value === null ? 'null' : locale[method](spec)(value);
|
|
40191
|
-
};
|
|
40192
|
-
const format = wrap('format');
|
|
40193
|
-
const timeFormat$1 = wrap('timeFormat');
|
|
40194
|
-
const utcFormat = wrap('utcFormat');
|
|
40195
|
-
const timeParse = wrap('timeParse');
|
|
40196
|
-
const utcParse = wrap('utcParse');
|
|
40197
|
-
const dateObj = new Date(2000, 0, 1);
|
|
40198
|
-
function time(month, day, specifier) {
|
|
40199
|
-
if (!Number.isInteger(month) || !Number.isInteger(day)) return '';
|
|
40200
|
-
dateObj.setYear(2000);
|
|
40201
|
-
dateObj.setMonth(month);
|
|
40202
|
-
dateObj.setDate(day);
|
|
40203
|
-
return timeFormat$1.call(this, dateObj, specifier);
|
|
40204
|
-
}
|
|
40205
|
-
function monthFormat(month) {
|
|
40206
|
-
return time.call(this, month, 1, '%B');
|
|
40207
|
-
}
|
|
40208
|
-
function monthAbbrevFormat(month) {
|
|
40209
|
-
return time.call(this, month, 1, '%b');
|
|
40210
|
-
}
|
|
40211
|
-
function dayFormat(day) {
|
|
40212
|
-
return time.call(this, 0, 2 + day, '%A');
|
|
40213
|
-
}
|
|
40214
|
-
function dayAbbrevFormat(day) {
|
|
40215
|
-
return time.call(this, 0, 2 + day, '%a');
|
|
40216
|
-
}
|
|
40217
|
-
|
|
40218
|
-
const DataPrefix = ':';
|
|
40219
|
-
const IndexPrefix = '@';
|
|
40220
|
-
const ScalePrefix = '%';
|
|
40221
|
-
const SignalPrefix = '$';
|
|
40222
|
-
|
|
40223
|
-
function dataVisitor(name, args, scope, params) {
|
|
40224
|
-
if (args[0].type !== Literal) {
|
|
40225
|
-
error$1('First argument to data functions must be a string literal.');
|
|
40226
|
-
}
|
|
40227
|
-
const data = args[0].value,
|
|
40228
|
-
dataName = DataPrefix + data;
|
|
40229
|
-
if (!has$1(dataName, params)) {
|
|
40230
|
-
try {
|
|
40231
|
-
params[dataName] = scope.getData(data).tuplesRef();
|
|
40232
|
-
} catch (err) {
|
|
40233
|
-
// if data set does not exist, there's nothing to track
|
|
40234
|
-
}
|
|
40235
|
-
}
|
|
40236
|
-
}
|
|
40237
|
-
function indataVisitor(name, args, scope, params) {
|
|
40238
|
-
if (args[0].type !== Literal) error$1('First argument to indata must be a string literal.');
|
|
40239
|
-
if (args[1].type !== Literal) error$1('Second argument to indata must be a string literal.');
|
|
40240
|
-
const data = args[0].value,
|
|
40241
|
-
field = args[1].value,
|
|
40242
|
-
indexName = IndexPrefix + field;
|
|
40243
|
-
if (!has$1(indexName, params)) {
|
|
40244
|
-
params[indexName] = scope.getData(data).indataRef(scope, field);
|
|
40245
|
-
}
|
|
40246
|
-
}
|
|
40247
|
-
function scaleVisitor(name, args, scope, params) {
|
|
40248
|
-
if (args[0].type === Literal) {
|
|
40249
|
-
// add scale dependency
|
|
40250
|
-
addScaleDependency(scope, params, args[0].value);
|
|
40251
|
-
} else {
|
|
40252
|
-
// indirect scale lookup; add all scales as parameters
|
|
40253
|
-
for (name in scope.scales) {
|
|
40254
|
-
addScaleDependency(scope, params, name);
|
|
40255
|
-
}
|
|
40256
|
-
}
|
|
40257
|
-
}
|
|
40258
|
-
function addScaleDependency(scope, params, name) {
|
|
40259
|
-
const scaleName = ScalePrefix + name;
|
|
40260
|
-
if (!has$1(params, scaleName)) {
|
|
40261
|
-
try {
|
|
40262
|
-
params[scaleName] = scope.scaleRef(name);
|
|
40263
|
-
} catch (err) {
|
|
40264
|
-
// TODO: error handling? warning?
|
|
40265
|
-
}
|
|
40266
|
-
}
|
|
40267
|
-
}
|
|
40268
|
-
|
|
40269
|
-
/**
|
|
40270
|
-
* Name must be a string. Return undefined if the scale is not registered.
|
|
40271
|
-
*/
|
|
40272
|
-
function getScale(name, ctx) {
|
|
40273
|
-
if (isString(name)) {
|
|
40274
|
-
const maybeScale = ctx.scales[name];
|
|
40275
|
-
return maybeScale && isRegisteredScale(maybeScale.value) ? maybeScale.value : undefined;
|
|
40276
|
-
}
|
|
40277
|
-
return undefined;
|
|
40278
|
-
}
|
|
40279
|
-
function internalScaleFunctions(codegen, fnctx, visitors) {
|
|
40280
|
-
// add helper method to the 'this' expression function context
|
|
40281
|
-
fnctx.__bandwidth = s => s && s.bandwidth ? s.bandwidth() : 0;
|
|
40282
|
-
|
|
40283
|
-
// register AST visitors for internal scale functions
|
|
40284
|
-
visitors._bandwidth = scaleVisitor;
|
|
40285
|
-
visitors._range = scaleVisitor;
|
|
40286
|
-
visitors._scale = scaleVisitor;
|
|
40287
|
-
|
|
40288
|
-
// resolve scale reference directly to the signal hash argument
|
|
40289
|
-
const ref = arg => '_[' + (arg.type === Literal ? $(ScalePrefix + arg.value) : $(ScalePrefix) + '+' + codegen(arg)) + ']';
|
|
40290
|
-
|
|
40291
|
-
// define and return internal scale function code generators
|
|
40292
|
-
// these internal functions are called by mark encoders
|
|
40293
|
-
return {
|
|
40294
|
-
_bandwidth: args => `this.__bandwidth(${ref(args[0])})`,
|
|
40295
|
-
_range: args => `${ref(args[0])}.range()`,
|
|
40296
|
-
_scale: args => `${ref(args[0])}(${codegen(args[1])})`
|
|
40297
|
-
};
|
|
40298
|
-
}
|
|
40299
|
-
|
|
40300
|
-
function geoMethod(methodName, globalMethod) {
|
|
40301
|
-
return function (projection, geojson, group) {
|
|
40302
|
-
if (projection) {
|
|
40303
|
-
// projection defined, use it
|
|
40304
|
-
const p = getScale(projection, (group || this).context);
|
|
40305
|
-
return p && p.path[methodName](geojson);
|
|
40306
|
-
} else {
|
|
40307
|
-
// projection undefined, use global method
|
|
40308
|
-
return globalMethod(geojson);
|
|
40309
|
-
}
|
|
40310
|
-
};
|
|
40311
|
-
}
|
|
40312
|
-
const geoArea = geoMethod('area', geoArea$1$1);
|
|
40313
|
-
const geoBounds = geoMethod('bounds', geoBounds$1$1);
|
|
40314
|
-
const geoCentroid = geoMethod('centroid', geoCentroid$1$1);
|
|
40315
|
-
function geoScale(projection, group) {
|
|
40316
|
-
const p = getScale(projection, (group || this).context);
|
|
40317
|
-
return p && p.scale();
|
|
40318
|
-
}
|
|
40319
|
-
|
|
40320
|
-
function inScope (item) {
|
|
40321
|
-
const group = this.context.group;
|
|
40322
|
-
let value = false;
|
|
40323
|
-
if (group) while (item) {
|
|
40324
|
-
if (item === group) {
|
|
40325
|
-
value = true;
|
|
40326
|
-
break;
|
|
40327
|
-
}
|
|
40328
|
-
item = item.mark.group;
|
|
40329
|
-
}
|
|
40330
|
-
return value;
|
|
40331
|
-
}
|
|
40332
|
-
|
|
40333
|
-
function log(df, method, args) {
|
|
40334
|
-
try {
|
|
40335
|
-
df[method].apply(df, ['EXPRESSION'].concat([].slice.call(args)));
|
|
40336
|
-
} catch (err) {
|
|
40337
|
-
df.warn(err);
|
|
40338
|
-
}
|
|
40339
|
-
return args[args.length - 1];
|
|
40340
|
-
}
|
|
40341
|
-
function warn$1() {
|
|
40342
|
-
return log(this.context.dataflow, 'warn', arguments);
|
|
40343
|
-
}
|
|
40344
|
-
function info() {
|
|
40345
|
-
return log(this.context.dataflow, 'info', arguments);
|
|
40346
|
-
}
|
|
40347
|
-
function debug$1() {
|
|
40348
|
-
return log(this.context.dataflow, 'debug', arguments);
|
|
40349
|
-
}
|
|
40350
|
-
|
|
40351
|
-
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
40352
|
-
function channel_luminance_value(channelValue) {
|
|
40353
|
-
const val = channelValue / 255;
|
|
40354
|
-
if (val <= 0.03928) {
|
|
40355
|
-
return val / 12.92;
|
|
40356
|
-
}
|
|
40357
|
-
return Math.pow((val + 0.055) / 1.055, 2.4);
|
|
40358
|
-
}
|
|
40359
|
-
function luminance(color) {
|
|
40360
|
-
const c = rgb$1(color),
|
|
40361
|
-
r = channel_luminance_value(c.r),
|
|
40362
|
-
g = channel_luminance_value(c.g),
|
|
40363
|
-
b = channel_luminance_value(c.b);
|
|
40364
|
-
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
40365
|
-
}
|
|
40366
|
-
|
|
40367
|
-
// https://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef
|
|
40368
|
-
function contrast(color1, color2) {
|
|
40369
|
-
const lum1 = luminance(color1),
|
|
40370
|
-
lum2 = luminance(color2),
|
|
40371
|
-
lumL = Math.max(lum1, lum2),
|
|
40372
|
-
lumD = Math.min(lum1, lum2);
|
|
40373
|
-
return (lumL + 0.05) / (lumD + 0.05);
|
|
40374
|
-
}
|
|
40375
|
-
|
|
40376
|
-
function merge () {
|
|
40377
|
-
const args = [].slice.call(arguments);
|
|
40378
|
-
args.unshift({});
|
|
40379
|
-
return extend$1(...args);
|
|
40380
|
-
}
|
|
40381
|
-
|
|
40382
|
-
function equal(a, b) {
|
|
40383
|
-
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;
|
|
40384
|
-
}
|
|
40385
|
-
function equalArray(a, b) {
|
|
40386
|
-
for (let i = 0, n = a.length; i < n; ++i) {
|
|
40387
|
-
if (!equal(a[i], b[i])) return false;
|
|
40388
|
-
}
|
|
40389
|
-
return true;
|
|
40390
|
-
}
|
|
40391
|
-
function equalObject(a, b) {
|
|
40392
|
-
for (const key in a) {
|
|
40393
|
-
if (!equal(a[key], b[key])) return false;
|
|
40394
|
-
}
|
|
40395
|
-
return true;
|
|
40396
|
-
}
|
|
40397
|
-
function removePredicate(props) {
|
|
40398
|
-
return _ => equalObject(props, _);
|
|
40399
|
-
}
|
|
40400
|
-
function modify (name, insert, remove, toggle, modify, values) {
|
|
40401
|
-
const df = this.context.dataflow,
|
|
40402
|
-
data = this.context.data[name],
|
|
40403
|
-
input = data.input,
|
|
40404
|
-
stamp = df.stamp();
|
|
40405
|
-
let changes = data.changes,
|
|
40406
|
-
predicate,
|
|
40407
|
-
key;
|
|
40408
|
-
if (df._trigger === false || !(input.value.length || insert || toggle)) {
|
|
40409
|
-
// nothing to do!
|
|
40410
|
-
return 0;
|
|
40411
|
-
}
|
|
40412
|
-
if (!changes || changes.stamp < stamp) {
|
|
40413
|
-
data.changes = changes = df.changeset();
|
|
40414
|
-
changes.stamp = stamp;
|
|
40415
|
-
df.runAfter(() => {
|
|
40416
|
-
data.modified = true;
|
|
40417
|
-
df.pulse(input, changes).run();
|
|
40418
|
-
}, true, 1);
|
|
40419
|
-
}
|
|
40420
|
-
if (remove) {
|
|
40421
|
-
predicate = remove === true ? truthy : isArray(remove) || isTuple(remove) ? remove : removePredicate(remove);
|
|
40422
|
-
changes.remove(predicate);
|
|
40423
|
-
}
|
|
40424
|
-
if (insert) {
|
|
40425
|
-
changes.insert(insert);
|
|
40426
|
-
}
|
|
40427
|
-
if (toggle) {
|
|
40428
|
-
predicate = removePredicate(toggle);
|
|
40429
|
-
if (input.value.some(predicate)) {
|
|
40430
|
-
changes.remove(predicate);
|
|
40431
|
-
} else {
|
|
40432
|
-
changes.insert(toggle);
|
|
40433
|
-
}
|
|
40434
|
-
}
|
|
40435
|
-
if (modify) {
|
|
40436
|
-
for (key in values) {
|
|
40437
|
-
changes.modify(modify, key, values[key]);
|
|
40438
|
-
}
|
|
40439
|
-
}
|
|
40440
|
-
return 1;
|
|
40441
|
-
}
|
|
40442
|
-
|
|
40443
|
-
function pinchDistance(event) {
|
|
40444
|
-
const t = event.touches,
|
|
40445
|
-
dx = t[0].clientX - t[1].clientX,
|
|
40446
|
-
dy = t[0].clientY - t[1].clientY;
|
|
40447
|
-
return Math.hypot(dx, dy);
|
|
40448
|
-
}
|
|
40449
|
-
function pinchAngle(event) {
|
|
40450
|
-
const t = event.touches;
|
|
40451
|
-
return Math.atan2(t[0].clientY - t[1].clientY, t[0].clientX - t[1].clientX);
|
|
40452
|
-
}
|
|
40453
|
-
|
|
40454
|
-
// memoize accessor functions
|
|
40455
|
-
const accessors = {};
|
|
40456
|
-
function pluck (data, name) {
|
|
40457
|
-
const accessor = accessors[name] || (accessors[name] = field$1(name));
|
|
40458
|
-
return isArray(data) ? data.map(accessor) : accessor(data);
|
|
40459
|
-
}
|
|
40460
|
-
|
|
40461
|
-
function array(seq) {
|
|
40462
|
-
return isArray(seq) || ArrayBuffer.isView(seq) ? seq : null;
|
|
40463
|
-
}
|
|
40464
|
-
function sequence(seq) {
|
|
40465
|
-
return array(seq) || (isString(seq) ? seq : null);
|
|
40466
|
-
}
|
|
40467
|
-
function join(seq) {
|
|
40468
|
-
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
40469
|
-
args[_key - 1] = arguments[_key];
|
|
40470
|
-
}
|
|
40471
|
-
return array(seq).join(...args);
|
|
40472
|
-
}
|
|
40473
|
-
function indexof(seq) {
|
|
40474
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
40475
|
-
args[_key2 - 1] = arguments[_key2];
|
|
40476
|
-
}
|
|
40477
|
-
return sequence(seq).indexOf(...args);
|
|
40478
|
-
}
|
|
40479
|
-
function lastindexof(seq) {
|
|
40480
|
-
for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
|
|
40481
|
-
args[_key3 - 1] = arguments[_key3];
|
|
40482
|
-
}
|
|
40483
|
-
return sequence(seq).lastIndexOf(...args);
|
|
40484
|
-
}
|
|
40485
|
-
function slice$1(seq) {
|
|
40486
|
-
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
|
40487
|
-
args[_key4 - 1] = arguments[_key4];
|
|
40488
|
-
}
|
|
40489
|
-
return sequence(seq).slice(...args);
|
|
40490
|
-
}
|
|
40491
|
-
function replace(str, pattern, repl) {
|
|
40492
|
-
if (isFunction(repl)) error$1('Function argument passed to replace.');
|
|
40493
|
-
return String(str).replace(pattern, repl);
|
|
40494
|
-
}
|
|
40495
|
-
function reverse$1(seq) {
|
|
40496
|
-
return array(seq).slice().reverse();
|
|
40497
|
-
}
|
|
40498
|
-
function sort(seq) {
|
|
40499
|
-
return array(seq).slice().sort(ascending$2);
|
|
40500
|
-
}
|
|
40501
|
-
|
|
40502
|
-
function bandspace(count, paddingInner, paddingOuter) {
|
|
40503
|
-
return bandSpace(count || 0, paddingInner || 0, paddingOuter || 0);
|
|
40504
|
-
}
|
|
40505
|
-
function bandwidth(name, group) {
|
|
40506
|
-
const s = getScale(name, (group || this).context);
|
|
40507
|
-
return s && s.bandwidth ? s.bandwidth() : 0;
|
|
40508
|
-
}
|
|
40509
|
-
function copy(name, group) {
|
|
40510
|
-
const s = getScale(name, (group || this).context);
|
|
40511
|
-
return s ? s.copy() : undefined;
|
|
40512
|
-
}
|
|
40513
|
-
function domain$2(name, group) {
|
|
40514
|
-
const s = getScale(name, (group || this).context);
|
|
40515
|
-
return s ? s.domain() : [];
|
|
40516
|
-
}
|
|
40517
|
-
function invert(name, range, group) {
|
|
40518
|
-
const s = getScale(name, (group || this).context);
|
|
40519
|
-
return !s ? undefined : isArray(range) ? (s.invertRange || s.invert)(range) : (s.invert || s.invertExtent)(range);
|
|
40520
|
-
}
|
|
40521
|
-
function range$2(name, group) {
|
|
40522
|
-
const s = getScale(name, (group || this).context);
|
|
40523
|
-
return s && s.range ? s.range() : [];
|
|
40524
|
-
}
|
|
40525
|
-
function scale$1(name, value, group) {
|
|
40526
|
-
const s = getScale(name, (group || this).context);
|
|
40527
|
-
return s ? s(value) : undefined;
|
|
40528
|
-
}
|
|
40529
|
-
|
|
40530
|
-
/**
|
|
40531
|
-
* Passing a function is only used for for testing.
|
|
40532
|
-
* Outside of tests, the first argument should be a string.
|
|
40533
|
-
*/
|
|
40534
|
-
function scaleGradient (scaleOrFunction, p0, p1, count, group) {
|
|
40535
|
-
let scale = typeof scaleOrFunction === 'string' ? getScale(scaleOrFunction, (group || this).context) : scaleOrFunction;
|
|
40536
|
-
const gradient = Gradient$1(p0, p1);
|
|
40537
|
-
let stops = scale.domain(),
|
|
40538
|
-
min = stops[0],
|
|
40539
|
-
max = peek$1(stops),
|
|
40540
|
-
fraction = identity$7;
|
|
40541
|
-
if (!(max - min)) {
|
|
40542
|
-
// expand scale if domain has zero span, fix #1479
|
|
40543
|
-
scale = (scale.interpolator ? scale$5('sequential')().interpolator(scale.interpolator()) : scale$5('linear')().interpolate(scale.interpolate()).range(scale.range())).domain([min = 0, max = 1]);
|
|
40544
|
-
} else {
|
|
40545
|
-
fraction = scaleFraction(scale, min, max);
|
|
40546
|
-
}
|
|
40547
|
-
if (scale.ticks) {
|
|
40548
|
-
stops = scale.ticks(+count || 15);
|
|
40549
|
-
if (min !== stops[0]) stops.unshift(min);
|
|
40550
|
-
if (max !== peek$1(stops)) stops.push(max);
|
|
40551
|
-
}
|
|
40552
|
-
stops.forEach(_ => gradient.stop(fraction(_), scale(_)));
|
|
40553
|
-
return gradient;
|
|
40554
|
-
}
|
|
40555
|
-
|
|
40556
|
-
function geoShape(projection, geojson, group) {
|
|
40557
|
-
const p = getScale(projection, (group || this).context);
|
|
40558
|
-
return function (context) {
|
|
40559
|
-
return p ? p.path.context(context)(geojson) : '';
|
|
40560
|
-
};
|
|
40561
|
-
}
|
|
40562
|
-
function pathShape(path) {
|
|
40563
|
-
let p = null;
|
|
40564
|
-
return function (context) {
|
|
40565
|
-
return context ? pathRender(context, p = p || parse$3(path)) : path;
|
|
40566
|
-
};
|
|
40567
|
-
}
|
|
40568
|
-
|
|
40569
|
-
const datum = d => d.data;
|
|
40570
|
-
function treeNodes(name, context) {
|
|
40571
|
-
const tree = data.call(context, name);
|
|
40572
|
-
return tree.root && tree.root.lookup || {};
|
|
40573
|
-
}
|
|
40574
|
-
function treePath(name, source, target) {
|
|
40575
|
-
const nodes = treeNodes(name, this),
|
|
40576
|
-
s = nodes[source],
|
|
40577
|
-
t = nodes[target];
|
|
40578
|
-
return s && t ? s.path(t).map(datum) : undefined;
|
|
40579
|
-
}
|
|
40580
|
-
function treeAncestors(name, node) {
|
|
40581
|
-
const n = treeNodes(name, this)[node];
|
|
40582
|
-
return n ? n.ancestors().map(datum) : undefined;
|
|
40583
|
-
}
|
|
40584
|
-
|
|
40585
|
-
const _window = () => typeof window !== 'undefined' && window || null;
|
|
40586
|
-
function screen() {
|
|
40587
|
-
const w = _window();
|
|
40588
|
-
return w ? w.screen : {};
|
|
40589
|
-
}
|
|
40590
|
-
function windowSize() {
|
|
40591
|
-
const w = _window();
|
|
40592
|
-
return w ? [w.innerWidth, w.innerHeight] : [undefined, undefined];
|
|
40593
|
-
}
|
|
40594
|
-
function containerSize() {
|
|
40595
|
-
const view = this.context.dataflow,
|
|
40596
|
-
el = view.container && view.container();
|
|
40597
|
-
return el ? [el.clientWidth, el.clientHeight] : [undefined, undefined];
|
|
40598
|
-
}
|
|
40599
|
-
|
|
40600
|
-
function intersect (b, opt, group) {
|
|
40601
|
-
if (!b) return [];
|
|
40602
|
-
const [u, v] = b,
|
|
40603
|
-
box = new Bounds().set(u[0], u[1], v[0], v[1]),
|
|
40604
|
-
scene = group || this.context.dataflow.scenegraph().root;
|
|
40605
|
-
return intersect$3(scene, box, filter(opt));
|
|
40606
|
-
}
|
|
40607
|
-
function filter(opt) {
|
|
40608
|
-
let p = null;
|
|
40609
|
-
if (opt) {
|
|
40610
|
-
const types = array$6(opt.marktype),
|
|
40611
|
-
names = array$6(opt.markname);
|
|
40612
|
-
p = _ => (!types.length || types.some(t => _.marktype === t)) && (!names.length || names.some(s => _.name === s));
|
|
40613
|
-
}
|
|
40614
|
-
return p;
|
|
40615
|
-
}
|
|
40616
|
-
|
|
40617
|
-
/**
|
|
40618
|
-
* Appends a new point to the lasso
|
|
40619
|
-
*
|
|
40620
|
-
* @param {*} lasso the lasso in pixel space
|
|
40621
|
-
* @param {*} x the x coordinate in pixel space
|
|
40622
|
-
* @param {*} y the y coordinate in pixel space
|
|
40623
|
-
* @param {*} minDist the minimum distance, in pixels, that thenew point needs to be apart from the last point
|
|
40624
|
-
* @returns a new array containing the lasso with the new point
|
|
40625
|
-
*/
|
|
40626
|
-
function lassoAppend(lasso, x, y) {
|
|
40627
|
-
let minDist = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 5;
|
|
40628
|
-
lasso = array$6(lasso);
|
|
40629
|
-
const last = lasso[lasso.length - 1];
|
|
40630
|
-
|
|
40631
|
-
// Add point to lasso if its the first point or distance to last point exceed minDist
|
|
40632
|
-
return last === undefined || Math.hypot(last[0] - x, last[1] - y) > minDist ? [...lasso, [x, y]] : lasso;
|
|
40633
|
-
}
|
|
40634
|
-
|
|
40635
|
-
/**
|
|
40636
|
-
* Generates a svg path command which draws a lasso
|
|
40637
|
-
*
|
|
40638
|
-
* @param {*} lasso the lasso in pixel space in the form [[x,y], [x,y], ...]
|
|
40639
|
-
* @returns the svg path command that draws the lasso
|
|
40640
|
-
*/
|
|
40641
|
-
function lassoPath(lasso) {
|
|
40642
|
-
return array$6(lasso).reduce((svg, _ref, i) => {
|
|
40643
|
-
let [x, y] = _ref;
|
|
40644
|
-
return svg += i == 0 ? `M ${x},${y} ` : i === lasso.length - 1 ? ' Z' : `L ${x},${y} `;
|
|
40645
|
-
}, '');
|
|
40646
|
-
}
|
|
40647
|
-
|
|
40648
|
-
/**
|
|
40649
|
-
* Inverts the lasso from pixel space to an array of vega scenegraph tuples
|
|
40650
|
-
*
|
|
40651
|
-
* @param {*} data the dataset
|
|
40652
|
-
* @param {*} pixelLasso the lasso in pixel space, [[x,y], [x,y], ...]
|
|
40653
|
-
* @param {*} unit the unit where the lasso is defined
|
|
40654
|
-
*
|
|
40655
|
-
* @returns an array of vega scenegraph tuples
|
|
40656
|
-
*/
|
|
40657
|
-
function intersectLasso(markname, pixelLasso, unit) {
|
|
40658
|
-
const {
|
|
40659
|
-
x,
|
|
40660
|
-
y,
|
|
40661
|
-
mark
|
|
40662
|
-
} = unit;
|
|
40663
|
-
const bb = new Bounds().set(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER, Number.MIN_SAFE_INTEGER, Number.MIN_SAFE_INTEGER);
|
|
40664
|
-
|
|
40665
|
-
// Get bounding box around lasso
|
|
40666
|
-
for (const [px, py] of pixelLasso) {
|
|
40667
|
-
if (px < bb.x1) bb.x1 = px;
|
|
40668
|
-
if (px > bb.x2) bb.x2 = px;
|
|
40669
|
-
if (py < bb.y1) bb.y1 = py;
|
|
40670
|
-
if (py > bb.y2) bb.y2 = py;
|
|
40671
|
-
}
|
|
40672
|
-
|
|
40673
|
-
// Translate bb against unit coordinates
|
|
40674
|
-
bb.translate(x, y);
|
|
40675
|
-
const intersection = intersect([[bb.x1, bb.y1], [bb.x2, bb.y2]], markname, mark);
|
|
40676
|
-
|
|
40677
|
-
// Check every point against the lasso
|
|
40678
|
-
return intersection.filter(tuple => pointInPolygon(tuple.x, tuple.y, pixelLasso));
|
|
40679
|
-
}
|
|
40680
|
-
|
|
40681
|
-
/**
|
|
40682
|
-
* Performs a test if a point is inside a polygon based on the idea from
|
|
40683
|
-
* https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html
|
|
40684
|
-
*
|
|
40685
|
-
* This method will not need the same start/end point since it wraps around the edges of the array
|
|
40686
|
-
*
|
|
40687
|
-
* @param {*} test a point to test against
|
|
40688
|
-
* @param {*} polygon a polygon in the form [[x,y], [x,y], ...]
|
|
40689
|
-
* @returns true if the point lies inside the polygon, false otherwise
|
|
40690
|
-
*/
|
|
40691
|
-
function pointInPolygon(testx, testy, polygon) {
|
|
40692
|
-
let intersections = 0;
|
|
40693
|
-
for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {
|
|
40694
|
-
const [prevX, prevY] = polygon[j];
|
|
40695
|
-
const [x, y] = polygon[i];
|
|
40696
|
-
|
|
40697
|
-
// count intersections
|
|
40698
|
-
if (y > testy != prevY > testy && testx < (prevX - x) * (testy - y) / (prevY - y) + x) {
|
|
40699
|
-
intersections++;
|
|
40700
|
-
}
|
|
40701
|
-
}
|
|
40702
|
-
|
|
40703
|
-
// point is in polygon if intersection count is odd
|
|
40704
|
-
return intersections & 1;
|
|
40705
|
-
}
|
|
40706
|
-
|
|
40707
|
-
// Expression function context object
|
|
40708
|
-
const functionContext = {
|
|
40709
|
-
random() {
|
|
40710
|
-
return random();
|
|
40711
|
-
},
|
|
40712
|
-
// override default
|
|
40713
|
-
cumulativeNormal,
|
|
40714
|
-
cumulativeLogNormal,
|
|
40715
|
-
cumulativeUniform,
|
|
40716
|
-
densityNormal,
|
|
40717
|
-
densityLogNormal,
|
|
40718
|
-
densityUniform,
|
|
40719
|
-
quantileNormal,
|
|
40720
|
-
quantileLogNormal,
|
|
40721
|
-
quantileUniform,
|
|
40722
|
-
sampleNormal,
|
|
40723
|
-
sampleLogNormal,
|
|
40724
|
-
sampleUniform,
|
|
40725
|
-
isArray,
|
|
40726
|
-
isBoolean: isBoolean$2,
|
|
40727
|
-
isDate: isDate$1,
|
|
40728
|
-
isDefined(_) {
|
|
40729
|
-
return _ !== undefined;
|
|
40730
|
-
},
|
|
40731
|
-
isNumber: isNumber$1,
|
|
40732
|
-
isObject,
|
|
40733
|
-
isRegExp,
|
|
40734
|
-
isString,
|
|
40735
|
-
isTuple,
|
|
40736
|
-
isValid(_) {
|
|
40737
|
-
return _ != null && _ === _;
|
|
40738
|
-
},
|
|
40739
|
-
toBoolean,
|
|
40740
|
-
toDate(_) {
|
|
40741
|
-
return toDate(_);
|
|
40742
|
-
},
|
|
40743
|
-
// suppress extra arguments
|
|
40744
|
-
toNumber,
|
|
40745
|
-
toString,
|
|
40746
|
-
indexof,
|
|
40747
|
-
join,
|
|
40748
|
-
lastindexof,
|
|
40749
|
-
replace,
|
|
40750
|
-
reverse: reverse$1,
|
|
40751
|
-
sort,
|
|
40752
|
-
slice: slice$1,
|
|
40753
|
-
flush,
|
|
40754
|
-
lerp,
|
|
40755
|
-
merge,
|
|
40756
|
-
pad: pad$3,
|
|
40757
|
-
peek: peek$1,
|
|
40758
|
-
pluck,
|
|
40759
|
-
span,
|
|
40760
|
-
inrange,
|
|
40761
|
-
truncate: truncate$1,
|
|
40762
|
-
rgb: rgb$1,
|
|
40763
|
-
lab: lab$1,
|
|
40764
|
-
hcl: hcl$2,
|
|
40765
|
-
hsl: hsl$2,
|
|
40766
|
-
luminance,
|
|
40767
|
-
contrast,
|
|
40768
|
-
sequence: range$6,
|
|
40769
|
-
format,
|
|
40770
|
-
utcFormat,
|
|
40771
|
-
utcParse,
|
|
40772
|
-
utcOffset,
|
|
40773
|
-
utcSequence,
|
|
40774
|
-
timeFormat: timeFormat$1,
|
|
40775
|
-
timeParse,
|
|
40776
|
-
timeOffset,
|
|
40777
|
-
timeSequence,
|
|
40778
|
-
timeUnitSpecifier,
|
|
40779
|
-
monthFormat,
|
|
40780
|
-
monthAbbrevFormat,
|
|
40781
|
-
dayFormat,
|
|
40782
|
-
dayAbbrevFormat,
|
|
40783
|
-
quarter,
|
|
40784
|
-
utcquarter,
|
|
40785
|
-
week,
|
|
40786
|
-
utcweek,
|
|
40787
|
-
dayofyear,
|
|
40788
|
-
utcdayofyear,
|
|
40789
|
-
warn: warn$1,
|
|
40790
|
-
info,
|
|
40791
|
-
debug: debug$1,
|
|
40792
|
-
extent(_) {
|
|
40793
|
-
return extent(_);
|
|
40794
|
-
},
|
|
40795
|
-
// suppress extra arguments
|
|
40796
|
-
inScope,
|
|
40797
|
-
intersect,
|
|
40798
|
-
clampRange,
|
|
40799
|
-
pinchDistance,
|
|
40800
|
-
pinchAngle,
|
|
40801
|
-
screen,
|
|
40802
|
-
containerSize,
|
|
40803
|
-
windowSize,
|
|
40804
|
-
bandspace,
|
|
40805
|
-
setdata,
|
|
40806
|
-
pathShape,
|
|
40807
|
-
panLinear,
|
|
40808
|
-
panLog,
|
|
40809
|
-
panPow,
|
|
40810
|
-
panSymlog,
|
|
40811
|
-
zoomLinear,
|
|
40812
|
-
zoomLog,
|
|
40813
|
-
zoomPow,
|
|
40814
|
-
zoomSymlog,
|
|
40815
|
-
encode,
|
|
40816
|
-
modify,
|
|
40817
|
-
lassoAppend,
|
|
40818
|
-
lassoPath,
|
|
40819
|
-
intersectLasso
|
|
40820
|
-
};
|
|
40821
|
-
const eventFunctions = ['view', 'item', 'group', 'xy', 'x', 'y'],
|
|
40822
|
-
// event functions
|
|
40823
|
-
eventPrefix = 'event.vega.',
|
|
40824
|
-
// event function prefix
|
|
40825
|
-
thisPrefix = 'this.',
|
|
40826
|
-
// function context prefix
|
|
40827
|
-
astVisitors = {}; // AST visitors for dependency analysis
|
|
40828
|
-
|
|
40829
|
-
// export code generator parameters
|
|
40830
|
-
const codegenParams = {
|
|
40831
|
-
forbidden: ['_'],
|
|
40832
|
-
allowed: ['datum', 'event', 'item'],
|
|
40833
|
-
fieldvar: 'datum',
|
|
40834
|
-
globalvar: id => `_[${$(SignalPrefix + id)}]`,
|
|
40835
|
-
functions: buildFunctions,
|
|
40836
|
-
constants: Constants$1,
|
|
40837
|
-
visitors: astVisitors
|
|
40838
|
-
};
|
|
40839
|
-
|
|
40840
|
-
// export code generator
|
|
40841
|
-
const codeGenerator = codegen(codegenParams);
|
|
40842
|
-
|
|
40843
|
-
// Build expression function registry
|
|
40844
|
-
function buildFunctions(codegen) {
|
|
40845
|
-
const fn = Functions$1(codegen);
|
|
40846
|
-
eventFunctions.forEach(name => fn[name] = eventPrefix + name);
|
|
40847
|
-
for (const name in functionContext) {
|
|
40848
|
-
fn[name] = thisPrefix + name;
|
|
40849
|
-
}
|
|
40850
|
-
extend$1(fn, internalScaleFunctions(codegen, functionContext, astVisitors));
|
|
40851
|
-
return fn;
|
|
40852
|
-
}
|
|
40853
|
-
|
|
40854
|
-
// Register an expression function
|
|
40855
|
-
function expressionFunction(name, fn, visitor) {
|
|
40856
|
-
if (arguments.length === 1) {
|
|
40857
|
-
return functionContext[name];
|
|
40858
|
-
}
|
|
40859
|
-
|
|
40860
|
-
// register with the functionContext
|
|
40861
|
-
functionContext[name] = fn;
|
|
40862
|
-
|
|
40863
|
-
// if there is an astVisitor register that, too
|
|
40864
|
-
if (visitor) astVisitors[name] = visitor;
|
|
40865
|
-
|
|
40866
|
-
// if the code generator has already been initialized,
|
|
40867
|
-
// we need to also register the function with it
|
|
40868
|
-
if (codeGenerator) codeGenerator.functions[name] = thisPrefix + name;
|
|
40869
|
-
return this;
|
|
40870
|
-
}
|
|
40871
|
-
|
|
40872
|
-
// register expression functions with ast visitors
|
|
40873
|
-
expressionFunction('bandwidth', bandwidth, scaleVisitor);
|
|
40874
|
-
expressionFunction('copy', copy, scaleVisitor);
|
|
40875
|
-
expressionFunction('domain', domain$2, scaleVisitor);
|
|
40876
|
-
expressionFunction('range', range$2, scaleVisitor);
|
|
40877
|
-
expressionFunction('invert', invert, scaleVisitor);
|
|
40878
|
-
expressionFunction('scale', scale$1, scaleVisitor);
|
|
40879
|
-
expressionFunction('gradient', scaleGradient, scaleVisitor);
|
|
40880
|
-
expressionFunction('geoArea', geoArea, scaleVisitor);
|
|
40881
|
-
expressionFunction('geoBounds', geoBounds, scaleVisitor);
|
|
40882
|
-
expressionFunction('geoCentroid', geoCentroid, scaleVisitor);
|
|
40883
|
-
expressionFunction('geoShape', geoShape, scaleVisitor);
|
|
40884
|
-
expressionFunction('geoScale', geoScale, scaleVisitor);
|
|
40885
|
-
expressionFunction('indata', indata, indataVisitor);
|
|
40886
|
-
expressionFunction('data', data, dataVisitor);
|
|
40887
|
-
expressionFunction('treePath', treePath, dataVisitor);
|
|
40888
|
-
expressionFunction('treeAncestors', treeAncestors, dataVisitor);
|
|
40889
|
-
|
|
40890
|
-
// register Vega-Lite selection functions
|
|
40891
|
-
expressionFunction('vlSelectionTest', selectionTest, selectionVisitor);
|
|
40892
|
-
expressionFunction('vlSelectionIdTest', selectionIdTest, selectionVisitor);
|
|
40893
|
-
expressionFunction('vlSelectionResolve', selectionResolve, selectionVisitor);
|
|
40894
|
-
expressionFunction('vlSelectionTuples', selectionTuples);
|
|
40895
|
-
|
|
40896
|
-
function parser (expr, scope) {
|
|
40897
|
-
const params = {};
|
|
40898
|
-
|
|
40899
|
-
// parse the expression to an abstract syntax tree (ast)
|
|
40900
|
-
let ast;
|
|
40901
|
-
try {
|
|
40902
|
-
expr = isString(expr) ? expr : $(expr) + '';
|
|
40903
|
-
ast = parser$1(expr);
|
|
40904
|
-
} catch (err) {
|
|
40905
|
-
error$1('Expression parse error: ' + expr);
|
|
40906
|
-
}
|
|
40907
|
-
|
|
40908
|
-
// analyze ast function calls for dependencies
|
|
40909
|
-
ast.visit(node => {
|
|
40910
|
-
if (node.type !== CallExpression) return;
|
|
40911
|
-
const name = node.callee.name,
|
|
40912
|
-
visit = codegenParams.visitors[name];
|
|
40913
|
-
if (visit) visit(name, node.arguments, scope, params);
|
|
40914
|
-
});
|
|
40915
|
-
|
|
40916
|
-
// perform code generation
|
|
40917
|
-
const gen = codeGenerator(ast);
|
|
40918
|
-
|
|
40919
|
-
// collect signal dependencies
|
|
40920
|
-
gen.globals.forEach(name => {
|
|
40921
|
-
const signalName = SignalPrefix + name;
|
|
40922
|
-
if (!has$1(params, signalName) && scope.getSignal(name)) {
|
|
40923
|
-
params[signalName] = scope.signalRef(name);
|
|
40924
|
-
}
|
|
40925
|
-
});
|
|
40926
|
-
|
|
40927
|
-
// return generated expression code and dependencies
|
|
40928
|
-
return {
|
|
40929
|
-
$expr: extend$1({
|
|
40930
|
-
code: gen.code
|
|
40931
|
-
}, scope.options.ast ? {
|
|
40932
|
-
ast
|
|
40933
|
-
} : null),
|
|
40934
|
-
$fields: gen.fields,
|
|
40935
|
-
$params: params
|
|
40936
|
-
};
|
|
40937
|
-
}
|
|
40938
|
-
|
|
40939
40213
|
const VIEW = 'view',
|
|
40940
40214
|
LBRACK = '[',
|
|
40941
40215
|
RBRACK = ']',
|
|
@@ -41231,7 +40505,7 @@ function applyDefaults (encode, type, role, style, config) {
|
|
|
41231
40505
|
}
|
|
41232
40506
|
|
|
41233
40507
|
// resolve styles, apply with increasing precedence
|
|
41234
|
-
array$
|
|
40508
|
+
array$5(style).forEach(name => {
|
|
41235
40509
|
const props = config.style && config.style[name];
|
|
41236
40510
|
for (const key in props) {
|
|
41237
40511
|
if (!has(key, encode)) {
|
|
@@ -41613,7 +40887,7 @@ function parseUpdate (spec, scope, target) {
|
|
|
41613
40887
|
}
|
|
41614
40888
|
|
|
41615
40889
|
// separate event streams from signal updates
|
|
41616
|
-
events = array$
|
|
40890
|
+
events = array$5(events).filter(s => s.signal || s.scale ? (sources.push(s), 0) : 1);
|
|
41617
40891
|
|
|
41618
40892
|
// merge internal operator listeners
|
|
41619
40893
|
if (sources.length > 1) {
|
|
@@ -42737,7 +42011,7 @@ function parseData$1 (from, group, scope) {
|
|
|
42737
42011
|
if (!from.data) {
|
|
42738
42012
|
op = parseTransform(extend$1({
|
|
42739
42013
|
type: 'aggregate',
|
|
42740
|
-
groupby: array$
|
|
42014
|
+
groupby: array$5(facet.groupby)
|
|
42741
42015
|
}, facet.aggregate), scope);
|
|
42742
42016
|
op.params.key = scope.keyRef(facet.groupby);
|
|
42743
42017
|
op.params.pulse = getDataRef(facet, scope);
|
|
@@ -43507,7 +42781,7 @@ function analyze(data, scope, ops) {
|
|
|
43507
42781
|
}
|
|
43508
42782
|
} else if (data.source) {
|
|
43509
42783
|
// derives from one or more other data sets
|
|
43510
|
-
source = upstream = array$
|
|
42784
|
+
source = upstream = array$5(data.source).map(d => ref(scope.getData(d).output));
|
|
43511
42785
|
output.push(null); // populate later
|
|
43512
42786
|
}
|
|
43513
42787
|
|
|
@@ -44142,20 +43416,20 @@ function buildAxisEncode(_, spec) {
|
|
|
44142
43416
|
}
|
|
44143
43417
|
|
|
44144
43418
|
function parseScope (spec, scope, preprocessed) {
|
|
44145
|
-
const signals = array$
|
|
44146
|
-
scales = array$
|
|
43419
|
+
const signals = array$5(spec.signals),
|
|
43420
|
+
scales = array$5(spec.scales);
|
|
44147
43421
|
|
|
44148
43422
|
// parse signal definitions, if not already preprocessed
|
|
44149
43423
|
if (!preprocessed) signals.forEach(_ => parseSignal(_, scope));
|
|
44150
43424
|
|
|
44151
43425
|
// parse cartographic projection definitions
|
|
44152
|
-
array$
|
|
43426
|
+
array$5(spec.projections).forEach(_ => parseProjection$1(_, scope));
|
|
44153
43427
|
|
|
44154
43428
|
// initialize scale references
|
|
44155
43429
|
scales.forEach(_ => initScale(_, scope));
|
|
44156
43430
|
|
|
44157
43431
|
// parse data sources
|
|
44158
|
-
array$
|
|
43432
|
+
array$5(spec.data).forEach(_ => parseData$2(_, scope));
|
|
44159
43433
|
|
|
44160
43434
|
// parse scale definitions
|
|
44161
43435
|
scales.forEach(_ => parseScale(_, scope));
|
|
@@ -44164,13 +43438,13 @@ function parseScope (spec, scope, preprocessed) {
|
|
|
44164
43438
|
(preprocessed || signals).forEach(_ => parseSignalUpdates(_, scope));
|
|
44165
43439
|
|
|
44166
43440
|
// parse axis definitions
|
|
44167
|
-
array$
|
|
43441
|
+
array$5(spec.axes).forEach(_ => parseAxis$1(_, scope));
|
|
44168
43442
|
|
|
44169
43443
|
// parse mark definitions
|
|
44170
|
-
array$
|
|
43444
|
+
array$5(spec.marks).forEach(_ => parseMark(_, scope));
|
|
44171
43445
|
|
|
44172
43446
|
// parse legend definitions
|
|
44173
|
-
array$
|
|
43447
|
+
array$5(spec.legends).forEach(_ => parseLegend$1(_, scope));
|
|
44174
43448
|
|
|
44175
43449
|
// parse title, if defined
|
|
44176
43450
|
if (spec.title) parseTitle(spec.title, scope);
|
|
@@ -44284,7 +43558,7 @@ function collectSignals(spec, config) {
|
|
|
44284
43558
|
map = {};
|
|
44285
43559
|
|
|
44286
43560
|
// add spec signal array
|
|
44287
|
-
array$
|
|
43561
|
+
array$5(spec.signals).forEach(s => {
|
|
44288
43562
|
if (has$1(pre, s.name)) {
|
|
44289
43563
|
// merge if built-in signal
|
|
44290
43564
|
s = extend$1(pre[s.name], s);
|
|
@@ -44296,7 +43570,7 @@ function collectSignals(spec, config) {
|
|
|
44296
43570
|
});
|
|
44297
43571
|
|
|
44298
43572
|
// add config signal array
|
|
44299
|
-
array$
|
|
43573
|
+
array$5(config.signals).forEach(s => {
|
|
44300
43574
|
if (!has$1(map, s.name) && !has$1(pre, s.name)) {
|
|
44301
43575
|
// add to signal list if not already defined
|
|
44302
43576
|
signals.push(s);
|
|
@@ -44488,8 +43762,8 @@ Scope.prototype = Subscope.prototype = {
|
|
|
44488
43762
|
compareRef(cmp) {
|
|
44489
43763
|
let signal = false;
|
|
44490
43764
|
const check = _ => isSignal(_) ? (signal = true, this.signalRef(_.signal)) : isExpr$1(_) ? (signal = true, this.exprRef(_.expr)) : _;
|
|
44491
|
-
const fields = array$
|
|
44492
|
-
orders = array$
|
|
43765
|
+
const fields = array$5(cmp.field).map(check),
|
|
43766
|
+
orders = array$5(cmp.order).map(check);
|
|
44493
43767
|
return signal ? ref(this.add(Compare({
|
|
44494
43768
|
fields: fields,
|
|
44495
43769
|
orders: orders
|
|
@@ -44499,7 +43773,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
44499
43773
|
let signal = false;
|
|
44500
43774
|
const check = _ => isSignal(_) ? (signal = true, ref(sig[_.signal])) : _;
|
|
44501
43775
|
const sig = this.signals;
|
|
44502
|
-
fields = array$
|
|
43776
|
+
fields = array$5(fields).map(check);
|
|
44503
43777
|
return signal ? ref(this.add(Key({
|
|
44504
43778
|
fields: fields,
|
|
44505
43779
|
flat: flat
|
|
@@ -44901,11 +44175,11 @@ function parse (spec, config, options) {
|
|
|
44901
44175
|
return parseView(spec, new Scope(config, options)).toRuntime();
|
|
44902
44176
|
}
|
|
44903
44177
|
|
|
44904
|
-
var version$4 = "5.
|
|
44178
|
+
var version$4 = "5.31.0";
|
|
44905
44179
|
|
|
44906
44180
|
// -- Transforms -----
|
|
44907
44181
|
|
|
44908
|
-
extend$1(transforms, tx, vtx, encode$
|
|
44182
|
+
extend$1(transforms, tx, vtx, encode$1, geo, force, label, tree, reg, voronoi, wordcloud, xf);
|
|
44909
44183
|
|
|
44910
44184
|
const vegaImport = /*#__PURE__*/Object.freeze({
|
|
44911
44185
|
__proto__: null,
|
|
@@ -44928,7 +44202,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
44928
44202
|
interpolateColors: interpolateColors,
|
|
44929
44203
|
interpolateRange: interpolateRange$1,
|
|
44930
44204
|
quantizeInterpolator: quantizeInterpolator,
|
|
44931
|
-
scale: scale$
|
|
44205
|
+
scale: scale$4,
|
|
44932
44206
|
scheme: scheme$1,
|
|
44933
44207
|
projection: projection,
|
|
44934
44208
|
View: View$1,
|
|
@@ -44937,7 +44211,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
44937
44211
|
locale: locale$2,
|
|
44938
44212
|
resetDefaultLocale: resetDefaultLocale,
|
|
44939
44213
|
timeFormatLocale: timeFormatDefaultLocale,
|
|
44940
|
-
expressionFunction: expressionFunction
|
|
44214
|
+
expressionFunction: expressionFunction,
|
|
44941
44215
|
parse: parse,
|
|
44942
44216
|
runtimeContext: context,
|
|
44943
44217
|
codegenExpression: codegen,
|
|
@@ -44951,7 +44225,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
44951
44225
|
accessor: accessor,
|
|
44952
44226
|
accessorFields: accessorFields,
|
|
44953
44227
|
accessorName: accessorName,
|
|
44954
|
-
array: array$
|
|
44228
|
+
array: array$5,
|
|
44955
44229
|
ascending: ascending$2,
|
|
44956
44230
|
clampRange: clampRange,
|
|
44957
44231
|
compare: compare$2,
|
|
@@ -44983,7 +44257,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
44983
44257
|
lerp: lerp,
|
|
44984
44258
|
logger: logger,
|
|
44985
44259
|
lruCache: lruCache,
|
|
44986
|
-
merge: merge$
|
|
44260
|
+
merge: merge$3,
|
|
44987
44261
|
mergeConfig: mergeConfig,
|
|
44988
44262
|
one: one$2,
|
|
44989
44263
|
pad: pad$3,
|
|
@@ -45039,7 +44313,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
45039
44313
|
regressionExp: exp$1,
|
|
45040
44314
|
regressionLinear: linear$2,
|
|
45041
44315
|
regressionLoess: loess,
|
|
45042
|
-
regressionLog: log$
|
|
44316
|
+
regressionLog: log$3,
|
|
45043
44317
|
regressionPoly: poly,
|
|
45044
44318
|
regressionPow: pow$3,
|
|
45045
44319
|
regressionQuad: quad,
|
|
@@ -45075,7 +44349,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
45075
44349
|
utcdayofyear: utcdayofyear,
|
|
45076
44350
|
utcweek: utcweek,
|
|
45077
44351
|
week: week,
|
|
45078
|
-
format: format$
|
|
44352
|
+
format: format$3,
|
|
45079
44353
|
formats: formats$1,
|
|
45080
44354
|
inferType: inferType,
|
|
45081
44355
|
inferTypes: inferTypes,
|
|
@@ -45113,7 +44387,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
45113
44387
|
font: font$1,
|
|
45114
44388
|
fontFamily: fontFamily,
|
|
45115
44389
|
fontSize: fontSize,
|
|
45116
|
-
intersect: intersect$
|
|
44390
|
+
intersect: intersect$2,
|
|
45117
44391
|
intersectBoxLine: intersectBoxLine,
|
|
45118
44392
|
intersectPath: intersectPath,
|
|
45119
44393
|
intersectPoint: intersectPoint,
|
|
@@ -47032,7 +46306,7 @@ function getMarkStyleConfig(prop, mark, styleConfigIndex) {
|
|
|
47032
46306
|
return getStyleConfig(prop, getStyles(mark), styleConfigIndex);
|
|
47033
46307
|
}
|
|
47034
46308
|
function getStyleConfig(p, styles, styleConfigIndex) {
|
|
47035
|
-
styles = array$
|
|
46309
|
+
styles = array$5(styles);
|
|
47036
46310
|
let value;
|
|
47037
46311
|
for (const style of styles) {
|
|
47038
46312
|
const styleConfig = styleConfigIndex[style];
|
|
@@ -47046,7 +46320,7 @@ function getStyleConfig(p, styles, styleConfigIndex) {
|
|
|
47046
46320
|
* Return Vega sort parameters (tuple of field and order).
|
|
47047
46321
|
*/
|
|
47048
46322
|
function sortParams(orderDef, fieldRefOption) {
|
|
47049
|
-
return array$
|
|
46323
|
+
return array$5(orderDef).reduce((s, orderChannelDef) => {
|
|
47050
46324
|
s.field.push(vgField(orderChannelDef, fieldRefOption));
|
|
47051
46325
|
s.order.push(orderChannelDef.sort ?? 'ascending');
|
|
47052
46326
|
return s;
|
|
@@ -47075,7 +46349,7 @@ function mergeTitle(title1, title2) {
|
|
|
47075
46349
|
return title2;
|
|
47076
46350
|
}
|
|
47077
46351
|
else {
|
|
47078
|
-
return [...array$
|
|
46352
|
+
return [...array$5(title1), ...array$5(title2)].join(', ');
|
|
47079
46353
|
}
|
|
47080
46354
|
}
|
|
47081
46355
|
function mergeTitleComponent(v1, v2) {
|
|
@@ -50187,7 +49461,7 @@ function initEncoding(encoding, mark, filled, config) {
|
|
|
50187
49461
|
}
|
|
50188
49462
|
}
|
|
50189
49463
|
// Array of fieldDefs for detail channel (or production rule)
|
|
50190
|
-
normalizedEncoding[channel] = array$
|
|
49464
|
+
normalizedEncoding[channel] = array$5(channelDef).reduce((defs, fieldDef) => {
|
|
50191
49465
|
if (!isFieldDef(fieldDef)) {
|
|
50192
49466
|
warn(emptyFieldDef(fieldDef, channel));
|
|
50193
49467
|
}
|
|
@@ -50232,7 +49506,7 @@ function fieldDefs(encoding) {
|
|
|
50232
49506
|
for (const channel of keys(encoding)) {
|
|
50233
49507
|
if (channelHasField(encoding, channel)) {
|
|
50234
49508
|
const channelDef = encoding[channel];
|
|
50235
|
-
const channelDefArray = array$
|
|
49509
|
+
const channelDefArray = array$5(channelDef);
|
|
50236
49510
|
for (const def of channelDefArray) {
|
|
50237
49511
|
if (isFieldDef(def)) {
|
|
50238
49512
|
arr.push(def);
|
|
@@ -50322,7 +49596,7 @@ function pathGroupingFields(mark, encoding) {
|
|
|
50322
49596
|
case KEY: {
|
|
50323
49597
|
const channelDef = encoding[channel];
|
|
50324
49598
|
if (isArray(channelDef) || isFieldDef(channelDef)) {
|
|
50325
|
-
for (const fieldDef of array$
|
|
49599
|
+
for (const fieldDef of array$5(channelDef)) {
|
|
50326
49600
|
if (!fieldDef.aggregate) {
|
|
50327
49601
|
details.push(vgField(fieldDef, {}));
|
|
50328
49602
|
}
|
|
@@ -52151,7 +51425,7 @@ function stack(m, encoding) {
|
|
|
52151
51425
|
// Ignore tooltip in stackBy (https://github.com/vega/vega-lite/issues/4001)
|
|
52152
51426
|
if (channel !== 'tooltip' && channelHasField(encoding, channel)) {
|
|
52153
51427
|
const channelDef = encoding[channel];
|
|
52154
|
-
for (const cDef of array$
|
|
51428
|
+
for (const cDef of array$5(channelDef)) {
|
|
52155
51429
|
const fieldDef = getFieldDef(cDef);
|
|
52156
51430
|
if (fieldDef.aggregate) {
|
|
52157
51431
|
continue;
|
|
@@ -53921,7 +53195,7 @@ const project = {
|
|
|
53921
53195
|
const type = selCmpt.type;
|
|
53922
53196
|
const cfg = model.config.selection[type];
|
|
53923
53197
|
const init = selDef.value !== undefined
|
|
53924
|
-
? array$
|
|
53198
|
+
? array$5(selDef.value)
|
|
53925
53199
|
: null;
|
|
53926
53200
|
// If no explicit projection (either fields or encodings) is specified, set some defaults.
|
|
53927
53201
|
// If an initial value is set, try to infer projections.
|
|
@@ -54447,7 +53721,7 @@ const interval = {
|
|
|
54447
53721
|
warn(`${evt} is not an ordered event stream for interval selections.`);
|
|
54448
53722
|
continue;
|
|
54449
53723
|
}
|
|
54450
|
-
const filters = array$
|
|
53724
|
+
const filters = array$5(((_a = evt.between[0]).filter ?? (_a.filter = [])));
|
|
54451
53725
|
if (!filters.includes(filterExpr)) {
|
|
54452
53726
|
filters.push(filterExpr);
|
|
54453
53727
|
}
|
|
@@ -54726,7 +54000,7 @@ function wrapCondition({ model, channelDef, vgChannel, invalidValueRef, mainRefF
|
|
|
54726
54000
|
const condition = isConditionalDef(channelDef) && channelDef.condition;
|
|
54727
54001
|
let valueRefs = [];
|
|
54728
54002
|
if (condition) {
|
|
54729
|
-
const conditions = array$
|
|
54003
|
+
const conditions = array$5(condition);
|
|
54730
54004
|
valueRefs = conditions.map(c => {
|
|
54731
54005
|
const conditionValueRef = mainRefFn(c);
|
|
54732
54006
|
if (isConditionalParameter(c)) {
|
|
@@ -54844,7 +54118,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
|
54844
54118
|
type: encoding[mainChannel].type // for secondary field def, copy type from main channel
|
|
54845
54119
|
};
|
|
54846
54120
|
const title = fieldDef.title || defaultTitle(fieldDef, formatConfig);
|
|
54847
|
-
const key = array$
|
|
54121
|
+
const key = array$5(title).join(', ').replaceAll(/"/g, '\\"');
|
|
54848
54122
|
let value;
|
|
54849
54123
|
if (isXorY(channel)) {
|
|
54850
54124
|
const channel2 = channel === 'x' ? 'x2' : 'y2';
|
|
@@ -55951,14 +55225,14 @@ const legendBindings = {
|
|
|
55951
55225
|
if (isObject(selDef.select) && (selDef.select.on || selDef.select.clear)) {
|
|
55952
55226
|
const legendFilter = 'event.item && indexof(event.item.mark.role, "legend") < 0';
|
|
55953
55227
|
for (const evt of selCmpt.events) {
|
|
55954
|
-
evt.filter = array$
|
|
55228
|
+
evt.filter = array$5(evt.filter ?? []);
|
|
55955
55229
|
if (!evt.filter.includes(legendFilter)) {
|
|
55956
55230
|
evt.filter.push(legendFilter);
|
|
55957
55231
|
}
|
|
55958
55232
|
}
|
|
55959
55233
|
}
|
|
55960
55234
|
const evt = isLegendStreamBinding(selCmpt.bind) ? selCmpt.bind.legend : 'click';
|
|
55961
|
-
const stream = isString(evt) ? eventSelector(evt, 'view') : array$
|
|
55235
|
+
const stream = isString(evt) ? eventSelector(evt, 'view') : array$5(evt);
|
|
55962
55236
|
selCmpt.bind = { legend: { merge: stream } };
|
|
55963
55237
|
},
|
|
55964
55238
|
topLevelSignals: (model, selCmpt, signals) => {
|
|
@@ -56363,7 +55637,7 @@ function parseUnitSelection(model, selDefs) {
|
|
|
56363
55637
|
type,
|
|
56364
55638
|
init: def.value,
|
|
56365
55639
|
bind: def.bind,
|
|
56366
|
-
events: isString(defaults.on) ? eventSelector(defaults.on, 'scope') : array$
|
|
55640
|
+
events: isString(defaults.on) ? eventSelector(defaults.on, 'scope') : array$5(duplicate(defaults.on))
|
|
56367
55641
|
});
|
|
56368
55642
|
if (isTimerSelection(selCmpt)) {
|
|
56369
55643
|
nTimerSelections++;
|
|
@@ -56503,7 +55777,7 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
|
|
|
56503
55777
|
else if (isConditionalAxisValue(propValue)) {
|
|
56504
55778
|
// deal with conditional axis value
|
|
56505
55779
|
const { condition, ...valueOrSignalRef } = propValue;
|
|
56506
|
-
const conditions = array$
|
|
55780
|
+
const conditions = array$5(condition);
|
|
56507
55781
|
const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];
|
|
56508
55782
|
if (propIndex) {
|
|
56509
55783
|
const { vgProp, part } = propIndex;
|
|
@@ -56709,7 +55983,7 @@ function getAxisConfigStyle(axisConfigTypes, config) {
|
|
|
56709
55983
|
// TODO: add special casing to add conditional value based on orient signal
|
|
56710
55984
|
let style = config[configType]?.style;
|
|
56711
55985
|
if (style) {
|
|
56712
|
-
style = array$
|
|
55986
|
+
style = array$5(style);
|
|
56713
55987
|
for (const s of style) {
|
|
56714
55988
|
toMerge.push(config.style[s]);
|
|
56715
55989
|
}
|
|
@@ -57548,7 +56822,7 @@ function getFirstConditionValue(channelDef) {
|
|
|
57548
56822
|
}
|
|
57549
56823
|
function getConditionValue(channelDef, reducer) {
|
|
57550
56824
|
if (hasConditionalValueDef(channelDef)) {
|
|
57551
|
-
return array$
|
|
56825
|
+
return array$5(channelDef.condition).reduce(reducer, channelDef.value);
|
|
57552
56826
|
}
|
|
57553
56827
|
else if (isValueDef(channelDef)) {
|
|
57554
56828
|
return channelDef.value;
|
|
@@ -62683,7 +61957,7 @@ class LookupNode extends DataFlowNode {
|
|
|
62683
61957
|
return new Set([this.transform.lookup]);
|
|
62684
61958
|
}
|
|
62685
61959
|
producedFields() {
|
|
62686
|
-
return new Set(this.transform.as ? array$
|
|
61960
|
+
return new Set(this.transform.as ? array$5(this.transform.as) : this.transform.from.fields);
|
|
62687
61961
|
}
|
|
62688
61962
|
hash() {
|
|
62689
61963
|
return `Lookup ${hash({ transform: this.transform, secondary: this.secondary })}`;
|
|
@@ -62694,7 +61968,7 @@ class LookupNode extends DataFlowNode {
|
|
|
62694
61968
|
// lookup a few fields and add create a flat output
|
|
62695
61969
|
foreign = {
|
|
62696
61970
|
values: this.transform.from.fields,
|
|
62697
|
-
...(this.transform.as ? { as: array$
|
|
61971
|
+
...(this.transform.as ? { as: array$5(this.transform.as) } : {})
|
|
62698
61972
|
};
|
|
62699
61973
|
}
|
|
62700
61974
|
else {
|
|
@@ -65380,7 +64654,7 @@ class LayerModel extends Model {
|
|
|
65380
64654
|
assembleGroupStyle() {
|
|
65381
64655
|
const uniqueStyles = new Set();
|
|
65382
64656
|
for (const child of this.children) {
|
|
65383
|
-
for (const style of array$
|
|
64657
|
+
for (const style of array$5(child.assembleGroupStyle())) {
|
|
65384
64658
|
uniqueStyles.add(style);
|
|
65385
64659
|
}
|
|
65386
64660
|
}
|