@platforma-sdk/model 1.33.14 → 1.33.17

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/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const PlatformaSDKVersion = "1.33.14";
1
+ export declare const PlatformaSDKVersion = "1.33.17";
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.33.14",
3
+ "version": "1.33.17",
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-model-common": "^1.15.4",
25
- "@milaboratories/pl-error-like": "^1.12.1"
24
+ "@milaboratories/pl-error-like": "^1.12.1",
25
+ "@milaboratories/pl-model-common": "^1.15.5"
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
- "@platforma-sdk/eslint-config": "1.0.3",
35
- "@milaboratories/platforma-build-configs": "1.0.3"
34
+ "@milaboratories/platforma-build-configs": "1.0.3",
35
+ "@platforma-sdk/eslint-config": "1.0.3"
36
36
  },
37
37
  "scripts": {
38
38
  "type-check": "node ./scripts/save-package-version.cjs && tsc --noEmit --composite false",
@@ -1,9 +1,8 @@
1
1
  import type {
2
- AxisId, CanonicalizedJson,
3
- DataInfo,
2
+ AxisId,
3
+ CanonicalizedJson,
4
4
  PColumn,
5
5
  PColumnSpec,
6
- PColumnValues,
7
6
  PFrameHandle,
8
7
  PObjectId,
9
8
  } from '@milaboratories/pl-model-common';
@@ -215,33 +214,53 @@ export function createPFrameForGraphs<A, U>(
215
214
  columns.addColumns(blockColumns);
216
215
 
217
216
  // all possible axes from block columns
217
+ const blockAxes = new Map<CanonicalizedJson<AxisId>, AxisId>();
218
+ // axes from block columns and compatible result pool columns
218
219
  const allAxes = new Map<CanonicalizedJson<AxisId>, AxisId>();
219
220
  for (const c of blockColumns) {
220
221
  for (const id of c.spec.axesSpec) {
221
222
  const aid = getAxisId(id);
223
+ blockAxes.set(canonicalizeJson(aid), aid);
222
224
  allAxes.set(canonicalizeJson(aid), aid);
223
225
  }
224
226
  }
225
227
 
226
228
  // all linker columns always go to pFrame - even it's impossible to use some of them they all are hidden
227
229
  const linkerColumns = columns.getColumns((spec) => isLinkerColumn(spec)) ?? [];
228
- const availableWithLinkersAxes = getAvailableWithLinkersAxes(linkerColumns, allAxes);
229
- const labelColumns = columns.getColumns(isLabelColumn) ?? [];
230
+ const availableWithLinkersAxes = getAvailableWithLinkersAxes(linkerColumns, blockAxes);
230
231
 
231
232
  // all possible axes from connected linkers
232
233
  for (const item of availableWithLinkersAxes) {
234
+ blockAxes.set(...item);
233
235
  allAxes.set(...item);
234
236
  }
235
237
 
236
- let compatible = (columns.getColumns([...allAxes.values()]
238
+ // all compatible with block columns but without label columns
239
+ const compatibleWithoutLabels = (columns.getColumns([...blockAxes.values()]
237
240
  .map((ax) => ({
238
241
  axes: [ax],
239
242
  partialAxesMatch: true,
240
- }))) ?? []).filter((column) => !isLabelColumn(column.spec));
241
- compatible = compatible.concat(labelColumns); // add all available labels columns to avoid problems with fixed axes, but don't add twice
243
+ })), {dontWaitAllData: true, overrideLabelAnnotation: false}) ?? []).filter((column) => !isLabelColumn(column.spec));
244
+
245
+ // extend axes set for label columns request
246
+ for (const c of compatibleWithoutLabels) {
247
+ for (const id of c.spec.axesSpec) {
248
+ const aid = getAxisId(id);
249
+ allAxes.set(canonicalizeJson(aid), aid);
250
+ }
251
+ }
252
+
253
+ // label columns must be compatible with full set of axes - block axes and axes from compatible columns from result pool
254
+ const compatibleLabels = (columns.getColumns([...allAxes.values()]
255
+ .map((ax) => ({
256
+ axes: [ax],
257
+ partialAxesMatch: true,
258
+ })), {dontWaitAllData: true, overrideLabelAnnotation: false}) ?? []).filter((column) => isLabelColumn(column.spec));
259
+
260
+ const compatible = [...compatibleWithoutLabels, ...compatibleLabels];
242
261
 
243
262
  // additional columns are duplicates with extra fields in domains for compatibility if there are ones with partial match
244
- const extendedColumns = enrichCompatible(allAxes, compatible);
263
+ const extendedColumns = enrichCompatible(blockAxes, compatible);
245
264
 
246
265
  // if at least one column is not yet ready, we can't show the table
247
266
  if (