@platforma-sdk/model 1.34.0 → 1.34.10
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/components/PFrameForGraphs.d.ts +12 -0
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +187 -181
- package/dist/index.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/PFrameForGraphs.ts +30 -10
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PlatformaSDKVersion = "1.34.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.34.10";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.34.
|
|
3
|
+
"version": "1.34.10",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -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-
|
|
35
|
-
"@
|
|
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",
|
|
@@ -203,6 +203,18 @@ function getAdditionalColumnsForColumn(
|
|
|
203
203
|
return [column, ...additionalColumns];
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
/**
|
|
207
|
+
The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool
|
|
208
|
+
(including linker columns and all label columns).
|
|
209
|
+
Block’s columns are added to pframe as is.
|
|
210
|
+
Other columns are added basing on set of axes of block’s columns, considering available with linker columns.
|
|
211
|
+
Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from
|
|
212
|
+
result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values
|
|
213
|
+
among existing ones).
|
|
214
|
+
In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case
|
|
215
|
+
of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)
|
|
216
|
+
and modified label (with added domain values in case if more than one copy with different domains exist).
|
|
217
|
+
*/
|
|
206
218
|
export function createPFrameForGraphs<A, U>(
|
|
207
219
|
ctx: RenderCtx<A, U>,
|
|
208
220
|
blockColumns: PColumn<PColumnDataUniversal>[] | undefined,
|
|
@@ -236,11 +248,15 @@ export function createPFrameForGraphs<A, U>(
|
|
|
236
248
|
}
|
|
237
249
|
|
|
238
250
|
// all compatible with block columns but without label columns
|
|
239
|
-
const compatibleWithoutLabels = (columns.getColumns(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
251
|
+
const compatibleWithoutLabels = (columns.getColumns((spec) => spec.axesSpec.some(axisSpec => {
|
|
252
|
+
const axisId = getAxisId(axisSpec);
|
|
253
|
+
for (const selectorAxisId of blockAxes.values()) {
|
|
254
|
+
if (matchAxisId(selectorAxisId, axisId)) {
|
|
255
|
+
return true;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return false;
|
|
259
|
+
}), {dontWaitAllData: true, overrideLabelAnnotation: false}) ?? []).filter((column) => !isLabelColumn(column.spec));
|
|
244
260
|
|
|
245
261
|
// extend axes set for label columns request
|
|
246
262
|
for (const c of compatibleWithoutLabels) {
|
|
@@ -251,11 +267,15 @@ export function createPFrameForGraphs<A, U>(
|
|
|
251
267
|
}
|
|
252
268
|
|
|
253
269
|
// 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(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
270
|
+
const compatibleLabels = (columns.getColumns((spec) => spec.axesSpec.some(axisSpec => {
|
|
271
|
+
const axisId = getAxisId(axisSpec);
|
|
272
|
+
for (const selectorAxisId of allAxes.values()) {
|
|
273
|
+
if (matchAxisId(selectorAxisId, axisId)) {
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return false;
|
|
278
|
+
}), {dontWaitAllData: true, overrideLabelAnnotation: false}) ?? []).filter((column) => isLabelColumn(column.spec));
|
|
259
279
|
|
|
260
280
|
const compatible = [...compatibleWithoutLabels, ...compatibleLabels];
|
|
261
281
|
|