@genome-spy/core 0.53.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle/{_commonjsHelpers-BIiJCwQW.js → _commonjsHelpers-DSebQMb9.js} +2 -4
- package/dist/bundle/{index-B5cesONJ.js → index-B6haPltu.js} +33 -65
- package/dist/bundle/{index-uO0O4Uv-.js → index-BhtH2nrr.js} +3 -5
- package/dist/bundle/{index-_tI-fMQF.js → index-BpoXW6_f.js} +5 -6
- package/dist/bundle/{index-BywMLhhd.js → index-COovE1Oo.js} +75 -105
- package/dist/bundle/{index-BJLu48Hz.js → index-CjesiOz_.js} +2 -2
- package/dist/bundle/{index-oqw_s02W.js → index-HGQZ77IK.js} +2 -2
- package/dist/bundle/{index-DAJ8JQLE.js → index-WACuLhO6.js} +64 -119
- package/dist/bundle/{index-e0oKgZbZ.js → index-_ftu0t0z.js} +2 -3
- package/dist/bundle/{index-CSayoXbw.js → index-nCZhu2o-.js} +3 -3
- package/dist/bundle/index.es.js +4378 -4412
- package/dist/bundle/index.js +98 -98
- package/dist/bundle/{long-D4tVjLLz.js → long-BXK3UEks.js} +9 -16
- package/dist/bundle/{remoteFile-BkTxwFub.js → remoteFile-DuIsnepi.js} +1 -1
- package/dist/schema.json +36 -2
- package/dist/src/data/transforms/aggregate.d.ts +10 -7
- package/dist/src/data/transforms/aggregate.d.ts.map +1 -1
- package/dist/src/data/transforms/aggregate.js +63 -21
- package/dist/src/data/transforms/aggregate.test.d.ts +2 -0
- package/dist/src/data/transforms/aggregate.test.d.ts.map +1 -0
- package/dist/src/data/transforms/aggregate.test.js +134 -0
- package/dist/src/data/transforms/aggregateOps.d.ts +6 -0
- package/dist/src/data/transforms/aggregateOps.d.ts.map +1 -0
- package/dist/src/data/transforms/aggregateOps.js +17 -0
- package/dist/src/img/genomespy-favicon.svg +1 -34
- package/dist/src/spec/title.d.ts +1 -1
- package/dist/src/spec/transform.d.ts +32 -2
- package/dist/src/view/gridView.d.ts.map +1 -1
- package/dist/src/view/gridView.js +7 -3
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as Pi } from "./index-
|
|
2
|
-
import { g as Da } from "./_commonjsHelpers-
|
|
1
|
+
import { b as Pi } from "./index-B6haPltu.js";
|
|
2
|
+
import { g as Da } from "./_commonjsHelpers-DSebQMb9.js";
|
|
3
3
|
var re = {};
|
|
4
4
|
(function(e) {
|
|
5
5
|
var i = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
|
|
@@ -248,8 +248,7 @@ function ti(e, i, t) {
|
|
|
248
248
|
do
|
|
249
249
|
ee(e, n, e.bl_tree);
|
|
250
250
|
while (--f !== 0);
|
|
251
|
-
else
|
|
252
|
-
n !== 0 ? (n !== r && (ee(e, n, e.bl_tree), f--), ee(e, Xi, e.bl_tree), C(e, f - 3, 2)) : f <= 10 ? (ee(e, qi, e.bl_tree), C(e, f - 3, 3)) : (ee(e, Gi, e.bl_tree), C(e, f - 11, 7));
|
|
251
|
+
else n !== 0 ? (n !== r && (ee(e, n, e.bl_tree), f--), ee(e, Xi, e.bl_tree), C(e, f - 3, 2)) : f <= 10 ? (ee(e, qi, e.bl_tree), C(e, f - 3, 3)) : (ee(e, Gi, e.bl_tree), C(e, f - 11, 7));
|
|
253
252
|
f = 0, r = n, h === 0 ? (_ = 138, l = 3) : n === h ? (_ = 6, l = 3) : (_ = 7, l = 4);
|
|
254
253
|
}
|
|
255
254
|
}
|
|
@@ -726,8 +725,7 @@ function $n() {
|
|
|
726
725
|
}
|
|
727
726
|
var va = $n, Ce = ie, Ue = re, Dt = Ee, Rt = Kt, Mn = va, ga = Object.prototype.toString, Hn = 0, yt = 4, ze = 0, fi = 1, hi = 2, Pn = -1, Kn = 0, Yn = 8;
|
|
728
727
|
function be(e) {
|
|
729
|
-
if (!(this instanceof be))
|
|
730
|
-
return new be(e);
|
|
728
|
+
if (!(this instanceof be)) return new be(e);
|
|
731
729
|
this.options = Ue.assign({
|
|
732
730
|
level: Pn,
|
|
733
731
|
method: Yn,
|
|
@@ -1183,8 +1181,7 @@ function vr(e, i) {
|
|
|
1183
1181
|
f--, l += a[n++] << o, o += 8;
|
|
1184
1182
|
}
|
|
1185
1183
|
t.length = l, t.head && (t.head.extra_len = l), t.flags & 512 && (m[0] = l & 255, m[1] = l >>> 8 & 255, t.check = Q(t.check, m, 2, 0)), l = 0, o = 0;
|
|
1186
|
-
} else
|
|
1187
|
-
t.head && (t.head.extra = null);
|
|
1184
|
+
} else t.head && (t.head.extra = null);
|
|
1188
1185
|
t.mode = pi;
|
|
1189
1186
|
case pi:
|
|
1190
1187
|
if (t.flags & 1024 && (u = t.length, u > f && (u = f), u && (t.head && (y = t.head.extra_len - t.length, t.head.extra || (t.head.extra = new Array(t.head.extra_len)), M.arraySet(
|
|
@@ -1209,8 +1206,7 @@ function vr(e, i) {
|
|
|
1209
1206
|
while (y && u < f);
|
|
1210
1207
|
if (t.flags & 512 && (t.check = Q(t.check, a, u, n)), f -= u, n += u, y)
|
|
1211
1208
|
break e;
|
|
1212
|
-
} else
|
|
1213
|
-
t.head && (t.head.name = null);
|
|
1209
|
+
} else t.head && (t.head.name = null);
|
|
1214
1210
|
t.length = 0, t.mode = ki;
|
|
1215
1211
|
case ki:
|
|
1216
1212
|
if (t.flags & 4096) {
|
|
@@ -1222,8 +1218,7 @@ function vr(e, i) {
|
|
|
1222
1218
|
while (y && u < f);
|
|
1223
1219
|
if (t.flags & 512 && (t.check = Q(t.check, a, u, n)), f -= u, n += u, y)
|
|
1224
1220
|
break e;
|
|
1225
|
-
} else
|
|
1226
|
-
t.head && (t.head.comment = null);
|
|
1221
|
+
} else t.head && (t.head.comment = null);
|
|
1227
1222
|
t.mode = Ei;
|
|
1228
1223
|
case Ei:
|
|
1229
1224
|
if (t.flags & 512) {
|
|
@@ -1603,8 +1598,7 @@ function pr() {
|
|
|
1603
1598
|
}
|
|
1604
1599
|
var xr = pr, Ae = j, Me = re, _t = Ee, L = Na, Ct = Kt, kr = va, Er = xr, za = Object.prototype.toString;
|
|
1605
1600
|
function xe(e) {
|
|
1606
|
-
if (!(this instanceof xe))
|
|
1607
|
-
return new xe(e);
|
|
1601
|
+
if (!(this instanceof xe)) return new xe(e);
|
|
1608
1602
|
this.options = Me.assign({
|
|
1609
1603
|
chunkSize: 16384,
|
|
1610
1604
|
windowBits: 0,
|
|
@@ -2317,8 +2311,7 @@ s.shiftRightUnsigned = function(i) {
|
|
|
2317
2311
|
if (i < 32) {
|
|
2318
2312
|
var a = this.low;
|
|
2319
2313
|
return O(a >>> i | t << 32 - i, t >>> i, this.unsigned);
|
|
2320
|
-
} else
|
|
2321
|
-
return i === 32 ? O(t, 0, this.unsigned) : O(t >>> i - 32, 0, this.unsigned);
|
|
2314
|
+
} else return i === 32 ? O(t, 0, this.unsigned) : O(t >>> i - 32, 0, this.unsigned);
|
|
2322
2315
|
};
|
|
2323
2316
|
s.shru = s.shiftRightUnsigned;
|
|
2324
2317
|
s.shr_u = s.shiftRightUnsigned;
|
package/dist/schema.json
CHANGED
|
@@ -2,16 +2,50 @@
|
|
|
2
2
|
"$ref": "#/definitions/RootSpec",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"definitions": {
|
|
5
|
+
"AggregateOp": {
|
|
6
|
+
"enum": [
|
|
7
|
+
"count",
|
|
8
|
+
"valid",
|
|
9
|
+
"sum",
|
|
10
|
+
"min",
|
|
11
|
+
"max",
|
|
12
|
+
"mean",
|
|
13
|
+
"median",
|
|
14
|
+
"variance"
|
|
15
|
+
],
|
|
16
|
+
"type": "string"
|
|
17
|
+
},
|
|
5
18
|
"AggregateParams": {
|
|
6
19
|
"additionalProperties": false,
|
|
7
20
|
"properties": {
|
|
21
|
+
"as": {
|
|
22
|
+
"description": "The names for the output fields corresponding to each aggregated field. If not provided, names will be automatically created using the operation and field names (e.g., `sum_field`, `average_field`).",
|
|
23
|
+
"items": {
|
|
24
|
+
"type": "string"
|
|
25
|
+
},
|
|
26
|
+
"type": "array"
|
|
27
|
+
},
|
|
28
|
+
"fields": {
|
|
29
|
+
"description": "The data fields to apply aggregate functions to. This array should correspond with the `ops` and `as` arrays. If no fields or operations are specified, a count aggregation will be applied by default.",
|
|
30
|
+
"items": {
|
|
31
|
+
"$ref": "#/definitions/Field"
|
|
32
|
+
},
|
|
33
|
+
"type": "array"
|
|
34
|
+
},
|
|
8
35
|
"groupby": {
|
|
9
|
-
"description": "
|
|
36
|
+
"description": "The fields by which to group the data. If these are not defined, all data objects will be grouped into a single category.",
|
|
10
37
|
"items": {
|
|
11
38
|
"$ref": "#/definitions/Field"
|
|
12
39
|
},
|
|
13
40
|
"type": "array"
|
|
14
41
|
},
|
|
42
|
+
"ops": {
|
|
43
|
+
"description": "The aggregation operations to be performed on the fields, such as `\"sum\"`, `\"average\"`, or `\"count\"`.",
|
|
44
|
+
"items": {
|
|
45
|
+
"$ref": "#/definitions/AggregateOp"
|
|
46
|
+
},
|
|
47
|
+
"type": "array"
|
|
48
|
+
},
|
|
15
49
|
"type": {
|
|
16
50
|
"const": "aggregate",
|
|
17
51
|
"description": "The type of the transform to be applied",
|
|
@@ -8020,7 +8054,7 @@
|
|
|
8020
8054
|
},
|
|
8021
8055
|
"orient": {
|
|
8022
8056
|
"$ref": "#/definitions/TitleOrient",
|
|
8023
|
-
"description": "Default title orientation (`\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)"
|
|
8057
|
+
"description": "Default title orientation (`\"none\"`, `\"top\"`, `\"bottom\"`, `\"left\"`, or `\"right\"`)"
|
|
8024
8058
|
},
|
|
8025
8059
|
"style": {
|
|
8026
8060
|
"description": "A mark style property to apply to the title text mark. If not specified, a default style of `\"group-title\"` is applied.",
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A minimal aggregate transform that just counts grouped (by a single field) data items.
|
|
3
|
-
* Work in progress.
|
|
4
|
-
*
|
|
5
|
-
* Eventually this will implement the most of Vega's aggregate transform:
|
|
6
|
-
* https://vega.github.io/vega/docs/transforms/aggregate/
|
|
7
|
-
*/
|
|
8
1
|
export default class AggregateTransform extends FlowNode {
|
|
9
2
|
/**
|
|
10
3
|
* @param {import("../../spec/transform.js").AggregateParams} params
|
|
4
|
+
*
|
|
5
|
+
* @typedef {import("../flowNode.js").Datum} Datum
|
|
11
6
|
*/
|
|
12
7
|
constructor(params: import("../../spec/transform.js").AggregateParams);
|
|
13
8
|
params: import("../../spec/transform.js").AggregateParams;
|
|
14
9
|
/** @type {any[]} */
|
|
15
10
|
buffer: any[];
|
|
11
|
+
/**
|
|
12
|
+
* @type {((arr: Datum[]) => number)[]}
|
|
13
|
+
*/
|
|
14
|
+
ops: ((arr: import("../flowNode.js").Datum[]) => number)[];
|
|
15
|
+
/**
|
|
16
|
+
* @type {string[]}
|
|
17
|
+
*/
|
|
18
|
+
as: string[];
|
|
16
19
|
}
|
|
17
20
|
import FlowNode from "../flowNode.js";
|
|
18
21
|
//# sourceMappingURL=aggregate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"aggregate.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregate.js"],"names":[],"mappings":"AAMA;IAKI;;;;OAIG;IACH,oBAJW,OAAO,yBAAyB,EAAE,eAAe,EA6C3D;IAvCG,0DAAoB;IAEpB,oBAAoB;IACpB,QADW,GAAG,EAAE,CACA;IAEhB;;OAEG;IACH,iDAF6B,MAAM,IAEtB;IACb;;OAEG;IACH,IAFU,MAAM,EAAE,CAEN;CAiFnB;qBA9GyC,gBAAgB"}
|
|
@@ -2,14 +2,8 @@ import { group as d3group } from "d3-array";
|
|
|
2
2
|
import FlowNode, { BEHAVIOR_CLONES } from "../flowNode.js";
|
|
3
3
|
import { field } from "../../utils/field.js";
|
|
4
4
|
import iterateNestedMaps from "../../utils/iterateNestedMaps.js";
|
|
5
|
+
import AGGREGATE_OPS from "./aggregateOps.js";
|
|
5
6
|
|
|
6
|
-
/**
|
|
7
|
-
* A minimal aggregate transform that just counts grouped (by a single field) data items.
|
|
8
|
-
* Work in progress.
|
|
9
|
-
*
|
|
10
|
-
* Eventually this will implement the most of Vega's aggregate transform:
|
|
11
|
-
* https://vega.github.io/vega/docs/transforms/aggregate/
|
|
12
|
-
*/
|
|
13
7
|
export default class AggregateTransform extends FlowNode {
|
|
14
8
|
get behavior() {
|
|
15
9
|
return BEHAVIOR_CLONES;
|
|
@@ -17,6 +11,8 @@ export default class AggregateTransform extends FlowNode {
|
|
|
17
11
|
|
|
18
12
|
/**
|
|
19
13
|
* @param {import("../../spec/transform.js").AggregateParams} params
|
|
14
|
+
*
|
|
15
|
+
* @typedef {import("../flowNode.js").Datum} Datum
|
|
20
16
|
*/
|
|
21
17
|
constructor(params) {
|
|
22
18
|
super();
|
|
@@ -24,9 +20,45 @@ export default class AggregateTransform extends FlowNode {
|
|
|
24
20
|
|
|
25
21
|
/** @type {any[]} */
|
|
26
22
|
this.buffer = [];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @type {((arr: Datum[]) => number)[]}
|
|
26
|
+
*/
|
|
27
|
+
this.ops = [];
|
|
28
|
+
/**
|
|
29
|
+
* @type {string[]}
|
|
30
|
+
*/
|
|
31
|
+
this.as = [];
|
|
32
|
+
|
|
33
|
+
if (params.fields) {
|
|
34
|
+
if (params.fields.length != params.ops.length) {
|
|
35
|
+
throw new Error("Fields and ops must have the same length!");
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (params.as && params.as.length != params.ops.length) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
'If "as" is defined, "fields" and "as" must have the same length!'
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
params.fields.forEach((fieldName, i) => {
|
|
45
|
+
const accessor = field(fieldName);
|
|
46
|
+
const op = AGGREGATE_OPS[params.ops[i]];
|
|
47
|
+
this.ops.push((arr) => op(arr, accessor));
|
|
48
|
+
this.as.push(
|
|
49
|
+
params.as
|
|
50
|
+
? params.as[i]
|
|
51
|
+
: `${params.ops[i]}_${params.fields[i]}`
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
} else {
|
|
55
|
+
this.ops.push((arr) => AGGREGATE_OPS.count(arr));
|
|
56
|
+
this.as.push("count");
|
|
57
|
+
}
|
|
27
58
|
}
|
|
28
59
|
|
|
29
60
|
reset() {
|
|
61
|
+
super.reset();
|
|
30
62
|
this.buffer = [];
|
|
31
63
|
}
|
|
32
64
|
|
|
@@ -41,26 +73,36 @@ export default class AggregateTransform extends FlowNode {
|
|
|
41
73
|
complete() {
|
|
42
74
|
const params = this.params;
|
|
43
75
|
|
|
44
|
-
const groupby = params
|
|
76
|
+
const groupby = params?.groupby;
|
|
77
|
+
|
|
78
|
+
if (groupby?.length > 0) {
|
|
79
|
+
const groupFieldAccessors = groupby.map((f) => field(f));
|
|
45
80
|
|
|
46
|
-
|
|
81
|
+
// There's something strange in d3-array's typings
|
|
82
|
+
const groups = /** @type {Map<any, any>} */ /** @type {any} */ (
|
|
83
|
+
d3group(this.buffer, ...groupFieldAccessors)
|
|
84
|
+
);
|
|
47
85
|
|
|
48
|
-
|
|
86
|
+
for (const [group, data] of iterateNestedMaps(groups)) {
|
|
87
|
+
/** @type {any} */
|
|
88
|
+
const datum = {};
|
|
49
89
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
);
|
|
90
|
+
for (let i = 0; i < groupby.length; i++) {
|
|
91
|
+
datum[groupby[i]] = group[i];
|
|
92
|
+
}
|
|
54
93
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
count: data.length,
|
|
59
|
-
};
|
|
94
|
+
this.ops.forEach((op, i) => {
|
|
95
|
+
datum[this.as[i]] = op(data);
|
|
96
|
+
});
|
|
60
97
|
|
|
61
|
-
|
|
62
|
-
datum[groupby[i]] = group[i];
|
|
98
|
+
this._propagate(datum);
|
|
63
99
|
}
|
|
100
|
+
} else {
|
|
101
|
+
/** @type {Datum} */
|
|
102
|
+
const datum = {};
|
|
103
|
+
this.ops.forEach((op, i) => {
|
|
104
|
+
datum[this.as[i]] = op(this.buffer);
|
|
105
|
+
});
|
|
64
106
|
|
|
65
107
|
this._propagate(datum);
|
|
66
108
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregate.test.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregate.test.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { describe, expect, test } from "vitest";
|
|
2
|
+
import { processData } from "../flowTestUtils.js";
|
|
3
|
+
import AggregateTransform from "./aggregate.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {import("../../spec/transform.js").AggregateParams} params
|
|
7
|
+
* @param {any[]} data
|
|
8
|
+
*/
|
|
9
|
+
function transform(params, data) {
|
|
10
|
+
return processData(new AggregateTransform(params), data);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
describe("Aggregate transform", () => {
|
|
14
|
+
test("Default to count when no data fields or group-by fields are specified", () => {
|
|
15
|
+
const input = [
|
|
16
|
+
{ name: "alpha", data: 123 },
|
|
17
|
+
{ name: "beta", data: 456 },
|
|
18
|
+
{ name: "beta", data: 789 },
|
|
19
|
+
];
|
|
20
|
+
|
|
21
|
+
expect(transform({ type: "aggregate" }, input)).toEqual([{ count: 3 }]);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test("Default to count when no data fields fields are specified", () => {
|
|
25
|
+
const input = [
|
|
26
|
+
{ name: "alpha", data: 123 },
|
|
27
|
+
{ name: "beta", data: 456 },
|
|
28
|
+
{ name: "beta", data: 789 },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
expect(
|
|
32
|
+
transform({ type: "aggregate", groupby: ["name"] }, input)
|
|
33
|
+
).toEqual([
|
|
34
|
+
{ name: "alpha", count: 1 },
|
|
35
|
+
{ name: "beta", count: 2 },
|
|
36
|
+
]);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test("Compute count, sum, min, max, and mean for groups. Use default output field names.", () => {
|
|
40
|
+
const input = [
|
|
41
|
+
{ name: "alpha", data: 123 },
|
|
42
|
+
{ name: "beta", data: 456 },
|
|
43
|
+
{ name: "beta", data: 789 },
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
expect(
|
|
47
|
+
transform(
|
|
48
|
+
{
|
|
49
|
+
type: "aggregate",
|
|
50
|
+
groupby: ["name"],
|
|
51
|
+
fields: ["data", "data", "data", "data", "data"],
|
|
52
|
+
ops: ["count", "sum", "min", "max", "mean"],
|
|
53
|
+
},
|
|
54
|
+
input
|
|
55
|
+
)
|
|
56
|
+
).toEqual([
|
|
57
|
+
{
|
|
58
|
+
name: "alpha",
|
|
59
|
+
count_data: 1,
|
|
60
|
+
sum_data: 123,
|
|
61
|
+
min_data: 123,
|
|
62
|
+
max_data: 123,
|
|
63
|
+
mean_data: 123,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "beta",
|
|
67
|
+
count_data: 2,
|
|
68
|
+
sum_data: 1245,
|
|
69
|
+
min_data: 456,
|
|
70
|
+
max_data: 789,
|
|
71
|
+
mean_data: 622.5,
|
|
72
|
+
},
|
|
73
|
+
]);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
test("Allow custom output field names", () => {
|
|
77
|
+
const input = [
|
|
78
|
+
{ name: "alpha", data: 123 },
|
|
79
|
+
{ name: "beta", data: 456 },
|
|
80
|
+
{ name: "beta", data: 789 },
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
expect(
|
|
84
|
+
transform(
|
|
85
|
+
{
|
|
86
|
+
type: "aggregate",
|
|
87
|
+
fields: ["data", "data", "data", "data", "data"],
|
|
88
|
+
ops: ["count", "sum", "min", "max", "mean"],
|
|
89
|
+
as: ["count", "total", "min", "max", "average"],
|
|
90
|
+
},
|
|
91
|
+
input
|
|
92
|
+
)
|
|
93
|
+
).toEqual([
|
|
94
|
+
{
|
|
95
|
+
count: 3,
|
|
96
|
+
total: 1368,
|
|
97
|
+
min: 123,
|
|
98
|
+
max: 789,
|
|
99
|
+
average: 456,
|
|
100
|
+
},
|
|
101
|
+
]);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
test("Throw if the length of fields and ops does not match", () => {
|
|
105
|
+
const input = [{ name: "beta", data: 789 }];
|
|
106
|
+
|
|
107
|
+
expect(() =>
|
|
108
|
+
transform(
|
|
109
|
+
{
|
|
110
|
+
type: "aggregate",
|
|
111
|
+
fields: ["data", "data", "data", "data"],
|
|
112
|
+
ops: ["count", "sum", "min", "max", "mean"],
|
|
113
|
+
},
|
|
114
|
+
input
|
|
115
|
+
)
|
|
116
|
+
).toThrow();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test("Throw if the length of fields and as does not match", () => {
|
|
120
|
+
const input = [{ name: "beta", data: 789 }];
|
|
121
|
+
|
|
122
|
+
expect(() =>
|
|
123
|
+
transform(
|
|
124
|
+
{
|
|
125
|
+
type: "aggregate",
|
|
126
|
+
fields: ["data"],
|
|
127
|
+
ops: ["count"],
|
|
128
|
+
as: ["count", "total"],
|
|
129
|
+
},
|
|
130
|
+
input
|
|
131
|
+
)
|
|
132
|
+
).toThrow();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export default AGGREGATE_OPS;
|
|
2
|
+
/**
|
|
3
|
+
* @type {Record<import("../../spec/transform.js").AggregateOp, (arr: any[], accessor?: (datum: any) => number) => number>}
|
|
4
|
+
*/
|
|
5
|
+
declare const AGGREGATE_OPS: Record<import("../../spec/transform.js").AggregateOp, (arr: any[], accessor?: (datum: any) => number) => number>;
|
|
6
|
+
//# sourceMappingURL=aggregateOps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aggregateOps.d.ts","sourceRoot":"","sources":["../../../../src/data/transforms/aggregateOps.js"],"names":[],"mappings":";AAEA;;GAEG;AACH,6BAFU,OAAO,OAAO,yBAAyB,EAAE,WAAW,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,MAAM,KAAK,MAAM,CAAC,CAWxH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { count, max, mean, median, min, sum, variance } from "d3-array";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @type {Record<import("../../spec/transform.js").AggregateOp, (arr: any[], accessor?: (datum: any) => number) => number>}
|
|
5
|
+
*/
|
|
6
|
+
const AGGREGATE_OPS = {
|
|
7
|
+
count: (arr) => arr.length,
|
|
8
|
+
valid: count,
|
|
9
|
+
sum,
|
|
10
|
+
min,
|
|
11
|
+
max,
|
|
12
|
+
mean,
|
|
13
|
+
median,
|
|
14
|
+
variance,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default AGGREGATE_OPS;
|
|
@@ -1,34 +1 @@
|
|
|
1
|
-
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg width="100%" height="100%" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5;">
|
|
4
|
-
<g transform="matrix(0.10221,0.00683825,-0.0067136,0.100347,-8.03424,-13.2222)">
|
|
5
|
-
<path d="M208.629,548.17C208.629,548.17 219.768,594.389 239.814,619.222C259.86,644.055 319.119,680.831 319.119,680.831C319.119,680.831 385.557,622.915 437.87,498.346C437.87,498.346 456.021,499.236 473.808,486.446C491.594,473.656 490.239,478.534 494.883,461.62C494.883,461.62 551.848,467.937 625.826,451.863C667.634,442.778 710.238,425.649 747.382,393.142C747.382,393.142 721.992,360.244 689.422,291.45C677.029,265.275 647.518,257.098 590.747,203.309L438.083,391.273L208.629,548.17Z" style="fill-opacity:0.11;"/>
|
|
6
|
-
</g>
|
|
7
|
-
<g transform="matrix(0.081985,-0.0582493,0.0582493,0.081985,-40.4754,34.7668)">
|
|
8
|
-
<path d="M561.588,349.155C561.588,349.155 516.297,271.341 328.841,252.044C328.841,252.044 302.342,325.189 307.686,368.056C313.031,410.922 303.001,456.147 329.132,501.174C329.132,501.174 443.114,506.743 554.649,428.469L629.204,432.112C629.204,432.112 673.755,534.351 856.964,554.375C856.964,554.375 886.717,491.768 879.193,417.478C871.211,338.673 871.716,293.443 871.716,293.443C871.716,293.443 775.485,283.928 635.418,361.795L561.588,349.155Z" style="fill:rgb(127,187,221);"/>
|
|
9
|
-
<clipPath id="_clip1">
|
|
10
|
-
<path d="M561.588,349.155C561.588,349.155 516.297,271.341 328.841,252.044C328.841,252.044 302.342,325.189 307.686,368.056C313.031,410.922 303.001,456.147 329.132,501.174C329.132,501.174 443.114,506.743 554.649,428.469L629.204,432.112C629.204,432.112 673.755,534.351 856.964,554.375C856.964,554.375 886.717,491.768 879.193,417.478C871.211,338.673 871.716,293.443 871.716,293.443C871.716,293.443 775.485,283.928 635.418,361.795L561.588,349.155Z"/>
|
|
11
|
-
</clipPath>
|
|
12
|
-
<g clip-path="url(#_clip1)">
|
|
13
|
-
<g transform="matrix(0.758637,0.45892,-0.45892,0.758637,425.635,-121.213)">
|
|
14
|
-
<path d="M386.873,397.241C371.345,383.628 335.138,374.782 290.644,380.543C246.149,386.304 196.827,402.266 178.802,412.065C168.202,417.828 151.494,429.354 150.682,439.334C149.527,453.528 153.593,477.066 165.625,491.284C171.69,498.451 179.927,503.445 193.838,505.423C211.701,507.963 252.714,480.627 275.399,469.22C299.332,457.187 313.981,454.56 338.386,447.014C338.386,447.014 291.346,478.587 270.205,494.393C239.61,517.268 218.575,522.444 212.859,539.897C209.766,549.34 212.237,567.767 220.354,577.538C229.427,588.461 233.197,595.069 254.591,597.624C267.303,599.143 276.685,598.802 314.37,568.95C336.06,551.767 370.297,509.817 381.412,494.616C397.581,472.506 405.165,451.462 402.656,435.04C399.045,411.391 394.259,403.716 386.873,397.241Z" style="fill:white;"/>
|
|
15
|
-
</g>
|
|
16
|
-
<g transform="matrix(0.752145,0.454993,-0.454993,0.752145,468.36,-108.293)">
|
|
17
|
-
<path d="M484.733,378.934C479.33,367.886 467.092,350.452 483.886,325.205C502.172,297.717 514.898,280.938 528.117,264.632C541.335,248.326 574.793,218.447 587.739,212.53C600.684,206.613 621.026,203.852 631.889,212.841C642.874,221.93 648.416,233.377 654.92,245.478C662.331,259.267 667.318,274.808 656.518,288.278C641.093,307.515 622.242,305.294 594.912,319.844C567.244,334.573 552.644,342.943 539.244,355.703C539.244,355.703 591.431,334.114 621.229,324.474C651.027,314.833 680.952,304.461 695.995,315.975C711.038,327.49 710.631,331.463 714.425,347.187C719.107,366.59 707.231,385.165 694.294,395.838C681.356,406.51 659.958,411.756 636.875,416.852C606.42,423.576 540.278,431.917 512.819,419.366C485.361,406.815 488.488,386.613 484.733,378.934Z" style="fill:white;"/>
|
|
18
|
-
</g>
|
|
19
|
-
</g>
|
|
20
|
-
<path d="M561.588,349.155C561.588,349.155 516.297,271.341 328.841,252.044C328.841,252.044 302.342,325.189 307.686,368.056C313.031,410.922 303.001,456.147 329.132,501.174C329.132,501.174 443.114,506.743 554.649,428.469L629.204,432.112C629.204,432.112 673.755,534.351 856.964,554.375C856.964,554.375 886.717,491.768 879.193,417.478C871.211,338.673 871.716,293.443 871.716,293.443C871.716,293.443 775.485,283.928 635.418,361.795L561.588,349.155Z" style="fill:none;stroke:black;stroke-width:16.57px;"/>
|
|
21
|
-
</g>
|
|
22
|
-
<g transform="matrix(0.100298,-0.00740488,0.00740488,0.100298,-15.7457,-5.17528)">
|
|
23
|
-
<path d="M384.916,385.459C384.916,385.459 430.781,347.868 450.027,350.093C471.685,352.596 490.49,407.747 490.208,424.416C489.927,441.085 442.948,469.866 422.537,466.24C422.537,466.24 425.525,442.129 412.114,413.335C398.702,384.54 384.916,385.459 384.916,385.459Z" style="fill:rgb(127,187,221);"/>
|
|
24
|
-
<clipPath id="_clip2">
|
|
25
|
-
<path d="M384.916,385.459C384.916,385.459 430.781,347.868 450.027,350.093C471.685,352.596 490.49,407.747 490.208,424.416C489.927,441.085 442.948,469.866 422.537,466.24C422.537,466.24 425.525,442.129 412.114,413.335C398.702,384.54 384.916,385.459 384.916,385.459Z"/>
|
|
26
|
-
</clipPath>
|
|
27
|
-
<g clip-path="url(#_clip2)">
|
|
28
|
-
<g transform="matrix(0.909069,3.67641e-17,-3.79818e-17,0.85852,37.051,52.1829)">
|
|
29
|
-
<path d="M413.282,402.697C430.77,421.58 423.307,448.426 441.683,446.137C463.409,443.431 472.604,430.356 473.316,413.402C474.028,396.448 472.245,393.911 466.172,375.321C460.099,356.731 447.953,352.176 422.842,357.179C401.957,361.339 405.039,360.215 398.735,367.228C392.43,374.242 384.315,393.182 384.315,393.182C384.315,393.182 392.715,380.492 413.282,402.697Z" style="fill:white;"/>
|
|
30
|
-
</g>
|
|
31
|
-
</g>
|
|
32
|
-
<path d="M384.916,385.459C384.916,385.459 430.781,347.868 450.027,350.093C471.685,352.596 490.49,407.747 490.208,424.416C489.927,441.085 442.948,469.866 422.537,466.24C422.537,466.24 425.525,442.129 412.114,413.335C398.702,384.54 384.916,385.459 384.916,385.459Z" style="fill:none;stroke:black;stroke-width:16.57px;"/>
|
|
33
|
-
</g>
|
|
34
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5" viewBox="0 0 64 64"><path d="M208.6 548.2s11.2 46.2 31.2 71c20 24.9 79.3 61.6 79.3 61.6S385.6 623 438 498.3c0 0 18.1 1 36-11.9 17.7-12.7 16.3-7.9 21-24.8 0 0 57 6.3 131-9.7 41.7-9.1 84.3-26.3 121.5-58.8 0 0-25.4-32.9-58-101.7-12.4-26.1-41.9-34.3-98.7-88L438.1 391.2 208.6 548.2Z" style="fill-opacity:.11" transform="matrix(.10221 .00684 -.00671 .10035 -8 -13.2)"/><g transform="rotate(-35.4 34.2 80.8) scale(.10057)"><path d="M561.6 349.2s-45.3-77.9-232.8-97.2c0 0-26.5 73.2-21.1 116 5.3 43-4.7 88.1 21.4 133.2 0 0 114 5.5 225.5-72.7l74.6 3.6S673.8 534.4 857 554.4c0 0 29.7-62.6 22.2-137-8-78.7-7.5-124-7.5-124s-96.2-9.5-236.3 68.4l-73.8-12.6Z" style="fill:#7fbbdd"/><clipPath id="a"><path d="M561.6 349.2s-45.3-77.9-232.8-97.2c0 0-26.5 73.2-21.1 116 5.3 43-4.7 88.1 21.4 133.2 0 0 114 5.5 225.5-72.7l74.6 3.6S673.8 534.4 857 554.4c0 0 29.7-62.6 22.2-137-8-78.7-7.5-124-7.5-124s-96.2-9.5-236.3 68.4l-73.8-12.6Z"/></clipPath><g clip-path="url(#a)"><path d="M386.9 397.2c-15.6-13.6-51.8-22.4-96.3-16.7-44.5 5.8-93.8 21.8-111.8 31.6-10.6 5.7-27.3 17.3-28.1 27.2-1.2 14.2 2.9 37.8 15 52 6 7.2 14.2 12.1 28.1 14.1 17.9 2.6 59-24.8 81.6-36.2 24-12 38.6-14.6 63-22.2 0 0-47 31.6-68.2 47.4-30.6 22.9-51.6 28-57.3 45.5-3.1 9.4-.7 27.9 7.5 37.6 9 11 12.8 17.6 34.2 20.1 12.7 1.5 22 1.2 59.8-28.6 21.7-17.2 55.9-59.2 67-74.4 16.2-22 23.8-43.1 21.3-59.6-3.7-23.6-8.4-31.3-15.8-37.8Z" style="fill:#fff" transform="scale(.88664) rotate(31.2 485 792.2)"/><path d="M484.7 379c-5.4-11.1-17.6-28.5-.8-53.8a739 739 0 0 1 44.2-60.6c13.2-16.3 46.7-46.2 59.6-52 13-6 33.3-8.7 44.2.2 11 9.1 16.5 20.6 23 32.7 7.4 13.8 12.4 29.3 1.6 42.8-15.4 19.2-34.3 17-61.6 31.5-27.7 14.8-42.3 23.1-55.7 35.9 0 0 52.2-21.6 82-31.2 29.8-9.7 59.8-20 74.8-8.5s14.6 15.5 18.4 31.2c4.7 19.4-7.2 38-20.1 48.6-13 10.7-34.3 16-57.4 21-30.5 6.8-96.6 15.1-124 2.6-27.5-12.6-24.4-32.8-28.2-40.5Z" style="fill:#fff" transform="scale(.87906) rotate(31.2 487.2 893.5)"/></g><path d="M561.6 349.2s-45.3-77.9-232.8-97.2c0 0-26.5 73.2-21.1 116 5.3 43-4.7 88.1 21.4 133.2 0 0 114 5.5 225.5-72.7l74.6 3.6S673.8 534.4 857 554.4c0 0 29.7-62.6 22.2-137-8-78.7-7.5-124-7.5-124s-96.2-9.5-236.3 68.4l-73.8-12.6Z" style="fill:none;stroke:#000;stroke-width:16.57px"/></g><g transform="rotate(-4.2 -78 211) scale(.10057)"><path d="M385 385.5s45.8-37.6 65-35.4c21.7 2.5 40.5 57.6 40.2 74.3-.3 16.7-47.3 45.5-67.7 41.8 0 0 3-24-10.4-52.9-13.4-28.8-27.2-27.8-27.2-27.8Z" style="fill:#7fbbdd"/><clipPath id="b"><path d="M385 385.5s45.8-37.6 65-35.4c21.7 2.5 40.5 57.6 40.2 74.3-.3 16.7-47.3 45.5-67.7 41.8 0 0 3-24-10.4-52.9-13.4-28.8-27.2-27.8-27.2-27.8Z"/></clipPath><g clip-path="url(#b)"><path d="M413.3 402.7c17.5 18.9 10 45.7 28.4 43.4 21.7-2.7 30.9-15.7 31.6-32.7.7-17-1-19.5-7.1-38-6.1-18.7-18.2-23.2-43.4-18.2-20.8 4.1-17.8 3-24 10-6.4 7-14.5 26-14.5 26s8.4-12.7 29 9.5Z" style="fill:#fff" transform="matrix(.90907 0 0 .85852 37 52.2)"/></g><path d="M385 385.5s45.8-37.6 65-35.4c21.7 2.5 40.5 57.6 40.2 74.3-.3 16.7-47.3 45.5-67.7 41.8 0 0 3-24-10.4-52.9-13.4-28.8-27.2-27.8-27.2-27.8Z" style="fill:none;stroke:#000;stroke-width:16.57px"/></g></svg>
|
package/dist/src/spec/title.d.ts
CHANGED
|
@@ -188,14 +188,44 @@ export interface StackParams extends TransformParamsBase {
|
|
|
188
188
|
baseField?: Field;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
export type AggregateOp =
|
|
192
|
+
| "count"
|
|
193
|
+
| "valid"
|
|
194
|
+
| "sum"
|
|
195
|
+
| "min"
|
|
196
|
+
| "max"
|
|
197
|
+
| "mean"
|
|
198
|
+
| "median"
|
|
199
|
+
| "variance";
|
|
200
|
+
|
|
191
201
|
export interface AggregateParams extends TransformParamsBase {
|
|
192
202
|
type: "aggregate";
|
|
193
203
|
|
|
194
204
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
205
|
+
* The fields by which to group the data. If these are not defined, all data
|
|
206
|
+
* objects will be grouped into a single category.
|
|
197
207
|
*/
|
|
198
208
|
groupby?: Field[];
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The data fields to apply aggregate functions to. This array should
|
|
212
|
+
* correspond with the `ops` and `as` arrays. If no fields or operations
|
|
213
|
+
* are specified, a count aggregation will be applied by default.
|
|
214
|
+
*/
|
|
215
|
+
fields?: Field[];
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* The aggregation operations to be performed on the fields, such as `"sum"`,
|
|
219
|
+
* `"average"`, or `"count"`.
|
|
220
|
+
*/
|
|
221
|
+
ops?: AggregateOp[];
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The names for the output fields corresponding to each aggregated field.
|
|
225
|
+
* If not provided, names will be automatically created using the operation
|
|
226
|
+
* and field names (e.g., `sum_field`, `average_field`).
|
|
227
|
+
*/
|
|
228
|
+
as?: string[];
|
|
199
229
|
}
|
|
200
230
|
|
|
201
231
|
export interface FlattenParams extends TransformParamsBase {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../src/view/gridView.js"],"names":[],"mappings":"AAswBA;;;GAGG;AACH,iDAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,QAAQ,CAwB9C;AAED;;;GAGG;AACH,uDAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,QAAQ,CA6C9C;AA2BD;;GAEG;AACH,8EAUC;AAED;;;;;GAKG;AACH,4CAJW,OAAO,uBAAuB,EAAE,OAAO,UACvC,OAAO,iBAAiB,EAAE,UAAU,YACpC,QAAQ,aAmBlB;AA53BD;;;;;;;;;;;;;;;GAeG;AACH;IA6BI;;;;;;;;;OASG;IACH,kBARW,OAAO,iBAAiB,EAAE,aAAa,WACvC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,aAAa,iDAEb,MAAM,WACN,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAoBzC;IARG,8CAAgB;IAOhB,uBAA0B;IAG9B;;OAEG;IACH,qDAIC;IAeD;;OAEG;IACH,wDAKC;IAqBD;;OAEG;IACH,8CAEC;IAED,yBAEC;IAED;;OAEG;IACH,wCAmCC;;CA+jBJ;AAgJD;IACI;;;;OAIG;IACH,6DAHW,aAAa,UACb,MAAM,EAoFhB;IAjFG,4BAAgC;IAChC,kCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,mFAAmF;IACnF,MADW,QAAQ,OAAO,OAAO,iBAAiB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC5D;IAEd,4FAA4F;IAC5F,WADW,QAAQ,OAAO,OAAO,iBAAiB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC3D;IAEnB,0DAA0D;IAC1D,kEAAoB;IAEpB,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IA4DhC,uEAcC;IAED;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"gridView.d.ts","sourceRoot":"","sources":["../../../src/view/gridView.js"],"names":[],"mappings":"AAswBA;;;GAGG;AACH,iDAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,QAAQ,CAwB9C;AAED;;;GAGG;AACH,uDAHW,OAAO,iBAAiB,EAAE,cAAc,GACtC,OAAO,iBAAiB,EAAE,QAAQ,CA6C9C;AA2BD;;GAEG;AACH,8EAUC;AAED;;;;;GAKG;AACH,4CAJW,OAAO,uBAAuB,EAAE,OAAO,UACvC,OAAO,iBAAiB,EAAE,UAAU,YACpC,QAAQ,aAmBlB;AA53BD;;;;;;;;;;;;;;;GAeG;AACH;IA6BI;;;;;;;;;OASG;IACH,kBARW,OAAO,iBAAiB,EAAE,aAAa,WACvC,OAAO,yBAAyB,EAAE,OAAO,gBACzC,aAAa,iDAEb,MAAM,WACN,MAAM,YACN,OAAO,WAAW,EAAE,WAAW,EAoBzC;IARG,8CAAgB;IAOhB,uBAA0B;IAG9B;;OAEG;IACH,qDAIC;IAeD;;OAEG;IACH,wDAKC;IAqBD;;OAEG;IACH,8CAEC;IAED,yBAEC;IAED;;OAEG;IACH,wCAmCC;;CA+jBJ;AAgJD;IACI;;;;OAIG;IACH,6DAHW,aAAa,UACb,MAAM,EAoFhB;IAjFG,4BAAgC;IAChC,kCAAgB;IAChB,eAAoB;IAEpB,uBAAuB;IACvB,YADW,QAAQ,CACQ;IAE3B,uBAAuB;IACvB,kBADW,QAAQ,CACc;IAEjC,mFAAmF;IACnF,MADW,QAAQ,OAAO,OAAO,iBAAiB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAC5D;IAEd,4FAA4F;IAC5F,WADW,QAAQ,OAAO,OAAO,iBAAiB,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAC3D;IAEnB,0DAA0D;IAC1D,kEAAoB;IAEpB,uBAAuB;IACvB,OADW,QAAQ,CACG;IAEtB,wBAAwB;IACxB,QADW,SAAS,CACQ;IA4DhC,uEAcC;IAED;;OAEG;IACH,4BAsKC;IAED,uBAqBC;IAED,iCAEC;CACJ;qBAtrC0D,eAAe;sBAFpD,uBAAuB;0BAGnB,oBAAoB;qBAGzB,eAAe;yBALX,mBAAmB;AAyrC5C;IAeI;;;OAGG;IACH,uBAHW,SAAS,8CA6FnB;IAhGD,uBAAmB;IAsCf;;;MAAoB;IAIpB;;;;MAQC;IAgDL,2BAKC;IAWD;;;;OAIG;IACH,gCAHW,SAAS,UACT,SAAS,QA8CnB;;CACJ;oBA52CmB,qBAAqB"}
|
|
@@ -1136,14 +1136,18 @@ export class GridChild {
|
|
|
1136
1136
|
"x",
|
|
1137
1137
|
"y",
|
|
1138
1138
|
])) {
|
|
1139
|
-
if (
|
|
1139
|
+
if (
|
|
1140
|
+
view.needsAxes[channel] &&
|
|
1141
|
+
// Handle a special case where the child view has an excluded resolution
|
|
1142
|
+
// but no scale or axis, e.g., when only values are used on a channel.
|
|
1143
|
+
view.getConfiguredOrDefaultResolution(channel, "axis") !=
|
|
1144
|
+
"excluded"
|
|
1145
|
+
) {
|
|
1140
1146
|
const r = view.getAxisResolution(channel);
|
|
1141
1147
|
if (!r) {
|
|
1142
1148
|
continue;
|
|
1143
1149
|
}
|
|
1144
1150
|
|
|
1145
|
-
// TODO: Optimization: the same grid view could be reused for all children
|
|
1146
|
-
// because they share the axis and scale resolutions anyway.
|
|
1147
1151
|
await createAxisGrid(r, channel, view);
|
|
1148
1152
|
}
|
|
1149
1153
|
}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
},
|
|
8
8
|
"contributors": [],
|
|
9
9
|
"license": "MIT",
|
|
10
|
-
"version": "0.
|
|
10
|
+
"version": "0.54.0",
|
|
11
11
|
"jsdelivr": "dist/bundle/index.js",
|
|
12
12
|
"unpkg": "dist/bundle/index.js",
|
|
13
13
|
"browser": "dist/bundle/index.js",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/long": "^4.0.1"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "38fcc65c16a986706fc946c4aae3c5199e02a119"
|
|
71
71
|
}
|