genesys-spark-chart-components 4.81.1 → 4.81.3
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-12cd593a.js → color-palette-313d94f7.js} +21 -21
- 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/collection/i18n/index.js +1 -1
- package/dist/esm/{color-palette-5cafcce9.js → color-palette-686ee197.js} +21 -21
- 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-187bbca4.entry.js → p-028de4aa.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-5abce991.entry.js → p-13e52c23.entry.js} +2 -2
- package/dist/genesys-chart-webcomponents/{p-f03fb957.entry.js → p-32c90b8d.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-cb712f61.entry.js → p-4cf542a9.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-96273072.entry.js → p-984c750e.entry.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-e4a70daa.js → p-dafef2fd.js} +1 -1
- package/dist/genesys-chart-webcomponents/{p-487f3bdf.entry.js → p-e8cc490f.entry.js} +1 -1
- package/dist/stencil-wrapper.js +1 -1
- package/dist/types/stencil-wrapper.d.ts +1 -1
- package/package.json +21 -21
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h as h$1, g as getElement } from './index-e4944b0d.js';
|
|
2
|
-
import { D as DEFAULT_LABEL_COLOR, a as DEFAULT_DOMAIN_COLOR, t as trackComponent } from './color-palette-
|
|
2
|
+
import { D as DEFAULT_LABEL_COLOR, a as DEFAULT_DOMAIN_COLOR, t as trackComponent } from './color-palette-686ee197.js';
|
|
3
3
|
|
|
4
4
|
/*!
|
|
5
5
|
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
@@ -1513,7 +1513,7 @@ function lerp (array, frac) {
|
|
|
1513
1513
|
const DEFAULT_MAX_SIZE = 10000;
|
|
1514
1514
|
|
|
1515
1515
|
// adapted from https://github.com/dominictarr/hashlru/ (MIT License)
|
|
1516
|
-
function lruCache
|
|
1516
|
+
function lruCache (maxsize) {
|
|
1517
1517
|
maxsize = +maxsize || DEFAULT_MAX_SIZE;
|
|
1518
1518
|
let curr, prev, size;
|
|
1519
1519
|
const clear = () => {
|
|
@@ -5002,14 +5002,14 @@ function changeset() {
|
|
|
5002
5002
|
};
|
|
5003
5003
|
}
|
|
5004
5004
|
|
|
5005
|
-
const CACHE
|
|
5005
|
+
const CACHE = '_:mod:_';
|
|
5006
5006
|
|
|
5007
5007
|
/**
|
|
5008
5008
|
* Hash that tracks modifications to assigned values.
|
|
5009
5009
|
* Callers *must* use the set method to update values.
|
|
5010
5010
|
*/
|
|
5011
5011
|
function Parameters() {
|
|
5012
|
-
Object.defineProperty(this, CACHE
|
|
5012
|
+
Object.defineProperty(this, CACHE, {
|
|
5013
5013
|
writable: true,
|
|
5014
5014
|
value: {}
|
|
5015
5015
|
});
|
|
@@ -5029,7 +5029,7 @@ Parameters.prototype = {
|
|
|
5029
5029
|
set(name, index, value, force) {
|
|
5030
5030
|
const o = this,
|
|
5031
5031
|
v = o[name],
|
|
5032
|
-
mod = o[CACHE
|
|
5032
|
+
mod = o[CACHE];
|
|
5033
5033
|
if (index != null && index >= 0) {
|
|
5034
5034
|
if (v[index] !== value || force) {
|
|
5035
5035
|
v[index] = value;
|
|
@@ -5053,7 +5053,7 @@ Parameters.prototype = {
|
|
|
5053
5053
|
* @return {boolean} - Returns true if a queried parameter was modified.
|
|
5054
5054
|
*/
|
|
5055
5055
|
modified(name, index) {
|
|
5056
|
-
const mod = this[CACHE
|
|
5056
|
+
const mod = this[CACHE];
|
|
5057
5057
|
if (!arguments.length) {
|
|
5058
5058
|
for (const k in mod) {
|
|
5059
5059
|
if (mod[k]) return true;
|
|
@@ -5072,7 +5072,7 @@ Parameters.prototype = {
|
|
|
5072
5072
|
* all parameters are considered unmodified.
|
|
5073
5073
|
*/
|
|
5074
5074
|
clear() {
|
|
5075
|
-
this[CACHE
|
|
5075
|
+
this[CACHE] = {};
|
|
5076
5076
|
return this;
|
|
5077
5077
|
}
|
|
5078
5078
|
};
|
|
@@ -10622,7 +10622,7 @@ function aggregateParams(_, pulse) {
|
|
|
10622
10622
|
key: _.key,
|
|
10623
10623
|
groupby: _.groupby,
|
|
10624
10624
|
ops: keys.map(() => op),
|
|
10625
|
-
fields: keys.map(k => get$
|
|
10625
|
+
fields: keys.map(k => get$4(k, key, value, fields)),
|
|
10626
10626
|
as: keys.map(k => k + ''),
|
|
10627
10627
|
modified: _.modified.bind(_)
|
|
10628
10628
|
};
|
|
@@ -10630,7 +10630,7 @@ function aggregateParams(_, pulse) {
|
|
|
10630
10630
|
|
|
10631
10631
|
// Generate aggregate field accessor.
|
|
10632
10632
|
// Output NaN for non-existent values; aggregator will ignore!
|
|
10633
|
-
function get$
|
|
10633
|
+
function get$4(k, key, value, fields) {
|
|
10634
10634
|
return accessor(d => key(d) === k ? value(d) : NaN, fields, k + '');
|
|
10635
10635
|
}
|
|
10636
10636
|
|
|
@@ -16126,12 +16126,12 @@ function labelFormat(locale, scale, count, type, specifier, formatType, noSkip)
|
|
|
16126
16126
|
return type === SymbolLegend && isDiscreteRange(scale) ? formatRange(format) : type === DiscreteLegend ? formatDiscrete(format) : formatPoint(format);
|
|
16127
16127
|
}
|
|
16128
16128
|
const formatRange = format => (value, index, array) => {
|
|
16129
|
-
const limit = get$
|
|
16129
|
+
const limit = get$3(array[index + 1], get$3(array.max, +Infinity)),
|
|
16130
16130
|
lo = formatValue$2(value, format),
|
|
16131
16131
|
hi = formatValue$2(limit, format);
|
|
16132
16132
|
return lo && hi ? lo + ' \u2013 ' + hi : hi ? '< ' + hi : '\u2265 ' + lo;
|
|
16133
16133
|
};
|
|
16134
|
-
const get$
|
|
16134
|
+
const get$3 = (value, dflt) => value != null ? value : dflt;
|
|
16135
16135
|
const formatDiscrete = format => (value, index) => index ? format(value) : null;
|
|
16136
16136
|
const formatPoint = format => value => format(value);
|
|
16137
16137
|
const formatValue$2 = (value, format) => Number.isFinite(value) ? format(value) : null;
|
|
@@ -16203,18 +16203,18 @@ function gradientRef(g, defs, base) {
|
|
|
16203
16203
|
if (!id) {
|
|
16204
16204
|
id = g.id = 'gradient_' + gradient_id++;
|
|
16205
16205
|
if (type === 'radial') {
|
|
16206
|
-
g.x1 = get$
|
|
16207
|
-
g.y1 = get$
|
|
16208
|
-
g.r1 = get$
|
|
16209
|
-
g.x2 = get$
|
|
16210
|
-
g.y2 = get$
|
|
16211
|
-
g.r2 = get$
|
|
16206
|
+
g.x1 = get$2(g.x1, 0.5);
|
|
16207
|
+
g.y1 = get$2(g.y1, 0.5);
|
|
16208
|
+
g.r1 = get$2(g.r1, 0);
|
|
16209
|
+
g.x2 = get$2(g.x2, 0.5);
|
|
16210
|
+
g.y2 = get$2(g.y2, 0.5);
|
|
16211
|
+
g.r2 = get$2(g.r2, 0.5);
|
|
16212
16212
|
prefix = patternPrefix;
|
|
16213
16213
|
} else {
|
|
16214
|
-
g.x1 = get$
|
|
16215
|
-
g.y1 = get$
|
|
16216
|
-
g.x2 = get$
|
|
16217
|
-
g.y2 = get$
|
|
16214
|
+
g.x1 = get$2(g.x1, 0);
|
|
16215
|
+
g.y1 = get$2(g.y1, 0);
|
|
16216
|
+
g.x2 = get$2(g.x2, 1);
|
|
16217
|
+
g.y2 = get$2(g.y2, 0);
|
|
16218
16218
|
}
|
|
16219
16219
|
}
|
|
16220
16220
|
|
|
@@ -16224,7 +16224,7 @@ function gradientRef(g, defs, base) {
|
|
|
16224
16224
|
// return url reference
|
|
16225
16225
|
return 'url(' + (base || '') + '#' + prefix + id + ')';
|
|
16226
16226
|
}
|
|
16227
|
-
function get$
|
|
16227
|
+
function get$2(val, def) {
|
|
16228
16228
|
return val != null ? val : def;
|
|
16229
16229
|
}
|
|
16230
16230
|
function Gradient$1 (p0, p1) {
|
|
@@ -18420,7 +18420,7 @@ var shape = markItemPath('shape', shape$1);
|
|
|
18420
18420
|
var symbol = markItemPath('symbol', symbol$1, intersectPoint);
|
|
18421
18421
|
|
|
18422
18422
|
// memoize text width measurement
|
|
18423
|
-
const widthCache = lruCache
|
|
18423
|
+
const widthCache = lruCache();
|
|
18424
18424
|
var textMetrics = {
|
|
18425
18425
|
height: fontSize,
|
|
18426
18426
|
measureWidth: measureWidth,
|
|
@@ -21639,7 +21639,7 @@ function bboxFull(item) {
|
|
|
21639
21639
|
const b = item.bounds.clone();
|
|
21640
21640
|
return b.empty() ? b.set(0, 0, 0, 0) : b.translate(-(item.x || 0), -(item.y || 0));
|
|
21641
21641
|
}
|
|
21642
|
-
function get$
|
|
21642
|
+
function get$1(opt, key, d) {
|
|
21643
21643
|
const v = isObject(opt) ? opt[key] : opt;
|
|
21644
21644
|
return v != null ? v : d !== undefined ? d : 0;
|
|
21645
21645
|
}
|
|
@@ -21650,10 +21650,10 @@ function gridLayout(view, groups, opt) {
|
|
|
21650
21650
|
var dirty = !opt.nodirty,
|
|
21651
21651
|
bbox = opt.bounds === Flush ? bboxFlush : bboxFull,
|
|
21652
21652
|
bounds = tempBounds.set(0, 0, 0, 0),
|
|
21653
|
-
alignCol = get$
|
|
21654
|
-
alignRow = get$
|
|
21655
|
-
padCol = get$
|
|
21656
|
-
padRow = get$
|
|
21653
|
+
alignCol = get$1(opt.align, Column),
|
|
21654
|
+
alignRow = get$1(opt.align, Row),
|
|
21655
|
+
padCol = get$1(opt.padding, Column),
|
|
21656
|
+
padRow = get$1(opt.padding, Row),
|
|
21657
21657
|
ncols = opt.columns || groups.length,
|
|
21658
21658
|
nrows = ncols <= 0 ? 1 : Math.ceil(groups.length / ncols),
|
|
21659
21659
|
n = groups.length,
|
|
@@ -21770,7 +21770,7 @@ function gridLayout(view, groups, opt) {
|
|
|
21770
21770
|
}
|
|
21771
21771
|
|
|
21772
21772
|
// perform horizontal centering
|
|
21773
|
-
if (alignCol && get$
|
|
21773
|
+
if (alignCol && get$1(opt.center, Column) && nrows > 1) {
|
|
21774
21774
|
for (i = 0; i < n; ++i) {
|
|
21775
21775
|
b = alignCol === All ? xMax : xExtent[i % ncols];
|
|
21776
21776
|
x = b - boxes[i].x2 - groups[i].x - dx[i];
|
|
@@ -21779,7 +21779,7 @@ function gridLayout(view, groups, opt) {
|
|
|
21779
21779
|
}
|
|
21780
21780
|
|
|
21781
21781
|
// perform vertical centering
|
|
21782
|
-
if (alignRow && get$
|
|
21782
|
+
if (alignRow && get$1(opt.center, Row) && ncols !== 1) {
|
|
21783
21783
|
for (i = 0; i < n; ++i) {
|
|
21784
21784
|
b = alignRow === All ? yMax : yExtent[~~(i / ncols)];
|
|
21785
21785
|
y = b - boxes[i].y2 - groups[i].y - dy[i];
|
|
@@ -21791,16 +21791,16 @@ function gridLayout(view, groups, opt) {
|
|
|
21791
21791
|
for (i = 0; i < n; ++i) {
|
|
21792
21792
|
bounds.union(boxes[i].translate(dx[i], dy[i]));
|
|
21793
21793
|
}
|
|
21794
|
-
x = get$
|
|
21795
|
-
y = get$
|
|
21796
|
-
switch (get$
|
|
21794
|
+
x = get$1(opt.anchor, X$1);
|
|
21795
|
+
y = get$1(opt.anchor, Y$1);
|
|
21796
|
+
switch (get$1(opt.anchor, Column)) {
|
|
21797
21797
|
case End$1:
|
|
21798
21798
|
x -= bounds.width();
|
|
21799
21799
|
break;
|
|
21800
21800
|
case Middle$1:
|
|
21801
21801
|
x -= bounds.width() / 2;
|
|
21802
21802
|
}
|
|
21803
|
-
switch (get$
|
|
21803
|
+
switch (get$1(opt.anchor, Row)) {
|
|
21804
21804
|
case End$1:
|
|
21805
21805
|
y -= bounds.height();
|
|
21806
21806
|
break;
|
|
@@ -21848,43 +21848,43 @@ function trellisLayout(view, group, opt) {
|
|
|
21848
21848
|
|
|
21849
21849
|
// perform row header layout
|
|
21850
21850
|
if (views.rowheaders) {
|
|
21851
|
-
band = get$
|
|
21852
|
-
x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get$
|
|
21851
|
+
band = get$1(opt.headerBand, Row, null);
|
|
21852
|
+
x = layoutHeaders(view, views.rowheaders, groups, ncols, nrows, -get$1(off, 'rowHeader'), min, 0, bbox, 'x1', 0, ncols, 1, band);
|
|
21853
21853
|
}
|
|
21854
21854
|
|
|
21855
21855
|
// perform column header layout
|
|
21856
21856
|
if (views.colheaders) {
|
|
21857
|
-
band = get$
|
|
21858
|
-
y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get$
|
|
21857
|
+
band = get$1(opt.headerBand, Column, null);
|
|
21858
|
+
y = layoutHeaders(view, views.colheaders, groups, ncols, ncols, -get$1(off, 'columnHeader'), min, 1, bbox, 'y1', 0, 1, ncols, band);
|
|
21859
21859
|
}
|
|
21860
21860
|
|
|
21861
21861
|
// perform row footer layout
|
|
21862
21862
|
if (views.rowfooters) {
|
|
21863
|
-
band = get$
|
|
21864
|
-
x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get$
|
|
21863
|
+
band = get$1(opt.footerBand, Row, null);
|
|
21864
|
+
x2 = layoutHeaders(view, views.rowfooters, groups, ncols, nrows, get$1(off, 'rowFooter'), max, 0, bbox, 'x2', ncols - 1, ncols, 1, band);
|
|
21865
21865
|
}
|
|
21866
21866
|
|
|
21867
21867
|
// perform column footer layout
|
|
21868
21868
|
if (views.colfooters) {
|
|
21869
|
-
band = get$
|
|
21870
|
-
y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get$
|
|
21869
|
+
band = get$1(opt.footerBand, Column, null);
|
|
21870
|
+
y2 = layoutHeaders(view, views.colfooters, groups, ncols, ncols, get$1(off, 'columnFooter'), max, 1, bbox, 'y2', cells - ncols, 1, ncols, band);
|
|
21871
21871
|
}
|
|
21872
21872
|
|
|
21873
21873
|
// perform row title layout
|
|
21874
21874
|
if (views.rowtitle) {
|
|
21875
|
-
anchor = get$
|
|
21876
|
-
offset = get$
|
|
21875
|
+
anchor = get$1(opt.titleAnchor, Row);
|
|
21876
|
+
offset = get$1(off, 'rowTitle');
|
|
21877
21877
|
offset = anchor === End$1 ? x2 + offset : x - offset;
|
|
21878
|
-
band = get$
|
|
21878
|
+
band = get$1(opt.titleBand, Row, 0.5);
|
|
21879
21879
|
layoutTitle(view, views.rowtitle, offset, 0, bounds, band);
|
|
21880
21880
|
}
|
|
21881
21881
|
|
|
21882
21882
|
// perform column title layout
|
|
21883
21883
|
if (views.coltitle) {
|
|
21884
|
-
anchor = get$
|
|
21885
|
-
offset = get$
|
|
21884
|
+
anchor = get$1(opt.titleAnchor, Column);
|
|
21885
|
+
offset = get$1(off, 'columnTitle');
|
|
21886
21886
|
offset = anchor === End$1 ? y2 + offset : y - offset;
|
|
21887
|
-
band = get$
|
|
21887
|
+
band = get$1(opt.titleBand, Column, 0.5);
|
|
21888
21888
|
layoutTitle(view, views.coltitle, offset, 1, bounds, band);
|
|
21889
21889
|
}
|
|
21890
21890
|
}
|
|
@@ -28398,7 +28398,7 @@ Dispatch.prototype = dispatch.prototype = {
|
|
|
28398
28398
|
|
|
28399
28399
|
// If no callback was specified, return the callback of the given type and name.
|
|
28400
28400
|
if (arguments.length < 2) {
|
|
28401
|
-
while (++i < n) if ((t = (typename = T[i]).type) && (t = get
|
|
28401
|
+
while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;
|
|
28402
28402
|
return;
|
|
28403
28403
|
}
|
|
28404
28404
|
|
|
@@ -28428,7 +28428,7 @@ Dispatch.prototype = dispatch.prototype = {
|
|
|
28428
28428
|
}
|
|
28429
28429
|
};
|
|
28430
28430
|
|
|
28431
|
-
function get
|
|
28431
|
+
function get(type, name) {
|
|
28432
28432
|
for (var i = 0, n = type.length, c; i < n; ++i) {
|
|
28433
28433
|
if ((c = type[i]).name === name) {
|
|
28434
28434
|
return c.value;
|
|
@@ -29464,7 +29464,7 @@ function hierarchy(data, children) {
|
|
|
29464
29464
|
children = objectChildren;
|
|
29465
29465
|
}
|
|
29466
29466
|
|
|
29467
|
-
var root = new Node$
|
|
29467
|
+
var root = new Node$1(data),
|
|
29468
29468
|
node,
|
|
29469
29469
|
nodes = [root],
|
|
29470
29470
|
child,
|
|
@@ -29476,7 +29476,7 @@ function hierarchy(data, children) {
|
|
|
29476
29476
|
if ((childs = children(node.data)) && (n = (childs = Array.from(childs)).length)) {
|
|
29477
29477
|
node.children = childs;
|
|
29478
29478
|
for (i = n - 1; i >= 0; --i) {
|
|
29479
|
-
nodes.push(child = childs[i] = new Node$
|
|
29479
|
+
nodes.push(child = childs[i] = new Node$1(childs[i]));
|
|
29480
29480
|
child.parent = node;
|
|
29481
29481
|
child.depth = node.depth + 1;
|
|
29482
29482
|
}
|
|
@@ -29509,15 +29509,15 @@ function computeHeight(node) {
|
|
|
29509
29509
|
while ((node = node.parent) && (node.height < ++height));
|
|
29510
29510
|
}
|
|
29511
29511
|
|
|
29512
|
-
function Node$
|
|
29512
|
+
function Node$1(data) {
|
|
29513
29513
|
this.data = data;
|
|
29514
29514
|
this.depth =
|
|
29515
29515
|
this.height = 0;
|
|
29516
29516
|
this.parent = null;
|
|
29517
29517
|
}
|
|
29518
29518
|
|
|
29519
|
-
Node$
|
|
29520
|
-
constructor: Node$
|
|
29519
|
+
Node$1.prototype = hierarchy.prototype = {
|
|
29520
|
+
constructor: Node$1,
|
|
29521
29521
|
count: node_count,
|
|
29522
29522
|
each: node_each,
|
|
29523
29523
|
eachAfter: node_eachAfter,
|
|
@@ -29739,7 +29739,7 @@ function score(node) {
|
|
|
29739
29739
|
return dx * dx + dy * dy;
|
|
29740
29740
|
}
|
|
29741
29741
|
|
|
29742
|
-
function Node
|
|
29742
|
+
function Node(circle) {
|
|
29743
29743
|
this._ = circle;
|
|
29744
29744
|
this.next = null;
|
|
29745
29745
|
this.previous = null;
|
|
@@ -29762,14 +29762,14 @@ function packSiblingsRandom(circles, random) {
|
|
|
29762
29762
|
place(b, a, c = circles[2]);
|
|
29763
29763
|
|
|
29764
29764
|
// Initialize the front-chain using the first three circles a, b and c.
|
|
29765
|
-
a = new Node
|
|
29765
|
+
a = new Node(a), b = new Node(b), c = new Node(c);
|
|
29766
29766
|
a.next = c.previous = b;
|
|
29767
29767
|
b.next = a.previous = c;
|
|
29768
29768
|
c.next = b.previous = a;
|
|
29769
29769
|
|
|
29770
29770
|
// Attempt to place each remaining circle…
|
|
29771
29771
|
pack: for (i = 3; i < n; ++i) {
|
|
29772
|
-
place(a._, b._, c = circles[i]), c = new Node
|
|
29772
|
+
place(a._, b._, c = circles[i]), c = new Node(c);
|
|
29773
29773
|
|
|
29774
29774
|
// Find the closest intersecting circle on the front-chain, if any.
|
|
29775
29775
|
// “Closeness” is determined by linear distance along the front-chain.
|
|
@@ -30008,7 +30008,7 @@ function stratify() {
|
|
|
30008
30008
|
}
|
|
30009
30009
|
|
|
30010
30010
|
for (i = 0, n = nodes.length; i < n; ++i) {
|
|
30011
|
-
d = nodes[i], node = nodes[i] = new Node$
|
|
30011
|
+
d = nodes[i], node = nodes[i] = new Node$1(d);
|
|
30012
30012
|
if ((nodeId = currentId(d, i, data)) != null && (nodeId += "")) {
|
|
30013
30013
|
nodeKey = node.id = nodeId;
|
|
30014
30014
|
nodeByKey.set(nodeKey, nodeByKey.has(nodeKey) ? ambiguous : node);
|
|
@@ -30174,7 +30174,7 @@ function TreeNode(node, i) {
|
|
|
30174
30174
|
this.i = i; // number
|
|
30175
30175
|
}
|
|
30176
30176
|
|
|
30177
|
-
TreeNode.prototype = Object.create(Node$
|
|
30177
|
+
TreeNode.prototype = Object.create(Node$1.prototype);
|
|
30178
30178
|
|
|
30179
30179
|
function treeRoot(root) {
|
|
30180
30180
|
var tree = new TreeNode(root, 0),
|
|
@@ -38247,7 +38247,7 @@ function change(name, changes) {
|
|
|
38247
38247
|
dataset.modified = true;
|
|
38248
38248
|
return this.pulse(dataset.input, changes);
|
|
38249
38249
|
}
|
|
38250
|
-
function insert
|
|
38250
|
+
function insert(name, _) {
|
|
38251
38251
|
return change.call(this, name, changeset().insert(_));
|
|
38252
38252
|
}
|
|
38253
38253
|
function remove(name, _) {
|
|
@@ -39440,7 +39440,7 @@ inherits(View$1, Dataflow, {
|
|
|
39440
39440
|
// -- DATA ----
|
|
39441
39441
|
data,
|
|
39442
39442
|
change,
|
|
39443
|
-
insert
|
|
39443
|
+
insert,
|
|
39444
39444
|
remove,
|
|
39445
39445
|
// -- SCALES --
|
|
39446
39446
|
scale: scale$1,
|
|
@@ -39952,7 +39952,7 @@ function parseSignal (signal, scope) {
|
|
|
39952
39952
|
}
|
|
39953
39953
|
}
|
|
39954
39954
|
|
|
39955
|
-
function Entry
|
|
39955
|
+
function Entry(type, value, params, parent) {
|
|
39956
39956
|
this.id = -1;
|
|
39957
39957
|
this.type = type;
|
|
39958
39958
|
this.value = value;
|
|
@@ -39960,7 +39960,7 @@ function Entry$1(type, value, params, parent) {
|
|
|
39960
39960
|
if (parent) this.parent = parent;
|
|
39961
39961
|
}
|
|
39962
39962
|
function entry(type, value, params, parent) {
|
|
39963
|
-
return new Entry
|
|
39963
|
+
return new Entry(type, value, params, parent);
|
|
39964
39964
|
}
|
|
39965
39965
|
function operator(value, params) {
|
|
39966
39966
|
return entry('operator', value, params);
|
|
@@ -42906,7 +42906,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
42906
42906
|
return op;
|
|
42907
42907
|
},
|
|
42908
42908
|
proxy(op) {
|
|
42909
|
-
const vref = op instanceof Entry
|
|
42909
|
+
const vref = op instanceof Entry ? ref(op) : op;
|
|
42910
42910
|
return this.add(Proxy({
|
|
42911
42911
|
value: vref
|
|
42912
42912
|
}));
|
|
@@ -43059,7 +43059,7 @@ Scope.prototype = Subscope.prototype = {
|
|
|
43059
43059
|
if (this.hasOwnSignal(name)) {
|
|
43060
43060
|
error('Duplicate signal name: ' + $(name));
|
|
43061
43061
|
}
|
|
43062
|
-
const op = value instanceof Entry
|
|
43062
|
+
const op = value instanceof Entry ? value : this.add(operator(value));
|
|
43063
43063
|
return this.signals[name] = op;
|
|
43064
43064
|
},
|
|
43065
43065
|
getSignal(name) {
|
|
@@ -43501,7 +43501,7 @@ const vegaImport = /*#__PURE__*/Object.freeze({
|
|
|
43501
43501
|
key: key,
|
|
43502
43502
|
lerp: lerp,
|
|
43503
43503
|
logger: logger,
|
|
43504
|
-
lruCache: lruCache
|
|
43504
|
+
lruCache: lruCache,
|
|
43505
43505
|
merge: merge$3,
|
|
43506
43506
|
mergeConfig: mergeConfig,
|
|
43507
43507
|
one: one$2,
|
|
@@ -43961,7 +43961,7 @@ var expression$1 = {
|
|
|
43961
43961
|
|
|
43962
43962
|
const name$1 = "vega-lite";
|
|
43963
43963
|
const author$1 = "Dominik Moritz, Kanit \"Ham\" Wongsuphasawat, Arvind Satyanarayan, Jeffrey Heer";
|
|
43964
|
-
const version$3 = "5.
|
|
43964
|
+
const version$3 = "5.21.0";
|
|
43965
43965
|
const collaborators = [
|
|
43966
43966
|
"Kanit Wongsuphasawat (http://kanitw.yellowpigz.com)",
|
|
43967
43967
|
"Dominik Moritz (https://www.domoritz.de)",
|
|
@@ -44039,50 +44039,50 @@ const bugs = {
|
|
|
44039
44039
|
url: "https://github.com/vega/vega-lite/issues"
|
|
44040
44040
|
};
|
|
44041
44041
|
const devDependencies$1 = {
|
|
44042
|
-
"@babel/core": "^7.24.
|
|
44043
|
-
"@babel/preset-env": "^7.
|
|
44042
|
+
"@babel/core": "^7.24.9",
|
|
44043
|
+
"@babel/preset-env": "^7.25.0",
|
|
44044
44044
|
"@babel/preset-typescript": "^7.24.7",
|
|
44045
44045
|
"@release-it/conventional-changelog": "^8.0.1",
|
|
44046
44046
|
"@rollup/plugin-alias": "^5.1.0",
|
|
44047
44047
|
"@rollup/plugin-babel": "^6.0.4",
|
|
44048
|
-
"@rollup/plugin-commonjs": "^
|
|
44048
|
+
"@rollup/plugin-commonjs": "^26.0.1",
|
|
44049
44049
|
"@rollup/plugin-json": "^6.1.0",
|
|
44050
44050
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
44051
44051
|
"@rollup/plugin-terser": "^0.4.4",
|
|
44052
44052
|
"@types/d3": "^7.4.3",
|
|
44053
44053
|
"@types/jest": "^29.5.12",
|
|
44054
44054
|
"@types/pako": "^2.0.3",
|
|
44055
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
44056
|
-
"@typescript-eslint/parser": "^7.
|
|
44057
|
-
ajv: "^8.
|
|
44058
|
-
"ajv-formats": "^
|
|
44055
|
+
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
44056
|
+
"@typescript-eslint/parser": "^7.17.0",
|
|
44057
|
+
ajv: "^8.17.1",
|
|
44058
|
+
"ajv-formats": "^3.0.1",
|
|
44059
44059
|
cheerio: "^1.0.0-rc.12",
|
|
44060
|
-
"conventional-changelog-cli": "^
|
|
44060
|
+
"conventional-changelog-cli": "^5.0.0",
|
|
44061
44061
|
d3: "^7.9.0",
|
|
44062
44062
|
"del-cli": "^5.1.0",
|
|
44063
44063
|
eslint: "^8.57.0",
|
|
44064
44064
|
"eslint-config-prettier": "^9.1.0",
|
|
44065
44065
|
"eslint-plugin-jest": "^27.9.0",
|
|
44066
|
-
"eslint-plugin-prettier": "^5.1
|
|
44066
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
44067
44067
|
"fast-json-stable-stringify": "~2.1.0",
|
|
44068
|
-
"highlight.js": "^11.
|
|
44068
|
+
"highlight.js": "^11.10.0",
|
|
44069
44069
|
jest: "^29.7.0",
|
|
44070
44070
|
"jest-dev-server": "^10.0.0",
|
|
44071
44071
|
mkdirp: "^3.0.1",
|
|
44072
44072
|
pako: "^2.1.0",
|
|
44073
|
-
prettier: "^3.3.
|
|
44073
|
+
prettier: "^3.3.3",
|
|
44074
44074
|
puppeteer: "^15.0.0",
|
|
44075
|
-
"release-it": "17.
|
|
44076
|
-
rollup: "^4.
|
|
44075
|
+
"release-it": "17.6.0",
|
|
44076
|
+
rollup: "^4.19.1",
|
|
44077
44077
|
"rollup-plugin-bundle-size": "^1.0.3",
|
|
44078
44078
|
serve: "^14.2.3",
|
|
44079
|
-
terser: "^5.31.
|
|
44080
|
-
"ts-jest": "^29.
|
|
44081
|
-
"ts-json-schema-generator": "^
|
|
44082
|
-
typescript: "~5.4
|
|
44079
|
+
terser: "^5.31.3",
|
|
44080
|
+
"ts-jest": "^29.2.3",
|
|
44081
|
+
"ts-json-schema-generator": "^2.3.0",
|
|
44082
|
+
typescript: "~5.5.4",
|
|
44083
44083
|
"vega-cli": "^5.28.0",
|
|
44084
44084
|
"vega-datasets": "^2.8.1",
|
|
44085
|
-
"vega-embed": "^6.
|
|
44085
|
+
"vega-embed": "^6.26.0",
|
|
44086
44086
|
"vega-tooltip": "^0.34.0",
|
|
44087
44087
|
"yaml-front-matter": "^4.1.1"
|
|
44088
44088
|
};
|
|
@@ -44090,7 +44090,7 @@ const dependencies$1 = {
|
|
|
44090
44090
|
"json-stringify-pretty-compact": "~3.0.0",
|
|
44091
44091
|
tslib: "~2.6.3",
|
|
44092
44092
|
"vega-event-selector": "~3.0.1",
|
|
44093
|
-
"vega-expression": "~5.1.
|
|
44093
|
+
"vega-expression": "~5.1.1",
|
|
44094
44094
|
"vega-util": "~1.17.2",
|
|
44095
44095
|
yargs: "~17.7.2"
|
|
44096
44096
|
};
|
|
@@ -44128,13 +44128,13 @@ const pkg$1 = {
|
|
|
44128
44128
|
};
|
|
44129
44129
|
|
|
44130
44130
|
function isLogicalOr(op) {
|
|
44131
|
-
return
|
|
44131
|
+
return hasProperty(op, 'or');
|
|
44132
44132
|
}
|
|
44133
44133
|
function isLogicalAnd(op) {
|
|
44134
|
-
return
|
|
44134
|
+
return hasProperty(op, 'and');
|
|
44135
44135
|
}
|
|
44136
44136
|
function isLogicalNot(op) {
|
|
44137
|
-
return
|
|
44137
|
+
return hasProperty(op, 'not');
|
|
44138
44138
|
}
|
|
44139
44139
|
function forEachLeaf(op, fn) {
|
|
44140
44140
|
if (isLogicalNot(op)) {
|
|
@@ -44351,7 +44351,9 @@ function isEmpty(obj) {
|
|
|
44351
44351
|
}
|
|
44352
44352
|
// This is a stricter version of Object.keys but with better types. See https://github.com/Microsoft/TypeScript/pull/12253#issuecomment-263132208
|
|
44353
44353
|
const keys = Object.keys;
|
|
44354
|
+
// Stricter version from https://github.com/microsoft/TypeScript/issues/51572#issuecomment-1319153323
|
|
44354
44355
|
const vals = Object.values;
|
|
44356
|
+
// Stricter version from https://github.com/microsoft/TypeScript/issues/51572#issuecomment-1319153323
|
|
44355
44357
|
const entries$1 = Object.entries;
|
|
44356
44358
|
function isBoolean(b) {
|
|
44357
44359
|
return b === true || b === false;
|
|
@@ -44458,12 +44460,7 @@ function accessPathDepth(path) {
|
|
|
44458
44460
|
* This is a replacement for chained || for numeric properties or properties that respect null so that 0 will be included.
|
|
44459
44461
|
*/
|
|
44460
44462
|
function getFirstDefined(...args) {
|
|
44461
|
-
|
|
44462
|
-
if (arg !== undefined) {
|
|
44463
|
-
return arg;
|
|
44464
|
-
}
|
|
44465
|
-
}
|
|
44466
|
-
return undefined;
|
|
44463
|
+
return args.find(a => a !== undefined);
|
|
44467
44464
|
}
|
|
44468
44465
|
// variable used to generate id
|
|
44469
44466
|
let idCounter = 42;
|
|
@@ -44533,19 +44530,19 @@ function deepEqual(a, b) {
|
|
|
44533
44530
|
if (a instanceof Map && b instanceof Map) {
|
|
44534
44531
|
if (a.size !== b.size)
|
|
44535
44532
|
return false;
|
|
44536
|
-
for (
|
|
44537
|
-
if (!b.has(
|
|
44533
|
+
for (const e of a.entries())
|
|
44534
|
+
if (!b.has(e[0]))
|
|
44538
44535
|
return false;
|
|
44539
|
-
for (
|
|
44540
|
-
if (!deepEqual(
|
|
44536
|
+
for (const e of a.entries())
|
|
44537
|
+
if (!deepEqual(e[1], b.get(e[0])))
|
|
44541
44538
|
return false;
|
|
44542
44539
|
return true;
|
|
44543
44540
|
}
|
|
44544
44541
|
if (a instanceof Set && b instanceof Set) {
|
|
44545
44542
|
if (a.size !== b.size)
|
|
44546
44543
|
return false;
|
|
44547
|
-
for (
|
|
44548
|
-
if (!b.has(
|
|
44544
|
+
for (const e of a.entries())
|
|
44545
|
+
if (!b.has(e[0]))
|
|
44549
44546
|
return false;
|
|
44550
44547
|
return true;
|
|
44551
44548
|
}
|
|
@@ -44630,6 +44627,16 @@ function stringify$1(data) {
|
|
|
44630
44627
|
return `{${out}}`;
|
|
44631
44628
|
})(data);
|
|
44632
44629
|
}
|
|
44630
|
+
/**
|
|
44631
|
+
* Check if the input object has the property and it's not undefined.
|
|
44632
|
+
*
|
|
44633
|
+
* @param object the object
|
|
44634
|
+
* @param property the property to search
|
|
44635
|
+
* @returns if the object has the property and it's not undefined.
|
|
44636
|
+
*/
|
|
44637
|
+
function hasProperty(obj, key) {
|
|
44638
|
+
return isObject(obj) && has$1(obj, key) && obj[key] !== undefined;
|
|
44639
|
+
}
|
|
44633
44640
|
|
|
44634
44641
|
/*
|
|
44635
44642
|
* Constants and utilities for encoding channels (Visual variables)
|
|
@@ -44691,7 +44698,7 @@ const POLAR_POSITION_CHANNEL_INDEX = {
|
|
|
44691
44698
|
radius2: 1
|
|
44692
44699
|
};
|
|
44693
44700
|
function isPolarPositionChannel(c) {
|
|
44694
|
-
return c
|
|
44701
|
+
return has$1(POLAR_POSITION_CHANNEL_INDEX, c);
|
|
44695
44702
|
}
|
|
44696
44703
|
const GEO_POSIITON_CHANNEL_INDEX = {
|
|
44697
44704
|
longitude: 1,
|
|
@@ -44712,7 +44719,7 @@ function getPositionChannelFromLatLong(channel) {
|
|
|
44712
44719
|
}
|
|
44713
44720
|
}
|
|
44714
44721
|
function isGeoPositionChannel(c) {
|
|
44715
|
-
return c
|
|
44722
|
+
return has$1(GEO_POSIITON_CHANNEL_INDEX, c);
|
|
44716
44723
|
}
|
|
44717
44724
|
const GEOPOSITION_CHANNELS = keys(GEO_POSIITON_CHANNEL_INDEX);
|
|
44718
44725
|
const UNIT_CHANNEL_INDEX = {
|
|
@@ -44761,10 +44768,10 @@ const CHANNELS = keys(CHANNEL_INDEX);
|
|
|
44761
44768
|
const { order: _o, detail: _d, tooltip: _tt1, ...SINGLE_DEF_CHANNEL_INDEX } = CHANNEL_INDEX;
|
|
44762
44769
|
const { row: _r, column: _c, facet: _f, ...SINGLE_DEF_UNIT_CHANNEL_INDEX } = SINGLE_DEF_CHANNEL_INDEX;
|
|
44763
44770
|
function isSingleDefUnitChannel(str) {
|
|
44764
|
-
return
|
|
44771
|
+
return has$1(SINGLE_DEF_UNIT_CHANNEL_INDEX, str);
|
|
44765
44772
|
}
|
|
44766
44773
|
function isChannel(str) {
|
|
44767
|
-
return
|
|
44774
|
+
return has$1(CHANNEL_INDEX, str);
|
|
44768
44775
|
}
|
|
44769
44776
|
const SECONDARY_RANGE_CHANNEL = [X2, Y2, LATITUDE2, LONGITUDE2, THETA2, RADIUS2];
|
|
44770
44777
|
function isSecondaryRangeChannel(c) {
|
|
@@ -44898,7 +44905,7 @@ const POSITION_SCALE_CHANNEL_INDEX = {
|
|
|
44898
44905
|
};
|
|
44899
44906
|
const POSITION_SCALE_CHANNELS = keys(POSITION_SCALE_CHANNEL_INDEX);
|
|
44900
44907
|
function isXorY(channel) {
|
|
44901
|
-
return channel
|
|
44908
|
+
return has$1(POSITION_SCALE_CHANNEL_INDEX, channel);
|
|
44902
44909
|
}
|
|
44903
44910
|
const POLAR_POSITION_SCALE_CHANNEL_INDEX = {
|
|
44904
44911
|
theta: 1,
|
|
@@ -44910,7 +44917,7 @@ function getPositionScaleChannel(sizeType) {
|
|
|
44910
44917
|
}
|
|
44911
44918
|
const OFFSET_SCALE_CHANNEL_INDEX = { xOffset: 1, yOffset: 1 };
|
|
44912
44919
|
function isXorYOffset(channel) {
|
|
44913
|
-
return channel
|
|
44920
|
+
return has$1(OFFSET_SCALE_CHANNEL_INDEX, channel);
|
|
44914
44921
|
}
|
|
44915
44922
|
// NON_POSITION_SCALE_CHANNEL = SCALE_CHANNELS without position / offset
|
|
44916
44923
|
const {
|
|
@@ -44922,7 +44929,7 @@ text: _t, tooltip: _tt, href: _hr, url: _u, description: _al,
|
|
|
44922
44929
|
detail: _dd, key: _k, order: _oo, ...NONPOSITION_SCALE_CHANNEL_INDEX } = NONPOSITION_CHANNEL_INDEX;
|
|
44923
44930
|
const NONPOSITION_SCALE_CHANNELS = keys(NONPOSITION_SCALE_CHANNEL_INDEX);
|
|
44924
44931
|
function isNonPositionScaleChannel(channel) {
|
|
44925
|
-
return
|
|
44932
|
+
return has$1(NONPOSITION_CHANNEL_INDEX, channel);
|
|
44926
44933
|
}
|
|
44927
44934
|
/**
|
|
44928
44935
|
* @returns whether Vega supports legends for a particular channel
|
|
@@ -44954,7 +44961,7 @@ const SCALE_CHANNEL_INDEX = {
|
|
|
44954
44961
|
/** List of channels with scales */
|
|
44955
44962
|
const SCALE_CHANNELS = keys(SCALE_CHANNEL_INDEX);
|
|
44956
44963
|
function isScaleChannel(channel) {
|
|
44957
|
-
return
|
|
44964
|
+
return has$1(SCALE_CHANNEL_INDEX, channel);
|
|
44958
44965
|
}
|
|
44959
44966
|
/**
|
|
44960
44967
|
* Return whether a channel supports a particular mark type.
|
|
@@ -45156,13 +45163,13 @@ const MULTIDOMAIN_SORT_OP_INDEX = {
|
|
|
45156
45163
|
max: 1
|
|
45157
45164
|
};
|
|
45158
45165
|
function isArgminDef(a) {
|
|
45159
|
-
return
|
|
45166
|
+
return hasProperty(a, 'argmin');
|
|
45160
45167
|
}
|
|
45161
45168
|
function isArgmaxDef(a) {
|
|
45162
|
-
return
|
|
45169
|
+
return hasProperty(a, 'argmax');
|
|
45163
45170
|
}
|
|
45164
45171
|
function isAggregateOp(a) {
|
|
45165
|
-
return isString(a) &&
|
|
45172
|
+
return isString(a) && has$1(AGGREGATE_OP_INDEX, a);
|
|
45166
45173
|
}
|
|
45167
45174
|
const COUNTING_OPS = new Set([
|
|
45168
45175
|
'count',
|
|
@@ -45225,7 +45232,7 @@ function isBinParams(bin) {
|
|
|
45225
45232
|
return isObject(bin);
|
|
45226
45233
|
}
|
|
45227
45234
|
function isParameterExtent(extent) {
|
|
45228
|
-
return extent
|
|
45235
|
+
return hasProperty(extent, 'param');
|
|
45229
45236
|
}
|
|
45230
45237
|
function autoMaxBins(channel) {
|
|
45231
45238
|
switch (channel) {
|
|
@@ -45251,7 +45258,7 @@ function autoMaxBins(channel) {
|
|
|
45251
45258
|
}
|
|
45252
45259
|
|
|
45253
45260
|
function isExprRef(o) {
|
|
45254
|
-
return
|
|
45261
|
+
return hasProperty(o, 'expr');
|
|
45255
45262
|
}
|
|
45256
45263
|
function replaceExprRef(index, { level } = { level: 0 }) {
|
|
45257
45264
|
const props = keys(index || {});
|
|
@@ -45303,26 +45310,26 @@ function isText(v) {
|
|
|
45303
45310
|
}
|
|
45304
45311
|
|
|
45305
45312
|
function isSignalRef(o) {
|
|
45306
|
-
return
|
|
45313
|
+
return hasProperty(o, 'signal');
|
|
45307
45314
|
}
|
|
45308
45315
|
function isVgRangeStep(range) {
|
|
45309
|
-
return
|
|
45316
|
+
return hasProperty(range, 'step');
|
|
45310
45317
|
}
|
|
45311
45318
|
function isDataRefUnionedDomain(domain) {
|
|
45312
45319
|
if (!isArray(domain)) {
|
|
45313
|
-
return 'fields'
|
|
45320
|
+
return hasProperty(domain, 'fields') && !hasProperty(domain, 'data');
|
|
45314
45321
|
}
|
|
45315
45322
|
return false;
|
|
45316
45323
|
}
|
|
45317
45324
|
function isFieldRefUnionDomain(domain) {
|
|
45318
45325
|
if (!isArray(domain)) {
|
|
45319
|
-
return 'fields'
|
|
45326
|
+
return hasProperty(domain, 'fields') && hasProperty(domain, 'data');
|
|
45320
45327
|
}
|
|
45321
45328
|
return false;
|
|
45322
45329
|
}
|
|
45323
45330
|
function isDataRefDomain(domain) {
|
|
45324
45331
|
if (!isArray(domain)) {
|
|
45325
|
-
return 'field'
|
|
45332
|
+
return hasProperty(domain, 'field') && hasProperty(domain, 'data');
|
|
45326
45333
|
}
|
|
45327
45334
|
return false;
|
|
45328
45335
|
}
|
|
@@ -45483,7 +45490,7 @@ function getStyles(mark) {
|
|
|
45483
45490
|
}
|
|
45484
45491
|
function getMarkPropOrConfig(channel, mark, config, opt = {}) {
|
|
45485
45492
|
const { vgChannel, ignoreVgConfig } = opt;
|
|
45486
|
-
if (vgChannel && mark
|
|
45493
|
+
if (vgChannel && hasProperty(mark, vgChannel)) {
|
|
45487
45494
|
return mark[vgChannel];
|
|
45488
45495
|
}
|
|
45489
45496
|
else if (mark[channel] !== undefined) {
|
|
@@ -45499,9 +45506,10 @@ function getMarkPropOrConfig(channel, mark, config, opt = {}) {
|
|
|
45499
45506
|
* Otherwise, return general mark specific config.
|
|
45500
45507
|
*/
|
|
45501
45508
|
function getMarkConfig(channel, mark, config, { vgChannel } = {}) {
|
|
45509
|
+
const cfg = getMarkStyleConfig(channel, mark, config.style);
|
|
45502
45510
|
return getFirstDefined(
|
|
45503
45511
|
// style config has highest precedence
|
|
45504
|
-
vgChannel ?
|
|
45512
|
+
vgChannel ? cfg : undefined, cfg,
|
|
45505
45513
|
// then mark-specific config
|
|
45506
45514
|
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
|
|
45507
45515
|
// If there is vgChannel, skip vl channel.
|
|
@@ -45517,7 +45525,7 @@ function getStyleConfig(p, styles, styleConfigIndex) {
|
|
|
45517
45525
|
let value;
|
|
45518
45526
|
for (const style of styles) {
|
|
45519
45527
|
const styleConfig = styleConfigIndex[style];
|
|
45520
|
-
if (styleConfig
|
|
45528
|
+
if (hasProperty(styleConfig, p)) {
|
|
45521
45529
|
value = styleConfig[p];
|
|
45522
45530
|
}
|
|
45523
45531
|
}
|
|
@@ -45852,7 +45860,7 @@ function debug$2(...args) {
|
|
|
45852
45860
|
function isDateTime(o) {
|
|
45853
45861
|
if (o && isObject(o)) {
|
|
45854
45862
|
for (const part of TIMEUNIT_PARTS) {
|
|
45855
|
-
if (part
|
|
45863
|
+
if (hasProperty(o, part)) {
|
|
45856
45864
|
return true;
|
|
45857
45865
|
}
|
|
45858
45866
|
}
|
|
@@ -46054,7 +46062,7 @@ const LOCAL_SINGLE_TIMEUNIT_INDEX = {
|
|
|
46054
46062
|
};
|
|
46055
46063
|
const TIMEUNIT_PARTS = keys(LOCAL_SINGLE_TIMEUNIT_INDEX);
|
|
46056
46064
|
function isLocalSingleTimeUnit(timeUnit) {
|
|
46057
|
-
return
|
|
46065
|
+
return has$1(LOCAL_SINGLE_TIMEUNIT_INDEX, timeUnit);
|
|
46058
46066
|
}
|
|
46059
46067
|
function isBinnedTimeUnit(timeUnit) {
|
|
46060
46068
|
if (isObject(timeUnit)) {
|
|
@@ -46231,7 +46239,7 @@ const DATE_PARTS = {
|
|
|
46231
46239
|
milliseconds: 1
|
|
46232
46240
|
};
|
|
46233
46241
|
function isDatePart(timeUnit) {
|
|
46234
|
-
return
|
|
46242
|
+
return has$1(DATE_PARTS, timeUnit);
|
|
46235
46243
|
}
|
|
46236
46244
|
function getDateTimePartAndStep(timeUnit, step = 1) {
|
|
46237
46245
|
if (isDatePart(timeUnit)) {
|
|
@@ -46249,7 +46257,7 @@ function getDateTimePartAndStep(timeUnit, step = 1) {
|
|
|
46249
46257
|
}
|
|
46250
46258
|
|
|
46251
46259
|
function isSelectionPredicate(predicate) {
|
|
46252
|
-
return predicate
|
|
46260
|
+
return hasProperty(predicate, 'param');
|
|
46253
46261
|
}
|
|
46254
46262
|
function isFieldEqualPredicate(predicate) {
|
|
46255
46263
|
return !!predicate?.field && predicate.equal !== undefined;
|
|
@@ -46337,7 +46345,7 @@ function fieldFilterExpression(predicate, useInRange = true) {
|
|
|
46337
46345
|
return fieldValidPredicate(fieldExpr$1, predicate.valid);
|
|
46338
46346
|
}
|
|
46339
46347
|
else if (isFieldRangePredicate(predicate)) {
|
|
46340
|
-
const { range } = predicate;
|
|
46348
|
+
const { range } = replaceExprRef(predicate);
|
|
46341
46349
|
const lower = isSignalRef(range) ? { signal: `${range.signal}[0]` } : range[0];
|
|
46342
46350
|
const upper = isSignalRef(range) ? { signal: `${range.signal}[1]` } : range[1];
|
|
46343
46351
|
if (lower !== null && upper !== null && useInRange) {
|
|
@@ -46556,6 +46564,7 @@ const defaultScaleConfig = {
|
|
|
46556
46564
|
pointPadding: 0.5,
|
|
46557
46565
|
barBandPaddingInner: 0.1,
|
|
46558
46566
|
rectBandPaddingInner: 0,
|
|
46567
|
+
tickBandPaddingInner: 0.25,
|
|
46559
46568
|
bandWithNestedOffsetPaddingInner: 0.2,
|
|
46560
46569
|
bandWithNestedOffsetPaddingOuter: 0.2,
|
|
46561
46570
|
minBandSize: 2,
|
|
@@ -46572,13 +46581,13 @@ const defaultScaleConfig = {
|
|
|
46572
46581
|
zero: true
|
|
46573
46582
|
};
|
|
46574
46583
|
function isExtendedScheme(scheme) {
|
|
46575
|
-
return !isString(scheme) &&
|
|
46584
|
+
return !isString(scheme) && hasProperty(scheme, 'name');
|
|
46576
46585
|
}
|
|
46577
46586
|
function isParameterDomain(domain) {
|
|
46578
|
-
return domain
|
|
46587
|
+
return hasProperty(domain, 'param');
|
|
46579
46588
|
}
|
|
46580
46589
|
function isDomainUnionWith(domain) {
|
|
46581
|
-
return domain
|
|
46590
|
+
return hasProperty(domain, 'unionWith');
|
|
46582
46591
|
}
|
|
46583
46592
|
function isFieldRange(range) {
|
|
46584
46593
|
return isObject(range) && 'field' in range;
|
|
@@ -46798,11 +46807,11 @@ function isPathMark(m) {
|
|
|
46798
46807
|
return ['line', 'area', 'trail'].includes(m);
|
|
46799
46808
|
}
|
|
46800
46809
|
function isRectBasedMark(m) {
|
|
46801
|
-
return ['rect', 'bar', 'image', 'arc' /* arc is rect/interval in polar coordinate */].includes(m);
|
|
46810
|
+
return ['rect', 'bar', 'image', 'arc', 'tick' /* arc is rect/interval in polar coordinate */].includes(m);
|
|
46802
46811
|
}
|
|
46803
46812
|
const PRIMITIVE_MARKS = new Set(keys(Mark));
|
|
46804
46813
|
function isMarkDef(mark) {
|
|
46805
|
-
return mark
|
|
46814
|
+
return hasProperty(mark, 'type');
|
|
46806
46815
|
}
|
|
46807
46816
|
const STROKE_CONFIG = [
|
|
46808
46817
|
'stroke',
|
|
@@ -46826,12 +46835,18 @@ const VL_ONLY_MARK_CONFIG_INDEX = {
|
|
|
46826
46835
|
timeUnitBandPosition: 1
|
|
46827
46836
|
};
|
|
46828
46837
|
const VL_ONLY_MARK_CONFIG_PROPERTIES = keys(VL_ONLY_MARK_CONFIG_INDEX);
|
|
46838
|
+
const VL_ONLY_RECT_CONFIG = [
|
|
46839
|
+
'binSpacing',
|
|
46840
|
+
'continuousBandSize',
|
|
46841
|
+
'discreteBandSize',
|
|
46842
|
+
'minBandSize'
|
|
46843
|
+
];
|
|
46829
46844
|
const VL_ONLY_MARK_SPECIFIC_CONFIG_PROPERTY_INDEX = {
|
|
46830
46845
|
area: ['line', 'point'],
|
|
46831
|
-
bar:
|
|
46832
|
-
rect:
|
|
46846
|
+
bar: VL_ONLY_RECT_CONFIG,
|
|
46847
|
+
rect: VL_ONLY_RECT_CONFIG,
|
|
46833
46848
|
line: ['point'],
|
|
46834
|
-
tick: ['bandSize', 'thickness']
|
|
46849
|
+
tick: ['bandSize', 'thickness', ...VL_ONLY_RECT_CONFIG]
|
|
46835
46850
|
};
|
|
46836
46851
|
const defaultMarkConfig = {
|
|
46837
46852
|
color: '#4c78a8',
|
|
@@ -46857,26 +46872,25 @@ const MARK_CONFIG_INDEX = {
|
|
|
46857
46872
|
};
|
|
46858
46873
|
const MARK_CONFIGS = keys(MARK_CONFIG_INDEX);
|
|
46859
46874
|
function isRelativeBandSize(o) {
|
|
46860
|
-
return o
|
|
46875
|
+
return hasProperty(o, 'band');
|
|
46861
46876
|
}
|
|
46862
46877
|
const BAR_CORNER_RADIUS_INDEX = {
|
|
46863
46878
|
horizontal: ['cornerRadiusTopRight', 'cornerRadiusBottomRight'],
|
|
46864
46879
|
vertical: ['cornerRadiusTopLeft', 'cornerRadiusTopRight']
|
|
46865
46880
|
};
|
|
46866
46881
|
const DEFAULT_RECT_BAND_SIZE = 5;
|
|
46867
|
-
const defaultBarConfig = {
|
|
46868
|
-
binSpacing: 1,
|
|
46869
|
-
continuousBandSize: DEFAULT_RECT_BAND_SIZE,
|
|
46870
|
-
minBandSize: 0.25,
|
|
46871
|
-
timeUnitBandPosition: 0.5
|
|
46872
|
-
};
|
|
46873
46882
|
const defaultRectConfig = {
|
|
46874
46883
|
binSpacing: 0,
|
|
46875
46884
|
continuousBandSize: DEFAULT_RECT_BAND_SIZE,
|
|
46876
46885
|
minBandSize: 0.25,
|
|
46877
46886
|
timeUnitBandPosition: 0.5
|
|
46878
46887
|
};
|
|
46888
|
+
const defaultBarConfig = {
|
|
46889
|
+
...defaultRectConfig,
|
|
46890
|
+
binSpacing: 1
|
|
46891
|
+
};
|
|
46879
46892
|
const defaultTickConfig = {
|
|
46893
|
+
...defaultRectConfig,
|
|
46880
46894
|
thickness: 1
|
|
46881
46895
|
};
|
|
46882
46896
|
function getMarkType(m) {
|
|
@@ -47110,7 +47124,7 @@ function midPoint({ channel, channelDef, channel2Def, markDef, config, scaleName
|
|
|
47110
47124
|
{
|
|
47111
47125
|
offset,
|
|
47112
47126
|
// For band, to get mid point, need to offset by half of the band
|
|
47113
|
-
band: scaleType === 'band' ? bandPosition ?? channelDef.bandPosition ?? 0.5 : undefined
|
|
47127
|
+
band: scaleType === 'band' ? (bandPosition ?? channelDef.bandPosition ?? 0.5) : undefined
|
|
47114
47128
|
});
|
|
47115
47129
|
}
|
|
47116
47130
|
else if (isValueDef(channelDef)) {
|
|
@@ -47376,33 +47390,33 @@ const SORT_BY_CHANNEL_INDEX = {
|
|
|
47376
47390
|
text: 1
|
|
47377
47391
|
};
|
|
47378
47392
|
function isSortByChannel(c) {
|
|
47379
|
-
return c
|
|
47393
|
+
return has$1(SORT_BY_CHANNEL_INDEX, c);
|
|
47380
47394
|
}
|
|
47381
47395
|
function isSortByEncoding(sort) {
|
|
47382
|
-
return
|
|
47396
|
+
return hasProperty(sort, 'encoding');
|
|
47383
47397
|
}
|
|
47384
47398
|
function isSortField(sort) {
|
|
47385
|
-
return sort && (sort
|
|
47399
|
+
return sort && (sort.op === 'count' || hasProperty(sort, 'field'));
|
|
47386
47400
|
}
|
|
47387
47401
|
function isSortArray(sort) {
|
|
47388
47402
|
return sort && isArray(sort);
|
|
47389
47403
|
}
|
|
47390
47404
|
|
|
47391
47405
|
function isFacetMapping(f) {
|
|
47392
|
-
return 'row'
|
|
47406
|
+
return hasProperty(f, 'row') || hasProperty(f, 'column');
|
|
47393
47407
|
}
|
|
47394
47408
|
function isFacetFieldDef(channelDef) {
|
|
47395
|
-
return
|
|
47409
|
+
return hasProperty(channelDef, 'header');
|
|
47396
47410
|
}
|
|
47397
47411
|
function isFacetSpec(spec) {
|
|
47398
|
-
return 'facet'
|
|
47412
|
+
return hasProperty(spec, 'facet');
|
|
47399
47413
|
}
|
|
47400
47414
|
|
|
47401
47415
|
function isConditionalParameter(c) {
|
|
47402
|
-
return c
|
|
47416
|
+
return hasProperty(c, 'param');
|
|
47403
47417
|
}
|
|
47404
47418
|
function isRepeatRef(field) {
|
|
47405
|
-
return
|
|
47419
|
+
return !isString(field) && hasProperty(field, 'repeat');
|
|
47406
47420
|
}
|
|
47407
47421
|
function toFieldDefBase(fieldDef) {
|
|
47408
47422
|
const { field, timeUnit, bin, aggregate } = fieldDef;
|
|
@@ -47414,7 +47428,7 @@ function toFieldDefBase(fieldDef) {
|
|
|
47414
47428
|
};
|
|
47415
47429
|
}
|
|
47416
47430
|
function isSortableFieldDef(fieldDef) {
|
|
47417
|
-
return 'sort'
|
|
47431
|
+
return hasProperty(fieldDef, 'sort');
|
|
47418
47432
|
}
|
|
47419
47433
|
function getBandPosition({ fieldDef, fieldDef2, markDef: mark, config }) {
|
|
47420
47434
|
if (isFieldOrDatumDef(fieldDef) && fieldDef.bandPosition !== undefined) {
|
|
@@ -47470,10 +47484,10 @@ function hasBandEnd(fieldDef, fieldDef2, markDef, config) {
|
|
|
47470
47484
|
return false;
|
|
47471
47485
|
}
|
|
47472
47486
|
function isOrderOnlyDef(orderDef) {
|
|
47473
|
-
return orderDef
|
|
47487
|
+
return hasProperty(orderDef, 'sort') && !hasProperty(orderDef, 'field');
|
|
47474
47488
|
}
|
|
47475
47489
|
function isConditionalDef(channelDef) {
|
|
47476
|
-
return channelDef
|
|
47490
|
+
return hasProperty(channelDef, 'condition');
|
|
47477
47491
|
}
|
|
47478
47492
|
/**
|
|
47479
47493
|
* Return if a channelDef is a ConditionalValueDef with ConditionFieldDef
|
|
@@ -47491,14 +47505,13 @@ function hasConditionalValueDef(channelDef) {
|
|
|
47491
47505
|
return !!condition && (isArray(condition) || isValueDef(condition));
|
|
47492
47506
|
}
|
|
47493
47507
|
function isFieldDef(channelDef) {
|
|
47494
|
-
|
|
47495
|
-
return channelDef && (!!channelDef['field'] || channelDef['aggregate'] === 'count');
|
|
47508
|
+
return hasProperty(channelDef, 'field') || channelDef?.aggregate === 'count';
|
|
47496
47509
|
}
|
|
47497
47510
|
function channelDefType(channelDef) {
|
|
47498
47511
|
return channelDef?.['type'];
|
|
47499
47512
|
}
|
|
47500
47513
|
function isDatumDef(channelDef) {
|
|
47501
|
-
return channelDef
|
|
47514
|
+
return hasProperty(channelDef, 'datum');
|
|
47502
47515
|
}
|
|
47503
47516
|
function isContinuousFieldOrDatumDef(cd) {
|
|
47504
47517
|
// TODO: make datum support DateTime object
|
|
@@ -47515,29 +47528,31 @@ function isFieldOrDatumDef(channelDef) {
|
|
|
47515
47528
|
return isFieldDef(channelDef) || isDatumDef(channelDef);
|
|
47516
47529
|
}
|
|
47517
47530
|
function isTypedFieldDef(channelDef) {
|
|
47518
|
-
return
|
|
47531
|
+
return (channelDef &&
|
|
47532
|
+
(hasProperty(channelDef, 'field') || channelDef['aggregate'] === 'count') &&
|
|
47533
|
+
hasProperty(channelDef, 'type'));
|
|
47519
47534
|
}
|
|
47520
47535
|
function isValueDef(channelDef) {
|
|
47521
|
-
return channelDef
|
|
47536
|
+
return hasProperty(channelDef, 'value');
|
|
47522
47537
|
}
|
|
47523
47538
|
function isScaleFieldDef(channelDef) {
|
|
47524
|
-
return channelDef
|
|
47539
|
+
return hasProperty(channelDef, 'scale') || hasProperty(channelDef, 'sort');
|
|
47525
47540
|
}
|
|
47526
47541
|
function isPositionFieldOrDatumDef(channelDef) {
|
|
47527
|
-
return channelDef
|
|
47542
|
+
return hasProperty(channelDef, 'axis') || hasProperty(channelDef, 'stack') || hasProperty(channelDef, 'impute');
|
|
47528
47543
|
}
|
|
47529
47544
|
function isMarkPropFieldOrDatumDef(channelDef) {
|
|
47530
|
-
return channelDef
|
|
47545
|
+
return hasProperty(channelDef, 'legend');
|
|
47531
47546
|
}
|
|
47532
47547
|
function isStringFieldOrDatumDef(channelDef) {
|
|
47533
|
-
return channelDef
|
|
47548
|
+
return hasProperty(channelDef, 'format') || hasProperty(channelDef, 'formatType');
|
|
47534
47549
|
}
|
|
47535
47550
|
function toStringFieldDef(fieldDef) {
|
|
47536
47551
|
// omit properties that don't exist in string field defs
|
|
47537
47552
|
return omit(fieldDef, ['legend', 'axis', 'header', 'scale']);
|
|
47538
47553
|
}
|
|
47539
47554
|
function isOpFieldDef(fieldDef) {
|
|
47540
|
-
return 'op'
|
|
47555
|
+
return hasProperty(fieldDef, 'op');
|
|
47541
47556
|
}
|
|
47542
47557
|
/**
|
|
47543
47558
|
* Get a Vega field reference from a Vega-Lite field def.
|
|
@@ -47659,12 +47674,7 @@ function functionalTitleFormatter(fieldDef) {
|
|
|
47659
47674
|
}
|
|
47660
47675
|
const timeUnitParams = timeUnit && !isBinnedTimeUnit(timeUnit) ? normalizeTimeUnit(timeUnit) : undefined;
|
|
47661
47676
|
const fn = aggregate || timeUnitParams?.unit || (timeUnitParams?.maxbins && 'timeunit') || (isBinning(bin) && 'bin');
|
|
47662
|
-
|
|
47663
|
-
return `${fn.toUpperCase()}(${field})`;
|
|
47664
|
-
}
|
|
47665
|
-
else {
|
|
47666
|
-
return field;
|
|
47667
|
-
}
|
|
47677
|
+
return fn ? `${fn.toUpperCase()}(${field})` : field;
|
|
47668
47678
|
}
|
|
47669
47679
|
const defaultTitleFormatter = (fieldDef, config) => {
|
|
47670
47680
|
switch (config.fieldTitle) {
|
|
@@ -47896,7 +47906,7 @@ function initFieldDef(fd, channel, { compositeMark = false } = {}) {
|
|
|
47896
47906
|
sort: { encoding: sort }
|
|
47897
47907
|
};
|
|
47898
47908
|
}
|
|
47899
|
-
const sub = sort.
|
|
47909
|
+
const sub = sort.substring(1);
|
|
47900
47910
|
if (sort.charAt(0) === '-' && isSortByChannel(sub)) {
|
|
47901
47911
|
return {
|
|
47902
47912
|
...fieldDef,
|
|
@@ -48354,7 +48364,7 @@ const AXIS_PROPERTIES_INDEX = {
|
|
|
48354
48364
|
encoding: 1
|
|
48355
48365
|
};
|
|
48356
48366
|
function isAxisProperty(prop) {
|
|
48357
|
-
return
|
|
48367
|
+
return has$1(AXIS_PROPERTIES_INDEX, prop);
|
|
48358
48368
|
}
|
|
48359
48369
|
const AXIS_CONFIGS_INDEX = {
|
|
48360
48370
|
axis: 1,
|
|
@@ -48383,7 +48393,7 @@ const AXIS_CONFIGS_INDEX = {
|
|
|
48383
48393
|
const AXIS_CONFIGS = keys(AXIS_CONFIGS_INDEX);
|
|
48384
48394
|
|
|
48385
48395
|
function isUnitSpec(spec) {
|
|
48386
|
-
return 'mark'
|
|
48396
|
+
return hasProperty(spec, 'mark');
|
|
48387
48397
|
}
|
|
48388
48398
|
|
|
48389
48399
|
class CompositeMarkNormalizer {
|
|
@@ -48840,7 +48850,7 @@ function filterTooltipWithAggregatedField(oldEncoding) {
|
|
|
48840
48850
|
}
|
|
48841
48851
|
}
|
|
48842
48852
|
else {
|
|
48843
|
-
if (tooltip
|
|
48853
|
+
if (tooltip.aggregate) {
|
|
48844
48854
|
filteredEncoding.tooltip = tooltip;
|
|
48845
48855
|
}
|
|
48846
48856
|
else {
|
|
@@ -49308,7 +49318,7 @@ function normalizeErrorBar(spec, { config }) {
|
|
|
49308
49318
|
encoding: normalizeEncoding(spec.encoding, config)
|
|
49309
49319
|
};
|
|
49310
49320
|
const { transform, continuousAxisChannelDef, continuousAxis, encodingWithoutContinuousAxis, ticksOrient, markDef, outerSpec, tooltipEncoding } = errorBarParams(spec, ERRORBAR, config);
|
|
49311
|
-
delete encodingWithoutContinuousAxis
|
|
49321
|
+
delete encodingWithoutContinuousAxis.size;
|
|
49312
49322
|
const makeErrorBarPart = makeCompositeAggregatePartFactory(markDef, continuousAxis, continuousAxisChannelDef, encodingWithoutContinuousAxis, config.errorbar);
|
|
49313
49323
|
const thickness = markDef.thickness;
|
|
49314
49324
|
const size = markDef.size;
|
|
@@ -49888,13 +49898,13 @@ function isAnyConcatSpec(spec) {
|
|
|
49888
49898
|
return isVConcatSpec(spec) || isHConcatSpec(spec) || isConcatSpec(spec);
|
|
49889
49899
|
}
|
|
49890
49900
|
function isConcatSpec(spec) {
|
|
49891
|
-
return 'concat'
|
|
49901
|
+
return hasProperty(spec, 'concat');
|
|
49892
49902
|
}
|
|
49893
49903
|
function isVConcatSpec(spec) {
|
|
49894
|
-
return 'vconcat'
|
|
49904
|
+
return hasProperty(spec, 'vconcat');
|
|
49895
49905
|
}
|
|
49896
49906
|
function isHConcatSpec(spec) {
|
|
49897
|
-
return 'hconcat'
|
|
49907
|
+
return hasProperty(spec, 'hconcat');
|
|
49898
49908
|
}
|
|
49899
49909
|
|
|
49900
49910
|
function getStepFor({ step, offsetIsDiscrete }) {
|
|
@@ -49906,10 +49916,10 @@ function getStepFor({ step, offsetIsDiscrete }) {
|
|
|
49906
49916
|
}
|
|
49907
49917
|
}
|
|
49908
49918
|
function isStep(size) {
|
|
49909
|
-
return
|
|
49919
|
+
return hasProperty(size, 'step');
|
|
49910
49920
|
}
|
|
49911
49921
|
function isFrameMixins(o) {
|
|
49912
|
-
return o
|
|
49922
|
+
return hasProperty(o, 'view') || hasProperty(o, 'width') || hasProperty(o, 'height');
|
|
49913
49923
|
}
|
|
49914
49924
|
const DEFAULT_SPACING = 20;
|
|
49915
49925
|
const COMPOSITION_LAYOUT_INDEX = {
|
|
@@ -50344,7 +50354,9 @@ function stripAndRedirectConfig(config) {
|
|
|
50344
50354
|
redirectTitleConfig(config);
|
|
50345
50355
|
// Remove empty config objects.
|
|
50346
50356
|
for (const prop in config) {
|
|
50357
|
+
// @ts-ignore
|
|
50347
50358
|
if (isObject(config[prop]) && isEmpty(config[prop])) {
|
|
50359
|
+
// @ts-ignore
|
|
50348
50360
|
delete config[prop];
|
|
50349
50361
|
}
|
|
50350
50362
|
}
|
|
@@ -50382,7 +50394,9 @@ function redirectTitleConfig(config) {
|
|
|
50382
50394
|
}
|
|
50383
50395
|
function redirectConfigToStyleConfig(config, prop, // string = composite mark
|
|
50384
50396
|
toProp, compositeMarkPart) {
|
|
50385
|
-
const propConfig = compositeMarkPart
|
|
50397
|
+
const propConfig = compositeMarkPart
|
|
50398
|
+
? config[prop][compositeMarkPart]
|
|
50399
|
+
: config[prop];
|
|
50386
50400
|
if (prop === 'view') {
|
|
50387
50401
|
toProp = 'cell'; // View's default style is "cell"
|
|
50388
50402
|
}
|
|
@@ -50401,14 +50415,14 @@ toProp, compositeMarkPart) {
|
|
|
50401
50415
|
}
|
|
50402
50416
|
|
|
50403
50417
|
function isLayerSpec(spec) {
|
|
50404
|
-
return 'layer'
|
|
50418
|
+
return hasProperty(spec, 'layer');
|
|
50405
50419
|
}
|
|
50406
50420
|
|
|
50407
50421
|
function isRepeatSpec(spec) {
|
|
50408
|
-
return 'repeat'
|
|
50422
|
+
return hasProperty(spec, 'repeat');
|
|
50409
50423
|
}
|
|
50410
50424
|
function isLayerRepeatSpec(spec) {
|
|
50411
|
-
return !isArray(spec.repeat) && spec.repeat
|
|
50425
|
+
return !isArray(spec.repeat) && hasProperty(spec.repeat, 'layer');
|
|
50412
50426
|
}
|
|
50413
50427
|
|
|
50414
50428
|
class SpecMapper {
|
|
@@ -50489,7 +50503,7 @@ const STACK_OFFSET_INDEX = {
|
|
|
50489
50503
|
normalize: 1
|
|
50490
50504
|
};
|
|
50491
50505
|
function isStackOffset(s) {
|
|
50492
|
-
return s
|
|
50506
|
+
return has$1(STACK_OFFSET_INDEX, s);
|
|
50493
50507
|
}
|
|
50494
50508
|
const STACKABLE_MARKS = new Set([ARC, BAR, AREA, RULE, POINT, CIRCLE, SQUARE, LINE, TEXT, TICK]);
|
|
50495
50509
|
const STACK_BY_DEFAULT_MARKS = new Set([BAR, AREA, ARC]);
|
|
@@ -51089,7 +51103,7 @@ function replaceRepeaterInChannelDef(channelDef, repeater) {
|
|
|
51089
51103
|
function replaceRepeaterInMapping(mapping, repeater) {
|
|
51090
51104
|
const out = {};
|
|
51091
51105
|
for (const channel in mapping) {
|
|
51092
|
-
if (
|
|
51106
|
+
if (hasProperty(mapping, channel)) {
|
|
51093
51107
|
const channelDef = mapping[channel];
|
|
51094
51108
|
if (isArray(channelDef)) {
|
|
51095
51109
|
// array cannot have condition
|
|
@@ -51416,70 +51430,70 @@ function mergeProjection(opt) {
|
|
|
51416
51430
|
}
|
|
51417
51431
|
|
|
51418
51432
|
function isFilter(t) {
|
|
51419
|
-
return 'filter'
|
|
51433
|
+
return hasProperty(t, 'filter');
|
|
51420
51434
|
}
|
|
51421
51435
|
function isImputeSequence(t) {
|
|
51422
|
-
return t
|
|
51436
|
+
return hasProperty(t, 'stop');
|
|
51423
51437
|
}
|
|
51424
51438
|
function isLookup(t) {
|
|
51425
|
-
return 'lookup'
|
|
51439
|
+
return hasProperty(t, 'lookup');
|
|
51426
51440
|
}
|
|
51427
51441
|
function isLookupData(from) {
|
|
51428
|
-
return 'data'
|
|
51442
|
+
return hasProperty(from, 'data');
|
|
51429
51443
|
}
|
|
51430
51444
|
function isLookupSelection(from) {
|
|
51431
|
-
return 'param'
|
|
51445
|
+
return hasProperty(from, 'param');
|
|
51432
51446
|
}
|
|
51433
51447
|
function isPivot(t) {
|
|
51434
|
-
return 'pivot'
|
|
51448
|
+
return hasProperty(t, 'pivot');
|
|
51435
51449
|
}
|
|
51436
51450
|
function isDensity(t) {
|
|
51437
|
-
return 'density'
|
|
51451
|
+
return hasProperty(t, 'density');
|
|
51438
51452
|
}
|
|
51439
51453
|
function isQuantile(t) {
|
|
51440
|
-
return 'quantile'
|
|
51454
|
+
return hasProperty(t, 'quantile');
|
|
51441
51455
|
}
|
|
51442
51456
|
function isRegression(t) {
|
|
51443
|
-
return 'regression'
|
|
51457
|
+
return hasProperty(t, 'regression');
|
|
51444
51458
|
}
|
|
51445
51459
|
function isLoess(t) {
|
|
51446
|
-
return 'loess'
|
|
51460
|
+
return hasProperty(t, 'loess');
|
|
51447
51461
|
}
|
|
51448
51462
|
function isSample(t) {
|
|
51449
|
-
return 'sample'
|
|
51463
|
+
return hasProperty(t, 'sample');
|
|
51450
51464
|
}
|
|
51451
51465
|
function isWindow(t) {
|
|
51452
|
-
return 'window'
|
|
51466
|
+
return hasProperty(t, 'window');
|
|
51453
51467
|
}
|
|
51454
51468
|
function isJoinAggregate(t) {
|
|
51455
|
-
return 'joinaggregate'
|
|
51469
|
+
return hasProperty(t, 'joinaggregate');
|
|
51456
51470
|
}
|
|
51457
51471
|
function isFlatten(t) {
|
|
51458
|
-
return 'flatten'
|
|
51472
|
+
return hasProperty(t, 'flatten');
|
|
51459
51473
|
}
|
|
51460
51474
|
function isCalculate(t) {
|
|
51461
|
-
return 'calculate'
|
|
51475
|
+
return hasProperty(t, 'calculate');
|
|
51462
51476
|
}
|
|
51463
51477
|
function isBin(t) {
|
|
51464
|
-
return 'bin'
|
|
51478
|
+
return hasProperty(t, 'bin');
|
|
51465
51479
|
}
|
|
51466
51480
|
function isImpute(t) {
|
|
51467
|
-
return 'impute'
|
|
51481
|
+
return hasProperty(t, 'impute');
|
|
51468
51482
|
}
|
|
51469
51483
|
function isTimeUnit(t) {
|
|
51470
|
-
return 'timeUnit'
|
|
51484
|
+
return hasProperty(t, 'timeUnit');
|
|
51471
51485
|
}
|
|
51472
51486
|
function isAggregate(t) {
|
|
51473
|
-
return 'aggregate'
|
|
51487
|
+
return hasProperty(t, 'aggregate');
|
|
51474
51488
|
}
|
|
51475
51489
|
function isStack(t) {
|
|
51476
|
-
return 'stack'
|
|
51490
|
+
return hasProperty(t, 'stack');
|
|
51477
51491
|
}
|
|
51478
51492
|
function isFold(t) {
|
|
51479
|
-
return 'fold'
|
|
51493
|
+
return hasProperty(t, 'fold');
|
|
51480
51494
|
}
|
|
51481
51495
|
function isExtent(t) {
|
|
51482
|
-
return 'extent'
|
|
51496
|
+
return hasProperty(t, 'extent') && !hasProperty(t, 'density') && !hasProperty(t, 'regression');
|
|
51483
51497
|
}
|
|
51484
51498
|
function normalizeTransform(transform) {
|
|
51485
51499
|
return transform.map(t => {
|
|
@@ -51703,7 +51717,7 @@ function normalizeGenericSpec(spec, config = {}) {
|
|
|
51703
51717
|
return topLevelSelectionNormalizer.map(coreNormalizer.map(selectionCompatNormalizer.map(spec, normParams), normParams), normParams);
|
|
51704
51718
|
}
|
|
51705
51719
|
function _normalizeAutoSize(autosize) {
|
|
51706
|
-
return isString(autosize) ? { type: autosize } : autosize ?? {};
|
|
51720
|
+
return isString(autosize) ? { type: autosize } : (autosize ?? {});
|
|
51707
51721
|
}
|
|
51708
51722
|
/**
|
|
51709
51723
|
* Normalize autosize and deal with width or height == "container".
|
|
@@ -51762,7 +51776,7 @@ function normalizeAutoSize(spec, sizeInfo, config) {
|
|
|
51762
51776
|
}
|
|
51763
51777
|
|
|
51764
51778
|
function isFitType(autoSizeType) {
|
|
51765
|
-
return
|
|
51779
|
+
return ['fit', 'fit-x', 'fit-y'].includes(autoSizeType);
|
|
51766
51780
|
}
|
|
51767
51781
|
function getFitType(sizeType) {
|
|
51768
51782
|
return sizeType ? `fit-${getPositionScaleChannel(sizeType)}` : 'fit';
|
|
@@ -51926,25 +51940,25 @@ class AncestorParse extends Split {
|
|
|
51926
51940
|
}
|
|
51927
51941
|
|
|
51928
51942
|
function isUrlData(data) {
|
|
51929
|
-
return 'url'
|
|
51943
|
+
return hasProperty(data, 'url');
|
|
51930
51944
|
}
|
|
51931
51945
|
function isInlineData(data) {
|
|
51932
|
-
return 'values'
|
|
51946
|
+
return hasProperty(data, 'values');
|
|
51933
51947
|
}
|
|
51934
51948
|
function isNamedData(data) {
|
|
51935
|
-
return 'name'
|
|
51949
|
+
return hasProperty(data, 'name') && !isUrlData(data) && !isInlineData(data) && !isGenerator(data);
|
|
51936
51950
|
}
|
|
51937
51951
|
function isGenerator(data) {
|
|
51938
51952
|
return data && (isSequenceGenerator(data) || isSphereGenerator(data) || isGraticuleGenerator(data));
|
|
51939
51953
|
}
|
|
51940
51954
|
function isSequenceGenerator(data) {
|
|
51941
|
-
return 'sequence'
|
|
51955
|
+
return hasProperty(data, 'sequence');
|
|
51942
51956
|
}
|
|
51943
51957
|
function isSphereGenerator(data) {
|
|
51944
|
-
return 'sphere'
|
|
51958
|
+
return hasProperty(data, 'sphere');
|
|
51945
51959
|
}
|
|
51946
51960
|
function isGraticuleGenerator(data) {
|
|
51947
|
-
return 'graticule'
|
|
51961
|
+
return hasProperty(data, 'graticule');
|
|
51948
51962
|
}
|
|
51949
51963
|
var DataSourceType;
|
|
51950
51964
|
(function (DataSourceType) {
|
|
@@ -52680,9 +52694,9 @@ const scaleBindings = {
|
|
|
52680
52694
|
// state is captured by the top-level signals that we insert and "push
|
|
52681
52695
|
// outer" to from within the units. We need to reassemble this state into
|
|
52682
52696
|
// the top-level named signal, except no single selCmpt has a global view.
|
|
52683
|
-
const namedSg = signals.
|
|
52697
|
+
const namedSg = signals.find(s => s.name === selCmpt.name);
|
|
52684
52698
|
let update = namedSg.update;
|
|
52685
|
-
if (update.
|
|
52699
|
+
if (update.includes(VL_SELECTION_RESOLVE)) {
|
|
52686
52700
|
namedSg.update = `{${bound
|
|
52687
52701
|
.map(proj => `${$(replacePathInField(proj.field))}: ${proj.signals.data}`)
|
|
52688
52702
|
.join(', ')}}`;
|
|
@@ -52745,7 +52759,7 @@ const interval = {
|
|
|
52745
52759
|
continue;
|
|
52746
52760
|
}
|
|
52747
52761
|
const filters = array$5(((_a = evt.between[0]).filter ?? (_a.filter = [])));
|
|
52748
|
-
if (filters.
|
|
52762
|
+
if (!filters.includes(filterExpr)) {
|
|
52749
52763
|
filters.push(filterExpr);
|
|
52750
52764
|
}
|
|
52751
52765
|
}
|
|
@@ -52915,7 +52929,10 @@ const interval = {
|
|
|
52915
52929
|
const vgStroke = keys(stroke).reduce((def, k) => {
|
|
52916
52930
|
def[k] = [
|
|
52917
52931
|
{
|
|
52918
|
-
test: [
|
|
52932
|
+
test: [
|
|
52933
|
+
x !== undefined && `${xvname}[0] !== ${xvname}[1]`,
|
|
52934
|
+
y !== undefined && `${yvname}[0] !== ${yvname}[1]`
|
|
52935
|
+
]
|
|
52919
52936
|
.filter(t => t)
|
|
52920
52937
|
.join(' && '),
|
|
52921
52938
|
value: stroke[k]
|
|
@@ -53182,7 +53199,7 @@ function tooltip(model, opt = {}) {
|
|
|
53182
53199
|
}
|
|
53183
53200
|
function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
53184
53201
|
const formatConfig = { ...config, ...config.tooltipFormat };
|
|
53185
|
-
const toSkip =
|
|
53202
|
+
const toSkip = new Set();
|
|
53186
53203
|
const expr = reactiveGeom ? 'datum.datum' : 'datum';
|
|
53187
53204
|
const tuples = [];
|
|
53188
53205
|
function add(fDef, channel) {
|
|
@@ -53204,7 +53221,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
|
53204
53221
|
const endField = vgField(fieldDef2, { expr });
|
|
53205
53222
|
const { format, formatType } = getFormatMixins(fieldDef);
|
|
53206
53223
|
value = binFormatExpression(startField, endField, format, formatType, formatConfig);
|
|
53207
|
-
toSkip
|
|
53224
|
+
toSkip.add(channel2);
|
|
53208
53225
|
}
|
|
53209
53226
|
}
|
|
53210
53227
|
if ((isXorY(channel) || channel === THETA || channel === RADIUS) &&
|
|
@@ -53234,7 +53251,7 @@ function tooltipData(encoding, stack, config, { reactiveGeom } = {}) {
|
|
|
53234
53251
|
});
|
|
53235
53252
|
const out = {};
|
|
53236
53253
|
for (const { channel, key, value } of tuples) {
|
|
53237
|
-
if (!toSkip
|
|
53254
|
+
if (!toSkip.has(channel) && !out[key]) {
|
|
53238
53255
|
out[key] = value;
|
|
53239
53256
|
}
|
|
53240
53257
|
}
|
|
@@ -53269,7 +53286,7 @@ function ariaRoleDescription(model) {
|
|
|
53269
53286
|
if (ariaRoleDesc != null) {
|
|
53270
53287
|
return { ariaRoleDescription: { value: ariaRoleDesc } };
|
|
53271
53288
|
}
|
|
53272
|
-
return mark
|
|
53289
|
+
return has$1(VG_MARK_INDEX, mark) ? {} : { ariaRoleDescription: { value: mark } };
|
|
53273
53290
|
}
|
|
53274
53291
|
function description$1(model) {
|
|
53275
53292
|
const { encoding, markDef, config, stack } = model;
|
|
@@ -53314,14 +53331,19 @@ function nonPosition(channel, model, opt = {}) {
|
|
|
53314
53331
|
const { markDef, encoding, config } = model;
|
|
53315
53332
|
const { vgChannel } = opt;
|
|
53316
53333
|
let { defaultRef, defaultValue } = opt;
|
|
53334
|
+
const channelDef = encoding[channel];
|
|
53317
53335
|
if (defaultRef === undefined) {
|
|
53318
53336
|
// prettier-ignore
|
|
53319
|
-
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, {
|
|
53337
|
+
defaultValue ?? (defaultValue = getMarkPropOrConfig(channel, markDef, config, {
|
|
53338
|
+
vgChannel,
|
|
53339
|
+
// If there is no conditonal def, we ignore vgConfig so the output spec is concise.
|
|
53340
|
+
// However, if there is a conditional def, we must include vgConfig so the default is respected.
|
|
53341
|
+
ignoreVgConfig: !isConditionalDef(channelDef)
|
|
53342
|
+
}));
|
|
53320
53343
|
if (defaultValue !== undefined) {
|
|
53321
53344
|
defaultRef = signalOrValueRef(defaultValue);
|
|
53322
53345
|
}
|
|
53323
53346
|
}
|
|
53324
|
-
const channelDef = encoding[channel];
|
|
53325
53347
|
const commonProps = {
|
|
53326
53348
|
markDef,
|
|
53327
53349
|
config,
|
|
@@ -53411,6 +53433,7 @@ function zindex(model) {
|
|
|
53411
53433
|
function positionOffset({ channel: baseChannel, markDef, encoding = {}, model, bandPosition }) {
|
|
53412
53434
|
const channel = `${baseChannel}Offset`; // Need to cast as the type can't be inferred automatically
|
|
53413
53435
|
const defaultValue = markDef[channel];
|
|
53436
|
+
// FIXME: remove as any
|
|
53414
53437
|
const channelDef = encoding[channel];
|
|
53415
53438
|
if ((channel === 'xOffset' || channel === 'yOffset') && channelDef) {
|
|
53416
53439
|
const ref = midPoint({
|
|
@@ -53585,6 +53608,7 @@ function vgAlignedPositionChannel(channel, markDef, config, defaultAlign = 'midd
|
|
|
53585
53608
|
else {
|
|
53586
53609
|
alignExcludingSignal = align;
|
|
53587
53610
|
}
|
|
53611
|
+
// FIXME: remove as any
|
|
53588
53612
|
if (channel === 'x') {
|
|
53589
53613
|
return ALIGNED_X_CHANNEL[alignExcludingSignal || (defaultAlign === 'top' ? 'left' : 'center')];
|
|
53590
53614
|
}
|
|
@@ -53731,9 +53755,12 @@ function rectPosition(model, channel) {
|
|
|
53731
53755
|
const scale = model.getScaleComponent(channel);
|
|
53732
53756
|
const scaleType = scale ? scale.get('type') : undefined;
|
|
53733
53757
|
const orient = markDef.orient;
|
|
53734
|
-
const hasSizeDef = encoding[sizeChannel] ??
|
|
53758
|
+
const hasSizeDef = encoding[sizeChannel] ??
|
|
53759
|
+
encoding.size ??
|
|
53760
|
+
getMarkPropOrConfig('size', markDef, config, { vgChannel: sizeChannel });
|
|
53735
53761
|
const offsetScaleChannel = getOffsetChannel(channel);
|
|
53736
|
-
const
|
|
53762
|
+
const isBarOrTickBand = (mark === 'bar' && (channel === 'x' ? orient === 'vertical' : orient === 'horizontal')) ||
|
|
53763
|
+
(mark === 'tick' && (channel === 'y' ? orient === 'vertical' : orient === 'horizontal'));
|
|
53737
53764
|
// x, x2, and width -- we must specify two of these in all conditions
|
|
53738
53765
|
if (isFieldDef(channelDef) &&
|
|
53739
53766
|
(isBinning(channelDef.bin) || isBinned(channelDef.bin) || (channelDef.timeUnit && !channelDef2)) &&
|
|
@@ -53747,7 +53774,7 @@ function rectPosition(model, channel) {
|
|
|
53747
53774
|
model
|
|
53748
53775
|
});
|
|
53749
53776
|
}
|
|
53750
|
-
else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) ||
|
|
53777
|
+
else if (((isFieldOrDatumDef(channelDef) && hasDiscreteDomain(scaleType)) || isBarOrTickBand) && !channelDef2) {
|
|
53751
53778
|
return positionAndSize(channelDef, channel, model);
|
|
53752
53779
|
}
|
|
53753
53780
|
else {
|
|
@@ -53792,8 +53819,8 @@ function defaultSizeRef(sizeChannel, scaleName, scale, config, bandSize, hasFiel
|
|
|
53792
53819
|
}
|
|
53793
53820
|
}
|
|
53794
53821
|
if (!hasFieldDef) {
|
|
53795
|
-
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner } = config.scale;
|
|
53796
|
-
const padding = getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner); // this part is like paddingInner in scale.ts
|
|
53822
|
+
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, tickBandPaddingInner } = config.scale;
|
|
53823
|
+
const padding = getFirstDefined(bandPaddingInner, mark === 'tick' ? tickBandPaddingInner : mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner); // this part is like paddingInner in scale.ts
|
|
53797
53824
|
if (isSignalRef(padding)) {
|
|
53798
53825
|
return { signal: `(1 - (${padding.signal})) * ${sizeChannel}` };
|
|
53799
53826
|
}
|
|
@@ -53817,8 +53844,12 @@ function positionAndSize(fieldDef, channel, model) {
|
|
|
53817
53844
|
const offsetScaleChannel = getOffsetChannel(channel);
|
|
53818
53845
|
const offsetScaleName = model.scaleName(offsetScaleChannel);
|
|
53819
53846
|
const offsetScale = model.getScaleComponent(getOffsetScaleChannel(channel));
|
|
53820
|
-
|
|
53821
|
-
|
|
53847
|
+
const useVlSizeChannel =
|
|
53848
|
+
// Always uses size channel for ticks, because tick only calls rectPosition() for the size channel
|
|
53849
|
+
markDef.type === 'tick' ||
|
|
53850
|
+
// use "size" channel for bars, if there is orient and the channel matches the right orientation
|
|
53851
|
+
(orient === 'horizontal' && channel === 'y') ||
|
|
53852
|
+
(orient === 'vertical' && channel === 'x');
|
|
53822
53853
|
// Use size encoding / mark property / config if it exists
|
|
53823
53854
|
let sizeMixins;
|
|
53824
53855
|
if (encoding.size || markDef.size) {
|
|
@@ -53936,7 +53967,7 @@ function rectBinPosition({ fieldDef, fieldDef2, channel, model }) {
|
|
|
53936
53967
|
const bandSize = getBandSize({ channel, fieldDef, markDef, config, scaleType });
|
|
53937
53968
|
const axis = model.component.axes[channel]?.[0];
|
|
53938
53969
|
const axisTranslate = axis?.get('translate') ?? 0.5; // vega default is 0.5
|
|
53939
|
-
const spacing = isXorY(channel) ? getMarkPropOrConfig('binSpacing', markDef, config) ?? 0 : 0;
|
|
53970
|
+
const spacing = isXorY(channel) ? (getMarkPropOrConfig('binSpacing', markDef, config) ?? 0) : 0;
|
|
53940
53971
|
const channel2 = getSecondaryRangeChannel(channel);
|
|
53941
53972
|
const vgChannel = getVgPositionChannel(channel);
|
|
53942
53973
|
const vgChannel2 = getVgPositionChannel(channel2);
|
|
@@ -54035,7 +54066,7 @@ function colorRef(channel, valueRef) {
|
|
|
54035
54066
|
}
|
|
54036
54067
|
function markDefProperties(mark, ignore) {
|
|
54037
54068
|
return VG_MARK_CONFIGS.reduce((m, prop) => {
|
|
54038
|
-
if (!ALWAYS_IGNORE.has(prop) && mark
|
|
54069
|
+
if (!ALWAYS_IGNORE.has(prop) && hasProperty(mark, prop) && ignore[prop] !== 'ignore') {
|
|
54039
54070
|
m[prop] = signalOrValueRef(mark[prop]);
|
|
54040
54071
|
}
|
|
54041
54072
|
return m;
|
|
@@ -54135,7 +54166,7 @@ const nearest = {
|
|
|
54135
54166
|
if (name === model.component.mark[0].name) {
|
|
54136
54167
|
index = i;
|
|
54137
54168
|
}
|
|
54138
|
-
else if (name.
|
|
54169
|
+
else if (name.includes(VORONOI)) {
|
|
54139
54170
|
exists = true;
|
|
54140
54171
|
}
|
|
54141
54172
|
});
|
|
@@ -54185,7 +54216,7 @@ const inputBindings = {
|
|
|
54185
54216
|
signals: (model, selCmpt, signals) => {
|
|
54186
54217
|
const name = selCmpt.name;
|
|
54187
54218
|
const proj = selCmpt.project;
|
|
54188
|
-
const signal = signals.
|
|
54219
|
+
const signal = signals.find(s => s.name === name + TUPLE);
|
|
54189
54220
|
const fields = name + TUPLE_FIELDS;
|
|
54190
54221
|
const values = proj.items.map(p => varName(`${name}_${p.field}`));
|
|
54191
54222
|
const valid = values.map(v => `${v} !== null`).join(' && ');
|
|
@@ -54428,7 +54459,7 @@ function onDelta$1(model, selCmpt, proj, size, signals) {
|
|
|
54428
54459
|
const delta = name + DELTA$1;
|
|
54429
54460
|
const channel = proj.channel;
|
|
54430
54461
|
const boundScales = scaleBindings.defined(selCmpt);
|
|
54431
|
-
const signal = signals.
|
|
54462
|
+
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']);
|
|
54432
54463
|
const sizeSg = model.getSizeSignalRef(size).signal;
|
|
54433
54464
|
const scaleCmpt = model.getScaleComponent(channel);
|
|
54434
54465
|
const scaleType = scaleCmpt && scaleCmpt.get('type');
|
|
@@ -54513,7 +54544,7 @@ function onDelta(model, selCmpt, proj, size, signals) {
|
|
|
54513
54544
|
const name = selCmpt.name;
|
|
54514
54545
|
const channel = proj.channel;
|
|
54515
54546
|
const boundScales = scaleBindings.defined(selCmpt);
|
|
54516
|
-
const signal = signals.
|
|
54547
|
+
const signal = signals.find(s => s.name === proj.signals[boundScales ? 'data' : 'visual']);
|
|
54517
54548
|
const sizeSg = model.getSizeSignalRef(size).signal;
|
|
54518
54549
|
const scaleCmpt = model.getScaleComponent(channel);
|
|
54519
54550
|
const scaleType = scaleCmpt && scaleCmpt.get('type');
|
|
@@ -54683,7 +54714,7 @@ function parseUnitSelection(model, selDefs) {
|
|
|
54683
54714
|
continue;
|
|
54684
54715
|
}
|
|
54685
54716
|
if (key === 'mark') {
|
|
54686
|
-
defaults
|
|
54717
|
+
defaults.mark = { ...cfg.mark, ...defaults.mark };
|
|
54687
54718
|
}
|
|
54688
54719
|
if (defaults[key] === undefined || defaults[key] === true) {
|
|
54689
54720
|
defaults[key] = duplicate(cfg[key] ?? defaults[key]);
|
|
@@ -54736,8 +54767,8 @@ function parseSelectionPredicate(model, pred, dfnode, datum = 'datum') {
|
|
|
54736
54767
|
}
|
|
54737
54768
|
function parseSelectionExtent(model, name, extent) {
|
|
54738
54769
|
const vname = varName(name);
|
|
54739
|
-
const encoding = extent
|
|
54740
|
-
let field = extent
|
|
54770
|
+
const encoding = extent.encoding;
|
|
54771
|
+
let field = extent.field;
|
|
54741
54772
|
let selCmpt;
|
|
54742
54773
|
try {
|
|
54743
54774
|
selCmpt = model.getSelectionComponent(vname, name);
|
|
@@ -54815,7 +54846,8 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
|
|
|
54815
54846
|
if (disable) {
|
|
54816
54847
|
return undefined;
|
|
54817
54848
|
}
|
|
54818
|
-
for (const
|
|
54849
|
+
for (const p in axis) {
|
|
54850
|
+
const prop = p;
|
|
54819
54851
|
const propType = AXIS_PROPERTY_TYPE[prop];
|
|
54820
54852
|
const propValue = axis[prop];
|
|
54821
54853
|
if (propType && propType !== kind && propType !== 'both') {
|
|
@@ -54861,6 +54893,7 @@ function assembleAxis(axisCmpt, kind, config, opt = { header: false }) {
|
|
|
54861
54893
|
const propIndex = CONDITIONAL_AXIS_PROP_INDEX[prop];
|
|
54862
54894
|
if (propIndex) {
|
|
54863
54895
|
const { vgProp, part } = propIndex;
|
|
54896
|
+
// FIXME: remove as any
|
|
54864
54897
|
setAxisEncode(axis, part, vgProp, propValue);
|
|
54865
54898
|
delete axis[prop];
|
|
54866
54899
|
} // else do nothing since the property already supports signal
|
|
@@ -55741,28 +55774,26 @@ function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, leg
|
|
|
55741
55774
|
const symbolOpacity = legendCmpt.get('symbolOpacity') ?? config.legend.symbolOpacity;
|
|
55742
55775
|
const symbolFillColor = legendCmpt.get('symbolFillColor') ?? config.legend.symbolFillColor;
|
|
55743
55776
|
const symbolStrokeColor = legendCmpt.get('symbolStrokeColor') ?? config.legend.symbolStrokeColor;
|
|
55744
|
-
const opacity = symbolOpacity === undefined ? getMaxValue(encoding.opacity) ?? markDef.opacity : undefined;
|
|
55777
|
+
const opacity = symbolOpacity === undefined ? (getMaxValue(encoding.opacity) ?? markDef.opacity) : undefined;
|
|
55745
55778
|
if (out.fill) {
|
|
55746
55779
|
// for fill legend, we don't want any fill in symbol
|
|
55747
55780
|
if (channel === 'fill' || (filled && channel === COLOR)) {
|
|
55748
55781
|
delete out.fill;
|
|
55749
55782
|
}
|
|
55750
|
-
else {
|
|
55751
|
-
if
|
|
55752
|
-
|
|
55753
|
-
|
|
55754
|
-
delete out.fill;
|
|
55755
|
-
}
|
|
55756
|
-
else {
|
|
55757
|
-
out.fill = signalOrValueRef(config.legend.symbolBaseFillColor ?? 'black');
|
|
55758
|
-
out.fillOpacity = signalOrValueRef(opacity ?? 1);
|
|
55759
|
-
}
|
|
55783
|
+
else if (hasProperty(out.fill, 'field')) {
|
|
55784
|
+
// For others, set fill to some opaque value (or nothing if a color is already set)
|
|
55785
|
+
if (symbolFillColor) {
|
|
55786
|
+
delete out.fill;
|
|
55760
55787
|
}
|
|
55761
|
-
else
|
|
55762
|
-
|
|
55763
|
-
|
|
55764
|
-
|
|
55765
|
-
|
|
55788
|
+
else {
|
|
55789
|
+
out.fill = signalOrValueRef(config.legend.symbolBaseFillColor ?? 'black');
|
|
55790
|
+
out.fillOpacity = signalOrValueRef(opacity ?? 1);
|
|
55791
|
+
}
|
|
55792
|
+
}
|
|
55793
|
+
else if (isArray(out.fill)) {
|
|
55794
|
+
const fill = getFirstConditionValue(encoding.fill ?? encoding.color) ?? markDef.fill ?? (filled && markDef.color);
|
|
55795
|
+
if (fill) {
|
|
55796
|
+
out.fill = signalOrValueRef(fill);
|
|
55766
55797
|
}
|
|
55767
55798
|
}
|
|
55768
55799
|
}
|
|
@@ -55770,16 +55801,14 @@ function symbols(symbolsSpec, { fieldOrDatumDef, model, channel, legendCmpt, leg
|
|
|
55770
55801
|
if (channel === 'stroke' || (!filled && channel === COLOR)) {
|
|
55771
55802
|
delete out.stroke;
|
|
55772
55803
|
}
|
|
55773
|
-
else {
|
|
55774
|
-
|
|
55775
|
-
|
|
55776
|
-
|
|
55777
|
-
|
|
55778
|
-
|
|
55779
|
-
|
|
55780
|
-
|
|
55781
|
-
out.stroke = { value: stroke };
|
|
55782
|
-
}
|
|
55804
|
+
else if (hasProperty(out.stroke, 'field') || symbolStrokeColor) {
|
|
55805
|
+
// For others, remove stroke field
|
|
55806
|
+
delete out.stroke;
|
|
55807
|
+
}
|
|
55808
|
+
else if (isArray(out.stroke)) {
|
|
55809
|
+
const stroke = getFirstDefined(getFirstConditionValue(encoding.stroke || encoding.color), markDef.stroke, filled ? markDef.color : undefined);
|
|
55810
|
+
if (stroke) {
|
|
55811
|
+
out.stroke = { value: stroke };
|
|
55783
55812
|
}
|
|
55784
55813
|
}
|
|
55785
55814
|
}
|
|
@@ -56130,6 +56159,7 @@ function parseLegendForChannel(model, channel) {
|
|
|
56130
56159
|
const legendEncode = {};
|
|
56131
56160
|
const legendEncodeParams = { fieldOrDatumDef, model, channel, legendCmpt, legendType };
|
|
56132
56161
|
for (const part of ['labels', 'legend', 'title', 'symbols', 'gradient', 'entries']) {
|
|
56162
|
+
// FIXME: remove as any (figure out what legendEncoding.entries is)
|
|
56133
56163
|
const legendEncodingPart = guideEncodeEntry(legendEncoding[part] ?? {}, model);
|
|
56134
56164
|
const value = part in legendEncodeRules
|
|
56135
56165
|
? legendEncodeRules[part](legendEncodingPart, legendEncodeParams) // apply rule
|
|
@@ -56526,7 +56556,7 @@ function rangeFormula(model, fieldDef, channel, config) {
|
|
|
56526
56556
|
if (binRequiresRange(fieldDef, channel)) {
|
|
56527
56557
|
// read format from axis or legend, if there is no format then use config.numberFormat
|
|
56528
56558
|
const guide = isUnitModel(model)
|
|
56529
|
-
? model.axis(channel) ?? model.legend(channel) ?? {}
|
|
56559
|
+
? (model.axis(channel) ?? model.legend(channel) ?? {})
|
|
56530
56560
|
: {};
|
|
56531
56561
|
const startField = vgField(fieldDef, { expr: 'datum' });
|
|
56532
56562
|
const endField = vgField(fieldDef, { expr: 'datum', binSuffix: 'end' });
|
|
@@ -56801,6 +56831,7 @@ class AggregateNode extends DataFlowNode {
|
|
|
56801
56831
|
return new AggregateNode(parent, dims, meas);
|
|
56802
56832
|
}
|
|
56803
56833
|
static makeFromTransform(parent, t) {
|
|
56834
|
+
var _a;
|
|
56804
56835
|
const dims = new Set();
|
|
56805
56836
|
const meas = {};
|
|
56806
56837
|
for (const s of t.aggregate) {
|
|
@@ -56812,7 +56843,8 @@ class AggregateNode extends DataFlowNode {
|
|
|
56812
56843
|
}
|
|
56813
56844
|
else {
|
|
56814
56845
|
meas[field] ?? (meas[field] = {});
|
|
56815
|
-
meas[field][op]
|
|
56846
|
+
(_a = meas[field])[op] ?? (_a[op] = new Set());
|
|
56847
|
+
meas[field][op].add(as ? as : vgField(s, { forAs: true }));
|
|
56816
56848
|
}
|
|
56817
56849
|
}
|
|
56818
56850
|
}
|
|
@@ -57172,10 +57204,11 @@ function getImplicitFromFilterTransform(transform) {
|
|
|
57172
57204
|
val = signalRefOrValue(filter.gte);
|
|
57173
57205
|
}
|
|
57174
57206
|
else if (isFieldRangePredicate(filter)) {
|
|
57207
|
+
// FIXME: remove as any
|
|
57175
57208
|
val = filter.range[0];
|
|
57176
57209
|
}
|
|
57177
57210
|
else if (isFieldOneOfPredicate(filter)) {
|
|
57178
|
-
val = (filter.oneOf ?? filter
|
|
57211
|
+
val = (filter.oneOf ?? filter.in)[0];
|
|
57179
57212
|
} // else -- for filter expression, we can't infer anything
|
|
57180
57213
|
if (val) {
|
|
57181
57214
|
if (isDateTime(val)) {
|
|
@@ -58818,8 +58851,8 @@ function parseSelectionDomain(model, channel) {
|
|
|
58818
58851
|
const scale = model.component.scales[channel];
|
|
58819
58852
|
const spec = model.specifiedScales[channel].domain;
|
|
58820
58853
|
const bin = model.fieldDef(channel)?.bin;
|
|
58821
|
-
const domain = isParameterDomain(spec)
|
|
58822
|
-
const extent = isBinParams(bin) && isParameterExtent(bin.extent)
|
|
58854
|
+
const domain = isParameterDomain(spec) ? spec : undefined;
|
|
58855
|
+
const extent = isBinParams(bin) && isParameterExtent(bin.extent) ? bin.extent : undefined;
|
|
58823
58856
|
if (domain || extent) {
|
|
58824
58857
|
// As scale parsing occurs before selection parsing, we cannot set
|
|
58825
58858
|
// domainRaw directly. So instead, we store the selectionExtent on
|
|
@@ -58991,7 +59024,7 @@ function mergeDomains(domains) {
|
|
|
58991
59024
|
}
|
|
58992
59025
|
// only keep sort properties that work with unioned domains
|
|
58993
59026
|
const unionDomainSorts = unique(sorts.map(s => {
|
|
58994
|
-
if (isBoolean(s) || !('op' in s) || (isString(s.op) && s.op
|
|
59027
|
+
if (isBoolean(s) || !('op' in s) || (isString(s.op) && has$1(MULTIDOMAIN_SORT_OP_INDEX, s.op))) {
|
|
58995
59028
|
return s;
|
|
58996
59029
|
}
|
|
58997
59030
|
warn(domainSortDropped(s));
|
|
@@ -59676,7 +59709,7 @@ function parseUnitScaleProperty(model, property) {
|
|
|
59676
59709
|
}
|
|
59677
59710
|
if (supportedByScaleType && channelIncompatability === undefined) {
|
|
59678
59711
|
if (specifiedValue !== undefined) {
|
|
59679
|
-
const timeUnit = fieldOrDatumDef
|
|
59712
|
+
const timeUnit = fieldOrDatumDef.timeUnit;
|
|
59680
59713
|
const type = fieldOrDatumDef.type;
|
|
59681
59714
|
switch (property) {
|
|
59682
59715
|
// domainMax/Min to signal if the value is a datetime object
|
|
@@ -59694,7 +59727,7 @@ function parseUnitScaleProperty(model, property) {
|
|
|
59694
59727
|
}
|
|
59695
59728
|
}
|
|
59696
59729
|
else {
|
|
59697
|
-
const value = property
|
|
59730
|
+
const value = hasProperty(scaleRules, property)
|
|
59698
59731
|
? scaleRules[property]({
|
|
59699
59732
|
model,
|
|
59700
59733
|
channel,
|
|
@@ -59833,11 +59866,11 @@ function paddingInner(paddingValue, channel, mark, scaleType, scaleConfig, hasNe
|
|
|
59833
59866
|
// Padding is only set for X and Y by default.
|
|
59834
59867
|
// Basically it doesn't make sense to add padding for color and size.
|
|
59835
59868
|
// paddingOuter would only be called if it's a band scale, just return the default for bandScale.
|
|
59836
|
-
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, bandWithNestedOffsetPaddingInner } = scaleConfig;
|
|
59869
|
+
const { bandPaddingInner, barBandPaddingInner, rectBandPaddingInner, tickBandPaddingInner, bandWithNestedOffsetPaddingInner } = scaleConfig;
|
|
59837
59870
|
if (hasNestedOffsetScale) {
|
|
59838
59871
|
return bandWithNestedOffsetPaddingInner;
|
|
59839
59872
|
}
|
|
59840
|
-
return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : rectBandPaddingInner);
|
|
59873
|
+
return getFirstDefined(bandPaddingInner, mark === 'bar' ? barBandPaddingInner : mark === 'tick' ? tickBandPaddingInner : rectBandPaddingInner);
|
|
59841
59874
|
}
|
|
59842
59875
|
else if (isXorYOffset(channel)) {
|
|
59843
59876
|
if (scaleType === ScaleType.BAND) {
|
|
@@ -59981,8 +60014,8 @@ function defaultType(channel, fieldDef, mark, hasNestedOffsetScale) {
|
|
|
59981
60014
|
return 'ordinal';
|
|
59982
60015
|
}
|
|
59983
60016
|
if (isXorY(channel) || isXorYOffset(channel)) {
|
|
59984
|
-
if (contains(['rect', 'bar', 'image', 'rule'], mark.type)) {
|
|
59985
|
-
// The rect/bar mark should fit into a band.
|
|
60017
|
+
if (contains(['rect', 'bar', 'image', 'rule', 'tick'], mark.type)) {
|
|
60018
|
+
// The rect/bar/tick mark should fit into a band.
|
|
59986
60019
|
// For rule, using band scale to make rule align with axis ticks better https://github.com/vega/vega-lite/issues/3429
|
|
59987
60020
|
return 'band';
|
|
59988
60021
|
}
|
|
@@ -60068,7 +60101,7 @@ function parseUnitScaleCore(model) {
|
|
|
60068
60101
|
if (fieldOrDatumDef && mark === GEOSHAPE && channel === SHAPE && fieldOrDatumDef.type === GEOJSON) {
|
|
60069
60102
|
continue;
|
|
60070
60103
|
}
|
|
60071
|
-
let specifiedScale = fieldOrDatumDef && fieldOrDatumDef
|
|
60104
|
+
let specifiedScale = fieldOrDatumDef && fieldOrDatumDef.scale;
|
|
60072
60105
|
if (fieldOrDatumDef && specifiedScale !== null && specifiedScale !== false) {
|
|
60073
60106
|
specifiedScale ?? (specifiedScale = {});
|
|
60074
60107
|
const hasNestedOffsetScale = channelHasNestedOffsetScale(encoding, channel);
|
|
@@ -61615,7 +61648,7 @@ class FacetModel extends ModelWithField {
|
|
|
61615
61648
|
return facetFieldDef;
|
|
61616
61649
|
}
|
|
61617
61650
|
channelHasField(channel) {
|
|
61618
|
-
return
|
|
61651
|
+
return hasProperty(this.facet, channel);
|
|
61619
61652
|
}
|
|
61620
61653
|
fieldDef(channel) {
|
|
61621
61654
|
return this.facet[channel];
|
|
@@ -61946,14 +61979,14 @@ function findSource(data, sources) {
|
|
|
61946
61979
|
if (data.name && other.hasName() && data.name !== other.dataName) {
|
|
61947
61980
|
continue;
|
|
61948
61981
|
}
|
|
61949
|
-
const formatMesh = data
|
|
61982
|
+
const formatMesh = data.format?.mesh;
|
|
61950
61983
|
const otherFeature = otherData.format?.feature;
|
|
61951
61984
|
// feature and mesh are mutually exclusive
|
|
61952
61985
|
if (formatMesh && otherFeature) {
|
|
61953
61986
|
continue;
|
|
61954
61987
|
}
|
|
61955
61988
|
// we have to extract the same feature or mesh
|
|
61956
|
-
const formatFeature = data
|
|
61989
|
+
const formatFeature = data.format?.feature;
|
|
61957
61990
|
if ((formatFeature || otherFeature) && formatFeature !== otherFeature) {
|
|
61958
61991
|
continue;
|
|
61959
61992
|
}
|
|
@@ -63082,7 +63115,8 @@ const tick = {
|
|
|
63082
63115
|
encodeEntry: (model) => {
|
|
63083
63116
|
const { config, markDef } = model;
|
|
63084
63117
|
const orient = markDef.orient;
|
|
63085
|
-
const
|
|
63118
|
+
const vgSizeAxisChannel = orient === 'horizontal' ? 'x' : 'y';
|
|
63119
|
+
const vgThicknessAxisChannel = orient === 'horizontal' ? 'y' : 'x';
|
|
63086
63120
|
const vgThicknessChannel = orient === 'horizontal' ? 'height' : 'width';
|
|
63087
63121
|
return {
|
|
63088
63122
|
...baseEncodeEntry(model, {
|
|
@@ -63093,35 +63127,15 @@ const tick = {
|
|
|
63093
63127
|
size: 'ignore',
|
|
63094
63128
|
theta: 'ignore'
|
|
63095
63129
|
}),
|
|
63096
|
-
...
|
|
63097
|
-
...pointPosition(
|
|
63098
|
-
|
|
63099
|
-
|
|
63100
|
-
defaultValue: defaultSize(model),
|
|
63101
|
-
vgChannel: vgSizeChannel
|
|
63130
|
+
...rectPosition(model, vgSizeAxisChannel),
|
|
63131
|
+
...pointPosition(vgThicknessAxisChannel, model, {
|
|
63132
|
+
defaultPos: 'mid',
|
|
63133
|
+
vgChannel: vgThicknessAxisChannel === 'y' ? 'yc' : 'xc'
|
|
63102
63134
|
}),
|
|
63103
63135
|
[vgThicknessChannel]: signalOrValueRef(getMarkPropOrConfig('thickness', markDef, config))
|
|
63104
63136
|
};
|
|
63105
63137
|
}
|
|
63106
63138
|
};
|
|
63107
|
-
function defaultSize(model) {
|
|
63108
|
-
const { config, markDef } = model;
|
|
63109
|
-
const { orient } = markDef;
|
|
63110
|
-
const vgSizeChannel = orient === 'horizontal' ? 'width' : 'height';
|
|
63111
|
-
const scale = model.getScaleComponent(orient === 'horizontal' ? 'x' : 'y');
|
|
63112
|
-
const markPropOrConfig = getMarkPropOrConfig('size', markDef, config, { vgChannel: vgSizeChannel }) ?? config.tick.bandSize;
|
|
63113
|
-
if (markPropOrConfig !== undefined) {
|
|
63114
|
-
return markPropOrConfig;
|
|
63115
|
-
}
|
|
63116
|
-
else {
|
|
63117
|
-
const scaleRange = scale ? scale.get('range') : undefined;
|
|
63118
|
-
if (scaleRange && isVgRangeStep(scaleRange) && isNumber$1(scaleRange.step)) {
|
|
63119
|
-
return (scaleRange.step * 3) / 4;
|
|
63120
|
-
}
|
|
63121
|
-
const defaultViewStep = getViewConfigDiscreteStep(config.view, vgSizeChannel);
|
|
63122
|
-
return (defaultViewStep * 3) / 4;
|
|
63123
|
-
}
|
|
63124
|
-
}
|
|
63125
63139
|
|
|
63126
63140
|
const markCompiler = {
|
|
63127
63141
|
arc,
|
|
@@ -63954,7 +63968,8 @@ const vegaLiteImport = /*#__PURE__*/Object.freeze({
|
|
|
63954
63968
|
normalizeAngle: normalizeAngle,
|
|
63955
63969
|
isNumeric: isNumeric,
|
|
63956
63970
|
deepEqual: deepEqual,
|
|
63957
|
-
stringify: stringify$1
|
|
63971
|
+
stringify: stringify$1,
|
|
63972
|
+
hasProperty: hasProperty
|
|
63958
63973
|
});
|
|
63959
63974
|
|
|
63960
63975
|
function e(e){const[n,r]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return {library:n,version:r}}
|
|
@@ -65269,657 +65284,39 @@ function getDefaultExportFromCjs (x) {
|
|
|
65269
65284
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
65270
65285
|
}
|
|
65271
65286
|
|
|
65272
|
-
var iterator;
|
|
65273
|
-
var hasRequiredIterator;
|
|
65274
|
-
function requireIterator() {
|
|
65275
|
-
if (hasRequiredIterator) return iterator;
|
|
65276
|
-
hasRequiredIterator = 1;
|
|
65277
|
-
iterator = function (Yallist) {
|
|
65278
|
-
Yallist.prototype[Symbol.iterator] = function* () {
|
|
65279
|
-
for (let walker = this.head; walker; walker = walker.next) {
|
|
65280
|
-
yield walker.value;
|
|
65281
|
-
}
|
|
65282
|
-
};
|
|
65283
|
-
};
|
|
65284
|
-
return iterator;
|
|
65285
|
-
}
|
|
65286
|
-
|
|
65287
|
-
var yallist = Yallist$1;
|
|
65288
|
-
Yallist$1.Node = Node;
|
|
65289
|
-
Yallist$1.create = Yallist$1;
|
|
65290
|
-
function Yallist$1(list) {
|
|
65291
|
-
var self = this;
|
|
65292
|
-
if (!(self instanceof Yallist$1)) {
|
|
65293
|
-
self = new Yallist$1();
|
|
65294
|
-
}
|
|
65295
|
-
self.tail = null;
|
|
65296
|
-
self.head = null;
|
|
65297
|
-
self.length = 0;
|
|
65298
|
-
if (list && typeof list.forEach === 'function') {
|
|
65299
|
-
list.forEach(function (item) {
|
|
65300
|
-
self.push(item);
|
|
65301
|
-
});
|
|
65302
|
-
} else if (arguments.length > 0) {
|
|
65303
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65304
|
-
self.push(arguments[i]);
|
|
65305
|
-
}
|
|
65306
|
-
}
|
|
65307
|
-
return self;
|
|
65308
|
-
}
|
|
65309
|
-
Yallist$1.prototype.removeNode = function (node) {
|
|
65310
|
-
if (node.list !== this) {
|
|
65311
|
-
throw new Error('removing node which does not belong to this list');
|
|
65312
|
-
}
|
|
65313
|
-
var next = node.next;
|
|
65314
|
-
var prev = node.prev;
|
|
65315
|
-
if (next) {
|
|
65316
|
-
next.prev = prev;
|
|
65317
|
-
}
|
|
65318
|
-
if (prev) {
|
|
65319
|
-
prev.next = next;
|
|
65320
|
-
}
|
|
65321
|
-
if (node === this.head) {
|
|
65322
|
-
this.head = next;
|
|
65323
|
-
}
|
|
65324
|
-
if (node === this.tail) {
|
|
65325
|
-
this.tail = prev;
|
|
65326
|
-
}
|
|
65327
|
-
node.list.length--;
|
|
65328
|
-
node.next = null;
|
|
65329
|
-
node.prev = null;
|
|
65330
|
-
node.list = null;
|
|
65331
|
-
return next;
|
|
65332
|
-
};
|
|
65333
|
-
Yallist$1.prototype.unshiftNode = function (node) {
|
|
65334
|
-
if (node === this.head) {
|
|
65335
|
-
return;
|
|
65336
|
-
}
|
|
65337
|
-
if (node.list) {
|
|
65338
|
-
node.list.removeNode(node);
|
|
65339
|
-
}
|
|
65340
|
-
var head = this.head;
|
|
65341
|
-
node.list = this;
|
|
65342
|
-
node.next = head;
|
|
65343
|
-
if (head) {
|
|
65344
|
-
head.prev = node;
|
|
65345
|
-
}
|
|
65346
|
-
this.head = node;
|
|
65347
|
-
if (!this.tail) {
|
|
65348
|
-
this.tail = node;
|
|
65349
|
-
}
|
|
65350
|
-
this.length++;
|
|
65351
|
-
};
|
|
65352
|
-
Yallist$1.prototype.pushNode = function (node) {
|
|
65353
|
-
if (node === this.tail) {
|
|
65354
|
-
return;
|
|
65355
|
-
}
|
|
65356
|
-
if (node.list) {
|
|
65357
|
-
node.list.removeNode(node);
|
|
65358
|
-
}
|
|
65359
|
-
var tail = this.tail;
|
|
65360
|
-
node.list = this;
|
|
65361
|
-
node.prev = tail;
|
|
65362
|
-
if (tail) {
|
|
65363
|
-
tail.next = node;
|
|
65364
|
-
}
|
|
65365
|
-
this.tail = node;
|
|
65366
|
-
if (!this.head) {
|
|
65367
|
-
this.head = node;
|
|
65368
|
-
}
|
|
65369
|
-
this.length++;
|
|
65370
|
-
};
|
|
65371
|
-
Yallist$1.prototype.push = function () {
|
|
65372
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65373
|
-
push(this, arguments[i]);
|
|
65374
|
-
}
|
|
65375
|
-
return this.length;
|
|
65376
|
-
};
|
|
65377
|
-
Yallist$1.prototype.unshift = function () {
|
|
65378
|
-
for (var i = 0, l = arguments.length; i < l; i++) {
|
|
65379
|
-
unshift(this, arguments[i]);
|
|
65380
|
-
}
|
|
65381
|
-
return this.length;
|
|
65382
|
-
};
|
|
65383
|
-
Yallist$1.prototype.pop = function () {
|
|
65384
|
-
if (!this.tail) {
|
|
65385
|
-
return undefined;
|
|
65386
|
-
}
|
|
65387
|
-
var res = this.tail.value;
|
|
65388
|
-
this.tail = this.tail.prev;
|
|
65389
|
-
if (this.tail) {
|
|
65390
|
-
this.tail.next = null;
|
|
65391
|
-
} else {
|
|
65392
|
-
this.head = null;
|
|
65393
|
-
}
|
|
65394
|
-
this.length--;
|
|
65395
|
-
return res;
|
|
65396
|
-
};
|
|
65397
|
-
Yallist$1.prototype.shift = function () {
|
|
65398
|
-
if (!this.head) {
|
|
65399
|
-
return undefined;
|
|
65400
|
-
}
|
|
65401
|
-
var res = this.head.value;
|
|
65402
|
-
this.head = this.head.next;
|
|
65403
|
-
if (this.head) {
|
|
65404
|
-
this.head.prev = null;
|
|
65405
|
-
} else {
|
|
65406
|
-
this.tail = null;
|
|
65407
|
-
}
|
|
65408
|
-
this.length--;
|
|
65409
|
-
return res;
|
|
65410
|
-
};
|
|
65411
|
-
Yallist$1.prototype.forEach = function (fn, thisp) {
|
|
65412
|
-
thisp = thisp || this;
|
|
65413
|
-
for (var walker = this.head, i = 0; walker !== null; i++) {
|
|
65414
|
-
fn.call(thisp, walker.value, i, this);
|
|
65415
|
-
walker = walker.next;
|
|
65416
|
-
}
|
|
65417
|
-
};
|
|
65418
|
-
Yallist$1.prototype.forEachReverse = function (fn, thisp) {
|
|
65419
|
-
thisp = thisp || this;
|
|
65420
|
-
for (var walker = this.tail, i = this.length - 1; walker !== null; i--) {
|
|
65421
|
-
fn.call(thisp, walker.value, i, this);
|
|
65422
|
-
walker = walker.prev;
|
|
65423
|
-
}
|
|
65424
|
-
};
|
|
65425
|
-
Yallist$1.prototype.get = function (n) {
|
|
65426
|
-
for (var i = 0, walker = this.head; walker !== null && i < n; i++) {
|
|
65427
|
-
// abort out of the list early if we hit a cycle
|
|
65428
|
-
walker = walker.next;
|
|
65429
|
-
}
|
|
65430
|
-
if (i === n && walker !== null) {
|
|
65431
|
-
return walker.value;
|
|
65432
|
-
}
|
|
65433
|
-
};
|
|
65434
|
-
Yallist$1.prototype.getReverse = function (n) {
|
|
65435
|
-
for (var i = 0, walker = this.tail; walker !== null && i < n; i++) {
|
|
65436
|
-
// abort out of the list early if we hit a cycle
|
|
65437
|
-
walker = walker.prev;
|
|
65438
|
-
}
|
|
65439
|
-
if (i === n && walker !== null) {
|
|
65440
|
-
return walker.value;
|
|
65441
|
-
}
|
|
65442
|
-
};
|
|
65443
|
-
Yallist$1.prototype.map = function (fn, thisp) {
|
|
65444
|
-
thisp = thisp || this;
|
|
65445
|
-
var res = new Yallist$1();
|
|
65446
|
-
for (var walker = this.head; walker !== null;) {
|
|
65447
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
65448
|
-
walker = walker.next;
|
|
65449
|
-
}
|
|
65450
|
-
return res;
|
|
65451
|
-
};
|
|
65452
|
-
Yallist$1.prototype.mapReverse = function (fn, thisp) {
|
|
65453
|
-
thisp = thisp || this;
|
|
65454
|
-
var res = new Yallist$1();
|
|
65455
|
-
for (var walker = this.tail; walker !== null;) {
|
|
65456
|
-
res.push(fn.call(thisp, walker.value, this));
|
|
65457
|
-
walker = walker.prev;
|
|
65458
|
-
}
|
|
65459
|
-
return res;
|
|
65460
|
-
};
|
|
65461
|
-
Yallist$1.prototype.reduce = function (fn, initial) {
|
|
65462
|
-
var acc;
|
|
65463
|
-
var walker = this.head;
|
|
65464
|
-
if (arguments.length > 1) {
|
|
65465
|
-
acc = initial;
|
|
65466
|
-
} else if (this.head) {
|
|
65467
|
-
walker = this.head.next;
|
|
65468
|
-
acc = this.head.value;
|
|
65469
|
-
} else {
|
|
65470
|
-
throw new TypeError('Reduce of empty list with no initial value');
|
|
65471
|
-
}
|
|
65472
|
-
for (var i = 0; walker !== null; i++) {
|
|
65473
|
-
acc = fn(acc, walker.value, i);
|
|
65474
|
-
walker = walker.next;
|
|
65475
|
-
}
|
|
65476
|
-
return acc;
|
|
65477
|
-
};
|
|
65478
|
-
Yallist$1.prototype.reduceReverse = function (fn, initial) {
|
|
65479
|
-
var acc;
|
|
65480
|
-
var walker = this.tail;
|
|
65481
|
-
if (arguments.length > 1) {
|
|
65482
|
-
acc = initial;
|
|
65483
|
-
} else if (this.tail) {
|
|
65484
|
-
walker = this.tail.prev;
|
|
65485
|
-
acc = this.tail.value;
|
|
65486
|
-
} else {
|
|
65487
|
-
throw new TypeError('Reduce of empty list with no initial value');
|
|
65488
|
-
}
|
|
65489
|
-
for (var i = this.length - 1; walker !== null; i--) {
|
|
65490
|
-
acc = fn(acc, walker.value, i);
|
|
65491
|
-
walker = walker.prev;
|
|
65492
|
-
}
|
|
65493
|
-
return acc;
|
|
65494
|
-
};
|
|
65495
|
-
Yallist$1.prototype.toArray = function () {
|
|
65496
|
-
var arr = new Array(this.length);
|
|
65497
|
-
for (var i = 0, walker = this.head; walker !== null; i++) {
|
|
65498
|
-
arr[i] = walker.value;
|
|
65499
|
-
walker = walker.next;
|
|
65500
|
-
}
|
|
65501
|
-
return arr;
|
|
65502
|
-
};
|
|
65503
|
-
Yallist$1.prototype.toArrayReverse = function () {
|
|
65504
|
-
var arr = new Array(this.length);
|
|
65505
|
-
for (var i = 0, walker = this.tail; walker !== null; i++) {
|
|
65506
|
-
arr[i] = walker.value;
|
|
65507
|
-
walker = walker.prev;
|
|
65508
|
-
}
|
|
65509
|
-
return arr;
|
|
65510
|
-
};
|
|
65511
|
-
Yallist$1.prototype.slice = function (from, to) {
|
|
65512
|
-
to = to || this.length;
|
|
65513
|
-
if (to < 0) {
|
|
65514
|
-
to += this.length;
|
|
65515
|
-
}
|
|
65516
|
-
from = from || 0;
|
|
65517
|
-
if (from < 0) {
|
|
65518
|
-
from += this.length;
|
|
65519
|
-
}
|
|
65520
|
-
var ret = new Yallist$1();
|
|
65521
|
-
if (to < from || to < 0) {
|
|
65522
|
-
return ret;
|
|
65523
|
-
}
|
|
65524
|
-
if (from < 0) {
|
|
65525
|
-
from = 0;
|
|
65526
|
-
}
|
|
65527
|
-
if (to > this.length) {
|
|
65528
|
-
to = this.length;
|
|
65529
|
-
}
|
|
65530
|
-
for (var i = 0, walker = this.head; walker !== null && i < from; i++) {
|
|
65531
|
-
walker = walker.next;
|
|
65532
|
-
}
|
|
65533
|
-
for (; walker !== null && i < to; i++, walker = walker.next) {
|
|
65534
|
-
ret.push(walker.value);
|
|
65535
|
-
}
|
|
65536
|
-
return ret;
|
|
65537
|
-
};
|
|
65538
|
-
Yallist$1.prototype.sliceReverse = function (from, to) {
|
|
65539
|
-
to = to || this.length;
|
|
65540
|
-
if (to < 0) {
|
|
65541
|
-
to += this.length;
|
|
65542
|
-
}
|
|
65543
|
-
from = from || 0;
|
|
65544
|
-
if (from < 0) {
|
|
65545
|
-
from += this.length;
|
|
65546
|
-
}
|
|
65547
|
-
var ret = new Yallist$1();
|
|
65548
|
-
if (to < from || to < 0) {
|
|
65549
|
-
return ret;
|
|
65550
|
-
}
|
|
65551
|
-
if (from < 0) {
|
|
65552
|
-
from = 0;
|
|
65553
|
-
}
|
|
65554
|
-
if (to > this.length) {
|
|
65555
|
-
to = this.length;
|
|
65556
|
-
}
|
|
65557
|
-
for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) {
|
|
65558
|
-
walker = walker.prev;
|
|
65559
|
-
}
|
|
65560
|
-
for (; walker !== null && i > from; i--, walker = walker.prev) {
|
|
65561
|
-
ret.push(walker.value);
|
|
65562
|
-
}
|
|
65563
|
-
return ret;
|
|
65564
|
-
};
|
|
65565
|
-
Yallist$1.prototype.splice = function (start, deleteCount, ...nodes) {
|
|
65566
|
-
if (start > this.length) {
|
|
65567
|
-
start = this.length - 1;
|
|
65568
|
-
}
|
|
65569
|
-
if (start < 0) {
|
|
65570
|
-
start = this.length + start;
|
|
65571
|
-
}
|
|
65572
|
-
for (var i = 0, walker = this.head; walker !== null && i < start; i++) {
|
|
65573
|
-
walker = walker.next;
|
|
65574
|
-
}
|
|
65575
|
-
var ret = [];
|
|
65576
|
-
for (var i = 0; walker && i < deleteCount; i++) {
|
|
65577
|
-
ret.push(walker.value);
|
|
65578
|
-
walker = this.removeNode(walker);
|
|
65579
|
-
}
|
|
65580
|
-
if (walker === null) {
|
|
65581
|
-
walker = this.tail;
|
|
65582
|
-
}
|
|
65583
|
-
if (walker !== this.head && walker !== this.tail) {
|
|
65584
|
-
walker = walker.prev;
|
|
65585
|
-
}
|
|
65586
|
-
for (var i = 0; i < nodes.length; i++) {
|
|
65587
|
-
walker = insert(this, walker, nodes[i]);
|
|
65588
|
-
}
|
|
65589
|
-
return ret;
|
|
65590
|
-
};
|
|
65591
|
-
Yallist$1.prototype.reverse = function () {
|
|
65592
|
-
var head = this.head;
|
|
65593
|
-
var tail = this.tail;
|
|
65594
|
-
for (var walker = head; walker !== null; walker = walker.prev) {
|
|
65595
|
-
var p = walker.prev;
|
|
65596
|
-
walker.prev = walker.next;
|
|
65597
|
-
walker.next = p;
|
|
65598
|
-
}
|
|
65599
|
-
this.head = tail;
|
|
65600
|
-
this.tail = head;
|
|
65601
|
-
return this;
|
|
65602
|
-
};
|
|
65603
|
-
function insert(self, node, value) {
|
|
65604
|
-
var inserted = node === self.head ? new Node(value, null, node, self) : new Node(value, node, node.next, self);
|
|
65605
|
-
if (inserted.next === null) {
|
|
65606
|
-
self.tail = inserted;
|
|
65607
|
-
}
|
|
65608
|
-
if (inserted.prev === null) {
|
|
65609
|
-
self.head = inserted;
|
|
65610
|
-
}
|
|
65611
|
-
self.length++;
|
|
65612
|
-
return inserted;
|
|
65613
|
-
}
|
|
65614
|
-
function push(self, item) {
|
|
65615
|
-
self.tail = new Node(item, self.tail, null, self);
|
|
65616
|
-
if (!self.head) {
|
|
65617
|
-
self.head = self.tail;
|
|
65618
|
-
}
|
|
65619
|
-
self.length++;
|
|
65620
|
-
}
|
|
65621
|
-
function unshift(self, item) {
|
|
65622
|
-
self.head = new Node(item, null, self.head, self);
|
|
65623
|
-
if (!self.tail) {
|
|
65624
|
-
self.tail = self.head;
|
|
65625
|
-
}
|
|
65626
|
-
self.length++;
|
|
65627
|
-
}
|
|
65628
|
-
function Node(value, prev, next, list) {
|
|
65629
|
-
if (!(this instanceof Node)) {
|
|
65630
|
-
return new Node(value, prev, next, list);
|
|
65631
|
-
}
|
|
65632
|
-
this.list = list;
|
|
65633
|
-
this.value = value;
|
|
65634
|
-
if (prev) {
|
|
65635
|
-
prev.next = this;
|
|
65636
|
-
this.prev = prev;
|
|
65637
|
-
} else {
|
|
65638
|
-
this.prev = null;
|
|
65639
|
-
}
|
|
65640
|
-
if (next) {
|
|
65641
|
-
next.prev = this;
|
|
65642
|
-
this.next = next;
|
|
65643
|
-
} else {
|
|
65644
|
-
this.next = null;
|
|
65645
|
-
}
|
|
65646
|
-
}
|
|
65647
|
-
try {
|
|
65648
|
-
// add if support for Symbol.iterator is present
|
|
65649
|
-
requireIterator()(Yallist$1);
|
|
65650
|
-
} catch (er) {}
|
|
65651
|
-
|
|
65652
|
-
// A linked list to keep track of recently-used-ness
|
|
65653
|
-
const Yallist = yallist;
|
|
65654
|
-
const MAX = Symbol('max');
|
|
65655
|
-
const LENGTH = Symbol('length');
|
|
65656
|
-
const LENGTH_CALCULATOR = Symbol('lengthCalculator');
|
|
65657
|
-
const ALLOW_STALE = Symbol('allowStale');
|
|
65658
|
-
const MAX_AGE = Symbol('maxAge');
|
|
65659
|
-
const DISPOSE = Symbol('dispose');
|
|
65660
|
-
const NO_DISPOSE_ON_SET = Symbol('noDisposeOnSet');
|
|
65661
|
-
const LRU_LIST = Symbol('lruList');
|
|
65662
|
-
const CACHE = Symbol('cache');
|
|
65663
|
-
const UPDATE_AGE_ON_GET = Symbol('updateAgeOnGet');
|
|
65664
|
-
const naiveLength = () => 1;
|
|
65665
|
-
|
|
65666
|
-
// lruList is a yallist where the head is the youngest
|
|
65667
|
-
// item, and the tail is the oldest. the list contains the Hit
|
|
65668
|
-
// objects as the entries.
|
|
65669
|
-
// Each Hit object has a reference to its Yallist.Node. This
|
|
65670
|
-
// never changes.
|
|
65671
|
-
//
|
|
65672
|
-
// cache is a Map (or PseudoMap) that matches the keys to
|
|
65673
|
-
// the Yallist.Node object.
|
|
65674
65287
|
class LRUCache {
|
|
65675
|
-
constructor(
|
|
65676
|
-
|
|
65677
|
-
|
|
65678
|
-
};
|
|
65679
|
-
if (!options) options = {};
|
|
65680
|
-
if (options.max && (typeof options.max !== 'number' || options.max < 0)) throw new TypeError('max must be a non-negative number');
|
|
65681
|
-
// Kind of weird to have a default max of Infinity, but oh well.
|
|
65682
|
-
this[MAX] = options.max || Infinity;
|
|
65683
|
-
const lc = options.length || naiveLength;
|
|
65684
|
-
this[LENGTH_CALCULATOR] = typeof lc !== 'function' ? naiveLength : lc;
|
|
65685
|
-
this[ALLOW_STALE] = options.stale || false;
|
|
65686
|
-
if (options.maxAge && typeof options.maxAge !== 'number') throw new TypeError('maxAge must be a number');
|
|
65687
|
-
this[MAX_AGE] = options.maxAge || 0;
|
|
65688
|
-
this[DISPOSE] = options.dispose;
|
|
65689
|
-
this[NO_DISPOSE_ON_SET] = options.noDisposeOnSet || false;
|
|
65690
|
-
this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
|
|
65691
|
-
this.reset();
|
|
65692
|
-
}
|
|
65693
|
-
|
|
65694
|
-
// resize the cache when the max changes.
|
|
65695
|
-
set max(mL) {
|
|
65696
|
-
if (typeof mL !== 'number' || mL < 0) throw new TypeError('max must be a non-negative number');
|
|
65697
|
-
this[MAX] = mL || Infinity;
|
|
65698
|
-
trim(this);
|
|
65699
|
-
}
|
|
65700
|
-
get max() {
|
|
65701
|
-
return this[MAX];
|
|
65702
|
-
}
|
|
65703
|
-
set allowStale(allowStale) {
|
|
65704
|
-
this[ALLOW_STALE] = !!allowStale;
|
|
65705
|
-
}
|
|
65706
|
-
get allowStale() {
|
|
65707
|
-
return this[ALLOW_STALE];
|
|
65708
|
-
}
|
|
65709
|
-
set maxAge(mA) {
|
|
65710
|
-
if (typeof mA !== 'number') throw new TypeError('maxAge must be a non-negative number');
|
|
65711
|
-
this[MAX_AGE] = mA;
|
|
65712
|
-
trim(this);
|
|
65713
|
-
}
|
|
65714
|
-
get maxAge() {
|
|
65715
|
-
return this[MAX_AGE];
|
|
65716
|
-
}
|
|
65717
|
-
|
|
65718
|
-
// resize the cache when the lengthCalculator changes.
|
|
65719
|
-
set lengthCalculator(lC) {
|
|
65720
|
-
if (typeof lC !== 'function') lC = naiveLength;
|
|
65721
|
-
if (lC !== this[LENGTH_CALCULATOR]) {
|
|
65722
|
-
this[LENGTH_CALCULATOR] = lC;
|
|
65723
|
-
this[LENGTH] = 0;
|
|
65724
|
-
this[LRU_LIST].forEach(hit => {
|
|
65725
|
-
hit.length = this[LENGTH_CALCULATOR](hit.value, hit.key);
|
|
65726
|
-
this[LENGTH] += hit.length;
|
|
65727
|
-
});
|
|
65728
|
-
}
|
|
65729
|
-
trim(this);
|
|
65730
|
-
}
|
|
65731
|
-
get lengthCalculator() {
|
|
65732
|
-
return this[LENGTH_CALCULATOR];
|
|
65733
|
-
}
|
|
65734
|
-
get length() {
|
|
65735
|
-
return this[LENGTH];
|
|
65736
|
-
}
|
|
65737
|
-
get itemCount() {
|
|
65738
|
-
return this[LRU_LIST].length;
|
|
65739
|
-
}
|
|
65740
|
-
rforEach(fn, thisp) {
|
|
65741
|
-
thisp = thisp || this;
|
|
65742
|
-
for (let walker = this[LRU_LIST].tail; walker !== null;) {
|
|
65743
|
-
const prev = walker.prev;
|
|
65744
|
-
forEachStep(this, fn, walker, thisp);
|
|
65745
|
-
walker = prev;
|
|
65746
|
-
}
|
|
65747
|
-
}
|
|
65748
|
-
forEach(fn, thisp) {
|
|
65749
|
-
thisp = thisp || this;
|
|
65750
|
-
for (let walker = this[LRU_LIST].head; walker !== null;) {
|
|
65751
|
-
const next = walker.next;
|
|
65752
|
-
forEachStep(this, fn, walker, thisp);
|
|
65753
|
-
walker = next;
|
|
65754
|
-
}
|
|
65755
|
-
}
|
|
65756
|
-
keys() {
|
|
65757
|
-
return this[LRU_LIST].toArray().map(k => k.key);
|
|
65758
|
-
}
|
|
65759
|
-
values() {
|
|
65760
|
-
return this[LRU_LIST].toArray().map(k => k.value);
|
|
65761
|
-
}
|
|
65762
|
-
reset() {
|
|
65763
|
-
if (this[DISPOSE] && this[LRU_LIST] && this[LRU_LIST].length) {
|
|
65764
|
-
this[LRU_LIST].forEach(hit => this[DISPOSE](hit.key, hit.value));
|
|
65765
|
-
}
|
|
65766
|
-
this[CACHE] = new Map(); // hash of items by key
|
|
65767
|
-
this[LRU_LIST] = new Yallist(); // list of items in order of use recency
|
|
65768
|
-
this[LENGTH] = 0; // length of items in the list
|
|
65769
|
-
}
|
|
65770
|
-
dump() {
|
|
65771
|
-
return this[LRU_LIST].map(hit => isStale(this, hit) ? false : {
|
|
65772
|
-
k: hit.key,
|
|
65773
|
-
v: hit.value,
|
|
65774
|
-
e: hit.now + (hit.maxAge || 0)
|
|
65775
|
-
}).toArray().filter(h => h);
|
|
65776
|
-
}
|
|
65777
|
-
dumpLru() {
|
|
65778
|
-
return this[LRU_LIST];
|
|
65779
|
-
}
|
|
65780
|
-
set(key, value, maxAge) {
|
|
65781
|
-
maxAge = maxAge || this[MAX_AGE];
|
|
65782
|
-
if (maxAge && typeof maxAge !== 'number') throw new TypeError('maxAge must be a number');
|
|
65783
|
-
const now = maxAge ? Date.now() : 0;
|
|
65784
|
-
const len = this[LENGTH_CALCULATOR](value, key);
|
|
65785
|
-
if (this[CACHE].has(key)) {
|
|
65786
|
-
if (len > this[MAX]) {
|
|
65787
|
-
del(this, this[CACHE].get(key));
|
|
65788
|
-
return false;
|
|
65789
|
-
}
|
|
65790
|
-
const node = this[CACHE].get(key);
|
|
65791
|
-
const item = node.value;
|
|
65792
|
-
|
|
65793
|
-
// dispose of the old one before overwriting
|
|
65794
|
-
// split out into 2 ifs for better coverage tracking
|
|
65795
|
-
if (this[DISPOSE]) {
|
|
65796
|
-
if (!this[NO_DISPOSE_ON_SET]) this[DISPOSE](key, item.value);
|
|
65797
|
-
}
|
|
65798
|
-
item.now = now;
|
|
65799
|
-
item.maxAge = maxAge;
|
|
65800
|
-
item.value = value;
|
|
65801
|
-
this[LENGTH] += len - item.length;
|
|
65802
|
-
item.length = len;
|
|
65803
|
-
this.get(key);
|
|
65804
|
-
trim(this);
|
|
65805
|
-
return true;
|
|
65806
|
-
}
|
|
65807
|
-
const hit = new Entry(key, value, len, now, maxAge);
|
|
65808
|
-
|
|
65809
|
-
// oversized objects fall out of cache automatically.
|
|
65810
|
-
if (hit.length > this[MAX]) {
|
|
65811
|
-
if (this[DISPOSE]) this[DISPOSE](key, value);
|
|
65812
|
-
return false;
|
|
65813
|
-
}
|
|
65814
|
-
this[LENGTH] += hit.length;
|
|
65815
|
-
this[LRU_LIST].unshift(hit);
|
|
65816
|
-
this[CACHE].set(key, this[LRU_LIST].head);
|
|
65817
|
-
trim(this);
|
|
65818
|
-
return true;
|
|
65819
|
-
}
|
|
65820
|
-
has(key) {
|
|
65821
|
-
if (!this[CACHE].has(key)) return false;
|
|
65822
|
-
const hit = this[CACHE].get(key).value;
|
|
65823
|
-
return !isStale(this, hit);
|
|
65288
|
+
constructor() {
|
|
65289
|
+
this.max = 1000;
|
|
65290
|
+
this.map = new Map();
|
|
65824
65291
|
}
|
|
65825
65292
|
get(key) {
|
|
65826
|
-
|
|
65827
|
-
|
|
65828
|
-
|
|
65829
|
-
|
|
65830
|
-
|
|
65831
|
-
|
|
65832
|
-
|
|
65833
|
-
|
|
65834
|
-
del(this, node);
|
|
65835
|
-
return node.value;
|
|
65836
|
-
}
|
|
65837
|
-
del(key) {
|
|
65838
|
-
del(this, this[CACHE].get(key));
|
|
65839
|
-
}
|
|
65840
|
-
load(arr) {
|
|
65841
|
-
// reset the cache
|
|
65842
|
-
this.reset();
|
|
65843
|
-
const now = Date.now();
|
|
65844
|
-
// A previous serialized cache has the most recent items first
|
|
65845
|
-
for (let l = arr.length - 1; l >= 0; l--) {
|
|
65846
|
-
const hit = arr[l];
|
|
65847
|
-
const expiresAt = hit.e || 0;
|
|
65848
|
-
if (expiresAt === 0)
|
|
65849
|
-
// the item was created without expiration in a non aged cache
|
|
65850
|
-
this.set(hit.k, hit.v);else {
|
|
65851
|
-
const maxAge = expiresAt - now;
|
|
65852
|
-
// dont add already expired items
|
|
65853
|
-
if (maxAge > 0) {
|
|
65854
|
-
this.set(hit.k, hit.v, maxAge);
|
|
65855
|
-
}
|
|
65856
|
-
}
|
|
65293
|
+
const value = this.map.get(key);
|
|
65294
|
+
if (value === undefined) {
|
|
65295
|
+
return undefined;
|
|
65296
|
+
} else {
|
|
65297
|
+
// Remove the key from the map and add it to the end
|
|
65298
|
+
this.map.delete(key);
|
|
65299
|
+
this.map.set(key, value);
|
|
65300
|
+
return value;
|
|
65857
65301
|
}
|
|
65858
65302
|
}
|
|
65859
|
-
|
|
65860
|
-
this
|
|
65303
|
+
delete(key) {
|
|
65304
|
+
return this.map.delete(key);
|
|
65861
65305
|
}
|
|
65862
|
-
|
|
65863
|
-
const
|
|
65864
|
-
|
|
65865
|
-
|
|
65866
|
-
|
|
65867
|
-
|
|
65868
|
-
|
|
65869
|
-
if (!self[ALLOW_STALE]) return undefined;
|
|
65870
|
-
} else {
|
|
65871
|
-
if (doUse) {
|
|
65872
|
-
if (self[UPDATE_AGE_ON_GET]) node.value.now = Date.now();
|
|
65873
|
-
self[LRU_LIST].unshiftNode(node);
|
|
65306
|
+
set(key, value) {
|
|
65307
|
+
const deleted = this.delete(key);
|
|
65308
|
+
if (!deleted && value !== undefined) {
|
|
65309
|
+
// If cache is full, delete the least recently used item
|
|
65310
|
+
if (this.map.size >= this.max) {
|
|
65311
|
+
const firstKey = this.map.keys().next().value;
|
|
65312
|
+
this.delete(firstKey);
|
|
65874
65313
|
}
|
|
65314
|
+
this.map.set(key, value);
|
|
65875
65315
|
}
|
|
65876
|
-
return
|
|
65877
|
-
}
|
|
65878
|
-
};
|
|
65879
|
-
const isStale = (self, hit) => {
|
|
65880
|
-
if (!hit || !hit.maxAge && !self[MAX_AGE]) return false;
|
|
65881
|
-
const diff = Date.now() - hit.now;
|
|
65882
|
-
return hit.maxAge ? diff > hit.maxAge : self[MAX_AGE] && diff > self[MAX_AGE];
|
|
65883
|
-
};
|
|
65884
|
-
const trim = self => {
|
|
65885
|
-
if (self[LENGTH] > self[MAX]) {
|
|
65886
|
-
for (let walker = self[LRU_LIST].tail; self[LENGTH] > self[MAX] && walker !== null;) {
|
|
65887
|
-
// We know that we're about to delete this one, and also
|
|
65888
|
-
// what the next least recently used key will be, so just
|
|
65889
|
-
// go ahead and set it now.
|
|
65890
|
-
const prev = walker.prev;
|
|
65891
|
-
del(self, walker);
|
|
65892
|
-
walker = prev;
|
|
65893
|
-
}
|
|
65894
|
-
}
|
|
65895
|
-
};
|
|
65896
|
-
const del = (self, node) => {
|
|
65897
|
-
if (node) {
|
|
65898
|
-
const hit = node.value;
|
|
65899
|
-
if (self[DISPOSE]) self[DISPOSE](hit.key, hit.value);
|
|
65900
|
-
self[LENGTH] -= hit.length;
|
|
65901
|
-
self[CACHE].delete(hit.key);
|
|
65902
|
-
self[LRU_LIST].removeNode(node);
|
|
65316
|
+
return this;
|
|
65903
65317
|
}
|
|
65904
|
-
}
|
|
65905
|
-
|
|
65906
|
-
constructor(key, value, length, now, maxAge) {
|
|
65907
|
-
this.key = key;
|
|
65908
|
-
this.value = value;
|
|
65909
|
-
this.length = length;
|
|
65910
|
-
this.now = now;
|
|
65911
|
-
this.maxAge = maxAge || 0;
|
|
65912
|
-
}
|
|
65913
|
-
}
|
|
65914
|
-
const forEachStep = (self, fn, node, thisp) => {
|
|
65915
|
-
let hit = node.value;
|
|
65916
|
-
if (isStale(self, hit)) {
|
|
65917
|
-
del(self, node);
|
|
65918
|
-
if (!self[ALLOW_STALE]) hit = undefined;
|
|
65919
|
-
}
|
|
65920
|
-
if (hit) fn.call(thisp, hit.value, hit.key, self);
|
|
65921
|
-
};
|
|
65922
|
-
var lruCache = LRUCache;
|
|
65318
|
+
}
|
|
65319
|
+
var lrucache = LRUCache;
|
|
65923
65320
|
|
|
65924
65321
|
// parse out just the options we care about
|
|
65925
65322
|
const looseOption = Object.freeze({
|
|
@@ -66283,7 +65680,7 @@ let SemVer$1 = class SemVer {
|
|
|
66283
65680
|
do {
|
|
66284
65681
|
const a = this.build[i];
|
|
66285
65682
|
const b = other.build[i];
|
|
66286
|
-
debug('
|
|
65683
|
+
debug('build compare', i, a, b);
|
|
66287
65684
|
if (a === undefined && b === undefined) {
|
|
66288
65685
|
return 0;
|
|
66289
65686
|
} else if (b === undefined) {
|
|
@@ -66785,10 +66182,8 @@ function requireRange() {
|
|
|
66785
66182
|
}
|
|
66786
66183
|
}
|
|
66787
66184
|
range = Range;
|
|
66788
|
-
const LRU =
|
|
66789
|
-
const cache = new LRU(
|
|
66790
|
-
max: 1000
|
|
66791
|
-
});
|
|
66185
|
+
const LRU = lrucache;
|
|
66186
|
+
const cache = new LRU();
|
|
66792
66187
|
const parseOptions = parseOptions_1;
|
|
66793
66188
|
const Comparator = requireComparator();
|
|
66794
66189
|
const debug = debug_1;
|
|
@@ -67016,7 +66411,8 @@ function requireRange() {
|
|
|
67016
66411
|
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
|
|
67017
66412
|
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
|
|
67018
66413
|
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
|
|
67019
|
-
|
|
66414
|
+
// TODO build?
|
|
66415
|
+
const hyphenReplace = incPr => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
67020
66416
|
if (isX(fM)) {
|
|
67021
66417
|
from = '';
|
|
67022
66418
|
} else if (isX(fm)) {
|
|
@@ -67633,9 +67029,9 @@ async function _embed(el, spec, opts = {}, loader) {
|
|
|
67633
67029
|
editorLink.addEventListener('click', function (e) {
|
|
67634
67030
|
post(window, editorUrl, {
|
|
67635
67031
|
config: config,
|
|
67636
|
-
mode,
|
|
67032
|
+
mode: patch ? 'vega' : mode,
|
|
67637
67033
|
renderer,
|
|
67638
|
-
spec: jsonStringifyPrettyCompact(spec)
|
|
67034
|
+
spec: jsonStringifyPrettyCompact(patch ? vgSpec : spec)
|
|
67639
67035
|
});
|
|
67640
67036
|
e.preventDefault();
|
|
67641
67037
|
});
|