@platforma-sdk/model 1.30.21 → 1.30.24
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 +490 -487
- package/dist/index.mjs.map +1 -1
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/label.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/render/util/column_collection.ts +9 -1
- package/src/render/util/label.ts +16 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"column_collection.d.ts","sourceRoot":"","sources":["../../../src/render/util/column_collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,eAAe,EACf,WAAW,EACX,SAAS,EACT,mBAAmB,EAKnB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"column_collection.d.ts","sourceRoot":"","sources":["../../../src/render/util/column_collection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,MAAM,EACN,QAAQ,EACR,OAAO,EACP,eAAe,EACf,WAAW,EACX,SAAS,EACT,mBAAmB,EAKnB,qBAAqB,EAEtB,MAAM,iCAAiC,CAAC;AAWzC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,SAAS,CAAC;AAG9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAK7F,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,eAAe,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC,gBAAgB,GAAG,QAAQ,CAAC,gBAAgB,CAAC,GAAG,SAAS,CAAC,EAAE,CAAC;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C,KAAK,EAAE,CAAC,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6CAA6C;IAC7C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sHAAsH;IACtH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;EAKrB,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AAGpD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;WAAsB,CAAC;AACzC,MAAM,MAAM,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,CAAC,CAAC;AAI1C,KAAK,mBAAmB,GAAG,WAAW,GAAG;IACvC,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,UAAU,EAAE,CAAC;CAC5B,CAAC;AAOF,wBAAgB,YAAY,CAAC,CAAC,EAC5B,MAAM,EAAE,CAAC,EAAE,EACX,aAAa,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,mBAAmB,EAC9C,GAAG,GAAE,kBAAuB,GAC3B,gBAAgB,CAAC,CAAC,CAAC,EAAE,CA+IvB"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PlatformaSDKVersion = "1.30.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.30.24";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.30.
|
|
3
|
+
"version": "1.30.24",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"utility-types": "^3.11.0",
|
|
22
22
|
"canonicalize": "~2.1.0",
|
|
23
23
|
"zod": "~3.23.8",
|
|
24
|
-
"@milaboratories/pl-
|
|
25
|
-
"@milaboratories/pl-
|
|
24
|
+
"@milaboratories/pl-error-like": "^1.12.1",
|
|
25
|
+
"@milaboratories/pl-model-common": "^1.15.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"typescript": "~5.5.4",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"jest": "^29.7.0",
|
|
32
32
|
"@jest/globals": "^29.7.0",
|
|
33
33
|
"ts-jest": "^29.2.6",
|
|
34
|
-
"@
|
|
35
|
-
"@platforma-
|
|
34
|
+
"@platforma-sdk/eslint-config": "1.0.3",
|
|
35
|
+
"@milaboratories/platforma-build-configs": "1.0.3"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"type-check": "node ./scripts/save-package-version.cjs && tsc --noEmit --composite false",
|
|
@@ -12,6 +12,7 @@ import type {
|
|
|
12
12
|
AnchoredPColumnSelector,
|
|
13
13
|
PartitionedDataInfoEntries,
|
|
14
14
|
ResolveAnchorsOptions,
|
|
15
|
+
NativePObjectId,
|
|
15
16
|
} from '@milaboratories/pl-model-common';
|
|
16
17
|
import {
|
|
17
18
|
selectorsToPredicate,
|
|
@@ -21,6 +22,7 @@ import {
|
|
|
21
22
|
canonicalizeAxisId,
|
|
22
23
|
isPartitionedDataInfoEntries,
|
|
23
24
|
entriesToDataInfo,
|
|
25
|
+
deriveNativeId,
|
|
24
26
|
} from '@milaboratories/pl-model-common';
|
|
25
27
|
import type { TreeNodeAccessor } from '../accessor';
|
|
26
28
|
import type { LabelDerivationOps, TraceEntry } from './label';
|
|
@@ -224,6 +226,7 @@ export class PColumnCollection {
|
|
|
224
226
|
: [predicateOrSelectors];
|
|
225
227
|
|
|
226
228
|
const intermediateResults: IntermediateColumnEntry[] = [];
|
|
229
|
+
const selectedNativeIds = new Set<NativePObjectId>();
|
|
227
230
|
|
|
228
231
|
for (const rawSelector of selectorsArray) {
|
|
229
232
|
const usesAnchors = hasAnchors(rawSelector);
|
|
@@ -241,8 +244,13 @@ export class PColumnCollection {
|
|
|
241
244
|
for (const provider of this.providers) {
|
|
242
245
|
const providerColumns = provider.selectColumns(currentSelector);
|
|
243
246
|
for (const col of providerColumns) {
|
|
244
|
-
if (selectedIds.has(col.id))
|
|
247
|
+
if (selectedIds.has(col.id))
|
|
248
|
+
throw new Error(`Duplicate column id ${col.id} in provider ${provider.constructor.name}`);
|
|
249
|
+
const nativeId = deriveNativeId(col.spec);
|
|
250
|
+
if (selectedNativeIds.has(nativeId))
|
|
251
|
+
continue;
|
|
245
252
|
selectedIds.add(col.id);
|
|
253
|
+
selectedNativeIds.add(nativeId);
|
|
246
254
|
selectedColumns.push(col);
|
|
247
255
|
}
|
|
248
256
|
}
|
package/src/render/util/label.ts
CHANGED
|
@@ -80,7 +80,7 @@ export function deriveLabels<T>(
|
|
|
80
80
|
...(suffixTrace ?? []),
|
|
81
81
|
];
|
|
82
82
|
|
|
83
|
-
if (label) {
|
|
83
|
+
if (label !== undefined) {
|
|
84
84
|
const labelEntry = { label, type: LabelType, importance: -2 };
|
|
85
85
|
if (ops.addLabelAsSuffix) trace.push(labelEntry);
|
|
86
86
|
else trace.splice(0, 0, labelEntry);
|
|
@@ -129,14 +129,20 @@ export function deriveLabels<T>(
|
|
|
129
129
|
else secondaryTypes.push(typeName);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
const calculate = (includedTypes: Set<string
|
|
132
|
+
const calculate = (includedTypes: Set<string>, force: boolean = false) => {
|
|
133
133
|
const result: RecordsWithLabel<T>[] = [];
|
|
134
134
|
for (let i = 0; i < enrichedRecords.length; i++) {
|
|
135
135
|
const r = enrichedRecords[i];
|
|
136
136
|
const includedTrace = r.fullTrace
|
|
137
137
|
.filter((fm) => includedTypes.has(fm.fullType));
|
|
138
|
-
if (includedTrace.length === 0)
|
|
139
|
-
|
|
138
|
+
if (includedTrace.length === 0) {
|
|
139
|
+
if (force)
|
|
140
|
+
result.push({
|
|
141
|
+
label: 'Unlabeled',
|
|
142
|
+
value: r.value,
|
|
143
|
+
} satisfies RecordsWithLabel<T>);
|
|
144
|
+
else return undefined;
|
|
145
|
+
}
|
|
140
146
|
const labelSet = includedTrace
|
|
141
147
|
.map((fm) => fm.label);
|
|
142
148
|
const sep = ops.separator ?? ' / ';
|
|
@@ -149,10 +155,8 @@ export function deriveLabels<T>(
|
|
|
149
155
|
};
|
|
150
156
|
|
|
151
157
|
if (mainTypes.length === 0) {
|
|
152
|
-
if (secondaryTypes.length !== 0) throw new Error('
|
|
153
|
-
|
|
154
|
-
if (result === undefined) throw new Error('Assertion error.');
|
|
155
|
-
return result;
|
|
158
|
+
if (secondaryTypes.length !== 0) throw new Error('Non-empty secondary types list while main types list is empty.');
|
|
159
|
+
return calculate(new Set(LabelTypeFull), true)!;
|
|
156
160
|
}
|
|
157
161
|
|
|
158
162
|
//
|
|
@@ -165,12 +169,13 @@ export function deriveLabels<T>(
|
|
|
165
169
|
// Resulting set: T0, T1, T3
|
|
166
170
|
//
|
|
167
171
|
let includedTypes = 0;
|
|
168
|
-
let additionalType =
|
|
172
|
+
let additionalType = -1;
|
|
169
173
|
while (includedTypes < mainTypes.length) {
|
|
170
174
|
const currentSet = new Set<string>();
|
|
171
175
|
if (ops.includeNativeLabel) currentSet.add(LabelTypeFull);
|
|
172
176
|
for (let i = 0; i < includedTypes; ++i) currentSet.add(mainTypes[i]);
|
|
173
|
-
|
|
177
|
+
if (additionalType >= 0)
|
|
178
|
+
currentSet.add(mainTypes[additionalType]);
|
|
174
179
|
|
|
175
180
|
const candidateResult = calculate(currentSet);
|
|
176
181
|
|
|
@@ -184,7 +189,5 @@ export function deriveLabels<T>(
|
|
|
184
189
|
}
|
|
185
190
|
}
|
|
186
191
|
|
|
187
|
-
|
|
188
|
-
if (result === undefined) throw new Error('Assertion error.');
|
|
189
|
-
return result;
|
|
192
|
+
return calculate(new Set([...mainTypes, ...secondaryTypes]), true)!;
|
|
190
193
|
}
|