@platforma-sdk/model 1.45.0 → 1.45.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/components/PFrameForGraphs.cjs +5 -22
- package/dist/components/PFrameForGraphs.cjs.map +1 -1
- package/dist/components/PFrameForGraphs.d.ts +0 -2
- package/dist/components/PFrameForGraphs.d.ts.map +1 -1
- package/dist/components/PFrameForGraphs.js +7 -22
- package/dist/components/PFrameForGraphs.js.map +1 -1
- package/dist/components/PlDataTable.cjs +6 -38
- package/dist/components/PlDataTable.cjs.map +1 -1
- package/dist/components/PlDataTable.d.ts +1 -4
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/components/PlDataTable.js +7 -38
- package/dist/components/PlDataTable.js.map +1 -1
- package/dist/index.cjs +2 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -3
- package/dist/package.json.cjs +1 -1
- package/dist/package.json.js +1 -1
- package/dist/render/api.cjs +7 -1
- package/dist/render/api.cjs.map +1 -1
- package/dist/render/api.d.ts +3 -3
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/api.js +7 -1
- package/dist/render/api.js.map +1 -1
- package/dist/render/util/pcolumn_data.cjs +21 -0
- package/dist/render/util/pcolumn_data.cjs.map +1 -1
- package/dist/render/util/pcolumn_data.d.ts +4 -1
- package/dist/render/util/pcolumn_data.d.ts.map +1 -1
- package/dist/render/util/pcolumn_data.js +21 -2
- package/dist/render/util/pcolumn_data.js.map +1 -1
- package/package.json +4 -4
- package/src/components/PFrameForGraphs.ts +5 -23
- package/src/components/PlDataTable.ts +5 -40
- package/src/render/api.ts +9 -5
- package/src/render/util/pcolumn_data.ts +24 -0
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
DataInfo,
|
|
3
3
|
PartitionedDataInfoEntries,
|
|
4
|
+
PColumn,
|
|
5
|
+
PColumnValues,
|
|
4
6
|
} from '@milaboratories/pl-model-common';
|
|
5
7
|
import {
|
|
6
8
|
dataInfoToEntries,
|
|
7
9
|
isDataInfo,
|
|
8
10
|
isDataInfoEntries,
|
|
11
|
+
visitDataInfo,
|
|
9
12
|
type BinaryChunk,
|
|
10
13
|
type DataInfoEntries,
|
|
11
14
|
type PColumnDataEntry,
|
|
12
15
|
type PColumnKey,
|
|
13
16
|
} from '@milaboratories/pl-model-common';
|
|
14
17
|
import { TreeNodeAccessor } from '../accessor';
|
|
18
|
+
import type { PColumnDataUniversal } from '../api';
|
|
15
19
|
|
|
16
20
|
const PCD_PREFIX = 'PColumnData/';
|
|
17
21
|
|
|
@@ -507,3 +511,23 @@ DataInfoEntries<TreeNodeAccessor> | undefined {
|
|
|
507
511
|
|
|
508
512
|
throw new Error(`Unexpected input type: ${typeof acc}`);
|
|
509
513
|
}
|
|
514
|
+
|
|
515
|
+
export function isPColumnReady(c: PColumn<PColumnDataUniversal>): boolean {
|
|
516
|
+
const isValues = (d: PColumnDataUniversal): d is PColumnValues => Array.isArray(d);
|
|
517
|
+
const isAccessor = (d: PColumnDataUniversal): d is TreeNodeAccessor => d instanceof TreeNodeAccessor;
|
|
518
|
+
|
|
519
|
+
let ready = true;
|
|
520
|
+
if (isAccessor(c.data)) {
|
|
521
|
+
ready &&= c.data.getIsReadyOrError();
|
|
522
|
+
} else if (isDataInfo(c.data)) {
|
|
523
|
+
visitDataInfo(c.data, (v) => ready &&= v.getIsReadyOrError());
|
|
524
|
+
} else if (!isValues(c.data)) {
|
|
525
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
526
|
+
throw Error(`unsupported column data type: ${c.data satisfies never}`);
|
|
527
|
+
}
|
|
528
|
+
return ready;
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
export function allPColumnsReady(columns: PColumn<PColumnDataUniversal>[]): boolean {
|
|
532
|
+
return columns.every(isPColumnReady);
|
|
533
|
+
}
|