genesys-spark-chart-components 4.81.2 → 4.82.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-f1720978.js → color-palette-aa165953.js} +6 -6
- 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 +358 -962
- package/dist/esm/{color-palette-ddc52cb6.js → color-palette-9cf471d5.js} +6 -6
- 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 +358 -962
- package/dist/genesys-chart-webcomponents/genesys-chart-webcomponents.esm.js +1 -1
- package/dist/genesys-chart-webcomponents/{p-8aa633d5.entry.js → p-464f1055.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-80326474.entry.js → p-4eec02be.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-8a692944.entry.js → p-5c1fa076.entry.js} +2 -2
- package/dist/genesys-chart-webcomponents/{p-b763fd87.js → p-a7bc85cd.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-942d18b0.entry.js → p-c538ac76.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-ea27beff.entry.js → p-c9f85c67.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-bc664320.entry.js → p-f87517c1.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +6 -6
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index$2 = require('./index-95713c33.js');
|
|
6
|
-
const colorPalette = require('./color-palette-
|
|
6
|
+
const colorPalette = require('./color-palette-aa165953.js');
|
|
7
7
|
|
|
8
8
|
/*!
|
|
9
9
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
@@ -1517,7 +1517,7 @@ function lerp (array, frac) {
|
|
|
1517
1517
|
const DEFAULT_MAX_SIZE = 10000;
|
|
1518
1518
|
|
|
1519
1519
|
// adapted from https://github.com/dominictarr/hashlru/ (MIT License)
|
|
1520
|
-
function lruCache
|
|
1520
|
+
function lruCache (maxsize) {
|
|
1521
1521
|
maxsize = +maxsize || DEFAULT_MAX_SIZE;
|
|
1522
1522
|
let curr, prev, size;
|
|
1523
1523
|
const clear = () => {
|
|
@@ -5006,14 +5006,14 @@ function changeset() {
|
|
|
5006
5006
|
};
|
|
5007
5007
|
}
|
|
5008
5008
|
|
|
5009
|
-
const CACHE
|
|
5009
|
+
const CACHE = '_:mod:_';
|
|
5010
5010
|
|
|
5011
5011
|
/**
|
|
5012
5012
|
* Hash that tracks modifications to assigned values.
|
|
5013
5013
|
* Callers *must* use the set method to update values.
|
|
5014
5014
|
*/
|
|
5015
5015
|
function Parameters() {
|
|
5016
|
-
Object.defineProperty(this, CACHE
|
|
5016
|
+
Object.defineProperty(this, CACHE, {
|
|
5017
5017
|
writable: true,
|
|
5018
5018
|
value: {}
|
|
5019
5019
|
});
|
|
@@ -5033,7 +5033,7 @@ Parameters.prototype = {
|
|
|
5033
5033
|
set(name, index, value, force) {
|
|
5034
5034
|
const o = this,
|
|
5035
5035
|
v = o[name],
|
|
5036
|
-
mod = o[CACHE
|
|
5036
|
+
mod = o[CACHE];
|
|
5037
5037
|
if (index != null && index >= 0) {
|
|
5038
5038
|
if (v[index] !== value || force) {
|
|
5039
5039
|
v[index] = value;
|
|
@@ -5057,7 +5057,7 @@ Parameters.prototype = {
|
|
|
5057
5057
|
* @return {boolean} - Returns true if a queried parameter was modified.
|
|
5058
5058
|
*/
|
|
5059
5059
|
modified(name, index) {
|
|
5060
|
-
const mod = this[CACHE
|
|
5060
|
+
const mod = this[CACHE];
|
|
5061
5061
|
if (!arguments.length) {
|
|
5062
5062
|
for (const k in mod) {
|
|
5063
5063
|
if (mod[k]) return true;
|
|
@@ -5076,7 +5076,7 @@ Parameters.prototype = {
|
|
|
5076
5076
|
* all parameters are considered unmodified.
|
|
5077
5077
|
*/
|
|
5078
5078
|
clear() {
|
|
5079
|
-
this[CACHE
|
|
5079
|
+
this[CACHE] = {};
|
|
5080
5080
|
return this;
|
|
5081
5081
|
}
|
|
5082
5082
|
};
|
|
@@ -10626,7 +10626,7 @@ function aggregateParams(_, pulse) {
|
|
|
10626
10626
|
key: _.key,
|
|
10627
10627
|
groupby: _.groupby,
|
|
10628
10628
|
ops: keys.map(() => op),
|
|
10629
|
-
fields: keys.map(k => get$
|
|
10629
|
+
fields: keys.map(k => get$4(k, key, value, fields)),
|
|
10630
10630
|
as: keys.map(k => k + ''),
|
|
10631
10631
|
modified: _.modified.bind(_)
|
|
10632
10632
|
};
|
|
@@ -10634,7 +10634,7 @@ function aggregateParams(_, pulse) {
|
|
|
10634
10634
|
|
|
10635
10635
|
// Generate aggregate field accessor.
|
|
10636
10636
|
// Output NaN for non-existent values; aggregator will ignore!
|
|
10637
|
-
function get$
|
|
10637
|
+
function get$4(k, key, value, fields) {
|
|
10638
10638
|
return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');
|
|
10639
10639
|
}
|
|
10640
10640
|
|
|
@@ -16130,12 +16130,12 @@ function labelFormat(locale, scale, count, type, specifier, formatType, noSkip)
|
|
|
16130
16130
|
return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);
|
|
16131
16131
|
}
|
|
16132
16132
|
const formatRange = format => (value, index, array) => {
|
|
16133
|
-
const limit = get$
|
|
16133
|
+
const limit = get$3(array[index + 1], get$3(array.max, +Infinity)),
|
|
16134
16134
|
lo = formatValue$2(value, format),
|
|
16135
16135
|
hi = formatValue$2(limit, format);
|
|
16136
16136
|
return lo && hi ? lo + ' \u2013 ' + hi : hi ? '< ' + hi : '\u2265 ' + lo;
|
|
16137
16137
|
};
|
|
16138
|
-
const get$
|
|
16138
|
+
const get$3 = (value, dflt) => value != null ? value : dflt;
|
|
16139
16139
|
const formatDiscrete = format => (value, index) => index ? format(value) : null;
|
|
16140
16140
|
const formatPoint = format => value => format(value);
|
|
16141
16141
|
const formatValue$2 = (value, format) => Number.isFinite(value) ? format(value) : null;
|
|
@@ -16207,18 +16207,18 @@ function gradientRef(g, defs, base) {
|
|
|
16207
16207
|
if (!id) {
|
|
16208
16208
|
id = g.id = 'gradient_' + gradient_id++;
|
|
16209
16209
|
if (type === 'radial') {
|
|
16210
|
-
g.x1 = get$
|
|
16211
|
-
g.y1 = get$
|
|
16212
|
-
g.r1 = get$
|
|
16213
|
-
g.x2 = get$
|
|
16214
|
-
g.y2 = get$
|
|
16215
|
-
g.r2 = get$
|
|
16210
|
+
g.x1 = get$2(g.x1, 0.5);
|
|
16211
|
+
g.y1 = get$2(g.y1, 0.5);
|
|
16212
|
+
g.r1 = get$2(g.r1, 0);
|
|
16213
|
+
g.x2 = get$2(g.x2, 0.5);
|
|
16214
|
+
g.y2 = get$2(g.y2, 0.5);
|
|
16215
|
+
g.r2 = get$2(g.r2, 0.5);
|
|
16216
16216
|
prefix = patternPrefix;
|
|
16217
16217
|
} else {
|
|
16218
|
-
g.x1 = get$
|
|
16219
|
-
g.y1 = get$
|
|
16220
|
-
g.x2 = get$
|
|
16221
|
-
g.y2 = get$
|
|
16218
|
+
g.x1 = get$2(g.x1, 0);
|
|
16219
|
+
g.y1 = get$2(g.y1, 0);
|
|
16220
|
+
g.x2 = get$2(g.x2, 1);
|
|
16221
|
+
g.y2 = get$2(g.y2, 0);
|
|
16222
16222
|
}
|
|
16223
16223
|
}
|
|
16224
16224
|
|
|
@@ -16228,7 +16228,7 @@ function gradientRef(g, defs, base) {
|
|
|
16228
16228
|
// return url reference
|
|
16229
16229
|
return 'url(' + (base || '') + '#' + prefix + id + ')';
|
|
16230
16230
|
}
|
|
16231
|
-
function get$
|
|
16231
|
+
function get$2(val, def) {
|
|
16232
16232
|
return val != null ? val : def;
|
|
16233
16233
|
}
|
|
16234
16234
|
function Gradient$1 (p0, p1) {
|
|
@@ -18424,7 +18424,7 @@ var shape = markItemPath('shape', shape$1);
|
|
|
18424
18424
|
var symbol = markItemPath('symbol', symbol$1, intersectPoint);
|
|
18425
18425
|
|
|
18426
18426
|
// memoize text width measurement
|
|
18427
|
-
const widthCache = lruCache
|
|
18427
|
+
const widthCache = lruCache();
|
|
18428
18428
|
var textMetrics = {
|
|
18429
18429
|
height: fontSize,
|
|
18430
18430
|
measureWidth: measureWidth,
|
|
@@ -21643,7 +21643,7 @@ function bboxFull(item) {
|
|
|
21643
21643
|
const b = item.bounds.clone();
|
|
21644
21644
|
return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));
|
|
21645
21645
|
}
|
|
21646
|
-
function get$
|
|
21646
|
+
function get$1(opt, key, d) {
|
|
21647
21647
|
const v = isObject(opt) ? opt[key] : opt;
|
|
21648
21648
|
return v != null ? v : d !== undefined ? d : 0;
|
|
21649
21649
|
}
|
|
@@ -21654,10 +21654,10 @@ function gridLayout(view, groups, opt) {
|
|
|
21654
21654
|
var dirty = !opt.nodirty,
|
|
21655
21655
|
bbox = opt.bounds === Flush ? bboxFlush : bboxFull,
|
|
21656
21656
|
bounds = tempBounds.set(0, 0, 0, 0),
|
|
21657
|
-
alignCol = get$
|
|
21658
|
-
alignRow = get$
|
|
21659
|
-
padCol = get$
|
|
21660
|
-
padRow = get$
|
|
21657
|
+
alignCol = get$1(opt.align, Column),
|
|
21658
|
+
alignRow = get$1(opt.align, Row),
|
|
21659
|
+
padCol = get$1(opt.padding, Column),
|
|
21660
|
+
padRow = get$1(opt.padding, Row),
|
|
21661
21661
|
ncols = opt.columns || groups.length,
|
|
21662
21662
|
nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),
|
|
21663
21663
|
n = groups.length,
|
|
@@ -21774,7 +21774,7 @@ function gridLayout(view, groups, opt) {
|
|
|
21774
21774
|
}
|
|
21775
21775
|
|
|
21776
21776
|
// perform horizontal centering
|
|
21777
|
-
if (alignCol && get$
|
|
21777
|
+
if (alignCol && get$1(opt.center, Column) && nrows > 1) {
|
|
21778
21778
|
for (i = 0; i < n; ++i) {
|
|
21779
21779
|
b = alignCol === All ? xMax : xExtent[i % ncols];
|
|
21780
21780
|
x = b - boxes[i].x2 - groups[i].x - dx[i];
|
|
@@ -21783,7 +21783,7 @@ function gridLayout(view, groups, opt) {
|
|
|
21783
21783
|
}
|
|
21784
21784
|
|
|
21785
21785
|
// perform vertical centering
|
|
21786
|
-
if (alignRow && get$
|
|
21786
|
+
if (alignRow && get$1(opt.center, Row) && ncols !== 1) {
|
|
21787
21787
|
for (i = 0; i < n; ++i) {
|
|
21788
21788
|
b = alignRow === All ? yMax : yExtent[~~(i / ncols)];
|
|
21789
21789
|
y = b - boxes[i].y2 - groups[i].y - dy[i];
|
|
@@ -21795,16 +21795,16 @@ function gridLayout(view, groups, opt) {
|
|
|
21795
21795
|
for (i = 0; i < n; ++i) {
|
|
21796
21796
|
bounds.union(boxes[i].translate(dx[i], dy[i]));
|
|
21797
21797
|
}
|
|
21798
|
-
x = get$
|
|
21799
|
-
y = get$
|
|
21800
|
-
switch (get$
|
|
21798
|
+
x = get$1(opt.anchor, X$1);
|
|
21799
|
+
y = get$1(opt.anchor, Y$1);
|
|
21800
|
+
switch (get$1(opt.anchor, Column)) {
|
|
21801
21801
|
case End$1:
|
|
21802
21802
|
x -= bounds.width();
|
|
21803
21803
|
break;
|
|
21804
21804
|
case Middle$1:
|
|
21805
21805
|
x -= bounds.width() / 2;
|
|
21806
21806
|
}
|
|
21807
|
-
switch (get$
|
|
21807
|
+
switch (get$1(opt.anchor, Row)) {
|
|
21808
21808
|
case End$1:
|
|
21809
21809
|
y -= bounds.height();
|
|
21810
21810
|
break;
|
|
@@ -21852,43 +21852,43 @@ function trellisLayout(view, group, opt) {
|
|
|
21852
21852
|
|
|
21853
21853
|
// perform row header layout
|
|
21854
21854
|
if (views.rowheaders) {
|
|
21855
|
-
band = get$
|
|
21856
|
-
x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get$
|
|
21855
|
+
band = get$1(opt.headerBand, Row, null);
|
|
21856
|
+
x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get$1(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);
|
|
21857
21857
|
}
|
|
21858
21858
|
|
|
21859
21859
|
// perform column header layout
|
|
21860
21860
|
if (views.colheaders) {
|
|
21861
|
-
band = get$
|
|
21862
|
-
y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get$
|
|
21861
|
+
band = get$1(opt.headerBand, Column, null);
|
|
21862
|
+
y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get$1(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);
|
|
21863
21863
|
}
|
|
21864
21864
|
|
|
21865
21865
|
// perform row footer layout
|
|
21866
21866
|
if (views.rowfooters) {
|
|
21867
|
-
band = get$
|
|
21868
|
-
x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get$
|
|
21867
|
+
band = get$1(opt.footerBand, Row, null);
|
|
21868
|
+
x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get$1(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);
|
|
21869
21869
|
}
|
|
21870
21870
|
|
|
21871
21871
|
// perform column footer layout
|
|
21872
21872
|
if (views.colfooters) {
|
|
21873
|
-
band = get$
|
|
21874
|
-
y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get$
|
|
21873
|
+
band = get$1(opt.footerBand, Column, null);
|
|
21874
|
+
y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get$1(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);
|
|
21875
21875
|
}
|
|
21876
21876
|
|
|
21877
21877
|
// perform row title layout
|
|
21878
21878
|
if (views.rowtitle) {
|
|
21879
|
-
anchor = get$
|
|
21880
|
-
offset = get$
|
|
21879
|
+
anchor = get$1(opt.titleAnchor, Row);
|
|
21880
|
+
offset = get$1(off, 'rowTitle');
|
|
21881
21881
|
offset = anchor === End$1 ? x2 + offset : x - offset;
|
|
21882
|
-
band = get$
|
|
21882
|
+
band = get$1(opt.titleBand, Row, 0.5);
|
|
21883
21883
|
layoutTitle(view, views.rowtitle, offset, 0, bounds, band);
|
|
21884
21884
|
}
|
|
21885
21885
|
|
|
21886
21886
|
// perform column title layout
|
|
21887
21887
|
if (views.coltitle) {
|
|
21888
|
-
anchor = get$
|
|
21889
|
-
offset = get$
|
|
21888
|
+
anchor = get$1(opt.titleAnchor, Column);
|
|
21889
|
+
offset = get$1(off, 'columnTitle');
|
|
21890
21890
|
offset = anchor === End$1 ? y2 + offset : y - offset;
|
|
21891
|
-
band = get$
|
|
21891
|
+
band = get$1(opt.titleBand, Column, 0.5);
|
|
21892
21892
|
layoutTitle(view, views.coltitle, offset, 1, bounds, band);
|
|
21893
21893
|
}
|
|
21894
21894
|
}
|
|
@@ -28402,7 +28402,7 @@ Dispatch.prototype = dispatch.prototype = {
|
|
|
28402
28402
|
|
|
28403
28403
|
// If no callback was specified, return the callback of the given type and name.
|
|
28404
28404
|
if (arguments.length < 2) {
|
|
28405
|
-
while (++i < n) if ((t = (typename = T[i]).type) && (t = get
|
|
28405
|
+
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
|
28406
28406
|
return;
|
|
28407
28407
|
}
|
|
28408
28408
|
|
|
@@ -28432,7 +28432,7 @@ Dispatch.prototype = dispatch.prototype = {
|
|
|
28432
28432
|
}
|
|
28433
28433
|
};
|
|
28434
28434
|
|
|
28435
|
-
function get
|
|
28435
|
+
function get(type, name) {
|
|
28436
28436
|
for (var i = 0, n = type.length, c; i < n; ++i) {
|
|
28437
28437
|
if ((c = type[i]).name === name) {
|
|
28438
28438
|
return c.value;
|
|
@@ -29468,7 +29468,7 @@ function hierarchy(data, children) {
|
|
|
29468
29468
|
children = objectChildren;
|
|
29469
29469
|
}
|
|
29470
29470
|
|
|
29471
|
-
var root = new Node$
|
|
29471
|
+
var root = new Node$1(data),
|
|
29472
29472
|
node,
|
|
29473
29473
|
nodes = [root],
|
|
29474
29474
|
child,
|
|
@@ -29480,7 +29480,7 @@ function hierarchy(data, children) {
|
|
|
29480
29480
|
if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
|
|
29481
29481
|
node.children = childs;
|
|
29482
29482
|
for (i = n - 1; i >= 0; --i) {
|
|
29483
|
-
nodes.push(child = childs[i] = new Node$
|
|
29483
|
+
nodes.push(child = childs[i] = new Node$1(childs[i]));
|
|
29484
29484
|
child.parent = node;
|
|
29485
29485
|
child.depth = node.depth + 1;
|
|
29486
29486
|
}
|
|
@@ -29513,15 +29513,15 @@ function computeHeight(node) {
|
|
|
29513
29513
|
while ((node = node.parent) && (node.height < ++height));
|
|
29514
29514
|
}
|
|
29515
29515
|
|
|
29516
|
-
function Node$
|
|
29516
|
+
function Node$1(data) {
|
|
29517
29517
|
this.data = data;
|
|
29518
29518
|
this.depth =
|
|
29519
29519
|
this.height = 0;
|
|
29520
29520
|
this.parent = null;
|
|
29521
29521
|
}
|
|
29522
29522
|
|
|
29523
|
-
Node$
|
|
29524
|
-
constructor: Node$
|
|
29523
|
+
Node$1.prototype = hierarchy.prototype = {
|
|
29524
|
+
constructor: Node$1,
|
|
29525
29525
|
count: node_count,
|
|
29526
29526
|
each: node_each,
|
|
29527
29527
|
eachAfter: node_eachAfter,
|
|
@@ -29743,7 +29743,7 @@ function score(node) {
|
|
|
29743
29743
|
return dx * dx + dy * dy;
|
|
29744
29744
|
}
|
|
29745
29745
|
|
|
29746
|
-
function Node
|
|
29746
|
+
function Node(circle) {
|
|
29747
29747
|
this._ = circle;
|
|
29748
29748
|
this.next = null;
|
|
29749
29749
|
this.previous = null;
|
|
@@ -29766,14 +29766,14 @@ function packSiblingsRandom(circles, random) {
|
|
|
29766
29766
|
place(b, a, c = circles[2]);
|
|
29767
29767
|
|
|
29768
29768
|
// Initialize the front-chain using the first three circles a, b and c.
|
|
29769
|
-
a = new Node
|
|
29769
|
+
a = new Node(a), b = new Node(b), c = new Node(c);
|
|
29770
29770
|
a.next = c.previous = b;
|
|
29771
29771
|
b.next = a.previous = c;
|
|
29772
29772
|
c.next = b.previous = a;
|
|
29773
29773
|
|
|
29774
29774
|
// Attempt to place each remaining circle…
|
|
29775
29775
|
pack: for (i = 3; i < n; ++i) {
|
|
29776
|
-
place(a._, b._, c = circles[i]), c = new Node
|
|
29776
|
+
place(a._, b._, c = circles[i]), c = new Node(c);
|
|
29777
29777
|
|
|
29778
29778
|
// Find the closest intersecting circle on the front-chain, if any.
|
|
29779
29779
|
// “Closeness” is determined by linear distance along the front-chain.
|
|
@@ -30012,7 +30012,7 @@ function stratify() {
|
|
|
30012
30012
|
}
|
|
30013
30013
|
|
|
30014
30014
|
for (i = 0, n = nodes.length; i < n; ++i) {
|
|
30015
|
-
d = nodes[i], node = nodes[i] = new Node$
|
|
30015
|
+
d = nodes[i], node = nodes[i] = new Node$1(d);
|
|
30016
30016
|
if ((nodeId = currentId(d, i, data)) != null && (nodeId += "")) {
|
|
30017
30017
|
nodeKey = node.id = nodeId;
|
|
30018
30018
|
nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);
|
|
@@ -30178,7 +30178,7 @@ function TreeNode(node, i) {
|
|
|
30178
30178
|
this.i = i; // number
|
|
30179
30179
|
}
|
|
30180
30180
|
|
|
30181
|
-
TreeNode.prototype = Object.create(Node$
|
|
30181
|
+
TreeNode.prototype = Object.create(Node$1.prototype);
|
|
30182
30182
|
|
|
30183
30183
|
function treeRoot(root) {
|
|
30184
30184
|
var tree = new TreeNode(root, 0),
|
|
@@ -38251,7 +38251,7 @@ function change(name, changes) {
|
|
|
38251
38251
|
dataset.modified = true;
|
|
38252
38252
|
return this.pulse(dataset.input, changes);
|
|
38253
38253
|
}
|
|
38254
|
-
function insert
|
|
38254
|
+
function insert(name, _) {
|
|
38255
38255
|
return change.call(this, name, changeset().insert(_));
|
|
38256
38256
|
}
|
|
38257
38257
|
function remove(name, _) {
|
|
@@ -39444,7 +39444,7 @@ inherits(View$1, Dataflow, {
|
|
|
39444
39444
|
// -- DATA ----
|
|
39445
39445
|
data,
|
|
39446
39446
|
change,
|
|
39447
|
-
insert
|
|
39447
|
+
insert,
|
|
39448
39448
|
remove,
|
|
39449
39449
|
// -- SCALES --
|
|
39450
39450
|
scale: scale$1,
|
|
@@ -39956,7 +39956,7 @@ function parseSignal (signal, scope) {
|
|
|
39956
39956
|
}
|
|
39957
39957
|
}
|
|
39958
39958
|
|
|
39959
|
-
function Entry
|
|
39959
|
+
function Entry(type, value, params, parent) {
|
|
39960
39960
|
this.id = -1;
|
|
39961
39961
|
this.type = type;
|
|
39962
39962
|
this.value = value;
|
|
@@ -39964,7 +39964,7 @@ function Entry$1(type, value, params, parent) {
|
|
|
39964
39964
|
if (parent) this.parent = parent;
|
|
39965
39965
|
}
|
|
39966
39966
|
function entry(type, value, params, parent) {
|
|
39967
|
-
return new Entry
|
|
39967
|
+
return new Entry(type, value, params, parent);
|
|
39968
39968
|
}
|
|
39969
39969
|
function operator(value, params) {
|
|
39970
39970
|
return entry('operator', value, params);
|
|
@@ -42910,7 +42910,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
42910
42910
|
return op;
|
|
42911
42911
|
},
|
|
42912
42912
|
proxy(op) {
|
|
42913
|
-
const vref = op instanceof Entry
|
|
42913
|
+
const vref = op instanceof Entry ? ref(op) : op;
|
|
42914
42914
|
return this.add(Proxy({
|
|
42915
42915
|
value: vref
|
|
42916
42916
|
}));
|
|
@@ -43063,7 +43063,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43063
43063
|
if (this.hasOwnSignal(name)) {
|
|
43064
43064
|
error('Duplicate signal name: ' + $(name));
|
|
43065
43065
|
}
|
|
43066
|
-
const op = value instanceof Entry
|
|
43066
|
+
const op = value instanceof Entry ? value : this.add(operator(value));
|
|
43067
43067
|
return this.signals[name] = op;
|
|
43068
43068
|
},
|
|
43069
43069
|
getSignal(name) {
|
|
@@ -43505,7 +43505,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
43505
43505
|
key: key,
|
|
43506
43506
|
lerp: lerp,
|
|
43507
43507
|
logger: logger,
|
|
43508
|
-
lruCache: lruCache
|
|
43508
|
+
lruCache: lruCache,
|
|
43509
43509
|
merge: merge$3,
|
|
43510
43510
|
mergeConfig: mergeConfig,
|
|
43511
43511
|
one: one$2,
|
|
@@ -43965,7 +43965,7 @@ var expression$1 = {
|
|
|
43965
43965
|
|
|
43966
43966
|
const name$1 = "vega-lite";
|
|
43967
43967
|
const author$1 = "Dominik Moritz, Kanit \"Ham\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer";
|
|
43968
|
-
const version$3 = "5.
|
|
43968
|
+
const version$3 = "5.21.0";
|
|
43969
43969
|
const collaborators = [
|
|
43970
43970
|
"Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)",
|
|
43971
43971
|
"Dominik Moritz (https://www.domoritz.de)",
|
|
@@ -44043,50 +44043,50 @@ const bugs = {
|
|
|
44043
44043
|
url: "https://github.com/vega/vega-lite/issues"
|
|
44044
44044
|
};
|
|
44045
44045
|
const devDependencies$1 = {
|
|
44046
|
-
"@babel/core": "^7.24.
|
|
44047
|
-
"@babel/preset-env": "^7.
|
|
44046
|
+
"@babel/core": "^7.24.9",
|
|
44047
|
+
"@babel/preset-env": "^7.25.0",
|
|
44048
44048
|
"@babel/preset-typescript": "^7.24.7",
|
|
44049
44049
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
44050
44050
|
"@rollup/plugin-alias": "^5.1.0",
|
|
44051
44051
|
"@rollup/plugin-babel": "^6.0.4",
|
|
44052
|
-
"@rollup/plugin-commonjs": "^
|
|
44052
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
44053
44053
|
"@rollup/plugin-json": "^6.1.0",
|
|
44054
44054
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
44055
44055
|
"@rollup/plugin-terser": "^0.4.4",
|
|
44056
44056
|
"@types/d3": "^7.4.3",
|
|
44057
44057
|
"@types/jest": "^29.5.12",
|
|
44058
44058
|
"@types/pako": "^2.0.3",
|
|
44059
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
44060
|
-
"@typescript-eslint/parser": "^7.
|
|
44061
|
-
ajv: "^8.
|
|
44062
|
-
"ajv-formats": "^
|
|
44059
|
+
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
44060
|
+
"@typescript-eslint/parser": "^7.17.0",
|
|
44061
|
+
ajv: "^8.17.1",
|
|
44062
|
+
"ajv-formats": "^3.0.1",
|
|
44063
44063
|
cheerio: "^1.0.0-rc.12",
|
|
44064
|
-
"conventional-changelog-cli": "^
|
|
44064
|
+
"conventional-changelog-cli": "^5.0.0",
|
|
44065
44065
|
d3: "^7.9.0",
|
|
44066
44066
|
"del-cli": "^5.1.0",
|
|
44067
44067
|
eslint: "^8.57.0",
|
|
44068
44068
|
"eslint-config-prettier": "^9.1.0",
|
|
44069
44069
|
"eslint-plugin-jest": "^27.9.0",
|
|
44070
|
-
"eslint-plugin-prettier": "^5.1
|
|
44070
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
44071
44071
|
"fast-json-stable-stringify": "~2.1.0",
|
|
44072
|
-
"highlight.js": "^11.
|
|
44072
|
+
"highlight.js": "^11.10.0",
|
|
44073
44073
|
jest: "^29.7.0",
|
|
44074
44074
|
"jest-dev-server": "^10.0.0",
|
|
44075
44075
|
mkdirp: "^3.0.1",
|
|
44076
44076
|
pako: "^2.1.0",
|
|
44077
|
-
prettier: "^3.3.
|
|
44077
|
+
prettier: "^3.3.3",
|
|
44078
44078
|
puppeteer: "^15.0.0",
|
|
44079
|
-
"release-it": "17.
|
|
44080
|
-
rollup: "^4.
|
|
44079
|
+
"release-it": "17.6.0",
|
|
44080
|
+
rollup: "^4.19.1",
|
|
44081
44081
|
"rollup-plugin-bundle-size": "^1.0.3",
|
|
44082
44082
|
serve: "^14.2.3",
|
|
44083
|
-
terser: "^5.31.
|
|
44084
|
-
"ts-jest": "^29.
|
|
44085
|
-
"ts-json-schema-generator": "^
|
|
44086
|
-
typescript: "~5.4
|
|
44083
|
+
terser: "^5.31.3",
|
|
44084
|
+
"ts-jest": "^29.2.3",
|
|
44085
|
+
"ts-json-schema-generator": "^2.3.0",
|
|
44086
|
+
typescript: "~5.5.4",
|
|
44087
44087
|
"vega-cli": "^5.28.0",
|
|
44088
44088
|
"vega-datasets": "^2.8.1",
|
|
44089
|
-
"vega-embed": "^6.
|
|
44089
|
+
"vega-embed": "^6.26.0",
|
|
44090
44090
|
"vega-tooltip": "^0.34.0",
|
|
44091
44091
|
"yaml-front-matter": "^4.1.1"
|
|
44092
44092
|
};
|
|
@@ -44094,7 +44094,7 @@ const dependencies$1 = {
|
|
|
44094
44094
|
"json-stringify-pretty-compact": "~3.0.0",
|
|
44095
44095
|
tslib: "~2.6.3",
|
|
44096
44096
|
"vega-event-selector": "~3.0.1",
|
|
44097
|
-
"vega-expression": "~5.1.
|
|
44097
|
+
"vega-expression": "~5.1.1",
|
|
44098
44098
|
"vega-util": "~1.17.2",
|
|
44099
44099
|
yargs: "~17.7.2"
|
|
44100
44100
|
};
|
|
@@ -44132,13 +44132,13 @@ const pkg$1 = {
|
|
|
44132
44132
|
};
|
|
44133
44133
|
|
|
44134
44134
|
function isLogicalOr(op) {
|
|
44135
|
-
return
|
|
44135
|
+
return hasProperty(op, 'or');
|
|
44136
44136
|
}
|
|
44137
44137
|
function isLogicalAnd(op) {
|
|
44138
|
-
return
|
|
44138
|
+
return hasProperty(op, 'and');
|
|
44139
44139
|
}
|
|
44140
44140
|
function isLogicalNot(op) {
|
|
44141
|
-
return
|
|
44141
|
+
return hasProperty(op, 'not');
|
|
44142
44142
|
}
|
|
44143
44143
|
function forEachLeaf(op, fn) {
|
|
44144
44144
|
if (isLogicalNot(op)) {
|
|
@@ -44355,7 +44355,9 @@ function isEmpty(obj) {
|
|
|
44355
44355
|
}
|
|
44356
44356
|
// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
44357
44357
|
const keys = Object.keys;
|
|
44358
|
+
// Stricter version from https://github.com/microsoft/TypeScript/issues/51572#issuecomment-1319153323
|
|
44358
44359
|
const vals = Object.values;
|
|
44360
|
+
// Stricter version from https://github.com/microsoft/TypeScript/issues/51572#issuecomment-1319153323
|
|
44359
44361
|
const entries$1 = Object.entries;
|
|
44360
44362
|
function isBoolean(b) {
|
|
44361
44363
|
return b === true || b === false;
|
|
@@ -44462,12 +44464,7 @@ function accessPathDepth(path) {
|
|
|
44462
44464
|
* This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.
|
|
44463
44465
|
*/
|
|
44464
44466
|
function getFirstDefined(...args) {
|
|
44465
|
-
|
|
44466
|
-
if (arg !== undefined) {
|
|
44467
|
-
return arg;
|
|
44468
|
-
}
|
|
44469
|
-
}
|
|
44470
|
-
return undefined;
|
|
44467
|
+
return args.find(a => a !== undefined);
|
|
44471
44468
|
}
|
|
44472
44469
|
// variable used to generate id
|
|
44473
44470
|
let idCounter = 42;
|
|
@@ -44537,19 +44534,19 @@ function deepEqual(a, b) {
|
|
|
44537
44534
|
if (a instanceof Map && b instanceof Map) {
|
|
44538
44535
|
if (a.size !== b.size)
|
|
44539
44536
|
return false;
|
|
44540
|
-
for (
|
|
44541
|
-
if (!b.has(
|
|
44537
|
+
for (const e of a.entries())
|
|
44538
|
+
if (!b.has(e[0]))
|
|
44542
44539
|
return false;
|
|
44543
|
-
for (
|
|
44544
|
-
if (!deepEqual(
|
|
44540
|
+
for (const e of a.entries())
|
|
44541
|
+
if (!deepEqual(e[1], b.get(e[0])))
|
|
44545
44542
|
return false;
|
|
44546
44543
|
return true;
|
|
44547
44544
|
}
|
|
44548
44545
|
if (a instanceof Set && b instanceof Set) {
|
|
44549
44546
|
if (a.size !== b.size)
|
|
44550
44547
|
return false;
|
|
44551
|
-
for (
|
|
44552
|
-
if (!b.has(
|
|
44548
|
+
for (const e of a.entries())
|
|
44549
|
+
if (!b.has(e[0]))
|
|
44553
44550
|
return false;
|
|
44554
44551
|
return true;
|
|
44555
44552
|
}
|
|
@@ -44634,6 +44631,16 @@ function stringify$1(data) {
|
|
|
44634
44631
|
return `{${out}}`;
|
|
44635
44632
|
})(data);
|
|
44636
44633
|
}
|
|
44634
|
+
/**
|
|
44635
|
+
* Check if the input object has the property and it's not undefined.
|
|
44636
|
+
*
|
|
44637
|
+
* @param object the object
|
|
44638
|
+
* @param property the property to search
|
|
44639
|
+
* @returns if the object has the property and it's not undefined.
|
|
44640
|
+
*/
|
|
44641
|
+
function hasProperty(obj, key) {
|
|
44642
|
+
return isObject(obj) && has$1(obj, key) && obj[key] !== undefined;
|
|
44643
|
+
}
|
|
44637
44644
|
|
|
44638
44645
|
/*
|
|
44639
44646
|
* Constants and utilities for encoding channels (Visual variables)
|
|
@@ -44695,7 +44702,7 @@ const POLAR_POSITION_CHANNEL_INDEX = {
|
|
|
44695
44702
|
radius2: 1
|
|
44696
44703
|
};
|
|
44697
44704
|
function isPolarPositionChannel(c) {
|
|
44698
|
-
return c
|
|
44705
|
+
return has$1(POLAR_POSITION_CHANNEL_INDEX, c);
|
|
44699
44706
|
}
|
|
44700
44707
|
const GEO_POSIITON_CHANNEL_INDEX = {
|
|
44701
44708
|
longitude: 1,
|
|
@@ -44716,7 +44723,7 @@ function getPositionChannelFromLatLong(channel) {
|
|
|
44716
44723
|
}
|
|
44717
44724
|
}
|
|
44718
44725
|
function isGeoPositionChannel(c) {
|
|
44719
|
-
return c
|
|
44726
|
+
return has$1(GEO_POSIITON_CHANNEL_INDEX, c);
|
|
44720
44727
|
}
|
|
44721
44728
|
const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);
|
|
44722
44729
|
const UNIT_CHANNEL_INDEX = {
|
|
@@ -44765,10 +44772,10 @@ const CHANNELS = keys(CHANNEL_INDEX);
|
|
|
44765
44772
|
const { order: _o, detail: _d, tooltip: _tt1, ...SINGLE_DEF_CHANNEL_INDEX } = CHANNEL_INDEX;
|
|
44766
44773
|
const { row: _r, column: _c, facet: _f, ...SINGLE_DEF_UNIT_CHANNEL_INDEX } = SINGLE_DEF_CHANNEL_INDEX;
|
|
44767
44774
|
function isSingleDefUnitChannel(str) {
|
|
44768
|
-
return
|
|
44775
|
+
return has$1(SINGLE_DEF_UNIT_CHANNEL_INDEX, str);
|
|
44769
44776
|
}
|
|
44770
44777
|
function isChannel(str) {
|
|
44771
|
-
return
|
|
44778
|
+
return has$1(CHANNEL_INDEX, str);
|
|
44772
44779
|
}
|
|
44773
44780
|
const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];
|
|
44774
44781
|
function isSecondaryRangeChannel(c) {
|
|
@@ -44902,7 +44909,7 @@ const POSITION_SCALE_CHANNEL_INDEX = {
|
|
|
44902
44909
|
};
|
|
44903
44910
|
const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);
|
|
44904
44911
|
function isXorY(channel) {
|
|
44905
|
-
return channel
|
|
44912
|
+
return has$1(POSITION_SCALE_CHANNEL_INDEX, channel);
|
|
44906
44913
|
}
|
|
44907
44914
|
const POLAR_POSITION_SCALE_CHANNEL_INDEX = {
|
|
44908
44915
|
theta: 1,
|
|
@@ -44914,7 +44921,7 @@ function getPositionScaleChannel(sizeType) {
|
|
|
44914
44921
|
}
|
|
44915
44922
|
const OFFSET_SCALE_CHANNEL_INDEX = { xOffset: 1, yOffset: 1 };
|
|
44916
44923
|
function isXorYOffset(channel) {
|
|
44917
|
-
return channel
|
|
44924
|
+
return has$1(OFFSET_SCALE_CHANNEL_INDEX, channel);
|
|
44918
44925
|
}
|
|
44919
44926
|
// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without position / offset
|
|
44920
44927
|
const {
|
|
@@ -44926,7 +44933,7 @@ text: _t, tooltip: _tt, href: _hr, url: _u, description: _al,
|
|
|
44926
44933
|
detail: _dd, key: _k, order: _oo, ...NONPOSITION_SCALE_CHANNEL_INDEX } = NONPOSITION_CHANNEL_INDEX;
|
|
44927
44934
|
const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);
|
|
44928
44935
|
function isNonPositionScaleChannel(channel) {
|
|
44929
|
-
return
|
|
44936
|
+
return has$1(NONPOSITION_CHANNEL_INDEX, channel);
|
|
44930
44937
|
}
|
|
44931
44938
|
/**
|
|
44932
44939
|
* @returns whether Vega supports legends for a particular channel
|
|
@@ -44958,7 +44965,7 @@ const SCALE_CHANNEL_INDEX = {
|
|
|
44958
44965
|
/** List of channels with scales */
|
|
44959
44966
|
const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);
|
|
44960
44967
|
function isScaleChannel(channel) {
|
|
44961
|
-
return
|
|
44968
|
+
return has$1(SCALE_CHANNEL_INDEX, channel);
|
|
44962
44969
|
}
|
|
44963
44970
|
/**
|
|
44964
44971
|
* Return whether a channel supports a particular mark type.
|
|
@@ -45160,13 +45167,13 @@ const MULTIDOMAIN_SORT_OP_INDEX = {
|
|
|
45160
45167
|
max: 1
|
|
45161
45168
|
};
|
|
45162
45169
|
function isArgminDef(a) {
|
|
45163
|
-
return
|
|
45170
|
+
return hasProperty(a, 'argmin');
|
|
45164
45171
|
}
|
|
45165
45172
|
function isArgmaxDef(a) {
|
|
45166
|
-
return
|
|
45173
|
+
return hasProperty(a, 'argmax');
|
|
45167
45174
|
}
|
|
45168
45175
|
function isAggregateOp(a) {
|
|
45169
|
-
return isString(a) &&
|
|
45176
|
+
return isString(a) && has$1(AGGREGATE_OP_INDEX, a);
|
|
45170
45177
|
}
|
|
45171
45178
|
const COUNTING_OPS = new Set([
|
|
45172
45179
|
'count',
|
|
@@ -45229,7 +45236,7 @@ function isBinParams(bin) {
|
|
|
45229
45236
|
return isObject(bin);
|
|
45230
45237
|
}
|
|
45231
45238
|
function isParameterExtent(extent) {
|
|
45232
|
-
return extent
|
|
45239
|
+
return hasProperty(extent, 'param');
|
|
45233
45240
|
}
|
|
45234
45241
|
function autoMaxBins(channel) {
|
|
45235
45242
|
switch (channel) {
|
|
@@ -45255,7 +45262,7 @@ function autoMaxBins(channel) {
|
|
|
45255
45262
|
}
|
|
45256
45263
|
|
|
45257
45264
|
function isExprRef(o) {
|
|
45258
|
-
return
|
|
45265
|
+
return hasProperty(o, 'expr');
|
|
45259
45266
|
}
|
|
45260
45267
|
function replaceExprRef(index, { level } = { level: 0 }) {
|
|
45261
45268
|
const props = keys(index || {});
|
|
@@ -45307,26 +45314,26 @@ function isText(v) {
|
|
|
45307
45314
|
}
|
|
45308
45315
|
|
|
45309
45316
|
function isSignalRef(o) {
|
|
45310
|
-
return
|
|
45317
|
+
return hasProperty(o, 'signal');
|
|
45311
45318
|
}
|
|
45312
45319
|
function isVgRangeStep(range) {
|
|
45313
|
-
return
|
|
45320
|
+
return hasProperty(range, 'step');
|
|
45314
45321
|
}
|
|
45315
45322
|
function isDataRefUnionedDomain(domain) {
|
|
45316
45323
|
if (!isArray(domain)) {
|
|
45317
|
-
return 'fields'
|
|
45324
|
+
return hasProperty(domain, 'fields') && !hasProperty(domain, 'data');
|
|
45318
45325
|
}
|
|
45319
45326
|
return false;
|
|
45320
45327
|
}
|
|
45321
45328
|
function isFieldRefUnionDomain(domain) {
|
|
45322
45329
|
if (!isArray(domain)) {
|
|
45323
|
-
return 'fields'
|
|
45330
|
+
return hasProperty(domain, 'fields') && hasProperty(domain, 'data');
|
|
45324
45331
|
}
|
|
45325
45332
|
return false;
|
|
45326
45333
|
}
|
|
45327
45334
|
function isDataRefDomain(domain) {
|
|
45328
45335
|
if (!isArray(domain)) {
|
|
45329
|
-
return 'field'
|
|
45336
|
+
return hasProperty(domain, 'field') && hasProperty(domain, 'data');
|
|
45330
45337
|
}
|
|
45331
45338
|
return false;
|
|
45332
45339
|
}
|
|
@@ -45487,7 +45494,7 @@ function getStyles(mark) {
|
|
|
45487
45494
|
}
|
|
45488
45495
|
function getMarkPropOrConfig(channel, mark, config, opt = {}) {
|
|
45489
45496
|
const { vgChannel, ignoreVgConfig } = opt;
|
|
45490
|
-
if (vgChannel && mark
|
|
45497
|
+
if (vgChannel && hasProperty(mark, vgChannel)) {
|
|
45491
45498
|
return mark[vgChannel];
|
|
45492
45499
|
}
|
|
45493
45500
|
else if (mark[channel] !== undefined) {
|
|
@@ -45503,9 +45510,10 @@ function getMarkPropOrConfig(channel, mark, config, opt = {}) {
|
|
|
45503
45510
|
* Otherwise, return general mark specific config.
|
|
45504
45511
|
*/
|
|
45505
45512
|
function getMarkConfig(channel, mark, config, { vgChannel } = {}) {
|
|
45513
|
+
const cfg = getMarkStyleConfig(channel, mark, config.style);
|
|
45506
45514
|
return getFirstDefined(
|
|
45507
45515
|
// style config has highest precedence
|
|
45508
|
-
vgChannel ?
|
|
45516
|
+
vgChannel ? cfg : undefined, cfg,
|
|
45509
45517
|
// then mark-specific config
|
|
45510
45518
|
vgChannel ? config[mark.type][vgChannel] : undefined, config[mark.type][channel], // Need to cast because MarkDef doesn't perfectly match with AnyMarkConfig, but if the type isn't available, we'll get nothing here, which is fine
|
|
45511
45519
|
// If there is vgChannel, skip vl channel.
|
|
@@ -45521,7 +45529,7 @@ function getStyleConfig(p, styles, styleConfigIndex) {
|
|
|
45521
45529
|
let value;
|
|
45522
45530
|
for (const style of styles) {
|
|
45523
45531
|
const styleConfig = styleConfigIndex[style];
|
|
45524
|
-
if (styleConfig
|
|
45532
|
+
if (hasProperty(styleConfig, p)) {
|
|
45525
45533
|
value = styleConfig[p];
|
|
45526
45534
|
}
|
|
45527
45535
|
}
|
|
@@ -45856,7 +45864,7 @@ function debug$2(...args) {
|
|
|
45856
45864
|
function isDateTime(o) {
|
|
45857
45865
|
if (o && isObject(o)) {
|
|
45858
45866
|
for (const part of TIMEUNIT_PARTS) {
|
|
45859
|
-
if (part
|
|
45867
|
+
if (hasProperty(o, part)) {
|
|
45860
45868
|
return true;
|
|
45861
45869
|
}
|
|
45862
45870
|
}
|
|
@@ -46058,7 +46066,7 @@ const LOCAL_SINGLE_TIMEUNIT_INDEX = {
|
|
|
46058
46066
|
};
|
|
46059
46067
|
const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);
|
|
46060
46068
|
function isLocalSingleTimeUnit(timeUnit) {
|
|
46061
|
-
return
|
|
46069
|
+
return has$1(LOCAL_SINGLE_TIMEUNIT_INDEX, timeUnit);
|
|
46062
46070
|
}
|
|
46063
46071
|
function isBinnedTimeUnit(timeUnit) {
|
|
46064
46072
|
if (isObject(timeUnit)) {
|
|
@@ -46235,7 +46243,7 @@ const DATE_PARTS = {
|
|
|
46235
46243
|
milliseconds: 1
|
|
46236
46244
|
};
|
|
46237
46245
|
function isDatePart(timeUnit) {
|
|
46238
|
-
return
|
|
46246
|
+
return has$1(DATE_PARTS, timeUnit);
|
|
46239
46247
|
}
|
|
46240
46248
|
function getDateTimePartAndStep(timeUnit, step = 1) {
|
|
46241
46249
|
if (isDatePart(timeUnit)) {
|
|
@@ -46253,7 +46261,7 @@ function getDateTimePartAndStep(timeUnit, step = 1) {
|
|
|
46253
46261
|
}
|
|
46254
46262
|
|
|
46255
46263
|
function isSelectionPredicate(predicate) {
|
|
46256
|
-
return predicate
|
|
46264
|
+
return hasProperty(predicate, 'param');
|
|
46257
46265
|
}
|
|
46258
46266
|
function isFieldEqualPredicate(predicate) {
|
|
46259
46267
|
return !!predicate?.field && predicate.equal !== undefined;
|
|
@@ -46341,7 +46349,7 @@ function fieldFilterExpression(predicate, useInRange = true) {
|
|
|
46341
46349
|
return fieldValidPredicate(fieldExpr$1, predicate.valid);
|
|
46342
46350
|
}
|
|
46343
46351
|
else if (isFieldRangePredicate(predicate)) {
|
|
46344
|
-
const { range } = predicate;
|
|
46352
|
+
const { range } = replaceExprRef(predicate);
|
|
46345
46353
|
const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];
|
|
46346
46354
|
const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];
|
|
46347
46355
|
if (lower !== null && upper !== null && useInRange) {
|
|
@@ -46560,6 +46568,7 @@ const defaultScaleConfig = {
|
|
|
46560
46568
|
pointPadding: 0.5,
|
|
46561
46569
|
barBandPaddingInner: 0.1,
|
|
46562
46570
|
rectBandPaddingInner: 0,
|
|
46571
|
+
tickBandPaddingInner: 0.25,
|
|
46563
46572
|
bandWithNestedOffsetPaddingInner: 0.2,
|
|
46564
46573
|
bandWithNestedOffsetPaddingOuter: 0.2,
|
|
46565
46574
|
minBandSize: 2,
|
|
@@ -46576,13 +46585,13 @@ const defaultScaleConfig = {
|
|
|
46576
46585
|
zero: true
|
|
46577
46586
|
};
|
|
46578
46587
|
function isExtendedScheme(scheme) {
|
|
46579
|
-
return !isString(scheme) &&
|
|
46588
|
+
return !isString(scheme) && hasProperty(scheme, 'name');
|
|
46580
46589
|
}
|
|
46581
46590
|
function isParameterDomain(domain) {
|
|
46582
|
-
return domain
|
|
46591
|
+
return hasProperty(domain, 'param');
|
|
46583
46592
|
}
|
|
46584
46593
|
function isDomainUnionWith(domain) {
|
|
46585
|
-
return domain
|
|
46594
|
+
return hasProperty(domain, 'unionWith');
|
|
46586
46595
|
}
|
|
46587
46596
|
function isFieldRange(range) {
|
|
46588
46597
|
return isObject(range) && 'field' in range;
|
|
@@ -46802,11 +46811,11 @@ function isPathMark(m) {
|
|
|
46802
46811
|
return ['line', 'area', 'trail'].includes(m);
|
|
46803
46812
|
}
|
|
46804
46813
|
function isRectBasedMark(m) {
|
|
46805
|
-
return ['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */].includes(m);
|
|
46814
|
+
return ['rect', 'bar', 'image', 'arc', 'tick' /* arc is rect/interval in polar coordinate */].includes(m);
|
|
46806
46815
|
}
|
|
46807
46816
|
const PRIMITIVE_MARKS = new Set(keys(Mark));
|
|
46808
46817
|
function isMarkDef(mark) {
|
|
46809
|
-
return mark
|
|
46818
|
+
return hasProperty(mark, 'type');
|
|
46810
46819
|
}
|
|
46811
46820
|
const STROKE_CONFIG = [
|
|
46812
46821
|
'stroke',
|
|
@@ -46830,12 +46839,18 @@ const VL_ONLY_MARK_CONFIG_INDEX = {
|
|
|
46830
46839
|
timeUnitBandPosition: 1
|
|
46831
46840
|
};
|
|
46832
46841
|
const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);
|
|
46842
|
+
const VL_ONLY_RECT_CONFIG = [
|
|
46843
|
+
'binSpacing',
|
|
46844
|
+
'continuousBandSize',
|
|
46845
|
+
'discreteBandSize',
|
|
46846
|
+
'minBandSize'
|
|
46847
|
+
];
|
|
46833
46848
|
const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {
|
|
46834
46849
|
area: ['line', 'point'],
|
|
46835
|
-
bar:
|
|
46836
|
-
rect:
|
|
46850
|
+
bar: VL_ONLY_RECT_CONFIG,
|
|
46851
|
+
rect: VL_ONLY_RECT_CONFIG,
|
|
46837
46852
|
line: ['point'],
|
|
46838
|
-
tick: ['bandSize', 'thickness']
|
|
46853
|
+
tick: ['bandSize', 'thickness', ...VL_ONLY_RECT_CONFIG]
|
|
46839
46854
|
};
|
|
46840
46855
|
const defaultMarkConfig = {
|
|
46841
46856
|
color: '#4c78a8',
|
|
@@ -46861,26 +46876,25 @@ const MARK_CONFIG_INDEX = {
|
|
|
46861
46876
|
};
|
|
46862
46877
|
const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);
|
|
46863
46878
|
function isRelativeBandSize(o) {
|
|
46864
|
-
return o
|
|
46879
|
+
return hasProperty(o, 'band');
|
|
46865
46880
|
}
|
|
46866
46881
|
const BAR_CORNER_RADIUS_INDEX = {
|
|
46867
46882
|
horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],
|
|
46868
46883
|
vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']
|
|
46869
46884
|
};
|
|
46870
46885
|
const DEFAULT_RECT_BAND_SIZE = 5;
|
|
46871
|
-
const defaultBarConfig = {
|
|
46872
|
-
binSpacing: 1,
|
|
46873
|
-
continuousBandSize: DEFAULT_RECT_BAND_SIZE,
|
|
46874
|
-
minBandSize: 0.25,
|
|
46875
|
-
timeUnitBandPosition: 0.5
|
|
46876
|
-
};
|
|
46877
46886
|
const defaultRectConfig = {
|
|
46878
46887
|
binSpacing: 0,
|
|
46879
46888
|
continuousBandSize: DEFAULT_RECT_BAND_SIZE,
|
|
46880
46889
|
minBandSize: 0.25,
|
|
46881
46890
|
timeUnitBandPosition: 0.5
|
|
46882
46891
|
};
|
|
46892
|
+
const defaultBarConfig = {
|
|
46893
|
+
...defaultRectConfig,
|
|
46894
|
+
binSpacing: 1
|
|
46895
|
+
};
|
|
46883
46896
|
const defaultTickConfig = {
|
|
46897
|
+
...defaultRectConfig,
|
|
46884
46898
|
thickness: 1
|
|
46885
46899
|
};
|
|
46886
46900
|
function getMarkType(m) {
|
|
@@ -47114,7 +47128,7 @@ function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName
|
|
|
47114
47128
|
{
|
|
47115
47129
|
offset,
|
|
47116
47130
|
// For band, to get mid point, need to offset by half of the band
|
|
47117
|
-
band: scaleType === 'band' ? bandPosition ?? channelDef.bandPosition ?? 0.5 : undefined
|
|
47131
|
+
band: scaleType === 'band' ? (bandPosition ?? channelDef.bandPosition ?? 0.5) : undefined
|
|
47118
47132
|
});
|
|
47119
47133
|
}
|
|
47120
47134
|
else if (isValueDef(channelDef)) {
|
|
@@ -47380,33 +47394,33 @@ const SORT_BY_CHANNEL_INDEX = {
|
|
|
47380
47394
|
text: 1
|
|
47381
47395
|
};
|
|
47382
47396
|
function isSortByChannel(c) {
|
|
47383
|
-
return c
|
|
47397
|
+
return has$1(SORT_BY_CHANNEL_INDEX, c);
|
|
47384
47398
|
}
|
|
47385
47399
|
function isSortByEncoding(sort) {
|
|
47386
|
-
return
|
|
47400
|
+
return hasProperty(sort, 'encoding');
|
|
47387
47401
|
}
|
|
47388
47402
|
function isSortField(sort) {
|
|
47389
|
-
return sort && (sort
|
|
47403
|
+
return sort && (sort.op === 'count' || hasProperty(sort, 'field'));
|
|
47390
47404
|
}
|
|
47391
47405
|
function isSortArray(sort) {
|
|
47392
47406
|
return sort && isArray(sort);
|
|
47393
47407
|
}
|
|
47394
47408
|
|
|
47395
47409
|
function isFacetMapping(f) {
|
|
47396
|
-
return 'row'
|
|
47410
|
+
return hasProperty(f, 'row') || hasProperty(f, 'column');
|
|
47397
47411
|
}
|
|
47398
47412
|
function isFacetFieldDef(channelDef) {
|
|
47399
|
-
return
|
|
47413
|
+
return hasProperty(channelDef, 'header');
|
|
47400
47414
|
}
|
|
47401
47415
|
function isFacetSpec(spec) {
|
|
47402
|
-
return 'facet'
|
|
47416
|
+
return hasProperty(spec, 'facet');
|
|
47403
47417
|
}
|
|
47404
47418
|
|
|
47405
47419
|
function isConditionalParameter(c) {
|
|
47406
|
-
return c
|
|
47420
|
+
return hasProperty(c, 'param');
|
|
47407
47421
|
}
|
|
47408
47422
|
function isRepeatRef(field) {
|
|
47409
|
-
return
|
|
47423
|
+
return !isString(field) && hasProperty(field, 'repeat');
|
|
47410
47424
|
}
|
|
47411
47425
|
function toFieldDefBase(fieldDef) {
|
|
47412
47426
|
const { field, timeUnit, bin, aggregate } = fieldDef;
|
|
@@ -47418,7 +47432,7 @@ function toFieldDefBase(fieldDef) {
|
|
|
47418
47432
|
};
|
|
47419
47433
|
}
|
|
47420
47434
|
function isSortableFieldDef(fieldDef) {
|
|
47421
|
-
return 'sort'
|
|
47435
|
+
return hasProperty(fieldDef, 'sort');
|
|
47422
47436
|
}
|
|
47423
47437
|
function getBandPosition({ fieldDef, fieldDef2, markDef: mark, config }) {
|
|
47424
47438
|
if (isFieldOrDatumDef(fieldDef) && fieldDef.bandPosition !== undefined) {
|
|
@@ -47474,10 +47488,10 @@ function hasBandEnd(fieldDef, fieldDef2, markDef, config) {
|
|
|
47474
47488
|
return false;
|
|
47475
47489
|
}
|
|
47476
47490
|
function isOrderOnlyDef(orderDef) {
|
|
47477
|
-
return orderDef
|
|
47491
|
+
return hasProperty(orderDef, 'sort') && !hasProperty(orderDef, 'field');
|
|
47478
47492
|
}
|
|
47479
47493
|
function isConditionalDef(channelDef) {
|
|
47480
|
-
return channelDef
|
|
47494
|
+
return hasProperty(channelDef, 'condition');
|
|
47481
47495
|
}
|
|
47482
47496
|
/**
|
|
47483
47497
|
* Return if a channelDef is a ConditionalValueDef with ConditionFieldDef
|
|
@@ -47495,14 +47509,13 @@ function hasConditionalValueDef(channelDef) {
|
|
|
47495
47509
|
return !!condition && (isArray(condition) || isValueDef(condition));
|
|
47496
47510
|
}
|
|
47497
47511
|
function isFieldDef(channelDef) {
|
|
47498
|
-
|
|
47499
|
-
return channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');
|
|
47512
|
+
return hasProperty(channelDef, 'field') || channelDef?.aggregate === 'count';
|
|
47500
47513
|
}
|
|
47501
47514
|
function channelDefType(channelDef) {
|
|
47502
47515
|
return channelDef?.['type'];
|
|
47503
47516
|
}
|
|
47504
47517
|
function isDatumDef(channelDef) {
|
|
47505
|
-
return channelDef
|
|
47518
|
+
return hasProperty(channelDef, 'datum');
|
|
47506
47519
|
}
|
|
47507
47520
|
function isContinuousFieldOrDatumDef(cd) {
|
|
47508
47521
|
// TODO: make datum support DateTime object
|
|
@@ -47519,29 +47532,31 @@ function isFieldOrDatumDef(channelDef) {
|
|
|
47519
47532
|
return isFieldDef(channelDef) || isDatumDef(channelDef);
|
|
47520
47533
|
}
|
|
47521
47534
|
function isTypedFieldDef(channelDef) {
|
|
47522
|
-
return
|
|
47535
|
+
return (channelDef &&
|
|
47536
|
+
(hasProperty(channelDef, 'field') || channelDef['aggregate'] === 'count') &&
|
|
47537
|
+
hasProperty(channelDef, 'type'));
|
|
47523
47538
|
}
|
|
47524
47539
|
function isValueDef(channelDef) {
|
|
47525
|
-
return channelDef
|
|
47540
|
+
return hasProperty(channelDef, 'value');
|
|
47526
47541
|
}
|
|
47527
47542
|
function isScaleFieldDef(channelDef) {
|
|
47528
|
-
return channelDef
|
|
47543
|
+
return hasProperty(channelDef, 'scale') || hasProperty(channelDef, 'sort');
|
|
47529
47544
|
}
|
|
47530
47545
|
function isPositionFieldOrDatumDef(channelDef) {
|
|
47531
|
-
return channelDef
|
|
47546
|
+
return hasProperty(channelDef, 'axis') || hasProperty(channelDef, 'stack') || hasProperty(channelDef, 'impute');
|
|
47532
47547
|
}
|
|
47533
47548
|
function isMarkPropFieldOrDatumDef(channelDef) {
|
|
47534
|
-
return channelDef
|
|
47549
|
+
return hasProperty(channelDef, 'legend');
|
|
47535
47550
|
}
|
|
47536
47551
|
function isStringFieldOrDatumDef(channelDef) {
|
|
47537
|
-
return channelDef
|
|
47552
|
+
return hasProperty(channelDef, 'format') || hasProperty(channelDef, 'formatType');
|
|
47538
47553
|
}
|
|
47539
47554
|
function toStringFieldDef(fieldDef) {
|
|
47540
47555
|
// omit properties that don't exist in string field defs
|
|
47541
47556
|
return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);
|
|
47542
47557
|
}
|
|
47543
47558
|
function isOpFieldDef(fieldDef) {
|
|
47544
|
-
return 'op'
|
|
47559
|
+
return hasProperty(fieldDef, 'op');
|
|
47545
47560
|
}
|
|
47546
47561
|
/**
|
|
47547
47562
|
* Get a Vega field reference from a Vega-Lite field def.
|
|
@@ -47663,12 +47678,7 @@ function functionalTitleFormatter(fieldDef) {
|
|
|
47663
47678
|
}
|
|
47664
47679
|
const timeUnitParams = timeUnit && !isBinnedTimeUnit(timeUnit) ? normalizeTimeUnit(timeUnit) : undefined;
|
|
47665
47680
|
const fn = aggregate || timeUnitParams?.unit || (timeUnitParams?.maxbins && 'timeunit') || (isBinning(bin) && 'bin');
|
|
47666
|
-
|
|
47667
|
-
return `${fn.toUpperCase()}(${field})`;
|
|
47668
|
-
}
|
|
47669
|
-
else {
|
|
47670
|
-
return field;
|
|
47671
|
-
}
|
|
47681
|
+
return fn ? `${fn.toUpperCase()}(${field})` : field;
|
|
47672
47682
|
}
|
|
47673
47683
|
const defaultTitleFormatter = (fieldDef, config) => {
|
|
47674
47684
|
switch (config.fieldTitle) {
|
|
@@ -47900,7 +47910,7 @@ function initFieldDef(fd, channel, { compositeMark = false } = {}) {
|
|
|
47900
47910
|
sort: { encoding: sort }
|
|
47901
47911
|
};
|
|
47902
47912
|
}
|
|
47903
|
-
const sub = sort.
|
|
47913
|
+
const sub = sort.substring(1);
|
|
47904
47914
|
if (sort.charAt(0) === '-' && isSortByChannel(sub)) {
|
|
47905
47915
|
return {
|
|
47906
47916
|
...fieldDef,
|
|
@@ -48358,7 +48368,7 @@ const AXIS_PROPERTIES_INDEX = {
|
|
|
48358
48368
|
encoding: 1
|
|
48359
48369
|
};
|
|
48360
48370
|
function isAxisProperty(prop) {
|
|
48361
|
-
return
|
|
48371
|
+
return has$1(AXIS_PROPERTIES_INDEX, prop);
|
|
48362
48372
|
}
|
|
48363
48373
|
const AXIS_CONFIGS_INDEX = {
|
|
48364
48374
|
axis: 1,
|
|
@@ -48387,7 +48397,7 @@ const AXIS_CONFIGS_INDEX = {
|
|
|
48387
48397
|
const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);
|
|
48388
48398
|
|
|
48389
48399
|
function isUnitSpec(spec) {
|
|
48390
|
-
return 'mark'
|
|
48400
|
+
return hasProperty(spec, 'mark');
|
|
48391
48401
|
}
|
|
48392
48402
|
|
|
48393
48403
|
class CompositeMarkNormalizer {
|
|
@@ -48844,7 +48854,7 @@ function filterTooltipWithAggregatedField(oldEncoding) {
|
|
|
48844
48854
|
}
|
|
48845
48855
|
}
|
|
48846
48856
|
else {
|
|
48847
|
-
if (tooltip
|
|
48857
|
+
if (tooltip.aggregate) {
|
|
48848
48858
|
filteredEncoding.tooltip = tooltip;
|
|
48849
48859
|
}
|
|
48850
48860
|
else {
|
|
@@ -49312,7 +49322,7 @@ function normalizeErrorBar(spec, { config }) {
|
|
|
49312
49322
|
encoding: normalizeEncoding(spec.encoding, config)
|
|
49313
49323
|
};
|
|
49314
49324
|
const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);
|
|
49315
|
-
delete encodingWithoutContinuousAxis
|
|
49325
|
+
delete encodingWithoutContinuousAxis.size;
|
|
49316
49326
|
const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);
|
|
49317
49327
|
const thickness = markDef.thickness;
|
|
49318
49328
|
const size = markDef.size;
|
|
@@ -49892,13 +49902,13 @@ function isAnyConcatSpec(spec) {
|
|
|
49892
49902
|
return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);
|
|
49893
49903
|
}
|
|
49894
49904
|
function isConcatSpec(spec) {
|
|
49895
|
-
return 'concat'
|
|
49905
|
+
return hasProperty(spec, 'concat');
|
|
49896
49906
|
}
|
|
49897
49907
|
function isVConcatSpec(spec) {
|
|
49898
|
-
return 'vconcat'
|
|
49908
|
+
return hasProperty(spec, 'vconcat');
|
|
49899
49909
|
}
|
|
49900
49910
|
function isHConcatSpec(spec) {
|
|
49901
|
-
return 'hconcat'
|
|
49911
|
+
return hasProperty(spec, 'hconcat');
|
|
49902
49912
|
}
|
|
49903
49913
|
|
|
49904
49914
|
function getStepFor({ step, offsetIsDiscrete }) {
|
|
@@ -49910,10 +49920,10 @@ function getStepFor({ step, offsetIsDiscrete }) {
|
|
|
49910
49920
|
}
|
|
49911
49921
|
}
|
|
49912
49922
|
function isStep(size) {
|
|
49913
|
-
return
|
|
49923
|
+
return hasProperty(size, 'step');
|
|
49914
49924
|
}
|
|
49915
49925
|
function isFrameMixins(o) {
|
|
49916
|
-
return o
|
|
49926
|
+
return hasProperty(o, 'view') || hasProperty(o, 'width') || hasProperty(o, 'height');
|
|
49917
49927
|
}
|
|
49918
49928
|
const DEFAULT_SPACING = 20;
|
|
49919
49929
|
const COMPOSITION_LAYOUT_INDEX = {
|
|
@@ -50348,7 +50358,9 @@ function stripAndRedirectConfig(config) {
|
|
|
50348
50358
|
redirectTitleConfig(config);
|
|
50349
50359
|
// Remove empty config objects.
|
|
50350
50360
|
for (const prop in config) {
|
|
50361
|
+
// @ts-ignore
|
|
50351
50362
|
if (isObject(config[prop]) && isEmpty(config[prop])) {
|
|
50363
|
+
// @ts-ignore
|
|
50352
50364
|
delete config[prop];
|
|
50353
50365
|
}
|
|
50354
50366
|
}
|
|
@@ -50386,7 +50398,9 @@ function redirectTitleConfig(config) {
|
|
|
50386
50398
|
}
|
|
50387
50399
|
function redirectConfigToStyleConfig(config, prop, // string = composite mark
|
|
50388
50400
|
toProp, compositeMarkPart) {
|
|
50389
|
-
const propConfig = compositeMarkPart
|
|
50401
|
+
const propConfig = compositeMarkPart
|
|
50402
|
+
? config[prop][compositeMarkPart]
|
|
50403
|
+
: config[prop];
|
|
50390
50404
|
if (prop === 'view') {
|
|
50391
50405
|
toProp = 'cell'; // View's default style is "cell"
|
|
50392
50406
|
}
|
|
@@ -50405,14 +50419,14 @@ toProp, compositeMarkPart) {
|
|
|
50405
50419
|
}
|
|
50406
50420
|
|
|
50407
50421
|
function isLayerSpec(spec) {
|
|
50408
|
-
return 'layer'
|
|
50422
|
+
return hasProperty(spec, 'layer');
|
|
50409
50423
|
}
|
|
50410
50424
|
|
|
50411
50425
|
function isRepeatSpec(spec) {
|
|
50412
|
-
return 'repeat'
|
|
50426
|
+
return hasProperty(spec, 'repeat');
|
|
50413
50427
|
}
|
|
50414
50428
|
function isLayerRepeatSpec(spec) {
|
|
50415
|
-
return !isArray(spec.repeat) && spec.repeat
|
|
50429
|
+
return !isArray(spec.repeat) && hasProperty(spec.repeat, 'layer');
|
|
50416
50430
|
}
|
|
50417
50431
|
|
|
50418
50432
|
class SpecMapper {
|
|
@@ -50493,7 +50507,7 @@ const STACK_OFFSET_INDEX = {
|
|
|
50493
50507
|
normalize: 1
|
|
50494
50508
|
};
|
|
50495
50509
|
function isStackOffset(s) {
|
|
50496
|
-
return s
|
|
50510
|
+
return has$1(STACK_OFFSET_INDEX, s);
|
|
50497
50511
|
}
|
|
50498
50512
|
const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);
|
|
50499
50513
|
const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);
|
|
@@ -51093,7 +51107,7 @@ function replaceRepeaterInChannelDef(channelDef, repeater) {
|
|
|
51093
51107
|
function replaceRepeaterInMapping(mapping, repeater) {
|
|
51094
51108
|
const out = {};
|
|
51095
51109
|
for (const channel in mapping) {
|
|
51096
|
-
if (
|
|
51110
|
+
if (hasProperty(mapping, channel)) {
|
|
51097
51111
|
const channelDef = mapping[channel];
|
|
51098
51112
|
if (isArray(channelDef)) {
|
|
51099
51113
|
// array cannot have condition
|
|
@@ -51420,70 +51434,70 @@ function mergeProjection(opt) {
|
|
|
51420
51434
|
}
|
|
51421
51435
|
|
|
51422
51436
|
function isFilter(t) {
|
|
51423
|
-
return 'filter'
|
|
51437
|
+
return hasProperty(t, 'filter');
|
|
51424
51438
|
}
|
|
51425
51439
|
function isImputeSequence(t) {
|
|
51426
|
-
return t
|
|
51440
|
+
return hasProperty(t, 'stop');
|
|
51427
51441
|
}
|
|
51428
51442
|
function isLookup(t) {
|
|
51429
|
-
return 'lookup'
|
|
51443
|
+
return hasProperty(t, 'lookup');
|
|
51430
51444
|
}
|
|
51431
51445
|
function isLookupData(from) {
|
|
51432
|
-
return 'data'
|
|
51446
|
+
return hasProperty(from, 'data');
|
|
51433
51447
|
}
|
|
51434
51448
|
function isLookupSelection(from) {
|
|
51435
|
-
return 'param'
|
|
51449
|
+
return hasProperty(from, 'param');
|
|
51436
51450
|
}
|
|
51437
51451
|
function isPivot(t) {
|
|
51438
|
-
return 'pivot'
|
|
51452
|
+
return hasProperty(t, 'pivot');
|
|
51439
51453
|
}
|
|
51440
51454
|
function isDensity(t) {
|
|
51441
|
-
return 'density'
|
|
51455
|
+
return hasProperty(t, 'density');
|
|
51442
51456
|
}
|
|
51443
51457
|
function isQuantile(t) {
|
|
51444
|
-
return 'quantile'
|
|
51458
|
+
return hasProperty(t, 'quantile');
|
|
51445
51459
|
}
|
|
51446
51460
|
function isRegression(t) {
|
|
51447
|
-
return 'regression'
|
|
51461
|
+
return hasProperty(t, 'regression');
|
|
51448
51462
|
}
|
|
51449
51463
|
function isLoess(t) {
|
|
51450
|
-
return 'loess'
|
|
51464
|
+
return hasProperty(t, 'loess');
|
|
51451
51465
|
}
|
|
51452
51466
|
function isSample(t) {
|
|
51453
|
-
return 'sample'
|
|
51467
|
+
return hasProperty(t, 'sample');
|
|
51454
51468
|
}
|
|
51455
51469
|
function isWindow(t) {
|
|
51456
|
-
return 'window'
|
|
51470
|
+
return hasProperty(t, 'window');
|
|
51457
51471
|
}
|
|
51458
51472
|
function isJoinAggregate(t) {
|
|
51459
|
-
return 'joinaggregate'
|
|
51473
|
+
return hasProperty(t, 'joinaggregate');
|
|
51460
51474
|
}
|
|
51461
51475
|
function isFlatten(t) {
|
|
51462
|
-
return 'flatten'
|
|
51476
|
+
return hasProperty(t, 'flatten');
|
|
51463
51477
|
}
|
|
51464
51478
|
function isCalculate(t) {
|
|
51465
|
-
return 'calculate'
|
|
51479
|
+
return hasProperty(t, 'calculate');
|
|
51466
51480
|
}
|
|
51467
51481
|
function isBin(t) {
|
|
51468
|
-
return 'bin'
|
|
51482
|
+
return hasProperty(t, 'bin');
|
|
51469
51483
|
}
|
|
51470
51484
|
function isImpute(t) {
|
|
51471
|
-
return 'impute'
|
|
51485
|
+
return hasProperty(t, 'impute');
|
|
51472
51486
|
}
|
|
51473
51487
|
function isTimeUnit(t) {
|
|
51474
|
-
return 'timeUnit'
|
|
51488
|
+
return hasProperty(t, 'timeUnit');
|
|
51475
51489
|
}
|
|
51476
51490
|
function isAggregate(t) {
|
|
51477
|
-
return 'aggregate'
|
|
51491
|
+
return hasProperty(t, 'aggregate');
|
|
51478
51492
|
}
|
|
51479
51493
|
function isStack(t) {
|
|
51480
|
-
return 'stack'
|
|
51494
|
+
return hasProperty(t, 'stack');
|
|
51481
51495
|
}
|
|
51482
51496
|
function isFold(t) {
|
|
51483
|
-
return 'fold'
|
|
51497
|
+
return hasProperty(t, 'fold');
|
|
51484
51498
|
}
|
|
51485
51499
|
function isExtent(t) {
|
|
51486
|
-
return 'extent'
|
|
51500
|
+
return hasProperty(t, 'extent') && !hasProperty(t, 'density') && !hasProperty(t, 'regression');
|
|
51487
51501
|
}
|
|
51488
51502
|
function normalizeTransform(transform) {
|
|
51489
51503
|
return transform.map(t => {
|
|
@@ -51707,7 +51721,7 @@ function normalizeGenericSpec(spec, config = {}) {
|
|
|
51707
51721
|
return topLevelSelectionNormalizer.map(coreNormalizer.map(selectionCompatNormalizer.map(spec, normParams), normParams), normParams);
|
|
51708
51722
|
}
|
|
51709
51723
|
function _normalizeAutoSize(autosize) {
|
|
51710
|
-
return isString(autosize) ? { type: autosize } : autosize ?? {};
|
|
51724
|
+
return isString(autosize) ? { type: autosize } : (autosize ?? {});
|
|
51711
51725
|
}
|
|
51712
51726
|
/**
|
|
51713
51727
|
* Normalize autosize and deal with width or height == "container".
|
|
@@ -51766,7 +51780,7 @@ function normalizeAutoSize(spec, sizeInfo, config) {
|
|
|
51766
51780
|
}
|
|
51767
51781
|
|
|
51768
51782
|
function isFitType(autoSizeType) {
|
|
51769
|
-
return
|
|
51783
|
+
return ['fit', 'fit-x', 'fit-y'].includes(autoSizeType);
|
|
51770
51784
|
}
|
|
51771
51785
|
function getFitType(sizeType) {
|
|
51772
51786
|
return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';
|
|
@@ -51930,25 +51944,25 @@ class AncestorParse extends Split {
|
|
|
51930
51944
|
}
|
|
51931
51945
|
|
|
51932
51946
|
function isUrlData(data) {
|
|
51933
|
-
return 'url'
|
|
51947
|
+
return hasProperty(data, 'url');
|
|
51934
51948
|
}
|
|
51935
51949
|
function isInlineData(data) {
|
|
51936
|
-
return 'values'
|
|
51950
|
+
return hasProperty(data, 'values');
|
|
51937
51951
|
}
|
|
51938
51952
|
function isNamedData(data) {
|
|
51939
|
-
return 'name'
|
|
51953
|
+
return hasProperty(data, 'name') && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);
|
|
51940
51954
|
}
|
|
51941
51955
|
function isGenerator(data) {
|
|
51942
51956
|
return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));
|
|
51943
51957
|
}
|
|
51944
51958
|
function isSequenceGenerator(data) {
|
|
51945
|
-
return 'sequence'
|
|
51959
|
+
return hasProperty(data, 'sequence');
|
|
51946
51960
|
}
|
|
51947
51961
|
function isSphereGenerator(data) {
|
|
51948
|
-
return 'sphere'
|
|
51962
|
+
return hasProperty(data, 'sphere');
|
|
51949
51963
|
}
|
|
51950
51964
|
function isGraticuleGenerator(data) {
|
|
51951
|
-
return 'graticule'
|
|
51965
|
+
return hasProperty(data, 'graticule');
|
|
51952
51966
|
}
|
|
51953
51967
|
var DataSourceType;
|
|
51954
51968
|
(function (DataSourceType) {
|
|
@@ -52684,9 +52698,9 @@ const scaleBindings = {
|
|
|
52684
52698
|
// state is captured by the top-level signals that we insert and "push
|
|
52685
52699
|
// outer" to from within the units. We need to reassemble this state into
|
|
52686
52700
|
// the top-level named signal, except no single selCmpt has a global view.
|
|
52687
|
-
const namedSg = signals.
|
|
52701
|
+
const namedSg = signals.find(s => s.name === selCmpt.name);
|
|
52688
52702
|
let update = namedSg.update;
|
|
52689
|
-
if (update.
|
|
52703
|
+
if (update.includes(VL_SELECTION_RESOLVE)) {
|
|
52690
52704
|
namedSg.update = `{${bound
|
|
52691
52705
|
.map(proj => `${$(replacePathInField(proj.field))}: ${proj.signals.data}`)
|
|
52692
52706
|
.join(', ')}}`;
|
|
@@ -52749,7 +52763,7 @@ const interval = {
|
|
|
52749
52763
|
continue;
|
|
52750
52764
|
}
|
|
52751
52765
|
const filters = array$5(((_a = evt.between[0]).filter ?? (_a.filter = [])));
|
|
52752
|
-
if (filters.
|
|
52766
|
+
if (!filters.includes(filterExpr)) {
|
|
52753
52767
|
filters.push(filterExpr);
|
|
52754
52768
|
}
|
|
52755
52769
|
}
|
|
@@ -52919,7 +52933,10 @@ const interval = {
|
|
|
52919
52933
|
const vgStroke = keys(stroke).reduce((def, k) => {
|
|
52920
52934
|
def[k] = [
|
|
52921
52935
|
{
|
|
52922
|
-
test: [
|
|
52936
|
+
test: [
|
|
52937
|
+
x !== undefined && `${xvname}[0] !== ${xvname}[1]`,
|
|
52938
|
+
y !== undefined && `${yvname}[0] !== ${yvname}[1]`
|
|
52939
|
+
]
|
|
52923
52940
|
.filter(t => t)
|
|
52924
52941
|
.join(' && '),
|
|
52925
52942
|
value: stroke[k]
|
|
@@ -53186,7 +53203,7 @@ function tooltip(model, opt = {}) {
|
|
|
53186
53203
|
}
|
|
53187
53204
|
function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
53188
53205
|
const formatConfig = { ...config, ...config.tooltipFormat };
|
|
53189
|
-
const toSkip =
|
|
53206
|
+
const toSkip = new Set();
|
|
53190
53207
|
const expr = reactiveGeom ? 'datum.datum' : 'datum';
|
|
53191
53208
|
const tuples = [];
|
|
53192
53209
|
function add(fDef, channel) {
|
|
@@ -53208,7 +53225,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
|
53208
53225
|
const endField = vgField(fieldDef2, { expr });
|
|
53209
53226
|
const { format, formatType } = getFormatMixins(fieldDef);
|
|
53210
53227
|
value = binFormatExpression(startField, endField, format, formatType, formatConfig);
|
|
53211
|
-
toSkip
|
|
53228
|
+
toSkip.add(channel2);
|
|
53212
53229
|
}
|
|
53213
53230
|
}
|
|
53214
53231
|
if ((isXorY(channel) || channel === THETA || channel === RADIUS) &&
|
|
@@ -53238,7 +53255,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
|
53238
53255
|
});
|
|
53239
53256
|
const out = {};
|
|
53240
53257
|
for (const { channel, key, value } of tuples) {
|
|
53241
|
-
if (!toSkip
|
|
53258
|
+
if (!toSkip.has(channel) && !out[key]) {
|
|
53242
53259
|
out[key] = value;
|
|
53243
53260
|
}
|
|
53244
53261
|
}
|
|
@@ -53273,7 +53290,7 @@ function ariaRoleDescription(model) {
|
|
|
53273
53290
|
if (ariaRoleDesc != null) {
|
|
53274
53291
|
return { ariaRoleDescription: { value: ariaRoleDesc } };
|
|
53275
53292
|
}
|
|
53276
|
-
return mark
|
|
53293
|
+
return has$1(VG_MARK_INDEX, mark) ? {} : { ariaRoleDescription: { value: mark } };
|
|
53277
53294
|
}
|
|
53278
53295
|
function description$1(model) {
|
|
53279
53296
|
const { encoding, markDef, config, stack } = model;
|
|
@@ -53318,14 +53335,19 @@ function nonPosition(channel, model, opt = {}) {
|
|
|
53318
53335
|
const { markDef, encoding, config } = model;
|
|
53319
53336
|
const { vgChannel } = opt;
|
|
53320
53337
|
let { defaultRef, defaultValue } = opt;
|
|
53338
|
+
const channelDef = encoding[channel];
|
|
53321
53339
|
if (defaultRef === undefined) {
|
|
53322
53340
|
// prettier-ignore
|
|
53323
|
-
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, {
|
|
53341
|
+
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, {
|
|
53342
|
+
vgChannel,
|
|
53343
|
+
// If there is no conditonal def, we ignore vgConfig so the output spec is concise.
|
|
53344
|
+
// However, if there is a conditional def, we must include vgConfig so the default is respected.
|
|
53345
|
+
ignoreVgConfig: !isConditionalDef(channelDef)
|
|
53346
|
+
}));
|
|
53324
53347
|
if (defaultValue !== undefined) {
|
|
53325
53348
|
defaultRef = signalOrValueRef(defaultValue);
|
|
53326
53349
|
}
|
|
53327
53350
|
}
|
|
53328
|
-
const channelDef = encoding[channel];
|
|
53329
53351
|
const commonProps = {
|
|
53330
53352
|
markDef,
|
|
53331
53353
|
config,
|
|
@@ -53415,6 +53437,7 @@ function zindex(model) {
|
|
|
53415
53437
|
function positionOffset({ channel: baseChannel, markDef, encoding = {}, model, bandPosition }) {
|
|
53416
53438
|
const channel = `${baseChannel}Offset`; // Need to cast as the type can't be inferred automatically
|
|
53417
53439
|
const defaultValue = markDef[channel];
|
|
53440
|
+
// FIXME: remove as any
|
|
53418
53441
|
const channelDef = encoding[channel];
|
|
53419
53442
|
if ((channel === 'xOffset' || channel === 'yOffset') && channelDef) {
|
|
53420
53443
|
const ref = midPoint({
|
|
@@ -53589,6 +53612,7 @@ function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'midd
|
|
|
53589
53612
|
else {
|
|
53590
53613
|
alignExcludingSignal = align;
|
|
53591
53614
|
}
|
|
53615
|
+
// FIXME: remove as any
|
|
53592
53616
|
if (channel === 'x') {
|
|
53593
53617
|
return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];
|
|
53594
53618
|
}
|
|
@@ -53735,9 +53759,12 @@ function rectPosition(model, channel) {
|
|
|
53735
53759
|
const scale = model.getScaleComponent(channel);
|
|
53736
53760
|
const scaleType = scale ? scale.get('type') : undefined;
|
|
53737
53761
|
const orient = markDef.orient;
|
|
53738
|
-
const hasSizeDef = encoding[sizeChannel] ??
|
|
53762
|
+
const hasSizeDef = encoding[sizeChannel] ??
|
|
53763
|
+
encoding.size ??
|
|
53764
|
+
getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });
|
|
53739
53765
|
const offsetScaleChannel = getOffsetChannel(channel);
|
|
53740
|
-
const
|
|
53766
|
+
const isBarOrTickBand = (mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal')) ||
|
|
53767
|
+
(mark === 'tick' && (channel === 'y' ? orient === 'vertical' : orient === 'horizontal'));
|
|
53741
53768
|
// x, x2, and width -- we must specify two of these in all conditions
|
|
53742
53769
|
if (isFieldDef(channelDef) &&
|
|
53743
53770
|
(isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&
|
|
@@ -53751,7 +53778,7 @@ function rectPosition(model, channel) {
|
|
|
53751
53778
|
model
|
|
53752
53779
|
});
|
|
53753
53780
|
}
|
|
53754
|
-
else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) ||
|
|
53781
|
+
else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarOrTickBand) && !channelDef2) {
|
|
53755
53782
|
return positionAndSize(channelDef, channel, model);
|
|
53756
53783
|
}
|
|
53757
53784
|
else {
|
|
@@ -53796,8 +53823,8 @@ function defaultSizeRef(sizeChannel, scaleName, scale, config, bandSize, hasFiel
|
|
|
53796
53823
|
}
|
|
53797
53824
|
}
|
|
53798
53825
|
if (!hasFieldDef) {
|
|
53799
|
-
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = config.scale;
|
|
53800
|
-
const padding = getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner); // this part is like paddingInner in scale.ts
|
|
53826
|
+
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, tickBandPaddingInner } = config.scale;
|
|
53827
|
+
const padding = getFirstDefined(bandPaddingInner, mark === 'tick' ? tickBandPaddingInner : mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner); // this part is like paddingInner in scale.ts
|
|
53801
53828
|
if (isSignalRef(padding)) {
|
|
53802
53829
|
return { signal: `(1 - (${padding.signal})) * ${sizeChannel}` };
|
|
53803
53830
|
}
|
|
@@ -53821,8 +53848,12 @@ function positionAndSize(fieldDef, channel, model) {
|
|
|
53821
53848
|
const offsetScaleChannel = getOffsetChannel(channel);
|
|
53822
53849
|
const offsetScaleName = model.scaleName(offsetScaleChannel);
|
|
53823
53850
|
const offsetScale = model.getScaleComponent(getOffsetScaleChannel(channel));
|
|
53824
|
-
|
|
53825
|
-
|
|
53851
|
+
const useVlSizeChannel =
|
|
53852
|
+
// Always uses size channel for ticks, because tick only calls rectPosition() for the size channel
|
|
53853
|
+
markDef.type === 'tick' ||
|
|
53854
|
+
// use "size" channel for bars, if there is orient and the channel matches the right orientation
|
|
53855
|
+
(orient === 'horizontal' && channel === 'y') ||
|
|
53856
|
+
(orient === 'vertical' && channel === 'x');
|
|
53826
53857
|
// Use size encoding / mark property / config if it exists
|
|
53827
53858
|
let sizeMixins;
|
|
53828
53859
|
if (encoding.size || markDef.size) {
|
|
@@ -53940,7 +53971,7 @@ function rectBinPosition({ fieldDef, fieldDef2, channel, model }) {
|
|
|
53940
53971
|
const bandSize = getBandSize({ channel, fieldDef, markDef, config, scaleType });
|
|
53941
53972
|
const axis = model.component.axes[channel]?.[0];
|
|
53942
53973
|
const axisTranslate = axis?.get('translate') ?? 0.5; // vega default is 0.5
|
|
53943
|
-
const spacing = isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) ?? 0 : 0;
|
|
53974
|
+
const spacing = isXorY(channel) ? (getMarkPropOrConfig('binSpacing', markDef, config) ?? 0) : 0;
|
|
53944
53975
|
const channel2 = getSecondaryRangeChannel(channel);
|
|
53945
53976
|
const vgChannel = getVgPositionChannel(channel);
|
|
53946
53977
|
const vgChannel2 = getVgPositionChannel(channel2);
|
|
@@ -54039,7 +54070,7 @@ function colorRef(channel, valueRef) {
|
|
|
54039
54070
|
}
|
|
54040
54071
|
function markDefProperties(mark, ignore) {
|
|
54041
54072
|
return VG_MARK_CONFIGS.reduce((m, prop) => {
|
|
54042
|
-
if (!ALWAYS_IGNORE.has(prop) && mark
|
|
54073
|
+
if (!ALWAYS_IGNORE.has(prop) && hasProperty(mark, prop) && ignore[prop] !== 'ignore') {
|
|
54043
54074
|
m[prop] = signalOrValueRef(mark[prop]);
|
|
54044
54075
|
}
|
|
54045
54076
|
return m;
|
|
@@ -54139,7 +54170,7 @@ const nearest = {
|
|
|
54139
54170
|
if (name === model.component.mark[0].name) {
|
|
54140
54171
|
index = i;
|
|
54141
54172
|
}
|
|
54142
|
-
else if (name.
|
|
54173
|
+
else if (name.includes(VORONOI)) {
|
|
54143
54174
|
exists = true;
|
|
54144
54175
|
}
|
|
54145
54176
|
});
|
|
@@ -54189,7 +54220,7 @@ const inputBindings = {
|
|
|
54189
54220
|
signals: (model, selCmpt, signals) => {
|
|
54190
54221
|
const name = selCmpt.name;
|
|
54191
54222
|
const proj = selCmpt.project;
|
|
54192
|
-
const signal = signals.
|
|
54223
|
+
const signal = signals.find(s => s.name === name + TUPLE);
|
|
54193
54224
|
const fields = name + TUPLE_FIELDS;
|
|
54194
54225
|
const values = proj.items.map(p => varName(`${name}_${p.field}`));
|
|
54195
54226
|
const valid = values.map(v => `${v} !== null`).join(' && ');
|
|
@@ -54432,7 +54463,7 @@ function onDelta$1(model, selCmpt, proj, size, signals) {
|
|
|
54432
54463
|
const delta = name + DELTA$1;
|
|
54433
54464
|
const channel = proj.channel;
|
|
54434
54465
|
const boundScales = scaleBindings.defined(selCmpt);
|
|
54435
|
-
const signal = signals.
|
|
54466
|
+
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']);
|
|
54436
54467
|
const sizeSg = model.getSizeSignalRef(size).signal;
|
|
54437
54468
|
const scaleCmpt = model.getScaleComponent(channel);
|
|
54438
54469
|
const scaleType = scaleCmpt && scaleCmpt.get('type');
|
|
@@ -54517,7 +54548,7 @@ function onDelta(model, selCmpt, proj, size, signals) {
|
|
|
54517
54548
|
const name = selCmpt.name;
|
|
54518
54549
|
const channel = proj.channel;
|
|
54519
54550
|
const boundScales = scaleBindings.defined(selCmpt);
|
|
54520
|
-
const signal = signals.
|
|
54551
|
+
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']);
|
|
54521
54552
|
const sizeSg = model.getSizeSignalRef(size).signal;
|
|
54522
54553
|
const scaleCmpt = model.getScaleComponent(channel);
|
|
54523
54554
|
const scaleType = scaleCmpt && scaleCmpt.get('type');
|
|
@@ -54687,7 +54718,7 @@ function parseUnitSelection(model, selDefs) {
|
|
|
54687
54718
|
continue;
|
|
54688
54719
|
}
|
|
54689
54720
|
if (key === 'mark') {
|
|
54690
|
-
defaults
|
|
54721
|
+
defaults.mark = { ...cfg.mark, ...defaults.mark };
|
|
54691
54722
|
}
|
|
54692
54723
|
if (defaults[key] === undefined || defaults[key] === true) {
|
|
54693
54724
|
defaults[key] = duplicate(cfg[key] ?? defaults[key]);
|
|
@@ -54740,8 +54771,8 @@ function parseSelectionPredicate(model, pred, dfnode, datum = 'datum') {
|
|
|
54740
54771
|
}
|
|
54741
54772
|
function parseSelectionExtent(model, name, extent) {
|
|
54742
54773
|
const vname = varName(name);
|
|
54743
|
-
const encoding = extent
|
|
54744
|
-
let field = extent
|
|
54774
|
+
const encoding = extent.encoding;
|
|
54775
|
+
let field = extent.field;
|
|
54745
54776
|
let selCmpt;
|
|
54746
54777
|
try {
|
|
54747
54778
|
selCmpt = model.getSelectionComponent(vname, name);
|
|
@@ -54819,7 +54850,8 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
|
|
|
54819
54850
|
if (disable) {
|
|
54820
54851
|
return undefined;
|
|
54821
54852
|
}
|
|
54822
|
-
for (const
|
|
54853
|
+
for (const p in axis) {
|
|
54854
|
+
const prop = p;
|
|
54823
54855
|
const propType = AXIS_PROPERTY_TYPE[prop];
|
|
54824
54856
|
const propValue = axis[prop];
|
|
54825
54857
|
if (propType && propType !== kind && propType !== 'both') {
|
|
@@ -54865,6 +54897,7 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
|
|
|
54865
54897
|
const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];
|
|
54866
54898
|
if (propIndex) {
|
|
54867
54899
|
const { vgProp, part } = propIndex;
|
|
54900
|
+
// FIXME: remove as any
|
|
54868
54901
|
setAxisEncode(axis, part, vgProp, propValue);
|
|
54869
54902
|
delete axis[prop];
|
|
54870
54903
|
} // else do nothing since the property already supports signal
|
|
@@ -55745,28 +55778,26 @@ function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, leg
|
|
|
55745
55778
|
const symbolOpacity = legendCmpt.get('symbolOpacity') ?? config.legend.symbolOpacity;
|
|
55746
55779
|
const symbolFillColor = legendCmpt.get('symbolFillColor') ?? config.legend.symbolFillColor;
|
|
55747
55780
|
const symbolStrokeColor = legendCmpt.get('symbolStrokeColor') ?? config.legend.symbolStrokeColor;
|
|
55748
|
-
const opacity = symbolOpacity === undefined ? getMaxValue(encoding.opacity) ?? markDef.opacity : undefined;
|
|
55781
|
+
const opacity = symbolOpacity === undefined ? (getMaxValue(encoding.opacity) ?? markDef.opacity) : undefined;
|
|
55749
55782
|
if (out.fill) {
|
|
55750
55783
|
// for fill legend, we don't want any fill in symbol
|
|
55751
55784
|
if (channel === 'fill' || (filled && channel === COLOR)) {
|
|
55752
55785
|
delete out.fill;
|
|
55753
55786
|
}
|
|
55754
|
-
else {
|
|
55755
|
-
if
|
|
55756
|
-
|
|
55757
|
-
|
|
55758
|
-
delete out.fill;
|
|
55759
|
-
}
|
|
55760
|
-
else {
|
|
55761
|
-
out.fill = signalOrValueRef(config.legend.symbolBaseFillColor ?? 'black');
|
|
55762
|
-
out.fillOpacity = signalOrValueRef(opacity ?? 1);
|
|
55763
|
-
}
|
|
55787
|
+
else if (hasProperty(out.fill, 'field')) {
|
|
55788
|
+
// For others, set fill to some opaque value (or nothing if a color is already set)
|
|
55789
|
+
if (symbolFillColor) {
|
|
55790
|
+
delete out.fill;
|
|
55764
55791
|
}
|
|
55765
|
-
else
|
|
55766
|
-
|
|
55767
|
-
|
|
55768
|
-
|
|
55769
|
-
|
|
55792
|
+
else {
|
|
55793
|
+
out.fill = signalOrValueRef(config.legend.symbolBaseFillColor ?? 'black');
|
|
55794
|
+
out.fillOpacity = signalOrValueRef(opacity ?? 1);
|
|
55795
|
+
}
|
|
55796
|
+
}
|
|
55797
|
+
else if (isArray(out.fill)) {
|
|
55798
|
+
const fill = getFirstConditionValue(encoding.fill ?? encoding.color) ?? markDef.fill ?? (filled && markDef.color);
|
|
55799
|
+
if (fill) {
|
|
55800
|
+
out.fill = signalOrValueRef(fill);
|
|
55770
55801
|
}
|
|
55771
55802
|
}
|
|
55772
55803
|
}
|
|
@@ -55774,16 +55805,14 @@ function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, leg
|
|
|
55774
55805
|
if (channel === 'stroke' || (!filled && channel === COLOR)) {
|
|
55775
55806
|
delete out.stroke;
|
|
55776
55807
|
}
|
|
55777
|
-
else {
|
|
55778
|
-
|
|
55779
|
-
|
|
55780
|
-
|
|
55781
|
-
|
|
55782
|
-
|
|
55783
|
-
|
|
55784
|
-
|
|
55785
|
-
out.stroke = { value: stroke };
|
|
55786
|
-
}
|
|
55808
|
+
else if (hasProperty(out.stroke, 'field') || symbolStrokeColor) {
|
|
55809
|
+
// For others, remove stroke field
|
|
55810
|
+
delete out.stroke;
|
|
55811
|
+
}
|
|
55812
|
+
else if (isArray(out.stroke)) {
|
|
55813
|
+
const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);
|
|
55814
|
+
if (stroke) {
|
|
55815
|
+
out.stroke = { value: stroke };
|
|
55787
55816
|
}
|
|
55788
55817
|
}
|
|
55789
55818
|
}
|
|
@@ -56134,6 +56163,7 @@ function parseLegendForChannel(model, channel) {
|
|
|
56134
56163
|
const legendEncode = {};
|
|
56135
56164
|
const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };
|
|
56136
56165
|
for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {
|
|
56166
|
+
// FIXME: remove as any (figure out what legendEncoding.entries is)
|
|
56137
56167
|
const legendEncodingPart = guideEncodeEntry(legendEncoding[part] ?? {}, model);
|
|
56138
56168
|
const value = part in legendEncodeRules
|
|
56139
56169
|
? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule
|
|
@@ -56530,7 +56560,7 @@ function rangeFormula(model, fieldDef, channel, config) {
|
|
|
56530
56560
|
if (binRequiresRange(fieldDef, channel)) {
|
|
56531
56561
|
// read format from axis or legend, if there is no format then use config.numberFormat
|
|
56532
56562
|
const guide = isUnitModel(model)
|
|
56533
|
-
? model.axis(channel) ?? model.legend(channel) ?? {}
|
|
56563
|
+
? (model.axis(channel) ?? model.legend(channel) ?? {})
|
|
56534
56564
|
: {};
|
|
56535
56565
|
const startField = vgField(fieldDef, { expr: 'datum' });
|
|
56536
56566
|
const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });
|
|
@@ -56805,6 +56835,7 @@ class AggregateNode extends DataFlowNode {
|
|
|
56805
56835
|
return new AggregateNode(parent, dims, meas);
|
|
56806
56836
|
}
|
|
56807
56837
|
static makeFromTransform(parent, t) {
|
|
56838
|
+
var _a;
|
|
56808
56839
|
const dims = new Set();
|
|
56809
56840
|
const meas = {};
|
|
56810
56841
|
for (const s of t.aggregate) {
|
|
@@ -56816,7 +56847,8 @@ class AggregateNode extends DataFlowNode {
|
|
|
56816
56847
|
}
|
|
56817
56848
|
else {
|
|
56818
56849
|
meas[field] ?? (meas[field] = {});
|
|
56819
|
-
meas[field][op]
|
|
56850
|
+
(_a = meas[field])[op] ?? (_a[op] = new Set());
|
|
56851
|
+
meas[field][op].add(as ? as : vgField(s, { forAs: true }));
|
|
56820
56852
|
}
|
|
56821
56853
|
}
|
|
56822
56854
|
}
|
|
@@ -57176,10 +57208,11 @@ function getImplicitFromFilterTransform(transform) {
|
|
|
57176
57208
|
val = signalRefOrValue(filter.gte);
|
|
57177
57209
|
}
|
|
57178
57210
|
else if (isFieldRangePredicate(filter)) {
|
|
57211
|
+
// FIXME: remove as any
|
|
57179
57212
|
val = filter.range[0];
|
|
57180
57213
|
}
|
|
57181
57214
|
else if (isFieldOneOfPredicate(filter)) {
|
|
57182
|
-
val = (filter.oneOf ?? filter
|
|
57215
|
+
val = (filter.oneOf ?? filter.in)[0];
|
|
57183
57216
|
} // else -- for filter expression, we can't infer anything
|
|
57184
57217
|
if (val) {
|
|
57185
57218
|
if (isDateTime(val)) {
|
|
@@ -58822,8 +58855,8 @@ function parseSelectionDomain(model, channel) {
|
|
|
58822
58855
|
const scale = model.component.scales[channel];
|
|
58823
58856
|
const spec = model.specifiedScales[channel].domain;
|
|
58824
58857
|
const bin = model.fieldDef(channel)?.bin;
|
|
58825
|
-
const domain = isParameterDomain(spec)
|
|
58826
|
-
const extent = isBinParams(bin) && isParameterExtent(bin.extent)
|
|
58858
|
+
const domain = isParameterDomain(spec) ? spec : undefined;
|
|
58859
|
+
const extent = isBinParams(bin) && isParameterExtent(bin.extent) ? bin.extent : undefined;
|
|
58827
58860
|
if (domain || extent) {
|
|
58828
58861
|
// As scale parsing occurs before selection parsing, we cannot set
|
|
58829
58862
|
// domainRaw directly. So instead, we store the selectionExtent on
|
|
@@ -58995,7 +59028,7 @@ function mergeDomains(domains) {
|
|
|
58995
59028
|
}
|
|
58996
59029
|
// only keep sort properties that work with unioned domains
|
|
58997
59030
|
const unionDomainSorts = unique(sorts.map(s => {
|
|
58998
|
-
if (isBoolean(s) || !('op' in s) || (isString(s.op) && s.op
|
|
59031
|
+
if (isBoolean(s) || !('op' in s) || (isString(s.op) && has$1(MULTIDOMAIN_SORT_OP_INDEX, s.op))) {
|
|
58999
59032
|
return s;
|
|
59000
59033
|
}
|
|
59001
59034
|
warn(domainSortDropped(s));
|
|
@@ -59680,7 +59713,7 @@ function parseUnitScaleProperty(model, property) {
|
|
|
59680
59713
|
}
|
|
59681
59714
|
if (supportedByScaleType && channelIncompatability === undefined) {
|
|
59682
59715
|
if (specifiedValue !== undefined) {
|
|
59683
|
-
const timeUnit = fieldOrDatumDef
|
|
59716
|
+
const timeUnit = fieldOrDatumDef.timeUnit;
|
|
59684
59717
|
const type = fieldOrDatumDef.type;
|
|
59685
59718
|
switch (property) {
|
|
59686
59719
|
// domainMax/Min to signal if the value is a datetime object
|
|
@@ -59698,7 +59731,7 @@ function parseUnitScaleProperty(model, property) {
|
|
|
59698
59731
|
}
|
|
59699
59732
|
}
|
|
59700
59733
|
else {
|
|
59701
|
-
const value = property
|
|
59734
|
+
const value = hasProperty(scaleRules, property)
|
|
59702
59735
|
? scaleRules[property]({
|
|
59703
59736
|
model,
|
|
59704
59737
|
channel,
|
|
@@ -59837,11 +59870,11 @@ function paddingInner(paddingValue, channel, mark, scaleType, scaleConfig, hasNe
|
|
|
59837
59870
|
// Padding is only set for X and Y by default.
|
|
59838
59871
|
// Basically it doesn't make sense to add padding for color and size.
|
|
59839
59872
|
// paddingOuter would only be called if it's a band scale, just return the default for bandScale.
|
|
59840
|
-
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, bandWithNestedOffsetPaddingInner } = scaleConfig;
|
|
59873
|
+
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, tickBandPaddingInner, bandWithNestedOffsetPaddingInner } = scaleConfig;
|
|
59841
59874
|
if (hasNestedOffsetScale) {
|
|
59842
59875
|
return bandWithNestedOffsetPaddingInner;
|
|
59843
59876
|
}
|
|
59844
|
-
return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);
|
|
59877
|
+
return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : mark === 'tick' ? tickBandPaddingInner : rectBandPaddingInner);
|
|
59845
59878
|
}
|
|
59846
59879
|
else if (isXorYOffset(channel)) {
|
|
59847
59880
|
if (scaleType === ScaleType.BAND) {
|
|
@@ -59985,8 +60018,8 @@ function defaultType(channel, fieldDef, mark, hasNestedOffsetScale) {
|
|
|
59985
60018
|
return 'ordinal';
|
|
59986
60019
|
}
|
|
59987
60020
|
if (isXorY(channel) || isXorYOffset(channel)) {
|
|
59988
|
-
if (contains(['rect', 'bar', 'image', 'rule'], mark.type)) {
|
|
59989
|
-
// The rect/bar mark should fit into a band.
|
|
60021
|
+
if (contains(['rect', 'bar', 'image', 'rule', 'tick'], mark.type)) {
|
|
60022
|
+
// The rect/bar/tick mark should fit into a band.
|
|
59990
60023
|
// For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429
|
|
59991
60024
|
return 'band';
|
|
59992
60025
|
}
|
|
@@ -60072,7 +60105,7 @@ function parseUnitScaleCore(model) {
|
|
|
60072
60105
|
if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {
|
|
60073
60106
|
continue;
|
|
60074
60107
|
}
|
|
60075
|
-
let specifiedScale = fieldOrDatumDef && fieldOrDatumDef
|
|
60108
|
+
let specifiedScale = fieldOrDatumDef && fieldOrDatumDef.scale;
|
|
60076
60109
|
if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {
|
|
60077
60110
|
specifiedScale ?? (specifiedScale = {});
|
|
60078
60111
|
const hasNestedOffsetScale = channelHasNestedOffsetScale(encoding, channel);
|
|
@@ -61619,7 +61652,7 @@ class FacetModel extends ModelWithField {
|
|
|
61619
61652
|
return facetFieldDef;
|
|
61620
61653
|
}
|
|
61621
61654
|
channelHasField(channel) {
|
|
61622
|
-
return
|
|
61655
|
+
return hasProperty(this.facet, channel);
|
|
61623
61656
|
}
|
|
61624
61657
|
fieldDef(channel) {
|
|
61625
61658
|
return this.facet[channel];
|
|
@@ -61950,14 +61983,14 @@ function findSource(data, sources) {
|
|
|
61950
61983
|
if (data.name && other.hasName() && data.name !== other.dataName) {
|
|
61951
61984
|
continue;
|
|
61952
61985
|
}
|
|
61953
|
-
const formatMesh = data
|
|
61986
|
+
const formatMesh = data.format?.mesh;
|
|
61954
61987
|
const otherFeature = otherData.format?.feature;
|
|
61955
61988
|
// feature and mesh are mutually exclusive
|
|
61956
61989
|
if (formatMesh && otherFeature) {
|
|
61957
61990
|
continue;
|
|
61958
61991
|
}
|
|
61959
61992
|
// we have to extract the same feature or mesh
|
|
61960
|
-
const formatFeature = data
|
|
61993
|
+
const formatFeature = data.format?.feature;
|
|
61961
61994
|
if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {
|
|
61962
61995
|
continue;
|
|
61963
61996
|
}
|
|
@@ -63086,7 +63119,8 @@ const tick = {
|
|
|
63086
63119
|
encodeEntry: (model) => {
|
|
63087
63120
|
const { config, markDef } = model;
|
|
63088
63121
|
const orient = markDef.orient;
|
|
63089
|
-
const
|
|
63122
|
+
const vgSizeAxisChannel = orient === 'horizontal' ? 'x' : 'y';
|
|
63123
|
+
const vgThicknessAxisChannel = orient === 'horizontal' ? 'y' : 'x';
|
|
63090
63124
|
const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';
|
|
63091
63125
|
return {
|
|
63092
63126
|
...baseEncodeEntry(model, {
|
|
@@ -63097,35 +63131,15 @@ const tick = {
|
|
|
63097
63131
|
size: 'ignore',
|
|
63098
63132
|
theta: 'ignore'
|
|
63099
63133
|
}),
|
|
63100
|
-
...
|
|
63101
|
-
...pointPosition(
|
|
63102
|
-
|
|
63103
|
-
|
|
63104
|
-
defaultValue: defaultSize(model),
|
|
63105
|
-
vgChannel: vgSizeChannel
|
|
63134
|
+
...rectPosition(model, vgSizeAxisChannel),
|
|
63135
|
+
...pointPosition(vgThicknessAxisChannel, model, {
|
|
63136
|
+
defaultPos: 'mid',
|
|
63137
|
+
vgChannel: vgThicknessAxisChannel === 'y' ? 'yc' : 'xc'
|
|
63106
63138
|
}),
|
|
63107
63139
|
[vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config))
|
|
63108
63140
|
};
|
|
63109
63141
|
}
|
|
63110
63142
|
};
|
|
63111
|
-
function defaultSize(model) {
|
|
63112
|
-
const { config, markDef } = model;
|
|
63113
|
-
const { orient } = markDef;
|
|
63114
|
-
const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';
|
|
63115
|
-
const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');
|
|
63116
|
-
const markPropOrConfig = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel }) ?? config.tick.bandSize;
|
|
63117
|
-
if (markPropOrConfig !== undefined) {
|
|
63118
|
-
return markPropOrConfig;
|
|
63119
|
-
}
|
|
63120
|
-
else {
|
|
63121
|
-
const scaleRange = scale ? scale.get('range') : undefined;
|
|
63122
|
-
if (scaleRange && isVgRangeStep(scaleRange) && isNumber$1(scaleRange.step)) {
|
|
63123
|
-
return (scaleRange.step * 3) / 4;
|
|
63124
|
-
}
|
|
63125
|
-
const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);
|
|
63126
|
-
return (defaultViewStep * 3) / 4;
|
|
63127
|
-
}
|
|
63128
|
-
}
|
|
63129
63143
|
|
|
63130
63144
|
const markCompiler = {
|
|
63131
63145
|
arc,
|
|
@@ -63958,7 +63972,8 @@ const vegaLiteImport = /*#__PURE__*/Object.freeze({
|
|
|
63958
63972
|
normalizeAngle: normalizeAngle,
|
|
63959
63973
|
isNumeric: isNumeric,
|
|
63960
63974
|
deepEqual: deepEqual,
|
|
63961
|
-
stringify: stringify$1
|
|
63975
|
+
stringify: stringify$1,
|
|
63976
|
+
hasProperty: hasProperty
|
|
63962
63977
|
});
|
|
63963
63978
|
|
|
63964
63979
|
function e(e){const[n,r]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return {library:n,version:r}}
|
|
@@ -65273,657 +65288,39 @@ function getDefaultExportFromCjs (x) {
|
|
|
65273
65288
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
65274
65289
|
}
|
|
65275
65290
|
|
|
65276
|
-
var iterator;
|
|
65277
|
-
var hasRequiredIterator;
|
|
65278
|
-
function requireIterator() {
|
|
65279
|
-
if (hasRequiredIterator) return iterator;
|
|
65280
|
-
hasRequiredIterator = 1;
|
|
65281
|
-
iterator = function (Yallist) {
|
|
65282
|
-
Yallist.prototype[Symbol.iterator] = function* () {
|
|
65283
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
|
65284
|
-
yield walker.value;
|
|
65285
|
-
}
|
|
65286
|
-
};
|
|
65287
|
-
};
|
|
65288
|
-
return iterator;
|
|
65289
|
-
}
|
|
65290
|
-
|
|
65291
|
-
var yallist = Yallist$1;
|
|
65292
|
-
Yallist$1.Node = Node;
|
|
65293
|
-
Yallist$1.create = Yallist$1;
|
|
65294
|
-
function Yallist$1(list) {
|
|
65295
|
-
var self = this;
|
|
65296
|
-
if (!(self instanceof Yallist$1)) {
|
|
65297
|
-
self = new Yallist$1();
|
|
65298
|
-
}
|
|
65299
|
-
self.tail = null;
|
|
65300
|
-
self.head = null;
|
|
65301
|
-
self.length = 0;
|
|
65302
|
-
if (list && typeof list.forEach === 'function') {
|
|
65303
|
-
list.forEach(function (item) {
|
|
65304
|
-
self.push(item);
|
|
65305
|
-
});
|
|
65306
|
-
} else if (arguments.length > 0) {
|
|
65307
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65308
|
-
self.push(arguments[i]);
|
|
65309
|
-
}
|
|
65310
|
-
}
|
|
65311
|
-
return self;
|
|
65312
|
-
}
|
|
65313
|
-
Yallist$1.prototype.removeNode = function (node) {
|
|
65314
|
-
if (node.list !== this) {
|
|
65315
|
-
throw new Error('removing node which does not belong to this list');
|
|
65316
|
-
}
|
|
65317
|
-
var next = node.next;
|
|
65318
|
-
var prev = node.prev;
|
|
65319
|
-
if (next) {
|
|
65320
|
-
next.prev = prev;
|
|
65321
|
-
}
|
|
65322
|
-
if (prev) {
|
|
65323
|
-
prev.next = next;
|
|
65324
|
-
}
|
|
65325
|
-
if (node === this.head) {
|
|
65326
|
-
this.head = next;
|
|
65327
|
-
}
|
|
65328
|
-
if (node === this.tail) {
|
|
65329
|
-
this.tail = prev;
|
|
65330
|
-
}
|
|
65331
|
-
node.list.length--;
|
|
65332
|
-
node.next = null;
|
|
65333
|
-
node.prev = null;
|
|
65334
|
-
node.list = null;
|
|
65335
|
-
return next;
|
|
65336
|
-
};
|
|
65337
|
-
Yallist$1.prototype.unshiftNode = function (node) {
|
|
65338
|
-
if (node === this.head) {
|
|
65339
|
-
return;
|
|
65340
|
-
}
|
|
65341
|
-
if (node.list) {
|
|
65342
|
-
node.list.removeNode(node);
|
|
65343
|
-
}
|
|
65344
|
-
var head = this.head;
|
|
65345
|
-
node.list = this;
|
|
65346
|
-
node.next = head;
|
|
65347
|
-
if (head) {
|
|
65348
|
-
head.prev = node;
|
|
65349
|
-
}
|
|
65350
|
-
this.head = node;
|
|
65351
|
-
if (!this.tail) {
|
|
65352
|
-
this.tail = node;
|
|
65353
|
-
}
|
|
65354
|
-
this.length++;
|
|
65355
|
-
};
|
|
65356
|
-
Yallist$1.prototype.pushNode = function (node) {
|
|
65357
|
-
if (node === this.tail) {
|
|
65358
|
-
return;
|
|
65359
|
-
}
|
|
65360
|
-
if (node.list) {
|
|
65361
|
-
node.list.removeNode(node);
|
|
65362
|
-
}
|
|
65363
|
-
var tail = this.tail;
|
|
65364
|
-
node.list = this;
|
|
65365
|
-
node.prev = tail;
|
|
65366
|
-
if (tail) {
|
|
65367
|
-
tail.next = node;
|
|
65368
|
-
}
|
|
65369
|
-
this.tail = node;
|
|
65370
|
-
if (!this.head) {
|
|
65371
|
-
this.head = node;
|
|
65372
|
-
}
|
|
65373
|
-
this.length++;
|
|
65374
|
-
};
|
|
65375
|
-
Yallist$1.prototype.push = function () {
|
|
65376
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65377
|
-
push(this, arguments[i]);
|
|
65378
|
-
}
|
|
65379
|
-
return this.length;
|
|
65380
|
-
};
|
|
65381
|
-
Yallist$1.prototype.unshift = function () {
|
|
65382
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65383
|
-
unshift(this, arguments[i]);
|
|
65384
|
-
}
|
|
65385
|
-
return this.length;
|
|
65386
|
-
};
|
|
65387
|
-
Yallist$1.prototype.pop = function () {
|
|
65388
|
-
if (!this.tail) {
|
|
65389
|
-
return undefined;
|
|
65390
|
-
}
|
|
65391
|
-
var res = this.tail.value;
|
|
65392
|
-
this.tail = this.tail.prev;
|
|
65393
|
-
if (this.tail) {
|
|
65394
|
-
this.tail.next = null;
|
|
65395
|
-
} else {
|
|
65396
|
-
this.head = null;
|
|
65397
|
-
}
|
|
65398
|
-
this.length--;
|
|
65399
|
-
return res;
|
|
65400
|
-
};
|
|
65401
|
-
Yallist$1.prototype.shift = function () {
|
|
65402
|
-
if (!this.head) {
|
|
65403
|
-
return undefined;
|
|
65404
|
-
}
|
|
65405
|
-
var res = this.head.value;
|
|
65406
|
-
this.head = this.head.next;
|
|
65407
|
-
if (this.head) {
|
|
65408
|
-
this.head.prev = null;
|
|
65409
|
-
} else {
|
|
65410
|
-
this.tail = null;
|
|
65411
|
-
}
|
|
65412
|
-
this.length--;
|
|
65413
|
-
return res;
|
|
65414
|
-
};
|
|
65415
|
-
Yallist$1.prototype.forEach = function (fn, thisp) {
|
|
65416
|
-
thisp = thisp || this;
|
|
65417
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
65418
|
-
fn.call(thisp, walker.value, i, this);
|
|
65419
|
-
walker = walker.next;
|
|
65420
|
-
}
|
|
65421
|
-
};
|
|
65422
|
-
Yallist$1.prototype.forEachReverse = function (fn, thisp) {
|
|
65423
|
-
thisp = thisp || this;
|
|
65424
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
65425
|
-
fn.call(thisp, walker.value, i, this);
|
|
65426
|
-
walker = walker.prev;
|
|
65427
|
-
}
|
|
65428
|
-
};
|
|
65429
|
-
Yallist$1.prototype.get = function (n) {
|
|
65430
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
65431
|
-
// abort out of the list early if we hit a cycle
|
|
65432
|
-
walker = walker.next;
|
|
65433
|
-
}
|
|
65434
|
-
if (i === n && walker !== null) {
|
|
65435
|
-
return walker.value;
|
|
65436
|
-
}
|
|
65437
|
-
};
|
|
65438
|
-
Yallist$1.prototype.getReverse = function (n) {
|
|
65439
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
65440
|
-
// abort out of the list early if we hit a cycle
|
|
65441
|
-
walker = walker.prev;
|
|
65442
|
-
}
|
|
65443
|
-
if (i === n && walker !== null) {
|
|
65444
|
-
return walker.value;
|
|
65445
|
-
}
|
|
65446
|
-
};
|
|
65447
|
-
Yallist$1.prototype.map = function (fn, thisp) {
|
|
65448
|
-
thisp = thisp || this;
|
|
65449
|
-
var res = new Yallist$1();
|
|
65450
|
-
for (var walker = this.head; walker !== null;) {
|
|
65451
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
65452
|
-
walker = walker.next;
|
|
65453
|
-
}
|
|
65454
|
-
return res;
|
|
65455
|
-
};
|
|
65456
|
-
Yallist$1.prototype.mapReverse = function (fn, thisp) {
|
|
65457
|
-
thisp = thisp || this;
|
|
65458
|
-
var res = new Yallist$1();
|
|
65459
|
-
for (var walker = this.tail; walker !== null;) {
|
|
65460
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
65461
|
-
walker = walker.prev;
|
|
65462
|
-
}
|
|
65463
|
-
return res;
|
|
65464
|
-
};
|
|
65465
|
-
Yallist$1.prototype.reduce = function (fn, initial) {
|
|
65466
|
-
var acc;
|
|
65467
|
-
var walker = this.head;
|
|
65468
|
-
if (arguments.length > 1) {
|
|
65469
|
-
acc = initial;
|
|
65470
|
-
} else if (this.head) {
|
|
65471
|
-
walker = this.head.next;
|
|
65472
|
-
acc = this.head.value;
|
|
65473
|
-
} else {
|
|
65474
|
-
throw new TypeError('Reduce of empty list with no initial value');
|
|
65475
|
-
}
|
|
65476
|
-
for (var i = 0; walker !== null; i++) {
|
|
65477
|
-
acc = fn(acc, walker.value, i);
|
|
65478
|
-
walker = walker.next;
|
|
65479
|
-
}
|
|
65480
|
-
return acc;
|
|
65481
|
-
};
|
|
65482
|
-
Yallist$1.prototype.reduceReverse = function (fn, initial) {
|
|
65483
|
-
var acc;
|
|
65484
|
-
var walker = this.tail;
|
|
65485
|
-
if (arguments.length > 1) {
|
|
65486
|
-
acc = initial;
|
|
65487
|
-
} else if (this.tail) {
|
|
65488
|
-
walker = this.tail.prev;
|
|
65489
|
-
acc = this.tail.value;
|
|
65490
|
-
} else {
|
|
65491
|
-
throw new TypeError('Reduce of empty list with no initial value');
|
|
65492
|
-
}
|
|
65493
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
|
65494
|
-
acc = fn(acc, walker.value, i);
|
|
65495
|
-
walker = walker.prev;
|
|
65496
|
-
}
|
|
65497
|
-
return acc;
|
|
65498
|
-
};
|
|
65499
|
-
Yallist$1.prototype.toArray = function () {
|
|
65500
|
-
var arr = new Array(this.length);
|
|
65501
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
65502
|
-
arr[i] = walker.value;
|
|
65503
|
-
walker = walker.next;
|
|
65504
|
-
}
|
|
65505
|
-
return arr;
|
|
65506
|
-
};
|
|
65507
|
-
Yallist$1.prototype.toArrayReverse = function () {
|
|
65508
|
-
var arr = new Array(this.length);
|
|
65509
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
65510
|
-
arr[i] = walker.value;
|
|
65511
|
-
walker = walker.prev;
|
|
65512
|
-
}
|
|
65513
|
-
return arr;
|
|
65514
|
-
};
|
|
65515
|
-
Yallist$1.prototype.slice = function (from, to) {
|
|
65516
|
-
to = to || this.length;
|
|
65517
|
-
if (to < 0) {
|
|
65518
|
-
to += this.length;
|
|
65519
|
-
}
|
|
65520
|
-
from = from || 0;
|
|
65521
|
-
if (from < 0) {
|
|
65522
|
-
from += this.length;
|
|
65523
|
-
}
|
|
65524
|
-
var ret = new Yallist$1();
|
|
65525
|
-
if (to < from || to < 0) {
|
|
65526
|
-
return ret;
|
|
65527
|
-
}
|
|
65528
|
-
if (from < 0) {
|
|
65529
|
-
from = 0;
|
|
65530
|
-
}
|
|
65531
|
-
if (to > this.length) {
|
|
65532
|
-
to = this.length;
|
|
65533
|
-
}
|
|
65534
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
65535
|
-
walker = walker.next;
|
|
65536
|
-
}
|
|
65537
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
65538
|
-
ret.push(walker.value);
|
|
65539
|
-
}
|
|
65540
|
-
return ret;
|
|
65541
|
-
};
|
|
65542
|
-
Yallist$1.prototype.sliceReverse = function (from, to) {
|
|
65543
|
-
to = to || this.length;
|
|
65544
|
-
if (to < 0) {
|
|
65545
|
-
to += this.length;
|
|
65546
|
-
}
|
|
65547
|
-
from = from || 0;
|
|
65548
|
-
if (from < 0) {
|
|
65549
|
-
from += this.length;
|
|
65550
|
-
}
|
|
65551
|
-
var ret = new Yallist$1();
|
|
65552
|
-
if (to < from || to < 0) {
|
|
65553
|
-
return ret;
|
|
65554
|
-
}
|
|
65555
|
-
if (from < 0) {
|
|
65556
|
-
from = 0;
|
|
65557
|
-
}
|
|
65558
|
-
if (to > this.length) {
|
|
65559
|
-
to = this.length;
|
|
65560
|
-
}
|
|
65561
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
65562
|
-
walker = walker.prev;
|
|
65563
|
-
}
|
|
65564
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
65565
|
-
ret.push(walker.value);
|
|
65566
|
-
}
|
|
65567
|
-
return ret;
|
|
65568
|
-
};
|
|
65569
|
-
Yallist$1.prototype.splice = function (start, deleteCount, ...nodes) {
|
|
65570
|
-
if (start > this.length) {
|
|
65571
|
-
start = this.length - 1;
|
|
65572
|
-
}
|
|
65573
|
-
if (start < 0) {
|
|
65574
|
-
start = this.length + start;
|
|
65575
|
-
}
|
|
65576
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
65577
|
-
walker = walker.next;
|
|
65578
|
-
}
|
|
65579
|
-
var ret = [];
|
|
65580
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
|
65581
|
-
ret.push(walker.value);
|
|
65582
|
-
walker = this.removeNode(walker);
|
|
65583
|
-
}
|
|
65584
|
-
if (walker === null) {
|
|
65585
|
-
walker = this.tail;
|
|
65586
|
-
}
|
|
65587
|
-
if (walker !== this.head && walker !== this.tail) {
|
|
65588
|
-
walker = walker.prev;
|
|
65589
|
-
}
|
|
65590
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
65591
|
-
walker = insert(this, walker, nodes[i]);
|
|
65592
|
-
}
|
|
65593
|
-
return ret;
|
|
65594
|
-
};
|
|
65595
|
-
Yallist$1.prototype.reverse = function () {
|
|
65596
|
-
var head = this.head;
|
|
65597
|
-
var tail = this.tail;
|
|
65598
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
65599
|
-
var p = walker.prev;
|
|
65600
|
-
walker.prev = walker.next;
|
|
65601
|
-
walker.next = p;
|
|
65602
|
-
}
|
|
65603
|
-
this.head = tail;
|
|
65604
|
-
this.tail = head;
|
|
65605
|
-
return this;
|
|
65606
|
-
};
|
|
65607
|
-
function insert(self, node, value) {
|
|
65608
|
-
var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
|
|
65609
|
-
if (inserted.next === null) {
|
|
65610
|
-
self.tail = inserted;
|
|
65611
|
-
}
|
|
65612
|
-
if (inserted.prev === null) {
|
|
65613
|
-
self.head = inserted;
|
|
65614
|
-
}
|
|
65615
|
-
self.length++;
|
|
65616
|
-
return inserted;
|
|
65617
|
-
}
|
|
65618
|
-
function push(self, item) {
|
|
65619
|
-
self.tail = new Node(item, self.tail, null, self);
|
|
65620
|
-
if (!self.head) {
|
|
65621
|
-
self.head = self.tail;
|
|
65622
|
-
}
|
|
65623
|
-
self.length++;
|
|
65624
|
-
}
|
|
65625
|
-
function unshift(self, item) {
|
|
65626
|
-
self.head = new Node(item, null, self.head, self);
|
|
65627
|
-
if (!self.tail) {
|
|
65628
|
-
self.tail = self.head;
|
|
65629
|
-
}
|
|
65630
|
-
self.length++;
|
|
65631
|
-
}
|
|
65632
|
-
function Node(value, prev, next, list) {
|
|
65633
|
-
if (!(this instanceof Node)) {
|
|
65634
|
-
return new Node(value, prev, next, list);
|
|
65635
|
-
}
|
|
65636
|
-
this.list = list;
|
|
65637
|
-
this.value = value;
|
|
65638
|
-
if (prev) {
|
|
65639
|
-
prev.next = this;
|
|
65640
|
-
this.prev = prev;
|
|
65641
|
-
} else {
|
|
65642
|
-
this.prev = null;
|
|
65643
|
-
}
|
|
65644
|
-
if (next) {
|
|
65645
|
-
next.prev = this;
|
|
65646
|
-
this.next = next;
|
|
65647
|
-
} else {
|
|
65648
|
-
this.next = null;
|
|
65649
|
-
}
|
|
65650
|
-
}
|
|
65651
|
-
try {
|
|
65652
|
-
// add if support for Symbol.iterator is present
|
|
65653
|
-
requireIterator()(Yallist$1);
|
|
65654
|
-
} catch (er) {}
|
|
65655
|
-
|
|
65656
|
-
// A linked list to keep track of recently-used-ness
|
|
65657
|
-
const Yallist = yallist;
|
|
65658
|
-
const MAX = Symbol('max');
|
|
65659
|
-
const LENGTH = Symbol('length');
|
|
65660
|
-
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
65661
|
-
const ALLOW_STALE = Symbol('allowStale');
|
|
65662
|
-
const MAX_AGE = Symbol('maxAge');
|
|
65663
|
-
const DISPOSE = Symbol('dispose');
|
|
65664
|
-
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
|
|
65665
|
-
const LRU_LIST = Symbol('lruList');
|
|
65666
|
-
const CACHE = Symbol('cache');
|
|
65667
|
-
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
65668
|
-
const naiveLength = () => 1;
|
|
65669
|
-
|
|
65670
|
-
// lruList is a yallist where the head is the youngest
|
|
65671
|
-
// item, and the tail is the oldest. the list contains the Hit
|
|
65672
|
-
// objects as the entries.
|
|
65673
|
-
// Each Hit object has a reference to its Yallist.Node. This
|
|
65674
|
-
// never changes.
|
|
65675
|
-
//
|
|
65676
|
-
// cache is a Map (or PseudoMap) that matches the keys to
|
|
65677
|
-
// the Yallist.Node object.
|
|
65678
65291
|
class LRUCache {
|
|
65679
|
-
constructor(
|
|
65680
|
-
|
|
65681
|
-
|
|
65682
|
-
};
|
|
65683
|
-
if (!options) options = {};
|
|
65684
|
-
if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number');
|
|
65685
|
-
// Kind of weird to have a default max of Infinity, but oh well.
|
|
65686
|
-
this[MAX] = options.max || Infinity;
|
|
65687
|
-
const lc = options.length || naiveLength;
|
|
65688
|
-
this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
|
|
65689
|
-
this[ALLOW_STALE] = options.stale || false;
|
|
65690
|
-
if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');
|
|
65691
|
-
this[MAX_AGE] = options.maxAge || 0;
|
|
65692
|
-
this[DISPOSE] = options.dispose;
|
|
65693
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
65694
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
65695
|
-
this.reset();
|
|
65696
|
-
}
|
|
65697
|
-
|
|
65698
|
-
// resize the cache when the max changes.
|
|
65699
|
-
set max(mL) {
|
|
65700
|
-
if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');
|
|
65701
|
-
this[MAX] = mL || Infinity;
|
|
65702
|
-
trim(this);
|
|
65703
|
-
}
|
|
65704
|
-
get max() {
|
|
65705
|
-
return this[MAX];
|
|
65706
|
-
}
|
|
65707
|
-
set allowStale(allowStale) {
|
|
65708
|
-
this[ALLOW_STALE] = !!allowStale;
|
|
65709
|
-
}
|
|
65710
|
-
get allowStale() {
|
|
65711
|
-
return this[ALLOW_STALE];
|
|
65712
|
-
}
|
|
65713
|
-
set maxAge(mA) {
|
|
65714
|
-
if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');
|
|
65715
|
-
this[MAX_AGE] = mA;
|
|
65716
|
-
trim(this);
|
|
65717
|
-
}
|
|
65718
|
-
get maxAge() {
|
|
65719
|
-
return this[MAX_AGE];
|
|
65720
|
-
}
|
|
65721
|
-
|
|
65722
|
-
// resize the cache when the lengthCalculator changes.
|
|
65723
|
-
set lengthCalculator(lC) {
|
|
65724
|
-
if (typeof lC !== 'function') lC = naiveLength;
|
|
65725
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
65726
|
-
this[LENGTH_CALCULATOR] = lC;
|
|
65727
|
-
this[LENGTH] = 0;
|
|
65728
|
-
this[LRU_LIST].forEach(hit => {
|
|
65729
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
65730
|
-
this[LENGTH] += hit.length;
|
|
65731
|
-
});
|
|
65732
|
-
}
|
|
65733
|
-
trim(this);
|
|
65734
|
-
}
|
|
65735
|
-
get lengthCalculator() {
|
|
65736
|
-
return this[LENGTH_CALCULATOR];
|
|
65737
|
-
}
|
|
65738
|
-
get length() {
|
|
65739
|
-
return this[LENGTH];
|
|
65740
|
-
}
|
|
65741
|
-
get itemCount() {
|
|
65742
|
-
return this[LRU_LIST].length;
|
|
65743
|
-
}
|
|
65744
|
-
rforEach(fn, thisp) {
|
|
65745
|
-
thisp = thisp || this;
|
|
65746
|
-
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
|
65747
|
-
const prev = walker.prev;
|
|
65748
|
-
forEachStep(this, fn, walker, thisp);
|
|
65749
|
-
walker = prev;
|
|
65750
|
-
}
|
|
65751
|
-
}
|
|
65752
|
-
forEach(fn, thisp) {
|
|
65753
|
-
thisp = thisp || this;
|
|
65754
|
-
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
|
65755
|
-
const next = walker.next;
|
|
65756
|
-
forEachStep(this, fn, walker, thisp);
|
|
65757
|
-
walker = next;
|
|
65758
|
-
}
|
|
65759
|
-
}
|
|
65760
|
-
keys() {
|
|
65761
|
-
return this[LRU_LIST].toArray().map(k => k.key);
|
|
65762
|
-
}
|
|
65763
|
-
values() {
|
|
65764
|
-
return this[LRU_LIST].toArray().map(k => k.value);
|
|
65765
|
-
}
|
|
65766
|
-
reset() {
|
|
65767
|
-
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
65768
|
-
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
65769
|
-
}
|
|
65770
|
-
this[CACHE] = new Map(); // hash of items by key
|
|
65771
|
-
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
65772
|
-
this[LENGTH] = 0; // length of items in the list
|
|
65773
|
-
}
|
|
65774
|
-
dump() {
|
|
65775
|
-
return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {
|
|
65776
|
-
k: hit.key,
|
|
65777
|
-
v: hit.value,
|
|
65778
|
-
e: hit.now + (hit.maxAge || 0)
|
|
65779
|
-
}).toArray().filter(h => h);
|
|
65780
|
-
}
|
|
65781
|
-
dumpLru() {
|
|
65782
|
-
return this[LRU_LIST];
|
|
65783
|
-
}
|
|
65784
|
-
set(key, value, maxAge) {
|
|
65785
|
-
maxAge = maxAge || this[MAX_AGE];
|
|
65786
|
-
if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');
|
|
65787
|
-
const now = maxAge ? Date.now() : 0;
|
|
65788
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
|
65789
|
-
if (this[CACHE].has(key)) {
|
|
65790
|
-
if (len > this[MAX]) {
|
|
65791
|
-
del(this, this[CACHE].get(key));
|
|
65792
|
-
return false;
|
|
65793
|
-
}
|
|
65794
|
-
const node = this[CACHE].get(key);
|
|
65795
|
-
const item = node.value;
|
|
65796
|
-
|
|
65797
|
-
// dispose of the old one before overwriting
|
|
65798
|
-
// split out into 2 ifs for better coverage tracking
|
|
65799
|
-
if (this[DISPOSE]) {
|
|
65800
|
-
if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);
|
|
65801
|
-
}
|
|
65802
|
-
item.now = now;
|
|
65803
|
-
item.maxAge = maxAge;
|
|
65804
|
-
item.value = value;
|
|
65805
|
-
this[LENGTH] += len - item.length;
|
|
65806
|
-
item.length = len;
|
|
65807
|
-
this.get(key);
|
|
65808
|
-
trim(this);
|
|
65809
|
-
return true;
|
|
65810
|
-
}
|
|
65811
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
|
65812
|
-
|
|
65813
|
-
// oversized objects fall out of cache automatically.
|
|
65814
|
-
if (hit.length > this[MAX]) {
|
|
65815
|
-
if (this[DISPOSE]) this[DISPOSE](key, value);
|
|
65816
|
-
return false;
|
|
65817
|
-
}
|
|
65818
|
-
this[LENGTH] += hit.length;
|
|
65819
|
-
this[LRU_LIST].unshift(hit);
|
|
65820
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
|
65821
|
-
trim(this);
|
|
65822
|
-
return true;
|
|
65823
|
-
}
|
|
65824
|
-
has(key) {
|
|
65825
|
-
if (!this[CACHE].has(key)) return false;
|
|
65826
|
-
const hit = this[CACHE].get(key).value;
|
|
65827
|
-
return !isStale(this, hit);
|
|
65292
|
+
constructor() {
|
|
65293
|
+
this.max = 1000;
|
|
65294
|
+
this.map = new Map();
|
|
65828
65295
|
}
|
|
65829
65296
|
get(key) {
|
|
65830
|
-
|
|
65831
|
-
|
|
65832
|
-
|
|
65833
|
-
|
|
65834
|
-
|
|
65835
|
-
|
|
65836
|
-
|
|
65837
|
-
|
|
65838
|
-
del(this, node);
|
|
65839
|
-
return node.value;
|
|
65840
|
-
}
|
|
65841
|
-
del(key) {
|
|
65842
|
-
del(this, this[CACHE].get(key));
|
|
65843
|
-
}
|
|
65844
|
-
load(arr) {
|
|
65845
|
-
// reset the cache
|
|
65846
|
-
this.reset();
|
|
65847
|
-
const now = Date.now();
|
|
65848
|
-
// A previous serialized cache has the most recent items first
|
|
65849
|
-
for (let l = arr.length - 1; l >= 0; l--) {
|
|
65850
|
-
const hit = arr[l];
|
|
65851
|
-
const expiresAt = hit.e || 0;
|
|
65852
|
-
if (expiresAt === 0)
|
|
65853
|
-
// the item was created without expiration in a non aged cache
|
|
65854
|
-
this.set(hit.k, hit.v);else {
|
|
65855
|
-
const maxAge = expiresAt - now;
|
|
65856
|
-
// dont add already expired items
|
|
65857
|
-
if (maxAge > 0) {
|
|
65858
|
-
this.set(hit.k, hit.v, maxAge);
|
|
65859
|
-
}
|
|
65860
|
-
}
|
|
65297
|
+
const value = this.map.get(key);
|
|
65298
|
+
if (value === undefined) {
|
|
65299
|
+
return undefined;
|
|
65300
|
+
} else {
|
|
65301
|
+
// Remove the key from the map and add it to the end
|
|
65302
|
+
this.map.delete(key);
|
|
65303
|
+
this.map.set(key, value);
|
|
65304
|
+
return value;
|
|
65861
65305
|
}
|
|
65862
65306
|
}
|
|
65863
|
-
|
|
65864
|
-
this
|
|
65307
|
+
delete(key) {
|
|
65308
|
+
return this.map.delete(key);
|
|
65865
65309
|
}
|
|
65866
|
-
|
|
65867
|
-
const
|
|
65868
|
-
|
|
65869
|
-
|
|
65870
|
-
|
|
65871
|
-
|
|
65872
|
-
|
|
65873
|
-
if (!self[ALLOW_STALE]) return undefined;
|
|
65874
|
-
} else {
|
|
65875
|
-
if (doUse) {
|
|
65876
|
-
if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();
|
|
65877
|
-
self[LRU_LIST].unshiftNode(node);
|
|
65310
|
+
set(key, value) {
|
|
65311
|
+
const deleted = this.delete(key);
|
|
65312
|
+
if (!deleted && value !== undefined) {
|
|
65313
|
+
// If cache is full, delete the least recently used item
|
|
65314
|
+
if (this.map.size >= this.max) {
|
|
65315
|
+
const firstKey = this.map.keys().next().value;
|
|
65316
|
+
this.delete(firstKey);
|
|
65878
65317
|
}
|
|
65318
|
+
this.map.set(key, value);
|
|
65879
65319
|
}
|
|
65880
|
-
return
|
|
65881
|
-
}
|
|
65882
|
-
};
|
|
65883
|
-
const isStale = (self, hit) => {
|
|
65884
|
-
if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;
|
|
65885
|
-
const diff = Date.now() - hit.now;
|
|
65886
|
-
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
|
|
65887
|
-
};
|
|
65888
|
-
const trim = self => {
|
|
65889
|
-
if (self[LENGTH] > self[MAX]) {
|
|
65890
|
-
for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {
|
|
65891
|
-
// We know that we're about to delete this one, and also
|
|
65892
|
-
// what the next least recently used key will be, so just
|
|
65893
|
-
// go ahead and set it now.
|
|
65894
|
-
const prev = walker.prev;
|
|
65895
|
-
del(self, walker);
|
|
65896
|
-
walker = prev;
|
|
65897
|
-
}
|
|
65898
|
-
}
|
|
65899
|
-
};
|
|
65900
|
-
const del = (self, node) => {
|
|
65901
|
-
if (node) {
|
|
65902
|
-
const hit = node.value;
|
|
65903
|
-
if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);
|
|
65904
|
-
self[LENGTH] -= hit.length;
|
|
65905
|
-
self[CACHE].delete(hit.key);
|
|
65906
|
-
self[LRU_LIST].removeNode(node);
|
|
65320
|
+
return this;
|
|
65907
65321
|
}
|
|
65908
|
-
}
|
|
65909
|
-
|
|
65910
|
-
constructor(key, value, length, now, maxAge) {
|
|
65911
|
-
this.key = key;
|
|
65912
|
-
this.value = value;
|
|
65913
|
-
this.length = length;
|
|
65914
|
-
this.now = now;
|
|
65915
|
-
this.maxAge = maxAge || 0;
|
|
65916
|
-
}
|
|
65917
|
-
}
|
|
65918
|
-
const forEachStep = (self, fn, node, thisp) => {
|
|
65919
|
-
let hit = node.value;
|
|
65920
|
-
if (isStale(self, hit)) {
|
|
65921
|
-
del(self, node);
|
|
65922
|
-
if (!self[ALLOW_STALE]) hit = undefined;
|
|
65923
|
-
}
|
|
65924
|
-
if (hit) fn.call(thisp, hit.value, hit.key, self);
|
|
65925
|
-
};
|
|
65926
|
-
var lruCache = LRUCache;
|
|
65322
|
+
}
|
|
65323
|
+
var lrucache = LRUCache;
|
|
65927
65324
|
|
|
65928
65325
|
// parse out just the options we care about
|
|
65929
65326
|
const looseOption = Object.freeze({
|
|
@@ -66287,7 +65684,7 @@ let SemVer$1 = class SemVer {
|
|
|
66287
65684
|
do {
|
|
66288
65685
|
const a = this.build[i];
|
|
66289
65686
|
const b = other.build[i];
|
|
66290
|
-
debug('
|
|
65687
|
+
debug('build compare', i, a, b);
|
|
66291
65688
|
if (a === undefined && b === undefined) {
|
|
66292
65689
|
return 0;
|
|
66293
65690
|
} else if (b === undefined) {
|
|
@@ -66789,10 +66186,8 @@ function requireRange() {
|
|
|
66789
66186
|
}
|
|
66790
66187
|
}
|
|
66791
66188
|
range = Range;
|
|
66792
|
-
const LRU =
|
|
66793
|
-
const cache = new LRU(
|
|
66794
|
-
max: 1000
|
|
66795
|
-
});
|
|
66189
|
+
const LRU = lrucache;
|
|
66190
|
+
const cache = new LRU();
|
|
66796
66191
|
const parseOptions = parseOptions_1;
|
|
66797
66192
|
const Comparator = requireComparator();
|
|
66798
66193
|
const debug = debug_1;
|
|
@@ -67020,7 +66415,8 @@ function requireRange() {
|
|
|
67020
66415
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
67021
66416
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
67022
66417
|
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
67023
|
-
|
|
66418
|
+
// TODO build?
|
|
66419
|
+
const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
67024
66420
|
if (isX(fM)) {
|
|
67025
66421
|
from = '';
|
|
67026
66422
|
} else if (isX(fm)) {
|
|
@@ -67637,9 +67033,9 @@ async function _embed(el, spec, opts = {}, loader) {
|
|
|
67637
67033
|
editorLink.addEventListener('click', function (e) {
|
|
67638
67034
|
post(window, editorUrl, {
|
|
67639
67035
|
config: config,
|
|
67640
|
-
mode,
|
|
67036
|
+
mode: patch ? 'vega' : mode,
|
|
67641
67037
|
renderer,
|
|
67642
|
-
spec: jsonStringifyPrettyCompact(spec)
|
|
67038
|
+
spec: jsonStringifyPrettyCompact(patch ? vgSpec : spec)
|
|
67643
67039
|
});
|
|
67644
67040
|
e.preventDefault();
|
|
67645
67041
|
});
|