@milaboratories/graph-maker 1.1.134 → 1.1.135
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/node_modules/@milaboratories/pf-plots/dist/index.js +1348 -1163
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +212 -208
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +1 -1
- package/dist/node_modules/@platforma-sdk/model/dist/index.js +242 -241
- package/dist/node_modules/@platforma-sdk/model/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { deriveLabels as
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import z from "../../../canonicalize/lib/canonicalize.js";
|
|
2
|
+
import { deriveLabels as Oe, isLabelColumn as Fe } from "../../../@platforma-sdk/model/dist/index.js";
|
|
3
|
+
import { canonicalizeJson as j } from "../../pl-model-common/dist/index.js";
|
|
4
|
+
import ie from "../../../lodash/lodash.js";
|
|
5
|
+
var _e = "pl7.app/axisNature", he = "pl7.app/label", Le = "pl7.app/columnAsAxis/name", Te = "pl7.app/columnAsAxis/domain", J = "pl7.app/isSubset", ee = "pl7.app/isDiscreteFilter", ke = "pl7.app/discreteValues", Ee = "pl7.app/graph/axis/highCardinality", Ne = "pl7.app/graph/isVirtual", xe = "pl7.app/isLinkerColumn", _ = class se {
|
|
5
6
|
constructor({ type: e, name: o, domain: n }) {
|
|
6
7
|
this.kind = "axis", this.type = e, this.name = o, this.domain = { ...n };
|
|
7
8
|
}
|
|
8
9
|
toCanonicalString() {
|
|
9
|
-
return
|
|
10
|
+
return z(this);
|
|
10
11
|
}
|
|
11
12
|
static fromAxisSpec(e) {
|
|
12
|
-
return new
|
|
13
|
+
return new se({ name: e.name, type: e.type, domain: e.domain });
|
|
13
14
|
}
|
|
14
15
|
static fromAxesSpec(e) {
|
|
15
|
-
return e.map((o) =>
|
|
16
|
+
return e.map((o) => se.fromAxisSpec(o));
|
|
16
17
|
}
|
|
17
18
|
copy() {
|
|
18
|
-
return new
|
|
19
|
+
return new se({ type: this.type, name: this.name, domain: this.domain });
|
|
19
20
|
}
|
|
20
21
|
toPFrameId() {
|
|
21
22
|
return {
|
|
@@ -25,80 +26,173 @@ var Pe = "pl7.app/axisNature", ge = "pl7.app/label", Oe = "pl7.app/columnAsAxis/
|
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
static fromPojo(e) {
|
|
28
|
-
return new
|
|
29
|
+
return new se(e);
|
|
29
30
|
}
|
|
30
|
-
},
|
|
31
|
+
}, W = class we {
|
|
31
32
|
constructor({ name: e, type: o }) {
|
|
32
33
|
this.kind = "column", this.name = e, this.type = o;
|
|
33
34
|
}
|
|
34
35
|
toCanonicalString() {
|
|
35
|
-
return
|
|
36
|
+
return z(this);
|
|
36
37
|
}
|
|
37
38
|
static fromPojo(e) {
|
|
38
|
-
return new
|
|
39
|
+
return new we(e);
|
|
39
40
|
}
|
|
40
41
|
};
|
|
41
42
|
function B(t) {
|
|
42
43
|
return t !== null && t.kind === "column";
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function le(t) {
|
|
45
46
|
return t !== null && t.kind === "axis";
|
|
46
47
|
}
|
|
47
|
-
function
|
|
48
|
+
function A(t) {
|
|
48
49
|
const e = JSON.parse(t);
|
|
49
50
|
if (e.kind === "column")
|
|
50
|
-
return
|
|
51
|
+
return W.fromPojo(e);
|
|
51
52
|
if (e.kind === "axis")
|
|
52
53
|
return _.fromPojo(e);
|
|
53
54
|
throw Error("wrong column or axis object");
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
var Se = "pl7.app/parents";
|
|
57
|
+
function Ce(t) {
|
|
58
|
+
return !t.annotations || !t.annotations[Se] ? [] : JSON.parse(t.annotations[Se]);
|
|
59
|
+
}
|
|
60
|
+
function Ge(t, e) {
|
|
61
|
+
const o = j(t[e]);
|
|
62
|
+
for (let n = 0; n < t.length; n++) {
|
|
63
|
+
const l = t[n];
|
|
64
|
+
if (e === n)
|
|
65
|
+
continue;
|
|
66
|
+
if (Ce(l).some((r) => j(r) === o))
|
|
67
|
+
return !1;
|
|
68
|
+
}
|
|
69
|
+
return !0;
|
|
70
|
+
}
|
|
71
|
+
function Me(t) {
|
|
72
|
+
for (let e = 0; e < t.length; e++)
|
|
73
|
+
if (Ge(t, e))
|
|
74
|
+
return t[e];
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
function qe(t) {
|
|
78
|
+
const e = { axis: t, parents: [] };
|
|
79
|
+
let o = [e];
|
|
80
|
+
for (; o.length; ) {
|
|
81
|
+
const n = [];
|
|
82
|
+
for (const l of o) {
|
|
83
|
+
const s = Ce(l.axis);
|
|
84
|
+
l.parents = s.map((r) => ({ axis: r, parents: [] })), n.push(...l.parents);
|
|
85
|
+
}
|
|
86
|
+
o = n;
|
|
87
|
+
}
|
|
88
|
+
return e;
|
|
89
|
+
}
|
|
90
|
+
function Ve(t) {
|
|
91
|
+
const e = /* @__PURE__ */ new Set([j(t.axis)]);
|
|
92
|
+
let o = [t];
|
|
93
|
+
for (; o.length; ) {
|
|
94
|
+
const n = [];
|
|
95
|
+
for (const l of o)
|
|
96
|
+
for (const s of l.parents)
|
|
97
|
+
e.add(j(s.axis)), n.push(s);
|
|
98
|
+
o = n;
|
|
99
|
+
}
|
|
100
|
+
return e;
|
|
101
|
+
}
|
|
102
|
+
function je(t) {
|
|
103
|
+
const e = [t.axis];
|
|
104
|
+
let o = [t];
|
|
105
|
+
for (; o.length; ) {
|
|
106
|
+
const n = [];
|
|
107
|
+
for (const l of o)
|
|
108
|
+
for (const s of l.parents)
|
|
109
|
+
e.push(s.axis), n.push(s);
|
|
110
|
+
o = n;
|
|
111
|
+
}
|
|
112
|
+
return e;
|
|
113
|
+
}
|
|
114
|
+
function te(t) {
|
|
115
|
+
if (!t.length)
|
|
116
|
+
return [];
|
|
117
|
+
let e = t;
|
|
118
|
+
const o = [];
|
|
119
|
+
for (; e.length; ) {
|
|
120
|
+
const n = Me(e);
|
|
121
|
+
if (n === null)
|
|
122
|
+
return null;
|
|
123
|
+
const l = qe(n);
|
|
124
|
+
if (l === null)
|
|
125
|
+
return null;
|
|
126
|
+
const s = Ve(l), r = je(l);
|
|
127
|
+
o.push(r), e = e.filter((c) => !s.has(j(c)));
|
|
128
|
+
}
|
|
129
|
+
return o;
|
|
130
|
+
}
|
|
131
|
+
function ze(t) {
|
|
132
|
+
var e, o;
|
|
133
|
+
const n = /* @__PURE__ */ new Map();
|
|
134
|
+
for (const l of t) {
|
|
135
|
+
const s = new W({ name: l.columnId, type: l.spec.valueType }), r = te(l.spec.axesSpec);
|
|
136
|
+
if (!r || r.length !== 2)
|
|
137
|
+
continue;
|
|
138
|
+
const [c, i] = r, p = j(c), u = j(i);
|
|
139
|
+
n.has(p) || n.set(p, /* @__PURE__ */ new Map()), n.has(u) || n.set(u, /* @__PURE__ */ new Map()), (e = n.get(p)) == null || e.set(u, s), (o = n.get(u)) == null || o.set(p, s);
|
|
140
|
+
}
|
|
141
|
+
return n;
|
|
142
|
+
}
|
|
143
|
+
async function Ke(t, e, o, n, l, s, r, c = !0, i) {
|
|
144
|
+
var p, u, m, d;
|
|
145
|
+
const h = A(e);
|
|
146
|
+
if (B(h)) {
|
|
147
|
+
const g = await t.pFrameProvider.getColumnSpecById(h);
|
|
148
|
+
if (!g)
|
|
61
149
|
return;
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
150
|
+
const x = be(
|
|
151
|
+
g,
|
|
152
|
+
l,
|
|
153
|
+
s,
|
|
154
|
+
r,
|
|
155
|
+
i
|
|
156
|
+
).map((a) => _.fromAxisSpec(a).toCanonicalString()), w = new Set(x), D = g.axesSpec.map((a) => _.fromAxisSpec(a).toCanonicalString()), b = {};
|
|
157
|
+
c && D.forEach((a, S) => {
|
|
158
|
+
w.has(a) && (b[a] = S);
|
|
65
159
|
});
|
|
66
|
-
const
|
|
160
|
+
const C = {
|
|
67
161
|
kind: "column",
|
|
68
|
-
name:
|
|
69
|
-
label: o ?? await
|
|
70
|
-
type:
|
|
71
|
-
spec:
|
|
72
|
-
annotations:
|
|
73
|
-
isSubsetFilter: ((
|
|
74
|
-
isDiscreteFilter:
|
|
75
|
-
axesToBeFixed:
|
|
76
|
-
axesToBeFixedIndexes:
|
|
162
|
+
name: g.name,
|
|
163
|
+
label: o ?? await T(t, e, []),
|
|
164
|
+
type: g.valueType,
|
|
165
|
+
spec: g,
|
|
166
|
+
annotations: g.annotations,
|
|
167
|
+
isSubsetFilter: ((p = g.annotations) == null ? void 0 : p[J]) === "true",
|
|
168
|
+
isDiscreteFilter: g.valueType === "String" || ((u = g.annotations) == null ? void 0 : u[ee]) === "true",
|
|
169
|
+
axesToBeFixed: x,
|
|
170
|
+
axesToBeFixedIndexes: b
|
|
77
171
|
};
|
|
78
|
-
n.set(
|
|
79
|
-
for (const
|
|
80
|
-
const
|
|
81
|
-
if (n.has(
|
|
172
|
+
n.set(h.toCanonicalString(), C);
|
|
173
|
+
for (const a of g.axesSpec) {
|
|
174
|
+
const y = _.fromAxisSpec(a).toCanonicalString();
|
|
175
|
+
if (n.has(y))
|
|
82
176
|
continue;
|
|
83
|
-
const
|
|
177
|
+
const f = Ae(a), v = {
|
|
84
178
|
kind: "axis",
|
|
85
|
-
name:
|
|
86
|
-
label: await
|
|
87
|
-
type:
|
|
88
|
-
mustBeConsumed:
|
|
179
|
+
name: a.name,
|
|
180
|
+
label: await T(t, y, [e]),
|
|
181
|
+
type: a.type,
|
|
182
|
+
mustBeConsumed: f,
|
|
89
183
|
dividable: !1,
|
|
90
|
-
spec:
|
|
91
|
-
annotations:
|
|
92
|
-
isSubsetFilter: ((
|
|
93
|
-
isDiscreteFilter:
|
|
184
|
+
spec: a,
|
|
185
|
+
annotations: a.annotations,
|
|
186
|
+
isSubsetFilter: ((m = a.annotations) == null ? void 0 : m[J]) === "true",
|
|
187
|
+
isDiscreteFilter: a.type === "String" || ((d = a.annotations) == null ? void 0 : d[ee]) === "true",
|
|
94
188
|
parentSources: [e]
|
|
95
189
|
};
|
|
96
|
-
n.set(
|
|
190
|
+
n.set(y, v);
|
|
97
191
|
}
|
|
98
192
|
}
|
|
99
193
|
}
|
|
100
|
-
function
|
|
101
|
-
const e =
|
|
194
|
+
function ye(t) {
|
|
195
|
+
const e = A(t), { name: o, type: n } = e;
|
|
102
196
|
return B(e) ? {
|
|
103
197
|
kind: "column",
|
|
104
198
|
name: "",
|
|
@@ -124,39 +218,39 @@ function Se(t) {
|
|
|
124
218
|
parentSources: []
|
|
125
219
|
};
|
|
126
220
|
}
|
|
127
|
-
function
|
|
221
|
+
function ue(t) {
|
|
128
222
|
return {
|
|
129
223
|
type: t.type,
|
|
130
224
|
components: { ...t.components },
|
|
131
225
|
dividedAxes: { ...t.dividedAxes }
|
|
132
226
|
};
|
|
133
227
|
}
|
|
134
|
-
function
|
|
135
|
-
const { selectedSource: e, type: o, selectedFilterRange: n, selectedFilterValue: l } = t, s =
|
|
228
|
+
function Ue(t) {
|
|
229
|
+
const { selectedSource: e, type: o, selectedFilterRange: n, selectedFilterValue: l } = t, s = A(e);
|
|
136
230
|
if (!s)
|
|
137
231
|
throw Error("Empty source selected");
|
|
138
232
|
if (o === "range") {
|
|
139
|
-
const
|
|
140
|
-
return (n == null ? void 0 : n.max) !== void 0 &&
|
|
233
|
+
const r = [];
|
|
234
|
+
return (n == null ? void 0 : n.max) !== void 0 && r.push({
|
|
141
235
|
type: "bySingleColumnV2",
|
|
142
|
-
column:
|
|
236
|
+
column: le(s) ? { type: "axis", id: s.toPFrameId() } : { type: "column", id: s.name },
|
|
143
237
|
predicate: {
|
|
144
238
|
operator: "LessOrEqual",
|
|
145
239
|
reference: n.max
|
|
146
240
|
}
|
|
147
|
-
}), (n == null ? void 0 : n.min) !== void 0 &&
|
|
241
|
+
}), (n == null ? void 0 : n.min) !== void 0 && r.push({
|
|
148
242
|
type: "bySingleColumnV2",
|
|
149
|
-
column:
|
|
243
|
+
column: le(s) ? { type: "axis", id: s.toPFrameId() } : { type: "column", id: s.name },
|
|
150
244
|
predicate: {
|
|
151
245
|
operator: "GreaterOrEqual",
|
|
152
246
|
reference: n == null ? void 0 : n.min
|
|
153
247
|
}
|
|
154
|
-
}),
|
|
248
|
+
}), r;
|
|
155
249
|
} else if (o === "subset")
|
|
156
250
|
return [
|
|
157
251
|
{
|
|
158
252
|
type: "bySingleColumnV2",
|
|
159
|
-
column:
|
|
253
|
+
column: le(s) ? { type: "axis", id: s.toPFrameId() } : { type: "column", id: s.name },
|
|
160
254
|
predicate: {
|
|
161
255
|
operator: "Not",
|
|
162
256
|
operand: { operator: "IsNA" }
|
|
@@ -166,7 +260,7 @@ function ke(t) {
|
|
|
166
260
|
return typeof l > "u" ? [] : [
|
|
167
261
|
{
|
|
168
262
|
type: "bySingleColumnV2",
|
|
169
|
-
column:
|
|
263
|
+
column: le(s) ? { type: "axis", id: s.toPFrameId() } : {
|
|
170
264
|
type: "column",
|
|
171
265
|
id: s.name
|
|
172
266
|
},
|
|
@@ -177,125 +271,120 @@ function ke(t) {
|
|
|
177
271
|
}
|
|
178
272
|
];
|
|
179
273
|
}
|
|
180
|
-
function
|
|
274
|
+
function Y(t) {
|
|
181
275
|
const e = [];
|
|
182
276
|
for (const o of t)
|
|
183
|
-
e.push(...
|
|
277
|
+
e.push(...Ue(o));
|
|
184
278
|
return e;
|
|
185
279
|
}
|
|
186
|
-
function
|
|
280
|
+
function fe(t) {
|
|
187
281
|
var e, o, n, l;
|
|
188
282
|
if ("kind" in t && t.kind === "PColumn") {
|
|
189
|
-
const
|
|
190
|
-
return
|
|
283
|
+
const c = (o = t.name) != null ? o : (e = t.annotations) == null ? void 0 : e[Le], i = (l = t.domain) != null ? l : (n = t.annotations) == null ? void 0 : n[Te];
|
|
284
|
+
return z({ name: c, domain: i });
|
|
191
285
|
}
|
|
192
|
-
const s = t.name,
|
|
193
|
-
return
|
|
286
|
+
const s = t.name, r = t.domain;
|
|
287
|
+
return z({ name: s, domain: r });
|
|
194
288
|
}
|
|
195
289
|
async function ve(t, e, o) {
|
|
196
290
|
var n;
|
|
197
291
|
for (const l of o) {
|
|
198
|
-
const s =
|
|
292
|
+
const s = A(l);
|
|
199
293
|
if (B(s)) {
|
|
200
|
-
const
|
|
201
|
-
(
|
|
294
|
+
const r = await t.pFrameProvider.getColumnSpecById(s), c = ((n = r == null ? void 0 : r.axesSpec) != null ? n : []).find(
|
|
295
|
+
(i) => _.fromAxisSpec(i).toCanonicalString() === e.toCanonicalString()
|
|
202
296
|
);
|
|
203
|
-
if (
|
|
204
|
-
return
|
|
297
|
+
if (c)
|
|
298
|
+
return c;
|
|
205
299
|
}
|
|
206
300
|
}
|
|
207
301
|
return null;
|
|
208
302
|
}
|
|
209
|
-
var
|
|
210
|
-
async function
|
|
211
|
-
const n =
|
|
303
|
+
var We = "pl7.app/label";
|
|
304
|
+
async function k(t, e, o) {
|
|
305
|
+
const n = A(e);
|
|
212
306
|
if (B(n))
|
|
213
307
|
return;
|
|
214
|
-
async function l(
|
|
215
|
-
const
|
|
216
|
-
return
|
|
308
|
+
async function l(i) {
|
|
309
|
+
const p = await ve(t, i, o);
|
|
310
|
+
return p ? fe(p) : null;
|
|
217
311
|
}
|
|
218
|
-
const s = await t.pFrameProvider.getColumnsFull([], !1, void 0, [
|
|
219
|
-
return
|
|
312
|
+
const s = await t.pFrameProvider.getColumnsFull([], !1, void 0, [We]), r = await l(n), c = s.find(({ spec: i }) => i && i.axesSpec.length === 1 && fe(i.axesSpec[0]) === r);
|
|
313
|
+
return c ? new W({ name: c.columnId, type: c.spec.valueType }) : void 0;
|
|
220
314
|
}
|
|
221
|
-
async function
|
|
315
|
+
async function T(t, e, o) {
|
|
222
316
|
var n, l;
|
|
223
|
-
const s =
|
|
224
|
-
let
|
|
225
|
-
if (B(s) ?
|
|
317
|
+
const s = A(e), r = await k(t, e, o);
|
|
318
|
+
let c;
|
|
319
|
+
if (B(s) ? c = await t.pFrameProvider.getColumnSpecById(r ?? s) : c = r ? await t.pFrameProvider.getColumnSpecById(r) : await ve(t, s, o), !c)
|
|
226
320
|
return "";
|
|
227
|
-
const
|
|
228
|
-
return t.labelsModifier(
|
|
321
|
+
const i = (l = (n = c.annotations) == null ? void 0 : n[he]) != null ? l : c.name;
|
|
322
|
+
return t.labelsModifier(c.name, i);
|
|
229
323
|
}
|
|
230
|
-
function
|
|
324
|
+
function Ae(t) {
|
|
231
325
|
var e, o;
|
|
232
|
-
const n = (o = (e = t.annotations) == null ? void 0 : e[
|
|
326
|
+
const n = (o = (e = t.annotations) == null ? void 0 : e[_e]) == null ? void 0 : o.toLowerCase();
|
|
233
327
|
return !!n && n !== "homogenous" && n !== "homogeneous";
|
|
234
328
|
}
|
|
235
|
-
function
|
|
329
|
+
function R(t) {
|
|
236
330
|
var e, o;
|
|
237
|
-
return ((e = t.annotations) == null ? void 0 : e[
|
|
331
|
+
return ((e = t.annotations) == null ? void 0 : e[J]) === "true" || ((o = t.annotations) == null ? void 0 : o[ee]) === "true", !0;
|
|
238
332
|
}
|
|
239
|
-
function
|
|
333
|
+
function He(t) {
|
|
240
334
|
var e, o;
|
|
241
|
-
return !t.name.includes("metadata") && ((e = t.annotations) == null ? void 0 : e[
|
|
335
|
+
return !t.name.includes("metadata") && ((e = t.annotations) == null ? void 0 : e[Ne]) !== "true" && ((o = t.annotations) == null ? void 0 : o[J]) !== "true";
|
|
242
336
|
}
|
|
243
|
-
|
|
337
|
+
function Ye(t) {
|
|
244
338
|
var e;
|
|
245
|
-
const o =
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
), n = {};
|
|
252
|
-
for (const l of o) {
|
|
253
|
-
const s = await t.pFrameProvider.getColumnSpecById(l), c = (e = s == null ? void 0 : s.axesSpec) != null ? e : [];
|
|
254
|
-
if (s && c.length) {
|
|
255
|
-
const [a, r] = c, u = _.fromAxisSpec(a).toCanonicalString(), p = _.fromAxisSpec(r).toCanonicalString();
|
|
256
|
-
n[u] || (n[u] = {}), n[p] || (n[p] = {}), n[u][p] = { id: l, spec: s }, n[p][u] = { id: l, spec: s };
|
|
339
|
+
const o = {};
|
|
340
|
+
for (const n of t.filter((l) => l.spec.axesSpec.length === 2)) {
|
|
341
|
+
const l = new W({ name: n.columnId, type: n.spec.valueType }), s = (e = n.spec.axesSpec) != null ? e : [];
|
|
342
|
+
if (s.length) {
|
|
343
|
+
const [r, c] = s, i = _.fromAxisSpec(r).toCanonicalString(), p = _.fromAxisSpec(c).toCanonicalString();
|
|
344
|
+
o[i] || (o[i] = {}), o[p] || (o[p] = {}), o[i][p] = { id: l, spec: n.spec }, o[p][i] = { id: l, spec: n.spec };
|
|
257
345
|
}
|
|
258
346
|
}
|
|
259
|
-
return
|
|
347
|
+
return o;
|
|
260
348
|
}
|
|
261
|
-
async function
|
|
262
|
-
const o = /* @__PURE__ */ new Set();
|
|
263
|
-
for (const
|
|
264
|
-
const
|
|
265
|
-
if (B(
|
|
266
|
-
const
|
|
267
|
-
if (!
|
|
349
|
+
async function $(t, e) {
|
|
350
|
+
const o = /* @__PURE__ */ new Set(), n = [];
|
|
351
|
+
for (const l of e) {
|
|
352
|
+
const s = A(l);
|
|
353
|
+
if (B(s)) {
|
|
354
|
+
const r = await t.pFrameProvider.getColumnSpecById(s);
|
|
355
|
+
if (!r)
|
|
268
356
|
continue;
|
|
269
|
-
|
|
270
|
-
|
|
357
|
+
r.axesSpec.forEach((c) => {
|
|
358
|
+
const i = _.fromAxisSpec(c).toCanonicalString();
|
|
359
|
+
o.has(i) || (o.add(i), n.push(c));
|
|
271
360
|
});
|
|
272
361
|
}
|
|
273
362
|
}
|
|
274
|
-
return
|
|
363
|
+
return n;
|
|
275
364
|
}
|
|
276
|
-
function
|
|
365
|
+
function Re(t, e, o) {
|
|
277
366
|
const n = {}, l = /* @__PURE__ */ new Set([e]);
|
|
278
367
|
let s = [e];
|
|
279
368
|
for (; s.length; ) {
|
|
280
|
-
const
|
|
281
|
-
for (const
|
|
282
|
-
if (t[
|
|
283
|
-
const
|
|
284
|
-
for (const
|
|
285
|
-
if (n[
|
|
286
|
-
const
|
|
369
|
+
const r = /* @__PURE__ */ new Set();
|
|
370
|
+
for (const c of s)
|
|
371
|
+
if (t[c]) {
|
|
372
|
+
const i = Object.keys(t[c]);
|
|
373
|
+
for (const p of i)
|
|
374
|
+
if (n[p] = c, p === o) {
|
|
375
|
+
const u = [];
|
|
287
376
|
let m = o;
|
|
288
377
|
for (; n[m] !== e; )
|
|
289
|
-
|
|
290
|
-
return
|
|
291
|
-
} else l.has(
|
|
378
|
+
u.push(m), m = n[m];
|
|
379
|
+
return u.push(m), u.map((d) => t[d][n[d]].id);
|
|
380
|
+
} else l.has(p) || (r.add(p), l.add(p));
|
|
292
381
|
}
|
|
293
|
-
s = [...
|
|
382
|
+
s = [...r];
|
|
294
383
|
}
|
|
295
384
|
return null;
|
|
296
385
|
}
|
|
297
|
-
function
|
|
298
|
-
const n = [...e].map((s) =>
|
|
386
|
+
function Xe(t, e, o) {
|
|
387
|
+
const n = [...e].map((s) => Re(t, s, o)).filter((s) => s !== null);
|
|
299
388
|
if (n.length === 0)
|
|
300
389
|
return [];
|
|
301
390
|
let l = n[0];
|
|
@@ -303,37 +392,90 @@ function Me(t, e, o) {
|
|
|
303
392
|
s.length < l.length && (l = s);
|
|
304
393
|
return l;
|
|
305
394
|
}
|
|
306
|
-
async function
|
|
307
|
-
const
|
|
308
|
-
|
|
395
|
+
async function X(t) {
|
|
396
|
+
const e = await t.pFrameProvider.getColumnsFull(
|
|
397
|
+
[],
|
|
398
|
+
!1,
|
|
399
|
+
void 0,
|
|
400
|
+
void 0,
|
|
401
|
+
{ [xe]: "true" }
|
|
402
|
+
), o = Ye(e.filter((l) => l.spec.axesSpec.length === 2)), n = ze(e.filter((l) => l.spec.axesSpec.length > 2));
|
|
403
|
+
return { linkerColumnsMap: o, compositeLinkerMap: n };
|
|
404
|
+
}
|
|
405
|
+
async function V(t, e, o, n, l, s) {
|
|
406
|
+
const r = A(l);
|
|
407
|
+
if (!B(r))
|
|
309
408
|
return [];
|
|
310
|
-
const c = await t.pFrameProvider.getColumnSpecById(
|
|
409
|
+
const c = await t.pFrameProvider.getColumnSpecById(r);
|
|
311
410
|
if (!c)
|
|
312
411
|
return [];
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}
|
|
318
|
-
|
|
412
|
+
const i = c.axesSpec.filter(
|
|
413
|
+
(x) => {
|
|
414
|
+
const w = _.fromAxisSpec(x).toCanonicalString();
|
|
415
|
+
return !(s != null && s.some((D) => D.axisSource === w));
|
|
416
|
+
}
|
|
417
|
+
), p = new Set(n.map((x) => _.fromAxisSpec(x).toCanonicalString())), u = i.filter((x) => {
|
|
418
|
+
const w = _.fromAxisSpec(x).toCanonicalString();
|
|
419
|
+
return !p.has(w);
|
|
420
|
+
});
|
|
421
|
+
if (!u.length)
|
|
422
|
+
return [];
|
|
423
|
+
const m = te(n), d = te(u);
|
|
424
|
+
if (!m || !d)
|
|
425
|
+
throw Error(`Can't create axes tree for ${c.name}`);
|
|
426
|
+
const h = new Set(m.map(j)), g = /* @__PURE__ */ new Set();
|
|
427
|
+
return d.forEach((x) => {
|
|
428
|
+
var w;
|
|
429
|
+
const D = j(x);
|
|
430
|
+
if (o.has(D)) {
|
|
431
|
+
const b = o.get(D), a = (b ? [...b.keys()] : []).find((y) => h.has(y));
|
|
432
|
+
if (!a)
|
|
433
|
+
throw Error(`Can't find composite linker column for ${c.name}, ${D}`);
|
|
434
|
+
const S = (w = o.get(D)) == null ? void 0 : w.get(a);
|
|
435
|
+
g.add(S.toCanonicalString());
|
|
436
|
+
} else if (x.length === 1) {
|
|
437
|
+
const b = _.fromAxisSpec(x[0]).toCanonicalString();
|
|
438
|
+
Xe(e, p, b).forEach((a) => {
|
|
439
|
+
g.add(a.toCanonicalString());
|
|
440
|
+
});
|
|
441
|
+
}
|
|
442
|
+
}), [...g].map((x) => A(x));
|
|
443
|
+
}
|
|
444
|
+
function be(t, e, o, n, l) {
|
|
445
|
+
const r = t.axesSpec.filter(
|
|
446
|
+
(u) => !o.has(_.fromAxisSpec(u).toCanonicalString())
|
|
447
|
+
);
|
|
448
|
+
if (!r.length)
|
|
449
|
+
return [];
|
|
450
|
+
const c = te(e);
|
|
451
|
+
let i = te(r);
|
|
452
|
+
if (!c || !i)
|
|
453
|
+
return r;
|
|
454
|
+
const p = new Set(c.map(j));
|
|
455
|
+
return i = i.filter(
|
|
456
|
+
(u) => {
|
|
457
|
+
const m = j(u), d = l.get(m);
|
|
458
|
+
return !(d ? [...d.keys()] : []).some((g) => p.has(g));
|
|
459
|
+
}
|
|
460
|
+
), i.some((u) => u.length > 1) ? i.flatMap((u) => u) : (i = i.filter(([u]) => !n.has(_.fromAxisSpec(u).toCanonicalString())), i.flatMap((u) => u));
|
|
319
461
|
}
|
|
320
|
-
function
|
|
462
|
+
function Ie(t, e) {
|
|
321
463
|
const o = e.columnsData[Object.keys(e.columnsData)[0]].length, n = new Int32Array(o).fill(0);
|
|
322
464
|
for (let l = 0; l < o; l++) {
|
|
323
465
|
let s = !1;
|
|
324
|
-
for (let
|
|
325
|
-
const { selectedSource:
|
|
326
|
-
if (
|
|
327
|
-
let
|
|
328
|
-
|
|
466
|
+
for (let r = 0; r < t.length; r++) {
|
|
467
|
+
const { selectedSource: c, selectedFilterValue: i, selectedFilterRange: p, type: u } = t[r], m = A(c), d = (B(m) ? e.columnsData[c] : e.axesData[c])[l];
|
|
468
|
+
if (i !== void 0 && (s = s || d === i), p !== void 0 && (p.min !== void 0 || p.max !== void 0) && typeof d == "number") {
|
|
469
|
+
let h = !0;
|
|
470
|
+
p.min !== void 0 && (h = h && d >= p.min), p.max !== void 0 && (h = h && d <= p.max), s = s || h;
|
|
329
471
|
}
|
|
330
|
-
|
|
472
|
+
u === "subset" && (s = s || d != null);
|
|
331
473
|
}
|
|
332
474
|
s && (n[l] = 1);
|
|
333
475
|
}
|
|
334
476
|
return n;
|
|
335
477
|
}
|
|
336
|
-
var
|
|
478
|
+
var Q = class {
|
|
337
479
|
constructor(t, e) {
|
|
338
480
|
this.simpleComponentControllers = t, this.filterComponentControllers = e, this.ignoredOptionIdNames = [], this.dataInputs = [], this.dontAllowUnfilteredHighCardinality = !1;
|
|
339
481
|
}
|
|
@@ -366,20 +508,20 @@ var R = class {
|
|
|
366
508
|
throw Error(`Unknown input name: ${String(t)}`);
|
|
367
509
|
}
|
|
368
510
|
changeSelected(t, e, o, n) {
|
|
369
|
-
const l = o.components[t].selectorStates, s = l.filter((
|
|
370
|
-
let
|
|
371
|
-
return s.forEach((
|
|
372
|
-
|
|
373
|
-
}),
|
|
374
|
-
|
|
511
|
+
const l = o.components[t].selectorStates, s = l.filter((i) => !n.find((p) => p.selectedSource === i.selectedSource)), r = n.filter((i) => !l.find((p) => p.selectedSource === i.selectedSource));
|
|
512
|
+
let c = ue(o);
|
|
513
|
+
return s.forEach((i) => {
|
|
514
|
+
c = this.deleteSelected(t, e, c, i);
|
|
515
|
+
}), r.forEach((i) => {
|
|
516
|
+
c = this.addSelected(t, c, i);
|
|
375
517
|
}), o.components[t].selectorStates = n.map(
|
|
376
|
-
(
|
|
377
|
-
(
|
|
518
|
+
(i) => o.components[t].selectorStates.find(
|
|
519
|
+
(p) => p.selectedSource === i.selectedSource
|
|
378
520
|
)
|
|
379
|
-
).filter(Boolean),
|
|
521
|
+
).filter(Boolean), c;
|
|
380
522
|
}
|
|
381
523
|
switchDividableAxis(t, e) {
|
|
382
|
-
return
|
|
524
|
+
return ue(t);
|
|
383
525
|
}
|
|
384
526
|
async getMustBeConsumedAxes(t, e) {
|
|
385
527
|
return Promise.resolve(/* @__PURE__ */ new Set());
|
|
@@ -400,42 +542,53 @@ var R = class {
|
|
|
400
542
|
)
|
|
401
543
|
);
|
|
402
544
|
}
|
|
403
|
-
async getSelectedSourcesInfo(t, e, o, n) {
|
|
404
|
-
var
|
|
405
|
-
const
|
|
406
|
-
for (const
|
|
407
|
-
for (const
|
|
408
|
-
const
|
|
409
|
-
if (B(
|
|
410
|
-
const
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
545
|
+
async getSelectedSourcesInfo(t, e, o, n, l) {
|
|
546
|
+
var s;
|
|
547
|
+
const r = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Set(), i = [];
|
|
548
|
+
for (const m of this.dataInputs)
|
|
549
|
+
for (const d of e.components[m].selectorStates) {
|
|
550
|
+
const h = A(d.selectedSource);
|
|
551
|
+
if (B(h)) {
|
|
552
|
+
const g = await t.pFrameProvider.getColumnSpecById(h);
|
|
553
|
+
g && g.axesSpec.forEach((x) => {
|
|
554
|
+
const w = _.fromAxisSpec(x).toCanonicalString();
|
|
555
|
+
c.has(w) || (c.add(w), i.push(x));
|
|
556
|
+
});
|
|
414
557
|
}
|
|
415
558
|
}
|
|
416
|
-
const
|
|
417
|
-
let
|
|
418
|
-
for (;
|
|
419
|
-
const
|
|
420
|
-
for (const
|
|
421
|
-
if (n[
|
|
422
|
-
const
|
|
423
|
-
for (const
|
|
424
|
-
!
|
|
559
|
+
const p = /* @__PURE__ */ new Set();
|
|
560
|
+
let u = [...c];
|
|
561
|
+
for (; u.length; ) {
|
|
562
|
+
const m = [];
|
|
563
|
+
for (const d of u)
|
|
564
|
+
if (n[d]) {
|
|
565
|
+
const h = Object.keys(n[d]);
|
|
566
|
+
for (const g of h)
|
|
567
|
+
!p.has(g) && !c.has(g) && (m.push(g), p.add(g));
|
|
425
568
|
}
|
|
426
|
-
|
|
569
|
+
u = m;
|
|
427
570
|
}
|
|
428
|
-
for (const [
|
|
429
|
-
const
|
|
430
|
-
for (const { selectedSource:
|
|
431
|
-
await
|
|
571
|
+
for (const [m, { selectorStates: d }] of Object.entries(e.components)) {
|
|
572
|
+
const g = ((s = this.simpleComponentControllers[m]) != null ? s : this.filterComponentControllers[m]).settings.columnsWithExtraAxesAllowed;
|
|
573
|
+
for (const { selectedSource: x } of d)
|
|
574
|
+
await Ke(
|
|
575
|
+
t,
|
|
576
|
+
x,
|
|
577
|
+
o[x],
|
|
578
|
+
r,
|
|
579
|
+
i,
|
|
580
|
+
c,
|
|
581
|
+
p,
|
|
582
|
+
g,
|
|
583
|
+
l
|
|
584
|
+
);
|
|
432
585
|
}
|
|
433
|
-
return
|
|
586
|
+
return r;
|
|
434
587
|
}
|
|
435
588
|
getEmptyInputGuide(t) {
|
|
436
589
|
return {
|
|
437
590
|
components: this.createEmptyComponentsGuide(t),
|
|
438
|
-
getSourceInfo: (e) =>
|
|
591
|
+
getSourceInfo: (e) => ye(e),
|
|
439
592
|
freeOptionsSet: /* @__PURE__ */ new Set(),
|
|
440
593
|
axesToBeFixedSet: /* @__PURE__ */ new Set(),
|
|
441
594
|
readyData: !1,
|
|
@@ -453,106 +606,107 @@ var R = class {
|
|
|
453
606
|
async getLabelsMap(t, e) {
|
|
454
607
|
const o = await t.pFrameProvider.getColumnsFull(
|
|
455
608
|
this.dataInputs.reduce((n, l) => {
|
|
456
|
-
const
|
|
457
|
-
return n.concat(
|
|
609
|
+
const r = e.components[l].selectorStates.map((c) => A(c.selectedSource));
|
|
610
|
+
return n.concat(r);
|
|
458
611
|
}, []),
|
|
459
612
|
!1
|
|
460
613
|
);
|
|
461
|
-
return
|
|
462
|
-
const s = new
|
|
614
|
+
return Oe(o, (n) => n.spec).reduce((n, l) => {
|
|
615
|
+
const s = new W({ name: l.value.columnId, type: l.value.spec.valueType }).toCanonicalString();
|
|
463
616
|
return n[s] = l.label, n;
|
|
464
617
|
}, {});
|
|
465
618
|
}
|
|
466
|
-
async calculateOptions(t, e, o = [], n =
|
|
619
|
+
async calculateOptions(t, e, o = [], n = He) {
|
|
467
620
|
var l, s;
|
|
468
|
-
const
|
|
469
|
-
for (const [
|
|
470
|
-
const
|
|
621
|
+
const r = this.createEmptyComponentsGuide(e), c = this.getConsumedOptionsSet(e), i = new Set(this.ignoredOptionIdNames), p = new Set(o), { linkerColumnsMap: u, compositeLinkerMap: m } = await X(t), d = await this.getLabelsMap(t, e), h = await this.getSelectedSourcesInfo(t, e, d, u, m), g = /* @__PURE__ */ new Map(), x = { ...this.simpleComponentControllers, ...this.filterComponentControllers }, w = /* @__PURE__ */ new Set();
|
|
622
|
+
for (const [y, f] of Object.entries(x)) {
|
|
623
|
+
const v = await f.getOptions(
|
|
471
624
|
t,
|
|
472
625
|
e,
|
|
626
|
+
d,
|
|
627
|
+
c,
|
|
628
|
+
u,
|
|
473
629
|
m,
|
|
474
|
-
a,
|
|
475
|
-
p,
|
|
476
630
|
n,
|
|
477
|
-
|
|
478
|
-
|
|
631
|
+
i,
|
|
632
|
+
p
|
|
479
633
|
);
|
|
480
|
-
this.dataInputs.includes(
|
|
481
|
-
|
|
634
|
+
this.dataInputs.includes(y) || v.options.forEach((P) => {
|
|
635
|
+
w.add(P.value);
|
|
482
636
|
});
|
|
483
|
-
for (const [
|
|
484
|
-
|
|
485
|
-
|
|
637
|
+
for (const [P, O] of v.optionsInfo)
|
|
638
|
+
g.set(P, O);
|
|
639
|
+
r[y] = v;
|
|
486
640
|
}
|
|
487
|
-
const
|
|
488
|
-
const
|
|
489
|
-
|
|
490
|
-
const
|
|
491
|
-
|
|
492
|
-
},
|
|
493
|
-
for (const
|
|
494
|
-
|
|
641
|
+
const D = (y) => {
|
|
642
|
+
const f = g.get(y);
|
|
643
|
+
f && f.kind === "axis" && (f.mustBeConsumed = !0);
|
|
644
|
+
const v = h.get(y);
|
|
645
|
+
v && v.kind === "axis" && (v.mustBeConsumed = !0);
|
|
646
|
+
}, b = await this.getMustBeConsumedAxes(t, e);
|
|
647
|
+
for (const y of b)
|
|
648
|
+
D(y);
|
|
495
649
|
if (this.dontAllowUnfilteredHighCardinality) {
|
|
496
|
-
const
|
|
497
|
-
var
|
|
498
|
-
return ((
|
|
499
|
-
},
|
|
500
|
-
const
|
|
501
|
-
return (
|
|
650
|
+
const y = (v) => {
|
|
651
|
+
var P;
|
|
652
|
+
return ((P = v == null ? void 0 : v.annotations) == null ? void 0 : P[Ee]) === "true";
|
|
653
|
+
}, f = (s = (l = e.components.filters) == null ? void 0 : l.selectorStates.reduce((v, P) => {
|
|
654
|
+
const O = h.get(P.selectedSource);
|
|
655
|
+
return (O == null ? void 0 : O.kind) === "column" && O.spec.axesSpec.filter(y).forEach((L) => v.add(_.fromAxisSpec(L).toCanonicalString())), (O == null ? void 0 : O.kind) === "axis" && y(O.spec) && v.add(_.fromAxisSpec(O.spec).toCanonicalString()), v;
|
|
502
656
|
}, /* @__PURE__ */ new Set())) != null ? s : /* @__PURE__ */ new Set();
|
|
503
|
-
this.dataInputs.forEach((
|
|
504
|
-
for (const { selectedSource:
|
|
505
|
-
const
|
|
506
|
-
if ((
|
|
507
|
-
const
|
|
508
|
-
!
|
|
509
|
-
}), (
|
|
510
|
-
const N = _.fromAxisSpec(
|
|
511
|
-
|
|
657
|
+
this.dataInputs.forEach((v) => {
|
|
658
|
+
for (const { selectedSource: P } of e.components[v].selectorStates) {
|
|
659
|
+
const O = h.get(P);
|
|
660
|
+
if ((O == null ? void 0 : O.kind) === "column" && O.spec.axesSpec.filter(y).forEach((L) => {
|
|
661
|
+
const E = _.fromAxisSpec(L).toCanonicalString();
|
|
662
|
+
!w.has(E) && !f.has(E) && w.add(E), f.has(E) || D(E);
|
|
663
|
+
}), (O == null ? void 0 : O.kind) === "axis" && y(O.spec)) {
|
|
664
|
+
const N = _.fromAxisSpec(O.spec).toCanonicalString();
|
|
665
|
+
w.has(N) || w.add(N), f.has(N) || D(N);
|
|
512
666
|
}
|
|
513
667
|
}
|
|
514
668
|
});
|
|
515
669
|
}
|
|
516
|
-
const
|
|
517
|
-
for (const { selectorStates:
|
|
518
|
-
for (const { selectedSource:
|
|
519
|
-
const
|
|
520
|
-
|
|
521
|
-
|
|
670
|
+
const C = /* @__PURE__ */ new Set();
|
|
671
|
+
for (const { selectorStates: y } of Object.values(e.components))
|
|
672
|
+
for (const { selectedSource: f } of y) {
|
|
673
|
+
const v = h.get(f);
|
|
674
|
+
v && v.kind === "column" && v.axesToBeFixed.forEach((P) => {
|
|
675
|
+
C.add(P);
|
|
522
676
|
});
|
|
523
677
|
}
|
|
524
|
-
const
|
|
525
|
-
var
|
|
526
|
-
const
|
|
527
|
-
return (
|
|
678
|
+
const a = await this.isConsistent(t, e, u, m), S = (y) => {
|
|
679
|
+
var f, v, P;
|
|
680
|
+
const O = (f = A(y).toCanonicalString()) != null ? f : y;
|
|
681
|
+
return (P = (v = g.get(O)) != null ? v : h.get(O)) != null ? P : ye(y);
|
|
528
682
|
};
|
|
529
683
|
return {
|
|
530
|
-
components:
|
|
531
|
-
getSourceInfo:
|
|
532
|
-
freeOptionsSet:
|
|
533
|
-
axesToBeFixedSet:
|
|
684
|
+
components: r,
|
|
685
|
+
getSourceInfo: S,
|
|
686
|
+
freeOptionsSet: w,
|
|
687
|
+
axesToBeFixedSet: C,
|
|
534
688
|
readyData: this.readyDataInputs(e),
|
|
535
|
-
ready: this.readyForPlotBuilding(t, e,
|
|
536
|
-
consistent:
|
|
689
|
+
ready: this.readyForPlotBuilding(t, e, a, w, S),
|
|
690
|
+
consistent: a
|
|
537
691
|
};
|
|
538
692
|
}
|
|
539
693
|
async getUniqueSourceValuesWithLabels(t, e, o, n, l, s) {
|
|
540
|
-
var
|
|
541
|
-
const
|
|
694
|
+
var r;
|
|
695
|
+
const c = (u) => u.sort((m, d) => m.label.localeCompare(d.label, "en", { numeric: !0 })), i = e.getSourceInfo(o), p = (r = i.annotations) == null ? void 0 : r[ke];
|
|
542
696
|
try {
|
|
543
|
-
const
|
|
544
|
-
if (
|
|
545
|
-
const m =
|
|
546
|
-
return
|
|
697
|
+
const u = p ? JSON.parse(p).map((m) => String(m)) : null;
|
|
698
|
+
if (u) {
|
|
699
|
+
const m = u.map((d) => ({ value: d, label: d }));
|
|
700
|
+
return c(m), { values: m, overflow: !1 };
|
|
547
701
|
}
|
|
548
702
|
} catch {
|
|
549
|
-
console.error(`Parsing error: discrete values annotation ${
|
|
703
|
+
console.error(`Parsing error: discrete values annotation ${p} in ${o}`);
|
|
550
704
|
}
|
|
551
|
-
if (
|
|
552
|
-
const
|
|
553
|
-
let
|
|
705
|
+
if (i.kind === "axis") {
|
|
706
|
+
const u = A(o), m = i.parentSources.map(A), d = await k(t, o, i.parentSources);
|
|
707
|
+
let h = [];
|
|
554
708
|
if (d) {
|
|
555
|
-
l && (
|
|
709
|
+
l && (h = [{
|
|
556
710
|
type: "bySingleColumnV2",
|
|
557
711
|
column: {
|
|
558
712
|
type: "column",
|
|
@@ -562,39 +716,39 @@ var R = class {
|
|
|
562
716
|
operator: "StringIContains",
|
|
563
717
|
substring: l
|
|
564
718
|
}
|
|
565
|
-
}]), s && (
|
|
719
|
+
}]), s && (h = [{
|
|
566
720
|
type: "bySingleColumnV2",
|
|
567
721
|
column: {
|
|
568
722
|
type: "axis",
|
|
569
|
-
id:
|
|
723
|
+
id: u.toPFrameId()
|
|
570
724
|
},
|
|
571
725
|
predicate: {
|
|
572
726
|
operator: "StringIContains",
|
|
573
727
|
substring: s
|
|
574
728
|
}
|
|
575
729
|
}]);
|
|
576
|
-
const { data:
|
|
577
|
-
for (let
|
|
578
|
-
|
|
579
|
-
return a
|
|
730
|
+
const { data: D, axesData: b } = await t.pFrameProvider.getSingleColumnData(d, h), C = b[u.toCanonicalString()], a = [];
|
|
731
|
+
for (let S = 0; S < Math.min(C.length, n ?? C.length); S++)
|
|
732
|
+
a.push({ value: String(C[S]), label: String(D[S]) });
|
|
733
|
+
return c(a), { values: a, overflow: !(n === void 0 || C.length < n) };
|
|
580
734
|
}
|
|
581
|
-
const
|
|
582
|
-
|
|
735
|
+
const g = l ?? s;
|
|
736
|
+
g && (h = [{
|
|
583
737
|
type: "bySingleColumnV2",
|
|
584
738
|
column: {
|
|
585
739
|
type: "axis",
|
|
586
|
-
id:
|
|
740
|
+
id: u.toPFrameId()
|
|
587
741
|
},
|
|
588
742
|
predicate: {
|
|
589
743
|
operator: "StringIContains",
|
|
590
|
-
substring:
|
|
744
|
+
substring: g
|
|
591
745
|
}
|
|
592
746
|
}]);
|
|
593
|
-
const
|
|
594
|
-
return
|
|
747
|
+
const x = await t.pFrameProvider.getAxisUniqueValues(u, [m[0]], n, h), w = x.values.map((D) => ({ value: String(D), label: String(D) }));
|
|
748
|
+
return c(w), { values: w, overflow: x.overflow };
|
|
595
749
|
}
|
|
596
|
-
if (
|
|
597
|
-
const
|
|
750
|
+
if (i.kind === "column") {
|
|
751
|
+
const u = l ?? s, m = A(o), d = u ? [{
|
|
598
752
|
type: "bySingleColumnV2",
|
|
599
753
|
column: {
|
|
600
754
|
type: "column",
|
|
@@ -602,31 +756,31 @@ var R = class {
|
|
|
602
756
|
},
|
|
603
757
|
predicate: {
|
|
604
758
|
operator: "StringIContains",
|
|
605
|
-
substring:
|
|
759
|
+
substring: u
|
|
606
760
|
}
|
|
607
|
-
}] : [],
|
|
608
|
-
return
|
|
761
|
+
}] : [], h = await t.pFrameProvider.getColumnUniqueValues(m, n, d), g = h.values.map((x) => ({ value: String(x), label: String(x) }));
|
|
762
|
+
return c(g), { values: g, overflow: h.overflow };
|
|
609
763
|
}
|
|
610
764
|
return { values: [], overflow: !1 };
|
|
611
765
|
}
|
|
612
|
-
async checkStateConsistency(t, e, o) {
|
|
613
|
-
const
|
|
614
|
-
for (const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
await this.simpleComponentControllers[
|
|
766
|
+
async checkStateConsistency(t, e, o, n) {
|
|
767
|
+
const l = /* @__PURE__ */ new Map();
|
|
768
|
+
for (const s of Object.keys(this.simpleComponentControllers))
|
|
769
|
+
l.set(
|
|
770
|
+
s,
|
|
771
|
+
await this.simpleComponentControllers[s].checkStateConsistency(t, e, o, n)
|
|
618
772
|
);
|
|
619
|
-
for (const
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
await this.filterComponentControllers[
|
|
773
|
+
for (const s of Object.keys(this.filterComponentControllers))
|
|
774
|
+
l.set(
|
|
775
|
+
s,
|
|
776
|
+
await this.filterComponentControllers[s].checkStateConsistency(t, e, o, n)
|
|
623
777
|
);
|
|
624
|
-
return
|
|
778
|
+
return l;
|
|
625
779
|
}
|
|
626
|
-
async isConsistent(t, e, o) {
|
|
627
|
-
const
|
|
628
|
-
for (const
|
|
629
|
-
if (Object.values(
|
|
780
|
+
async isConsistent(t, e, o, n) {
|
|
781
|
+
const l = await this.checkStateConsistency(t, e, o, n);
|
|
782
|
+
for (const s of l.values())
|
|
783
|
+
if (Object.values(s).some((r) => !r))
|
|
630
784
|
return !1;
|
|
631
785
|
return !0;
|
|
632
786
|
}
|
|
@@ -637,31 +791,31 @@ var R = class {
|
|
|
637
791
|
if (!o || !this.readyDataInputs(e))
|
|
638
792
|
return !1;
|
|
639
793
|
let s = !1;
|
|
640
|
-
for (const
|
|
641
|
-
const
|
|
642
|
-
if (
|
|
794
|
+
for (const c of n) {
|
|
795
|
+
const i = l(c);
|
|
796
|
+
if (i && i.kind === "axis" && i.mustBeConsumed) {
|
|
643
797
|
s = !0;
|
|
644
798
|
break;
|
|
645
799
|
}
|
|
646
800
|
}
|
|
647
|
-
let
|
|
648
|
-
for (const { selectorStates:
|
|
649
|
-
for (const { selectedSource:
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
801
|
+
let r = !1;
|
|
802
|
+
for (const { selectorStates: c } of Object.values(e.components)) {
|
|
803
|
+
for (const { selectedSource: i, fixedAxes: p } of c) {
|
|
804
|
+
const u = l(i);
|
|
805
|
+
if (u && u.kind === "column" && u.axesToBeFixed.some(
|
|
652
806
|
(m) => {
|
|
653
807
|
var d;
|
|
654
|
-
return ((d = (
|
|
808
|
+
return ((d = (p ?? []).find((h) => h.axisSource === m)) == null ? void 0 : d.axisValue) === void 0;
|
|
655
809
|
}
|
|
656
810
|
)) {
|
|
657
|
-
|
|
811
|
+
r = !0;
|
|
658
812
|
break;
|
|
659
813
|
}
|
|
660
814
|
}
|
|
661
|
-
if (
|
|
815
|
+
if (r)
|
|
662
816
|
break;
|
|
663
817
|
}
|
|
664
|
-
return this.requiredComponents.every((
|
|
818
|
+
return this.requiredComponents.every((c) => e.components[c].selectorStates.length > 0) && !s && !r;
|
|
665
819
|
}
|
|
666
820
|
async createDataForPlot(t, e) {
|
|
667
821
|
return {
|
|
@@ -669,18 +823,21 @@ var R = class {
|
|
|
669
823
|
settings: await this.createChartSettings(t, e)
|
|
670
824
|
};
|
|
671
825
|
}
|
|
672
|
-
},
|
|
826
|
+
}, Je = (t) => {
|
|
827
|
+
var e;
|
|
828
|
+
return ((e = t == null ? void 0 : t.annotations) == null ? void 0 : e[xe]) === "true";
|
|
829
|
+
}, De = class Be {
|
|
673
830
|
constructor({
|
|
674
831
|
componentName: e,
|
|
675
832
|
allowedTypes: o,
|
|
676
833
|
settings: n,
|
|
677
834
|
strictlyDependsOnParents: l,
|
|
678
835
|
dependsOn: s = [],
|
|
679
|
-
parentComponents:
|
|
680
|
-
annotations:
|
|
681
|
-
checkSourceBySpec:
|
|
836
|
+
parentComponents: r = [],
|
|
837
|
+
annotations: c = {},
|
|
838
|
+
checkSourceBySpec: i
|
|
682
839
|
}) {
|
|
683
|
-
this.componentName = e, this.allowedTypes = [...o], this.settings = { ...
|
|
840
|
+
this.componentName = e, this.allowedTypes = [...o], this.settings = { ...Be.DefaultSettings, ...n }, this.dependsOn = [...s], this.parentComponents = [...r], this.strictlyDependsOnParents = l ?? !0, this.annotations = { ...c }, i && (this.checkSourceBySpec = i);
|
|
684
841
|
}
|
|
685
842
|
get isRequired() {
|
|
686
843
|
return this.settings.required;
|
|
@@ -689,181 +846,205 @@ var R = class {
|
|
|
689
846
|
return this.settings.dimensionConsumer;
|
|
690
847
|
}
|
|
691
848
|
addSelected(e, o) {
|
|
692
|
-
const n =
|
|
849
|
+
const n = ue(e);
|
|
693
850
|
return n.components[this.componentName].selectorStates.push(o), n;
|
|
694
851
|
}
|
|
695
852
|
deleteSelected(e, o) {
|
|
696
|
-
const n =
|
|
853
|
+
const n = ue(e);
|
|
697
854
|
return n.components[this.componentName].selectorStates = n.components[this.componentName].selectorStates.filter((l) => l.selectedSource !== o), n;
|
|
698
855
|
}
|
|
699
|
-
async checkStateConsistency(e, o, n) {
|
|
700
|
-
const
|
|
701
|
-
function
|
|
702
|
-
const
|
|
703
|
-
return
|
|
856
|
+
async checkStateConsistency(e, o, n, l) {
|
|
857
|
+
const s = o.components[this.componentName], { parentAxes: r, linkerAxes: c } = await this.getAllowedAxes(e, o, n);
|
|
858
|
+
function i(u) {
|
|
859
|
+
const m = _.fromAxisSpec(u).toCanonicalString();
|
|
860
|
+
return r.has(m) || c.has(m);
|
|
704
861
|
}
|
|
705
|
-
const
|
|
706
|
-
|
|
707
|
-
const
|
|
708
|
-
if (B(
|
|
709
|
-
const
|
|
710
|
-
|
|
862
|
+
const p = await Promise.all(
|
|
863
|
+
s.selectorStates.map(async ({ selectedSource: u }) => {
|
|
864
|
+
const m = A(u);
|
|
865
|
+
if (B(m)) {
|
|
866
|
+
const d = await e.pFrameProvider.getColumnSpecById(m);
|
|
867
|
+
if (!d)
|
|
868
|
+
return !1;
|
|
869
|
+
if (this.parentComponents.length === 0)
|
|
870
|
+
return !0;
|
|
871
|
+
if (this.strictlyDependsOnParents && !this.settings.columnsWithExtraAxesAllowed && !this.settings.isDataComponent)
|
|
872
|
+
return d.axesSpec.every((g) => i(g));
|
|
873
|
+
if (this.settings.columnsWithExtraAxesAllowed && !this.settings.isDataComponent) {
|
|
874
|
+
if (d.axesSpec.some((x) => i(x)))
|
|
875
|
+
return !0;
|
|
876
|
+
const g = te(d.axesSpec);
|
|
877
|
+
return g ? g.some((x) => l.has(j(x))) : !1;
|
|
878
|
+
} else
|
|
879
|
+
return r.size === 0 || d.axesSpec.some((g) => i(g));
|
|
711
880
|
}
|
|
712
|
-
return
|
|
881
|
+
return r.has(u);
|
|
713
882
|
})
|
|
714
883
|
);
|
|
715
|
-
return
|
|
716
|
-
(
|
|
884
|
+
return s.selectorStates.reduce(
|
|
885
|
+
(u, m, d) => (u[m.selectedSource] = p[d], u),
|
|
717
886
|
{}
|
|
718
887
|
);
|
|
719
888
|
}
|
|
720
889
|
async getProducingAxes(e, o) {
|
|
721
|
-
const s = o.components[this.componentName].selectorStates.map((
|
|
890
|
+
const s = o.components[this.componentName].selectorStates.map((i) => A(i.selectedSource)).filter((i) => B(i)), r = /* @__PURE__ */ new Set();
|
|
722
891
|
return (await Promise.all(
|
|
723
|
-
s.map((
|
|
724
|
-
)).forEach((
|
|
725
|
-
|
|
726
|
-
|
|
892
|
+
s.map((i) => e.pFrameProvider.getColumnSpecById(i))
|
|
893
|
+
)).forEach((i) => {
|
|
894
|
+
i && i.axesSpec.forEach((p) => {
|
|
895
|
+
r.add(_.fromAxisSpec(p).toCanonicalString());
|
|
727
896
|
});
|
|
728
|
-
}),
|
|
897
|
+
}), r;
|
|
729
898
|
}
|
|
730
899
|
getParentSelectedSources(e, o) {
|
|
731
900
|
return this.parentComponents.reduce((l, s) => {
|
|
732
|
-
const
|
|
733
|
-
(
|
|
901
|
+
const r = o.components[s].selectorStates.map(
|
|
902
|
+
(c) => A(c.selectedSource)
|
|
734
903
|
);
|
|
735
|
-
return l.push(...
|
|
904
|
+
return l.push(...r), l;
|
|
736
905
|
}, []);
|
|
737
906
|
}
|
|
738
907
|
async getParentAxes(e, o) {
|
|
739
908
|
var n;
|
|
740
909
|
const l = this.getParentSelectedSources(e, o), s = /* @__PURE__ */ new Set();
|
|
741
|
-
for (const
|
|
742
|
-
if (B(
|
|
743
|
-
const
|
|
744
|
-
(n =
|
|
745
|
-
const
|
|
746
|
-
s.add(
|
|
910
|
+
for (const r of l)
|
|
911
|
+
if (B(r)) {
|
|
912
|
+
const c = await e.pFrameProvider.getColumnSpecById(r);
|
|
913
|
+
(n = c == null ? void 0 : c.axesSpec) == null || n.forEach((i) => {
|
|
914
|
+
const p = _.fromAxisSpec(i);
|
|
915
|
+
s.add(p.toCanonicalString());
|
|
747
916
|
});
|
|
748
917
|
}
|
|
749
918
|
return s;
|
|
750
919
|
}
|
|
751
920
|
async getAllowedAxes(e, o, n) {
|
|
752
|
-
var l, s, c,
|
|
753
|
-
const m = this.getParentSelectedSources(e, o), d = /* @__PURE__ */ new Set(),
|
|
754
|
-
for (const
|
|
755
|
-
if (B(
|
|
756
|
-
const b = await e.pFrameProvider.getColumnSpecById(
|
|
757
|
-
for (const
|
|
758
|
-
const
|
|
759
|
-
if (d.has(
|
|
921
|
+
var l, s, r, c, i, p, u;
|
|
922
|
+
const m = this.getParentSelectedSources(e, o), d = /* @__PURE__ */ new Set(), h = [], g = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Map();
|
|
923
|
+
for (const D of m)
|
|
924
|
+
if (B(D)) {
|
|
925
|
+
const b = await e.pFrameProvider.getColumnSpecById(D);
|
|
926
|
+
for (const C of (l = b == null ? void 0 : b.axesSpec) != null ? l : []) {
|
|
927
|
+
const S = _.fromAxisSpec(C).toCanonicalString();
|
|
928
|
+
if (d.has(S))
|
|
760
929
|
continue;
|
|
761
|
-
d.add(
|
|
762
|
-
const y =
|
|
763
|
-
|
|
930
|
+
d.add(S), h.push(C);
|
|
931
|
+
const y = Ae(C);
|
|
932
|
+
x.set(S, {
|
|
764
933
|
kind: "axis",
|
|
765
|
-
name:
|
|
766
|
-
label: await
|
|
767
|
-
|
|
934
|
+
name: C.name,
|
|
935
|
+
label: await T(e, S, [
|
|
936
|
+
D.toCanonicalString()
|
|
768
937
|
]),
|
|
769
|
-
type:
|
|
938
|
+
type: C.type,
|
|
770
939
|
mustBeConsumed: y,
|
|
771
940
|
dividable: !1,
|
|
772
|
-
spec:
|
|
773
|
-
annotations:
|
|
774
|
-
isSubsetFilter: ((s =
|
|
775
|
-
isDiscreteFilter:
|
|
776
|
-
parentSources: [
|
|
941
|
+
spec: C,
|
|
942
|
+
annotations: C.annotations,
|
|
943
|
+
isSubsetFilter: ((s = C.annotations) == null ? void 0 : s[J]) === "true",
|
|
944
|
+
isDiscreteFilter: C.type === "String" || ((r = C.annotations) == null ? void 0 : r[ee]) === "true",
|
|
945
|
+
parentSources: [D.toCanonicalString()]
|
|
777
946
|
});
|
|
778
947
|
}
|
|
779
948
|
}
|
|
780
|
-
let
|
|
781
|
-
for (;
|
|
782
|
-
const
|
|
783
|
-
for (const b of
|
|
949
|
+
let w = [...d];
|
|
950
|
+
for (; w.length; ) {
|
|
951
|
+
const D = [];
|
|
952
|
+
for (const b of w)
|
|
784
953
|
if (n[b]) {
|
|
785
|
-
const
|
|
786
|
-
for (const
|
|
787
|
-
if (!
|
|
788
|
-
|
|
789
|
-
const { spec:
|
|
790
|
-
for (const
|
|
791
|
-
const
|
|
792
|
-
|
|
954
|
+
const C = Object.keys(n[b]);
|
|
955
|
+
for (const a of C)
|
|
956
|
+
if (!g.has(a)) {
|
|
957
|
+
D.push(a), g.add(a);
|
|
958
|
+
const { spec: S, id: y } = n[b][a];
|
|
959
|
+
for (const f of S.axesSpec) {
|
|
960
|
+
const v = _.fromAxisSpec(f).toCanonicalString();
|
|
961
|
+
x.has(v) || x.set(v, {
|
|
793
962
|
kind: "axis",
|
|
794
|
-
name:
|
|
795
|
-
label: (
|
|
796
|
-
type:
|
|
963
|
+
name: f.name,
|
|
964
|
+
label: (i = (c = f.annotations) == null ? void 0 : c[he]) != null ? i : "",
|
|
965
|
+
type: f.type,
|
|
797
966
|
mustBeConsumed: !1,
|
|
798
967
|
dividable: !1,
|
|
799
|
-
spec:
|
|
800
|
-
annotations:
|
|
801
|
-
isSubsetFilter: ((
|
|
802
|
-
isDiscreteFilter:
|
|
968
|
+
spec: f,
|
|
969
|
+
annotations: f.annotations,
|
|
970
|
+
isSubsetFilter: ((p = f.annotations) == null ? void 0 : p[J]) === "true",
|
|
971
|
+
isDiscreteFilter: f.type === "String" || ((u = f.annotations) == null ? void 0 : u[ee]) === "true",
|
|
803
972
|
parentSources: [y.toCanonicalString()]
|
|
804
973
|
});
|
|
805
974
|
}
|
|
806
975
|
}
|
|
807
976
|
}
|
|
808
|
-
|
|
977
|
+
w = D;
|
|
809
978
|
}
|
|
810
|
-
return {
|
|
979
|
+
return { parentAxes: d, parentAxesList: h, linkerAxes: g, optionsInfo: x };
|
|
811
980
|
}
|
|
812
|
-
async getOptions(e, o, n, l, s, c,
|
|
813
|
-
var u,
|
|
814
|
-
const x = this.settings.multipleSelectors,
|
|
981
|
+
async getOptions(e, o, n, l, s, r, c, i = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Set()) {
|
|
982
|
+
var u, m, d, h, g;
|
|
983
|
+
const x = this.settings.multipleSelectors, w = this.settings.required, D = await this.checkStateConsistency(e, o, s, r);
|
|
815
984
|
if (this.dependsOn.length && this.dependsOn.some((O) => o.components[O].selectorStates.length === 0))
|
|
816
|
-
return { multipleSelectors: x, required:
|
|
985
|
+
return { multipleSelectors: x, required: w, stateConsistency: D, options: [], optionsInfo: /* @__PURE__ */ new Map() };
|
|
817
986
|
if (this.strictlyDependsOnParents && !this.settings.isDataComponent && this.parentComponents.some((O) => o.components[O].selectorStates.length === 0))
|
|
818
|
-
return { multipleSelectors: x, required:
|
|
819
|
-
const
|
|
987
|
+
return { multipleSelectors: x, required: w, stateConsistency: D, options: [], optionsInfo: /* @__PURE__ */ new Map() };
|
|
988
|
+
const b = this.getParentSelectedSources(e, o), C = (await e.pFrameProvider.getColumns([], !1, this.allowedTypes, void 0, this.annotations)).filter((O) => !l.has(O.toCanonicalString())), { parentAxes: a, linkerAxes: S, parentAxesList: y, optionsInfo: f } = await this.getAllowedAxes(e, o, s), v = o.components[this.componentName], P = [];
|
|
820
989
|
if (this.settings.axesAllowed)
|
|
821
|
-
for (const O of
|
|
822
|
-
const
|
|
823
|
-
([
|
|
824
|
-
var
|
|
825
|
-
return ((
|
|
990
|
+
for (const O of a) {
|
|
991
|
+
const N = A(O), L = f.get(N.toCanonicalString()), E = this.allowedTypes.includes(L.spec.type), F = Object.entries(this.annotations).every(
|
|
992
|
+
([oe, q]) => {
|
|
993
|
+
var U;
|
|
994
|
+
return ((U = L.spec.annotations) == null ? void 0 : U[oe]) === q;
|
|
826
995
|
}
|
|
827
|
-
),
|
|
828
|
-
|
|
996
|
+
), G = this.checkSourceBySpec ? this.checkSourceBySpec(L.spec, o) : !0, M = !this.settings.homogeneous || !(L != null && L.mustBeConsumed), K = !l.has(O), Z = i.has(N.name) || p.has(N.toCanonicalString()), ne = v.selectorStates.some((oe) => oe.selectedSource === O);
|
|
997
|
+
E && F && G && M && K && !Z && !ne && P.push({ value: O });
|
|
829
998
|
}
|
|
830
999
|
if (this.settings.columnsAllowed) {
|
|
831
1000
|
const O = !this.settings.columnsWithExtraAxesAllowed && this.strictlyDependsOnParents;
|
|
832
|
-
for (const
|
|
833
|
-
const
|
|
1001
|
+
for (const N of C) {
|
|
1002
|
+
const L = N.toCanonicalString(), E = A(L), F = await e.pFrameProvider.getColumnSpecById(E);
|
|
1003
|
+
if (!F)
|
|
1004
|
+
continue;
|
|
1005
|
+
const G = be(
|
|
1006
|
+
F,
|
|
1007
|
+
y,
|
|
1008
|
+
a,
|
|
1009
|
+
S,
|
|
1010
|
+
r
|
|
1011
|
+
).map((q) => _.fromAxisSpec(q).toCanonicalString()), M = new Set(G);
|
|
834
1012
|
if (
|
|
835
1013
|
// do not add to available options label columns, or columns that are not fit by custom spec condition, or columns that are not fit by condition for data inputs
|
|
836
|
-
|
|
1014
|
+
Fe(F) || Je(F) || this.checkSourceBySpec && !this.checkSourceBySpec(F, o) || this.settings.isDataComponent && !c(F) || O && G.length > 0 || b.length && G.length > 0 && !F.axesSpec.some((q) => {
|
|
1015
|
+
const U = _.fromAxisSpec(q).toCanonicalString();
|
|
1016
|
+
return a.has(U) || S.has(U);
|
|
1017
|
+
})
|
|
837
1018
|
)
|
|
838
1019
|
continue;
|
|
839
|
-
const
|
|
840
|
-
if (this.settings.columnsWithExtraAxesAllowed &&
|
|
841
|
-
|
|
842
|
-
}),
|
|
843
|
-
const
|
|
1020
|
+
const K = (m = (u = F == null ? void 0 : F.axesSpec) == null ? void 0 : u.map((q) => _.fromAxisSpec(q).toCanonicalString())) != null ? m : [], Z = {};
|
|
1021
|
+
if (this.settings.columnsWithExtraAxesAllowed && K.forEach((q, U) => {
|
|
1022
|
+
M.has(q) && (Z[q] = U);
|
|
1023
|
+
}), F) {
|
|
1024
|
+
const q = (d = n[L]) != null ? d : await T(e, N.toCanonicalString(), []), U = {
|
|
844
1025
|
kind: "column",
|
|
845
|
-
name:
|
|
846
|
-
label:
|
|
847
|
-
type:
|
|
848
|
-
spec:
|
|
849
|
-
annotations:
|
|
850
|
-
isSubsetFilter: ((
|
|
851
|
-
isDiscreteFilter:
|
|
852
|
-
axesToBeFixed:
|
|
853
|
-
axesToBeFixedIndexes:
|
|
1026
|
+
name: F.name,
|
|
1027
|
+
label: q,
|
|
1028
|
+
type: F.valueType,
|
|
1029
|
+
spec: F,
|
|
1030
|
+
annotations: F.annotations,
|
|
1031
|
+
isSubsetFilter: ((h = F.annotations) == null ? void 0 : h[J]) === "true",
|
|
1032
|
+
isDiscreteFilter: F.valueType === "String" || ((g = F.annotations) == null ? void 0 : g[ee]) === "true",
|
|
1033
|
+
axesToBeFixed: G,
|
|
1034
|
+
axesToBeFixedIndexes: Z
|
|
854
1035
|
};
|
|
855
|
-
|
|
1036
|
+
f.set(E.toCanonicalString(), U);
|
|
856
1037
|
}
|
|
857
|
-
const
|
|
858
|
-
(
|
|
1038
|
+
const ne = i.has(E.name) || p.has(E.toCanonicalString()), oe = o.components[this.componentName].selectorStates.some(
|
|
1039
|
+
(q) => q.selectedSource === L
|
|
859
1040
|
);
|
|
860
|
-
!
|
|
1041
|
+
!ne && !oe && P.push({ value: L });
|
|
861
1042
|
}
|
|
862
1043
|
}
|
|
863
|
-
return { multipleSelectors: x, required:
|
|
1044
|
+
return { multipleSelectors: x, required: w, stateConsistency: D, options: P, optionsInfo: f };
|
|
864
1045
|
}
|
|
865
1046
|
};
|
|
866
|
-
|
|
1047
|
+
De.DefaultSettings = {
|
|
867
1048
|
isDataComponent: !1,
|
|
868
1049
|
multipleSelectors: !1,
|
|
869
1050
|
required: !1,
|
|
@@ -873,7 +1054,7 @@ Ae.DefaultSettings = {
|
|
|
873
1054
|
columnsWithExtraAxesAllowed: !0,
|
|
874
1055
|
dimensionConsumer: !1
|
|
875
1056
|
};
|
|
876
|
-
var
|
|
1057
|
+
var I = De, $e = {
|
|
877
1058
|
type: "bubble",
|
|
878
1059
|
components: {
|
|
879
1060
|
valueSize: { type: "simple", selectorStates: [] },
|
|
@@ -887,23 +1068,23 @@ var D = Ae, Ve = {
|
|
|
887
1068
|
},
|
|
888
1069
|
dividedAxes: {}
|
|
889
1070
|
};
|
|
890
|
-
function
|
|
1071
|
+
function ae(t, e) {
|
|
891
1072
|
if (!e.length)
|
|
892
1073
|
return [];
|
|
893
|
-
const o = e.map((s) =>
|
|
1074
|
+
const o = e.map((s) => A(s)), n = Object.values(t.columnsData)[0].length, l = [];
|
|
894
1075
|
for (let s = 0; s < n; s++) {
|
|
895
|
-
const
|
|
896
|
-
const
|
|
897
|
-
return B(
|
|
1076
|
+
const r = o.map((c) => {
|
|
1077
|
+
const i = c.toCanonicalString();
|
|
1078
|
+
return B(c) ? t.columnsData[i][s] : t.axesData[i][s];
|
|
898
1079
|
}).join(", ");
|
|
899
|
-
l.push(
|
|
1080
|
+
l.push(r);
|
|
900
1081
|
}
|
|
901
1082
|
return l;
|
|
902
1083
|
}
|
|
903
|
-
var
|
|
1084
|
+
var Qe = class extends Q {
|
|
904
1085
|
constructor() {
|
|
905
1086
|
super({
|
|
906
|
-
valueSize: new
|
|
1087
|
+
valueSize: new I({
|
|
907
1088
|
componentName: "valueSize",
|
|
908
1089
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
909
1090
|
strictlyDependsOnParents: !0,
|
|
@@ -915,7 +1096,7 @@ var je = class extends R {
|
|
|
915
1096
|
required: !0
|
|
916
1097
|
}
|
|
917
1098
|
}),
|
|
918
|
-
valueColor: new
|
|
1099
|
+
valueColor: new I({
|
|
919
1100
|
componentName: "valueColor",
|
|
920
1101
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
921
1102
|
strictlyDependsOnParents: !0,
|
|
@@ -927,7 +1108,7 @@ var je = class extends R {
|
|
|
927
1108
|
required: !0
|
|
928
1109
|
}
|
|
929
1110
|
}),
|
|
930
|
-
x: new
|
|
1111
|
+
x: new I({
|
|
931
1112
|
componentName: "x",
|
|
932
1113
|
allowedTypes: ["Int", "String", "Long"],
|
|
933
1114
|
strictlyDependsOnParents: !0,
|
|
@@ -940,7 +1121,7 @@ var je = class extends R {
|
|
|
940
1121
|
columnsAllowed: !1
|
|
941
1122
|
}
|
|
942
1123
|
}),
|
|
943
|
-
y: new
|
|
1124
|
+
y: new I({
|
|
944
1125
|
componentName: "y",
|
|
945
1126
|
allowedTypes: ["Int", "String", "Long"],
|
|
946
1127
|
strictlyDependsOnParents: !0,
|
|
@@ -953,7 +1134,7 @@ var je = class extends R {
|
|
|
953
1134
|
columnsAllowed: !1
|
|
954
1135
|
}
|
|
955
1136
|
}),
|
|
956
|
-
tooltipContent: new
|
|
1137
|
+
tooltipContent: new I({
|
|
957
1138
|
componentName: "tooltipContent",
|
|
958
1139
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
959
1140
|
strictlyDependsOnParents: !0,
|
|
@@ -964,7 +1145,7 @@ var je = class extends R {
|
|
|
964
1145
|
multipleSelectors: !0
|
|
965
1146
|
}
|
|
966
1147
|
}),
|
|
967
|
-
facetBy: new
|
|
1148
|
+
facetBy: new I({
|
|
968
1149
|
componentName: "facetBy",
|
|
969
1150
|
allowedTypes: ["String", "Int", "Long"],
|
|
970
1151
|
strictlyDependsOnParents: !0,
|
|
@@ -976,7 +1157,7 @@ var je = class extends R {
|
|
|
976
1157
|
}
|
|
977
1158
|
})
|
|
978
1159
|
}, {
|
|
979
|
-
filters: new
|
|
1160
|
+
filters: new I({
|
|
980
1161
|
componentName: "filters",
|
|
981
1162
|
allowedTypes: ["String", "Int", "Long", "Double", "Long"],
|
|
982
1163
|
strictlyDependsOnParents: !0,
|
|
@@ -987,9 +1168,9 @@ var je = class extends R {
|
|
|
987
1168
|
dimensionConsumer: !0,
|
|
988
1169
|
multipleSelectors: !0
|
|
989
1170
|
},
|
|
990
|
-
checkSourceBySpec:
|
|
1171
|
+
checkSourceBySpec: R
|
|
991
1172
|
}),
|
|
992
|
-
tabBy: new
|
|
1173
|
+
tabBy: new I({
|
|
993
1174
|
componentName: "tabBy",
|
|
994
1175
|
allowedTypes: ["String", "Int"],
|
|
995
1176
|
strictlyDependsOnParents: !0,
|
|
@@ -1005,139 +1186,141 @@ var je = class extends R {
|
|
|
1005
1186
|
async getMustBeConsumedAxes(t, e) {
|
|
1006
1187
|
if (!e.components.valueColor.selectorStates.length)
|
|
1007
1188
|
return /* @__PURE__ */ new Set();
|
|
1008
|
-
const o = e.components.valueColor.selectorStates[0].selectedSource, n = await t.pFrameProvider.getColumnSpecById(
|
|
1189
|
+
const o = e.components.valueColor.selectorStates[0].selectedSource, n = await t.pFrameProvider.getColumnSpecById(A(o));
|
|
1009
1190
|
return n ? new Set(n.axesSpec.map((l) => _.fromAxisSpec(l).toCanonicalString())) : /* @__PURE__ */ new Set();
|
|
1010
1191
|
}
|
|
1011
1192
|
async createDataByColumns(t, e) {
|
|
1012
1193
|
var o, n, l;
|
|
1013
|
-
const s = (o = e.components.valueColor.selectorStates[0]) == null ? void 0 : o.selectedSource,
|
|
1014
|
-
if (!s || !
|
|
1194
|
+
const s = (o = e.components.valueColor.selectorStates[0]) == null ? void 0 : o.selectedSource, r = (n = e.components.valueSize.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
1195
|
+
if (!s || !r)
|
|
1015
1196
|
throw Error("Value column is not valid");
|
|
1016
|
-
const
|
|
1017
|
-
if (!
|
|
1197
|
+
const c = A(s), i = A(r);
|
|
1198
|
+
if (!c || !i || !B(c) && !B(i))
|
|
1018
1199
|
throw Error("Value column is not valid");
|
|
1019
|
-
const
|
|
1200
|
+
const p = {
|
|
1020
1201
|
type: "columns",
|
|
1021
|
-
id: (l =
|
|
1202
|
+
id: (l = z(e.components)) != null ? l : "",
|
|
1022
1203
|
values: {}
|
|
1023
|
-
},
|
|
1204
|
+
}, { linkerColumnsMap: u, compositeLinkerMap: m } = await X(t), d = [
|
|
1024
1205
|
...e.components.filters.selectorStates,
|
|
1025
1206
|
...e.components.tabBy.selectorStates
|
|
1026
|
-
],
|
|
1207
|
+
], h = Y(d), g = d.map((F) => A(F.selectedSource)).filter(B), x = [c, i].filter(B), w = x.map((F) => F.toCanonicalString()), D = await $(t, w), b = [
|
|
1027
1208
|
e.components.facetBy,
|
|
1028
1209
|
e.components.x,
|
|
1029
1210
|
e.components.y,
|
|
1030
1211
|
e.components.tooltipContent
|
|
1031
|
-
],
|
|
1032
|
-
for (const { selectedSource:
|
|
1033
|
-
|
|
1212
|
+
], C = [], a = x.map(() => []), S = [], y = [];
|
|
1213
|
+
for (const { selectedSource: F, fixedAxes: G } of d)
|
|
1214
|
+
y.push(...await V(
|
|
1034
1215
|
t,
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1216
|
+
u,
|
|
1217
|
+
m,
|
|
1218
|
+
D,
|
|
1219
|
+
F,
|
|
1220
|
+
G
|
|
1221
|
+
)), a.push(
|
|
1222
|
+
(G ?? []).map(({ axisIdx: M, axisValue: K }) => ({ idx: M, value: K }))
|
|
1041
1223
|
);
|
|
1042
|
-
for (const
|
|
1043
|
-
for (const { selectedSource:
|
|
1044
|
-
|
|
1045
|
-
(
|
|
1046
|
-
),
|
|
1224
|
+
for (const F of b)
|
|
1225
|
+
for (const { selectedSource: G, fixedAxes: M } of F.selectorStates) {
|
|
1226
|
+
C.push(A(G)), S.push(
|
|
1227
|
+
(M ?? []).map(({ axisIdx: Z, axisValue: ne }) => ({ idx: Z, value: ne }))
|
|
1228
|
+
), y.push(...await V(
|
|
1047
1229
|
t,
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1230
|
+
u,
|
|
1231
|
+
m,
|
|
1232
|
+
D,
|
|
1233
|
+
G,
|
|
1234
|
+
M
|
|
1052
1235
|
));
|
|
1053
|
-
const
|
|
1054
|
-
|
|
1236
|
+
const K = await k(t, G, w);
|
|
1237
|
+
K && C.push(K);
|
|
1055
1238
|
}
|
|
1056
|
-
const
|
|
1057
|
-
[...
|
|
1058
|
-
|
|
1059
|
-
|
|
1239
|
+
const f = await t.pFrameProvider.getTableOuterJoin(
|
|
1240
|
+
[...x, ...y, ...g],
|
|
1241
|
+
C,
|
|
1242
|
+
h,
|
|
1060
1243
|
!0,
|
|
1061
|
-
|
|
1062
|
-
|
|
1244
|
+
a,
|
|
1245
|
+
S
|
|
1063
1246
|
);
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1067
|
-
}),
|
|
1068
|
-
const
|
|
1069
|
-
async (
|
|
1070
|
-
var
|
|
1071
|
-
return (
|
|
1247
|
+
C.forEach((F) => {
|
|
1248
|
+
const G = F.toCanonicalString();
|
|
1249
|
+
p.values[G] = B(F) ? f.columnsData[G] : f.axesData[G];
|
|
1250
|
+
}), p.values[s] = B(c) ? f.columnsData[s] : f.axesData[s], p.values[r] = B(i) ? f.columnsData[r] : f.axesData[r];
|
|
1251
|
+
const v = e.components.x.selectorStates.map((F) => F.selectedSource), P = v.join(", "), O = await Promise.all(v.map(
|
|
1252
|
+
async (F) => {
|
|
1253
|
+
var G, M;
|
|
1254
|
+
return (M = (G = await k(t, F, w)) == null ? void 0 : G.toCanonicalString()) != null ? M : F;
|
|
1072
1255
|
}
|
|
1073
1256
|
));
|
|
1074
|
-
|
|
1075
|
-
const N = e.components.y.selectorStates.map((
|
|
1076
|
-
async (
|
|
1077
|
-
var
|
|
1078
|
-
return (
|
|
1257
|
+
p.values[P] = ae(f, v), p.values.xLabels = ae(f, O);
|
|
1258
|
+
const N = e.components.y.selectorStates.map((F) => F.selectedSource), L = N.join(", "), E = await Promise.all(N.map(
|
|
1259
|
+
async (F) => {
|
|
1260
|
+
var G, M;
|
|
1261
|
+
return (M = (G = await k(t, F, w)) == null ? void 0 : G.toCanonicalString()) != null ? M : F;
|
|
1079
1262
|
}
|
|
1080
1263
|
));
|
|
1081
|
-
return
|
|
1264
|
+
return p.values[L] = ae(f, N), p.values.yLabels = ae(f, E), { byColumns: p };
|
|
1082
1265
|
}
|
|
1083
1266
|
async createChartSettings(t, e) {
|
|
1084
1267
|
var o, n;
|
|
1085
1268
|
const l = (o = e.components.valueColor.selectorStates[0]) == null ? void 0 : o.selectedSource, s = (n = e.components.valueSize.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
1086
1269
|
if (!l || !s)
|
|
1087
1270
|
throw Error("Value column is not valid");
|
|
1088
|
-
const
|
|
1089
|
-
if (!B(
|
|
1271
|
+
const r = A(l), c = A(s);
|
|
1272
|
+
if (!B(r) && !B(c))
|
|
1090
1273
|
throw Error("Value column is not valid");
|
|
1091
|
-
const
|
|
1274
|
+
const i = [r, c].filter(B).map((C) => C.toCanonicalString()), p = {
|
|
1092
1275
|
type: "column",
|
|
1093
1276
|
value: l,
|
|
1094
|
-
label: await
|
|
1095
|
-
},
|
|
1277
|
+
label: await T(t, l, [])
|
|
1278
|
+
}, u = {
|
|
1096
1279
|
type: "column",
|
|
1097
1280
|
value: s,
|
|
1098
|
-
label: await
|
|
1099
|
-
}, d = e.components.x.selectorStates.map(({ selectedSource:
|
|
1100
|
-
var
|
|
1281
|
+
label: await T(t, s, [])
|
|
1282
|
+
}, d = e.components.x.selectorStates.map(({ selectedSource: C }) => C).join(", "), g = e.components.y.selectorStates.map(({ selectedSource: C }) => C).join(", "), x = await Promise.all(e.components.facetBy.selectorStates.map(async (C) => {
|
|
1283
|
+
var a, S;
|
|
1101
1284
|
return {
|
|
1102
1285
|
type: "column",
|
|
1103
|
-
value: (
|
|
1286
|
+
value: (S = (a = await k(t, C.selectedSource, i)) == null ? void 0 : a.toCanonicalString()) != null ? S : C.selectedSource
|
|
1104
1287
|
};
|
|
1105
|
-
})),
|
|
1106
|
-
e.components.tooltipContent.selectorStates.map(async (
|
|
1107
|
-
var
|
|
1108
|
-
const y =
|
|
1288
|
+
})), w = (await Promise.all(e.components.x.selectorStates.map((C) => T(t, C.selectedSource, i)))).join(", "), D = (await Promise.all(e.components.y.selectorStates.map((C) => T(t, C.selectedSource, i)))).join(", "), b = await Promise.all(
|
|
1289
|
+
e.components.tooltipContent.selectorStates.map(async (C) => {
|
|
1290
|
+
var a, S;
|
|
1291
|
+
const y = C.selectedSource;
|
|
1109
1292
|
return {
|
|
1110
1293
|
type: "column",
|
|
1111
|
-
label: await
|
|
1294
|
+
label: await T(t, y, i) || y,
|
|
1112
1295
|
value: y,
|
|
1113
|
-
valueLabels: (
|
|
1296
|
+
valueLabels: (S = (a = await k(t, y, i)) == null ? void 0 : a.toCanonicalString()) != null ? S : y
|
|
1114
1297
|
};
|
|
1115
1298
|
})
|
|
1116
1299
|
);
|
|
1117
1300
|
return {
|
|
1118
1301
|
type: "bubble",
|
|
1119
|
-
valueColor:
|
|
1120
|
-
valueSize:
|
|
1302
|
+
valueColor: p,
|
|
1303
|
+
valueSize: u,
|
|
1121
1304
|
xColumn: {
|
|
1122
1305
|
type: "column",
|
|
1123
1306
|
value: d,
|
|
1124
|
-
label:
|
|
1307
|
+
label: w,
|
|
1125
1308
|
valueLabels: "xLabels"
|
|
1126
1309
|
},
|
|
1127
1310
|
yColumn: {
|
|
1128
1311
|
type: "column",
|
|
1129
|
-
value:
|
|
1130
|
-
label:
|
|
1312
|
+
value: g,
|
|
1313
|
+
label: D,
|
|
1131
1314
|
valueLabels: "yLabels"
|
|
1132
1315
|
},
|
|
1133
|
-
facetBy:
|
|
1316
|
+
facetBy: x,
|
|
1134
1317
|
tooltips: {
|
|
1135
1318
|
show: !0,
|
|
1136
1319
|
content: b
|
|
1137
1320
|
}
|
|
1138
1321
|
};
|
|
1139
1322
|
}
|
|
1140
|
-
},
|
|
1323
|
+
}, Ze = {
|
|
1141
1324
|
type: "histogram",
|
|
1142
1325
|
components: {
|
|
1143
1326
|
value: { type: "simple", selectorStates: [] },
|
|
@@ -1147,11 +1330,11 @@ var je = class extends R {
|
|
|
1147
1330
|
facetBy: { type: "simple", selectorStates: [] }
|
|
1148
1331
|
},
|
|
1149
1332
|
dividedAxes: {}
|
|
1150
|
-
},
|
|
1333
|
+
}, et = class extends Q {
|
|
1151
1334
|
constructor() {
|
|
1152
1335
|
super(
|
|
1153
1336
|
{
|
|
1154
|
-
value: new
|
|
1337
|
+
value: new I({
|
|
1155
1338
|
componentName: "value",
|
|
1156
1339
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
1157
1340
|
settings: {
|
|
@@ -1161,7 +1344,7 @@ var je = class extends R {
|
|
|
1161
1344
|
required: !0
|
|
1162
1345
|
}
|
|
1163
1346
|
}),
|
|
1164
|
-
grouping: new
|
|
1347
|
+
grouping: new I({
|
|
1165
1348
|
componentName: "grouping",
|
|
1166
1349
|
allowedTypes: ["String", "Int", "Long"],
|
|
1167
1350
|
parentComponents: ["value"],
|
|
@@ -1171,7 +1354,7 @@ var je = class extends R {
|
|
|
1171
1354
|
multipleSelectors: !1
|
|
1172
1355
|
}
|
|
1173
1356
|
}),
|
|
1174
|
-
facetBy: new
|
|
1357
|
+
facetBy: new I({
|
|
1175
1358
|
componentName: "facetBy",
|
|
1176
1359
|
allowedTypes: ["String", "Int", "Long"],
|
|
1177
1360
|
parentComponents: ["value"],
|
|
@@ -1184,7 +1367,7 @@ var je = class extends R {
|
|
|
1184
1367
|
})
|
|
1185
1368
|
},
|
|
1186
1369
|
{
|
|
1187
|
-
filters: new
|
|
1370
|
+
filters: new I({
|
|
1188
1371
|
componentName: "filters",
|
|
1189
1372
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
1190
1373
|
parentComponents: ["value"],
|
|
@@ -1195,9 +1378,9 @@ var je = class extends R {
|
|
|
1195
1378
|
dimensionConsumer: !0,
|
|
1196
1379
|
multipleSelectors: !0
|
|
1197
1380
|
},
|
|
1198
|
-
checkSourceBySpec:
|
|
1381
|
+
checkSourceBySpec: R
|
|
1199
1382
|
}),
|
|
1200
|
-
tabBy: new
|
|
1383
|
+
tabBy: new I({
|
|
1201
1384
|
componentName: "tabBy",
|
|
1202
1385
|
allowedTypes: ["String", "Int"],
|
|
1203
1386
|
parentComponents: ["value"],
|
|
@@ -1216,87 +1399,85 @@ var je = class extends R {
|
|
|
1216
1399
|
const l = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource;
|
|
1217
1400
|
if (!l)
|
|
1218
1401
|
throw Error("Value column is not valid");
|
|
1219
|
-
const s =
|
|
1402
|
+
const s = A(l);
|
|
1220
1403
|
if (!B(s))
|
|
1221
1404
|
throw Error("Value column is not valid");
|
|
1222
|
-
const
|
|
1405
|
+
const r = {
|
|
1223
1406
|
type: "columns",
|
|
1224
|
-
id: (n =
|
|
1407
|
+
id: (n = z(e.components)) != null ? n : "",
|
|
1225
1408
|
values: {}
|
|
1226
|
-
},
|
|
1409
|
+
}, { linkerColumnsMap: c, compositeLinkerMap: i } = await X(t), p = [
|
|
1227
1410
|
...e.components.filters.selectorStates,
|
|
1228
1411
|
...e.components.tabBy.selectorStates
|
|
1229
|
-
], u =
|
|
1230
|
-
for (const { selectedSource:
|
|
1231
|
-
|
|
1232
|
-
...await
|
|
1233
|
-
),
|
|
1234
|
-
|
|
1235
|
-
), A.push(
|
|
1236
|
-
(i ?? []).map(({ axisIdx: f, axisValue: y }) => ({ idx: f, value: y }))
|
|
1412
|
+
], u = Y(p), m = p.map((a) => A(a.selectedSource)).filter(B), d = [l], h = await $(t, d), g = [e.components.facetBy, e.components.grouping], x = [], w = [[]], D = [], b = [];
|
|
1413
|
+
for (const { selectedSource: a, fixedAxes: S } of p)
|
|
1414
|
+
b.push(
|
|
1415
|
+
...await V(t, c, i, h, a, S)
|
|
1416
|
+
), w.push(
|
|
1417
|
+
(S ?? []).map(({ axisIdx: y, axisValue: f }) => ({ idx: y, value: f }))
|
|
1237
1418
|
);
|
|
1238
|
-
for (const
|
|
1239
|
-
for (const { selectedSource:
|
|
1240
|
-
|
|
1241
|
-
(
|
|
1242
|
-
),
|
|
1243
|
-
...await
|
|
1419
|
+
for (const a of g)
|
|
1420
|
+
for (const { selectedSource: S, fixedAxes: y } of a.selectorStates) {
|
|
1421
|
+
x.push(A(S)), D.push(
|
|
1422
|
+
(y ?? []).map(({ axisIdx: v, axisValue: P }) => ({ idx: v, value: P }))
|
|
1423
|
+
), b.push(
|
|
1424
|
+
...await V(t, c, i, h, S, y)
|
|
1244
1425
|
);
|
|
1245
|
-
const
|
|
1246
|
-
|
|
1426
|
+
const f = await k(t, S, d);
|
|
1427
|
+
f && x.push(f);
|
|
1247
1428
|
}
|
|
1248
|
-
const
|
|
1249
|
-
[s, ...
|
|
1250
|
-
|
|
1429
|
+
const C = await t.pFrameProvider.getTableOuterJoin(
|
|
1430
|
+
[s, ...b, ...m],
|
|
1431
|
+
x,
|
|
1251
1432
|
u,
|
|
1252
1433
|
!0,
|
|
1253
|
-
|
|
1254
|
-
|
|
1434
|
+
w,
|
|
1435
|
+
D
|
|
1255
1436
|
);
|
|
1256
|
-
return
|
|
1257
|
-
const
|
|
1258
|
-
|
|
1259
|
-
}),
|
|
1437
|
+
return x.forEach((a) => {
|
|
1438
|
+
const S = a.toCanonicalString();
|
|
1439
|
+
r.values[S] = B(a) ? C.columnsData[S] : C.axesData[S];
|
|
1440
|
+
}), r.values[s.toCanonicalString()] = C.columnsData[s.toCanonicalString()], { byColumns: r };
|
|
1260
1441
|
}
|
|
1261
1442
|
async createChartSettings(t, e) {
|
|
1262
1443
|
var o, n;
|
|
1263
1444
|
const l = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource;
|
|
1264
1445
|
if (!l)
|
|
1265
1446
|
throw Error("Value column is not valid");
|
|
1266
|
-
const s =
|
|
1447
|
+
const s = A(l);
|
|
1267
1448
|
if (!B(s))
|
|
1268
1449
|
throw Error("Value column is not valid");
|
|
1269
|
-
const
|
|
1450
|
+
const r = [l], c = {
|
|
1270
1451
|
type: "column",
|
|
1271
1452
|
value: l,
|
|
1272
|
-
label: await
|
|
1273
|
-
},
|
|
1274
|
-
e.components.facetBy.selectorStates.map(async (
|
|
1453
|
+
label: await T(t, l, [])
|
|
1454
|
+
}, i = await Promise.all(
|
|
1455
|
+
e.components.facetBy.selectorStates.map(async (u) => {
|
|
1275
1456
|
var m, d;
|
|
1276
1457
|
return {
|
|
1277
1458
|
type: "column",
|
|
1278
|
-
value: (d = (m = await
|
|
1459
|
+
value: (d = (m = await k(t, u.selectedSource, r)) == null ? void 0 : m.toCanonicalString()) != null ? d : u.selectedSource
|
|
1279
1460
|
};
|
|
1280
1461
|
})
|
|
1281
1462
|
);
|
|
1282
|
-
let
|
|
1463
|
+
let p;
|
|
1283
1464
|
if (e.components.grouping.selectorStates.length) {
|
|
1284
|
-
const { selectedSource:
|
|
1285
|
-
|
|
1465
|
+
const { selectedSource: u } = e.components.grouping.selectorStates[0];
|
|
1466
|
+
p = {
|
|
1286
1467
|
type: "column",
|
|
1287
|
-
value:
|
|
1288
|
-
label: await
|
|
1289
|
-
valueLabels: (n = await
|
|
1468
|
+
value: u,
|
|
1469
|
+
label: await T(t, u, r),
|
|
1470
|
+
valueLabels: (n = await k(t, u, r)) == null ? void 0 : n.toCanonicalString()
|
|
1290
1471
|
};
|
|
1291
1472
|
}
|
|
1292
1473
|
return {
|
|
1293
1474
|
type: "histogram",
|
|
1294
|
-
valueColumn:
|
|
1295
|
-
facetBy:
|
|
1296
|
-
grouping:
|
|
1475
|
+
valueColumn: c,
|
|
1476
|
+
facetBy: i,
|
|
1477
|
+
grouping: p
|
|
1297
1478
|
};
|
|
1298
1479
|
}
|
|
1299
|
-
},
|
|
1480
|
+
}, tt = {
|
|
1300
1481
|
type: "discrete",
|
|
1301
1482
|
components: {
|
|
1302
1483
|
y: { type: "simple", selectorStates: [] },
|
|
@@ -1307,16 +1488,16 @@ var je = class extends R {
|
|
|
1307
1488
|
secondaryGrouping: { type: "simple", selectorStates: [] }
|
|
1308
1489
|
},
|
|
1309
1490
|
dividedAxes: {}
|
|
1310
|
-
},
|
|
1491
|
+
}, nt = class extends Q {
|
|
1311
1492
|
constructor() {
|
|
1312
1493
|
super(
|
|
1313
1494
|
{
|
|
1314
|
-
y: new
|
|
1495
|
+
y: new I({
|
|
1315
1496
|
componentName: "y",
|
|
1316
1497
|
allowedTypes: ["Int", "Double", "Long", "Float"],
|
|
1317
1498
|
settings: { isDataComponent: !0 }
|
|
1318
1499
|
}),
|
|
1319
|
-
primaryGrouping: new
|
|
1500
|
+
primaryGrouping: new I({
|
|
1320
1501
|
componentName: "primaryGrouping",
|
|
1321
1502
|
allowedTypes: ["String", "Int", "Long"],
|
|
1322
1503
|
strictlyDependsOnParents: !0,
|
|
@@ -1327,7 +1508,7 @@ var je = class extends R {
|
|
|
1327
1508
|
homogeneous: !0
|
|
1328
1509
|
}
|
|
1329
1510
|
}),
|
|
1330
|
-
secondaryGrouping: new
|
|
1511
|
+
secondaryGrouping: new I({
|
|
1331
1512
|
componentName: "secondaryGrouping",
|
|
1332
1513
|
allowedTypes: ["String", "Int", "Long"],
|
|
1333
1514
|
strictlyDependsOnParents: !0,
|
|
@@ -1338,7 +1519,7 @@ var je = class extends R {
|
|
|
1338
1519
|
homogeneous: !0
|
|
1339
1520
|
}
|
|
1340
1521
|
}),
|
|
1341
|
-
facetBy: new
|
|
1522
|
+
facetBy: new I({
|
|
1342
1523
|
componentName: "facetBy",
|
|
1343
1524
|
allowedTypes: ["String", "Int", "Long"],
|
|
1344
1525
|
strictlyDependsOnParents: !0,
|
|
@@ -1352,7 +1533,7 @@ var je = class extends R {
|
|
|
1352
1533
|
})
|
|
1353
1534
|
},
|
|
1354
1535
|
{
|
|
1355
|
-
filters: new
|
|
1536
|
+
filters: new I({
|
|
1356
1537
|
componentName: "filters",
|
|
1357
1538
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
1358
1539
|
strictlyDependsOnParents: !0,
|
|
@@ -1363,9 +1544,9 @@ var je = class extends R {
|
|
|
1363
1544
|
dimensionConsumer: !0,
|
|
1364
1545
|
multipleSelectors: !0
|
|
1365
1546
|
},
|
|
1366
|
-
checkSourceBySpec:
|
|
1547
|
+
checkSourceBySpec: R
|
|
1367
1548
|
}),
|
|
1368
|
-
tabBy: new
|
|
1549
|
+
tabBy: new I({
|
|
1369
1550
|
componentName: "tabBy",
|
|
1370
1551
|
allowedTypes: ["String", "Int"],
|
|
1371
1552
|
strictlyDependsOnParents: !0,
|
|
@@ -1381,113 +1562,115 @@ var je = class extends R {
|
|
|
1381
1562
|
}
|
|
1382
1563
|
async createDataByColumns(t, e) {
|
|
1383
1564
|
var o;
|
|
1384
|
-
const n = e.components.y.selectorStates[0].selectedSource, l =
|
|
1565
|
+
const n = e.components.y.selectorStates[0].selectedSource, l = A(n);
|
|
1385
1566
|
if (!n || !B(l))
|
|
1386
1567
|
throw Error("Y column is not valid");
|
|
1387
1568
|
const s = {
|
|
1388
1569
|
type: "columns",
|
|
1389
|
-
id: (o =
|
|
1570
|
+
id: (o = z(e.components)) != null ? o : "",
|
|
1390
1571
|
values: {}
|
|
1391
|
-
}, c = await
|
|
1572
|
+
}, { linkerColumnsMap: r, compositeLinkerMap: c } = await X(t), i = [
|
|
1392
1573
|
...e.components.filters.selectorStates,
|
|
1393
1574
|
...e.components.tabBy.selectorStates
|
|
1394
|
-
],
|
|
1395
|
-
for (const { selectedSource:
|
|
1396
|
-
|
|
1575
|
+
], p = Y(i), u = i.map((C) => A(C.selectedSource)).filter(B), m = [n], d = await $(t, m), h = [e.components.primaryGrouping, e.components.secondaryGrouping, e.components.facetBy], g = [], x = [[]], w = [], D = [];
|
|
1576
|
+
for (const { selectedSource: C, fixedAxes: a } of i)
|
|
1577
|
+
D.push(...await V(
|
|
1397
1578
|
t,
|
|
1579
|
+
r,
|
|
1398
1580
|
c,
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
)),
|
|
1403
|
-
(
|
|
1581
|
+
d,
|
|
1582
|
+
C,
|
|
1583
|
+
a
|
|
1584
|
+
)), x.push(
|
|
1585
|
+
(a ?? []).map(({ axisIdx: S, axisValue: y }) => ({ idx: S, value: y }))
|
|
1404
1586
|
);
|
|
1405
|
-
for (const
|
|
1406
|
-
for (const { selectedSource:
|
|
1407
|
-
|
|
1408
|
-
(
|
|
1409
|
-
),
|
|
1587
|
+
for (const C of h)
|
|
1588
|
+
for (const { selectedSource: a, fixedAxes: S } of C.selectorStates) {
|
|
1589
|
+
g.push(A(a)), w.push(
|
|
1590
|
+
(S ?? []).map(({ axisIdx: f, axisValue: v }) => ({ idx: f, value: v }))
|
|
1591
|
+
), D.push(...await V(
|
|
1410
1592
|
t,
|
|
1593
|
+
r,
|
|
1411
1594
|
c,
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1595
|
+
d,
|
|
1596
|
+
a,
|
|
1597
|
+
S
|
|
1415
1598
|
));
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1599
|
+
const y = await k(t, a, m);
|
|
1600
|
+
y && g.push(y);
|
|
1418
1601
|
}
|
|
1419
|
-
const
|
|
1420
|
-
[l, ...
|
|
1421
|
-
|
|
1422
|
-
|
|
1602
|
+
const b = await t.pFrameProvider.getTableOuterJoin(
|
|
1603
|
+
[l, ...D, ...u],
|
|
1604
|
+
g,
|
|
1605
|
+
p,
|
|
1423
1606
|
!0,
|
|
1424
|
-
|
|
1425
|
-
|
|
1607
|
+
x,
|
|
1608
|
+
w
|
|
1426
1609
|
);
|
|
1427
|
-
return
|
|
1428
|
-
const
|
|
1429
|
-
s.values[
|
|
1430
|
-
}), s.values[l.toCanonicalString()] =
|
|
1610
|
+
return g.forEach((C) => {
|
|
1611
|
+
const a = C.toCanonicalString();
|
|
1612
|
+
s.values[a] = B(C) ? b.columnsData[a] : b.axesData[a];
|
|
1613
|
+
}), s.values[l.toCanonicalString()] = b.columnsData[l.toCanonicalString()], { byColumns: s };
|
|
1431
1614
|
}
|
|
1432
1615
|
async createChartSettings(t, e) {
|
|
1433
1616
|
var o, n;
|
|
1434
|
-
const l = e.components.y.selectorStates[0].selectedSource, s =
|
|
1617
|
+
const l = e.components.y.selectorStates[0].selectedSource, s = A(l);
|
|
1435
1618
|
if (!l || !B(s))
|
|
1436
1619
|
throw Error("Y column is not valid");
|
|
1437
|
-
const
|
|
1620
|
+
const r = {
|
|
1438
1621
|
type: "column",
|
|
1439
1622
|
value: l,
|
|
1440
|
-
label: await
|
|
1441
|
-
},
|
|
1442
|
-
let
|
|
1623
|
+
label: await T(t, l, [])
|
|
1624
|
+
}, c = [l];
|
|
1625
|
+
let i;
|
|
1443
1626
|
if (e.components.primaryGrouping.selectorStates.length) {
|
|
1444
1627
|
const { selectedSource: m } = e.components.primaryGrouping.selectorStates[0];
|
|
1445
|
-
|
|
1628
|
+
i = {
|
|
1446
1629
|
columnName: {
|
|
1447
1630
|
type: "column",
|
|
1448
1631
|
value: m,
|
|
1449
|
-
label: await
|
|
1450
|
-
valueLabels: (o = await
|
|
1632
|
+
label: await T(t, m, c),
|
|
1633
|
+
valueLabels: (o = await k(
|
|
1451
1634
|
t,
|
|
1452
1635
|
m,
|
|
1453
|
-
|
|
1636
|
+
c
|
|
1454
1637
|
)) == null ? void 0 : o.toCanonicalString()
|
|
1455
1638
|
}
|
|
1456
1639
|
};
|
|
1457
1640
|
}
|
|
1458
|
-
let
|
|
1641
|
+
let p;
|
|
1459
1642
|
if (e.components.secondaryGrouping.selectorStates.length) {
|
|
1460
1643
|
const { selectedSource: m } = e.components.secondaryGrouping.selectorStates[0];
|
|
1461
|
-
|
|
1644
|
+
p = {
|
|
1462
1645
|
columnName: {
|
|
1463
1646
|
type: "column",
|
|
1464
1647
|
value: m,
|
|
1465
|
-
label: await
|
|
1466
|
-
valueLabels: (n = await
|
|
1648
|
+
label: await T(t, m, c),
|
|
1649
|
+
valueLabels: (n = await k(
|
|
1467
1650
|
t,
|
|
1468
1651
|
m,
|
|
1469
|
-
|
|
1652
|
+
c
|
|
1470
1653
|
)) == null ? void 0 : n.toCanonicalString()
|
|
1471
1654
|
}
|
|
1472
1655
|
};
|
|
1473
1656
|
}
|
|
1474
|
-
const
|
|
1475
|
-
var d,
|
|
1657
|
+
const u = await Promise.all(e.components.facetBy.selectorStates.map(async (m) => {
|
|
1658
|
+
var d, h;
|
|
1476
1659
|
return {
|
|
1477
1660
|
type: "column",
|
|
1478
|
-
value: (
|
|
1479
|
-
label: await
|
|
1661
|
+
value: (h = (d = await k(t, m.selectedSource, c)) == null ? void 0 : d.toCanonicalString()) != null ? h : m.selectedSource,
|
|
1662
|
+
label: await T(t, m.selectedSource, c)
|
|
1480
1663
|
};
|
|
1481
1664
|
}));
|
|
1482
1665
|
return {
|
|
1483
1666
|
type: "discrete",
|
|
1484
|
-
y:
|
|
1485
|
-
primaryGrouping:
|
|
1486
|
-
secondaryGrouping:
|
|
1487
|
-
facetBy:
|
|
1667
|
+
y: r,
|
|
1668
|
+
primaryGrouping: i,
|
|
1669
|
+
secondaryGrouping: p,
|
|
1670
|
+
facetBy: u
|
|
1488
1671
|
};
|
|
1489
1672
|
}
|
|
1490
|
-
},
|
|
1673
|
+
}, ot = {
|
|
1491
1674
|
type: "heatmap",
|
|
1492
1675
|
components: {
|
|
1493
1676
|
value: { type: "simple", selectorStates: [] },
|
|
@@ -1507,24 +1690,24 @@ var je = class extends R {
|
|
|
1507
1690
|
function pe(t) {
|
|
1508
1691
|
return t ? "kind" in t && t.kind === "PColumn" ? t.valueType === "String" : t.type === "String" : !0;
|
|
1509
1692
|
}
|
|
1510
|
-
function
|
|
1693
|
+
function re(t, e) {
|
|
1511
1694
|
if (!e.length)
|
|
1512
1695
|
return [];
|
|
1513
|
-
const o = e.map((s) =>
|
|
1696
|
+
const o = e.map((s) => A(s)), n = Object.values(t.columnsData)[0].length, l = [];
|
|
1514
1697
|
for (let s = 0; s < n; s++) {
|
|
1515
|
-
const
|
|
1516
|
-
const
|
|
1517
|
-
return B(
|
|
1698
|
+
const r = o.map((c) => {
|
|
1699
|
+
const i = c.toCanonicalString();
|
|
1700
|
+
return B(c) ? t.columnsData[i][s] : t.axesData[i][s];
|
|
1518
1701
|
}).join(", ");
|
|
1519
|
-
l.push(
|
|
1702
|
+
l.push(r);
|
|
1520
1703
|
}
|
|
1521
1704
|
return l;
|
|
1522
1705
|
}
|
|
1523
|
-
var
|
|
1706
|
+
var st = class extends Q {
|
|
1524
1707
|
constructor() {
|
|
1525
1708
|
super(
|
|
1526
1709
|
{
|
|
1527
|
-
value: new
|
|
1710
|
+
value: new I({
|
|
1528
1711
|
componentName: "value",
|
|
1529
1712
|
allowedTypes: ["Int", "Long", "Double", "Float", "String"],
|
|
1530
1713
|
settings: {
|
|
@@ -1534,7 +1717,7 @@ var Ke = class extends R {
|
|
|
1534
1717
|
required: !0
|
|
1535
1718
|
}
|
|
1536
1719
|
}),
|
|
1537
|
-
x: new
|
|
1720
|
+
x: new I({
|
|
1538
1721
|
componentName: "x",
|
|
1539
1722
|
allowedTypes: ["Int", "String", "Long"],
|
|
1540
1723
|
strictlyDependsOnParents: !0,
|
|
@@ -1547,7 +1730,7 @@ var Ke = class extends R {
|
|
|
1547
1730
|
columnsAllowed: !1
|
|
1548
1731
|
}
|
|
1549
1732
|
}),
|
|
1550
|
-
xGroupBy: new
|
|
1733
|
+
xGroupBy: new I({
|
|
1551
1734
|
componentName: "xGroupBy",
|
|
1552
1735
|
allowedTypes: ["Int", "String", "Long"],
|
|
1553
1736
|
strictlyDependsOnParents: !0,
|
|
@@ -1569,7 +1752,7 @@ var Ke = class extends R {
|
|
|
1569
1752
|
) : !0;
|
|
1570
1753
|
}
|
|
1571
1754
|
}),
|
|
1572
|
-
y: new
|
|
1755
|
+
y: new I({
|
|
1573
1756
|
componentName: "y",
|
|
1574
1757
|
allowedTypes: ["Int", "String", "Long"],
|
|
1575
1758
|
strictlyDependsOnParents: !0,
|
|
@@ -1582,7 +1765,7 @@ var Ke = class extends R {
|
|
|
1582
1765
|
columnsAllowed: !0
|
|
1583
1766
|
}
|
|
1584
1767
|
}),
|
|
1585
|
-
yGroupBy: new
|
|
1768
|
+
yGroupBy: new I({
|
|
1586
1769
|
componentName: "yGroupBy",
|
|
1587
1770
|
allowedTypes: ["Int", "String", "Long"],
|
|
1588
1771
|
strictlyDependsOnParents: !0,
|
|
@@ -1604,7 +1787,7 @@ var Ke = class extends R {
|
|
|
1604
1787
|
) : !0;
|
|
1605
1788
|
}
|
|
1606
1789
|
}),
|
|
1607
|
-
tooltipContent: new
|
|
1790
|
+
tooltipContent: new I({
|
|
1608
1791
|
componentName: "tooltipContent",
|
|
1609
1792
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
1610
1793
|
strictlyDependsOnParents: !0,
|
|
@@ -1616,7 +1799,7 @@ var Ke = class extends R {
|
|
|
1616
1799
|
multipleSelectors: !0
|
|
1617
1800
|
}
|
|
1618
1801
|
}),
|
|
1619
|
-
facetBy: new
|
|
1802
|
+
facetBy: new I({
|
|
1620
1803
|
componentName: "facetBy",
|
|
1621
1804
|
allowedTypes: ["String", "Int", "Long"],
|
|
1622
1805
|
strictlyDependsOnParents: !0,
|
|
@@ -1628,7 +1811,7 @@ var Ke = class extends R {
|
|
|
1628
1811
|
multipleSelectors: !0
|
|
1629
1812
|
}
|
|
1630
1813
|
}),
|
|
1631
|
-
annotationsX: new
|
|
1814
|
+
annotationsX: new I({
|
|
1632
1815
|
componentName: "annotationsX",
|
|
1633
1816
|
allowedTypes: ["Int", "Long", "Double", "Float", "String"],
|
|
1634
1817
|
parentComponents: ["value"],
|
|
@@ -1647,7 +1830,7 @@ var Ke = class extends R {
|
|
|
1647
1830
|
) : o.has(_.fromAxisSpec(t).toCanonicalString());
|
|
1648
1831
|
}
|
|
1649
1832
|
}),
|
|
1650
|
-
annotationsY: new
|
|
1833
|
+
annotationsY: new I({
|
|
1651
1834
|
componentName: "annotationsY",
|
|
1652
1835
|
allowedTypes: ["Int", "Long", "Double", "Float", "String"],
|
|
1653
1836
|
parentComponents: ["value"],
|
|
@@ -1668,7 +1851,7 @@ var Ke = class extends R {
|
|
|
1668
1851
|
})
|
|
1669
1852
|
},
|
|
1670
1853
|
{
|
|
1671
|
-
filters: new
|
|
1854
|
+
filters: new I({
|
|
1672
1855
|
componentName: "filters",
|
|
1673
1856
|
allowedTypes: ["String", "Int", "Long", "Double", "Long"],
|
|
1674
1857
|
strictlyDependsOnParents: !0,
|
|
@@ -1680,9 +1863,9 @@ var Ke = class extends R {
|
|
|
1680
1863
|
dimensionConsumer: !0,
|
|
1681
1864
|
multipleSelectors: !0
|
|
1682
1865
|
},
|
|
1683
|
-
checkSourceBySpec:
|
|
1866
|
+
checkSourceBySpec: R
|
|
1684
1867
|
}),
|
|
1685
|
-
tabBy: new
|
|
1868
|
+
tabBy: new I({
|
|
1686
1869
|
componentName: "tabBy",
|
|
1687
1870
|
allowedTypes: ["String", "Int"],
|
|
1688
1871
|
strictlyDependsOnParents: !0,
|
|
@@ -1700,7 +1883,7 @@ var Ke = class extends R {
|
|
|
1700
1883
|
async getMustBeConsumedAxes(t, e) {
|
|
1701
1884
|
if (!e.components.value.selectorStates.length)
|
|
1702
1885
|
return /* @__PURE__ */ new Set();
|
|
1703
|
-
const o = e.components.value.selectorStates[0].selectedSource, n = await t.pFrameProvider.getColumnSpecById(
|
|
1886
|
+
const o = e.components.value.selectorStates[0].selectedSource, n = await t.pFrameProvider.getColumnSpecById(A(o));
|
|
1704
1887
|
return n ? new Set(n.axesSpec.map((l) => _.fromAxisSpec(l).toCanonicalString())) : /* @__PURE__ */ new Set();
|
|
1705
1888
|
}
|
|
1706
1889
|
async createDataByColumns(t, e) {
|
|
@@ -1708,17 +1891,17 @@ var Ke = class extends R {
|
|
|
1708
1891
|
const l = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource;
|
|
1709
1892
|
if (!l)
|
|
1710
1893
|
throw Error("Value column is not valid");
|
|
1711
|
-
const s =
|
|
1894
|
+
const s = A(l);
|
|
1712
1895
|
if (!B(s))
|
|
1713
1896
|
throw Error("Value column is not valid");
|
|
1714
|
-
const
|
|
1897
|
+
const r = {
|
|
1715
1898
|
type: "columns",
|
|
1716
|
-
id: (n =
|
|
1899
|
+
id: (n = z(e.components)) != null ? n : "",
|
|
1717
1900
|
values: {}
|
|
1718
|
-
},
|
|
1901
|
+
}, { linkerColumnsMap: c, compositeLinkerMap: i } = await X(t), p = [
|
|
1719
1902
|
...e.components.filters.selectorStates,
|
|
1720
1903
|
...e.components.tabBy.selectorStates
|
|
1721
|
-
], u =
|
|
1904
|
+
], u = Y(p), m = p.map((L) => A(L.selectedSource)).filter(B), d = [l], h = await $(t, d), g = [
|
|
1722
1905
|
e.components.facetBy,
|
|
1723
1906
|
e.components.annotationsX,
|
|
1724
1907
|
e.components.annotationsY,
|
|
@@ -1727,185 +1910,187 @@ var Ke = class extends R {
|
|
|
1727
1910
|
e.components.xGroupBy,
|
|
1728
1911
|
e.components.yGroupBy,
|
|
1729
1912
|
e.components.tooltipContent
|
|
1730
|
-
],
|
|
1731
|
-
for (const { selectedSource: L, fixedAxes:
|
|
1732
|
-
|
|
1913
|
+
], x = [], w = [[]], D = [], b = [];
|
|
1914
|
+
for (const { selectedSource: L, fixedAxes: E } of p)
|
|
1915
|
+
b.push(...await V(
|
|
1733
1916
|
t,
|
|
1734
|
-
|
|
1735
|
-
|
|
1917
|
+
c,
|
|
1918
|
+
i,
|
|
1919
|
+
h,
|
|
1736
1920
|
L,
|
|
1737
|
-
|
|
1738
|
-
)),
|
|
1739
|
-
(
|
|
1921
|
+
E
|
|
1922
|
+
)), w.push(
|
|
1923
|
+
(E ?? []).map(({ axisIdx: F, axisValue: G }) => ({ idx: F, value: G }))
|
|
1740
1924
|
);
|
|
1741
|
-
for (const L of
|
|
1742
|
-
for (const { selectedSource:
|
|
1743
|
-
|
|
1744
|
-
(
|
|
1745
|
-
),
|
|
1925
|
+
for (const L of g)
|
|
1926
|
+
for (const { selectedSource: E, fixedAxes: F } of L.selectorStates) {
|
|
1927
|
+
x.push(A(E)), D.push(
|
|
1928
|
+
(F ?? []).map(({ axisIdx: M, axisValue: K }) => ({ idx: M, value: K }))
|
|
1929
|
+
), b.push(...await V(
|
|
1746
1930
|
t,
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1931
|
+
c,
|
|
1932
|
+
i,
|
|
1933
|
+
h,
|
|
1934
|
+
E,
|
|
1935
|
+
F
|
|
1751
1936
|
));
|
|
1752
|
-
const
|
|
1753
|
-
|
|
1937
|
+
const G = await k(t, E, d);
|
|
1938
|
+
G && x.push(G);
|
|
1754
1939
|
}
|
|
1755
|
-
const
|
|
1756
|
-
[s, ...
|
|
1757
|
-
|
|
1940
|
+
const C = await t.pFrameProvider.getTableOuterJoin(
|
|
1941
|
+
[s, ...b, ...m],
|
|
1942
|
+
x,
|
|
1758
1943
|
u,
|
|
1759
1944
|
!0,
|
|
1760
|
-
|
|
1761
|
-
|
|
1945
|
+
w,
|
|
1946
|
+
D
|
|
1762
1947
|
);
|
|
1763
|
-
|
|
1764
|
-
const
|
|
1765
|
-
|
|
1766
|
-
}),
|
|
1767
|
-
const
|
|
1768
|
-
|
|
1769
|
-
const
|
|
1770
|
-
|
|
1948
|
+
x.forEach((L) => {
|
|
1949
|
+
const E = L.toCanonicalString();
|
|
1950
|
+
r.values[E] = B(L) ? C.columnsData[E] : C.axesData[E];
|
|
1951
|
+
}), r.values[s.toCanonicalString()] = C.columnsData[s.toCanonicalString()];
|
|
1952
|
+
const a = e.components.x.selectorStates.concat(e.components.xGroupBy.selectorStates).map((L) => L.selectedSource), S = a.join(", ");
|
|
1953
|
+
r.values[S] = re(C, a);
|
|
1954
|
+
const y = e.components.x.selectorStates.map((L) => L.selectedSource), f = await Promise.all(
|
|
1955
|
+
y.map(
|
|
1771
1956
|
async (L) => {
|
|
1772
|
-
var
|
|
1773
|
-
return (
|
|
1957
|
+
var E, F;
|
|
1958
|
+
return (F = (E = await k(t, L, d)) == null ? void 0 : E.toCanonicalString()) != null ? F : L;
|
|
1774
1959
|
}
|
|
1775
1960
|
)
|
|
1776
1961
|
);
|
|
1777
|
-
|
|
1778
|
-
const
|
|
1779
|
-
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1962
|
+
r.values.xLabelsKey = re(C, f);
|
|
1963
|
+
const v = e.components.y.selectorStates.concat(e.components.yGroupBy.selectorStates).map((L) => L.selectedSource), P = v.join(", ");
|
|
1964
|
+
r.values[P] = re(C, v);
|
|
1965
|
+
const O = e.components.y.selectorStates.map((L) => L.selectedSource), N = await Promise.all(
|
|
1966
|
+
O.map(
|
|
1782
1967
|
async (L) => {
|
|
1783
|
-
var
|
|
1784
|
-
return (
|
|
1968
|
+
var E, F;
|
|
1969
|
+
return (F = (E = await k(t, L, d)) == null ? void 0 : E.toCanonicalString()) != null ? F : L;
|
|
1785
1970
|
}
|
|
1786
1971
|
)
|
|
1787
1972
|
);
|
|
1788
|
-
return
|
|
1973
|
+
return r.values.yLabelsKey = re(C, N), { byColumns: r };
|
|
1789
1974
|
}
|
|
1790
1975
|
async createChartSettings(t, e) {
|
|
1791
1976
|
var o;
|
|
1792
1977
|
const n = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource;
|
|
1793
1978
|
if (!n)
|
|
1794
1979
|
throw Error("Value column is not valid");
|
|
1795
|
-
const l =
|
|
1980
|
+
const l = A(n);
|
|
1796
1981
|
if (!B(l))
|
|
1797
1982
|
throw Error("Value column is not valid");
|
|
1798
|
-
const s = [n],
|
|
1983
|
+
const s = [n], r = {
|
|
1799
1984
|
type: "column",
|
|
1800
1985
|
value: n,
|
|
1801
|
-
label: await
|
|
1802
|
-
},
|
|
1803
|
-
e.components.facetBy.selectorStates.map(async (
|
|
1804
|
-
var
|
|
1986
|
+
label: await T(t, n, [])
|
|
1987
|
+
}, i = e.components.x.selectorStates.concat(e.components.xGroupBy.selectorStates).map(({ selectedSource: a }) => A(a)).map((a) => a.toCanonicalString()).join(", "), u = e.components.y.selectorStates.concat(e.components.yGroupBy.selectorStates).map(({ selectedSource: a }) => A(a)).map((a) => a.toCanonicalString()).join(", "), m = await Promise.all(
|
|
1988
|
+
e.components.facetBy.selectorStates.map(async (a) => {
|
|
1989
|
+
var S, y;
|
|
1805
1990
|
return {
|
|
1806
1991
|
type: "column",
|
|
1807
|
-
value: (y = (
|
|
1992
|
+
value: (y = (S = await k(t, a.selectedSource, s)) == null ? void 0 : S.toCanonicalString()) != null ? y : a.selectedSource
|
|
1808
1993
|
};
|
|
1809
1994
|
})
|
|
1810
1995
|
), d = await Promise.all(
|
|
1811
|
-
e.components.xGroupBy.selectorStates.map(async (
|
|
1812
|
-
var
|
|
1996
|
+
e.components.xGroupBy.selectorStates.map(async (a) => {
|
|
1997
|
+
var S, y;
|
|
1813
1998
|
return {
|
|
1814
1999
|
type: "column",
|
|
1815
|
-
label: await
|
|
1816
|
-
value:
|
|
1817
|
-
valueLabels: (y = (
|
|
2000
|
+
label: await T(t, a.selectedSource, s),
|
|
2001
|
+
value: a.selectedSource,
|
|
2002
|
+
valueLabels: (y = (S = await k(t, a.selectedSource, s)) == null ? void 0 : S.toCanonicalString()) != null ? y : a.selectedSource
|
|
1818
2003
|
};
|
|
1819
2004
|
})
|
|
1820
|
-
),
|
|
1821
|
-
e.components.yGroupBy.selectorStates.map(async (
|
|
1822
|
-
var
|
|
2005
|
+
), h = await Promise.all(
|
|
2006
|
+
e.components.yGroupBy.selectorStates.map(async (a) => {
|
|
2007
|
+
var S, y;
|
|
1823
2008
|
return {
|
|
1824
2009
|
type: "column",
|
|
1825
|
-
label: await
|
|
1826
|
-
value:
|
|
1827
|
-
valueLabels: (y = (
|
|
2010
|
+
label: await T(t, a.selectedSource, s),
|
|
2011
|
+
value: a.selectedSource,
|
|
2012
|
+
valueLabels: (y = (S = await k(t, a.selectedSource, s)) == null ? void 0 : S.toCanonicalString()) != null ? y : a.selectedSource
|
|
1828
2013
|
};
|
|
1829
2014
|
})
|
|
1830
|
-
),
|
|
1831
|
-
e.components.annotationsX.selectorStates.map(async (
|
|
1832
|
-
var
|
|
1833
|
-
const
|
|
1834
|
-
(
|
|
2015
|
+
), g = await t.pFrameProvider.getColumnSpecById(l), x = await Promise.all(
|
|
2016
|
+
e.components.annotationsX.selectorStates.map(async (a) => {
|
|
2017
|
+
var S, y;
|
|
2018
|
+
const f = a.selectedSource, v = A(f), P = B(v) ? await t.pFrameProvider.getColumnSpecById(v) : (y = (S = g == null ? void 0 : g.axesSpec) == null ? void 0 : S.find(
|
|
2019
|
+
(O) => _.fromAxisSpec(O).toCanonicalString() === f
|
|
1835
2020
|
)) != null ? y : null;
|
|
1836
2021
|
return {
|
|
1837
2022
|
axis: "x",
|
|
1838
2023
|
valueColumn: {
|
|
1839
2024
|
type: "column",
|
|
1840
|
-
value:
|
|
1841
|
-
label: await
|
|
2025
|
+
value: f,
|
|
2026
|
+
label: await T(t, f, s)
|
|
1842
2027
|
},
|
|
1843
2028
|
type: pe(P) ? "discrete" : "continuous"
|
|
1844
2029
|
};
|
|
1845
2030
|
})
|
|
1846
|
-
),
|
|
1847
|
-
e.components.annotationsY.selectorStates.map(async (
|
|
1848
|
-
var
|
|
1849
|
-
const
|
|
1850
|
-
(
|
|
2031
|
+
), w = await Promise.all(
|
|
2032
|
+
e.components.annotationsY.selectorStates.map(async (a) => {
|
|
2033
|
+
var S, y;
|
|
2034
|
+
const f = a.selectedSource, v = A(f), P = B(v) ? await t.pFrameProvider.getColumnSpecById(v) : (y = (S = g == null ? void 0 : g.axesSpec) == null ? void 0 : S.find(
|
|
2035
|
+
(O) => _.fromAxisSpec(O).toCanonicalString() === f
|
|
1851
2036
|
)) != null ? y : null;
|
|
1852
2037
|
return {
|
|
1853
2038
|
axis: "y",
|
|
1854
2039
|
valueColumn: {
|
|
1855
2040
|
type: "column",
|
|
1856
|
-
value:
|
|
1857
|
-
label: await
|
|
2041
|
+
value: f,
|
|
2042
|
+
label: await T(t, f, s)
|
|
1858
2043
|
},
|
|
1859
2044
|
type: pe(P) ? "discrete" : "continuous"
|
|
1860
2045
|
};
|
|
1861
2046
|
})
|
|
1862
|
-
),
|
|
2047
|
+
), D = (await Promise.all(
|
|
1863
2048
|
e.components.x.selectorStates.map(
|
|
1864
|
-
(
|
|
2049
|
+
(a) => T(t, a.selectedSource, s)
|
|
1865
2050
|
)
|
|
1866
2051
|
)).join(", "), b = (await Promise.all(
|
|
1867
2052
|
e.components.y.selectorStates.map(
|
|
1868
|
-
(
|
|
2053
|
+
(a) => T(t, a.selectedSource, s)
|
|
1869
2054
|
)
|
|
1870
|
-
)).join(", "),
|
|
1871
|
-
e.components.tooltipContent.selectorStates.map(async (
|
|
1872
|
-
var
|
|
1873
|
-
const
|
|
2055
|
+
)).join(", "), C = await Promise.all(
|
|
2056
|
+
e.components.tooltipContent.selectorStates.map(async (a) => {
|
|
2057
|
+
var S, y;
|
|
2058
|
+
const f = a.selectedSource;
|
|
1874
2059
|
return {
|
|
1875
2060
|
type: "column",
|
|
1876
|
-
label: await
|
|
1877
|
-
value:
|
|
1878
|
-
valueLabels: (y = (
|
|
2061
|
+
label: await T(t, f, s) || f,
|
|
2062
|
+
value: f,
|
|
2063
|
+
valueLabels: (y = (S = await k(t, f, s)) == null ? void 0 : S.toCanonicalString()) != null ? y : f
|
|
1879
2064
|
};
|
|
1880
2065
|
})
|
|
1881
2066
|
);
|
|
1882
2067
|
return {
|
|
1883
2068
|
type: "heatmap",
|
|
1884
|
-
valueColumn:
|
|
1885
|
-
valueType: pe(
|
|
2069
|
+
valueColumn: r,
|
|
2070
|
+
valueType: pe(g) ? "discrete" : "continuous",
|
|
1886
2071
|
xColumn: {
|
|
1887
2072
|
type: "column",
|
|
1888
|
-
value:
|
|
1889
|
-
label:
|
|
2073
|
+
value: i,
|
|
2074
|
+
label: D,
|
|
1890
2075
|
valueLabels: "xLabelsKey"
|
|
1891
2076
|
},
|
|
1892
2077
|
yColumn: {
|
|
1893
2078
|
type: "column",
|
|
1894
|
-
value:
|
|
2079
|
+
value: u,
|
|
1895
2080
|
label: b,
|
|
1896
2081
|
valueLabels: "yLabelsKey"
|
|
1897
2082
|
},
|
|
1898
2083
|
facetBy: m,
|
|
1899
2084
|
xGroupBy: d,
|
|
1900
|
-
yGroupBy:
|
|
1901
|
-
annotations: [...
|
|
2085
|
+
yGroupBy: h,
|
|
2086
|
+
annotations: [...x, ...w],
|
|
1902
2087
|
tooltips: {
|
|
1903
2088
|
show: !0,
|
|
1904
|
-
content:
|
|
2089
|
+
content: C
|
|
1905
2090
|
}
|
|
1906
2091
|
};
|
|
1907
2092
|
}
|
|
1908
|
-
},
|
|
2093
|
+
}, lt = {
|
|
1909
2094
|
type: "scatterplot",
|
|
1910
2095
|
components: {
|
|
1911
2096
|
x: { type: "simple", selectorStates: [] },
|
|
@@ -1921,11 +2106,11 @@ var Ke = class extends R {
|
|
|
1921
2106
|
tooltipContent: { type: "simple", selectorStates: [] }
|
|
1922
2107
|
},
|
|
1923
2108
|
dividedAxes: {}
|
|
1924
|
-
},
|
|
2109
|
+
}, at = class extends Q {
|
|
1925
2110
|
constructor() {
|
|
1926
2111
|
super(
|
|
1927
2112
|
{
|
|
1928
|
-
x: new
|
|
2113
|
+
x: new I({
|
|
1929
2114
|
componentName: "x",
|
|
1930
2115
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
1931
2116
|
parentComponents: ["y"],
|
|
@@ -1937,7 +2122,7 @@ var Ke = class extends R {
|
|
|
1937
2122
|
columnsAllowed: !0
|
|
1938
2123
|
}
|
|
1939
2124
|
}),
|
|
1940
|
-
y: new
|
|
2125
|
+
y: new I({
|
|
1941
2126
|
componentName: "y",
|
|
1942
2127
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
1943
2128
|
parentComponents: ["x"],
|
|
@@ -1949,7 +2134,7 @@ var Ke = class extends R {
|
|
|
1949
2134
|
columnsAllowed: !0
|
|
1950
2135
|
}
|
|
1951
2136
|
}),
|
|
1952
|
-
facetBy: new
|
|
2137
|
+
facetBy: new I({
|
|
1953
2138
|
componentName: "facetBy",
|
|
1954
2139
|
allowedTypes: ["String", "Int", "Long"],
|
|
1955
2140
|
strictlyDependsOnParents: !0,
|
|
@@ -1961,7 +2146,7 @@ var Ke = class extends R {
|
|
|
1961
2146
|
multipleSelectors: !0
|
|
1962
2147
|
}
|
|
1963
2148
|
}),
|
|
1964
|
-
grouping: new
|
|
2149
|
+
grouping: new I({
|
|
1965
2150
|
componentName: "grouping",
|
|
1966
2151
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
1967
2152
|
strictlyDependsOnParents: !0,
|
|
@@ -1972,7 +2157,7 @@ var Ke = class extends R {
|
|
|
1972
2157
|
multipleSelectors: !0
|
|
1973
2158
|
}
|
|
1974
2159
|
}),
|
|
1975
|
-
shape: new
|
|
2160
|
+
shape: new I({
|
|
1976
2161
|
componentName: "shape",
|
|
1977
2162
|
allowedTypes: ["String", "Int", "Long"],
|
|
1978
2163
|
strictlyDependsOnParents: !0,
|
|
@@ -1982,7 +2167,7 @@ var Ke = class extends R {
|
|
|
1982
2167
|
axesAllowed: !0
|
|
1983
2168
|
}
|
|
1984
2169
|
}),
|
|
1985
|
-
size: new
|
|
2170
|
+
size: new I({
|
|
1986
2171
|
componentName: "size",
|
|
1987
2172
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
1988
2173
|
strictlyDependsOnParents: !0,
|
|
@@ -1992,7 +2177,7 @@ var Ke = class extends R {
|
|
|
1992
2177
|
axesAllowed: !0
|
|
1993
2178
|
}
|
|
1994
2179
|
}),
|
|
1995
|
-
tooltipContent: new
|
|
2180
|
+
tooltipContent: new I({
|
|
1996
2181
|
componentName: "tooltipContent",
|
|
1997
2182
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
1998
2183
|
strictlyDependsOnParents: !0,
|
|
@@ -2004,7 +2189,7 @@ var Ke = class extends R {
|
|
|
2004
2189
|
multipleSelectors: !0
|
|
2005
2190
|
}
|
|
2006
2191
|
}),
|
|
2007
|
-
label: new
|
|
2192
|
+
label: new I({
|
|
2008
2193
|
componentName: "label",
|
|
2009
2194
|
allowedTypes: ["String", "Int", "Long"],
|
|
2010
2195
|
strictlyDependsOnParents: !0,
|
|
@@ -2018,7 +2203,7 @@ var Ke = class extends R {
|
|
|
2018
2203
|
})
|
|
2019
2204
|
},
|
|
2020
2205
|
{
|
|
2021
|
-
filters: new
|
|
2206
|
+
filters: new I({
|
|
2022
2207
|
componentName: "filters",
|
|
2023
2208
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
2024
2209
|
strictlyDependsOnParents: !0,
|
|
@@ -2030,9 +2215,9 @@ var Ke = class extends R {
|
|
|
2030
2215
|
dimensionConsumer: !0,
|
|
2031
2216
|
multipleSelectors: !0
|
|
2032
2217
|
},
|
|
2033
|
-
checkSourceBySpec:
|
|
2218
|
+
checkSourceBySpec: R
|
|
2034
2219
|
}),
|
|
2035
|
-
tabBy: new
|
|
2220
|
+
tabBy: new I({
|
|
2036
2221
|
componentName: "tabBy",
|
|
2037
2222
|
allowedTypes: ["String", "Int"],
|
|
2038
2223
|
strictlyDependsOnParents: !0,
|
|
@@ -2043,7 +2228,7 @@ var Ke = class extends R {
|
|
|
2043
2228
|
dimensionConsumer: !0
|
|
2044
2229
|
}
|
|
2045
2230
|
}),
|
|
2046
|
-
highlight: new
|
|
2231
|
+
highlight: new I({
|
|
2047
2232
|
componentName: "highlight",
|
|
2048
2233
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
2049
2234
|
strictlyDependsOnParents: !0,
|
|
@@ -2054,7 +2239,7 @@ var Ke = class extends R {
|
|
|
2054
2239
|
columnsAllowed: !0,
|
|
2055
2240
|
multipleSelectors: !0
|
|
2056
2241
|
},
|
|
2057
|
-
checkSourceBySpec:
|
|
2242
|
+
checkSourceBySpec: R
|
|
2058
2243
|
})
|
|
2059
2244
|
}
|
|
2060
2245
|
), this.dataInputs = ["x", "y"];
|
|
@@ -2062,39 +2247,40 @@ var Ke = class extends R {
|
|
|
2062
2247
|
async getMustBeConsumedAxes(t, e) {
|
|
2063
2248
|
if (!e.components.x.selectorStates.length || !e.components.y.selectorStates.length)
|
|
2064
2249
|
return /* @__PURE__ */ new Set();
|
|
2065
|
-
const o = e.components.x.selectorStates[0].selectedSource, n = e.components.y.selectorStates[0].selectedSource, l = await t.pFrameProvider.getColumnSpecById(
|
|
2250
|
+
const o = e.components.x.selectorStates[0].selectedSource, n = e.components.y.selectorStates[0].selectedSource, l = await t.pFrameProvider.getColumnSpecById(A(o)), s = await t.pFrameProvider.getColumnSpecById(A(n));
|
|
2066
2251
|
if (!l || !s)
|
|
2067
2252
|
return /* @__PURE__ */ new Set();
|
|
2068
|
-
const
|
|
2069
|
-
return /* @__PURE__ */ new Set([...
|
|
2253
|
+
const r = l.axesSpec.map((u) => _.fromAxisSpec(u).toCanonicalString()), c = s.axesSpec.map((u) => _.fromAxisSpec(u).toCanonicalString()), i = r.filter((u) => !c.some((m) => m === u)), p = c.filter((u) => !r.some((m) => m === u));
|
|
2254
|
+
return /* @__PURE__ */ new Set([...i, ...p]);
|
|
2070
2255
|
}
|
|
2071
2256
|
async createDataByColumns(t, e) {
|
|
2072
2257
|
var o, n, l;
|
|
2073
|
-
const s = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource,
|
|
2074
|
-
if (!s || !
|
|
2258
|
+
const s = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource, r = (n = e.components.y.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
2259
|
+
if (!s || !r)
|
|
2075
2260
|
throw Error("X or Y column is not valid");
|
|
2076
|
-
const
|
|
2261
|
+
const c = A(s), i = A(r), p = {
|
|
2077
2262
|
type: "columns",
|
|
2078
|
-
id: (l =
|
|
2263
|
+
id: (l = z(e.components)) != null ? l : "",
|
|
2079
2264
|
values: {}
|
|
2080
|
-
},
|
|
2265
|
+
}, { linkerColumnsMap: u, compositeLinkerMap: m } = await X(t), d = [
|
|
2081
2266
|
...e.components.filters.selectorStates,
|
|
2082
2267
|
...e.components.tabBy.selectorStates
|
|
2083
|
-
],
|
|
2084
|
-
if (
|
|
2268
|
+
], h = Y(d), g = d.map((v) => A(v.selectedSource)).filter(B), x = [c, i].filter(B).map((v) => v.toCanonicalString());
|
|
2269
|
+
if (x.length === 0)
|
|
2085
2270
|
throw Error("One of X and Y should be a column");
|
|
2086
|
-
const
|
|
2087
|
-
for (const { selectedSource:
|
|
2088
|
-
|
|
2271
|
+
const w = await $(t, x), D = [c, i, ...g], b = [], C = [[], []], a = [], S = [];
|
|
2272
|
+
for (const { selectedSource: v, fixedAxes: P } of d)
|
|
2273
|
+
S.push(...await V(
|
|
2089
2274
|
t,
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2275
|
+
u,
|
|
2276
|
+
m,
|
|
2277
|
+
w,
|
|
2278
|
+
v,
|
|
2279
|
+
P
|
|
2280
|
+
)), C.push(
|
|
2281
|
+
(P ?? []).map(({ axisIdx: O, axisValue: N }) => ({ idx: O, value: N }))
|
|
2096
2282
|
);
|
|
2097
|
-
const
|
|
2283
|
+
const y = [
|
|
2098
2284
|
e.components.grouping,
|
|
2099
2285
|
e.components.size,
|
|
2100
2286
|
e.components.shape,
|
|
@@ -2103,113 +2289,114 @@ var Ke = class extends R {
|
|
|
2103
2289
|
e.components.label,
|
|
2104
2290
|
e.components.highlight
|
|
2105
2291
|
];
|
|
2106
|
-
for (const
|
|
2107
|
-
for (const { selectedSource:
|
|
2108
|
-
|
|
2109
|
-
(
|
|
2110
|
-
),
|
|
2292
|
+
for (const v of y)
|
|
2293
|
+
for (const { selectedSource: P, fixedAxes: O } of v.selectorStates) {
|
|
2294
|
+
b.push(A(P)), a.push(
|
|
2295
|
+
(O ?? []).map(({ axisIdx: L, axisValue: E }) => ({ idx: L, value: E }))
|
|
2296
|
+
), S.push(...await V(
|
|
2111
2297
|
t,
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
P
|
|
2298
|
+
u,
|
|
2299
|
+
m,
|
|
2300
|
+
w,
|
|
2301
|
+
P,
|
|
2302
|
+
O
|
|
2116
2303
|
));
|
|
2117
|
-
const N = await
|
|
2118
|
-
N &&
|
|
2304
|
+
const N = await k(t, P, x);
|
|
2305
|
+
N && b.push(N);
|
|
2119
2306
|
}
|
|
2120
|
-
const
|
|
2121
|
-
[
|
|
2122
|
-
x,
|
|
2123
|
-
d,
|
|
2124
|
-
!1,
|
|
2307
|
+
const f = await t.pFrameProvider.getTableOuterJoin(
|
|
2308
|
+
[c, i, ...S, ...g],
|
|
2125
2309
|
b,
|
|
2126
|
-
|
|
2310
|
+
h,
|
|
2311
|
+
!1,
|
|
2312
|
+
C,
|
|
2313
|
+
a
|
|
2127
2314
|
);
|
|
2128
|
-
return [...
|
|
2129
|
-
const
|
|
2130
|
-
|
|
2131
|
-
}),
|
|
2315
|
+
return [...D, ...b].forEach((v) => {
|
|
2316
|
+
const P = v.toCanonicalString();
|
|
2317
|
+
p.values[P] = B(v) ? f.columnsData[P] : f.axesData[P];
|
|
2318
|
+
}), p.values.key = new Array(p.values[Object.keys(p.values)[0]].length).fill(0).map((v, P) => P), e.components.highlight.selectorStates.length && (p.values.highlight = Ie(e.components.highlight.selectorStates, f)), { byColumns: p };
|
|
2132
2319
|
}
|
|
2133
2320
|
async createChartSettings(t, e) {
|
|
2134
2321
|
var o, n, l, s;
|
|
2135
|
-
const
|
|
2136
|
-
if (!
|
|
2322
|
+
const r = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource, c = (n = e.components.y.selectorStates[0]) == null ? void 0 : n.selectedSource, i = r ? A(r) : null, p = c ? A(c) : null;
|
|
2323
|
+
if (!r || !c || !i || !p || !B(i) && !B(p))
|
|
2137
2324
|
throw Error("Empty or invalid required data");
|
|
2138
|
-
const
|
|
2325
|
+
const u = [i, p].filter(B).map((a) => a.toCanonicalString()), m = {
|
|
2139
2326
|
type: "column",
|
|
2140
|
-
value:
|
|
2141
|
-
label: await
|
|
2327
|
+
value: r,
|
|
2328
|
+
label: await T(t, r, u)
|
|
2142
2329
|
}, d = {
|
|
2143
2330
|
type: "column",
|
|
2144
|
-
value:
|
|
2145
|
-
label: await
|
|
2146
|
-
},
|
|
2331
|
+
value: c,
|
|
2332
|
+
label: await T(t, c, u)
|
|
2333
|
+
}, h = {
|
|
2147
2334
|
type: "column",
|
|
2148
2335
|
value: "key"
|
|
2149
|
-
},
|
|
2150
|
-
e.components.facetBy.selectorStates.map(async (
|
|
2151
|
-
var
|
|
2336
|
+
}, g = await Promise.all(
|
|
2337
|
+
e.components.facetBy.selectorStates.map(async (a) => {
|
|
2338
|
+
var S, y;
|
|
2152
2339
|
return {
|
|
2153
2340
|
type: "column",
|
|
2154
|
-
value: (y = (
|
|
2341
|
+
value: (y = (S = await k(t, a.selectedSource, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : a.selectedSource
|
|
2155
2342
|
};
|
|
2156
2343
|
})
|
|
2157
|
-
),
|
|
2158
|
-
...e.components.grouping.selectorStates.map((
|
|
2159
|
-
...e.components.size.selectorStates.map((
|
|
2160
|
-
...e.components.shape.selectorStates.map((
|
|
2161
|
-
]),
|
|
2162
|
-
|
|
2163
|
-
var
|
|
2344
|
+
), x = ie.uniq([
|
|
2345
|
+
...e.components.grouping.selectorStates.map((a) => a.selectedSource),
|
|
2346
|
+
...e.components.size.selectorStates.map((a) => a.selectedSource),
|
|
2347
|
+
...e.components.shape.selectorStates.map((a) => a.selectedSource)
|
|
2348
|
+
]), w = await Promise.all(
|
|
2349
|
+
x.map(async (a) => {
|
|
2350
|
+
var S, y;
|
|
2164
2351
|
return {
|
|
2165
2352
|
type: "column",
|
|
2166
|
-
label: await
|
|
2167
|
-
value:
|
|
2168
|
-
valueLabels: (y = (
|
|
2353
|
+
label: await T(t, a, u) || a,
|
|
2354
|
+
value: a,
|
|
2355
|
+
valueLabels: (y = (S = await k(t, a, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : a
|
|
2169
2356
|
};
|
|
2170
2357
|
})
|
|
2171
|
-
),
|
|
2172
|
-
e.components.tooltipContent.selectorStates.map(async (
|
|
2173
|
-
var
|
|
2174
|
-
const
|
|
2358
|
+
), D = await Promise.all(
|
|
2359
|
+
e.components.tooltipContent.selectorStates.map(async (a) => {
|
|
2360
|
+
var S, y;
|
|
2361
|
+
const f = a.selectedSource;
|
|
2175
2362
|
return {
|
|
2176
2363
|
type: "column",
|
|
2177
|
-
label: await
|
|
2178
|
-
value:
|
|
2179
|
-
valueLabels: (y = (
|
|
2364
|
+
label: await T(t, f, u) || f,
|
|
2365
|
+
value: f,
|
|
2366
|
+
valueLabels: (y = (S = await k(t, f, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : f
|
|
2180
2367
|
};
|
|
2181
2368
|
})
|
|
2182
2369
|
);
|
|
2183
2370
|
let b;
|
|
2184
2371
|
if (e.components.label.selectorStates.length) {
|
|
2185
|
-
const
|
|
2372
|
+
const a = e.components.label.selectorStates[0].selectedSource;
|
|
2186
2373
|
b = {
|
|
2187
2374
|
type: "column",
|
|
2188
|
-
value:
|
|
2189
|
-
label: await
|
|
2190
|
-
valueLabels: (s = (l = await
|
|
2375
|
+
value: a,
|
|
2376
|
+
label: await T(t, a, u),
|
|
2377
|
+
valueLabels: (s = (l = await k(t, a, u)) == null ? void 0 : l.toCanonicalString()) != null ? s : a
|
|
2191
2378
|
};
|
|
2192
2379
|
}
|
|
2193
|
-
let
|
|
2194
|
-
return e.components.highlight.selectorStates.length && (
|
|
2380
|
+
let C;
|
|
2381
|
+
return e.components.highlight.selectorStates.length && (C = {
|
|
2195
2382
|
type: "column",
|
|
2196
2383
|
value: "highlight"
|
|
2197
2384
|
}), {
|
|
2198
2385
|
type: "scatterplot",
|
|
2199
2386
|
x: m,
|
|
2200
2387
|
y: d,
|
|
2201
|
-
keyColumn:
|
|
2202
|
-
facetBy:
|
|
2203
|
-
grouping:
|
|
2388
|
+
keyColumn: h,
|
|
2389
|
+
facetBy: g,
|
|
2390
|
+
grouping: w,
|
|
2204
2391
|
label: b,
|
|
2205
|
-
highlight:
|
|
2392
|
+
highlight: C,
|
|
2206
2393
|
tooltips: {
|
|
2207
2394
|
show: !0,
|
|
2208
|
-
content:
|
|
2395
|
+
content: D
|
|
2209
2396
|
}
|
|
2210
2397
|
};
|
|
2211
2398
|
}
|
|
2212
|
-
},
|
|
2399
|
+
}, rt = {
|
|
2213
2400
|
type: "scatterplot-umap",
|
|
2214
2401
|
components: {
|
|
2215
2402
|
x: { type: "simple", selectorStates: [] },
|
|
@@ -2224,11 +2411,11 @@ var Ke = class extends R {
|
|
|
2224
2411
|
size: { type: "simple", selectorStates: [] }
|
|
2225
2412
|
},
|
|
2226
2413
|
dividedAxes: {}
|
|
2227
|
-
},
|
|
2414
|
+
}, ct = class extends Q {
|
|
2228
2415
|
constructor() {
|
|
2229
2416
|
super(
|
|
2230
2417
|
{
|
|
2231
|
-
x: new
|
|
2418
|
+
x: new I({
|
|
2232
2419
|
componentName: "x",
|
|
2233
2420
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
2234
2421
|
parentComponents: ["y"],
|
|
@@ -2240,7 +2427,7 @@ var Ke = class extends R {
|
|
|
2240
2427
|
columnsAllowed: !0
|
|
2241
2428
|
}
|
|
2242
2429
|
}),
|
|
2243
|
-
y: new
|
|
2430
|
+
y: new I({
|
|
2244
2431
|
componentName: "y",
|
|
2245
2432
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
2246
2433
|
parentComponents: ["x"],
|
|
@@ -2252,7 +2439,7 @@ var Ke = class extends R {
|
|
|
2252
2439
|
columnsAllowed: !0
|
|
2253
2440
|
}
|
|
2254
2441
|
}),
|
|
2255
|
-
facetBy: new
|
|
2442
|
+
facetBy: new I({
|
|
2256
2443
|
componentName: "facetBy",
|
|
2257
2444
|
allowedTypes: ["String", "Int", "Long"],
|
|
2258
2445
|
strictlyDependsOnParents: !0,
|
|
@@ -2264,7 +2451,7 @@ var Ke = class extends R {
|
|
|
2264
2451
|
multipleSelectors: !0
|
|
2265
2452
|
}
|
|
2266
2453
|
}),
|
|
2267
|
-
grouping: new
|
|
2454
|
+
grouping: new I({
|
|
2268
2455
|
componentName: "grouping",
|
|
2269
2456
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
2270
2457
|
strictlyDependsOnParents: !0,
|
|
@@ -2275,7 +2462,7 @@ var Ke = class extends R {
|
|
|
2275
2462
|
multipleSelectors: !0
|
|
2276
2463
|
}
|
|
2277
2464
|
}),
|
|
2278
|
-
tooltipContent: new
|
|
2465
|
+
tooltipContent: new I({
|
|
2279
2466
|
componentName: "tooltipContent",
|
|
2280
2467
|
allowedTypes: ["String", "Int", "Long", "Float", "Double"],
|
|
2281
2468
|
strictlyDependsOnParents: !0,
|
|
@@ -2287,7 +2474,7 @@ var Ke = class extends R {
|
|
|
2287
2474
|
multipleSelectors: !0
|
|
2288
2475
|
}
|
|
2289
2476
|
}),
|
|
2290
|
-
label: new
|
|
2477
|
+
label: new I({
|
|
2291
2478
|
componentName: "label",
|
|
2292
2479
|
allowedTypes: ["String", "Int", "Long"],
|
|
2293
2480
|
strictlyDependsOnParents: !0,
|
|
@@ -2299,7 +2486,7 @@ var Ke = class extends R {
|
|
|
2299
2486
|
multipleSelectors: !1
|
|
2300
2487
|
}
|
|
2301
2488
|
}),
|
|
2302
|
-
size: new
|
|
2489
|
+
size: new I({
|
|
2303
2490
|
componentName: "size",
|
|
2304
2491
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
2305
2492
|
strictlyDependsOnParents: !0,
|
|
@@ -2311,7 +2498,7 @@ var Ke = class extends R {
|
|
|
2311
2498
|
})
|
|
2312
2499
|
},
|
|
2313
2500
|
{
|
|
2314
|
-
filters: new
|
|
2501
|
+
filters: new I({
|
|
2315
2502
|
componentName: "filters",
|
|
2316
2503
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
2317
2504
|
strictlyDependsOnParents: !0,
|
|
@@ -2322,9 +2509,9 @@ var Ke = class extends R {
|
|
|
2322
2509
|
dimensionConsumer: !0,
|
|
2323
2510
|
multipleSelectors: !0
|
|
2324
2511
|
},
|
|
2325
|
-
checkSourceBySpec:
|
|
2512
|
+
checkSourceBySpec: R
|
|
2326
2513
|
}),
|
|
2327
|
-
tabBy: new
|
|
2514
|
+
tabBy: new I({
|
|
2328
2515
|
componentName: "tabBy",
|
|
2329
2516
|
allowedTypes: ["String", "Int"],
|
|
2330
2517
|
strictlyDependsOnParents: !0,
|
|
@@ -2335,7 +2522,7 @@ var Ke = class extends R {
|
|
|
2335
2522
|
dimensionConsumer: !0
|
|
2336
2523
|
}
|
|
2337
2524
|
}),
|
|
2338
|
-
highlight: new
|
|
2525
|
+
highlight: new I({
|
|
2339
2526
|
componentName: "highlight",
|
|
2340
2527
|
allowedTypes: ["String", "Int", "Long", "Double", "Float"],
|
|
2341
2528
|
strictlyDependsOnParents: !0,
|
|
@@ -2346,7 +2533,7 @@ var Ke = class extends R {
|
|
|
2346
2533
|
columnsAllowed: !0,
|
|
2347
2534
|
multipleSelectors: !0
|
|
2348
2535
|
},
|
|
2349
|
-
checkSourceBySpec:
|
|
2536
|
+
checkSourceBySpec: R
|
|
2350
2537
|
})
|
|
2351
2538
|
}
|
|
2352
2539
|
), this.dataInputs = ["x", "y"];
|
|
@@ -2354,48 +2541,43 @@ var Ke = class extends R {
|
|
|
2354
2541
|
async getMustBeConsumedAxes(t, e) {
|
|
2355
2542
|
if (!e.components.x.selectorStates.length || !e.components.y.selectorStates.length)
|
|
2356
2543
|
return /* @__PURE__ */ new Set();
|
|
2357
|
-
const o = e.components.x.selectorStates[0].selectedSource, n = e.components.y.selectorStates[0].selectedSource, l = await t.pFrameProvider.getColumnSpecById(
|
|
2544
|
+
const o = e.components.x.selectorStates[0].selectedSource, n = e.components.y.selectorStates[0].selectedSource, l = await t.pFrameProvider.getColumnSpecById(A(o)), s = await t.pFrameProvider.getColumnSpecById(A(n));
|
|
2358
2545
|
if (!l || !s)
|
|
2359
2546
|
return /* @__PURE__ */ new Set();
|
|
2360
|
-
const
|
|
2361
|
-
return /* @__PURE__ */ new Set([...
|
|
2547
|
+
const r = l.axesSpec.map((u) => _.fromAxisSpec(u).toCanonicalString()), c = s.axesSpec.map((u) => _.fromAxisSpec(u).toCanonicalString()), i = r.filter((u) => !c.some((m) => m === u)), p = c.filter((u) => !r.some((m) => m === u));
|
|
2548
|
+
return /* @__PURE__ */ new Set([...i, ...p]);
|
|
2362
2549
|
}
|
|
2363
2550
|
async createDataByColumns(t, e) {
|
|
2364
2551
|
var o, n, l;
|
|
2365
|
-
const s = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource,
|
|
2366
|
-
if (!s || !
|
|
2552
|
+
const s = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource, r = (n = e.components.y.selectorStates[0]) == null ? void 0 : n.selectedSource;
|
|
2553
|
+
if (!s || !r)
|
|
2367
2554
|
throw Error("X or Y column is not valid");
|
|
2368
|
-
const
|
|
2369
|
-
if (!
|
|
2555
|
+
const c = A(s), i = A(r);
|
|
2556
|
+
if (!c || !i)
|
|
2370
2557
|
throw Error("X or Y column is not valid");
|
|
2371
|
-
const
|
|
2558
|
+
const p = {
|
|
2372
2559
|
type: "columns",
|
|
2373
|
-
id: (l =
|
|
2560
|
+
id: (l = z(e.components)) != null ? l : "",
|
|
2374
2561
|
values: {}
|
|
2375
|
-
},
|
|
2562
|
+
}, { linkerColumnsMap: u, compositeLinkerMap: m } = await X(t), d = [
|
|
2376
2563
|
...e.components.filters.selectorStates,
|
|
2377
2564
|
...e.components.tabBy.selectorStates
|
|
2378
|
-
],
|
|
2379
|
-
if (
|
|
2565
|
+
], h = Y(d), g = d.map((v) => A(v.selectedSource)).filter(B), x = [c, i].filter(B).map((v) => v.toCanonicalString());
|
|
2566
|
+
if (x.length === 0)
|
|
2380
2567
|
throw Error("One of X and Y should be a column");
|
|
2381
|
-
const
|
|
2382
|
-
for (const { selectedSource:
|
|
2383
|
-
|
|
2384
|
-
t,
|
|
2385
|
-
p,
|
|
2386
|
-
A,
|
|
2387
|
-
S,
|
|
2388
|
-
I
|
|
2389
|
-
)), i.push(...await M(
|
|
2568
|
+
const w = await $(t, x), D = [c, i, ...g], b = [], C = [[], []], a = [], S = [];
|
|
2569
|
+
for (const { selectedSource: v, fixedAxes: P } of d)
|
|
2570
|
+
S.push(...await V(
|
|
2390
2571
|
t,
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2572
|
+
u,
|
|
2573
|
+
m,
|
|
2574
|
+
w,
|
|
2575
|
+
v,
|
|
2576
|
+
P
|
|
2577
|
+
)), C.push(
|
|
2578
|
+
(P ?? []).map(({ axisIdx: O, axisValue: N }) => ({ idx: O, value: N }))
|
|
2397
2579
|
);
|
|
2398
|
-
const
|
|
2580
|
+
const y = [
|
|
2399
2581
|
e.components.grouping,
|
|
2400
2582
|
e.components.facetBy,
|
|
2401
2583
|
e.components.tooltipContent,
|
|
@@ -2403,115 +2585,116 @@ var Ke = class extends R {
|
|
|
2403
2585
|
e.components.highlight,
|
|
2404
2586
|
e.components.size
|
|
2405
2587
|
];
|
|
2406
|
-
for (const
|
|
2407
|
-
for (const { selectedSource:
|
|
2408
|
-
|
|
2409
|
-
(
|
|
2410
|
-
),
|
|
2588
|
+
for (const v of y)
|
|
2589
|
+
for (const { selectedSource: P, fixedAxes: O } of v.selectorStates) {
|
|
2590
|
+
b.push(A(P)), a.push(
|
|
2591
|
+
(O ?? []).map(({ axisIdx: L, axisValue: E }) => ({ idx: L, value: E }))
|
|
2592
|
+
), S.push(...await V(
|
|
2411
2593
|
t,
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
P
|
|
2594
|
+
u,
|
|
2595
|
+
m,
|
|
2596
|
+
w,
|
|
2597
|
+
P,
|
|
2598
|
+
O
|
|
2416
2599
|
));
|
|
2417
|
-
const N = await
|
|
2418
|
-
N &&
|
|
2600
|
+
const N = await k(t, P, x);
|
|
2601
|
+
N && b.push(N);
|
|
2419
2602
|
}
|
|
2420
|
-
const
|
|
2421
|
-
[
|
|
2422
|
-
x,
|
|
2423
|
-
d,
|
|
2424
|
-
!1,
|
|
2603
|
+
const f = await t.pFrameProvider.getTableOuterJoin(
|
|
2604
|
+
[c, i, ...S, ...g],
|
|
2425
2605
|
b,
|
|
2426
|
-
|
|
2606
|
+
h,
|
|
2607
|
+
!1,
|
|
2608
|
+
C,
|
|
2609
|
+
a
|
|
2427
2610
|
);
|
|
2428
|
-
return [...
|
|
2429
|
-
const
|
|
2430
|
-
|
|
2431
|
-
}), e.components.highlight.selectorStates.length && (
|
|
2432
|
-
byColumns:
|
|
2433
|
-
axesData:
|
|
2611
|
+
return [...D, ...b].forEach((v) => {
|
|
2612
|
+
const P = v.toCanonicalString();
|
|
2613
|
+
p.values[P] = B(v) ? f.columnsData[P] : f.axesData[P];
|
|
2614
|
+
}), e.components.highlight.selectorStates.length && (p.values.highlight = Ie(e.components.highlight.selectorStates, f)), {
|
|
2615
|
+
byColumns: p,
|
|
2616
|
+
axesData: f.axesData
|
|
2434
2617
|
};
|
|
2435
2618
|
}
|
|
2436
2619
|
async createChartSettings(t, e) {
|
|
2437
2620
|
var o, n, l, s;
|
|
2438
|
-
const
|
|
2439
|
-
if (!
|
|
2621
|
+
const r = (o = e.components.x.selectorStates[0]) == null ? void 0 : o.selectedSource, c = (n = e.components.y.selectorStates[0]) == null ? void 0 : n.selectedSource, i = r ? A(r) : null, p = c ? A(c) : null;
|
|
2622
|
+
if (!r || !c || !i || !p || !B(i) && !B(p))
|
|
2440
2623
|
throw Error("Empty or invalid required data");
|
|
2441
|
-
const
|
|
2624
|
+
const u = [i, p].filter(B).map((a) => a.toCanonicalString()), m = {
|
|
2442
2625
|
type: "column",
|
|
2443
|
-
value:
|
|
2444
|
-
label: await
|
|
2626
|
+
value: r,
|
|
2627
|
+
label: await T(t, r, u)
|
|
2445
2628
|
}, d = {
|
|
2446
2629
|
type: "column",
|
|
2447
|
-
value:
|
|
2448
|
-
label: await
|
|
2449
|
-
},
|
|
2630
|
+
value: c,
|
|
2631
|
+
label: await T(t, c, u)
|
|
2632
|
+
}, h = {
|
|
2450
2633
|
type: "column",
|
|
2451
2634
|
value: "key"
|
|
2452
|
-
},
|
|
2453
|
-
e.components.facetBy.selectorStates.map(async (
|
|
2454
|
-
var
|
|
2635
|
+
}, g = await Promise.all(
|
|
2636
|
+
e.components.facetBy.selectorStates.map(async (a) => {
|
|
2637
|
+
var S, y;
|
|
2455
2638
|
return {
|
|
2456
2639
|
type: "column",
|
|
2457
|
-
value: (y = (
|
|
2640
|
+
value: (y = (S = await k(t, a.selectedSource, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : a.selectedSource
|
|
2458
2641
|
};
|
|
2459
2642
|
})
|
|
2460
|
-
),
|
|
2461
|
-
...e.components.grouping.selectorStates.map((
|
|
2462
|
-
...e.components.size.selectorStates.map((
|
|
2463
|
-
]),
|
|
2464
|
-
|
|
2465
|
-
var
|
|
2643
|
+
), x = ie.uniq([
|
|
2644
|
+
...e.components.grouping.selectorStates.map((a) => a.selectedSource),
|
|
2645
|
+
...e.components.size.selectorStates.map((a) => a.selectedSource)
|
|
2646
|
+
]), w = await Promise.all(
|
|
2647
|
+
x.map(async (a) => {
|
|
2648
|
+
var S, y;
|
|
2466
2649
|
return {
|
|
2467
2650
|
type: "column",
|
|
2468
|
-
label: await
|
|
2469
|
-
value:
|
|
2470
|
-
valueLabels: (y = (
|
|
2651
|
+
label: await T(t, a, u) || a,
|
|
2652
|
+
value: a,
|
|
2653
|
+
valueLabels: (y = (S = await k(t, a, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : a
|
|
2471
2654
|
};
|
|
2472
2655
|
})
|
|
2473
|
-
),
|
|
2474
|
-
e.components.tooltipContent.selectorStates.map(async (
|
|
2475
|
-
var
|
|
2476
|
-
const
|
|
2656
|
+
), D = await Promise.all(
|
|
2657
|
+
e.components.tooltipContent.selectorStates.map(async (a) => {
|
|
2658
|
+
var S, y;
|
|
2659
|
+
const f = a.selectedSource;
|
|
2477
2660
|
return {
|
|
2478
2661
|
type: "column",
|
|
2479
|
-
label: await
|
|
2480
|
-
value:
|
|
2481
|
-
valueLabels: (y = (
|
|
2662
|
+
label: await T(t, f, u) || f,
|
|
2663
|
+
value: f,
|
|
2664
|
+
valueLabels: (y = (S = await k(t, f, u)) == null ? void 0 : S.toCanonicalString()) != null ? y : f
|
|
2482
2665
|
};
|
|
2483
2666
|
})
|
|
2484
2667
|
);
|
|
2485
2668
|
let b;
|
|
2486
2669
|
if (e.components.label.selectorStates.length) {
|
|
2487
|
-
const
|
|
2670
|
+
const a = e.components.label.selectorStates[0].selectedSource;
|
|
2488
2671
|
b = {
|
|
2489
2672
|
type: "column",
|
|
2490
|
-
value:
|
|
2491
|
-
label: await
|
|
2492
|
-
valueLabels: (s = (l = await
|
|
2673
|
+
value: a,
|
|
2674
|
+
label: await T(t, a, u),
|
|
2675
|
+
valueLabels: (s = (l = await k(t, a, u)) == null ? void 0 : l.toCanonicalString()) != null ? s : a
|
|
2493
2676
|
};
|
|
2494
2677
|
}
|
|
2495
|
-
let
|
|
2496
|
-
return e.components.highlight.selectorStates.length && (
|
|
2678
|
+
let C;
|
|
2679
|
+
return e.components.highlight.selectorStates.length && (C = {
|
|
2497
2680
|
type: "column",
|
|
2498
2681
|
value: "highlight"
|
|
2499
2682
|
}), {
|
|
2500
2683
|
type: "scatterplot-umap",
|
|
2501
2684
|
x: m,
|
|
2502
2685
|
y: d,
|
|
2503
|
-
keyColumn:
|
|
2504
|
-
facetBy:
|
|
2505
|
-
grouping:
|
|
2686
|
+
keyColumn: h,
|
|
2687
|
+
facetBy: g,
|
|
2688
|
+
grouping: w,
|
|
2506
2689
|
label: b,
|
|
2507
|
-
highlight:
|
|
2690
|
+
highlight: C,
|
|
2508
2691
|
tooltips: {
|
|
2509
2692
|
show: !0,
|
|
2510
|
-
content:
|
|
2693
|
+
content: D
|
|
2511
2694
|
}
|
|
2512
2695
|
};
|
|
2513
2696
|
}
|
|
2514
|
-
}, me = "pl7.app/dendrogram/nodeId", de = "id",
|
|
2697
|
+
}, me = "pl7.app/dendrogram/nodeId", de = "id", it = {
|
|
2515
2698
|
type: "dendro",
|
|
2516
2699
|
components: {
|
|
2517
2700
|
value: { type: "simple", selectorStates: [] },
|
|
@@ -2531,11 +2714,11 @@ var Ke = class extends R {
|
|
|
2531
2714
|
heatmapGroup: { type: "simple", selectorStates: [] }
|
|
2532
2715
|
},
|
|
2533
2716
|
dividedAxes: {}
|
|
2534
|
-
},
|
|
2717
|
+
}, ut = class extends Q {
|
|
2535
2718
|
constructor() {
|
|
2536
2719
|
super(
|
|
2537
2720
|
{
|
|
2538
|
-
value: new
|
|
2721
|
+
value: new I({
|
|
2539
2722
|
componentName: "value",
|
|
2540
2723
|
allowedTypes: ["Int", "Long"],
|
|
2541
2724
|
annotations: { "pl7.app/dendrogram/isTopology": "true" },
|
|
@@ -2547,7 +2730,7 @@ var Ke = class extends R {
|
|
|
2547
2730
|
columnsWithExtraAxesAllowed: !1
|
|
2548
2731
|
}
|
|
2549
2732
|
}),
|
|
2550
|
-
height: new
|
|
2733
|
+
height: new I({
|
|
2551
2734
|
componentName: "height",
|
|
2552
2735
|
allowedTypes: ["Int", "Long", "Double", "Float"],
|
|
2553
2736
|
annotations: { "pl7.app/dendrogram/isDistance": "true" },
|
|
@@ -2560,7 +2743,7 @@ var Ke = class extends R {
|
|
|
2560
2743
|
columnsWithExtraAxesAllowed: !1
|
|
2561
2744
|
}
|
|
2562
2745
|
}),
|
|
2563
|
-
labels: new
|
|
2746
|
+
labels: new I({
|
|
2564
2747
|
componentName: "labels",
|
|
2565
2748
|
allowedTypes: ["Int", "String", "Long"],
|
|
2566
2749
|
parentComponents: ["value"],
|
|
@@ -2571,7 +2754,7 @@ var Ke = class extends R {
|
|
|
2571
2754
|
columnsWithExtraAxesAllowed: !1
|
|
2572
2755
|
}
|
|
2573
2756
|
}),
|
|
2574
|
-
tableContent: new
|
|
2757
|
+
tableContent: new I({
|
|
2575
2758
|
componentName: "tableContent",
|
|
2576
2759
|
allowedTypes: ["Int", "String", "Long", "Double", "Float"],
|
|
2577
2760
|
parentComponents: ["value"],
|
|
@@ -2583,7 +2766,7 @@ var Ke = class extends R {
|
|
|
2583
2766
|
columnsWithExtraAxesAllowed: !1
|
|
2584
2767
|
}
|
|
2585
2768
|
}),
|
|
2586
|
-
nodeShape: new
|
|
2769
|
+
nodeShape: new I({
|
|
2587
2770
|
componentName: "nodeShape",
|
|
2588
2771
|
allowedTypes: ["Int", "String", "Long"],
|
|
2589
2772
|
parentComponents: ["value"],
|
|
@@ -2594,7 +2777,7 @@ var Ke = class extends R {
|
|
|
2594
2777
|
columnsWithExtraAxesAllowed: !1
|
|
2595
2778
|
}
|
|
2596
2779
|
}),
|
|
2597
|
-
nodeSize: new
|
|
2780
|
+
nodeSize: new I({
|
|
2598
2781
|
componentName: "nodeSize",
|
|
2599
2782
|
allowedTypes: ["Double", "Int", "String", "Long"],
|
|
2600
2783
|
parentComponents: ["value"],
|
|
@@ -2605,7 +2788,7 @@ var Ke = class extends R {
|
|
|
2605
2788
|
columnsWithExtraAxesAllowed: !1
|
|
2606
2789
|
}
|
|
2607
2790
|
}),
|
|
2608
|
-
nodeColor: new
|
|
2791
|
+
nodeColor: new I({
|
|
2609
2792
|
componentName: "nodeColor",
|
|
2610
2793
|
allowedTypes: ["Double", "Int", "String", "Long"],
|
|
2611
2794
|
parentComponents: ["value"],
|
|
@@ -2616,7 +2799,7 @@ var Ke = class extends R {
|
|
|
2616
2799
|
columnsWithExtraAxesAllowed: !1
|
|
2617
2800
|
}
|
|
2618
2801
|
}),
|
|
2619
|
-
lineColor: new
|
|
2802
|
+
lineColor: new I({
|
|
2620
2803
|
componentName: "lineColor",
|
|
2621
2804
|
allowedTypes: ["Double", "Int", "String", "Long"],
|
|
2622
2805
|
parentComponents: ["value"],
|
|
@@ -2627,7 +2810,7 @@ var Ke = class extends R {
|
|
|
2627
2810
|
columnsWithExtraAxesAllowed: !1
|
|
2628
2811
|
}
|
|
2629
2812
|
}),
|
|
2630
|
-
heatmapForSequence: new
|
|
2813
|
+
heatmapForSequence: new I({
|
|
2631
2814
|
componentName: "heatmapForSequence",
|
|
2632
2815
|
allowedTypes: ["String"],
|
|
2633
2816
|
annotations: { "pl7.app/type": "sequence" },
|
|
@@ -2639,7 +2822,7 @@ var Ke = class extends R {
|
|
|
2639
2822
|
columnsWithExtraAxesAllowed: !1
|
|
2640
2823
|
}
|
|
2641
2824
|
}),
|
|
2642
|
-
heatmapAnnotation: new
|
|
2825
|
+
heatmapAnnotation: new I({
|
|
2643
2826
|
componentName: "heatmapAnnotation",
|
|
2644
2827
|
allowedTypes: ["Double", "Int", "Long", "Float", "String"],
|
|
2645
2828
|
parentComponents: ["value"],
|
|
@@ -2651,7 +2834,7 @@ var Ke = class extends R {
|
|
|
2651
2834
|
columnsWithExtraAxesAllowed: !1
|
|
2652
2835
|
}
|
|
2653
2836
|
}),
|
|
2654
|
-
facetBy: new
|
|
2837
|
+
facetBy: new I({
|
|
2655
2838
|
componentName: "facetBy",
|
|
2656
2839
|
allowedTypes: ["String", "Int", "Long"],
|
|
2657
2840
|
parentComponents: ["value"],
|
|
@@ -2664,7 +2847,7 @@ var Ke = class extends R {
|
|
|
2664
2847
|
columnsWithExtraAxesAllowed: !1
|
|
2665
2848
|
}
|
|
2666
2849
|
}),
|
|
2667
|
-
heatmapAxis: new
|
|
2850
|
+
heatmapAxis: new I({
|
|
2668
2851
|
componentName: "heatmapAxis",
|
|
2669
2852
|
allowedTypes: ["String", "Int", "Long"],
|
|
2670
2853
|
parentComponents: ["heatmapAnnotation"],
|
|
@@ -2675,7 +2858,7 @@ var Ke = class extends R {
|
|
|
2675
2858
|
columnsWithExtraAxesAllowed: !1
|
|
2676
2859
|
}
|
|
2677
2860
|
}),
|
|
2678
|
-
heatmapGroup: new
|
|
2861
|
+
heatmapGroup: new I({
|
|
2679
2862
|
componentName: "heatmapGroup",
|
|
2680
2863
|
allowedTypes: ["String", "Int", "Long"],
|
|
2681
2864
|
parentComponents: ["heatmapAnnotation"],
|
|
@@ -2689,7 +2872,7 @@ var Ke = class extends R {
|
|
|
2689
2872
|
})
|
|
2690
2873
|
},
|
|
2691
2874
|
{
|
|
2692
|
-
filters: new
|
|
2875
|
+
filters: new I({
|
|
2693
2876
|
componentName: "filters",
|
|
2694
2877
|
allowedTypes: ["String", "Int", "Long"],
|
|
2695
2878
|
parentComponents: ["value", "heatmapAnnotation"],
|
|
@@ -2702,7 +2885,7 @@ var Ke = class extends R {
|
|
|
2702
2885
|
columnsWithExtraAxesAllowed: !1
|
|
2703
2886
|
}
|
|
2704
2887
|
}),
|
|
2705
|
-
tabBy: new
|
|
2888
|
+
tabBy: new I({
|
|
2706
2889
|
componentName: "tabBy",
|
|
2707
2890
|
allowedTypes: ["String", "Int", "Long"],
|
|
2708
2891
|
parentComponents: ["value", "heatmapAnnotation"],
|
|
@@ -2722,16 +2905,16 @@ var Ke = class extends R {
|
|
|
2722
2905
|
}
|
|
2723
2906
|
async createTableData(t, e) {
|
|
2724
2907
|
var o;
|
|
2725
|
-
const n = {}, l = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource, s =
|
|
2908
|
+
const n = {}, l = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource, s = A(l);
|
|
2726
2909
|
if (!l || !B(s))
|
|
2727
2910
|
throw Error("Value column is not valid");
|
|
2728
|
-
const c = await
|
|
2911
|
+
const { linkerColumnsMap: r, compositeLinkerMap: c } = await X(t), i = Y([
|
|
2729
2912
|
...e.components.filters.selectorStates,
|
|
2730
2913
|
...e.components.tabBy.selectorStates
|
|
2731
|
-
]),
|
|
2732
|
-
...e.components.filters.selectorStates.map((
|
|
2733
|
-
...e.components.tabBy.selectorStates.map((
|
|
2734
|
-
].filter(B), u = [l],
|
|
2914
|
+
]), p = [
|
|
2915
|
+
...e.components.filters.selectorStates.map((a) => A(a.selectedSource)),
|
|
2916
|
+
...e.components.tabBy.selectorStates.map((a) => A(a.selectedSource))
|
|
2917
|
+
].filter(B), u = [l], m = await $(t, u), d = [], h = [], g = [], x = [e.components.value], w = [
|
|
2735
2918
|
e.components.tableContent,
|
|
2736
2919
|
// next components can content data mapped on tree
|
|
2737
2920
|
e.components.labels,
|
|
@@ -2739,70 +2922,72 @@ var Ke = class extends R {
|
|
|
2739
2922
|
e.components.nodeSize,
|
|
2740
2923
|
e.components.nodeShape,
|
|
2741
2924
|
e.components.lineColor
|
|
2742
|
-
],
|
|
2743
|
-
for (const
|
|
2744
|
-
for (const { selectedSource:
|
|
2745
|
-
|
|
2925
|
+
], D = {};
|
|
2926
|
+
for (const a of x)
|
|
2927
|
+
for (const { selectedSource: S, fixedAxes: y } of a.selectorStates) {
|
|
2928
|
+
g.push(...await V(
|
|
2746
2929
|
t,
|
|
2930
|
+
r,
|
|
2747
2931
|
c,
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2932
|
+
m,
|
|
2933
|
+
S,
|
|
2934
|
+
y
|
|
2751
2935
|
));
|
|
2752
|
-
const
|
|
2753
|
-
v
|
|
2936
|
+
const f = await k(t, S, u), v = f ?? A(S);
|
|
2937
|
+
D[v.toCanonicalString()] = S, d.push(v);
|
|
2754
2938
|
}
|
|
2755
|
-
for (const
|
|
2756
|
-
for (const { selectedSource:
|
|
2757
|
-
|
|
2939
|
+
for (const a of w)
|
|
2940
|
+
for (const { selectedSource: S, fixedAxes: y } of a.selectorStates) {
|
|
2941
|
+
g.push(...await V(
|
|
2758
2942
|
t,
|
|
2943
|
+
r,
|
|
2759
2944
|
c,
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2945
|
+
m,
|
|
2946
|
+
S,
|
|
2947
|
+
y
|
|
2763
2948
|
));
|
|
2764
|
-
const
|
|
2765
|
-
|
|
2949
|
+
const f = await k(t, S, u), v = f ?? A(S);
|
|
2950
|
+
D[S] = v.toCanonicalString(), h.push(v);
|
|
2766
2951
|
}
|
|
2767
|
-
const
|
|
2768
|
-
[...
|
|
2769
|
-
|
|
2770
|
-
|
|
2952
|
+
const b = await t.pFrameProvider.getTableOuterJoin(
|
|
2953
|
+
[...d, ...p, ...g],
|
|
2954
|
+
h,
|
|
2955
|
+
i,
|
|
2771
2956
|
!1
|
|
2772
2957
|
);
|
|
2773
|
-
for (const
|
|
2774
|
-
const
|
|
2775
|
-
n[
|
|
2776
|
-
data: B(
|
|
2777
|
-
spec: B(
|
|
2778
|
-
label: await
|
|
2958
|
+
for (const a of [...d, ...h]) {
|
|
2959
|
+
const S = a.toCanonicalString(), y = D[a.toCanonicalString()];
|
|
2960
|
+
n[y] = {
|
|
2961
|
+
data: B(a) ? b.columnsData[S] : b.axesData[S],
|
|
2962
|
+
spec: B(a) ? b.columnSpecs[S] : b.axesSpecs[S],
|
|
2963
|
+
label: await T(t, y, u)
|
|
2779
2964
|
};
|
|
2780
2965
|
}
|
|
2781
|
-
const
|
|
2782
|
-
(
|
|
2783
|
-
var
|
|
2784
|
-
return ((
|
|
2966
|
+
const C = Object.keys(b.axesData).find(
|
|
2967
|
+
(a) => {
|
|
2968
|
+
var S;
|
|
2969
|
+
return ((S = A(a)) == null ? void 0 : S.name) === me;
|
|
2785
2970
|
}
|
|
2786
2971
|
);
|
|
2787
|
-
return
|
|
2788
|
-
data:
|
|
2972
|
+
return C ? n[de] = {
|
|
2973
|
+
data: b.axesData[C],
|
|
2789
2974
|
spec: { kind: "PColumn", valueType: "Int", name: "Node id" },
|
|
2790
2975
|
label: "Node id"
|
|
2791
2976
|
} : console.warn("Missed node id axis in data column"), n;
|
|
2792
2977
|
}
|
|
2793
2978
|
async createDataByColumns(t, e) {
|
|
2794
2979
|
var o, n, l;
|
|
2795
|
-
const s = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource,
|
|
2796
|
-
if (!s || !B(
|
|
2980
|
+
const s = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource, r = (n = e.components.heatmapAnnotation.selectorStates[0]) == null ? void 0 : n.selectedSource, c = A(s), i = r ? A(r) : null;
|
|
2981
|
+
if (!s || !B(c))
|
|
2797
2982
|
throw Error("Value column is not valid");
|
|
2798
|
-
const
|
|
2983
|
+
const p = {
|
|
2799
2984
|
type: "columns",
|
|
2800
|
-
id: (l =
|
|
2985
|
+
id: (l = z(e.components)) != null ? l : "",
|
|
2801
2986
|
values: {}
|
|
2802
|
-
},
|
|
2987
|
+
}, u = [
|
|
2803
2988
|
...e.components.filters.selectorStates,
|
|
2804
2989
|
...e.components.tabBy.selectorStates
|
|
2805
|
-
], m =
|
|
2990
|
+
], m = Y(u), d = u.map((y) => A(y.selectedSource)).filter(B), h = [c, i].filter(B).map((y) => y.toCanonicalString()), g = [], x = [], w = [], D = [], b = [
|
|
2806
2991
|
e.components.value,
|
|
2807
2992
|
e.components.height,
|
|
2808
2993
|
e.components.labels,
|
|
@@ -2812,147 +2997,147 @@ var Ke = class extends R {
|
|
|
2812
2997
|
e.components.lineColor,
|
|
2813
2998
|
e.components.heatmapAnnotation,
|
|
2814
2999
|
e.components.heatmapForSequence
|
|
2815
|
-
],
|
|
3000
|
+
], C = [
|
|
2816
3001
|
e.components.facetBy,
|
|
2817
3002
|
e.components.heatmapAxis,
|
|
2818
3003
|
e.components.heatmapGroup,
|
|
2819
3004
|
e.components.tableContent
|
|
2820
3005
|
];
|
|
2821
3006
|
for (const y of b)
|
|
2822
|
-
for (const { selectedSource:
|
|
2823
|
-
|
|
2824
|
-
(
|
|
3007
|
+
for (const { selectedSource: f, fixedAxes: v } of y.selectorStates) {
|
|
3008
|
+
g.push(A(f)), w.push(
|
|
3009
|
+
(v ?? []).map(({ axisIdx: O, axisValue: N }) => ({ idx: O, value: N }))
|
|
2825
3010
|
);
|
|
2826
|
-
const P = await
|
|
2827
|
-
P &&
|
|
3011
|
+
const P = await k(t, f, h);
|
|
3012
|
+
P && g.push(P);
|
|
2828
3013
|
}
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
(y ?? []).map(({ axisIdx:
|
|
3014
|
+
u.forEach(({ fixedAxes: y }) => {
|
|
3015
|
+
w.push(
|
|
3016
|
+
(y ?? []).map(({ axisIdx: f, axisValue: v }) => ({ idx: f, value: v }))
|
|
2832
3017
|
);
|
|
2833
3018
|
});
|
|
2834
|
-
for (const y of
|
|
2835
|
-
for (const { selectedSource:
|
|
2836
|
-
|
|
2837
|
-
(
|
|
3019
|
+
for (const y of C)
|
|
3020
|
+
for (const { selectedSource: f, fixedAxes: v } of y.selectorStates) {
|
|
3021
|
+
x.push(A(f)), D.push(
|
|
3022
|
+
(v ?? []).map(({ axisIdx: O, axisValue: N }) => ({ idx: O, value: N }))
|
|
2838
3023
|
);
|
|
2839
|
-
const P = await
|
|
2840
|
-
P &&
|
|
3024
|
+
const P = await k(t, f, h);
|
|
3025
|
+
P && x.push(P);
|
|
2841
3026
|
}
|
|
2842
|
-
const
|
|
2843
|
-
[...
|
|
2844
|
-
|
|
3027
|
+
const a = await t.pFrameProvider.getTableOuterJoin(
|
|
3028
|
+
[...g, ...d],
|
|
3029
|
+
x,
|
|
2845
3030
|
m,
|
|
2846
3031
|
!1,
|
|
2847
|
-
|
|
2848
|
-
|
|
3032
|
+
w,
|
|
3033
|
+
D
|
|
2849
3034
|
);
|
|
2850
|
-
[...
|
|
2851
|
-
const
|
|
2852
|
-
|
|
3035
|
+
[...g, ...x].forEach((y) => {
|
|
3036
|
+
const f = y.toCanonicalString(), v = B(y) ? a.columnsData[f] : a.axesData[f];
|
|
3037
|
+
p.values[f] = [], p.values[f] = v;
|
|
2853
3038
|
});
|
|
2854
|
-
const
|
|
3039
|
+
const S = Object.keys(a.axesData).find(
|
|
2855
3040
|
(y) => {
|
|
2856
|
-
var
|
|
2857
|
-
return ((
|
|
3041
|
+
var f;
|
|
3042
|
+
return ((f = A(y)) == null ? void 0 : f.name) === me;
|
|
2858
3043
|
}
|
|
2859
3044
|
);
|
|
2860
|
-
return
|
|
3045
|
+
return S ? p.values[de] = a.axesData[S] : console.warn("Missed node id axis in data column"), { byColumns: p };
|
|
2861
3046
|
}
|
|
2862
3047
|
async createChartSettings(t, e) {
|
|
2863
3048
|
var o, n, l;
|
|
2864
|
-
const s = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource,
|
|
2865
|
-
if (!s || !B(
|
|
3049
|
+
const s = (o = e.components.value.selectorStates[0]) == null ? void 0 : o.selectedSource, r = A(s);
|
|
3050
|
+
if (!s || !B(r))
|
|
2866
3051
|
throw Error("Data column is not valid");
|
|
2867
|
-
const
|
|
3052
|
+
const c = [s], i = { type: "column", value: de }, p = { type: "column", value: s }, u = e.components.height.selectorStates.length ? { type: "column", value: e.components.height.selectorStates[0].selectedSource } : void 0, m = e.components.labels.selectorStates.length ? { type: "column", value: e.components.labels.selectorStates[0].selectedSource } : void 0, d = {};
|
|
2868
3053
|
if (e.components.nodeColor.selectorStates.length) {
|
|
2869
|
-
const
|
|
3054
|
+
const w = e.components.nodeColor.selectorStates[0].selectedSource;
|
|
2870
3055
|
d.nodeColor = {
|
|
2871
3056
|
columnName: {
|
|
2872
3057
|
type: "column",
|
|
2873
|
-
value:
|
|
2874
|
-
label: await
|
|
3058
|
+
value: w,
|
|
3059
|
+
label: await T(t, w, c)
|
|
2875
3060
|
}
|
|
2876
3061
|
};
|
|
2877
3062
|
}
|
|
2878
3063
|
if (e.components.nodeShape.selectorStates.length) {
|
|
2879
|
-
const
|
|
3064
|
+
const w = e.components.nodeShape.selectorStates[0].selectedSource;
|
|
2880
3065
|
d.nodeShape = {
|
|
2881
3066
|
columnName: {
|
|
2882
3067
|
type: "column",
|
|
2883
|
-
value:
|
|
2884
|
-
label: await
|
|
3068
|
+
value: w,
|
|
3069
|
+
label: await T(t, w, c)
|
|
2885
3070
|
}
|
|
2886
3071
|
};
|
|
2887
3072
|
}
|
|
2888
3073
|
if (e.components.nodeSize.selectorStates.length) {
|
|
2889
|
-
const
|
|
3074
|
+
const w = e.components.nodeSize.selectorStates[0].selectedSource;
|
|
2890
3075
|
d.nodeSize = {
|
|
2891
3076
|
columnName: {
|
|
2892
3077
|
type: "column",
|
|
2893
|
-
value:
|
|
2894
|
-
label: await
|
|
3078
|
+
value: w,
|
|
3079
|
+
label: await T(t, w, c)
|
|
2895
3080
|
}
|
|
2896
3081
|
};
|
|
2897
3082
|
}
|
|
2898
3083
|
if (e.components.lineColor.selectorStates.length) {
|
|
2899
|
-
const
|
|
3084
|
+
const w = e.components.lineColor.selectorStates[0].selectedSource;
|
|
2900
3085
|
d.lineColor = {
|
|
2901
3086
|
columnName: {
|
|
2902
3087
|
type: "column",
|
|
2903
|
-
value:
|
|
2904
|
-
label: await
|
|
3088
|
+
value: w,
|
|
3089
|
+
label: await T(t, w, c)
|
|
2905
3090
|
}
|
|
2906
3091
|
};
|
|
2907
3092
|
}
|
|
2908
|
-
let
|
|
3093
|
+
let h, g, x;
|
|
2909
3094
|
if (e.components.heatmapAnnotation.selectorStates.length && e.components.heatmapAxis.selectorStates.length) {
|
|
2910
|
-
const
|
|
2911
|
-
|
|
3095
|
+
const w = e.components.heatmapAnnotation.selectorStates[0].selectedSource;
|
|
3096
|
+
h = {
|
|
2912
3097
|
type: "column",
|
|
2913
|
-
value:
|
|
2914
|
-
label: await
|
|
2915
|
-
valueLabels: (n = await
|
|
3098
|
+
value: w,
|
|
3099
|
+
label: await T(t, w, []),
|
|
3100
|
+
valueLabels: (n = await k(t, w, [])) == null ? void 0 : n.toCanonicalString()
|
|
2916
3101
|
};
|
|
2917
|
-
const
|
|
2918
|
-
|
|
3102
|
+
const D = e.components.heatmapAxis.selectorStates[0].selectedSource;
|
|
3103
|
+
g = {
|
|
2919
3104
|
type: "column",
|
|
2920
|
-
value:
|
|
2921
|
-
label: await
|
|
2922
|
-
valueLabels: (l = await
|
|
2923
|
-
},
|
|
3105
|
+
value: D,
|
|
3106
|
+
label: await T(t, D, [w]),
|
|
3107
|
+
valueLabels: (l = await k(t, D, [w])) == null ? void 0 : l.toCanonicalString()
|
|
3108
|
+
}, x = await Promise.all(
|
|
2924
3109
|
e.components.heatmapGroup.selectorStates.map(async (b) => {
|
|
2925
|
-
var
|
|
3110
|
+
var C;
|
|
2926
3111
|
return {
|
|
2927
3112
|
type: "column",
|
|
2928
3113
|
value: b.selectedSource,
|
|
2929
|
-
label: await
|
|
2930
|
-
valueLabels: (
|
|
3114
|
+
label: await T(t, b.selectedSource, [w]),
|
|
3115
|
+
valueLabels: (C = await k(t, b.selectedSource, [w])) == null ? void 0 : C.toCanonicalString()
|
|
2931
3116
|
};
|
|
2932
3117
|
})
|
|
2933
3118
|
);
|
|
2934
3119
|
} else if (e.components.heatmapForSequence.selectorStates.length) {
|
|
2935
|
-
const
|
|
2936
|
-
|
|
3120
|
+
const w = e.components.heatmapForSequence.selectorStates[0].selectedSource;
|
|
3121
|
+
h = {
|
|
2937
3122
|
type: "column",
|
|
2938
|
-
value:
|
|
2939
|
-
label: await
|
|
3123
|
+
value: w,
|
|
3124
|
+
label: await T(t, w, [])
|
|
2940
3125
|
};
|
|
2941
3126
|
}
|
|
2942
3127
|
return {
|
|
2943
3128
|
type: "dendro",
|
|
2944
|
-
id:
|
|
2945
|
-
parentId:
|
|
2946
|
-
height:
|
|
3129
|
+
id: i,
|
|
3130
|
+
parentId: p,
|
|
3131
|
+
height: u,
|
|
2947
3132
|
labels: m,
|
|
2948
3133
|
aes: d,
|
|
2949
|
-
heatmapAnnotation:
|
|
2950
|
-
heatmapAxis:
|
|
2951
|
-
heatmapGroup:
|
|
3134
|
+
heatmapAnnotation: h,
|
|
3135
|
+
heatmapAxis: g,
|
|
3136
|
+
heatmapGroup: x
|
|
2952
3137
|
};
|
|
2953
3138
|
}
|
|
2954
|
-
},
|
|
2955
|
-
function
|
|
3139
|
+
}, ge = 1e6;
|
|
3140
|
+
function ce(t, e) {
|
|
2956
3141
|
if (t === "String")
|
|
2957
3142
|
return e.data;
|
|
2958
3143
|
if (typeof e.data[0] == "bigint") {
|
|
@@ -2967,8 +3152,8 @@ function re(t, e) {
|
|
|
2967
3152
|
}
|
|
2968
3153
|
return e.data;
|
|
2969
3154
|
}
|
|
2970
|
-
var
|
|
2971
|
-
var
|
|
3155
|
+
var H = !1;
|
|
3156
|
+
var pt = class {
|
|
2972
3157
|
constructor(t, e) {
|
|
2973
3158
|
this.pframeHandle = t, this.pframeDriver = e;
|
|
2974
3159
|
}
|
|
@@ -2989,19 +3174,19 @@ var et = class {
|
|
|
2989
3174
|
},
|
|
2990
3175
|
filters: e,
|
|
2991
3176
|
sorting: []
|
|
2992
|
-
}), l = n.filter((
|
|
3177
|
+
}), l = n.filter((r) => r.spec.type === "axis"), s = n.filter((r) => r.spec.type === "column");
|
|
2993
3178
|
return {
|
|
2994
|
-
axesData: l.reduce((
|
|
2995
|
-
const
|
|
2996
|
-
return
|
|
3179
|
+
axesData: l.reduce((r, c) => {
|
|
3180
|
+
const i = _.fromAxisSpec(c.spec.spec);
|
|
3181
|
+
return r[i.toCanonicalString()] = ce(i.type, c.data), r;
|
|
2997
3182
|
}, {}),
|
|
2998
|
-
data: s.length ?
|
|
3183
|
+
data: s.length ? ce(t.type, s[0].data) : []
|
|
2999
3184
|
};
|
|
3000
3185
|
} catch (o) {
|
|
3001
3186
|
throw console.error("PFrame: calculateTableData error"), o;
|
|
3002
3187
|
}
|
|
3003
3188
|
}
|
|
3004
|
-
async getColumnUniqueValues(t, e =
|
|
3189
|
+
async getColumnUniqueValues(t, e = ge, o = []) {
|
|
3005
3190
|
if (!await this.isColumnExisted(t))
|
|
3006
3191
|
return { values: [], overflow: !1 };
|
|
3007
3192
|
const n = {
|
|
@@ -3011,25 +3196,25 @@ var et = class {
|
|
|
3011
3196
|
};
|
|
3012
3197
|
try {
|
|
3013
3198
|
const l = Date.now(), s = await this.pframeDriver.getUniqueValues(this.pframeHandle, n);
|
|
3014
|
-
let
|
|
3015
|
-
return s.overflow && (
|
|
3199
|
+
let r = !1;
|
|
3200
|
+
return s.overflow && (r = !0, console.warn(`More than ${e} values for ${t.name} column`)), {
|
|
3016
3201
|
values: Array.from(s.values.data).map(String),
|
|
3017
|
-
overflow:
|
|
3202
|
+
overflow: r
|
|
3018
3203
|
};
|
|
3019
3204
|
} catch (l) {
|
|
3020
3205
|
throw console.error("PFrame: getUniqueValues for column error"), l;
|
|
3021
3206
|
}
|
|
3022
3207
|
}
|
|
3023
|
-
async getAxisUniqueValues(t, e, o =
|
|
3024
|
-
const l = e.filter(B), s = await Promise.all(l.map((
|
|
3025
|
-
const
|
|
3026
|
-
return
|
|
3208
|
+
async getAxisUniqueValues(t, e, o = ge, n = []) {
|
|
3209
|
+
const l = e.filter(B), s = await Promise.all(l.map((i) => this.getColumnSpecById(i))), r = t.toCanonicalString(), c = l.filter((i, p) => {
|
|
3210
|
+
const u = s[p];
|
|
3211
|
+
return u !== null && u.axesSpec.some((m) => _.fromAxisSpec(m).toCanonicalString() === r);
|
|
3027
3212
|
});
|
|
3028
|
-
if (
|
|
3213
|
+
if (c.length === 0)
|
|
3029
3214
|
return { values: [], overflow: !1 };
|
|
3030
3215
|
try {
|
|
3031
|
-
const
|
|
3032
|
-
|
|
3216
|
+
const i = Date.now(), p = await Promise.all(
|
|
3217
|
+
c.map(
|
|
3033
3218
|
(m) => this.pframeDriver.getUniqueValues(this.pframeHandle, {
|
|
3034
3219
|
columnId: m.name,
|
|
3035
3220
|
axis: t.toPFrameId(),
|
|
@@ -3038,58 +3223,58 @@ var et = class {
|
|
|
3038
3223
|
})
|
|
3039
3224
|
)
|
|
3040
3225
|
);
|
|
3041
|
-
let
|
|
3042
|
-
return
|
|
3043
|
-
m.overflow && (
|
|
3226
|
+
let u = !1;
|
|
3227
|
+
return p.forEach((m, d) => {
|
|
3228
|
+
m.overflow && (u = !0, console.warn(`More than ${o} values for ${c[d].name} column`));
|
|
3044
3229
|
}), {
|
|
3045
|
-
values:
|
|
3046
|
-
|
|
3230
|
+
values: ie.uniq(
|
|
3231
|
+
ie.flatten(p.map((m) => Array.from(m.values.data).map(String)))
|
|
3047
3232
|
),
|
|
3048
|
-
overflow:
|
|
3233
|
+
overflow: u
|
|
3049
3234
|
};
|
|
3050
|
-
} catch (
|
|
3051
|
-
throw console.error("PFrame: getUniqueValues for axis error",
|
|
3235
|
+
} catch (i) {
|
|
3236
|
+
throw console.error("PFrame: getUniqueValues for axis error", i), i;
|
|
3052
3237
|
}
|
|
3053
3238
|
}
|
|
3054
3239
|
async getTableOuterJoin(t, e, o = [], n = !0, l = [], s = []) {
|
|
3055
|
-
const
|
|
3240
|
+
const r = t.filter(B), c = e.filter(B), i = {
|
|
3056
3241
|
src: {
|
|
3057
3242
|
type: "outer",
|
|
3058
3243
|
primary: {
|
|
3059
3244
|
type: n ? "inner" : "full",
|
|
3060
|
-
entries:
|
|
3245
|
+
entries: r.map((p, u) => {
|
|
3061
3246
|
var m;
|
|
3062
|
-
const d = (m = l[
|
|
3247
|
+
const d = (m = l[u]) == null ? void 0 : m.map((h) => ({
|
|
3063
3248
|
type: "constant",
|
|
3064
|
-
axisIndex:
|
|
3065
|
-
constant:
|
|
3066
|
-
})).filter((
|
|
3249
|
+
axisIndex: h.idx,
|
|
3250
|
+
constant: h.value
|
|
3251
|
+
})).filter((h) => h.constant !== void 0);
|
|
3067
3252
|
return d != null && d.length ? {
|
|
3068
3253
|
type: "slicedColumn",
|
|
3069
|
-
newId:
|
|
3070
|
-
column:
|
|
3254
|
+
newId: p.name,
|
|
3255
|
+
column: p.name,
|
|
3071
3256
|
axisFilters: d
|
|
3072
3257
|
} : {
|
|
3073
3258
|
type: "column",
|
|
3074
|
-
column:
|
|
3259
|
+
column: p.name
|
|
3075
3260
|
};
|
|
3076
3261
|
})
|
|
3077
3262
|
},
|
|
3078
|
-
secondary:
|
|
3263
|
+
secondary: c.map((p, u) => {
|
|
3079
3264
|
var m;
|
|
3080
|
-
const d = (m = s[
|
|
3265
|
+
const d = (m = s[u]) == null ? void 0 : m.map((h) => ({
|
|
3081
3266
|
type: "constant",
|
|
3082
|
-
axisIndex:
|
|
3083
|
-
constant:
|
|
3084
|
-
})).filter((
|
|
3267
|
+
axisIndex: h.idx,
|
|
3268
|
+
constant: h.value
|
|
3269
|
+
})).filter((h) => h.constant !== void 0);
|
|
3085
3270
|
return d != null && d.length ? {
|
|
3086
3271
|
type: "slicedColumn",
|
|
3087
|
-
newId:
|
|
3088
|
-
column:
|
|
3272
|
+
newId: p.name,
|
|
3273
|
+
column: p.name,
|
|
3089
3274
|
axisFilters: d
|
|
3090
3275
|
} : {
|
|
3091
3276
|
type: "column",
|
|
3092
|
-
column:
|
|
3277
|
+
column: p.name
|
|
3093
3278
|
};
|
|
3094
3279
|
})
|
|
3095
3280
|
},
|
|
@@ -3097,33 +3282,33 @@ var et = class {
|
|
|
3097
3282
|
sorting: []
|
|
3098
3283
|
};
|
|
3099
3284
|
try {
|
|
3100
|
-
const
|
|
3285
|
+
const p = Date.now(), u = await this.pframeDriver.calculateTableData(this.pframeHandle, i), m = u.filter((h) => h.spec.type === "axis"), d = u.filter((h) => h.spec.type === "column");
|
|
3101
3286
|
return {
|
|
3102
|
-
axesData: m.reduce((
|
|
3103
|
-
const
|
|
3104
|
-
return
|
|
3287
|
+
axesData: m.reduce((h, g) => {
|
|
3288
|
+
const x = _.fromAxisSpec(g.spec.spec);
|
|
3289
|
+
return h[x.toCanonicalString()] = ce(x.type, g.data), h;
|
|
3105
3290
|
}, {}),
|
|
3106
|
-
columnsData: d.reduce((
|
|
3107
|
-
const
|
|
3108
|
-
name:
|
|
3109
|
-
type:
|
|
3291
|
+
columnsData: d.reduce((h, g) => {
|
|
3292
|
+
const x = g.spec.spec, w = new W({
|
|
3293
|
+
name: g.spec.id,
|
|
3294
|
+
type: x.valueType
|
|
3110
3295
|
});
|
|
3111
|
-
return w
|
|
3296
|
+
return h[w.toCanonicalString()] = ce(w.type, g.data), h;
|
|
3112
3297
|
}, {}),
|
|
3113
|
-
columnSpecs: d.reduce((
|
|
3114
|
-
const
|
|
3115
|
-
name:
|
|
3116
|
-
type:
|
|
3298
|
+
columnSpecs: d.reduce((h, g) => {
|
|
3299
|
+
const x = g.spec.spec, w = new W({
|
|
3300
|
+
name: g.spec.id,
|
|
3301
|
+
type: x.valueType
|
|
3117
3302
|
});
|
|
3118
|
-
return w
|
|
3303
|
+
return h[w.toCanonicalString()] = x, h;
|
|
3119
3304
|
}, {}),
|
|
3120
|
-
axesSpecs: m.reduce((
|
|
3121
|
-
const
|
|
3122
|
-
return w
|
|
3305
|
+
axesSpecs: m.reduce((h, g) => {
|
|
3306
|
+
const x = g.spec.spec, w = _.fromAxisSpec(x);
|
|
3307
|
+
return h[w.toCanonicalString()] = x, h;
|
|
3123
3308
|
}, {})
|
|
3124
3309
|
};
|
|
3125
|
-
} catch (
|
|
3126
|
-
throw console.error("PFrame: table outer join error"), console.info("error with request: ",
|
|
3310
|
+
} catch (p) {
|
|
3311
|
+
throw console.error("PFrame: table outer join error"), console.info("error with request: ", i), p;
|
|
3127
3312
|
}
|
|
3128
3313
|
}
|
|
3129
3314
|
async getColumnSpecById(t) {
|
|
@@ -3144,7 +3329,7 @@ var et = class {
|
|
|
3144
3329
|
for (const l of t)
|
|
3145
3330
|
if (B(l)) {
|
|
3146
3331
|
const s = (o = (e = await this.getColumnSpecById(l)) == null ? void 0 : e.axesSpec) != null ? o : [];
|
|
3147
|
-
n.push(...s.map((
|
|
3332
|
+
n.push(...s.map((r) => _.fromAxisSpec(r).toPFrameId()));
|
|
3148
3333
|
}
|
|
3149
3334
|
return n;
|
|
3150
3335
|
}
|
|
@@ -3162,17 +3347,17 @@ var et = class {
|
|
|
3162
3347
|
compatibleWith: await this.getRequestColumnsFromSelectedSources(t),
|
|
3163
3348
|
strictlyCompatible: e
|
|
3164
3349
|
// should be true if we want to get meta and false if X/Y
|
|
3165
|
-
},
|
|
3166
|
-
return
|
|
3167
|
-
|
|
3168
|
-
}),
|
|
3350
|
+
}, r = Date.now(), c = await this.pframeDriver.findColumns(this.pframeHandle, s), i = [];
|
|
3351
|
+
return c.hits.forEach((p) => {
|
|
3352
|
+
i.push(p);
|
|
3353
|
+
}), i;
|
|
3169
3354
|
} catch (s) {
|
|
3170
3355
|
throw console.error("PFrame: findColumns error"), s;
|
|
3171
3356
|
}
|
|
3172
3357
|
}
|
|
3173
3358
|
async getColumns(t, e, o, n, l) {
|
|
3174
3359
|
return (await this.getColumnsFull(t, e, o, n, l)).map(
|
|
3175
|
-
(s) => new
|
|
3360
|
+
(s) => new W({
|
|
3176
3361
|
name: s.columnId,
|
|
3177
3362
|
type: s.spec.valueType
|
|
3178
3363
|
})
|
|
@@ -3189,56 +3374,56 @@ var et = class {
|
|
|
3189
3374
|
},
|
|
3190
3375
|
compatibleWith: [],
|
|
3191
3376
|
strictlyCompatible: !1
|
|
3192
|
-
}, s = Date.now(),
|
|
3193
|
-
return
|
|
3194
|
-
|
|
3195
|
-
}),
|
|
3377
|
+
}, s = Date.now(), r = await this.pframeDriver.findColumns(this.pframeHandle, l), c = [];
|
|
3378
|
+
return r.hits.forEach(({ columnId: i, spec: p }) => {
|
|
3379
|
+
c.push(new W({ name: i, type: p.valueType }));
|
|
3380
|
+
}), c.length > 1 && console.warn(`More than 1 column found for ${t}}`), c.length === 0 ? (console.warn(`No columns found for ${t}}`), null) : c[0];
|
|
3196
3381
|
} catch (l) {
|
|
3197
3382
|
throw console.error("PFrame: findColumns error"), l;
|
|
3198
3383
|
}
|
|
3199
3384
|
}
|
|
3200
|
-
},
|
|
3385
|
+
}, ft = class {
|
|
3201
3386
|
constructor(t, e, o = (n, l) => l ?? n) {
|
|
3202
|
-
this.labelsModifier = o, this.pFrameProvider = new
|
|
3387
|
+
this.labelsModifier = o, this.pFrameProvider = new pt(t, e);
|
|
3203
3388
|
}
|
|
3204
|
-
},
|
|
3389
|
+
}, Pe = {
|
|
3205
3390
|
controllers: {
|
|
3206
|
-
discrete: new
|
|
3207
|
-
scatterplot: new
|
|
3208
|
-
"scatterplot-umap": new
|
|
3209
|
-
heatmap: new
|
|
3210
|
-
dendro: new
|
|
3211
|
-
histogram: new
|
|
3212
|
-
bubble: new
|
|
3391
|
+
discrete: new nt(),
|
|
3392
|
+
scatterplot: new at(),
|
|
3393
|
+
"scatterplot-umap": new ct(),
|
|
3394
|
+
heatmap: new st(),
|
|
3395
|
+
dendro: new ut(),
|
|
3396
|
+
histogram: new et(),
|
|
3397
|
+
bubble: new Qe()
|
|
3213
3398
|
},
|
|
3214
3399
|
initialStates: {
|
|
3215
|
-
discrete:
|
|
3216
|
-
scatterplot:
|
|
3217
|
-
"scatterplot-umap":
|
|
3218
|
-
heatmap:
|
|
3219
|
-
dendro:
|
|
3220
|
-
histogram:
|
|
3221
|
-
bubble:
|
|
3400
|
+
discrete: tt,
|
|
3401
|
+
scatterplot: lt,
|
|
3402
|
+
"scatterplot-umap": rt,
|
|
3403
|
+
heatmap: ot,
|
|
3404
|
+
dendro: it,
|
|
3405
|
+
histogram: Ze,
|
|
3406
|
+
bubble: $e
|
|
3222
3407
|
}
|
|
3223
3408
|
};
|
|
3224
|
-
function
|
|
3225
|
-
return
|
|
3409
|
+
function gt(t) {
|
|
3410
|
+
return Pe.controllers[t];
|
|
3226
3411
|
}
|
|
3227
|
-
function
|
|
3228
|
-
return
|
|
3412
|
+
function ht(t) {
|
|
3413
|
+
return Pe.initialStates[t];
|
|
3229
3414
|
}
|
|
3230
3415
|
export {
|
|
3231
3416
|
_ as AxisId,
|
|
3232
|
-
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3417
|
+
Qe as BubbleStateController,
|
|
3418
|
+
W as ColumnId,
|
|
3419
|
+
ft as DemoDataStore,
|
|
3420
|
+
ut as DendroStateController,
|
|
3421
|
+
nt as DiscreteStateController,
|
|
3422
|
+
st as HeatmapStateController,
|
|
3423
|
+
at as ScatterplotStateController,
|
|
3424
|
+
A as columnOrAxisIdFromString,
|
|
3425
|
+
gt as getControllerByType,
|
|
3426
|
+
ht as getInitialStateByType,
|
|
3242
3427
|
B as isColumnId
|
|
3243
3428
|
};
|
|
3244
3429
|
//# sourceMappingURL=index.js.map
|