@platforma-sdk/model 1.27.17 → 1.28.1
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/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +826 -683
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +14 -29
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/util/column_collection.d.ts +54 -0
- package/dist/render/util/column_collection.d.ts.map +1 -0
- package/dist/render/util/index.d.ts +1 -0
- package/dist/render/util/index.d.ts.map +1 -1
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +11 -2
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/split_selectors.d.ts +26 -0
- package/dist/render/util/split_selectors.d.ts.map +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/render/api.ts +77 -292
- package/src/render/util/column_collection.ts +421 -0
- package/src/render/util/index.ts +1 -0
- package/src/render/util/label.test.ts +22 -0
- package/src/render/util/label.ts +21 -9
- package/src/render/util/pcolumn_data.ts +62 -4
- package/src/render/util/split_selectors.ts +29 -0
- package/dist/render/split_selectors.d.ts +0 -14
- package/dist/render/split_selectors.d.ts.map +0 -1
- package/src/render/split_selectors.ts +0 -15
package/dist/index.mjs
CHANGED
|
@@ -1,66 +1,67 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { isPColumn as
|
|
1
|
+
var je = Object.defineProperty;
|
|
2
|
+
var Ke = (t, e, n) => e in t ? je(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var L = (t, e, n) => Ke(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { isPColumn as ie, mapPObjectData as ge, isDataInfoEntries as xe, isDataInfo as me, dataInfoToEntries as Ve, resolveAnchors as $e, isPColumnSpec as Q, isPartitionedDataInfoEntries as Je, getAxisId as E, entriesToDataInfo as Ne, selectorsToPredicate as ce, canonicalizeAxisId as Ue, AnchoredIdDeriver as ye, isPlRef as Be, mapValueInVOE as Me, ensurePColumn as Ge, extractAllColumns as We, mapPTableDef as He, mapDataInfo as qe, matchAxisId as G } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
|
-
import { z as
|
|
6
|
+
import { z as K } from "zod";
|
|
7
|
+
import Pe from "canonicalize";
|
|
7
8
|
export * from "@milaboratories/pl-error-like";
|
|
8
|
-
class
|
|
9
|
+
class ze extends Error {
|
|
9
10
|
constructor(e, n) {
|
|
10
11
|
super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0].message), this.errors = e, this.moreErrors = n;
|
|
11
12
|
}
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!t.ok) throw new
|
|
14
|
+
function Ye(t) {
|
|
15
|
+
if (!t.ok) throw new ze(t.errors, t.moreErrors);
|
|
15
16
|
return t.value;
|
|
16
17
|
}
|
|
17
|
-
function
|
|
18
|
+
function Rt(t) {
|
|
18
19
|
return new Proxy(t, {
|
|
19
20
|
get(e, n) {
|
|
20
|
-
return
|
|
21
|
+
return Ye(e[n]);
|
|
21
22
|
}
|
|
22
23
|
});
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
-
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ?
|
|
25
|
+
function x(t) {
|
|
26
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? Z(t) : t;
|
|
26
27
|
}
|
|
27
28
|
function W(t) {
|
|
28
29
|
return { type: "GetFromCtx", variable: t };
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
+
function Ot(t) {
|
|
31
32
|
return {
|
|
32
33
|
type: "Isolate",
|
|
33
34
|
cfg: t
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
const
|
|
37
|
-
function
|
|
37
|
+
const jt = W("$args"), Kt = W("$it"), Vt = W("$prod"), $t = W("$staging"), Jt = W("$ui");
|
|
38
|
+
function Z(t) {
|
|
38
39
|
return { type: "Immediate", value: t };
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function Ce(t) {
|
|
41
42
|
const e = {};
|
|
42
|
-
for (const [n, r] of Object.entries(t)) e[n] =
|
|
43
|
+
for (const [n, r] of Object.entries(t)) e[n] = x(r);
|
|
43
44
|
return {
|
|
44
45
|
type: "MakeObject",
|
|
45
46
|
template: e
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function Nt(...t) {
|
|
49
50
|
const e = [];
|
|
50
|
-
for (const n of t) e.push(
|
|
51
|
+
for (const n of t) e.push(x(n));
|
|
51
52
|
return {
|
|
52
53
|
type: "MakeArray",
|
|
53
54
|
template: e
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function ee(t, e) {
|
|
57
58
|
return {
|
|
58
59
|
type: "GetJsonField",
|
|
59
|
-
source:
|
|
60
|
-
field:
|
|
60
|
+
source: x(t),
|
|
61
|
+
field: x(e)
|
|
61
62
|
};
|
|
62
63
|
}
|
|
63
|
-
function
|
|
64
|
+
function Ut(t, e, n = "$it") {
|
|
64
65
|
return {
|
|
65
66
|
type: "MapRecordValues",
|
|
66
67
|
source: t,
|
|
@@ -68,7 +69,7 @@ function At(t, e, n = "$it") {
|
|
|
68
69
|
itVar: n
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function Bt(t, e, n = "$it") {
|
|
72
73
|
return {
|
|
73
74
|
type: "MapArrayValues",
|
|
74
75
|
source: t,
|
|
@@ -76,54 +77,54 @@ function St(t, e, n = "$it") {
|
|
|
76
77
|
itVar: n
|
|
77
78
|
};
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function Mt(t) {
|
|
80
81
|
return {
|
|
81
82
|
type: "Flatten",
|
|
82
83
|
source: t
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function Gt(t) {
|
|
86
87
|
return {
|
|
87
88
|
type: "IsEmpty",
|
|
88
89
|
arg: t
|
|
89
90
|
};
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
+
function Wt(t) {
|
|
92
93
|
return {
|
|
93
94
|
type: "Not",
|
|
94
95
|
operand: t
|
|
95
96
|
};
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function Ht(t, e) {
|
|
98
99
|
return {
|
|
99
100
|
type: "And",
|
|
100
101
|
operand1: t,
|
|
101
102
|
operand2: e
|
|
102
103
|
};
|
|
103
104
|
}
|
|
104
|
-
function
|
|
105
|
+
function qt(t, e) {
|
|
105
106
|
return {
|
|
106
107
|
type: "Or",
|
|
107
108
|
operand1: t,
|
|
108
109
|
operand2: e
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function zt(t, e) {
|
|
112
113
|
return {
|
|
113
114
|
type: "GetResourceField",
|
|
114
|
-
source:
|
|
115
|
-
field:
|
|
115
|
+
source: x(t),
|
|
116
|
+
field: x(e)
|
|
116
117
|
};
|
|
117
118
|
}
|
|
118
|
-
function
|
|
119
|
+
function Yt() {
|
|
119
120
|
return function(t) {
|
|
120
121
|
return {
|
|
121
122
|
type: "GetResourceValueAsJson",
|
|
122
|
-
source:
|
|
123
|
+
source: x(t)
|
|
123
124
|
};
|
|
124
125
|
};
|
|
125
126
|
}
|
|
126
|
-
function
|
|
127
|
+
function Xt(t, e, n = "$it") {
|
|
127
128
|
return {
|
|
128
129
|
type: "MapResourceFields",
|
|
129
130
|
source: t,
|
|
@@ -131,120 +132,120 @@ function Rt(t, e, n = "$it") {
|
|
|
131
132
|
itVar: n
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function Qt(t) {
|
|
135
136
|
return {
|
|
136
137
|
type: "GetBlobContent",
|
|
137
|
-
source:
|
|
138
|
+
source: x(t)
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
+
function Zt(t) {
|
|
141
142
|
return {
|
|
142
143
|
type: "GetBlobContentAsString",
|
|
143
|
-
source:
|
|
144
|
+
source: x(t)
|
|
144
145
|
};
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
+
function en() {
|
|
147
148
|
return function(t) {
|
|
148
149
|
return {
|
|
149
150
|
type: "GetBlobContentAsJson",
|
|
150
|
-
source:
|
|
151
|
+
source: x(t)
|
|
151
152
|
};
|
|
152
153
|
};
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
+
function tn(t) {
|
|
155
156
|
return {
|
|
156
157
|
type: "GetDownloadedBlobContent",
|
|
157
|
-
source:
|
|
158
|
+
source: x(t)
|
|
158
159
|
};
|
|
159
160
|
}
|
|
160
|
-
function
|
|
161
|
+
function nn(t) {
|
|
161
162
|
return {
|
|
162
163
|
type: "GetOnDemandBlobContent",
|
|
163
|
-
source:
|
|
164
|
+
source: x(t)
|
|
164
165
|
};
|
|
165
166
|
}
|
|
166
|
-
function
|
|
167
|
+
function rn(t, e) {
|
|
167
168
|
return {
|
|
168
169
|
type: "ExtractArchiveAndGetURL",
|
|
169
170
|
format: e,
|
|
170
|
-
source:
|
|
171
|
+
source: x(t)
|
|
171
172
|
};
|
|
172
173
|
}
|
|
173
|
-
function
|
|
174
|
+
function sn(t) {
|
|
174
175
|
return {
|
|
175
176
|
type: "GetImportProgress",
|
|
176
|
-
source:
|
|
177
|
+
source: x(t)
|
|
177
178
|
};
|
|
178
179
|
}
|
|
179
|
-
function
|
|
180
|
+
function on(t, e) {
|
|
180
181
|
return {
|
|
181
182
|
type: "GetLastLogs",
|
|
182
|
-
source:
|
|
183
|
+
source: x(t),
|
|
183
184
|
lines: e
|
|
184
185
|
};
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
+
function an(t, e) {
|
|
187
188
|
return {
|
|
188
189
|
type: "GetProgressLog",
|
|
189
|
-
source:
|
|
190
|
+
source: x(t),
|
|
190
191
|
patternToSearch: e
|
|
191
192
|
};
|
|
192
193
|
}
|
|
193
|
-
function
|
|
194
|
+
function ln(t, e) {
|
|
194
195
|
return {
|
|
195
196
|
type: "GetProgressLogWithInfo",
|
|
196
|
-
source:
|
|
197
|
+
source: x(t),
|
|
197
198
|
patternToSearch: e
|
|
198
199
|
};
|
|
199
200
|
}
|
|
200
|
-
function
|
|
201
|
+
function un(t) {
|
|
201
202
|
return {
|
|
202
203
|
type: "GetLogHandle",
|
|
203
|
-
source:
|
|
204
|
+
source: x(t)
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
function
|
|
207
|
+
function Xe() {
|
|
207
208
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
208
209
|
}
|
|
209
|
-
function
|
|
210
|
+
function _e(t) {
|
|
210
211
|
if (t && typeof globalThis.getPlatforma == "function")
|
|
211
212
|
return globalThis.getPlatforma(t);
|
|
212
213
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
213
214
|
throw new Error("Can't get platforma instance.");
|
|
214
215
|
}
|
|
215
|
-
function
|
|
216
|
+
function Qe() {
|
|
216
217
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
217
218
|
}
|
|
218
|
-
function
|
|
219
|
+
function m() {
|
|
219
220
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
220
221
|
throw new Error("Not in config rendering context");
|
|
221
222
|
}
|
|
222
|
-
function
|
|
223
|
-
const n =
|
|
223
|
+
function Y(t, e) {
|
|
224
|
+
const n = Qe();
|
|
224
225
|
if (n === void 0) return !1;
|
|
225
226
|
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
226
227
|
return n.callbackRegistry[t] = e, !0;
|
|
227
228
|
}
|
|
228
|
-
const
|
|
229
|
-
function
|
|
230
|
-
t in
|
|
231
|
-
for (const r of
|
|
229
|
+
const ae = /* @__PURE__ */ new Map();
|
|
230
|
+
function Ze(t, e) {
|
|
231
|
+
t in m().callbackRegistry || (m().callbackRegistry[t] = (n) => {
|
|
232
|
+
for (const r of ae.get(t))
|
|
232
233
|
r(n);
|
|
233
|
-
},
|
|
234
|
+
}, ae.set(t, [])), ae.get(t).push(e);
|
|
234
235
|
}
|
|
235
|
-
class
|
|
236
|
+
class C {
|
|
236
237
|
constructor(e, n = (r) => r) {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
this.handle = e, this.postProcess = n,
|
|
238
|
+
L(this, "isResolved", !1);
|
|
239
|
+
L(this, "resolvedValue");
|
|
240
|
+
this.handle = e, this.postProcess = n, Ze(e, (r) => {
|
|
240
241
|
this.resolvedValue = n(r), this.isResolved = !0;
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
map(e) {
|
|
244
|
-
return new
|
|
245
|
+
return new C(this.handle, (n) => e(this.postProcess(n)));
|
|
245
246
|
}
|
|
246
247
|
mapDefined(e) {
|
|
247
|
-
return new
|
|
248
|
+
return new C(this.handle, (n) => {
|
|
248
249
|
const r = this.postProcess(n);
|
|
249
250
|
return r ? e(r) : void 0;
|
|
250
251
|
});
|
|
@@ -253,10 +254,10 @@ class S {
|
|
|
253
254
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
|
-
function
|
|
257
|
+
function pe(t, e) {
|
|
257
258
|
return t === void 0 ? void 0 : e(t);
|
|
258
259
|
}
|
|
259
|
-
class
|
|
260
|
+
class _ {
|
|
260
261
|
constructor(e, n) {
|
|
261
262
|
this.handle = e, this.resolvePath = n;
|
|
262
263
|
}
|
|
@@ -295,47 +296,47 @@ class I {
|
|
|
295
296
|
...this.resolvePath,
|
|
296
297
|
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
297
298
|
];
|
|
298
|
-
return
|
|
299
|
-
|
|
300
|
-
(i) => new
|
|
299
|
+
return pe(
|
|
300
|
+
m().resolveWithCommon(this.handle, e, ...n),
|
|
301
|
+
(i) => new _(i, r)
|
|
301
302
|
);
|
|
302
303
|
}
|
|
303
304
|
get resourceType() {
|
|
304
|
-
return
|
|
305
|
+
return m().getResourceType(this.handle);
|
|
305
306
|
}
|
|
306
307
|
getInputsLocked() {
|
|
307
|
-
return
|
|
308
|
+
return m().getInputsLocked(this.handle);
|
|
308
309
|
}
|
|
309
310
|
getOutputsLocked() {
|
|
310
|
-
return
|
|
311
|
+
return m().getOutputsLocked(this.handle);
|
|
311
312
|
}
|
|
312
313
|
getIsReadyOrError() {
|
|
313
|
-
return
|
|
314
|
+
return m().getIsReadyOrError(this.handle);
|
|
314
315
|
}
|
|
315
316
|
getIsFinal() {
|
|
316
|
-
return
|
|
317
|
+
return m().getIsFinal(this.handle);
|
|
317
318
|
}
|
|
318
319
|
getError() {
|
|
319
320
|
const e = [...this.resolvePath, "error"];
|
|
320
|
-
return
|
|
321
|
-
|
|
322
|
-
(n) => new
|
|
321
|
+
return pe(
|
|
322
|
+
m().getError(this.handle),
|
|
323
|
+
(n) => new _(n, e)
|
|
323
324
|
);
|
|
324
325
|
}
|
|
325
326
|
listInputFields() {
|
|
326
|
-
return
|
|
327
|
+
return m().listInputFields(this.handle);
|
|
327
328
|
}
|
|
328
329
|
listOutputFields() {
|
|
329
|
-
return
|
|
330
|
+
return m().listOutputFields(this.handle);
|
|
330
331
|
}
|
|
331
332
|
listDynamicFields() {
|
|
332
|
-
return
|
|
333
|
+
return m().listDynamicFields(this.handle);
|
|
333
334
|
}
|
|
334
335
|
getKeyValueBase64(e) {
|
|
335
|
-
return
|
|
336
|
+
return m().getKeyValueBase64(this.handle, e);
|
|
336
337
|
}
|
|
337
338
|
getKeyValueAsString(e) {
|
|
338
|
-
return
|
|
339
|
+
return m().getKeyValueAsString(this.handle, e);
|
|
339
340
|
}
|
|
340
341
|
getKeyValueAsJson(e) {
|
|
341
342
|
const n = this.getKeyValueAsString(e);
|
|
@@ -343,10 +344,10 @@ class I {
|
|
|
343
344
|
return JSON.parse(n);
|
|
344
345
|
}
|
|
345
346
|
getDataBase64() {
|
|
346
|
-
return
|
|
347
|
+
return m().getDataBase64(this.handle);
|
|
347
348
|
}
|
|
348
349
|
getDataAsString() {
|
|
349
|
-
return
|
|
350
|
+
return m().getDataAsString(this.handle);
|
|
350
351
|
}
|
|
351
352
|
getDataAsJson() {
|
|
352
353
|
const e = this.getDataAsString();
|
|
@@ -359,7 +360,7 @@ class I {
|
|
|
359
360
|
getPColumns(e = !1, n = "") {
|
|
360
361
|
const r = this.parsePObjectCollection(e, n);
|
|
361
362
|
return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
|
|
362
|
-
if (!
|
|
363
|
+
if (!ie(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
363
364
|
return s;
|
|
364
365
|
});
|
|
365
366
|
}
|
|
@@ -367,7 +368,7 @@ class I {
|
|
|
367
368
|
*
|
|
368
369
|
*/
|
|
369
370
|
parsePObjectCollection(e = !1, n = "") {
|
|
370
|
-
const r =
|
|
371
|
+
const r = m().parsePObjectCollection(
|
|
371
372
|
this.handle,
|
|
372
373
|
e,
|
|
373
374
|
n,
|
|
@@ -377,19 +378,19 @@ class I {
|
|
|
377
378
|
const i = {};
|
|
378
379
|
for (const [s, o] of Object.entries(r)) {
|
|
379
380
|
const a = [...this.resolvePath, s];
|
|
380
|
-
i[s] =
|
|
381
|
+
i[s] = ge(o, (l) => new _(l, a));
|
|
381
382
|
}
|
|
382
383
|
return i;
|
|
383
384
|
}
|
|
384
385
|
getFileContentAsBase64() {
|
|
385
|
-
return new
|
|
386
|
+
return new C(m().getBlobContentAsBase64(this.handle));
|
|
386
387
|
}
|
|
387
388
|
getFileContentAsString() {
|
|
388
|
-
return new
|
|
389
|
+
return new C(m().getBlobContentAsString(this.handle));
|
|
389
390
|
}
|
|
390
391
|
getFileContentAsJson() {
|
|
391
|
-
return new
|
|
392
|
-
|
|
392
|
+
return new C(
|
|
393
|
+
m().getBlobContentAsString(this.handle)
|
|
393
394
|
).mapDefined((e) => JSON.parse(e));
|
|
394
395
|
}
|
|
395
396
|
/**
|
|
@@ -408,7 +409,7 @@ class I {
|
|
|
408
409
|
* @returns downloaded file handle
|
|
409
410
|
*/
|
|
410
411
|
getFileHandle() {
|
|
411
|
-
return new
|
|
412
|
+
return new C(m().getDownloadedBlobContentHandle(this.handle));
|
|
412
413
|
}
|
|
413
414
|
/**
|
|
414
415
|
* @deprecated use getFileHandle
|
|
@@ -420,7 +421,7 @@ class I {
|
|
|
420
421
|
* @returns downloaded file handle
|
|
421
422
|
*/
|
|
422
423
|
getRemoteFileHandle() {
|
|
423
|
-
return new
|
|
424
|
+
return new C(m().getOnDemandBlobContentHandle(this.handle));
|
|
424
425
|
}
|
|
425
426
|
/**
|
|
426
427
|
* @deprecated use getRemoteFileHandle
|
|
@@ -432,22 +433,22 @@ class I {
|
|
|
432
433
|
* @returns the url to the extracted folder
|
|
433
434
|
*/
|
|
434
435
|
extractArchiveAndGetURL(e) {
|
|
435
|
-
return new
|
|
436
|
+
return new C(m().extractArchiveAndGetURL(this.handle, e));
|
|
436
437
|
}
|
|
437
438
|
getImportProgress() {
|
|
438
|
-
return new
|
|
439
|
+
return new C(m().getImportProgress(this.handle));
|
|
439
440
|
}
|
|
440
441
|
getLastLogs(e) {
|
|
441
|
-
return new
|
|
442
|
+
return new C(m().getLastLogs(this.handle, e));
|
|
442
443
|
}
|
|
443
444
|
getProgressLog(e) {
|
|
444
|
-
return new
|
|
445
|
+
return new C(m().getProgressLog(this.handle, e));
|
|
445
446
|
}
|
|
446
447
|
getProgressLogWithInfo(e) {
|
|
447
|
-
return new
|
|
448
|
+
return new C(m().getProgressLogWithInfo(this.handle, e));
|
|
448
449
|
}
|
|
449
450
|
getLogHandle() {
|
|
450
|
-
return new
|
|
451
|
+
return new C(m().getLogHandle(this.handle));
|
|
451
452
|
}
|
|
452
453
|
allFieldsResolved(e = "Input") {
|
|
453
454
|
switch (e) {
|
|
@@ -470,195 +471,147 @@ class I {
|
|
|
470
471
|
}, o = e;
|
|
471
472
|
if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
472
473
|
return;
|
|
473
|
-
let
|
|
474
|
-
(
|
|
474
|
+
let l = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
475
|
+
(u) => [u, this.resolve({ field: u, assertFieldType: r })]
|
|
475
476
|
);
|
|
476
|
-
return s && (
|
|
477
|
+
return s && (l = l.filter((u) => u[1] !== void 0)), l.map(([u, S]) => o(u, S));
|
|
477
478
|
}
|
|
478
479
|
}
|
|
479
|
-
const
|
|
480
|
+
const Ie = "staging", Le = "main", et = {
|
|
480
481
|
explicitColumnsSupport: !0,
|
|
481
482
|
inlineColumnsSupport: !0,
|
|
482
483
|
activeArgs: !0
|
|
483
484
|
};
|
|
484
|
-
function
|
|
485
|
+
function Te(t) {
|
|
485
486
|
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
486
487
|
}
|
|
487
|
-
function
|
|
488
|
+
function de(t, e, n) {
|
|
488
489
|
if (e.has(n)) return;
|
|
489
490
|
if (e.add(n), typeof n === "object")
|
|
490
|
-
if (
|
|
491
|
+
if (Te(n)) n.__awaited_futures__.forEach((i) => t.add(i));
|
|
491
492
|
else if (Array.isArray(n))
|
|
492
|
-
for (const i of n)
|
|
493
|
+
for (const i of n) de(t, e, i);
|
|
493
494
|
else
|
|
494
495
|
for (const [, i] of Object.entries(n))
|
|
495
|
-
i !== n &&
|
|
496
|
+
i !== n && de(t, e, i);
|
|
496
497
|
}
|
|
497
|
-
function
|
|
498
|
+
function tt(t) {
|
|
498
499
|
const e = /* @__PURE__ */ new Set();
|
|
499
|
-
return
|
|
500
|
+
return de(e, /* @__PURE__ */ new Set(), t), e;
|
|
500
501
|
}
|
|
501
|
-
const
|
|
502
|
+
const cn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
502
503
|
__proto__: null,
|
|
503
|
-
GlobalCfgRenderCtxFeatureFlags:
|
|
504
|
-
MainAccessorName:
|
|
505
|
-
StagingAccessorName:
|
|
506
|
-
getAllFutureAwaits:
|
|
507
|
-
isFutureAwait:
|
|
508
|
-
}, Symbol.toStringTag, { value: "Module" }))
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
const
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
if (s[o] !== a)
|
|
525
|
-
return !1;
|
|
526
|
-
return !0;
|
|
527
|
-
}, i = (s) => {
|
|
528
|
-
const o = [...s];
|
|
529
|
-
for (const [a] of n)
|
|
530
|
-
o.splice(a, 1);
|
|
531
|
-
return o;
|
|
532
|
-
};
|
|
533
|
-
switch (t.type) {
|
|
534
|
-
case "Json": {
|
|
535
|
-
const s = t.data.filter((o) => r(o.key)).map((o) => ({
|
|
536
|
-
key: i(o.key),
|
|
537
|
-
value: o.value
|
|
538
|
-
}));
|
|
539
|
-
return {
|
|
540
|
-
type: "Json",
|
|
541
|
-
keyLength: t.keyLength - e.length,
|
|
542
|
-
data: s
|
|
543
|
-
};
|
|
544
|
-
}
|
|
545
|
-
case "JsonPartitioned": {
|
|
546
|
-
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
547
|
-
key: i(o.key),
|
|
548
|
-
value: o.value
|
|
549
|
-
}));
|
|
550
|
-
return {
|
|
551
|
-
type: "JsonPartitioned",
|
|
552
|
-
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
553
|
-
parts: s
|
|
554
|
-
};
|
|
555
|
-
}
|
|
556
|
-
case "BinaryPartitioned": {
|
|
557
|
-
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
558
|
-
key: i(o.key),
|
|
559
|
-
value: o.value
|
|
560
|
-
}));
|
|
561
|
-
return {
|
|
562
|
-
type: "BinaryPartitioned",
|
|
563
|
-
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
564
|
-
parts: s
|
|
565
|
-
};
|
|
566
|
-
}
|
|
567
|
-
}
|
|
568
|
-
}
|
|
569
|
-
const Me = "pl7.app/label", Ge = "pl7.app/trace", We = O.object({
|
|
570
|
-
type: O.string(),
|
|
571
|
-
importance: O.number().optional(),
|
|
572
|
-
id: O.string().optional(),
|
|
573
|
-
label: O.string()
|
|
574
|
-
}), He = O.array(We), qe = 1e-3, ze = "__LABEL__", pe = "__LABEL__@1";
|
|
575
|
-
function de(t, e, n = {}) {
|
|
576
|
-
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((f) => {
|
|
577
|
-
var R, k;
|
|
578
|
-
const p = e(f);
|
|
579
|
-
let d, y, g;
|
|
580
|
-
"spec" in p && typeof p.spec == "object" ? (d = p.spec, y = p.prefixTrace, g = p.suffixTrace) : d = p;
|
|
581
|
-
const v = (R = d.annotations) == null ? void 0 : R[Me], w = (k = d.annotations) == null ? void 0 : k[Ge], x = (w ? He.safeParse(JSON.parse(w)).data : void 0) ?? [], C = [
|
|
582
|
-
...y ?? [],
|
|
583
|
-
...x,
|
|
584
|
-
...g ?? []
|
|
504
|
+
GlobalCfgRenderCtxFeatureFlags: et,
|
|
505
|
+
MainAccessorName: Le,
|
|
506
|
+
StagingAccessorName: Ie,
|
|
507
|
+
getAllFutureAwaits: tt,
|
|
508
|
+
isFutureAwait: Te
|
|
509
|
+
}, Symbol.toStringTag, { value: "Module" })), nt = "pl7.app/label", rt = "pl7.app/trace", it = K.object({
|
|
510
|
+
type: K.string(),
|
|
511
|
+
importance: K.number().optional(),
|
|
512
|
+
id: K.string().optional(),
|
|
513
|
+
label: K.string()
|
|
514
|
+
}), st = K.array(it), ot = 1e-3, at = "__LABEL__", ve = "__LABEL__@1";
|
|
515
|
+
function Ee(t, e, n = {}) {
|
|
516
|
+
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((p) => {
|
|
517
|
+
var q, D;
|
|
518
|
+
const c = e(p);
|
|
519
|
+
let h, A, y;
|
|
520
|
+
"spec" in c && typeof c.spec == "object" ? (h = c.spec, A = c.prefixTrace, y = c.suffixTrace) : h = c;
|
|
521
|
+
const v = (q = h.annotations) == null ? void 0 : q[nt], g = (D = h.annotations) == null ? void 0 : D[rt], P = (g ? st.safeParse(JSON.parse(g)).data : void 0) ?? [], b = [
|
|
522
|
+
...A ?? [],
|
|
523
|
+
...P,
|
|
524
|
+
...y ?? []
|
|
585
525
|
];
|
|
586
526
|
if (v) {
|
|
587
|
-
const
|
|
588
|
-
n.addLabelAsSuffix ?
|
|
527
|
+
const I = { label: v, type: at, importance: -2 };
|
|
528
|
+
n.addLabelAsSuffix ? b.push(I) : b.splice(0, 0, I);
|
|
589
529
|
}
|
|
590
|
-
const
|
|
591
|
-
for (let
|
|
592
|
-
const { type:
|
|
593
|
-
|
|
594
|
-
const
|
|
595
|
-
i.set(
|
|
596
|
-
|
|
530
|
+
const F = [], $ = /* @__PURE__ */ new Map();
|
|
531
|
+
for (let I = b.length - 1; I >= 0; --I) {
|
|
532
|
+
const { type: R } = b[I], se = b[I].importance ?? 0, J = ($.get(R) ?? 0) + 1;
|
|
533
|
+
$.set(R, J);
|
|
534
|
+
const w = `${R}@${J}`;
|
|
535
|
+
i.set(w, (i.get(w) ?? 0) + 1), r.set(
|
|
536
|
+
w,
|
|
597
537
|
Math.max(
|
|
598
|
-
r.get(
|
|
599
|
-
|
|
538
|
+
r.get(w) ?? Number.NEGATIVE_INFINITY,
|
|
539
|
+
se - (b.length - I) * ot
|
|
600
540
|
)
|
|
601
|
-
),
|
|
541
|
+
), F.push({ ...b[I], fullType: w, occurenceIndex: J });
|
|
602
542
|
}
|
|
603
|
-
return
|
|
604
|
-
value:
|
|
605
|
-
spec:
|
|
543
|
+
return F.reverse(), {
|
|
544
|
+
value: p,
|
|
545
|
+
spec: h,
|
|
606
546
|
label: v,
|
|
607
|
-
fullTrace:
|
|
547
|
+
fullTrace: F
|
|
608
548
|
};
|
|
609
|
-
}), o = [], a = [],
|
|
610
|
-
|
|
611
|
-
for (const [
|
|
612
|
-
|
|
613
|
-
const
|
|
614
|
-
const
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
549
|
+
}), o = [], a = [], l = [...r];
|
|
550
|
+
l.sort(([, p], [, c]) => c - p);
|
|
551
|
+
for (const [p] of l)
|
|
552
|
+
p.endsWith("@1") || i.get(p) === t.length ? o.push(p) : a.push(p);
|
|
553
|
+
const u = (p) => {
|
|
554
|
+
const c = [];
|
|
555
|
+
for (let h = 0; h < s.length; h++) {
|
|
556
|
+
const A = s[h], y = A.fullTrace.filter((P) => p.has(P.fullType));
|
|
557
|
+
if (y.length === 0)
|
|
558
|
+
return;
|
|
559
|
+
const v = y.map((P) => P.label), g = n.separator ?? " / ";
|
|
560
|
+
c.push({
|
|
561
|
+
label: v.join(g),
|
|
562
|
+
value: A.value
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
return c;
|
|
566
|
+
};
|
|
620
567
|
if (o.length === 0) {
|
|
621
568
|
if (a.length !== 0) throw new Error("Assertion error.");
|
|
622
|
-
|
|
569
|
+
const p = u(new Set(ve));
|
|
570
|
+
if (p === void 0) throw new Error("Assertion error.");
|
|
571
|
+
return p;
|
|
623
572
|
}
|
|
624
|
-
let
|
|
625
|
-
for (;
|
|
626
|
-
const
|
|
627
|
-
n.includeNativeLabel &&
|
|
628
|
-
for (let
|
|
629
|
-
|
|
630
|
-
const
|
|
631
|
-
if (
|
|
632
|
-
|
|
573
|
+
let S = 0, d = 0;
|
|
574
|
+
for (; S < o.length; ) {
|
|
575
|
+
const p = /* @__PURE__ */ new Set();
|
|
576
|
+
n.includeNativeLabel && p.add(ve);
|
|
577
|
+
for (let h = 0; h < S; ++h) p.add(o[h]);
|
|
578
|
+
p.add(o[d]);
|
|
579
|
+
const c = u(p);
|
|
580
|
+
if (c !== void 0) {
|
|
581
|
+
if (new Set(c.map((h) => h.label)).size === t.length) return c;
|
|
582
|
+
d++, d == o.length && (S++, d = S);
|
|
583
|
+
}
|
|
633
584
|
}
|
|
634
|
-
|
|
585
|
+
const f = u(/* @__PURE__ */ new Set([...o, ...a]));
|
|
586
|
+
if (f === void 0) throw new Error("Assertion error.");
|
|
587
|
+
return f;
|
|
635
588
|
}
|
|
636
|
-
const H = "PColumnData/",
|
|
637
|
-
function
|
|
589
|
+
const H = "PColumnData/", te = H + "ResourceMap", ne = H + "Partitioned/ResourceMap", U = H + "JsonPartitioned", V = H + "BinaryPartitioned", Fe = H + "Partitioned/", re = Fe + "JsonPartitioned", B = Fe + "BinaryPartitioned";
|
|
590
|
+
function De(t, e, n, r = [], i) {
|
|
638
591
|
if (t === void 0) return !1;
|
|
639
592
|
switch (t.resourceType.name) {
|
|
640
|
-
case
|
|
593
|
+
case te: {
|
|
641
594
|
let s = t.getInputsLocked();
|
|
642
595
|
for (const o of t.listInputFields()) {
|
|
643
|
-
const a = t.resolve({ field: o, assertFieldType: "Input" }),
|
|
644
|
-
|
|
596
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" }), l = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
|
|
597
|
+
u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: l, value: u });
|
|
645
598
|
}
|
|
646
599
|
return s;
|
|
647
600
|
}
|
|
648
|
-
case
|
|
601
|
+
case ne: {
|
|
649
602
|
let s = t.getInputsLocked();
|
|
650
603
|
for (const o of t.listInputFields()) {
|
|
651
604
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
652
605
|
if (a === void 0) s = !1;
|
|
653
606
|
else {
|
|
654
|
-
const
|
|
607
|
+
const l = [...r, ...JSON.parse(o)], u = De(
|
|
655
608
|
a,
|
|
656
609
|
e,
|
|
657
610
|
n,
|
|
658
|
-
|
|
611
|
+
l,
|
|
659
612
|
i
|
|
660
613
|
);
|
|
661
|
-
s = s &&
|
|
614
|
+
s = s && u;
|
|
662
615
|
}
|
|
663
616
|
}
|
|
664
617
|
return s;
|
|
@@ -667,65 +620,87 @@ function Se(t, e, n, r = [], i) {
|
|
|
667
620
|
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
668
621
|
}
|
|
669
622
|
}
|
|
670
|
-
function
|
|
623
|
+
function pn(t, e, n = !1) {
|
|
671
624
|
const r = [];
|
|
672
|
-
return { isComplete:
|
|
625
|
+
return { isComplete: De(t, e, r, [], n), data: r };
|
|
673
626
|
}
|
|
674
|
-
const
|
|
627
|
+
const fe = (t) => {
|
|
675
628
|
if (t.endsWith(".index"))
|
|
676
629
|
return { baseKey: t.substring(0, t.length - 6), type: "index" };
|
|
677
630
|
if (t.endsWith(".values"))
|
|
678
631
|
return { baseKey: t.substring(0, t.length - 7), type: "values" };
|
|
679
632
|
throw new Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
680
633
|
};
|
|
681
|
-
function
|
|
634
|
+
function lt(t) {
|
|
682
635
|
if (!t) return;
|
|
683
636
|
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
684
637
|
let i = 0;
|
|
685
638
|
switch (e) {
|
|
686
|
-
case
|
|
639
|
+
case te:
|
|
687
640
|
i = n.keyLength;
|
|
688
641
|
break;
|
|
689
|
-
case
|
|
642
|
+
case ne:
|
|
690
643
|
i = n.partitionKeyLength + n.keyLength;
|
|
691
644
|
break;
|
|
692
|
-
case
|
|
693
|
-
case
|
|
645
|
+
case U:
|
|
646
|
+
case V:
|
|
694
647
|
i = n.partitionKeyLength;
|
|
695
648
|
break;
|
|
696
649
|
case B:
|
|
697
|
-
case
|
|
650
|
+
case re:
|
|
698
651
|
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
699
652
|
break;
|
|
700
653
|
}
|
|
701
654
|
switch (e) {
|
|
702
|
-
case
|
|
703
|
-
case
|
|
704
|
-
case
|
|
655
|
+
case te:
|
|
656
|
+
case U:
|
|
657
|
+
case V:
|
|
705
658
|
for (let s of t.listInputFields()) {
|
|
706
|
-
e ===
|
|
659
|
+
e === V && (s = fe(s).baseKey);
|
|
707
660
|
const o = [...JSON.parse(s)];
|
|
708
661
|
r.push(o);
|
|
709
662
|
}
|
|
710
663
|
break;
|
|
711
|
-
case
|
|
664
|
+
case ne:
|
|
712
665
|
case B:
|
|
713
|
-
case
|
|
666
|
+
case re:
|
|
714
667
|
for (const s of t.listInputFields()) {
|
|
715
668
|
const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
|
|
716
669
|
if (a !== void 0)
|
|
717
|
-
for (let
|
|
718
|
-
e === B && (
|
|
719
|
-
const
|
|
720
|
-
r.push(
|
|
670
|
+
for (let l of a.listInputFields()) {
|
|
671
|
+
e === B && (l = fe(l).baseKey);
|
|
672
|
+
const u = [...o, ...JSON.parse(l)];
|
|
673
|
+
r.push(u);
|
|
721
674
|
}
|
|
722
675
|
}
|
|
723
676
|
break;
|
|
724
677
|
}
|
|
725
678
|
return { data: r, keyLength: i };
|
|
726
679
|
}
|
|
727
|
-
function
|
|
728
|
-
|
|
680
|
+
function ut(t) {
|
|
681
|
+
if (t.type !== "JsonPartitioned" && t.type !== "BinaryPartitioned")
|
|
682
|
+
throw new Error(`Splitting requires Partitioned DataInfoEntries, got ${t.type}`);
|
|
683
|
+
const { parts: e, partitionKeyLength: n } = t, r = [];
|
|
684
|
+
for (let i = 0; i < n; ++i)
|
|
685
|
+
r.push(/* @__PURE__ */ new Set());
|
|
686
|
+
for (const i of e) {
|
|
687
|
+
const s = i.key;
|
|
688
|
+
if (s.length !== n)
|
|
689
|
+
throw new Error(
|
|
690
|
+
`Key length (${s.length}) does not match partition length (${n}) for key: ${JSON.stringify(
|
|
691
|
+
s
|
|
692
|
+
)}`
|
|
693
|
+
);
|
|
694
|
+
for (let o = 0; o < n; ++o)
|
|
695
|
+
r[o].add(s[o]);
|
|
696
|
+
}
|
|
697
|
+
return r.map((i) => Array.from(i.values()));
|
|
698
|
+
}
|
|
699
|
+
function ct(t) {
|
|
700
|
+
if (t === void 0) return;
|
|
701
|
+
if (xe(t))
|
|
702
|
+
return ut(t);
|
|
703
|
+
const e = lt(t);
|
|
729
704
|
if (!e) return;
|
|
730
705
|
const { data: n, keyLength: r } = e, i = [];
|
|
731
706
|
for (let s = 0; s < r; ++s)
|
|
@@ -738,16 +713,16 @@ function Xe(t) {
|
|
|
738
713
|
}
|
|
739
714
|
return i.map((s) => Array.from(s.values()));
|
|
740
715
|
}
|
|
741
|
-
function
|
|
742
|
-
if (t === void 0) return;
|
|
716
|
+
function he(t, e = []) {
|
|
717
|
+
if (t === void 0 || !t.getIsReadyOrError()) return;
|
|
743
718
|
const n = t.resourceType.name, r = t.getDataAsJson();
|
|
744
|
-
if (e.length > 0 && (n ===
|
|
719
|
+
if (e.length > 0 && (n === re || n === B))
|
|
745
720
|
throw new Error(`Unexpected nested super-partitioned resource: ${n}`);
|
|
746
721
|
switch (n) {
|
|
747
|
-
case
|
|
748
|
-
case
|
|
722
|
+
case te:
|
|
723
|
+
case ne:
|
|
749
724
|
throw new Error(`Only data columns are supported, got: ${n}`);
|
|
750
|
-
case
|
|
725
|
+
case U: {
|
|
751
726
|
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
752
727
|
throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
|
|
753
728
|
const i = [];
|
|
@@ -763,21 +738,21 @@ function le(t, e = []) {
|
|
|
763
738
|
parts: i
|
|
764
739
|
};
|
|
765
740
|
}
|
|
766
|
-
case
|
|
741
|
+
case V: {
|
|
767
742
|
if (typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
768
743
|
throw new Error(`Missing partitionKeyLength in metadata for ${n}`);
|
|
769
744
|
const i = [], s = /* @__PURE__ */ new Map();
|
|
770
745
|
for (const o of t.listInputFields()) {
|
|
771
|
-
const a =
|
|
772
|
-
if (
|
|
773
|
-
let
|
|
774
|
-
|
|
746
|
+
const a = fe(o), l = t.resolve({ field: o, assertFieldType: "Input" });
|
|
747
|
+
if (l === void 0) return;
|
|
748
|
+
let u = s.get(a.baseKey);
|
|
749
|
+
u || (u = {}, s.set(a.baseKey, u)), a.type === "index" ? u.index = l : u.values = l;
|
|
775
750
|
}
|
|
776
751
|
for (const [o, a] of s.entries()) {
|
|
777
752
|
if (!a.index || !a.values) return;
|
|
778
|
-
const
|
|
753
|
+
const l = [...e, ...JSON.parse(o)];
|
|
779
754
|
i.push({
|
|
780
|
-
key:
|
|
755
|
+
key: l,
|
|
781
756
|
value: {
|
|
782
757
|
index: a.index,
|
|
783
758
|
values: a.values
|
|
@@ -790,20 +765,20 @@ function le(t, e = []) {
|
|
|
790
765
|
parts: i
|
|
791
766
|
};
|
|
792
767
|
}
|
|
793
|
-
case
|
|
768
|
+
case re: {
|
|
794
769
|
if (typeof (r == null ? void 0 : r.superPartitionKeyLength) != "number" || typeof (r == null ? void 0 : r.partitionKeyLength) != "number")
|
|
795
770
|
throw new Error(`Missing superPartitionKeyLength or partitionKeyLength in metadata for ${n}`);
|
|
796
771
|
const i = r.superPartitionKeyLength + r.partitionKeyLength, s = [];
|
|
797
772
|
for (const o of t.listInputFields()) {
|
|
798
773
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
799
774
|
if (a === void 0) return;
|
|
800
|
-
if (a.resourceType.name !==
|
|
801
|
-
throw new Error(`Expected ${
|
|
802
|
-
const
|
|
803
|
-
if (
|
|
804
|
-
if (
|
|
805
|
-
throw new Error(`Unexpected inner result type for ${n}: ${
|
|
806
|
-
s.push(...
|
|
775
|
+
if (a.resourceType.name !== U)
|
|
776
|
+
throw new Error(`Expected ${U} inside ${n}, but got ${a.resourceType.name}`);
|
|
777
|
+
const l = he(a, JSON.parse(o));
|
|
778
|
+
if (l === void 0) return;
|
|
779
|
+
if (l.type !== "JsonPartitioned")
|
|
780
|
+
throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
|
|
781
|
+
s.push(...l.parts);
|
|
807
782
|
}
|
|
808
783
|
return {
|
|
809
784
|
type: "JsonPartitioned",
|
|
@@ -818,13 +793,13 @@ function le(t, e = []) {
|
|
|
818
793
|
for (const o of t.listInputFields()) {
|
|
819
794
|
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
820
795
|
if (a === void 0) return;
|
|
821
|
-
if (a.resourceType.name !==
|
|
822
|
-
throw new Error(`Expected ${
|
|
823
|
-
const
|
|
824
|
-
if (
|
|
825
|
-
if (
|
|
826
|
-
throw new Error(`Unexpected inner result type for ${n}: ${
|
|
827
|
-
s.push(...
|
|
796
|
+
if (a.resourceType.name !== V)
|
|
797
|
+
throw new Error(`Expected ${V} inside ${n}, but got ${a.resourceType.name}`);
|
|
798
|
+
const l = he(a, JSON.parse(o));
|
|
799
|
+
if (l === void 0) return;
|
|
800
|
+
if (l.type !== "BinaryPartitioned")
|
|
801
|
+
throw new Error(`Unexpected inner result type for ${n}: ${l.type}`);
|
|
802
|
+
s.push(...l.parts);
|
|
828
803
|
}
|
|
829
804
|
return {
|
|
830
805
|
type: "BinaryPartitioned",
|
|
@@ -836,32 +811,287 @@ function le(t, e = []) {
|
|
|
836
811
|
throw new Error(`Unknown resource type: ${n}`);
|
|
837
812
|
}
|
|
838
813
|
}
|
|
839
|
-
function
|
|
840
|
-
if (t
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
if (t
|
|
844
|
-
|
|
814
|
+
function pt(t) {
|
|
815
|
+
if (t !== void 0) {
|
|
816
|
+
if (xe(t)) return t;
|
|
817
|
+
if (me(t)) return Ve(t);
|
|
818
|
+
if (t instanceof _) return he(t);
|
|
819
|
+
throw new Error(`Unexpected input type: ${typeof t}`);
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
function dt(t, e) {
|
|
823
|
+
const n = [...e].sort((s, o) => o[0] - s[0]);
|
|
824
|
+
if (t.type === "JsonPartitioned" || t.type === "BinaryPartitioned") {
|
|
825
|
+
const { partitionKeyLength: s } = t;
|
|
826
|
+
for (const [o] of e)
|
|
827
|
+
if (o >= s)
|
|
828
|
+
throw new Error(`Can't filter on non-partitioned axis ${o}. Must be >= ${s}`);
|
|
829
|
+
} else if (t.type === "Json") {
|
|
830
|
+
const { keyLength: s } = t;
|
|
831
|
+
for (const [o] of e)
|
|
832
|
+
if (o >= s)
|
|
833
|
+
throw new Error(`Can't filter on non-data axis ${o}. Must be >= ${s}`);
|
|
834
|
+
}
|
|
835
|
+
const r = (s) => {
|
|
836
|
+
for (const [o, a] of n)
|
|
837
|
+
if (s[o] !== a)
|
|
838
|
+
return !1;
|
|
839
|
+
return !0;
|
|
840
|
+
}, i = (s) => {
|
|
841
|
+
const o = [...s];
|
|
842
|
+
for (const [a] of n)
|
|
843
|
+
o.splice(a, 1);
|
|
844
|
+
return o;
|
|
845
|
+
};
|
|
846
|
+
switch (t.type) {
|
|
847
|
+
case "Json": {
|
|
848
|
+
const s = t.data.filter((o) => r(o.key)).map((o) => ({
|
|
849
|
+
key: i(o.key),
|
|
850
|
+
value: o.value
|
|
851
|
+
}));
|
|
852
|
+
return {
|
|
853
|
+
type: "Json",
|
|
854
|
+
keyLength: t.keyLength - e.length,
|
|
855
|
+
data: s
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
case "JsonPartitioned": {
|
|
859
|
+
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
860
|
+
key: i(o.key),
|
|
861
|
+
value: o.value
|
|
862
|
+
}));
|
|
863
|
+
return {
|
|
864
|
+
type: "JsonPartitioned",
|
|
865
|
+
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
866
|
+
parts: s
|
|
867
|
+
};
|
|
868
|
+
}
|
|
869
|
+
case "BinaryPartitioned": {
|
|
870
|
+
const s = t.parts.filter((o) => r(o.key)).map((o) => ({
|
|
871
|
+
key: i(o.key),
|
|
872
|
+
value: o.value
|
|
873
|
+
}));
|
|
874
|
+
return {
|
|
875
|
+
type: "BinaryPartitioned",
|
|
876
|
+
partitionKeyLength: t.partitionKeyLength - e.length,
|
|
877
|
+
parts: s
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
}
|
|
845
881
|
}
|
|
846
|
-
|
|
847
|
-
|
|
882
|
+
class ft {
|
|
883
|
+
constructor(e) {
|
|
884
|
+
this.columns = e;
|
|
885
|
+
}
|
|
886
|
+
selectColumns(e) {
|
|
887
|
+
const n = typeof e == "function" ? e : ce(e);
|
|
888
|
+
return this.columns.filter((r) => n(r.spec));
|
|
889
|
+
}
|
|
848
890
|
}
|
|
849
|
-
function
|
|
891
|
+
function ht(t) {
|
|
850
892
|
if (t)
|
|
851
893
|
return t.map((e) => ({
|
|
852
|
-
type: `split:${
|
|
894
|
+
type: `split:${Ue(e.axisId)}`,
|
|
853
895
|
label: e.label,
|
|
854
896
|
importance: 1e6
|
|
855
897
|
// High importance for split filters in labels
|
|
856
898
|
}));
|
|
857
899
|
}
|
|
858
|
-
function
|
|
900
|
+
function gt(t) {
|
|
859
901
|
if (t)
|
|
860
902
|
return t.map((e) => [e.axisIdx, e.value]);
|
|
861
903
|
}
|
|
862
|
-
|
|
904
|
+
function mt(t, e) {
|
|
905
|
+
if (!e || e.length === 0) return t;
|
|
906
|
+
const n = [...e].sort((r, i) => r[0] - i[0]);
|
|
907
|
+
return Pe({ id: t, axisFilters: n });
|
|
908
|
+
}
|
|
909
|
+
function yt(t) {
|
|
910
|
+
if (!t || typeof t != "object") return !1;
|
|
911
|
+
const e = t, n = e.domain && typeof e.domain == "object" && Object.values(e.domain).some((i) => typeof i == "object" && i !== null && "anchor" in i), r = e.axes && Array.isArray(e.axes) && e.axes.some((i) => typeof i == "object" && i !== null && "anchor" in i);
|
|
912
|
+
return !!e.domainAnchor || n || r;
|
|
913
|
+
}
|
|
914
|
+
function vt(t) {
|
|
915
|
+
if (typeof t != "object" || !("axes" in t) || t.axes === void 0)
|
|
916
|
+
return [];
|
|
917
|
+
const e = t.axes.map((n, r) => typeof n == "object" && "split" in n && n.split === !0 ? r : -1).filter((n) => n !== -1);
|
|
918
|
+
if (e.length > 0 && t.partialAxesMatch !== void 0)
|
|
919
|
+
throw new Error("Axis splitting is not supported when `partialAxesMatch` is defined.");
|
|
920
|
+
return e.sort((n, r) => n - r), e;
|
|
921
|
+
}
|
|
922
|
+
class be {
|
|
923
|
+
constructor() {
|
|
924
|
+
L(this, "defaultProviderStore", []);
|
|
925
|
+
L(this, "providers", [new ft(this.defaultProviderStore)]);
|
|
926
|
+
L(this, "axisLabelProviders", []);
|
|
927
|
+
}
|
|
928
|
+
addColumnProvider(e) {
|
|
929
|
+
return this.providers.push(e), this;
|
|
930
|
+
}
|
|
931
|
+
addAxisLabelProvider(e) {
|
|
932
|
+
return this.axisLabelProviders.push(e), this;
|
|
933
|
+
}
|
|
934
|
+
addColumns(e) {
|
|
935
|
+
return this.defaultProviderStore.push(...e), this;
|
|
936
|
+
}
|
|
937
|
+
addColumn(e) {
|
|
938
|
+
return this.defaultProviderStore.push(e), this;
|
|
939
|
+
}
|
|
940
|
+
/** Fetches labels for a given axis from the registered providers */
|
|
941
|
+
findLabels(e) {
|
|
942
|
+
for (const n of this.axisLabelProviders) {
|
|
943
|
+
const r = n.findLabels(e);
|
|
944
|
+
if (r) return r;
|
|
945
|
+
}
|
|
946
|
+
}
|
|
947
|
+
getUniversalEntries(e, n) {
|
|
948
|
+
const { anchorCtx: r, labelOps: i, dontWaitAllData: s = !1, overrideLabelAnnotation: o = !1 } = n ?? {}, a = {
|
|
949
|
+
...o && (i == null ? void 0 : i.includeNativeLabel) !== !1 ? { includeNativeLabel: !0 } : {},
|
|
950
|
+
...i ?? {}
|
|
951
|
+
}, l = typeof e == "function" ? [e] : Array.isArray(e) ? e : [e], u = [];
|
|
952
|
+
for (const f of l) {
|
|
953
|
+
const p = yt(f);
|
|
954
|
+
let c;
|
|
955
|
+
if (p) {
|
|
956
|
+
if (!r)
|
|
957
|
+
throw new Error("Anchored selectors require an AnchoredIdDeriver to be provided in options.");
|
|
958
|
+
c = $e(r.anchors, f);
|
|
959
|
+
} else
|
|
960
|
+
c = f;
|
|
961
|
+
const h = /* @__PURE__ */ new Set(), A = [];
|
|
962
|
+
for (const g of this.providers) {
|
|
963
|
+
const P = g.selectColumns(c);
|
|
964
|
+
for (const b of P) {
|
|
965
|
+
if (h.has(b.id)) throw new Error(`Duplicate column id ${b.id} in provider ${g.constructor.name}`);
|
|
966
|
+
h.add(b.id), A.push(b);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
if (A.length === 0) continue;
|
|
970
|
+
const y = vt(f), v = y.length > 0;
|
|
971
|
+
for (const g of A) {
|
|
972
|
+
if (!Q(g.spec)) continue;
|
|
973
|
+
const P = g.spec;
|
|
974
|
+
if (v) {
|
|
975
|
+
const b = pt(g.data);
|
|
976
|
+
if (!b) {
|
|
977
|
+
if (s) continue;
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
if (!Je(b))
|
|
981
|
+
throw new Error(`Splitting requires Partitioned DataInfoEntries, but parsing resulted in ${b.type} for column ${g.id}`);
|
|
982
|
+
const F = ct(b), $ = y[y.length - 1];
|
|
983
|
+
if ($ >= b.partitionKeyLength)
|
|
984
|
+
throw new Error(`Not enough partition keys (${b.partitionKeyLength}) for requested split axes (max index ${$}) in column ${P.name}`);
|
|
985
|
+
const q = y.map((w) => this.findLabels(E(P.axesSpec[w]))), D = [], I = (w, N) => {
|
|
986
|
+
if (N >= y.length) {
|
|
987
|
+
D.push([...w]);
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
const k = y[N];
|
|
991
|
+
if (k >= F.length)
|
|
992
|
+
throw new Error(`Axis index ${k} out of bounds for unique keys array (length ${F.length}) during split key generation for column ${g.id}`);
|
|
993
|
+
const O = F[k];
|
|
994
|
+
if (!O || O.length === 0) {
|
|
995
|
+
D.length = 0;
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
for (const z of O)
|
|
999
|
+
w.push(z), I(w, N + 1), w.pop();
|
|
1000
|
+
};
|
|
1001
|
+
if (I([], 0), D.length === 0)
|
|
1002
|
+
continue;
|
|
1003
|
+
const R = [...P.axesSpec], se = y.map((w) => w);
|
|
1004
|
+
for (let w = y.length - 1; w >= 0; w--)
|
|
1005
|
+
R.splice(y[w], 1);
|
|
1006
|
+
const J = { ...P, axesSpec: R };
|
|
1007
|
+
for (const w of D) {
|
|
1008
|
+
const N = w.map((k, O) => {
|
|
1009
|
+
const z = se[O], Re = E(P.axesSpec[z]), oe = q[O], Oe = (oe == null ? void 0 : oe[k]) ?? String(k);
|
|
1010
|
+
return { axisIdx: z, axisId: Re, value: k, label: Oe };
|
|
1011
|
+
});
|
|
1012
|
+
u.push({
|
|
1013
|
+
type: "split",
|
|
1014
|
+
originalColumn: g,
|
|
1015
|
+
spec: P,
|
|
1016
|
+
adjustedSpec: J,
|
|
1017
|
+
dataEntries: b,
|
|
1018
|
+
axisFilters: N
|
|
1019
|
+
});
|
|
1020
|
+
}
|
|
1021
|
+
} else
|
|
1022
|
+
u.push({
|
|
1023
|
+
type: "direct",
|
|
1024
|
+
originalColumn: g,
|
|
1025
|
+
spec: P,
|
|
1026
|
+
adjustedSpec: P
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
if (u.length === 0) return [];
|
|
1031
|
+
const S = Ee(
|
|
1032
|
+
u,
|
|
1033
|
+
(f) => ({
|
|
1034
|
+
spec: f.spec,
|
|
1035
|
+
suffixTrace: f.type === "split" ? ht(f.axisFilters) : void 0
|
|
1036
|
+
}),
|
|
1037
|
+
a
|
|
1038
|
+
), d = [];
|
|
1039
|
+
for (const { value: f, label: p } of S) {
|
|
1040
|
+
const { originalColumn: c, spec: h } = f, A = f.type === "split" ? f.axisFilters : void 0, y = gt(A);
|
|
1041
|
+
let v;
|
|
1042
|
+
r ? v = r.deriveS(h, y) : v = mt(c.id, y);
|
|
1043
|
+
let g = { ...f.adjustedSpec };
|
|
1044
|
+
o && (g = {
|
|
1045
|
+
...g,
|
|
1046
|
+
annotations: {
|
|
1047
|
+
...g.annotations ?? {},
|
|
1048
|
+
"pl7.app/label": p
|
|
1049
|
+
}
|
|
1050
|
+
}), d.push({
|
|
1051
|
+
id: v,
|
|
1052
|
+
spec: g,
|
|
1053
|
+
data: () => f.type === "split" ? Ne(dt(f.dataEntries, y)) : f.originalColumn.data,
|
|
1054
|
+
label: p
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
return d;
|
|
1058
|
+
}
|
|
1059
|
+
getColumns(e, n) {
|
|
1060
|
+
const r = this.getUniversalEntries(e, {
|
|
1061
|
+
overrideLabelAnnotation: !0,
|
|
1062
|
+
// default for getColumns
|
|
1063
|
+
...n ?? {}
|
|
1064
|
+
});
|
|
1065
|
+
if (!r) return;
|
|
1066
|
+
const i = [];
|
|
1067
|
+
for (const s of r) {
|
|
1068
|
+
const o = s.data();
|
|
1069
|
+
if (!o) {
|
|
1070
|
+
if (n != null && n.dontWaitAllData) continue;
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
i.push({
|
|
1074
|
+
id: s.id,
|
|
1075
|
+
spec: s.spec,
|
|
1076
|
+
data: o
|
|
1077
|
+
});
|
|
1078
|
+
}
|
|
1079
|
+
return i;
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
function le(t, e) {
|
|
1083
|
+
if (t === void 0) return e === void 0;
|
|
1084
|
+
if (e === void 0) return !0;
|
|
1085
|
+
for (const n in e)
|
|
1086
|
+
if (t[n] !== e[n]) return !1;
|
|
1087
|
+
return !0;
|
|
1088
|
+
}
|
|
1089
|
+
function we(t) {
|
|
1090
|
+
return ge(t, (e) => e instanceof _ ? e.handle : me(e) ? qe(e, (n) => n.handle) : e);
|
|
1091
|
+
}
|
|
1092
|
+
class bt {
|
|
863
1093
|
constructor() {
|
|
864
|
-
|
|
1094
|
+
L(this, "ctx", m());
|
|
865
1095
|
}
|
|
866
1096
|
/**
|
|
867
1097
|
* @deprecated use getOptions()
|
|
@@ -871,7 +1101,7 @@ class et {
|
|
|
871
1101
|
}
|
|
872
1102
|
getOptions(e, n) {
|
|
873
1103
|
const r = typeof e == "function" ? e : ce(e), i = this.getSpecs().entries.filter((s) => r(s.obj));
|
|
874
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
1104
|
+
return typeof n == "object" || typeof n > "u" ? Ee(i, (s) => s.obj, n ?? {}).map(({ value: { ref: s }, label: o }) => ({
|
|
875
1105
|
ref: s,
|
|
876
1106
|
label: o
|
|
877
1107
|
})) : i.map((s) => ({
|
|
@@ -879,93 +1109,18 @@ class et {
|
|
|
879
1109
|
label: n(s.obj, s.ref)
|
|
880
1110
|
}));
|
|
881
1111
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
const u = this.getPColumnSpecByRef(m);
|
|
892
|
-
if (!u)
|
|
893
|
-
return;
|
|
894
|
-
i[l] = u;
|
|
895
|
-
} else
|
|
896
|
-
i[l] = m;
|
|
897
|
-
const s = typeof n == "function" ? [n] : Array.isArray(n) ? n : [n], o = e instanceof te ? e : new te(i), a = [];
|
|
898
|
-
for (const l of s) {
|
|
899
|
-
const m = typeof l == "function" ? l : ce(Le(i, l)), u = this.getSpecs().entries.filter(({ obj: p }) => N(p) ? m(p) : !1);
|
|
900
|
-
if (u.length === 0)
|
|
901
|
-
continue;
|
|
902
|
-
const f = typeof l == "object" && "axes" in l && l.axes !== void 0 && l.partialAxesMatch === void 0 ? l.axes.map((p, d) => "split" in p && p.split === !0 ? d : -1).filter((p) => p !== -1) : [];
|
|
903
|
-
if (f.sort((p, d) => p - d), f.length > 0) {
|
|
904
|
-
const p = f[f.length - 1];
|
|
905
|
-
for (const { ref: d, obj: y } of u) {
|
|
906
|
-
if (!N(y)) throw new Error(`Assertion failed: expected PColumnSpec, got ${y.kind}`);
|
|
907
|
-
const g = this.getDataByRef(d);
|
|
908
|
-
if (!g) {
|
|
909
|
-
if (r != null && r.dontWaitAllData) continue;
|
|
910
|
-
return;
|
|
911
|
-
}
|
|
912
|
-
if (!M(g)) throw new Error(`Assertion failed: expected PColumn, got ${g.spec.kind}`);
|
|
913
|
-
const v = Xe(g.data);
|
|
914
|
-
if (!v) {
|
|
915
|
-
if (r != null && r.dontWaitAllData) continue;
|
|
916
|
-
return;
|
|
917
|
-
}
|
|
918
|
-
if (p >= v.length)
|
|
919
|
-
throw new Error(`Not enough partition keys for the requested split axes in column ${y.name}`);
|
|
920
|
-
const w = f.map((P) => this.findLabels(L(y.axesSpec[P]))), x = [], C = (P, T) => {
|
|
921
|
-
if (T >= f.length) {
|
|
922
|
-
x.push([...P]);
|
|
923
|
-
return;
|
|
924
|
-
}
|
|
925
|
-
const R = f[T], k = v[R];
|
|
926
|
-
for (const A of k)
|
|
927
|
-
P.push(A), C(P, T + 1), P.pop();
|
|
928
|
-
};
|
|
929
|
-
C([], 0);
|
|
930
|
-
for (const P of x) {
|
|
931
|
-
const T = P.map((R, k) => {
|
|
932
|
-
const A = f[k], j = L(y.axesSpec[A]), V = w[k], K = (V == null ? void 0 : V[R]) ?? String(R);
|
|
933
|
-
return { axisIdx: A, axisId: j, value: R, label: K };
|
|
934
|
-
});
|
|
935
|
-
a.push({
|
|
936
|
-
obj: y,
|
|
937
|
-
ref: d,
|
|
938
|
-
axisFilters: T
|
|
939
|
-
});
|
|
940
|
-
}
|
|
941
|
-
}
|
|
1112
|
+
resolveAnchorCtx(e) {
|
|
1113
|
+
if (e instanceof ye) return e;
|
|
1114
|
+
const n = {};
|
|
1115
|
+
for (const [r, i] of Object.entries(e))
|
|
1116
|
+
if (Be(i)) {
|
|
1117
|
+
const s = this.getPColumnSpecByRef(i);
|
|
1118
|
+
if (!s)
|
|
1119
|
+
return;
|
|
1120
|
+
n[r] = s;
|
|
942
1121
|
} else
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
obj: d,
|
|
946
|
-
ref: p
|
|
947
|
-
// No splitFilters needed here
|
|
948
|
-
});
|
|
949
|
-
}
|
|
950
|
-
return a.length === 0 ? [] : de(
|
|
951
|
-
a,
|
|
952
|
-
(l) => ({
|
|
953
|
-
spec: l.obj,
|
|
954
|
-
suffixTrace: Qe(l.axisFilters)
|
|
955
|
-
// Use helper function
|
|
956
|
-
}),
|
|
957
|
-
(r == null ? void 0 : r.labelOps) ?? {}
|
|
958
|
-
).map((l) => ({
|
|
959
|
-
id: o.deriveS(
|
|
960
|
-
l.value.obj,
|
|
961
|
-
Ze(l.value.axisFilters)
|
|
962
|
-
// Use helper function
|
|
963
|
-
),
|
|
964
|
-
obj: l.value.obj,
|
|
965
|
-
ref: l.value.ref,
|
|
966
|
-
axisFilters: l.value.axisFilters,
|
|
967
|
-
label: l.label
|
|
968
|
-
}));
|
|
1122
|
+
n[r] = i;
|
|
1123
|
+
return new ye(n);
|
|
969
1124
|
}
|
|
970
1125
|
/**
|
|
971
1126
|
* Returns columns that match the provided anchors and selectors. It applies axis filters and label derivation.
|
|
@@ -976,55 +1131,12 @@ class et {
|
|
|
976
1131
|
* @returns A PFrameHandle for the created PFrame, or undefined if any required data is missing
|
|
977
1132
|
*/
|
|
978
1133
|
getAnchoredPColumns(e, n, r) {
|
|
979
|
-
const i =
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
}
|
|
985
|
-
}, s = this.getUniversalPColumnEntries(
|
|
986
|
-
e,
|
|
987
|
-
n,
|
|
988
|
-
i
|
|
989
|
-
);
|
|
990
|
-
if (!s || s.length === 0) return;
|
|
991
|
-
const o = [];
|
|
992
|
-
for (const a of s) {
|
|
993
|
-
const c = this.getPColumnByRef(a.ref);
|
|
994
|
-
if (!c) return;
|
|
995
|
-
const l = le(c.data);
|
|
996
|
-
if (!l) return;
|
|
997
|
-
let m = l, u = { ...c.spec };
|
|
998
|
-
if (a.axisFilters && a.axisFilters.length > 0) {
|
|
999
|
-
const p = a.axisFilters.map((g) => [
|
|
1000
|
-
g.axisIdx,
|
|
1001
|
-
g.value
|
|
1002
|
-
]);
|
|
1003
|
-
m = Ue(l, p);
|
|
1004
|
-
const d = [...a.axisFilters].map((g) => g.axisIdx).sort((g, v) => v - g), y = [...u.axesSpec];
|
|
1005
|
-
for (const g of d)
|
|
1006
|
-
y.splice(g, 1);
|
|
1007
|
-
u = { ...u, axesSpec: y };
|
|
1008
|
-
}
|
|
1009
|
-
const f = Fe(m);
|
|
1010
|
-
u.annotations ? u = {
|
|
1011
|
-
...u,
|
|
1012
|
-
annotations: {
|
|
1013
|
-
...u.annotations,
|
|
1014
|
-
"pl7.app/label": a.label
|
|
1015
|
-
}
|
|
1016
|
-
} : u = {
|
|
1017
|
-
...u,
|
|
1018
|
-
annotations: {
|
|
1019
|
-
"pl7.app/label": a.label
|
|
1020
|
-
}
|
|
1021
|
-
}, o.push({
|
|
1022
|
-
id: a.id,
|
|
1023
|
-
spec: u,
|
|
1024
|
-
data: f
|
|
1134
|
+
const i = this.resolveAnchorCtx(e);
|
|
1135
|
+
if (i)
|
|
1136
|
+
return new be().addColumnProvider(this).addAxisLabelProvider(this).getColumns(n, {
|
|
1137
|
+
...r,
|
|
1138
|
+
anchorCtx: i
|
|
1025
1139
|
});
|
|
1026
|
-
}
|
|
1027
|
-
return o;
|
|
1028
1140
|
}
|
|
1029
1141
|
/**
|
|
1030
1142
|
* Calculates anchored identifier options for columns matching a given predicate and returns their
|
|
@@ -1056,11 +1168,16 @@ class et {
|
|
|
1056
1168
|
* or undefined if any PlRef resolution fails.
|
|
1057
1169
|
*/
|
|
1058
1170
|
getCanonicalOptions(e, n, r) {
|
|
1059
|
-
const i = this.
|
|
1060
|
-
if (i)
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1171
|
+
const i = this.resolveAnchorCtx(e);
|
|
1172
|
+
if (!i) return;
|
|
1173
|
+
const s = new be().addColumnProvider(this).addAxisLabelProvider(this).getUniversalEntries(n, {
|
|
1174
|
+
...r,
|
|
1175
|
+
anchorCtx: i
|
|
1176
|
+
});
|
|
1177
|
+
if (s)
|
|
1178
|
+
return s.map((o) => ({
|
|
1179
|
+
value: o.id,
|
|
1180
|
+
label: o.label
|
|
1064
1181
|
}));
|
|
1065
1182
|
}
|
|
1066
1183
|
/**
|
|
@@ -1077,7 +1194,7 @@ class et {
|
|
|
1077
1194
|
ref: n.ref,
|
|
1078
1195
|
obj: {
|
|
1079
1196
|
...n.obj,
|
|
1080
|
-
data: new
|
|
1197
|
+
data: new _(n.obj.data, [n.ref.blockId, n.ref.name])
|
|
1081
1198
|
}
|
|
1082
1199
|
}))
|
|
1083
1200
|
};
|
|
@@ -1096,9 +1213,9 @@ class et {
|
|
|
1096
1213
|
ref: n.ref,
|
|
1097
1214
|
obj: {
|
|
1098
1215
|
...n.obj,
|
|
1099
|
-
data:
|
|
1216
|
+
data: Me(
|
|
1100
1217
|
n.obj.data,
|
|
1101
|
-
(r) => new
|
|
1218
|
+
(r) => new _(r, [n.ref.blockId, n.ref.name])
|
|
1102
1219
|
)
|
|
1103
1220
|
}
|
|
1104
1221
|
}))
|
|
@@ -1125,9 +1242,9 @@ class et {
|
|
|
1125
1242
|
)) == null ? void 0 : r.obj;
|
|
1126
1243
|
const n = this.ctx.getDataFromResultPoolByRef(e.blockId, e.name);
|
|
1127
1244
|
if (n)
|
|
1128
|
-
return
|
|
1245
|
+
return ge(
|
|
1129
1246
|
n,
|
|
1130
|
-
(i) => new
|
|
1247
|
+
(i) => new _(i, [e.blockId, e.name])
|
|
1131
1248
|
);
|
|
1132
1249
|
}
|
|
1133
1250
|
/**
|
|
@@ -1138,7 +1255,7 @@ class et {
|
|
|
1138
1255
|
getPColumnByRef(e) {
|
|
1139
1256
|
const n = this.getDataByRef(e);
|
|
1140
1257
|
if (n)
|
|
1141
|
-
return
|
|
1258
|
+
return Ge(n);
|
|
1142
1259
|
}
|
|
1143
1260
|
/**
|
|
1144
1261
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
@@ -1148,7 +1265,7 @@ class et {
|
|
|
1148
1265
|
getPColumnSpecByRef(e) {
|
|
1149
1266
|
const n = this.getSpecByRef(e);
|
|
1150
1267
|
if (n) {
|
|
1151
|
-
if (!
|
|
1268
|
+
if (!Q(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
1152
1269
|
return n;
|
|
1153
1270
|
}
|
|
1154
1271
|
}
|
|
@@ -1167,13 +1284,13 @@ class et {
|
|
|
1167
1284
|
findDataWithCompatibleSpec(e) {
|
|
1168
1285
|
const n = [];
|
|
1169
1286
|
e: for (const r of this.getData().entries) {
|
|
1170
|
-
if (!
|
|
1287
|
+
if (!Q(r.obj.spec))
|
|
1171
1288
|
continue;
|
|
1172
1289
|
const i = r.obj.spec;
|
|
1173
|
-
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length &&
|
|
1290
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && le(e.domain, i.domain)) {
|
|
1174
1291
|
for (let s = 0; s < e.axesSpec.length; ++s) {
|
|
1175
1292
|
const o = e.axesSpec[s], a = i.axesSpec[s];
|
|
1176
|
-
if (o.name !== a.name || o.type !== a.type || !
|
|
1293
|
+
if (o.name !== a.name || o.type !== a.type || !le(o.domain, a.domain))
|
|
1177
1294
|
continue e;
|
|
1178
1295
|
}
|
|
1179
1296
|
n.push(r.obj);
|
|
@@ -1188,9 +1305,9 @@ class et {
|
|
|
1188
1305
|
findLabels(e) {
|
|
1189
1306
|
const n = this.getData();
|
|
1190
1307
|
for (const r of n.entries) {
|
|
1191
|
-
if (!
|
|
1308
|
+
if (!ie(r.obj)) continue;
|
|
1192
1309
|
const i = r.obj.spec;
|
|
1193
|
-
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type &&
|
|
1310
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && le(e.domain, i.axesSpec[0].domain)) {
|
|
1194
1311
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
1195
1312
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
1196
1313
|
return Object.fromEntries(
|
|
@@ -1201,6 +1318,29 @@ class et {
|
|
|
1201
1318
|
}
|
|
1202
1319
|
}
|
|
1203
1320
|
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Selects columns based on the provided selectors, returning PColumn objects
|
|
1323
|
+
* with lazily loaded data.
|
|
1324
|
+
*
|
|
1325
|
+
* @param selectors - A predicate function, a single selector, or an array of selectors.
|
|
1326
|
+
* @returns An array of PColumn objects matching the selectors. Data is loaded on first access.
|
|
1327
|
+
*/
|
|
1328
|
+
selectColumns(e) {
|
|
1329
|
+
const n = typeof e == "function" ? e : ce(e);
|
|
1330
|
+
return this.getSpecs().entries.filter(({ obj: i }) => Q(i) ? n(i) : !1).map(({ ref: i, obj: s }) => {
|
|
1331
|
+
const o = s;
|
|
1332
|
+
let a = null;
|
|
1333
|
+
const l = this;
|
|
1334
|
+
return {
|
|
1335
|
+
id: Pe(i),
|
|
1336
|
+
spec: o,
|
|
1337
|
+
get data() {
|
|
1338
|
+
var u;
|
|
1339
|
+
return a !== null || (a = (u = l.getPColumnByRef(i)) == null ? void 0 : u.data), a;
|
|
1340
|
+
}
|
|
1341
|
+
};
|
|
1342
|
+
});
|
|
1343
|
+
}
|
|
1204
1344
|
/**
|
|
1205
1345
|
* Find labels data for a given axis id of a p-column.
|
|
1206
1346
|
* @returns a map of axis value => label
|
|
@@ -1214,15 +1354,15 @@ class et {
|
|
|
1214
1354
|
}));
|
|
1215
1355
|
}
|
|
1216
1356
|
}
|
|
1217
|
-
class
|
|
1357
|
+
class X {
|
|
1218
1358
|
constructor() {
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1359
|
+
L(this, "ctx");
|
|
1360
|
+
L(this, "args");
|
|
1361
|
+
L(this, "uiState");
|
|
1222
1362
|
// lazy rendering because this feature is rarely used
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
this.ctx =
|
|
1363
|
+
L(this, "_activeArgsCache");
|
|
1364
|
+
L(this, "resultPool", new bt());
|
|
1365
|
+
this.ctx = m(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
1226
1366
|
}
|
|
1227
1367
|
/**
|
|
1228
1368
|
* Returns args snapshot the block was executed for (i.e. when "Run" button was pressed).
|
|
@@ -1238,16 +1378,16 @@ class z {
|
|
|
1238
1378
|
// return this.ctx.featureFlags;
|
|
1239
1379
|
// }
|
|
1240
1380
|
getNamedAccessor(e) {
|
|
1241
|
-
return
|
|
1381
|
+
return pe(
|
|
1242
1382
|
this.ctx.getAccessorHandleByName(e),
|
|
1243
|
-
(n) => new
|
|
1383
|
+
(n) => new _(n, [e])
|
|
1244
1384
|
);
|
|
1245
1385
|
}
|
|
1246
1386
|
get prerun() {
|
|
1247
|
-
return this.getNamedAccessor(
|
|
1387
|
+
return this.getNamedAccessor(Ie);
|
|
1248
1388
|
}
|
|
1249
1389
|
get outputs() {
|
|
1250
|
-
return this.getNamedAccessor(
|
|
1390
|
+
return this.getNamedAccessor(Le);
|
|
1251
1391
|
}
|
|
1252
1392
|
/**
|
|
1253
1393
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
@@ -1259,12 +1399,13 @@ class z {
|
|
|
1259
1399
|
}
|
|
1260
1400
|
verifyInlineAndExplicitColumnsSupport(e) {
|
|
1261
1401
|
var i;
|
|
1262
|
-
const n = e.some((s) => !(s.data instanceof
|
|
1402
|
+
const n = e.some((s) => !(s.data instanceof _) || me(s.data)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
|
|
1263
1403
|
if (n && !r) throw Error("Inline or explicit columns not supported");
|
|
1264
1404
|
}
|
|
1405
|
+
// TODO remove all non-PColumn fields
|
|
1265
1406
|
createPFrame(e) {
|
|
1266
1407
|
return this.verifyInlineAndExplicitColumnsSupport(e), this.ctx.createPFrame(
|
|
1267
|
-
e.map((n) =>
|
|
1408
|
+
e.map((n) => we(n))
|
|
1268
1409
|
);
|
|
1269
1410
|
}
|
|
1270
1411
|
createPTable(e) {
|
|
@@ -1276,8 +1417,8 @@ class z {
|
|
|
1276
1417
|
},
|
|
1277
1418
|
filters: e.filters ?? [],
|
|
1278
1419
|
sorting: e.sorting ?? []
|
|
1279
|
-
} : n = e, this.verifyInlineAndExplicitColumnsSupport(
|
|
1280
|
-
|
|
1420
|
+
} : n = e, this.verifyInlineAndExplicitColumnsSupport(We(n.src)), this.ctx.createPTable(
|
|
1421
|
+
He(n, (r) => we(r))
|
|
1281
1422
|
);
|
|
1282
1423
|
}
|
|
1283
1424
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -1289,19 +1430,19 @@ class z {
|
|
|
1289
1430
|
return this.ctx.getCurrentUnstableMarker();
|
|
1290
1431
|
}
|
|
1291
1432
|
}
|
|
1292
|
-
const
|
|
1293
|
-
function
|
|
1433
|
+
const M = "1.28.1";
|
|
1434
|
+
function wt(t) {
|
|
1294
1435
|
return t.__renderLambda === !0;
|
|
1295
1436
|
}
|
|
1296
|
-
function
|
|
1437
|
+
function ue(t) {
|
|
1297
1438
|
if (t !== void 0)
|
|
1298
|
-
return
|
|
1439
|
+
return wt(t) ? t.handle : t;
|
|
1299
1440
|
}
|
|
1300
|
-
function
|
|
1441
|
+
function j(t) {
|
|
1301
1442
|
if (t !== void 0)
|
|
1302
1443
|
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
1303
1444
|
}
|
|
1304
|
-
function
|
|
1445
|
+
function dn(t) {
|
|
1305
1446
|
if (t.v3 !== void 0) {
|
|
1306
1447
|
const {
|
|
1307
1448
|
initialArgs: e,
|
|
@@ -1311,8 +1452,8 @@ function Gt(t) {
|
|
|
1311
1452
|
renderingMode: s,
|
|
1312
1453
|
sdkVersion: o,
|
|
1313
1454
|
sections: a,
|
|
1314
|
-
title:
|
|
1315
|
-
} = t.v3, { code:
|
|
1455
|
+
title: l
|
|
1456
|
+
} = t.v3, { code: u } = t;
|
|
1316
1457
|
return {
|
|
1317
1458
|
initialArgs: e,
|
|
1318
1459
|
initialUiState: n,
|
|
@@ -1321,42 +1462,42 @@ function Gt(t) {
|
|
|
1321
1462
|
renderingMode: s,
|
|
1322
1463
|
sdkVersion: o,
|
|
1323
1464
|
sections: a,
|
|
1324
|
-
title:
|
|
1325
|
-
code:
|
|
1465
|
+
title: l,
|
|
1466
|
+
code: u
|
|
1326
1467
|
};
|
|
1327
1468
|
} else if (t.inputsValid !== void 0) {
|
|
1328
|
-
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t,
|
|
1469
|
+
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t, l = Object.keys(t);
|
|
1329
1470
|
if (e === void 0 || n === void 0 || r === void 0 || i === void 0 || s === void 0 || o === void 0)
|
|
1330
1471
|
throw new Error(
|
|
1331
|
-
`Malformed config v2. SDK version ${e}; Fields = ${
|
|
1472
|
+
`Malformed config v2. SDK version ${e}; Fields = ${l.join(", ")}`
|
|
1332
1473
|
);
|
|
1333
1474
|
return {
|
|
1334
1475
|
sdkVersion: e,
|
|
1335
1476
|
renderingMode: n,
|
|
1336
1477
|
initialArgs: o,
|
|
1337
1478
|
outputs: Object.fromEntries(
|
|
1338
|
-
Object.entries(r).map(([
|
|
1479
|
+
Object.entries(r).map(([u, S]) => [u, j(S)])
|
|
1339
1480
|
),
|
|
1340
|
-
inputsValid:
|
|
1341
|
-
sections:
|
|
1481
|
+
inputsValid: j(i),
|
|
1482
|
+
sections: j(s),
|
|
1342
1483
|
initialUiState: void 0,
|
|
1343
1484
|
code: a
|
|
1344
1485
|
};
|
|
1345
1486
|
} else if (t.renderingMode !== void 0) {
|
|
1346
|
-
const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: a } = t,
|
|
1487
|
+
const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: a } = t, l = Object.keys(t);
|
|
1347
1488
|
if (r === void 0 || i === void 0 || n === void 0 || s === void 0 || o === void 0)
|
|
1348
1489
|
throw new Error(
|
|
1349
|
-
`Malformed config v1. SDK version ${e}; Fields = ${
|
|
1490
|
+
`Malformed config v1. SDK version ${e}; Fields = ${l.join(", ")}`
|
|
1350
1491
|
);
|
|
1351
1492
|
return {
|
|
1352
1493
|
sdkVersion: e ?? "unknown",
|
|
1353
1494
|
renderingMode: r,
|
|
1354
1495
|
initialArgs: o,
|
|
1355
1496
|
outputs: Object.fromEntries(
|
|
1356
|
-
Object.entries(i).map(([
|
|
1497
|
+
Object.entries(i).map(([u, S]) => [u, j(S)])
|
|
1357
1498
|
),
|
|
1358
|
-
inputsValid:
|
|
1359
|
-
sections:
|
|
1499
|
+
inputsValid: j(n),
|
|
1500
|
+
sections: j(s),
|
|
1360
1501
|
initialUiState: void 0,
|
|
1361
1502
|
code: a
|
|
1362
1503
|
};
|
|
@@ -1367,25 +1508,25 @@ function Gt(t) {
|
|
|
1367
1508
|
);
|
|
1368
1509
|
}
|
|
1369
1510
|
}
|
|
1370
|
-
class
|
|
1511
|
+
class T {
|
|
1371
1512
|
constructor(e, n, r, i, s, o, a) {
|
|
1372
1513
|
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a;
|
|
1373
1514
|
}
|
|
1374
1515
|
static create(e = "Heavy") {
|
|
1375
|
-
return new
|
|
1516
|
+
return new T(
|
|
1376
1517
|
e,
|
|
1377
1518
|
void 0,
|
|
1378
1519
|
{},
|
|
1379
1520
|
{},
|
|
1380
|
-
|
|
1381
|
-
|
|
1521
|
+
Z(!0),
|
|
1522
|
+
Z([]),
|
|
1382
1523
|
void 0
|
|
1383
1524
|
);
|
|
1384
1525
|
}
|
|
1385
1526
|
output(e, n, r = {}) {
|
|
1386
1527
|
if (typeof n == "function") {
|
|
1387
1528
|
const i = `output#${e}`;
|
|
1388
|
-
return
|
|
1529
|
+
return Y(i, () => n(new X())), new T(
|
|
1389
1530
|
this._renderingMode,
|
|
1390
1531
|
this._initialArgs,
|
|
1391
1532
|
this._initialUiState,
|
|
@@ -1402,7 +1543,7 @@ class _ {
|
|
|
1402
1543
|
this._title
|
|
1403
1544
|
);
|
|
1404
1545
|
} else
|
|
1405
|
-
return new
|
|
1546
|
+
return new T(
|
|
1406
1547
|
this._renderingMode,
|
|
1407
1548
|
this._initialArgs,
|
|
1408
1549
|
this._initialUiState,
|
|
@@ -1420,7 +1561,7 @@ class _ {
|
|
|
1420
1561
|
return this.output(e, n, { retentive: !0 });
|
|
1421
1562
|
}
|
|
1422
1563
|
argsValid(e) {
|
|
1423
|
-
return typeof e == "function" ? (
|
|
1564
|
+
return typeof e == "function" ? (Y("inputsValid", () => e(new X())), new T(
|
|
1424
1565
|
this._renderingMode,
|
|
1425
1566
|
this._initialArgs,
|
|
1426
1567
|
this._initialUiState,
|
|
@@ -1431,7 +1572,7 @@ class _ {
|
|
|
1431
1572
|
},
|
|
1432
1573
|
this._sections,
|
|
1433
1574
|
this._title
|
|
1434
|
-
)) : new
|
|
1575
|
+
)) : new T(
|
|
1435
1576
|
this._renderingMode,
|
|
1436
1577
|
this._initialArgs,
|
|
1437
1578
|
this._initialUiState,
|
|
@@ -1442,7 +1583,7 @@ class _ {
|
|
|
1442
1583
|
);
|
|
1443
1584
|
}
|
|
1444
1585
|
sections(e) {
|
|
1445
|
-
return Array.isArray(e) ? this.sections(
|
|
1586
|
+
return Array.isArray(e) ? this.sections(Z(e)) : typeof e == "function" ? (Y("sections", () => e(new X())), new T(
|
|
1446
1587
|
this._renderingMode,
|
|
1447
1588
|
this._initialArgs,
|
|
1448
1589
|
this._initialUiState,
|
|
@@ -1450,7 +1591,7 @@ class _ {
|
|
|
1450
1591
|
this._inputsValid,
|
|
1451
1592
|
{ __renderLambda: !0, handle: "sections" },
|
|
1452
1593
|
this._title
|
|
1453
|
-
)) : new
|
|
1594
|
+
)) : new T(
|
|
1454
1595
|
this._renderingMode,
|
|
1455
1596
|
this._initialArgs,
|
|
1456
1597
|
this._initialUiState,
|
|
@@ -1462,7 +1603,7 @@ class _ {
|
|
|
1462
1603
|
}
|
|
1463
1604
|
/** Sets a rendering function to derive block title, shown for the block in the left blocks-overview panel. */
|
|
1464
1605
|
title(e) {
|
|
1465
|
-
return
|
|
1606
|
+
return Y("title", () => e(new X())), new T(
|
|
1466
1607
|
this._renderingMode,
|
|
1467
1608
|
this._initialArgs,
|
|
1468
1609
|
this._initialUiState,
|
|
@@ -1477,7 +1618,7 @@ class _ {
|
|
|
1477
1618
|
* @deprecated use {@link withArgs}
|
|
1478
1619
|
* */
|
|
1479
1620
|
initialArgs(e) {
|
|
1480
|
-
return new
|
|
1621
|
+
return new T(
|
|
1481
1622
|
this._renderingMode,
|
|
1482
1623
|
e,
|
|
1483
1624
|
this._initialUiState,
|
|
@@ -1489,7 +1630,7 @@ class _ {
|
|
|
1489
1630
|
}
|
|
1490
1631
|
/** Sets initial args for the block, this value must be specified. */
|
|
1491
1632
|
withArgs(e) {
|
|
1492
|
-
return new
|
|
1633
|
+
return new T(
|
|
1493
1634
|
this._renderingMode,
|
|
1494
1635
|
e,
|
|
1495
1636
|
this._initialUiState,
|
|
@@ -1501,7 +1642,7 @@ class _ {
|
|
|
1501
1642
|
}
|
|
1502
1643
|
/** Defines type and sets initial value for block UiState. */
|
|
1503
1644
|
withUiState(e) {
|
|
1504
|
-
return new
|
|
1645
|
+
return new T(
|
|
1505
1646
|
this._renderingMode,
|
|
1506
1647
|
this._initialArgs,
|
|
1507
1648
|
e,
|
|
@@ -1518,7 +1659,7 @@ class _ {
|
|
|
1518
1659
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1519
1660
|
const e = {
|
|
1520
1661
|
v3: {
|
|
1521
|
-
sdkVersion:
|
|
1662
|
+
sdkVersion: M,
|
|
1522
1663
|
renderingMode: this._renderingMode,
|
|
1523
1664
|
initialArgs: this._initialArgs,
|
|
1524
1665
|
initialUiState: this._initialUiState,
|
|
@@ -1528,75 +1669,75 @@ class _ {
|
|
|
1528
1669
|
outputs: this._outputs
|
|
1529
1670
|
},
|
|
1530
1671
|
// fields below are added to allow previous desktop versions read generated configs
|
|
1531
|
-
sdkVersion:
|
|
1672
|
+
sdkVersion: M,
|
|
1532
1673
|
renderingMode: this._renderingMode,
|
|
1533
1674
|
initialArgs: this._initialArgs,
|
|
1534
|
-
inputsValid:
|
|
1535
|
-
sections:
|
|
1675
|
+
inputsValid: ue(this._inputsValid),
|
|
1676
|
+
sections: ue(this._sections),
|
|
1536
1677
|
outputs: Object.fromEntries(
|
|
1537
|
-
Object.entries(this._outputs).map(([n, r]) => [n,
|
|
1678
|
+
Object.entries(this._outputs).map(([n, r]) => [n, ue(r)])
|
|
1538
1679
|
)
|
|
1539
1680
|
};
|
|
1540
|
-
return
|
|
1681
|
+
return Xe() ? _e({ sdkVersion: M }) : { config: e };
|
|
1541
1682
|
}
|
|
1542
1683
|
}
|
|
1543
|
-
function
|
|
1544
|
-
var
|
|
1684
|
+
function fn(t, e, n, r) {
|
|
1685
|
+
var u, S;
|
|
1545
1686
|
Array.isArray(r) && (r = { filters: r });
|
|
1546
|
-
const i = t.resultPool.getData().entries.map((
|
|
1547
|
-
let p =
|
|
1687
|
+
const i = t.resultPool.getData().entries.map((d) => d.obj).filter(ie).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, f) => {
|
|
1688
|
+
let p = d.toString();
|
|
1548
1689
|
if (f)
|
|
1549
|
-
for (const
|
|
1550
|
-
p +=
|
|
1690
|
+
for (const c in f)
|
|
1691
|
+
p += c, p += f[c];
|
|
1551
1692
|
return p;
|
|
1552
1693
|
}, o = /* @__PURE__ */ new Map();
|
|
1553
|
-
for (const
|
|
1554
|
-
for (const f of
|
|
1555
|
-
const p =
|
|
1556
|
-
for (const
|
|
1557
|
-
const
|
|
1558
|
-
if (G(p,
|
|
1559
|
-
const
|
|
1560
|
-
if (
|
|
1561
|
-
const
|
|
1562
|
-
o.set(
|
|
1563
|
-
id:
|
|
1694
|
+
for (const d of e)
|
|
1695
|
+
for (const f of d.spec.axesSpec) {
|
|
1696
|
+
const p = E(f);
|
|
1697
|
+
for (const c of i) {
|
|
1698
|
+
const h = c.spec.axesSpec[0], A = E(c.spec.axesSpec[0]);
|
|
1699
|
+
if (G(p, A)) {
|
|
1700
|
+
const y = Object.keys(p.domain ?? {}).length, v = Object.keys(A.domain ?? {}).length;
|
|
1701
|
+
if (y > v) {
|
|
1702
|
+
const g = s(c.id, p.domain);
|
|
1703
|
+
o.set(g, {
|
|
1704
|
+
id: g,
|
|
1564
1705
|
spec: {
|
|
1565
|
-
...
|
|
1566
|
-
axesSpec: [{ ...p, annotations:
|
|
1706
|
+
...c.spec,
|
|
1707
|
+
axesSpec: [{ ...p, annotations: h.annotations }]
|
|
1567
1708
|
},
|
|
1568
|
-
data:
|
|
1709
|
+
data: c.data
|
|
1569
1710
|
});
|
|
1570
1711
|
} else
|
|
1571
|
-
o.set(s(
|
|
1712
|
+
o.set(s(c.id), c);
|
|
1572
1713
|
}
|
|
1573
1714
|
}
|
|
1574
1715
|
}
|
|
1575
1716
|
if ([...e, ...o.values()].some(
|
|
1576
|
-
(
|
|
1717
|
+
(d) => d.data instanceof _ && !d.data.getIsReadyOrError()
|
|
1577
1718
|
))
|
|
1578
1719
|
return;
|
|
1579
1720
|
let a = e;
|
|
1580
|
-
const
|
|
1721
|
+
const l = [];
|
|
1581
1722
|
if (r != null && r.coreColumnPredicate) {
|
|
1582
1723
|
a = [];
|
|
1583
|
-
for (const
|
|
1584
|
-
r.coreColumnPredicate(
|
|
1724
|
+
for (const d of e)
|
|
1725
|
+
r.coreColumnPredicate(d.spec) ? a.push(d) : l.push(d);
|
|
1585
1726
|
}
|
|
1586
|
-
return
|
|
1727
|
+
return l.push(...o.values()), t.createPTable({
|
|
1587
1728
|
src: {
|
|
1588
1729
|
type: "outer",
|
|
1589
1730
|
primary: {
|
|
1590
1731
|
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
1591
|
-
entries: a.map((
|
|
1732
|
+
entries: a.map((d) => ({ type: "column", column: d }))
|
|
1592
1733
|
},
|
|
1593
|
-
secondary:
|
|
1734
|
+
secondary: l.map((d) => ({ type: "column", column: d }))
|
|
1594
1735
|
},
|
|
1595
|
-
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((
|
|
1596
|
-
sorting: ((
|
|
1736
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
1737
|
+
sorting: ((S = n == null ? void 0 : n.pTableParams) == null ? void 0 : S.sorting) ?? []
|
|
1597
1738
|
});
|
|
1598
1739
|
}
|
|
1599
|
-
function
|
|
1740
|
+
function hn(t, e, n) {
|
|
1600
1741
|
const r = t.resultPool.findLabels(e);
|
|
1601
1742
|
return {
|
|
1602
1743
|
axis: e,
|
|
@@ -1607,7 +1748,7 @@ function Ht(t, e, n) {
|
|
|
1607
1748
|
defaultValue: n[0]
|
|
1608
1749
|
};
|
|
1609
1750
|
}
|
|
1610
|
-
const
|
|
1751
|
+
const At = (t, e) => {
|
|
1611
1752
|
let n = t.toString();
|
|
1612
1753
|
return e == null || e.forEach((r) => {
|
|
1613
1754
|
if (r)
|
|
@@ -1615,7 +1756,7 @@ const nt = (t, e) => {
|
|
|
1615
1756
|
n += i, n += s;
|
|
1616
1757
|
}), n;
|
|
1617
1758
|
};
|
|
1618
|
-
function
|
|
1759
|
+
function St(t) {
|
|
1619
1760
|
if (!t.length)
|
|
1620
1761
|
return [];
|
|
1621
1762
|
let e = [[]];
|
|
@@ -1626,87 +1767,87 @@ function rt(t) {
|
|
|
1626
1767
|
}), e = r;
|
|
1627
1768
|
}), e;
|
|
1628
1769
|
}
|
|
1629
|
-
function
|
|
1630
|
-
const n = t.spec.axesSpec.map(
|
|
1631
|
-
return e.spec.axesSpec.map(
|
|
1770
|
+
function xt(t, e) {
|
|
1771
|
+
const n = t.spec.axesSpec.map(E);
|
|
1772
|
+
return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i) && G(i, s)));
|
|
1632
1773
|
}
|
|
1633
|
-
function
|
|
1634
|
-
const n = t.spec.axesSpec.map(
|
|
1635
|
-
return e.spec.axesSpec.map(
|
|
1774
|
+
function ke(t, e) {
|
|
1775
|
+
const n = t.spec.axesSpec.map(E);
|
|
1776
|
+
return e.spec.axesSpec.map(E).every((i) => n.some((s) => G(s, i)));
|
|
1636
1777
|
}
|
|
1637
|
-
const
|
|
1638
|
-
function
|
|
1639
|
-
const n = t.spec.axesSpec.map(
|
|
1640
|
-
if (
|
|
1778
|
+
const Pt = "pl7.app/graph/isVirtual", Ae = "pl7.app/label";
|
|
1779
|
+
function Se(t, e) {
|
|
1780
|
+
const n = t.spec.axesSpec.map(E), r = e.spec.axesSpec.map(E);
|
|
1781
|
+
if (xt(t, e))
|
|
1641
1782
|
return [];
|
|
1642
|
-
if (!
|
|
1783
|
+
if (!ke(t, e))
|
|
1643
1784
|
return [];
|
|
1644
|
-
const o = r.map((
|
|
1785
|
+
const o = r.map((d) => n.filter((f) => G(f, d))), a = St(o), l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), S = a.map((d) => {
|
|
1645
1786
|
const f = /* @__PURE__ */ new Set();
|
|
1646
|
-
return
|
|
1647
|
-
const
|
|
1648
|
-
return Object.entries(
|
|
1649
|
-
if ((
|
|
1650
|
-
const
|
|
1651
|
-
f.add(
|
|
1787
|
+
return d.map((p, c) => {
|
|
1788
|
+
const h = e.spec.axesSpec[c].domain, A = p.domain;
|
|
1789
|
+
return Object.entries(A ?? {}).forEach(([y, v]) => {
|
|
1790
|
+
if ((h == null ? void 0 : h[y]) === void 0) {
|
|
1791
|
+
const g = JSON.stringify([y, v]);
|
|
1792
|
+
f.add(g), l.add(g);
|
|
1652
1793
|
}
|
|
1653
1794
|
}), {
|
|
1654
1795
|
...p,
|
|
1655
|
-
annotations: e.spec.axesSpec[
|
|
1796
|
+
annotations: e.spec.axesSpec[c].annotations
|
|
1656
1797
|
};
|
|
1657
1798
|
}), f;
|
|
1658
1799
|
});
|
|
1659
|
-
return [...
|
|
1660
|
-
|
|
1661
|
-
}), a.map((
|
|
1662
|
-
var
|
|
1663
|
-
const p =
|
|
1664
|
-
var
|
|
1665
|
-
return (
|
|
1666
|
-
}).join(" / "),
|
|
1800
|
+
return [...l].forEach((d) => {
|
|
1801
|
+
S.some((f) => !f.has(d)) && u.add(d);
|
|
1802
|
+
}), a.map((d, f) => {
|
|
1803
|
+
var y;
|
|
1804
|
+
const p = At(e.id, d.map((v) => v.domain)), c = ((y = e.spec.annotations) == null ? void 0 : y[Ae]) ?? "", h = [...S[f]].filter((v) => u.has(v)).sort().map((v) => {
|
|
1805
|
+
var g;
|
|
1806
|
+
return (g = JSON.parse(v)) == null ? void 0 : g[1];
|
|
1807
|
+
}).join(" / "), A = {
|
|
1667
1808
|
...e.spec.annotations,
|
|
1668
|
-
[
|
|
1809
|
+
[Pt]: "true"
|
|
1669
1810
|
};
|
|
1670
|
-
return (
|
|
1811
|
+
return (c || h) && (A[Ae] = c && h ? c + " / " + h : c + h), {
|
|
1671
1812
|
id: p,
|
|
1672
1813
|
spec: {
|
|
1673
1814
|
...e.spec,
|
|
1674
|
-
axesSpec:
|
|
1675
|
-
...
|
|
1676
|
-
annotations: e.spec.axesSpec[
|
|
1815
|
+
axesSpec: d.map((v, g) => ({
|
|
1816
|
+
...v,
|
|
1817
|
+
annotations: e.spec.axesSpec[g].annotations
|
|
1677
1818
|
})),
|
|
1678
|
-
annotations:
|
|
1819
|
+
annotations: A
|
|
1679
1820
|
},
|
|
1680
1821
|
data: e.data
|
|
1681
1822
|
};
|
|
1682
1823
|
});
|
|
1683
1824
|
}
|
|
1684
|
-
function
|
|
1825
|
+
function Ct(t) {
|
|
1685
1826
|
const e = [];
|
|
1686
1827
|
for (let n = 0; n < t.length; n++)
|
|
1687
1828
|
for (let r = n + 1; r < t.length; r++) {
|
|
1688
1829
|
const i = t[n], s = t[r];
|
|
1689
1830
|
e.push(
|
|
1690
|
-
...
|
|
1691
|
-
...
|
|
1831
|
+
...Se(i, s),
|
|
1832
|
+
...Se(s, i)
|
|
1692
1833
|
);
|
|
1693
1834
|
}
|
|
1694
1835
|
return e;
|
|
1695
1836
|
}
|
|
1696
|
-
function
|
|
1837
|
+
function _t(t, e) {
|
|
1697
1838
|
const n = [...t];
|
|
1698
1839
|
for (const r of e)
|
|
1699
1840
|
for (const i of t) {
|
|
1700
1841
|
if (i.id === r.id)
|
|
1701
1842
|
break;
|
|
1702
|
-
if (
|
|
1843
|
+
if (ke(i, r)) {
|
|
1703
1844
|
n.push(r);
|
|
1704
1845
|
break;
|
|
1705
1846
|
}
|
|
1706
1847
|
}
|
|
1707
1848
|
return n;
|
|
1708
1849
|
}
|
|
1709
|
-
const
|
|
1850
|
+
const It = [
|
|
1710
1851
|
"Int",
|
|
1711
1852
|
"Long",
|
|
1712
1853
|
"Float",
|
|
@@ -1714,15 +1855,15 @@ const lt = [
|
|
|
1714
1855
|
"String",
|
|
1715
1856
|
"Bytes"
|
|
1716
1857
|
];
|
|
1717
|
-
function
|
|
1858
|
+
function gn(t, e) {
|
|
1718
1859
|
if (e === void 0) return;
|
|
1719
|
-
const n = t.resultPool.getData().entries.map((s) => s.obj).filter(
|
|
1860
|
+
const n = t.resultPool.getData().entries.map((s) => s.obj).filter(ie).filter((s) => It.includes(s.spec.valueType)), r = _t(e, n), i = [...r, ...Ct(r)];
|
|
1720
1861
|
if (!i.some(
|
|
1721
|
-
(s) => s.data instanceof
|
|
1862
|
+
(s) => s.data instanceof _ && !s.data.getIsReadyOrError()
|
|
1722
1863
|
))
|
|
1723
1864
|
return t.createPFrame(i);
|
|
1724
1865
|
}
|
|
1725
|
-
class
|
|
1866
|
+
class mn {
|
|
1726
1867
|
constructor(e) {
|
|
1727
1868
|
this.handle = e;
|
|
1728
1869
|
}
|
|
@@ -1742,111 +1883,113 @@ class zt {
|
|
|
1742
1883
|
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1743
1884
|
}
|
|
1744
1885
|
}
|
|
1745
|
-
function
|
|
1746
|
-
return
|
|
1886
|
+
function Lt(t) {
|
|
1887
|
+
return Ce({
|
|
1747
1888
|
__isRef: !0,
|
|
1748
|
-
blockId:
|
|
1749
|
-
name:
|
|
1889
|
+
blockId: ee(t, "blockId"),
|
|
1890
|
+
name: ee(t, "name")
|
|
1750
1891
|
});
|
|
1751
1892
|
}
|
|
1752
|
-
function
|
|
1753
|
-
return
|
|
1754
|
-
ref:
|
|
1755
|
-
label:
|
|
1893
|
+
function yn(t) {
|
|
1894
|
+
return Ce({
|
|
1895
|
+
ref: Lt(ee(t, "ref")),
|
|
1896
|
+
label: ee(t, "label")
|
|
1756
1897
|
});
|
|
1757
1898
|
}
|
|
1758
|
-
const
|
|
1759
|
-
sdkVersion:
|
|
1899
|
+
const vn = {
|
|
1900
|
+
sdkVersion: M
|
|
1760
1901
|
};
|
|
1761
|
-
function
|
|
1762
|
-
return
|
|
1902
|
+
function Tt() {
|
|
1903
|
+
return _e({ sdkVersion: M });
|
|
1763
1904
|
}
|
|
1764
|
-
function
|
|
1905
|
+
function bn(t) {
|
|
1765
1906
|
try {
|
|
1766
|
-
return
|
|
1907
|
+
return Tt();
|
|
1767
1908
|
} catch {
|
|
1768
1909
|
return t;
|
|
1769
1910
|
}
|
|
1770
1911
|
}
|
|
1771
|
-
function
|
|
1912
|
+
function wn(t) {
|
|
1772
1913
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1773
1914
|
return globalThis.getEnvironmentValue(t);
|
|
1774
1915
|
}
|
|
1775
1916
|
export {
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1917
|
+
jt as Args,
|
|
1918
|
+
T as BlockModel,
|
|
1919
|
+
vn as CurrentSdkInfo,
|
|
1920
|
+
C as FutureRef,
|
|
1921
|
+
Pt as IS_VIRTUAL_COLUMN,
|
|
1922
|
+
Kt as It,
|
|
1923
|
+
cn as JsRenderInternal,
|
|
1924
|
+
Ae as LABEL_ANNOTATION,
|
|
1925
|
+
Vt as MainOutputs,
|
|
1926
|
+
ze as OutputError,
|
|
1927
|
+
nt as PAnnotationLabel,
|
|
1928
|
+
rt as PAnnotationTrace,
|
|
1929
|
+
be as PColumnCollection,
|
|
1930
|
+
mn as PFrameImpl,
|
|
1931
|
+
V as RT_BINARY_PARTITIONED,
|
|
1790
1932
|
B as RT_BINARY_SUPER_PARTITIONED,
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1933
|
+
U as RT_JSON_PARTITIONED,
|
|
1934
|
+
re as RT_JSON_SUPER_PARTITIONED,
|
|
1935
|
+
te as RT_RESOURCE_MAP,
|
|
1936
|
+
ne as RT_RESOURCE_MAP_PARTITIONED,
|
|
1937
|
+
X as RenderCtx,
|
|
1938
|
+
bt as ResultPool,
|
|
1939
|
+
$t as StagingOutputs,
|
|
1940
|
+
st as Trace,
|
|
1941
|
+
it as TraceEntry,
|
|
1942
|
+
_ as TreeNodeAccessor,
|
|
1943
|
+
Jt as UiState,
|
|
1944
|
+
Ht as and,
|
|
1945
|
+
pt as convertOrParsePColumnData,
|
|
1946
|
+
gn as createPFrameForGraphs,
|
|
1947
|
+
fn as createPlDataTable,
|
|
1948
|
+
hn as createPlDataTableSheet,
|
|
1949
|
+
Ee as deriveLabels,
|
|
1950
|
+
ue as downgradeCfgOrLambda,
|
|
1951
|
+
_t as enrichColumnsWithCompatible,
|
|
1952
|
+
rn as extractArchiveAndGetURL,
|
|
1953
|
+
dn as extractConfig,
|
|
1954
|
+
dt as filterDataInfoEntries,
|
|
1955
|
+
Mt as flatten,
|
|
1956
|
+
yn as fromPlOption,
|
|
1957
|
+
Lt as fromPlRef,
|
|
1958
|
+
Ct as getAdditionalColumns,
|
|
1959
|
+
Qt as getBlobContent,
|
|
1960
|
+
en as getBlobContentAsJson,
|
|
1961
|
+
Zt as getBlobContentAsString,
|
|
1962
|
+
tn as getDownloadedBlobContent,
|
|
1963
|
+
wn as getEnvironmentValue,
|
|
1821
1964
|
W as getFromCfg,
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1965
|
+
Z as getImmediate,
|
|
1966
|
+
sn as getImportProgress,
|
|
1967
|
+
ee as getJsonField,
|
|
1968
|
+
on as getLastLogs,
|
|
1969
|
+
un as getLogHandle,
|
|
1970
|
+
nn as getOnDemandBlobContent,
|
|
1971
|
+
lt as getPartitionKeysList,
|
|
1972
|
+
bn as getPlatformaOrDefault,
|
|
1973
|
+
an as getProgressLog,
|
|
1974
|
+
ln as getProgressLogWithInfo,
|
|
1975
|
+
Tt as getRawPlatformaInstance,
|
|
1976
|
+
zt as getResourceField,
|
|
1977
|
+
Yt as getResourceValueAsJson,
|
|
1978
|
+
ct as getUniquePartitionKeys,
|
|
1979
|
+
pe as ifDef,
|
|
1980
|
+
wt as isConfigLambda,
|
|
1981
|
+
Gt as isEmpty,
|
|
1982
|
+
Ot as isolate,
|
|
1983
|
+
Nt as makeArray,
|
|
1984
|
+
Ce as makeObject,
|
|
1985
|
+
Bt as mapArrayValues,
|
|
1986
|
+
Ut as mapRecordValues,
|
|
1987
|
+
Xt as mapResourceFields,
|
|
1988
|
+
Wt as not,
|
|
1989
|
+
qt as or,
|
|
1990
|
+
he as parsePColumnData,
|
|
1991
|
+
pn as parseResourceMap,
|
|
1992
|
+
Ye as readOutput,
|
|
1993
|
+
Rt as wrapOutputs
|
|
1851
1994
|
};
|
|
1852
1995
|
//# sourceMappingURL=index.mjs.map
|