@platforma-sdk/model 1.42.10 → 1.42.16
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 +5 -8
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PlDataTable.d.ts +3 -3
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlMultiSequenceAlignment.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +661 -677
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/util/axis_filtering.d.ts +3 -2
- package/dist/render/util/axis_filtering.d.ts.map +1 -1
- package/dist/render/util/column_collection.d.ts.map +1 -1
- package/dist/render/util/label.d.ts +0 -2
- package/dist/render/util/label.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/components/PFrameForGraphs.test.ts +20 -21
- package/src/components/PFrameForGraphs.ts +56 -75
- package/src/components/PlDataTable.ts +12 -6
- package/src/components/PlMultiSequenceAlignment.ts +9 -5
- package/src/render/api.ts +4 -2
- package/src/render/util/axis_filtering.ts +63 -50
- package/src/render/util/column_collection.ts +3 -2
- package/src/render/util/label.test.ts +4 -4
- package/src/render/util/label.ts +4 -7
package/dist/render/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/render/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,eAAe,EACf,WAAW,EACX,aAAa,EACb,SAAS,EACT,YAAY,EACZ,OAAO,EAEP,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,kBAAkB,EAClB,aAAa,EACb,KAAK,EACL,qBAAqB,EACrB,gBAAgB,EAChB,mBAAmB,EACnB,YAAY,EACb,MAA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CAAC,CAAC,CAAC,GAClB,KAAK,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsonDataInfoEntries, JsonPartitionedDataInfoEntries, BinaryPartitionedDataInfoEntries, AxisFilterByIdx } from '@milaboratories/pl-model-common';
|
|
1
|
+
import { JsonDataInfoEntries, JsonPartitionedDataInfoEntries, BinaryPartitionedDataInfoEntries, ParquetPartitionedDataInfoEntries, PartitionedDataInfoEntries, AxisFilterByIdx } from '@milaboratories/pl-model-common';
|
|
2
2
|
/**
|
|
3
3
|
* Filters DataInfoEntries using axis filters, removing specified axes from keys and
|
|
4
4
|
* only keeping entries that match the filter values.
|
|
@@ -7,8 +7,9 @@ import { JsonDataInfoEntries, JsonPartitionedDataInfoEntries, BinaryPartitionedD
|
|
|
7
7
|
* @param axisFilters - Array of axis filters (index, value pairs)
|
|
8
8
|
* @throws Error if any filter axis is outside the partitioning axes or data axes for Json data
|
|
9
9
|
*/
|
|
10
|
+
export declare function filterDataInfoEntries<Blob>(dataInfoEntries: ParquetPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): ParquetPartitionedDataInfoEntries<Blob>;
|
|
10
11
|
export declare function filterDataInfoEntries<Blob>(dataInfoEntries: BinaryPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): BinaryPartitionedDataInfoEntries<Blob>;
|
|
11
12
|
export declare function filterDataInfoEntries<Blob>(dataInfoEntries: JsonPartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): JsonPartitionedDataInfoEntries<Blob>;
|
|
12
|
-
export declare function filterDataInfoEntries<Blob>(dataInfoEntries:
|
|
13
|
+
export declare function filterDataInfoEntries<Blob>(dataInfoEntries: PartitionedDataInfoEntries<Blob>, axisFilters: AxisFilterByIdx[]): PartitionedDataInfoEntries<Blob>;
|
|
13
14
|
export declare function filterDataInfoEntries(dataInfoEntries: JsonDataInfoEntries, axisFilters: AxisFilterByIdx[]): JsonDataInfoEntries;
|
|
14
15
|
//# sourceMappingURL=axis_filtering.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"axis_filtering.d.ts","sourceRoot":"","sources":["../../../src/render/util/axis_filtering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,mBAAmB,EACnB,8BAA8B,EAC9B,gCAAgC,EACjC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EACxC,eAAe,EAAE,
|
|
1
|
+
{"version":3,"file":"axis_filtering.d.ts","sourceRoot":"","sources":["../../../src/render/util/axis_filtering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAMV,mBAAmB,EACnB,8BAA8B,EAC9B,gCAAgC,EAChC,iCAAiC,EACjC,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAEvE;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EACxC,eAAe,EAAE,iCAAiC,CAAC,IAAI,CAAC,EACxD,WAAW,EAAE,eAAe,EAAE,GAC7B,iCAAiC,CAAC,IAAI,CAAC,CAAC;AAC3C,wBAAgB,qBAAqB,CAAC,IAAI,EACxC,eAAe,EAAE,gCAAgC,CAAC,IAAI,CAAC,EACvD,WAAW,EAAE,eAAe,EAAE,GAC7B,gCAAgC,CAAC,IAAI,CAAC,CAAC;AAC1C,wBAAgB,qBAAqB,CAAC,IAAI,EACxC,eAAe,EAAE,8BAA8B,CAAC,IAAI,CAAC,EACrD,WAAW,EAAE,eAAe,EAAE,GAC7B,8BAA8B,CAAC,IAAI,CAAC,CAAC;AACxC,wBAAgB,qBAAqB,CAAC,IAAI,EACxC,eAAe,EAAE,0BAA0B,CAAC,IAAI,CAAC,EACjD,WAAW,EAAE,eAAe,EAAE,GAC7B,0BAA0B,CAAC,IAAI,CAAC,CAAC;AACpC,wBAAgB,qBAAqB,CACnC,eAAe,EAAE,mBAAmB,EACpC,WAAW,EAAE,eAAe,EAAE,GAC7B,mBAAmB,CAAC"}
|
|
@@ -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,OAAO,EACP,eAAe,EACf,WAAW,EACX,SAAS,EACT,mBAAmB,EAGnB,uBAAuB,EAEvB,qBAAqB,EAGtB,MAAM,iCAAiC,CAAC;
|
|
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,OAAO,EACP,eAAe,EACf,WAAW,EACX,SAAS,EACT,mBAAmB,EAGnB,uBAAuB,EAEvB,qBAAqB,EAGtB,MAAM,iCAAiC,CAAC;AAazC,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,SAAS,CAAC;AAG9D,OAAO,KAAK,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAC;AAI7F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AASnD,MAAM,WAAW,cAAc;IAC7B,aAAa,CAAC,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,eAAe,GAAG,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,EAAE,CAAC;CAC/I;AAED,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACvE;AAgBD,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,SAAS,CAAC;IACd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AqB,EAAE,GAAG,SAAS;IAC3D,mBAAmB,CACxB,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,wBAAwB,GAAG,wBAAwB,EAAE,EAC9G,IAAI,CAAC,EAAE,6BAA6B,GAAG,qBAAqB,EAAE,GAAG,SAAS;IA+MrE,UAAU,CACf,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,yBAAyB,GAAG,yBAAyB,EAAE,EAChH,IAAI,EAAE,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAAE,GAAG,SAAS;IACnE,UAAU,CACf,oBAAoB,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,GAAG,wBAAwB,GAAG,wBAAwB,EAAE,EAC9G,IAAI,CAAC,EAAE,6BAA6B,GAAG,OAAO,CAAC,oBAAoB,CAAC,EAAE,GAAG,SAAS;CA0BrF"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { PObjectSpec } from '@milaboratories/pl-model-common';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
export declare const PAnnotationLabel = "pl7.app/label";
|
|
4
|
-
export declare const PAnnotationTrace = "pl7.app/trace";
|
|
5
3
|
export type RecordsWithLabel<T> = {
|
|
6
4
|
value: T;
|
|
7
5
|
label: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/render/util/label.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../../../src/render/util/label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC1G,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI;IAChC,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;IAC3B,2EAA2E;IAC3E,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B,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,CAoJvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/model",
|
|
3
|
-
"version": "1.42.
|
|
3
|
+
"version": "1.42.16",
|
|
4
4
|
"description": "Platforma.bio SDK / Block Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"utility-types": "^3.11.0",
|
|
23
23
|
"canonicalize": "~2.1.0",
|
|
24
24
|
"zod": "~3.23.8",
|
|
25
|
-
"@milaboratories/pl-model-common": "^1.19.
|
|
25
|
+
"@milaboratories/pl-model-common": "^1.19.6",
|
|
26
26
|
"@milaboratories/pl-error-like": "^1.12.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"ts-jest": "^29.2.6",
|
|
35
35
|
"fast-json-patch": "^3.1.1",
|
|
36
36
|
"@platforma-sdk/eslint-config": "1.0.3",
|
|
37
|
-
"@milaboratories/
|
|
38
|
-
"@milaboratories/
|
|
37
|
+
"@milaboratories/helpers": "^1.6.19",
|
|
38
|
+
"@milaboratories/build-configs": "1.0.5"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"type-check": "tsc --noEmit --composite false",
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import {test, expect, describe} from '@jest/globals';
|
|
2
|
-
import {
|
|
3
|
-
IS_VIRTUAL_COLUMN,
|
|
4
|
-
LABEL_ANNOTATION,
|
|
5
|
-
enrichCompatible, LINKER_COLUMN_ANNOTATION, getAvailableWithLinkersAxes
|
|
6
|
-
} from './PFrameForGraphs';
|
|
2
|
+
import {enrichCompatible, getAvailableWithLinkersAxes} from './PFrameForGraphs';
|
|
7
3
|
import {
|
|
8
4
|
AxisId, CanonicalizedJson,
|
|
9
5
|
canonicalizeJson, DataInfo,
|
|
@@ -11,16 +7,19 @@ import {
|
|
|
11
7
|
PColumn,
|
|
12
8
|
PColumnSpec,
|
|
13
9
|
PColumnValues,
|
|
14
|
-
PObjectId
|
|
10
|
+
PObjectId,
|
|
11
|
+
Annotation,
|
|
12
|
+
AxisSpecNormalized,
|
|
13
|
+
getNormalizedAxesList,
|
|
15
14
|
} from "@milaboratories/pl-model-common";
|
|
16
15
|
import {TreeNodeAccessor} from "../render";
|
|
17
16
|
|
|
18
|
-
function getAllAxesFromSpecs (specs:PColumnSpec[]):Map<CanonicalizedJson<AxisId>,
|
|
19
|
-
const allAxes:Map<CanonicalizedJson<AxisId>,
|
|
17
|
+
function getAllAxesFromSpecs (specs:PColumnSpec[]):Map<CanonicalizedJson<AxisId>, AxisSpecNormalized> {
|
|
18
|
+
const allAxes:Map<CanonicalizedJson<AxisId>, AxisSpecNormalized> = new Map();
|
|
20
19
|
for (const spec of specs) {
|
|
21
|
-
for (const id of spec.axesSpec) {
|
|
20
|
+
for (const id of getNormalizedAxesList(spec.axesSpec)) {
|
|
22
21
|
const aid = getAxisId(id);
|
|
23
|
-
allAxes.set(canonicalizeJson(aid),
|
|
22
|
+
allAxes.set(canonicalizeJson(aid), id);
|
|
24
23
|
}
|
|
25
24
|
}
|
|
26
25
|
return allAxes
|
|
@@ -84,8 +83,8 @@ describe('PFrameForGraph', () => {
|
|
|
84
83
|
kind: 'PColumn',
|
|
85
84
|
name: 'column2',
|
|
86
85
|
valueType: 'Int',
|
|
87
|
-
axesSpec: [{type: 'String', name: 'axis1', domain: {key1: 'a'}}],
|
|
88
|
-
annotations: {[
|
|
86
|
+
axesSpec: [{type: 'String', name: 'axis1', domain: {key1: 'a'}, parentAxesSpec: []}],
|
|
87
|
+
annotations: {[Annotation.Graph.IsVirtual]: 'true'}
|
|
89
88
|
});
|
|
90
89
|
});
|
|
91
90
|
test('columns are not compatible, additional columns are impossible', () => {
|
|
@@ -179,7 +178,7 @@ describe('PFrameForGraph', () => {
|
|
|
179
178
|
kind: 'PColumn',
|
|
180
179
|
name: 'column2',
|
|
181
180
|
valueType: 'Int',
|
|
182
|
-
annotations: {[
|
|
181
|
+
annotations: {[Annotation.Label]: 'Label of column2'},
|
|
183
182
|
axesSpec: [{type: 'String', name: 'axis1', domain: {key0: 'commonDomain'}}]
|
|
184
183
|
}
|
|
185
184
|
const allAxes = getAllAxesFromSpecs([columnSpec1]);
|
|
@@ -189,8 +188,8 @@ describe('PFrameForGraph', () => {
|
|
|
189
188
|
] as PColumn<PColumnValues>[]
|
|
190
189
|
|
|
191
190
|
const resultColumns = enrichCompatible(allAxes, columns);
|
|
192
|
-
expect(resultColumns[2].spec.annotations?.[
|
|
193
|
-
expect(resultColumns[3].spec.annotations?.[
|
|
191
|
+
expect(resultColumns[2].spec.annotations?.[Annotation.Label]).toEqual('Label of column2 / a');
|
|
192
|
+
expect(resultColumns[3].spec.annotations?.[Annotation.Label]).toEqual('Label of column2 / b');
|
|
194
193
|
})
|
|
195
194
|
|
|
196
195
|
test('Linker column adds available axis', () => {
|
|
@@ -207,7 +206,7 @@ describe('PFrameForGraph', () => {
|
|
|
207
206
|
kind: 'PColumn',
|
|
208
207
|
name: 'linker13',
|
|
209
208
|
valueType: 'String',
|
|
210
|
-
annotations: {[
|
|
209
|
+
annotations: {[Annotation.IsLinkerColumn]: 'true'},
|
|
211
210
|
axesSpec: [
|
|
212
211
|
{type: 'String', name: 'axis1'},
|
|
213
212
|
{type: 'String', name: 'axis3'}
|
|
@@ -219,7 +218,7 @@ describe('PFrameForGraph', () => {
|
|
|
219
218
|
linkerColumns,
|
|
220
219
|
getAllAxesFromSpecs([columnSpec1])
|
|
221
220
|
);
|
|
222
|
-
expect([...availableAxes.values()].map(id => id.name)).toEqual(['axis3'])
|
|
221
|
+
expect([...availableAxes.values()].map((id) => id.name)).toEqual(['axis3'])
|
|
223
222
|
})
|
|
224
223
|
|
|
225
224
|
test('Linker columns add available axes by chains', () => {
|
|
@@ -233,7 +232,7 @@ describe('PFrameForGraph', () => {
|
|
|
233
232
|
kind: 'PColumn',
|
|
234
233
|
name: 'linker12',
|
|
235
234
|
valueType: 'String',
|
|
236
|
-
annotations: {[
|
|
235
|
+
annotations: {[Annotation.IsLinkerColumn]: 'true'},
|
|
237
236
|
axesSpec: [
|
|
238
237
|
{type: 'String', name: 'axis1'},
|
|
239
238
|
{type: 'String', name: 'axis2'}
|
|
@@ -243,7 +242,7 @@ describe('PFrameForGraph', () => {
|
|
|
243
242
|
kind: 'PColumn',
|
|
244
243
|
name: 'linker23',
|
|
245
244
|
valueType: 'String',
|
|
246
|
-
annotations: {[
|
|
245
|
+
annotations: {[Annotation.IsLinkerColumn]: 'true'},
|
|
247
246
|
axesSpec: [
|
|
248
247
|
{type: 'String', name: 'axis2'},
|
|
249
248
|
{type: 'String', name: 'axis3'}
|
|
@@ -253,7 +252,7 @@ describe('PFrameForGraph', () => {
|
|
|
253
252
|
kind: 'PColumn',
|
|
254
253
|
name: 'linker34',
|
|
255
254
|
valueType: 'String',
|
|
256
|
-
annotations: {[
|
|
255
|
+
annotations: {[Annotation.IsLinkerColumn]: 'true'},
|
|
257
256
|
axesSpec: [
|
|
258
257
|
{type: 'String', name: 'axis3'},
|
|
259
258
|
{type: 'String', name: 'axis4'}
|
|
@@ -269,6 +268,6 @@ describe('PFrameForGraph', () => {
|
|
|
269
268
|
linkerColumns,
|
|
270
269
|
getAllAxesFromSpecs([columnSpec1])
|
|
271
270
|
);
|
|
272
|
-
expect([...availableAxes.values()].map(id => id.name)).toEqual(['axis2', 'axis3', 'axis4'])
|
|
271
|
+
expect([...availableAxes.values()].map((id) => id.name)).toEqual(['axis2', 'axis3', 'axis4'])
|
|
273
272
|
})
|
|
274
273
|
})
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
AxisId,
|
|
3
|
+
AxisSpecNormalized,
|
|
3
4
|
CanonicalizedJson,
|
|
4
5
|
PColumn,
|
|
5
6
|
PColumnSpec,
|
|
@@ -10,8 +11,17 @@ import {
|
|
|
10
11
|
canonicalizeJson,
|
|
11
12
|
getAxisId,
|
|
12
13
|
isDataInfo,
|
|
13
|
-
matchAxisId,
|
|
14
|
+
matchAxisId,
|
|
14
15
|
visitDataInfo,
|
|
16
|
+
getColumnIdAndSpec,
|
|
17
|
+
Annotation,
|
|
18
|
+
readAnnotation,
|
|
19
|
+
getNormalizedAxesList,
|
|
20
|
+
stringifyJson,
|
|
21
|
+
readAnnotationJson,
|
|
22
|
+
LinkerMap,
|
|
23
|
+
getArrayFromAxisTree,
|
|
24
|
+
getAxesTree,
|
|
15
25
|
} from '@milaboratories/pl-model-common';
|
|
16
26
|
import type { PColumnDataUniversal, RenderCtx } from '../render';
|
|
17
27
|
import { PColumnCollection, TreeNodeAccessor } from '../render';
|
|
@@ -48,70 +58,41 @@ function getKeysCombinations(idsLists: AxisId[][]) {
|
|
|
48
58
|
}
|
|
49
59
|
|
|
50
60
|
/** Check if column is a linker column */
|
|
51
|
-
export function isLinkerColumn(column: PColumnSpec) {
|
|
52
|
-
return column.
|
|
61
|
+
export function isLinkerColumn(column: PColumnSpec): boolean {
|
|
62
|
+
return !!readAnnotationJson(column, Annotation.IsLinkerColumn);
|
|
53
63
|
}
|
|
54
64
|
|
|
55
|
-
|
|
56
|
-
export const LABEL_ANNOTATION = 'pl7.app/label';
|
|
57
|
-
export const LINKER_COLUMN_ANNOTATION = 'pl7.app/isLinkerColumn';
|
|
58
|
-
|
|
59
|
-
export type LinkerColumnsMap = Map<CanonicalizedJson<AxisId>, Set<CanonicalizedJson<AxisId>>>;
|
|
60
|
-
export function getLinkerColumnsMap(linkerColumns: PColumn<PColumnDataUniversal>[]) {
|
|
61
|
-
const resultMap: LinkerColumnsMap = new Map();
|
|
62
|
-
for (const { spec } of linkerColumns) {
|
|
63
|
-
const axisIds = spec.axesSpec.map(getAxisId).map(canonicalizeJson);
|
|
64
|
-
axisIds.forEach((id) => {
|
|
65
|
-
if (!resultMap.has(id)) {
|
|
66
|
-
resultMap.set(id, new Set());
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
for (let i = 0; i < axisIds.length - 1; i++) {
|
|
70
|
-
for (let j = i + 1; j < axisIds.length; j++) {
|
|
71
|
-
const id1 = axisIds[i];
|
|
72
|
-
const id2 = axisIds[j];
|
|
73
|
-
resultMap.get(id1)?.add(id2);
|
|
74
|
-
resultMap.get(id2)?.add(id1);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
return resultMap;
|
|
79
|
-
}
|
|
65
|
+
type AxesVault = Map<CanonicalizedJson<AxisId>, AxisSpecNormalized>;
|
|
80
66
|
|
|
81
67
|
export function getAvailableWithLinkersAxes(
|
|
82
68
|
linkerColumns: PColumn<PColumnDataUniversal>[],
|
|
83
|
-
blockAxes:
|
|
84
|
-
):
|
|
85
|
-
const
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
blockAxes: AxesVault,
|
|
70
|
+
): AxesVault {
|
|
71
|
+
const linkerMap = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec));
|
|
72
|
+
const startKeys: CanonicalizedJson<AxisId[]>[] = [];
|
|
73
|
+
const blockAxesGrouped: AxisId[][] = [...blockAxes.values()].map((axis) => getArrayFromAxisTree(getAxesTree(axis)).map(getAxisId));
|
|
74
|
+
|
|
75
|
+
for (const axesGroupBlock of blockAxesGrouped) {
|
|
76
|
+
const matched = linkerMap.keyAxesIds.find(
|
|
77
|
+
(keyIds: AxisId[]) => keyIds.every(
|
|
78
|
+
(keySourceAxis) => axesGroupBlock.find((axisSpecFromBlock) => matchAxisId(axisSpecFromBlock, keySourceAxis)),
|
|
79
|
+
),
|
|
80
|
+
);
|
|
90
81
|
if (matched) {
|
|
91
82
|
startKeys.push(canonicalizeJson(matched)); // linker column can contain fewer domains than in block's columns, it's fixed on next step in enrichCompatible
|
|
92
83
|
}
|
|
93
84
|
}
|
|
94
|
-
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (!visited.has(availableKey)) {
|
|
103
|
-
next.push(availableKey);
|
|
104
|
-
visited.add(availableKey);
|
|
105
|
-
addedAvailableAxes.set(availableKey, parseJson(availableKey));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
nextKeys = next;
|
|
110
|
-
}
|
|
111
|
-
return addedAvailableAxes;
|
|
85
|
+
|
|
86
|
+
const availableKeys = linkerMap.searchAvailableAxesKeys(startKeys);
|
|
87
|
+
const availableAxes = linkerMap.getAxesListFromKeysList([...availableKeys]);
|
|
88
|
+
|
|
89
|
+
return new Map(availableAxes.map((axisSpec) => {
|
|
90
|
+
const id = getAxisId(axisSpec);
|
|
91
|
+
return [canonicalizeJson(id), axisSpec];
|
|
92
|
+
}));
|
|
112
93
|
}
|
|
113
94
|
/** Add columns with fully compatible axes created from partial compatible ones */
|
|
114
|
-
export function enrichCompatible(blockAxes:
|
|
95
|
+
export function enrichCompatible(blockAxes: AxesVault, columns: PColumn<PColumnDataUniversal>[]) {
|
|
115
96
|
const result: PColumn<PColumnDataUniversal>[] = [];
|
|
116
97
|
columns.forEach((column) => {
|
|
117
98
|
result.push(...getAdditionalColumnsForColumn(blockAxes, column));
|
|
@@ -120,7 +101,7 @@ export function enrichCompatible(blockAxes: Map<string, AxisId>, columns: PColum
|
|
|
120
101
|
}
|
|
121
102
|
|
|
122
103
|
function getAdditionalColumnsForColumn(
|
|
123
|
-
blockAxes:
|
|
104
|
+
blockAxes: AxesVault,
|
|
124
105
|
column: PColumn<PColumnDataUniversal>,
|
|
125
106
|
): PColumn<PColumnDataUniversal>[] {
|
|
126
107
|
const columnAxesIds = column.spec.axesSpec.map(getAxisId);
|
|
@@ -173,19 +154,19 @@ function getAdditionalColumnsForColumn(
|
|
|
173
154
|
const additionalColumns = secondaryIdsVariants.map((idsList, idx) => {
|
|
174
155
|
const id = colId(column.id, idsList.map((id) => id.domain));
|
|
175
156
|
|
|
176
|
-
const label = column.spec.
|
|
157
|
+
const label = readAnnotation(column.spec, Annotation.Label) ?? '';
|
|
177
158
|
const labelDomainPart = ([...addedByVariantsDomainValues[idx]])
|
|
178
159
|
.filter((str) => addedNotToAllVariantsDomainValues.has(str))
|
|
179
160
|
.sort()
|
|
180
161
|
.map((v) => JSON.parse(v)?.[1]) // use in labels only domain values, but sort them by key to save the same order in all column variants
|
|
181
162
|
.join(' / ');
|
|
182
163
|
|
|
183
|
-
const annotations:
|
|
164
|
+
const annotations: Annotation = {
|
|
184
165
|
...column.spec.annotations,
|
|
185
|
-
[
|
|
166
|
+
[Annotation.Graph.IsVirtual]: stringifyJson(true),
|
|
186
167
|
};
|
|
187
168
|
if (label || labelDomainPart) {
|
|
188
|
-
annotations[
|
|
169
|
+
annotations[Annotation.Label] = label && labelDomainPart ? label + ' / ' + labelDomainPart : label + labelDomainPart;
|
|
189
170
|
}
|
|
190
171
|
|
|
191
172
|
return {
|
|
@@ -248,11 +229,11 @@ export function createPFrameForGraphs<A, U>(
|
|
|
248
229
|
return undefined;
|
|
249
230
|
}
|
|
250
231
|
|
|
251
|
-
const allAxes = new Map(allColumns
|
|
252
|
-
.flatMap((column) => column.spec.axesSpec)
|
|
232
|
+
const allAxes: AxesVault = new Map(allColumns
|
|
233
|
+
.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec))
|
|
253
234
|
.map((axisSpec) => {
|
|
254
235
|
const axisId = getAxisId(axisSpec);
|
|
255
|
-
return [canonicalizeJson(axisId),
|
|
236
|
+
return [canonicalizeJson(axisId), axisSpec];
|
|
256
237
|
}));
|
|
257
238
|
|
|
258
239
|
// additional columns are duplicates with extra fields in domains for compatibility if there are ones with partial match
|
|
@@ -271,14 +252,14 @@ export function createPFrameForGraphs<A, U>(
|
|
|
271
252
|
columns.addColumns(blockColumns);
|
|
272
253
|
|
|
273
254
|
// all possible axes from block columns
|
|
274
|
-
const blockAxes = new Map
|
|
255
|
+
const blockAxes: AxesVault = new Map();
|
|
275
256
|
// axes from block columns and compatible result pool columns
|
|
276
|
-
const allAxes = new Map
|
|
257
|
+
const allAxes: AxesVault = new Map();
|
|
277
258
|
for (const c of blockColumns) {
|
|
278
|
-
for (const
|
|
279
|
-
const aid = getAxisId(
|
|
280
|
-
blockAxes.set(canonicalizeJson(aid),
|
|
281
|
-
allAxes.set(canonicalizeJson(aid),
|
|
259
|
+
for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
|
|
260
|
+
const aid = getAxisId(spec);
|
|
261
|
+
blockAxes.set(canonicalizeJson(aid), spec);
|
|
262
|
+
allAxes.set(canonicalizeJson(aid), spec);
|
|
282
263
|
}
|
|
283
264
|
}
|
|
284
265
|
|
|
@@ -295,8 +276,8 @@ export function createPFrameForGraphs<A, U>(
|
|
|
295
276
|
// all compatible with block columns but without label columns
|
|
296
277
|
const compatibleWithoutLabels = (columns.getColumns((spec) => spec.axesSpec.some((axisSpec) => {
|
|
297
278
|
const axisId = getAxisId(axisSpec);
|
|
298
|
-
for (const
|
|
299
|
-
if (matchAxisId(
|
|
279
|
+
for (const selectorAxisSpec of blockAxes.values()) {
|
|
280
|
+
if (matchAxisId(getAxisId(selectorAxisSpec), axisId)) {
|
|
300
281
|
return true;
|
|
301
282
|
}
|
|
302
283
|
}
|
|
@@ -310,17 +291,17 @@ export function createPFrameForGraphs<A, U>(
|
|
|
310
291
|
|
|
311
292
|
// extend axes set for label columns request
|
|
312
293
|
for (const c of compatibleWithoutLabels) {
|
|
313
|
-
for (const
|
|
314
|
-
const aid = getAxisId(
|
|
315
|
-
allAxes.set(canonicalizeJson(aid),
|
|
294
|
+
for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
|
|
295
|
+
const aid = getAxisId(spec);
|
|
296
|
+
allAxes.set(canonicalizeJson(aid), spec);
|
|
316
297
|
}
|
|
317
298
|
}
|
|
318
299
|
|
|
319
300
|
// label columns must be compatible with full set of axes - block axes and axes from compatible columns from result pool
|
|
320
301
|
const compatibleLabels = (columns.getColumns((spec) => spec.axesSpec.some((axisSpec) => {
|
|
321
302
|
const axisId = getAxisId(axisSpec);
|
|
322
|
-
for (const
|
|
323
|
-
if (matchAxisId(
|
|
303
|
+
for (const selectorAxisSpec of allAxes.values()) {
|
|
304
|
+
if (matchAxisId(getAxisId(selectorAxisSpec), axisId)) {
|
|
324
305
|
return true;
|
|
325
306
|
}
|
|
326
307
|
}
|
|
@@ -20,10 +20,13 @@ import type {
|
|
|
20
20
|
PTableSorting,
|
|
21
21
|
} from '@milaboratories/pl-model-common';
|
|
22
22
|
import {
|
|
23
|
+
Annotation,
|
|
23
24
|
canonicalizeJson,
|
|
24
25
|
getAxisId,
|
|
25
26
|
getColumnIdAndSpec,
|
|
26
27
|
matchAxisId,
|
|
28
|
+
PColumnName,
|
|
29
|
+
readAnnotation,
|
|
27
30
|
} from '@milaboratories/pl-model-common';
|
|
28
31
|
import type {
|
|
29
32
|
AxisLabelProvider,
|
|
@@ -468,7 +471,7 @@ export type CreatePlDataTableOps = {
|
|
|
468
471
|
|
|
469
472
|
/** Check if column is a label column */
|
|
470
473
|
export function isLabelColumn(column: PColumnSpec) {
|
|
471
|
-
return column.axesSpec.length === 1 && column.name ===
|
|
474
|
+
return column.axesSpec.length === 1 && column.name === PColumnName.Label;
|
|
472
475
|
}
|
|
473
476
|
|
|
474
477
|
/** Get all label columns from the result pool */
|
|
@@ -479,7 +482,7 @@ export function getAllLabelColumns(
|
|
|
479
482
|
.addAxisLabelProvider(resultPool)
|
|
480
483
|
.addColumnProvider(resultPool)
|
|
481
484
|
.getColumns({
|
|
482
|
-
name:
|
|
485
|
+
name: PColumnName.Label,
|
|
483
486
|
axes: [{}], // exactly one axis
|
|
484
487
|
}, { dontWaitAllData: true });
|
|
485
488
|
}
|
|
@@ -587,6 +590,9 @@ export function allColumnsComputed(
|
|
|
587
590
|
case 'BinaryPartitioned':
|
|
588
591
|
return Object.values(d.parts)
|
|
589
592
|
.every((p) => p.index.getIsReadyOrError() && p.values.getIsReadyOrError());
|
|
593
|
+
case 'ParquetPartitioned':
|
|
594
|
+
return Object.values(d.parts)
|
|
595
|
+
.every((p) => p.getIsReadyOrError());
|
|
590
596
|
}
|
|
591
597
|
} else {
|
|
592
598
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
@@ -642,13 +648,13 @@ export type PlDataTableModel = {
|
|
|
642
648
|
};
|
|
643
649
|
|
|
644
650
|
/** Check if column should be omitted from the table */
|
|
645
|
-
export function isColumnHidden(spec: { annotations?:
|
|
646
|
-
return spec.
|
|
651
|
+
export function isColumnHidden(spec: { annotations?: Annotation }): boolean {
|
|
652
|
+
return readAnnotation(spec, Annotation.Table.Visibility) === 'hidden';
|
|
647
653
|
}
|
|
648
654
|
|
|
649
655
|
/** Check if column is hidden by default */
|
|
650
|
-
export function isColumnOptional(spec: { annotations?:
|
|
651
|
-
return spec.
|
|
656
|
+
export function isColumnOptional(spec: { annotations?: Annotation }): boolean {
|
|
657
|
+
return readAnnotation(spec, Annotation.Table.Visibility) === 'optional';
|
|
652
658
|
}
|
|
653
659
|
|
|
654
660
|
/**
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Annotation,
|
|
2
3
|
isPTableAbsent,
|
|
3
4
|
type PColumn,
|
|
4
5
|
type PColumnIdAndSpec,
|
|
5
6
|
type PColumnKey,
|
|
7
|
+
PColumnName,
|
|
6
8
|
type PColumnValues,
|
|
7
9
|
type PObjectId,
|
|
8
10
|
type PTableColumnId,
|
|
11
|
+
stringifyJson,
|
|
9
12
|
uniquePlId,
|
|
13
|
+
ValueType,
|
|
10
14
|
} from '@milaboratories/pl-model-common';
|
|
11
15
|
import { type PlSelectionModel } from './PlSelectionModel';
|
|
12
16
|
|
|
@@ -58,14 +62,14 @@ export function createRowSelectionColumn({
|
|
|
58
62
|
id: columnId,
|
|
59
63
|
spec: {
|
|
60
64
|
kind: 'PColumn',
|
|
61
|
-
valueType:
|
|
62
|
-
name:
|
|
65
|
+
valueType: ValueType.Int,
|
|
66
|
+
name: PColumnName.Table.RowSelection,
|
|
63
67
|
axesSpec: selection.axesSpec,
|
|
64
68
|
...(domain && Object.keys(domain).length && { domain }),
|
|
65
69
|
annotations: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
70
|
+
[Annotation.Label]: label,
|
|
71
|
+
[Annotation.DiscreteValues]: stringifyJson([1]),
|
|
72
|
+
} satisfies Annotation,
|
|
69
73
|
},
|
|
70
74
|
data,
|
|
71
75
|
};
|
package/src/render/api.ts
CHANGED
|
@@ -36,6 +36,8 @@ import {
|
|
|
36
36
|
mapPObjectData,
|
|
37
37
|
mapPTableDef,
|
|
38
38
|
mapValueInVOE,
|
|
39
|
+
PColumnName,
|
|
40
|
+
readAnnotation,
|
|
39
41
|
selectorsToPredicate,
|
|
40
42
|
withEnrichments,
|
|
41
43
|
} from '@milaboratories/pl-model-common';
|
|
@@ -427,7 +429,7 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
427
429
|
|
|
428
430
|
const spec = column.obj.spec;
|
|
429
431
|
if (
|
|
430
|
-
spec.name ===
|
|
432
|
+
spec.name === PColumnName.Label
|
|
431
433
|
&& spec.axesSpec.length === 1
|
|
432
434
|
&& spec.axesSpec[0].name === axis.name
|
|
433
435
|
&& spec.axesSpec[0].type === axis.type
|
|
@@ -497,7 +499,7 @@ export class ResultPool implements ColumnProvider, AxisLabelProvider {
|
|
|
497
499
|
public findLabelsForColumnAxis(column: PColumnSpec, axisIdx: number): Record<string | number, string> | undefined {
|
|
498
500
|
const labels = this.findLabels(column.axesSpec[axisIdx]);
|
|
499
501
|
if (!labels) return undefined;
|
|
500
|
-
const axisKeys = column
|
|
502
|
+
const axisKeys = readAnnotation(column, `pl7.app/axisKeys/${axisIdx}`);
|
|
501
503
|
if (axisKeys !== undefined) {
|
|
502
504
|
const keys = JSON.parse(axisKeys) as string[];
|
|
503
505
|
return Object.fromEntries(keys.map((key) => {
|