@milaboratories/graph-maker 1.1.134 → 1.1.136
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 +1342 -1164
- package/dist/node_modules/@milaboratories/pf-plots/dist/index.js.map +1 -1
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js +324 -265
- package/dist/node_modules/@milaboratories/pl-model-common/dist/index.js.map +1 -1
- package/dist/node_modules/@platforma-sdk/model/dist/index.js +290 -280
- package/dist/node_modules/@platforma-sdk/model/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,226 +1,272 @@
|
|
|
1
1
|
import u from "../../../zod/lib/index.js";
|
|
2
|
-
import
|
|
3
|
-
var
|
|
2
|
+
import l from "../../../canonicalize/lib/canonicalize.js";
|
|
3
|
+
var A = Object.defineProperty, k = (e, t, r) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, m = (e, t, r) => k(e, typeof t != "symbol" ? t + "" : t, r);
|
|
4
4
|
u.object({
|
|
5
5
|
/** Included left border. */
|
|
6
6
|
from: u.number(),
|
|
7
7
|
/** Excluded right border. */
|
|
8
8
|
to: u.number()
|
|
9
9
|
});
|
|
10
|
-
function
|
|
11
|
-
throw new Error("Unexpected object: " +
|
|
10
|
+
function P(e) {
|
|
11
|
+
throw new Error("Unexpected object: " + e);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
13
|
+
function F(e) {
|
|
14
|
+
if (!e || typeof e != "object")
|
|
15
15
|
return !1;
|
|
16
|
-
const
|
|
17
|
-
if (!("type" in
|
|
16
|
+
const t = e;
|
|
17
|
+
if (!("type" in t))
|
|
18
18
|
return !1;
|
|
19
|
-
switch (
|
|
19
|
+
switch (t.type) {
|
|
20
20
|
case "Json":
|
|
21
|
-
return typeof
|
|
21
|
+
return typeof t.keyLength == "number" && t.data !== void 0 && typeof t.data == "object";
|
|
22
22
|
case "JsonPartitioned":
|
|
23
|
-
return typeof
|
|
23
|
+
return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
|
|
24
24
|
case "BinaryPartitioned":
|
|
25
|
-
return typeof
|
|
25
|
+
return typeof t.partitionKeyLength == "number" && t.parts !== void 0 && typeof t.parts == "object";
|
|
26
26
|
default:
|
|
27
27
|
return !1;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
if (
|
|
32
|
-
switch (
|
|
30
|
+
function z(e, t) {
|
|
31
|
+
if (e !== void 0)
|
|
32
|
+
switch (e.type) {
|
|
33
33
|
case "Json":
|
|
34
|
-
return
|
|
34
|
+
return e;
|
|
35
35
|
case "JsonPartitioned": {
|
|
36
|
-
const
|
|
37
|
-
for (const [
|
|
38
|
-
n
|
|
36
|
+
const r = {};
|
|
37
|
+
for (const [n, o] of Object.entries(e.parts))
|
|
38
|
+
r[n] = t(o);
|
|
39
39
|
return {
|
|
40
|
-
...
|
|
41
|
-
parts:
|
|
40
|
+
...e,
|
|
41
|
+
parts: r
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
case "BinaryPartitioned": {
|
|
45
|
-
const
|
|
46
|
-
for (const [
|
|
47
|
-
n
|
|
48
|
-
index:
|
|
49
|
-
values:
|
|
45
|
+
const r = {};
|
|
46
|
+
for (const [n, o] of Object.entries(e.parts))
|
|
47
|
+
r[n] = {
|
|
48
|
+
index: t(o.index),
|
|
49
|
+
values: t(o.values)
|
|
50
50
|
};
|
|
51
51
|
return {
|
|
52
|
-
...
|
|
53
|
-
parts:
|
|
52
|
+
...e,
|
|
53
|
+
parts: r
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
if (!
|
|
58
|
+
function S(e) {
|
|
59
|
+
if (!e || typeof e != "object")
|
|
60
60
|
return !1;
|
|
61
|
-
const
|
|
62
|
-
if (!("type" in
|
|
61
|
+
const t = e;
|
|
62
|
+
if (!("type" in t))
|
|
63
63
|
return !1;
|
|
64
|
-
switch (
|
|
64
|
+
switch (t.type) {
|
|
65
65
|
case "Json":
|
|
66
|
-
return typeof
|
|
66
|
+
return typeof t.keyLength == "number" && Array.isArray(t.data);
|
|
67
67
|
case "JsonPartitioned":
|
|
68
|
-
return typeof
|
|
68
|
+
return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
|
|
69
69
|
case "BinaryPartitioned":
|
|
70
|
-
return typeof
|
|
70
|
+
return typeof t.partitionKeyLength == "number" && Array.isArray(t.parts);
|
|
71
71
|
default:
|
|
72
72
|
return !1;
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
75
|
+
function q(e) {
|
|
76
|
+
return S(e) ? e.type === "JsonPartitioned" || e.type === "BinaryPartitioned" : !1;
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
switch (
|
|
78
|
+
function U(e) {
|
|
79
|
+
switch (e.type) {
|
|
80
80
|
case "Json": {
|
|
81
|
-
const
|
|
81
|
+
const t = Object.entries(e.data).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
82
82
|
return {
|
|
83
83
|
type: "Json",
|
|
84
|
-
keyLength:
|
|
85
|
-
data:
|
|
84
|
+
keyLength: e.keyLength,
|
|
85
|
+
data: t
|
|
86
86
|
};
|
|
87
87
|
}
|
|
88
88
|
case "JsonPartitioned": {
|
|
89
|
-
const
|
|
89
|
+
const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
90
90
|
return {
|
|
91
91
|
type: "JsonPartitioned",
|
|
92
|
-
partitionKeyLength:
|
|
93
|
-
parts:
|
|
92
|
+
partitionKeyLength: e.partitionKeyLength,
|
|
93
|
+
parts: t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
case "BinaryPartitioned": {
|
|
97
|
-
const
|
|
97
|
+
const t = Object.entries(e.parts).map(([r, n]) => ({ key: JSON.parse(r), value: n }));
|
|
98
98
|
return {
|
|
99
99
|
type: "BinaryPartitioned",
|
|
100
|
-
partitionKeyLength:
|
|
101
|
-
parts:
|
|
100
|
+
partitionKeyLength: e.partitionKeyLength,
|
|
101
|
+
parts: t
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
switch (
|
|
106
|
+
function G(e) {
|
|
107
|
+
switch (e.type) {
|
|
108
108
|
case "Json": {
|
|
109
|
-
const
|
|
110
|
-
for (const
|
|
111
|
-
|
|
109
|
+
const t = {};
|
|
110
|
+
for (const r of e.data)
|
|
111
|
+
t[JSON.stringify(r.key)] = r.value;
|
|
112
112
|
return {
|
|
113
113
|
type: "Json",
|
|
114
|
-
keyLength:
|
|
115
|
-
data:
|
|
114
|
+
keyLength: e.keyLength,
|
|
115
|
+
data: t
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
case "JsonPartitioned": {
|
|
119
|
-
const
|
|
120
|
-
for (const
|
|
121
|
-
|
|
119
|
+
const t = {};
|
|
120
|
+
for (const r of e.parts)
|
|
121
|
+
t[JSON.stringify(r.key)] = r.value;
|
|
122
122
|
return {
|
|
123
123
|
type: "JsonPartitioned",
|
|
124
|
-
partitionKeyLength:
|
|
125
|
-
parts:
|
|
124
|
+
partitionKeyLength: e.partitionKeyLength,
|
|
125
|
+
parts: t
|
|
126
126
|
};
|
|
127
127
|
}
|
|
128
128
|
case "BinaryPartitioned": {
|
|
129
|
-
const
|
|
130
|
-
for (const
|
|
131
|
-
|
|
129
|
+
const t = {};
|
|
130
|
+
for (const r of e.parts)
|
|
131
|
+
t[JSON.stringify(r.key)] = r.value;
|
|
132
132
|
return {
|
|
133
133
|
type: "BinaryPartitioned",
|
|
134
|
-
partitionKeyLength:
|
|
135
|
-
parts:
|
|
134
|
+
partitionKeyLength: e.partitionKeyLength,
|
|
135
|
+
parts: t
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
const E = -2147483648, b = -9007199254740991n, j = null, N = null;
|
|
141
|
+
function O(e, t) {
|
|
142
|
+
switch (t) {
|
|
143
|
+
case "Int":
|
|
144
|
+
return e === E;
|
|
145
|
+
case "Long":
|
|
146
|
+
return e === Number(b) || e === b;
|
|
147
|
+
case "Float":
|
|
148
|
+
return Number.isNaN(e);
|
|
149
|
+
case "Double":
|
|
150
|
+
return Number.isNaN(e);
|
|
151
|
+
case "String":
|
|
152
|
+
return e === j;
|
|
153
|
+
case "Bytes":
|
|
154
|
+
return e === N;
|
|
155
|
+
default:
|
|
156
|
+
throw Error(`unsupported data type: ${t}`);
|
|
157
|
+
}
|
|
143
158
|
}
|
|
144
|
-
function
|
|
145
|
-
|
|
159
|
+
function I(e, t) {
|
|
160
|
+
const r = Math.floor(t / 8), n = 1 << 7 - t % 8;
|
|
161
|
+
return (e[r] & n) > 0;
|
|
162
|
+
}
|
|
163
|
+
const J = { type: "absent" }, L = null;
|
|
164
|
+
function Q(e, t, r = {}) {
|
|
165
|
+
if (I(e.absent, t))
|
|
166
|
+
return r.absent === void 0 ? J : r.absent;
|
|
167
|
+
const n = e.data[t], o = e.type;
|
|
168
|
+
if (O(n, o)) return r.na === void 0 ? L : r.na;
|
|
169
|
+
switch (o) {
|
|
170
|
+
case "Int":
|
|
171
|
+
return n;
|
|
172
|
+
case "Long":
|
|
173
|
+
return Number(n);
|
|
174
|
+
case "Float":
|
|
175
|
+
return n;
|
|
176
|
+
case "Double":
|
|
177
|
+
return n;
|
|
178
|
+
case "String":
|
|
179
|
+
return n;
|
|
180
|
+
case "Bytes":
|
|
181
|
+
throw Error("Bytes not yet supported");
|
|
182
|
+
default:
|
|
183
|
+
throw Error(`unsupported data type: ${o}`);
|
|
184
|
+
}
|
|
146
185
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
186
|
+
function d(e) {
|
|
187
|
+
const { type: t, name: r, domain: n } = e, o = { type: t, name: r };
|
|
188
|
+
return n && Object.entries(n).length > 0 && Object.assign(o, { domain: n }), o;
|
|
149
189
|
}
|
|
150
|
-
function
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
190
|
+
function $(e) {
|
|
191
|
+
return e.map(d);
|
|
192
|
+
}
|
|
193
|
+
function X(e) {
|
|
194
|
+
return l(d(e));
|
|
195
|
+
}
|
|
196
|
+
function C(e, t) {
|
|
197
|
+
if (e === void 0) return t === void 0;
|
|
198
|
+
if (t === void 0) return !0;
|
|
199
|
+
for (const r in t)
|
|
200
|
+
if (e[r] !== t[r]) return !1;
|
|
155
201
|
return !0;
|
|
156
202
|
}
|
|
157
|
-
function
|
|
158
|
-
return
|
|
203
|
+
function T(e, t) {
|
|
204
|
+
return e.name === t.name && C(e.domain, t.domain);
|
|
159
205
|
}
|
|
160
|
-
function
|
|
161
|
-
return { ...
|
|
206
|
+
function Y(e, t) {
|
|
207
|
+
return { ...e, src: h(e.src, t) };
|
|
162
208
|
}
|
|
163
|
-
function
|
|
164
|
-
switch (
|
|
209
|
+
function h(e, t) {
|
|
210
|
+
switch (e.type) {
|
|
165
211
|
case "column":
|
|
166
212
|
return {
|
|
167
213
|
type: "column",
|
|
168
|
-
column: e
|
|
214
|
+
column: t(e.column)
|
|
169
215
|
};
|
|
170
216
|
case "slicedColumn":
|
|
171
217
|
return {
|
|
172
218
|
type: "slicedColumn",
|
|
173
|
-
column: e
|
|
174
|
-
newId:
|
|
175
|
-
axisFilters:
|
|
219
|
+
column: t(e.column),
|
|
220
|
+
newId: e.newId,
|
|
221
|
+
axisFilters: e.axisFilters
|
|
176
222
|
};
|
|
177
223
|
case "inlineColumn":
|
|
178
|
-
return
|
|
224
|
+
return e;
|
|
179
225
|
case "inner":
|
|
180
226
|
case "full":
|
|
181
227
|
return {
|
|
182
|
-
type:
|
|
183
|
-
entries:
|
|
228
|
+
type: e.type,
|
|
229
|
+
entries: e.entries.map((r) => h(r, t))
|
|
184
230
|
};
|
|
185
231
|
case "outer":
|
|
186
232
|
return {
|
|
187
233
|
type: "outer",
|
|
188
|
-
primary:
|
|
189
|
-
secondary:
|
|
234
|
+
primary: h(e.primary, t),
|
|
235
|
+
secondary: e.secondary.map((r) => h(r, t))
|
|
190
236
|
};
|
|
191
237
|
default:
|
|
192
|
-
|
|
238
|
+
P(e);
|
|
193
239
|
}
|
|
194
240
|
}
|
|
195
|
-
function
|
|
196
|
-
return
|
|
241
|
+
function B(e) {
|
|
242
|
+
return l(e);
|
|
197
243
|
}
|
|
198
|
-
function g(
|
|
199
|
-
return
|
|
244
|
+
function g(e) {
|
|
245
|
+
return l(d(e));
|
|
200
246
|
}
|
|
201
|
-
function
|
|
202
|
-
return JSON.stringify([
|
|
247
|
+
function x(e, t) {
|
|
248
|
+
return JSON.stringify([e, t]);
|
|
203
249
|
}
|
|
204
|
-
class
|
|
250
|
+
class Z {
|
|
205
251
|
/**
|
|
206
252
|
* Creates a new anchor context from a set of anchor column specifications
|
|
207
253
|
* @param anchors Record of anchor column specifications indexed by anchor ID
|
|
208
254
|
*/
|
|
209
|
-
constructor(
|
|
210
|
-
m(this, "domains", /* @__PURE__ */ new Map()), m(this, "axes", /* @__PURE__ */ new Map()), m(this, "domainPacks", []), m(this, "domainPackToAnchor", /* @__PURE__ */ new Map()), this.anchors =
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
for (const [
|
|
255
|
+
constructor(t) {
|
|
256
|
+
m(this, "domains", /* @__PURE__ */ new Map()), m(this, "axes", /* @__PURE__ */ new Map()), m(this, "domainPacks", []), m(this, "domainPackToAnchor", /* @__PURE__ */ new Map()), this.anchors = t;
|
|
257
|
+
const r = Object.entries(t);
|
|
258
|
+
r.sort((n, o) => n[0].localeCompare(o[0]));
|
|
259
|
+
for (const [n, o] of r) {
|
|
214
260
|
for (let i = 0; i < o.axesSpec.length; i++) {
|
|
215
261
|
const a = o.axesSpec[i], s = g(a);
|
|
216
|
-
this.axes.set(s, { anchor:
|
|
262
|
+
this.axes.set(s, { anchor: n, idx: i });
|
|
217
263
|
}
|
|
218
264
|
if (o.domain !== void 0) {
|
|
219
265
|
const i = Object.entries(o.domain);
|
|
220
|
-
i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i),
|
|
266
|
+
i.sort((a, s) => a[0].localeCompare(s[0])), this.domainPackToAnchor.set(JSON.stringify(i), n), this.domainPacks.push(i.map(([a]) => a));
|
|
221
267
|
for (const [a, s] of i) {
|
|
222
|
-
const c =
|
|
223
|
-
this.domains.set(c,
|
|
268
|
+
const c = x(a, s);
|
|
269
|
+
this.domains.set(c, n);
|
|
224
270
|
}
|
|
225
271
|
}
|
|
226
272
|
}
|
|
@@ -228,56 +274,56 @@ class q {
|
|
|
228
274
|
/**
|
|
229
275
|
* Implementation of derive method
|
|
230
276
|
*/
|
|
231
|
-
derive(
|
|
232
|
-
const
|
|
233
|
-
name:
|
|
277
|
+
derive(t, r) {
|
|
278
|
+
const n = {
|
|
279
|
+
name: t.name,
|
|
234
280
|
axes: []
|
|
235
281
|
};
|
|
236
282
|
let o;
|
|
237
|
-
if (
|
|
283
|
+
if (t.domain !== void 0)
|
|
238
284
|
e:
|
|
239
285
|
for (const a of this.domainPacks) {
|
|
240
286
|
const s = [];
|
|
241
287
|
for (const f of a) {
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
-
s.push([f,
|
|
288
|
+
const p = t.domain[f];
|
|
289
|
+
if (p !== void 0)
|
|
290
|
+
s.push([f, p]);
|
|
245
291
|
else
|
|
246
292
|
break e;
|
|
247
293
|
}
|
|
248
294
|
const c = this.domainPackToAnchor.get(JSON.stringify(s));
|
|
249
295
|
if (c !== void 0) {
|
|
250
|
-
|
|
296
|
+
n.domainAnchor = c, o = new Set(a);
|
|
251
297
|
break;
|
|
252
298
|
}
|
|
253
299
|
}
|
|
254
|
-
for (const [a, s] of Object.entries(
|
|
300
|
+
for (const [a, s] of Object.entries(t.domain ?? {})) {
|
|
255
301
|
if (o !== void 0 && o.has(a))
|
|
256
302
|
continue;
|
|
257
|
-
const c =
|
|
258
|
-
|
|
303
|
+
const c = x(a, s), f = this.domains.get(c);
|
|
304
|
+
n.domain ?? (n.domain = {}), n.domain[a] = f ? { anchor: f } : s;
|
|
259
305
|
}
|
|
260
|
-
if (
|
|
306
|
+
if (n.axes = t.axesSpec.map((a) => {
|
|
261
307
|
const s = g(a), c = this.axes.get(s);
|
|
262
308
|
return c === void 0 ? d(a) : c;
|
|
263
|
-
}), !
|
|
264
|
-
return
|
|
309
|
+
}), !r || r.length === 0)
|
|
310
|
+
return n;
|
|
265
311
|
const i = [];
|
|
266
|
-
for (const a of
|
|
312
|
+
for (const a of r) {
|
|
267
313
|
const [s, c] = a;
|
|
268
314
|
if (typeof s == "number") {
|
|
269
|
-
if (s < 0 || s >=
|
|
270
|
-
throw new Error(`Axis index ${s} is out of bounds (0-${
|
|
315
|
+
if (s < 0 || s >= t.axesSpec.length)
|
|
316
|
+
throw new Error(`Axis index ${s} is out of bounds (0-${t.axesSpec.length - 1})`);
|
|
271
317
|
i.push([s, c]);
|
|
272
318
|
} else {
|
|
273
|
-
const f =
|
|
319
|
+
const f = t.axesSpec.findIndex((p) => p.name === s);
|
|
274
320
|
if (f === -1)
|
|
275
321
|
throw new Error(`Axis with name "${s}" not found in the column specification`);
|
|
276
322
|
i.push([f, c]);
|
|
277
323
|
}
|
|
278
324
|
}
|
|
279
325
|
return i.sort((a, s) => a[0] - s[0]), {
|
|
280
|
-
source:
|
|
326
|
+
source: n,
|
|
281
327
|
axisFilters: i
|
|
282
328
|
};
|
|
283
329
|
}
|
|
@@ -287,26 +333,26 @@ class q {
|
|
|
287
333
|
* @param axisFilters Optional axis filters to apply to the column
|
|
288
334
|
* @returns A canonicalized string representation of the anchored column identifier
|
|
289
335
|
*/
|
|
290
|
-
deriveS(
|
|
291
|
-
return
|
|
336
|
+
deriveS(t, r) {
|
|
337
|
+
return B(this.derive(t, r));
|
|
292
338
|
}
|
|
293
339
|
}
|
|
294
|
-
function
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
const i =
|
|
340
|
+
function H(e, t, r) {
|
|
341
|
+
const n = { ...t }, o = (r == null ? void 0 : r.ignoreMissingDomains) ?? !1;
|
|
342
|
+
if (n.domainAnchor !== void 0) {
|
|
343
|
+
const i = e[n.domainAnchor];
|
|
298
344
|
if (!i)
|
|
299
|
-
throw new Error(`Anchor "${
|
|
345
|
+
throw new Error(`Anchor "${n.domainAnchor}" not found`);
|
|
300
346
|
const a = i.domain || {};
|
|
301
|
-
|
|
347
|
+
n.domain = { ...a, ...n.domain }, delete n.domainAnchor;
|
|
302
348
|
}
|
|
303
|
-
if (
|
|
349
|
+
if (n.domain) {
|
|
304
350
|
const i = {};
|
|
305
|
-
for (const [a, s] of Object.entries(
|
|
351
|
+
for (const [a, s] of Object.entries(n.domain))
|
|
306
352
|
if (typeof s == "string")
|
|
307
353
|
i[a] = s;
|
|
308
354
|
else {
|
|
309
|
-
const c =
|
|
355
|
+
const c = e[s.anchor];
|
|
310
356
|
if (!c)
|
|
311
357
|
throw new Error(`Anchor "${s.anchor}" not found for domain key "${a}"`);
|
|
312
358
|
if (!c.domain || c.domain[a] === void 0) {
|
|
@@ -316,154 +362,154 @@ function F(t, e, n) {
|
|
|
316
362
|
}
|
|
317
363
|
i[a] = c.domain[a];
|
|
318
364
|
}
|
|
319
|
-
|
|
365
|
+
n.domain = i;
|
|
320
366
|
}
|
|
321
|
-
return
|
|
322
|
-
}
|
|
323
|
-
function
|
|
324
|
-
if (!
|
|
325
|
-
return
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
328
|
-
throw new Error(`Anchor "${
|
|
329
|
-
if ("idx" in
|
|
330
|
-
if (
|
|
331
|
-
throw new Error(`Axis index ${
|
|
332
|
-
return
|
|
333
|
-
} else if ("name" in
|
|
334
|
-
const o =
|
|
367
|
+
return n.axes && (n.axes = n.axes.map((i) => D(e, i))), n;
|
|
368
|
+
}
|
|
369
|
+
function D(e, t) {
|
|
370
|
+
if (!K(t))
|
|
371
|
+
return t;
|
|
372
|
+
const r = t.anchor, n = e[r];
|
|
373
|
+
if (!n)
|
|
374
|
+
throw new Error(`Anchor "${r}" not found for axis reference`);
|
|
375
|
+
if ("idx" in t) {
|
|
376
|
+
if (t.idx < 0 || t.idx >= n.axesSpec.length)
|
|
377
|
+
throw new Error(`Axis index ${t.idx} out of bounds for anchor "${r}"`);
|
|
378
|
+
return n.axesSpec[t.idx];
|
|
379
|
+
} else if ("name" in t) {
|
|
380
|
+
const o = n.axesSpec.filter((i) => i.name === t.name);
|
|
335
381
|
if (o.length > 1)
|
|
336
|
-
throw new Error(`Multiple axes with name "${
|
|
382
|
+
throw new Error(`Multiple axes with name "${t.name}" found in anchor "${r}"`);
|
|
337
383
|
if (o.length === 0)
|
|
338
|
-
throw new Error(`Axis with name "${
|
|
384
|
+
throw new Error(`Axis with name "${t.name}" not found in anchor "${r}"`);
|
|
339
385
|
return o[0];
|
|
340
|
-
} else if ("id" in
|
|
341
|
-
const o =
|
|
386
|
+
} else if ("id" in t) {
|
|
387
|
+
const o = n.axesSpec.filter((i) => T(t.id, d(i)));
|
|
342
388
|
if (o.length > 1)
|
|
343
|
-
throw new Error(`Multiple matching axes found for matcher in anchor "${
|
|
389
|
+
throw new Error(`Multiple matching axes found for matcher in anchor "${r}"`);
|
|
344
390
|
if (o.length === 0)
|
|
345
|
-
throw new Error(`No matching axis found for matcher in anchor "${
|
|
391
|
+
throw new Error(`No matching axis found for matcher in anchor "${r}"`);
|
|
346
392
|
return o[0];
|
|
347
393
|
}
|
|
348
394
|
throw new Error("Unsupported axis reference type");
|
|
349
395
|
}
|
|
350
|
-
function
|
|
351
|
-
return typeof
|
|
396
|
+
function K(e) {
|
|
397
|
+
return typeof e == "object" && "anchor" in e;
|
|
352
398
|
}
|
|
353
|
-
function
|
|
354
|
-
return
|
|
399
|
+
function y(e) {
|
|
400
|
+
return e.kind === "PColumn";
|
|
355
401
|
}
|
|
356
|
-
function
|
|
357
|
-
return
|
|
402
|
+
function M(e) {
|
|
403
|
+
return y(e.spec);
|
|
358
404
|
}
|
|
359
|
-
function
|
|
360
|
-
if (!
|
|
361
|
-
return
|
|
405
|
+
function W(e) {
|
|
406
|
+
if (!M(e)) throw new Error(`not a PColumn (kind = ${e.spec.kind})`);
|
|
407
|
+
return e;
|
|
362
408
|
}
|
|
363
|
-
function
|
|
364
|
-
return
|
|
365
|
-
...
|
|
366
|
-
data: e
|
|
409
|
+
function ee(e, t) {
|
|
410
|
+
return e === void 0 ? void 0 : {
|
|
411
|
+
...e,
|
|
412
|
+
data: t(e.data)
|
|
367
413
|
};
|
|
368
414
|
}
|
|
369
|
-
function
|
|
370
|
-
const
|
|
371
|
-
switch (
|
|
415
|
+
function te(e) {
|
|
416
|
+
const t = /* @__PURE__ */ new Map(), r = (n) => {
|
|
417
|
+
switch (n.type) {
|
|
372
418
|
case "column":
|
|
373
|
-
|
|
419
|
+
t.set(n.column.id, n.column);
|
|
374
420
|
return;
|
|
375
421
|
case "slicedColumn":
|
|
376
|
-
|
|
422
|
+
t.set(n.column.id, n.column);
|
|
377
423
|
return;
|
|
378
424
|
case "inlineColumn":
|
|
379
425
|
return;
|
|
380
426
|
case "full":
|
|
381
427
|
case "inner":
|
|
382
|
-
for (const o of
|
|
428
|
+
for (const o of n.entries) r(o);
|
|
383
429
|
return;
|
|
384
430
|
case "outer":
|
|
385
|
-
n
|
|
386
|
-
for (const o of
|
|
431
|
+
r(n.primary);
|
|
432
|
+
for (const o of n.secondary) r(o);
|
|
387
433
|
return;
|
|
388
434
|
default:
|
|
389
|
-
|
|
435
|
+
P(n);
|
|
390
436
|
}
|
|
391
437
|
};
|
|
392
|
-
return
|
|
438
|
+
return r(e), [...t.values()];
|
|
393
439
|
}
|
|
394
|
-
function
|
|
395
|
-
if (
|
|
440
|
+
function v(e, t) {
|
|
441
|
+
if (e.name !== void 0 && e.name !== t.name)
|
|
396
442
|
return !1;
|
|
397
|
-
if (
|
|
398
|
-
if (Array.isArray(
|
|
399
|
-
if (!
|
|
443
|
+
if (e.type !== void 0) {
|
|
444
|
+
if (Array.isArray(e.type)) {
|
|
445
|
+
if (!e.type.includes(t.type))
|
|
400
446
|
return !1;
|
|
401
|
-
} else if (
|
|
447
|
+
} else if (e.type !== t.type)
|
|
402
448
|
return !1;
|
|
403
449
|
}
|
|
404
|
-
if (
|
|
405
|
-
const
|
|
406
|
-
for (const [
|
|
407
|
-
if (n
|
|
450
|
+
if (e.domain !== void 0) {
|
|
451
|
+
const r = t.domain || {};
|
|
452
|
+
for (const [n, o] of Object.entries(e.domain))
|
|
453
|
+
if (r[n] !== o)
|
|
408
454
|
return !1;
|
|
409
455
|
}
|
|
410
456
|
return !0;
|
|
411
457
|
}
|
|
412
|
-
function
|
|
413
|
-
if (
|
|
458
|
+
function w(e, t) {
|
|
459
|
+
if (t.name !== void 0 && e.name !== t.name || t.namePattern !== void 0 && !new RegExp(t.namePattern).test(e.name))
|
|
414
460
|
return !1;
|
|
415
|
-
if (
|
|
416
|
-
if (Array.isArray(
|
|
417
|
-
if (!
|
|
461
|
+
if (t.type !== void 0) {
|
|
462
|
+
if (Array.isArray(t.type)) {
|
|
463
|
+
if (!t.type.includes(e.valueType))
|
|
418
464
|
return !1;
|
|
419
|
-
} else if (
|
|
465
|
+
} else if (t.type !== e.valueType)
|
|
420
466
|
return !1;
|
|
421
467
|
}
|
|
422
|
-
if (
|
|
423
|
-
const
|
|
424
|
-
for (const [
|
|
425
|
-
if (n
|
|
468
|
+
if (t.domain !== void 0) {
|
|
469
|
+
const r = e.domain || {};
|
|
470
|
+
for (const [n, o] of Object.entries(t.domain))
|
|
471
|
+
if (r[n] !== o)
|
|
426
472
|
return !1;
|
|
427
473
|
}
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
if (
|
|
431
|
-
for (const
|
|
432
|
-
if (!
|
|
474
|
+
if (t.axes !== void 0) {
|
|
475
|
+
const r = e.axesSpec.map(d);
|
|
476
|
+
if (t.partialAxesMatch) {
|
|
477
|
+
for (const n of t.axes)
|
|
478
|
+
if (!r.some((o) => v(n, o)))
|
|
433
479
|
return !1;
|
|
434
480
|
} else {
|
|
435
|
-
if (
|
|
481
|
+
if (r.length !== t.axes.length)
|
|
436
482
|
return !1;
|
|
437
|
-
for (let
|
|
438
|
-
if (!
|
|
483
|
+
for (let n = 0; n < t.axes.length; n++)
|
|
484
|
+
if (!v(t.axes[n], r[n]))
|
|
439
485
|
return !1;
|
|
440
486
|
}
|
|
441
487
|
}
|
|
442
|
-
if (
|
|
443
|
-
const
|
|
444
|
-
for (const [
|
|
445
|
-
if (n
|
|
488
|
+
if (t.annotations !== void 0) {
|
|
489
|
+
const r = e.annotations || {};
|
|
490
|
+
for (const [n, o] of Object.entries(t.annotations))
|
|
491
|
+
if (r[n] !== o)
|
|
446
492
|
return !1;
|
|
447
493
|
}
|
|
448
|
-
if (
|
|
449
|
-
const
|
|
450
|
-
for (const [
|
|
451
|
-
const i = n
|
|
494
|
+
if (t.annotationPatterns !== void 0) {
|
|
495
|
+
const r = e.annotations || {};
|
|
496
|
+
for (const [n, o] of Object.entries(t.annotationPatterns)) {
|
|
497
|
+
const i = r[n];
|
|
452
498
|
if (i === void 0 || !new RegExp(o).test(i))
|
|
453
499
|
return !1;
|
|
454
500
|
}
|
|
455
501
|
}
|
|
456
502
|
return !0;
|
|
457
503
|
}
|
|
458
|
-
function
|
|
459
|
-
return Array.isArray(
|
|
504
|
+
function ne(e) {
|
|
505
|
+
return Array.isArray(e) ? (t) => e.some((r) => y(t) && w(t, r)) : (t) => y(t) && w(t, e);
|
|
460
506
|
}
|
|
461
|
-
function
|
|
462
|
-
const
|
|
463
|
-
kind:
|
|
464
|
-
name:
|
|
507
|
+
function re(e) {
|
|
508
|
+
const t = {
|
|
509
|
+
kind: e.kind,
|
|
510
|
+
name: e.name
|
|
465
511
|
};
|
|
466
|
-
return
|
|
512
|
+
return e.domain !== void 0 && (t.domain = e.domain), y(e) && (t.axesSpec = $(e.axesSpec)), l(t);
|
|
467
513
|
}
|
|
468
514
|
u.object({
|
|
469
515
|
__isRef: u.literal(!0).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
@@ -473,53 +519,66 @@ u.object({
|
|
|
473
519
|
}).describe(
|
|
474
520
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
475
521
|
).readonly();
|
|
476
|
-
function
|
|
477
|
-
return typeof
|
|
522
|
+
function oe(e) {
|
|
523
|
+
return typeof e == "object" && e !== null && "__isRef" in e && e.__isRef === !0 && "blockId" in e && "name" in e;
|
|
478
524
|
}
|
|
479
|
-
function
|
|
480
|
-
if (
|
|
525
|
+
function ie(e, t = !0) {
|
|
526
|
+
if (t)
|
|
481
527
|
return {
|
|
482
|
-
...
|
|
528
|
+
...e,
|
|
483
529
|
requireEnrichments: !0
|
|
484
530
|
};
|
|
485
531
|
{
|
|
486
|
-
const { requireEnrichments:
|
|
487
|
-
return
|
|
532
|
+
const { requireEnrichments: r, ...n } = e;
|
|
533
|
+
return n;
|
|
488
534
|
}
|
|
489
535
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
536
|
+
function ae(e, t) {
|
|
537
|
+
return e.ok ? { ok: !0, value: t(e.value) } : e;
|
|
538
|
+
}
|
|
539
|
+
const V = 24;
|
|
540
|
+
u.string().length(V).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
541
|
+
function se(e) {
|
|
542
|
+
return l(e);
|
|
492
543
|
}
|
|
493
|
-
const C = 24;
|
|
494
|
-
u.string().length(C).regex(/[ABCDEFGHIJKLMNOPQRSTUVWXYZ234567]/).brand("PlId");
|
|
495
544
|
export {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
545
|
+
Z as AnchoredIdDeriver,
|
|
546
|
+
J as PTableAbsent,
|
|
547
|
+
L as PTableNA,
|
|
548
|
+
N as PValueBytesNA,
|
|
549
|
+
E as PValueIntNA,
|
|
550
|
+
b as PValueLongNA,
|
|
551
|
+
j as PValueStringNA,
|
|
552
|
+
V as PlIdLength,
|
|
553
|
+
X as canonicalizeAxisId,
|
|
554
|
+
se as canonicalizeJson,
|
|
555
|
+
U as dataInfoToEntries,
|
|
556
|
+
re as deriveNativeId,
|
|
557
|
+
W as ensurePColumn,
|
|
558
|
+
G as entriesToDataInfo,
|
|
559
|
+
te as extractAllColumns,
|
|
560
|
+
$ as getAxesId,
|
|
505
561
|
d as getAxisId,
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
v as
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
H as
|
|
562
|
+
F as isDataInfo,
|
|
563
|
+
S as isDataInfoEntries,
|
|
564
|
+
M as isPColumn,
|
|
565
|
+
y as isPColumnSpec,
|
|
566
|
+
q as isPartitionedDataInfoEntries,
|
|
567
|
+
oe as isPlRef,
|
|
568
|
+
I as isValueAbsent,
|
|
569
|
+
O as isValueNA,
|
|
570
|
+
z as mapDataInfo,
|
|
571
|
+
h as mapJoinEntry,
|
|
572
|
+
ee as mapPObjectData,
|
|
573
|
+
Y as mapPTableDef,
|
|
574
|
+
ae as mapValueInVOE,
|
|
575
|
+
v as matchAxis,
|
|
576
|
+
T as matchAxisId,
|
|
577
|
+
w as matchPColumn,
|
|
578
|
+
Q as pTableValue,
|
|
579
|
+
H as resolveAnchors,
|
|
580
|
+
ne as selectorsToPredicate,
|
|
581
|
+
B as stringifyColumnId,
|
|
582
|
+
ie as withEnrichments
|
|
524
583
|
};
|
|
525
584
|
//# sourceMappingURL=index.js.map
|