@milaboratories/milaboratories.ui-examples.model 1.2.46 → 1.3.1
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/.turbo/turbo-build.log +3 -3
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +18 -0
- package/dist/bundle.js +142 -118
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +5 -5
- package/src/index.ts +2 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @milaboratories/milaboratories.ui-examples.model@1.
|
|
3
|
+
> @milaboratories/milaboratories.ui-examples.model@1.3.1 build /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
|
|
4
4
|
> ts-builder build --target block-model && block-tools build-model
|
|
5
5
|
|
|
6
6
|
Building block-model project...
|
|
7
7
|
↳ rollup -c /configs/rollup.block-model.config.js
|
|
8
8
|
[36m
|
|
9
9
|
[1m./src/index.ts[22m → [1mdist, dist[22m...[39m
|
|
10
|
-
[32mcreated [1mdist, dist[22m in [
|
|
10
|
+
[32mcreated [1mdist, dist[22m in [1m8.4s[22m[39m
|
|
11
11
|
[36m
|
|
12
12
|
[1m./src/index.ts[22m → [1mdist[22m...[39m
|
|
13
13
|
[1m[33m(!) Circular dependency[39m[22m
|
|
14
14
|
../../../../sdk/model/dist/components/PFrameForGraphs.js -> ../../../../sdk/model/dist/components/PlDataTable.js -> ../../../../sdk/model/dist/components/PFrameForGraphs.js
|
|
15
|
-
[32mcreated [1mdist[22m in [
|
|
15
|
+
[32mcreated [1mdist[22m in [1m6.3s[22m[39m
|
|
16
16
|
Build completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @milaboratories/milaboratories.ui-examples.model@1.
|
|
3
|
+
> @milaboratories/milaboratories.ui-examples.model@1.3.1 type-check /home/runner/_work/platforma/platforma/etc/blocks/ui-examples/model
|
|
4
4
|
> ts-builder types --target block-model
|
|
5
5
|
|
|
6
6
|
↳ tsc --noEmit --project ./tsconfig.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @milaboratories/milaboratories.ui-examples.model
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [64cee78]
|
|
8
|
+
- @platforma-sdk/model@1.45.17
|
|
9
|
+
|
|
10
|
+
## 1.3.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 3ef2381: Generelazation filters and annotations
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies [3ef2381]
|
|
19
|
+
- @platforma-sdk/model@1.45.0
|
|
20
|
+
|
|
3
21
|
## 1.2.46
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/bundle.js
CHANGED
|
@@ -4392,6 +4392,36 @@
|
|
|
4392
4392
|
}
|
|
4393
4393
|
}
|
|
4394
4394
|
}
|
|
4395
|
+
/**
|
|
4396
|
+
* @param dataInfo - The source DataInfo object
|
|
4397
|
+
* @param cb - Callback, function that have access to every blob to visit them all
|
|
4398
|
+
* @returns Nothing
|
|
4399
|
+
*/
|
|
4400
|
+
function visitDataInfo(dataInfo, cb) {
|
|
4401
|
+
switch (dataInfo.type) {
|
|
4402
|
+
case 'Json':
|
|
4403
|
+
// Json type doesn't contain blobs, so return as is
|
|
4404
|
+
break;
|
|
4405
|
+
case 'JsonPartitioned': {
|
|
4406
|
+
// Visit each blob in parts
|
|
4407
|
+
Object.values(dataInfo.parts).forEach(cb);
|
|
4408
|
+
break;
|
|
4409
|
+
}
|
|
4410
|
+
case 'BinaryPartitioned': {
|
|
4411
|
+
// Visit each index and values blob in parts
|
|
4412
|
+
Object.values(dataInfo.parts).forEach((chunk) => {
|
|
4413
|
+
cb(chunk.index);
|
|
4414
|
+
cb(chunk.values);
|
|
4415
|
+
});
|
|
4416
|
+
break;
|
|
4417
|
+
}
|
|
4418
|
+
case 'ParquetPartitioned': {
|
|
4419
|
+
// Visit each blob in parts
|
|
4420
|
+
Object.values(dataInfo.parts).forEach(cb);
|
|
4421
|
+
break;
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
}
|
|
4395
4425
|
/**
|
|
4396
4426
|
* Type guard function that checks if the given value is a valid DataInfoEntries.
|
|
4397
4427
|
*
|
|
@@ -5528,6 +5558,89 @@
|
|
|
5528
5558
|
const StagingAccessorName = 'staging';
|
|
5529
5559
|
const MainAccessorName = 'main';
|
|
5530
5560
|
|
|
5561
|
+
function filterDataInfoEntries(dataInfoEntries, axisFilters) {
|
|
5562
|
+
// Sort filters by axis index in descending order to safely remove elements from arrays
|
|
5563
|
+
const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
|
|
5564
|
+
// Check for invalid filter axes
|
|
5565
|
+
const { type } = dataInfoEntries;
|
|
5566
|
+
switch (type) {
|
|
5567
|
+
case 'Json': {
|
|
5568
|
+
const { keyLength } = dataInfoEntries;
|
|
5569
|
+
for (const [axisIdx] of axisFilters)
|
|
5570
|
+
if (axisIdx >= keyLength)
|
|
5571
|
+
throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
|
|
5572
|
+
break;
|
|
5573
|
+
}
|
|
5574
|
+
case 'JsonPartitioned':
|
|
5575
|
+
case 'BinaryPartitioned':
|
|
5576
|
+
case 'ParquetPartitioned': {
|
|
5577
|
+
const { partitionKeyLength } = dataInfoEntries;
|
|
5578
|
+
for (const [axisIdx] of axisFilters)
|
|
5579
|
+
if (axisIdx >= partitionKeyLength)
|
|
5580
|
+
throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);
|
|
5581
|
+
break;
|
|
5582
|
+
}
|
|
5583
|
+
default:
|
|
5584
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
5585
|
+
throw new Error(`Unsupported data info type: ${type}`);
|
|
5586
|
+
}
|
|
5587
|
+
const keyMatchesFilters = (key) => {
|
|
5588
|
+
for (const [axisIdx, axisValue] of sortedFilters)
|
|
5589
|
+
if (key[axisIdx] !== axisValue)
|
|
5590
|
+
return false;
|
|
5591
|
+
return true;
|
|
5592
|
+
};
|
|
5593
|
+
const removeFilteredAxes = (key) => {
|
|
5594
|
+
const newKey = [...key];
|
|
5595
|
+
// Remove axes in descending order to maintain correct indices
|
|
5596
|
+
for (const [axisIdx] of sortedFilters)
|
|
5597
|
+
newKey.splice(axisIdx, 1);
|
|
5598
|
+
return newKey;
|
|
5599
|
+
};
|
|
5600
|
+
switch (dataInfoEntries.type) {
|
|
5601
|
+
case 'Json': return {
|
|
5602
|
+
type: 'Json',
|
|
5603
|
+
keyLength: dataInfoEntries.keyLength - axisFilters.length,
|
|
5604
|
+
data: dataInfoEntries.data
|
|
5605
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
5606
|
+
.map((entry) => ({
|
|
5607
|
+
key: removeFilteredAxes(entry.key),
|
|
5608
|
+
value: entry.value,
|
|
5609
|
+
})),
|
|
5610
|
+
};
|
|
5611
|
+
case 'JsonPartitioned': return {
|
|
5612
|
+
type: 'JsonPartitioned',
|
|
5613
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
5614
|
+
parts: dataInfoEntries.parts
|
|
5615
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
5616
|
+
.map((entry) => ({
|
|
5617
|
+
key: removeFilteredAxes(entry.key),
|
|
5618
|
+
value: entry.value,
|
|
5619
|
+
})),
|
|
5620
|
+
};
|
|
5621
|
+
case 'BinaryPartitioned': return {
|
|
5622
|
+
type: 'BinaryPartitioned',
|
|
5623
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
5624
|
+
parts: dataInfoEntries.parts
|
|
5625
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
5626
|
+
.map((entry) => ({
|
|
5627
|
+
key: removeFilteredAxes(entry.key),
|
|
5628
|
+
value: entry.value,
|
|
5629
|
+
})),
|
|
5630
|
+
};
|
|
5631
|
+
case 'ParquetPartitioned': return {
|
|
5632
|
+
type: 'ParquetPartitioned',
|
|
5633
|
+
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
5634
|
+
parts: dataInfoEntries.parts
|
|
5635
|
+
.filter((entry) => keyMatchesFilters(entry.key))
|
|
5636
|
+
.map((entry) => ({
|
|
5637
|
+
key: removeFilteredAxes(entry.key),
|
|
5638
|
+
value: entry.value,
|
|
5639
|
+
})),
|
|
5640
|
+
};
|
|
5641
|
+
}
|
|
5642
|
+
}
|
|
5643
|
+
|
|
5531
5644
|
const TraceEntry = z.object({
|
|
5532
5645
|
type: z.string(),
|
|
5533
5646
|
importance: z.number().optional(),
|
|
@@ -6011,88 +6124,24 @@
|
|
|
6011
6124
|
return parsePColumnData(acc);
|
|
6012
6125
|
throw new Error(`Unexpected input type: ${typeof acc}`);
|
|
6013
6126
|
}
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
switch (type) {
|
|
6021
|
-
case 'Json': {
|
|
6022
|
-
const { keyLength } = dataInfoEntries;
|
|
6023
|
-
for (const [axisIdx] of axisFilters)
|
|
6024
|
-
if (axisIdx >= keyLength)
|
|
6025
|
-
throw new Error(`Can't filter on non-data axis ${axisIdx}. Must be >= ${keyLength}`);
|
|
6026
|
-
break;
|
|
6027
|
-
}
|
|
6028
|
-
case 'JsonPartitioned':
|
|
6029
|
-
case 'BinaryPartitioned':
|
|
6030
|
-
case 'ParquetPartitioned': {
|
|
6031
|
-
const { partitionKeyLength } = dataInfoEntries;
|
|
6032
|
-
for (const [axisIdx] of axisFilters)
|
|
6033
|
-
if (axisIdx >= partitionKeyLength)
|
|
6034
|
-
throw new Error(`Can't filter on non-partitioned axis ${axisIdx}. Must be >= ${partitionKeyLength}`);
|
|
6035
|
-
break;
|
|
6036
|
-
}
|
|
6037
|
-
default:
|
|
6038
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
6039
|
-
throw new Error(`Unsupported data info type: ${type}`);
|
|
6127
|
+
function isPColumnReady(c) {
|
|
6128
|
+
const isValues = (d) => Array.isArray(d);
|
|
6129
|
+
const isAccessor = (d) => d instanceof TreeNodeAccessor;
|
|
6130
|
+
let ready = true;
|
|
6131
|
+
if (isAccessor(c.data)) {
|
|
6132
|
+
ready &&= c.data.getIsReadyOrError();
|
|
6040
6133
|
}
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
const removeFilteredAxes = (key) => {
|
|
6048
|
-
const newKey = [...key];
|
|
6049
|
-
// Remove axes in descending order to maintain correct indices
|
|
6050
|
-
for (const [axisIdx] of sortedFilters)
|
|
6051
|
-
newKey.splice(axisIdx, 1);
|
|
6052
|
-
return newKey;
|
|
6053
|
-
};
|
|
6054
|
-
switch (dataInfoEntries.type) {
|
|
6055
|
-
case 'Json': return {
|
|
6056
|
-
type: 'Json',
|
|
6057
|
-
keyLength: dataInfoEntries.keyLength - axisFilters.length,
|
|
6058
|
-
data: dataInfoEntries.data
|
|
6059
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
6060
|
-
.map((entry) => ({
|
|
6061
|
-
key: removeFilteredAxes(entry.key),
|
|
6062
|
-
value: entry.value,
|
|
6063
|
-
})),
|
|
6064
|
-
};
|
|
6065
|
-
case 'JsonPartitioned': return {
|
|
6066
|
-
type: 'JsonPartitioned',
|
|
6067
|
-
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
6068
|
-
parts: dataInfoEntries.parts
|
|
6069
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
6070
|
-
.map((entry) => ({
|
|
6071
|
-
key: removeFilteredAxes(entry.key),
|
|
6072
|
-
value: entry.value,
|
|
6073
|
-
})),
|
|
6074
|
-
};
|
|
6075
|
-
case 'BinaryPartitioned': return {
|
|
6076
|
-
type: 'BinaryPartitioned',
|
|
6077
|
-
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
6078
|
-
parts: dataInfoEntries.parts
|
|
6079
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
6080
|
-
.map((entry) => ({
|
|
6081
|
-
key: removeFilteredAxes(entry.key),
|
|
6082
|
-
value: entry.value,
|
|
6083
|
-
})),
|
|
6084
|
-
};
|
|
6085
|
-
case 'ParquetPartitioned': return {
|
|
6086
|
-
type: 'ParquetPartitioned',
|
|
6087
|
-
partitionKeyLength: dataInfoEntries.partitionKeyLength - axisFilters.length,
|
|
6088
|
-
parts: dataInfoEntries.parts
|
|
6089
|
-
.filter((entry) => keyMatchesFilters(entry.key))
|
|
6090
|
-
.map((entry) => ({
|
|
6091
|
-
key: removeFilteredAxes(entry.key),
|
|
6092
|
-
value: entry.value,
|
|
6093
|
-
})),
|
|
6094
|
-
};
|
|
6134
|
+
else if (isDataInfo(c.data)) {
|
|
6135
|
+
visitDataInfo(c.data, (v) => ready &&= v.getIsReadyOrError());
|
|
6136
|
+
}
|
|
6137
|
+
else if (!isValues(c.data)) {
|
|
6138
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
6139
|
+
throw Error(`unsupported column data type: ${c.data}`);
|
|
6095
6140
|
}
|
|
6141
|
+
return ready;
|
|
6142
|
+
}
|
|
6143
|
+
function allPColumnsReady(columns) {
|
|
6144
|
+
return columns.every(isPColumnReady);
|
|
6096
6145
|
}
|
|
6097
6146
|
|
|
6098
6147
|
function isPColumnValues(value) {
|
|
@@ -6898,6 +6947,8 @@
|
|
|
6898
6947
|
// TODO remove all non-PColumn fields
|
|
6899
6948
|
createPFrame(def) {
|
|
6900
6949
|
this.verifyInlineAndExplicitColumnsSupport(def);
|
|
6950
|
+
if (!allPColumnsReady(def))
|
|
6951
|
+
return undefined;
|
|
6901
6952
|
return this.ctx.createPFrame(def.map((c) => transformPColumnData(c)));
|
|
6902
6953
|
}
|
|
6903
6954
|
createPTable(def) {
|
|
@@ -6916,7 +6967,10 @@
|
|
|
6916
6967
|
else {
|
|
6917
6968
|
rawDef = this.patchPTableDef(def);
|
|
6918
6969
|
}
|
|
6919
|
-
|
|
6970
|
+
const columns = extractAllColumns(rawDef.src);
|
|
6971
|
+
this.verifyInlineAndExplicitColumnsSupport(columns);
|
|
6972
|
+
if (!allPColumnsReady(columns))
|
|
6973
|
+
return undefined;
|
|
6920
6974
|
return this.ctx.createPTable(mapPTableDef(rawDef, (po) => transformPColumnData(po)));
|
|
6921
6975
|
}
|
|
6922
6976
|
/** @deprecated scheduled for removal from SDK */
|
|
@@ -6937,7 +6991,7 @@
|
|
|
6937
6991
|
}
|
|
6938
6992
|
}
|
|
6939
6993
|
|
|
6940
|
-
var version = "1.
|
|
6994
|
+
var version = "1.45.17";
|
|
6941
6995
|
|
|
6942
6996
|
const PlatformaSDKVersion = version;
|
|
6943
6997
|
|
|
@@ -7236,41 +7290,6 @@
|
|
|
7236
7290
|
}
|
|
7237
7291
|
return labelColumns;
|
|
7238
7292
|
}
|
|
7239
|
-
/** Check if all columns are computed */
|
|
7240
|
-
function allColumnsComputed(columns) {
|
|
7241
|
-
const isValues = (d) => Array.isArray(d);
|
|
7242
|
-
const isAccessor = (d) => d instanceof TreeNodeAccessor;
|
|
7243
|
-
const isDataInfo = (d) => typeof d === 'object' && 'type' in d;
|
|
7244
|
-
return columns
|
|
7245
|
-
.map((c) => c.data)
|
|
7246
|
-
.every((d) => {
|
|
7247
|
-
if (isValues(d)) {
|
|
7248
|
-
return true;
|
|
7249
|
-
}
|
|
7250
|
-
else if (isAccessor(d)) {
|
|
7251
|
-
return d.getIsReadyOrError();
|
|
7252
|
-
}
|
|
7253
|
-
else if (isDataInfo(d)) {
|
|
7254
|
-
const type = d.type;
|
|
7255
|
-
switch (type) {
|
|
7256
|
-
case 'Json':
|
|
7257
|
-
return true;
|
|
7258
|
-
case 'JsonPartitioned':
|
|
7259
|
-
return Object.values(d.parts).every((p) => p.getIsReadyOrError());
|
|
7260
|
-
case 'BinaryPartitioned':
|
|
7261
|
-
return Object.values(d.parts)
|
|
7262
|
-
.every((p) => p.index.getIsReadyOrError() && p.values.getIsReadyOrError());
|
|
7263
|
-
case 'ParquetPartitioned':
|
|
7264
|
-
return Object.values(d.parts)
|
|
7265
|
-
.every((p) => p.getIsReadyOrError());
|
|
7266
|
-
}
|
|
7267
|
-
}
|
|
7268
|
-
else {
|
|
7269
|
-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
7270
|
-
throw Error(`unsupported column data type: ${d}`);
|
|
7271
|
-
}
|
|
7272
|
-
});
|
|
7273
|
-
}
|
|
7274
7293
|
function createPTableDef(params) {
|
|
7275
7294
|
let coreColumns = params.columns;
|
|
7276
7295
|
const secondaryColumns = [];
|
|
@@ -7360,6 +7379,8 @@
|
|
|
7360
7379
|
coreColumnPredicate: ops?.coreColumnPredicate,
|
|
7361
7380
|
});
|
|
7362
7381
|
const fullHandle = ctx.createPTable(fullDef);
|
|
7382
|
+
if (!fullHandle)
|
|
7383
|
+
return undefined;
|
|
7363
7384
|
const hiddenColumns = new Set((() => {
|
|
7364
7385
|
const hiddenColIds = tableStateNormalized.pTableParams.hiddenColIds;
|
|
7365
7386
|
if (hiddenColIds)
|
|
@@ -7381,7 +7402,7 @@
|
|
|
7381
7402
|
const visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));
|
|
7382
7403
|
const visibleLabelColumns = getMatchingLabelColumns(visibleColumns.map(getColumnIdAndSpec), allLabelColumns);
|
|
7383
7404
|
// if at least one column is not yet computed, we can't show the table
|
|
7384
|
-
if (!
|
|
7405
|
+
if (!allPColumnsReady([...visibleColumns, ...visibleLabelColumns]))
|
|
7385
7406
|
return undefined;
|
|
7386
7407
|
const visibleDef = createPTableDef({
|
|
7387
7408
|
columns: visibleColumns,
|
|
@@ -7393,6 +7414,8 @@
|
|
|
7393
7414
|
coreColumnPredicate,
|
|
7394
7415
|
});
|
|
7395
7416
|
const visibleHandle = ctx.createPTable(visibleDef);
|
|
7417
|
+
if (!visibleHandle)
|
|
7418
|
+
return undefined;
|
|
7396
7419
|
return {
|
|
7397
7420
|
sourceId: tableStateNormalized.pTableParams.sourceId,
|
|
7398
7421
|
fullTableHandle: fullHandle,
|
|
@@ -7757,6 +7780,7 @@
|
|
|
7757
7780
|
{ type: 'link', href: '/typography', label: 'Typography' },
|
|
7758
7781
|
{ type: 'link', href: '/ag-grid-vue', label: 'AgGridVue' },
|
|
7759
7782
|
{ type: 'link', href: '/ag-grid-vue-with-builder', label: 'AgGridVue with builder' },
|
|
7783
|
+
{ type: 'link', href: '/pl-annotations', label: 'PlAnnotations' },
|
|
7760
7784
|
{ type: 'link', href: '/pl-ag-data-table-v2', label: 'PlAgDataTableV2' },
|
|
7761
7785
|
{ type: 'link', href: '/pl-splash-page', label: 'PlSplashPage' },
|
|
7762
7786
|
{ type: 'link', href: '/pl-file-input-page', label: 'PlFileInputPage' },
|