@milaboratories/pl-model-common 1.16.3 → 1.16.5
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/drivers/pframe/data_info.d.ts +6 -0
- package/dist/drivers/pframe/data_info.d.ts.map +1 -1
- package/dist/drivers/pframe/table_common.d.ts +5 -3
- package/dist/drivers/pframe/table_common.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +146 -129
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/drivers/pframe/data_info.ts +31 -0
- package/src/drivers/pframe/table_common.ts +13 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/pl-model-common",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.5",
|
|
4
4
|
"description": "Platforma SDK Model",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"typescript": "~5.6.3",
|
|
27
27
|
"vite": "^6.3.5",
|
|
28
28
|
"vitest": "^2.1.9",
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
29
|
+
"@platforma-sdk/eslint-config": "1.0.3",
|
|
30
|
+
"@milaboratories/build-configs": "1.0.4"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"type-check": "tsc --noEmit --composite false",
|
|
@@ -189,6 +189,37 @@ export function mapDataInfo<B1, B2>(
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
+
/**
|
|
193
|
+
* @param dataInfo - The source DataInfo object
|
|
194
|
+
* @param cb - Callback, function that have access to every blob to visit them all
|
|
195
|
+
* @returns Nothing
|
|
196
|
+
*/
|
|
197
|
+
export function visitDataInfo<B>(
|
|
198
|
+
dataInfo: DataInfo<B>,
|
|
199
|
+
cb: (blob: B) => void,
|
|
200
|
+
): void {
|
|
201
|
+
switch (dataInfo.type) {
|
|
202
|
+
case 'Json':
|
|
203
|
+
// Json type doesn't contain blobs, so return as is
|
|
204
|
+
break;
|
|
205
|
+
case 'JsonPartitioned': {
|
|
206
|
+
// Visit each blob in parts
|
|
207
|
+
for (const [_, blob] of Object.entries(dataInfo.parts)) {
|
|
208
|
+
cb(blob);
|
|
209
|
+
}
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
case 'BinaryPartitioned': {
|
|
213
|
+
// Visit each index and values blob in parts
|
|
214
|
+
for (const [_, chunk] of Object.entries(dataInfo.parts)) {
|
|
215
|
+
cb(chunk.index);
|
|
216
|
+
cb(chunk.values);
|
|
217
|
+
}
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
|
|
192
223
|
//
|
|
193
224
|
// Lightway representation for ExplicitJsonData
|
|
194
225
|
//
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { PObjectId } from '../../pool';
|
|
2
2
|
import type { AxisId, AxisSpec, PColumnSpec } from './spec/spec';
|
|
3
3
|
|
|
4
|
+
export type PTableColumnSpecAxis = {
|
|
5
|
+
type: 'axis';
|
|
6
|
+
id: AxisId;
|
|
7
|
+
spec: AxisSpec;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type PTableColumnSpecColumn = {
|
|
11
|
+
type: 'column';
|
|
12
|
+
id: PObjectId;
|
|
13
|
+
spec: PColumnSpec;
|
|
14
|
+
};
|
|
15
|
+
|
|
4
16
|
/** Unified spec object for axes and columns */
|
|
5
|
-
export type PTableColumnSpec =
|
|
6
|
-
| {
|
|
7
|
-
type: 'axis';
|
|
8
|
-
id: AxisId;
|
|
9
|
-
spec: AxisSpec;
|
|
10
|
-
}
|
|
11
|
-
| {
|
|
12
|
-
type: 'column';
|
|
13
|
-
id: PObjectId;
|
|
14
|
-
spec: PColumnSpec;
|
|
15
|
-
};
|
|
17
|
+
export type PTableColumnSpec = PTableColumnSpecAxis | PTableColumnSpecColumn;
|
|
16
18
|
|
|
17
19
|
export type PTableColumnIdAxis = {
|
|
18
20
|
type: 'axis';
|