@platforma-open/milaboratories.sequence-properties.model 1.2.1 → 1.2.3
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 +10 -10
- package/.turbo/turbo-check.log +4 -4
- package/CHANGELOG.md +20 -0
- package/dist/bundle.js +339 -1224
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +2 -33
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -34
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +1 -1
- package/src/index.ts +12 -91
package/dist/bundle.js
CHANGED
|
@@ -4973,6 +4973,9 @@
|
|
|
4973
4973
|
Sequence: "pl7.app/vdj/sequence"
|
|
4974
4974
|
}
|
|
4975
4975
|
};
|
|
4976
|
+
function isLabelColumn(column) {
|
|
4977
|
+
return column.axesSpec.length === 1 && column.name === PColumnName.Label;
|
|
4978
|
+
}
|
|
4976
4979
|
/** Get column id and spec from a column */
|
|
4977
4980
|
function getColumnIdAndSpec(column) {
|
|
4978
4981
|
return {
|
|
@@ -5545,47 +5548,6 @@
|
|
|
5545
5548
|
return v === null || v === void 0;
|
|
5546
5549
|
}
|
|
5547
5550
|
Array.isArray;
|
|
5548
|
-
function isObject(value) {
|
|
5549
|
-
return typeof value === "object" && value !== null;
|
|
5550
|
-
}
|
|
5551
|
-
/**
|
|
5552
|
-
* Checks if the given value is a plain object.
|
|
5553
|
-
*
|
|
5554
|
-
* A plain object is defined as an object created by the `{}` literal,
|
|
5555
|
-
* an object created with `Object.create(null)`, or an object with a
|
|
5556
|
-
* prototype that resolves to `Object.prototype`.
|
|
5557
|
-
*
|
|
5558
|
-
* @param value - The value to check.
|
|
5559
|
-
* @returns `true` if the value is a plain object, otherwise `false`.
|
|
5560
|
-
*
|
|
5561
|
-
* @example
|
|
5562
|
-
* ```typescript
|
|
5563
|
-
* isPlainObject({}); // true
|
|
5564
|
-
* isPlainObject(Object.create(null)); // true
|
|
5565
|
-
* isPlainObject(new Date()); // false
|
|
5566
|
-
* isPlainObject(null); // false
|
|
5567
|
-
* isPlainObject([]); // false
|
|
5568
|
-
* ```
|
|
5569
|
-
*/
|
|
5570
|
-
function isPlainObject(value) {
|
|
5571
|
-
if (!isObject(value)) return false;
|
|
5572
|
-
const prototype = Object.getPrototypeOf(value);
|
|
5573
|
-
return prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null;
|
|
5574
|
-
}
|
|
5575
|
-
/**
|
|
5576
|
-
* Reads a property from a union-typed object where the key may exist only on some members of the union.
|
|
5577
|
-
*
|
|
5578
|
-
* `K` is constrained to keys of the union's intersection, so any key present on at least one union
|
|
5579
|
-
* member is accepted. The return type resolves to `T[K]` when `K` is a key of `T`, otherwise `undefined`
|
|
5580
|
-
* — matching the runtime behavior of reading a missing property.
|
|
5581
|
-
*
|
|
5582
|
-
* @param obj - source object (may be a union of shapes)
|
|
5583
|
-
* @param prop - property name, must be a key of at least one union member
|
|
5584
|
-
* @returns the property value if present, otherwise `undefined`
|
|
5585
|
-
*/
|
|
5586
|
-
function getField(obj, prop) {
|
|
5587
|
-
return obj[prop];
|
|
5588
|
-
}
|
|
5589
5551
|
//#endregion
|
|
5590
5552
|
//#region ../node_modules/.pnpm/@milaboratories+helpers@1.14.2/node_modules/@milaboratories/helpers/dist/error.js
|
|
5591
5553
|
function throwError(v) {
|
|
@@ -5600,22 +5562,6 @@
|
|
|
5600
5562
|
}
|
|
5601
5563
|
createGetIncrementalId();
|
|
5602
5564
|
//#endregion
|
|
5603
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/spec/discovered_column.js
|
|
5604
|
-
function distillDiscoveredPColumn(props) {
|
|
5605
|
-
return {
|
|
5606
|
-
column: props.column,
|
|
5607
|
-
path: Array.isArray(props.path) && props.path.length > 0 ? props.path : void 0,
|
|
5608
|
-
columnQualifications: Array.isArray(props.columnQualifications) && props.columnQualifications.length > 0 ? props.columnQualifications : void 0,
|
|
5609
|
-
queriesQualifications: props.queriesQualifications && Object.keys(props.queriesQualifications).length > 0 ? props.queriesQualifications : void 0
|
|
5610
|
-
};
|
|
5611
|
-
}
|
|
5612
|
-
function createDiscoveredPColumnId(props) {
|
|
5613
|
-
return stringifyDiscoveredPColumnId(props);
|
|
5614
|
-
}
|
|
5615
|
-
function stringifyDiscoveredPColumnId(id) {
|
|
5616
|
-
return canonicalizeJson(distillDiscoveredPColumn(id));
|
|
5617
|
-
}
|
|
5618
|
-
//#endregion
|
|
5619
5565
|
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/drivers/pframe/linker_columns.js
|
|
5620
5566
|
var LinkerMap = class LinkerMap {
|
|
5621
5567
|
/** Graph of linkers connected by axes (single or grouped by parents) */
|
|
@@ -5849,47 +5795,6 @@
|
|
|
5849
5795
|
} : voe;
|
|
5850
5796
|
}
|
|
5851
5797
|
//#endregion
|
|
5852
|
-
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/resource_types.js
|
|
5853
|
-
/** Well-known resource type names used across the platform. */
|
|
5854
|
-
const ResourceTypeName = {
|
|
5855
|
-
StreamManager: "StreamManager",
|
|
5856
|
-
StdMap: "StdMap",
|
|
5857
|
-
StdMapSlash: "std/map",
|
|
5858
|
-
EphStdMap: "EphStdMap",
|
|
5859
|
-
PFrame: "PFrame",
|
|
5860
|
-
ParquetChunk: "ParquetChunk",
|
|
5861
|
-
BContext: "BContext",
|
|
5862
|
-
BlockPackCustom: "BlockPackCustom",
|
|
5863
|
-
BinaryMap: "BinaryMap",
|
|
5864
|
-
BinaryValue: "BinaryValue",
|
|
5865
|
-
BlobMap: "BlobMap",
|
|
5866
|
-
BResolveSingle: "BResolveSingle",
|
|
5867
|
-
BResolveSingleNoResult: "BResolveSingleNoResult",
|
|
5868
|
-
BQueryResult: "BQueryResult",
|
|
5869
|
-
TengoTemplate: "TengoTemplate",
|
|
5870
|
-
TengoLib: "TengoLib",
|
|
5871
|
-
SoftwareInfo: "SoftwareInfo",
|
|
5872
|
-
Dummy: "Dummy",
|
|
5873
|
-
JsonResourceError: "json/resourceError",
|
|
5874
|
-
JsonObject: "json/object",
|
|
5875
|
-
JsonGzObject: "json-gz/object",
|
|
5876
|
-
JsonString: "json/string",
|
|
5877
|
-
JsonArray: "json/array",
|
|
5878
|
-
JsonNumber: "json/number",
|
|
5879
|
-
BContextEnd: "BContextEnd",
|
|
5880
|
-
FrontendFromUrl: "Frontend/FromUrl",
|
|
5881
|
-
FrontendFromFolder: "Frontend/FromFolder",
|
|
5882
|
-
BObjectSpec: "BObjectSpec",
|
|
5883
|
-
Blob: "Blob",
|
|
5884
|
-
Null: "Null",
|
|
5885
|
-
Binary: "binary",
|
|
5886
|
-
LSProvider: "LSProvider",
|
|
5887
|
-
WorkingDirectory: "WorkingDirectory",
|
|
5888
|
-
UserProject: "UserProject",
|
|
5889
|
-
Projects: "Projects",
|
|
5890
|
-
ClientRoot: "ClientRoot"
|
|
5891
|
-
};
|
|
5892
|
-
//#endregion
|
|
5893
5798
|
//#region ../node_modules/.pnpm/@milaboratories+pl-model-common@1.41.2/node_modules/@milaboratories/pl-model-common/dist/services/service_types.js
|
|
5894
5799
|
const SERVICE_ID_PATTERN = /^[a-zA-Z][a-zA-Z0-9]*$/;
|
|
5895
5800
|
const { service, isNodeService, isWasmService, isMainService, getServiceKind, getServiceModelMethods, getServiceUiMethods } = (() => {
|
|
@@ -6286,13 +6191,9 @@
|
|
|
6286
6191
|
}
|
|
6287
6192
|
}
|
|
6288
6193
|
//#endregion
|
|
6289
|
-
//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/function/
|
|
6290
|
-
function
|
|
6291
|
-
return
|
|
6292
|
-
let result = funcs.length ? funcs[0].apply(this, args) : args[0];
|
|
6293
|
-
for (let i = 1; i < funcs.length; i++) result = funcs[i].call(this, result);
|
|
6294
|
-
return result;
|
|
6295
|
-
};
|
|
6194
|
+
//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/function/identity.mjs
|
|
6195
|
+
function identity(x) {
|
|
6196
|
+
return x;
|
|
6296
6197
|
}
|
|
6297
6198
|
//#endregion
|
|
6298
6199
|
//#region ../node_modules/.pnpm/es-toolkit@1.42.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
@@ -6386,7 +6287,7 @@
|
|
|
6386
6287
|
qualifications: entry.qualifications
|
|
6387
6288
|
};
|
|
6388
6289
|
}
|
|
6389
|
-
function formatQualification
|
|
6290
|
+
function formatQualification(q) {
|
|
6390
6291
|
const ctx = q.contextDomain ?? {};
|
|
6391
6292
|
const keys = Object.keys(ctx);
|
|
6392
6293
|
if (keys.length === 0) return q.axis.name;
|
|
@@ -6394,7 +6295,7 @@
|
|
|
6394
6295
|
return Object.prototype.hasOwnProperty.call(ctx, q.axis.name) ? pairs : `${q.axis.name} ${pairs}`;
|
|
6395
6296
|
}
|
|
6396
6297
|
function formatQualifications(qs) {
|
|
6397
|
-
return qs.map(formatQualification
|
|
6298
|
+
return qs.map(formatQualification).join("; ");
|
|
6398
6299
|
}
|
|
6399
6300
|
function computeStepLabel(step, stepIndex, formatters) {
|
|
6400
6301
|
const base = (readAnnotation(step.spec, Annotation.LinkLabel) ?? readAnnotation(step.spec, Annotation.Label))?.trim();
|
|
@@ -6871,7 +6772,7 @@
|
|
|
6871
6772
|
/**
|
|
6872
6773
|
* A simple implementation of {@link ColumnProvider} backed by a pre-defined array of columns.
|
|
6873
6774
|
*/
|
|
6874
|
-
var ArrayColumnProvider
|
|
6775
|
+
var ArrayColumnProvider = class {
|
|
6875
6776
|
constructor(columns) {
|
|
6876
6777
|
this.columns = columns;
|
|
6877
6778
|
}
|
|
@@ -6922,7 +6823,7 @@
|
|
|
6922
6823
|
}
|
|
6923
6824
|
var PColumnCollection = class {
|
|
6924
6825
|
defaultProviderStore = [];
|
|
6925
|
-
providers = [new ArrayColumnProvider
|
|
6826
|
+
providers = [new ArrayColumnProvider(this.defaultProviderStore)];
|
|
6926
6827
|
axisLabelProviders = [];
|
|
6927
6828
|
constructor() {}
|
|
6928
6829
|
addColumnProvider(provider) {
|
|
@@ -8170,471 +8071,196 @@
|
|
|
8170
8071
|
}
|
|
8171
8072
|
};
|
|
8172
8073
|
//#endregion
|
|
8173
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/
|
|
8174
|
-
|
|
8175
|
-
|
|
8176
|
-
|
|
8177
|
-
|
|
8178
|
-
|
|
8179
|
-
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8183
|
-
|
|
8184
|
-
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
|
|
8188
|
-
|
|
8189
|
-
|
|
8190
|
-
|
|
8191
|
-
|
|
8192
|
-
|
|
8193
|
-
|
|
8194
|
-
|
|
8195
|
-
|
|
8196
|
-
|
|
8197
|
-
|
|
8198
|
-
|
|
8199
|
-
|
|
8074
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
|
|
8075
|
+
/** Create id for column copy with added keys in axes domains */
|
|
8076
|
+
const colId = (id, domains, contextDomains) => {
|
|
8077
|
+
let wid = id.toString();
|
|
8078
|
+
domains?.forEach((domain) => {
|
|
8079
|
+
if (domain) for (const [k, v] of Object.entries(domain)) {
|
|
8080
|
+
wid += k;
|
|
8081
|
+
wid += v;
|
|
8082
|
+
}
|
|
8083
|
+
});
|
|
8084
|
+
contextDomains?.forEach((contextDomain) => {
|
|
8085
|
+
if (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {
|
|
8086
|
+
wid += k;
|
|
8087
|
+
wid += v;
|
|
8088
|
+
}
|
|
8089
|
+
});
|
|
8090
|
+
return wid;
|
|
8091
|
+
};
|
|
8092
|
+
/** All combinations with 1 key from each list */
|
|
8093
|
+
function getKeysCombinations(idsLists) {
|
|
8094
|
+
if (!idsLists.length) return [];
|
|
8095
|
+
let result = [[]];
|
|
8096
|
+
idsLists.forEach((list) => {
|
|
8097
|
+
const nextResult = [];
|
|
8098
|
+
list.forEach((key) => {
|
|
8099
|
+
nextResult.push(...result.map((resultItem) => [...resultItem, key]));
|
|
8100
|
+
});
|
|
8101
|
+
result = nextResult;
|
|
8102
|
+
});
|
|
8200
8103
|
return result;
|
|
8201
8104
|
}
|
|
8202
|
-
function
|
|
8203
|
-
const
|
|
8204
|
-
|
|
8205
|
-
|
|
8206
|
-
|
|
8207
|
-
if (input.contextDomain !== void 0) result.contextDomain = normalizeRecord(input.contextDomain);
|
|
8208
|
-
if (input.annotations !== void 0) result.annotations = normalizeRecord(input.annotations);
|
|
8209
|
-
if (input.axes !== void 0) result.axes = input.axes.map(convertRelaxedAxisSelectorToMultiAxisSelector);
|
|
8210
|
-
if (input.partialAxesMatch !== void 0) result.partialAxesMatch = input.partialAxesMatch;
|
|
8211
|
-
return result;
|
|
8105
|
+
function getAvailableWithLinkersAxes(linkerColumns, blockAxes) {
|
|
8106
|
+
const availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));
|
|
8107
|
+
return new Map(availableAxes.map((axisSpec) => {
|
|
8108
|
+
return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
|
|
8109
|
+
}));
|
|
8212
8110
|
}
|
|
8213
|
-
|
|
8214
|
-
|
|
8111
|
+
/** Add columns with fully compatible axes created from partial compatible ones */
|
|
8112
|
+
function enrichCompatible(blockAxes, columns) {
|
|
8113
|
+
return columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));
|
|
8215
8114
|
}
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8228
|
-
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
if (isDataInfo(d)) {
|
|
8247
|
-
let ready = true;
|
|
8248
|
-
let final = true;
|
|
8249
|
-
visitDataInfo(d, (v) => {
|
|
8250
|
-
ready &&= v.getIsReadyOrError();
|
|
8251
|
-
final &&= v.getIsFinal();
|
|
8115
|
+
function getAdditionalColumnsForColumn(blockAxes, column) {
|
|
8116
|
+
const columnAxesIds = column.spec.axesSpec.map(getAxisId);
|
|
8117
|
+
if (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];
|
|
8118
|
+
const secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {
|
|
8119
|
+
const result = [];
|
|
8120
|
+
for (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);
|
|
8121
|
+
return result;
|
|
8122
|
+
}));
|
|
8123
|
+
const allAddedDomainValues = /* @__PURE__ */ new Set();
|
|
8124
|
+
const addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();
|
|
8125
|
+
const addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {
|
|
8126
|
+
const addedSet = /* @__PURE__ */ new Set();
|
|
8127
|
+
idsList.map((axisId, idx) => {
|
|
8128
|
+
const d1 = column.spec.axesSpec[idx].domain;
|
|
8129
|
+
const d2 = axisId.domain;
|
|
8130
|
+
Object.entries(d2 ?? {}).forEach(([key, value]) => {
|
|
8131
|
+
if (d1?.[key] === void 0) {
|
|
8132
|
+
const item = JSON.stringify([key, value]);
|
|
8133
|
+
addedSet.add(item);
|
|
8134
|
+
allAddedDomainValues.add(item);
|
|
8135
|
+
}
|
|
8136
|
+
});
|
|
8137
|
+
const cd1 = column.spec.axesSpec[idx].contextDomain;
|
|
8138
|
+
const cd2 = axisId.contextDomain;
|
|
8139
|
+
Object.entries(cd2 ?? {}).forEach(([key, value]) => {
|
|
8140
|
+
if (cd1?.[key] === void 0) {
|
|
8141
|
+
const item = JSON.stringify(["ctx:" + key, value]);
|
|
8142
|
+
addedSet.add(item);
|
|
8143
|
+
allAddedDomainValues.add(item);
|
|
8144
|
+
}
|
|
8252
8145
|
});
|
|
8253
|
-
if (ready) return "ready";
|
|
8254
|
-
if (final) return "absent";
|
|
8255
|
-
return "computing";
|
|
8256
|
-
}
|
|
8257
|
-
return "ready";
|
|
8258
|
-
}
|
|
8259
|
-
};
|
|
8260
|
-
/**
|
|
8261
|
-
* Provider wrapping an array of ColumnSnapshots.
|
|
8262
|
-
* Always complete. Data status taken from each snapshot.
|
|
8263
|
-
*/
|
|
8264
|
-
var SnapshotColumnProvider = class {
|
|
8265
|
-
constructor(snapshots) {
|
|
8266
|
-
this.snapshots = snapshots;
|
|
8267
|
-
}
|
|
8268
|
-
getAllColumns() {
|
|
8269
|
-
return this.snapshots;
|
|
8270
|
-
}
|
|
8271
|
-
isColumnListComplete() {
|
|
8272
|
-
return true;
|
|
8273
|
-
}
|
|
8274
|
-
};
|
|
8275
|
-
/**
|
|
8276
|
-
* Provider wrapping a TreeNodeAccessor (output/prerun resolve result).
|
|
8277
|
-
* Detects data status from accessor readiness state.
|
|
8278
|
-
*/
|
|
8279
|
-
var OutputColumnProvider = class {
|
|
8280
|
-
constructor(accessor, opts) {
|
|
8281
|
-
this.accessor = accessor;
|
|
8282
|
-
this.opts = opts;
|
|
8283
|
-
}
|
|
8284
|
-
getAllColumns() {
|
|
8285
|
-
return this.getColumns();
|
|
8286
|
-
}
|
|
8287
|
-
isColumnListComplete() {
|
|
8288
|
-
return this.accessor.getInputsLocked();
|
|
8289
|
-
}
|
|
8290
|
-
getColumns() {
|
|
8291
|
-
const pColumns = this.accessor.getPColumns();
|
|
8292
|
-
if (pColumns === void 0) return [];
|
|
8293
|
-
const isFinal = this.accessor.getIsFinal();
|
|
8294
|
-
const allowAbsence = this.opts?.allowPermanentAbsence === true;
|
|
8295
|
-
return pColumns.map((col) => {
|
|
8296
|
-
const dataAccessor = col.data;
|
|
8297
|
-
const isReady = dataAccessor.getIsReadyOrError();
|
|
8298
|
-
let dataStatus;
|
|
8299
|
-
if (isReady) dataStatus = "ready";
|
|
8300
|
-
else if (allowAbsence && isFinal) dataStatus = "absent";
|
|
8301
|
-
else dataStatus = "computing";
|
|
8302
8146
|
return {
|
|
8303
|
-
|
|
8304
|
-
|
|
8305
|
-
dataStatus,
|
|
8306
|
-
data: { get: () => isReady ? dataAccessor : void 0 }
|
|
8147
|
+
...axisId,
|
|
8148
|
+
annotations: column.spec.axesSpec[idx].annotations
|
|
8307
8149
|
};
|
|
8308
8150
|
});
|
|
8309
|
-
|
|
8310
|
-
|
|
8311
|
-
|
|
8312
|
-
|
|
8313
|
-
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8317
|
-
|
|
8318
|
-
|
|
8319
|
-
|
|
8320
|
-
|
|
8321
|
-
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
-
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
|
|
8332
|
-
|
|
8333
|
-
|
|
8334
|
-
|
|
8335
|
-
|
|
8336
|
-
if (isColumnSnapshotProvider(source)) return source;
|
|
8337
|
-
if (isColumnSnapshotArray(source)) return new SnapshotColumnProvider(source);
|
|
8338
|
-
if (isPColumnArray(source)) return new ArrayColumnProvider(source);
|
|
8339
|
-
throw new Error("Unknown ColumnSource type");
|
|
8151
|
+
return addedSet;
|
|
8152
|
+
});
|
|
8153
|
+
[...allAddedDomainValues].forEach((addedPart) => {
|
|
8154
|
+
if (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);
|
|
8155
|
+
});
|
|
8156
|
+
return [column, ...secondaryIdsVariants.map((idsList, idx) => {
|
|
8157
|
+
const id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));
|
|
8158
|
+
const label = readAnnotation(column.spec, Annotation.Label) ?? "";
|
|
8159
|
+
const labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(" / ");
|
|
8160
|
+
const annotations = {
|
|
8161
|
+
...column.spec.annotations,
|
|
8162
|
+
[Annotation.Graph.IsVirtual]: stringifyJson(true)
|
|
8163
|
+
};
|
|
8164
|
+
if (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + " / " + labelDomainPart : label + labelDomainPart;
|
|
8165
|
+
return {
|
|
8166
|
+
...column,
|
|
8167
|
+
id,
|
|
8168
|
+
spec: {
|
|
8169
|
+
...column.spec,
|
|
8170
|
+
axesSpec: idsList.map((axisId, idx) => ({
|
|
8171
|
+
...axisId,
|
|
8172
|
+
annotations: column.spec.axesSpec[idx].annotations
|
|
8173
|
+
})),
|
|
8174
|
+
annotations
|
|
8175
|
+
}
|
|
8176
|
+
};
|
|
8177
|
+
})];
|
|
8340
8178
|
}
|
|
8341
8179
|
//#endregion
|
|
8342
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns
|
|
8343
|
-
|
|
8344
|
-
|
|
8345
|
-
|
|
8346
|
-
|
|
8347
|
-
|
|
8348
|
-
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8359
|
-
*/
|
|
8360
|
-
|
|
8361
|
-
|
|
8362
|
-
|
|
8363
|
-
|
|
8364
|
-
|
|
8365
|
-
|
|
8366
|
-
|
|
8367
|
-
|
|
8368
|
-
|
|
8369
|
-
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
const
|
|
8373
|
-
|
|
8374
|
-
|
|
8375
|
-
|
|
8376
|
-
|
|
8377
|
-
|
|
8378
|
-
|
|
8379
|
-
|
|
8380
|
-
|
|
8381
|
-
|
|
8382
|
-
|
|
8383
|
-
columns
|
|
8384
|
-
|
|
8385
|
-
|
|
8386
|
-
|
|
8387
|
-
|
|
8388
|
-
|
|
8389
|
-
}
|
|
8390
|
-
|
|
8391
|
-
|
|
8392
|
-
|
|
8393
|
-
|
|
8394
|
-
|
|
8395
|
-
|
|
8396
|
-
|
|
8397
|
-
|
|
8398
|
-
const excludeColumns = options?.exclude ? toMultiColumnSelectors(options.exclude) : void 0;
|
|
8399
|
-
return this.specDriver.discoverColumns(this.specFrameEntry.key, {
|
|
8400
|
-
includeColumns,
|
|
8401
|
-
excludeColumns,
|
|
8402
|
-
axes: [],
|
|
8403
|
-
maxHops: 0,
|
|
8404
|
-
constraints: matchingModeToConstraints("enrichment")
|
|
8405
|
-
}).hits.map((hit) => this.columns.get(hit.hit.columnId)).filter((col) => col !== void 0);
|
|
8406
|
-
}
|
|
8407
|
-
};
|
|
8408
|
-
var AnchoredColumnCollectionImpl = class {
|
|
8409
|
-
anchorsMap;
|
|
8410
|
-
columnsMap;
|
|
8411
|
-
specFrameEntry;
|
|
8412
|
-
constructor(specDriver, options) {
|
|
8413
|
-
this.specDriver = specDriver;
|
|
8414
|
-
this.specFrameEntry = this.specDriver.createSpecFrame(Object.fromEntries(options.columns.map((col) => [col.id, col.spec])));
|
|
8415
|
-
this.columnsMap = new Map(options.columns.map((col) => [col.id, col]));
|
|
8416
|
-
this.anchorsMap = resolveAnchorMap(options.anchors, options.columns, this.specDriver.discoverColumns.bind(this.specDriver, this.specFrameEntry.key));
|
|
8417
|
-
}
|
|
8418
|
-
dispose() {
|
|
8419
|
-
this.specFrameEntry.unref();
|
|
8420
|
-
}
|
|
8421
|
-
[Symbol.dispose]() {
|
|
8422
|
-
this.dispose();
|
|
8423
|
-
}
|
|
8424
|
-
getAnchors() {
|
|
8425
|
-
return this.anchorsMap;
|
|
8426
|
-
}
|
|
8427
|
-
findColumns(options) {
|
|
8428
|
-
const constraints = matchingModeToConstraints(options?.mode ?? "enrichment");
|
|
8429
|
-
const includeColumns = options?.include ? toMultiColumnSelectors(options.include) : void 0;
|
|
8430
|
-
const excludeColumns = options?.exclude ? toMultiColumnSelectors(options.exclude) : void 0;
|
|
8431
|
-
const anchors = Array.from(this.anchorsMap.values());
|
|
8432
|
-
const byColumn = this.specDriver.discoverColumns(this.specFrameEntry.key, {
|
|
8433
|
-
includeColumns,
|
|
8434
|
-
excludeColumns,
|
|
8435
|
-
constraints,
|
|
8436
|
-
maxHops: options?.maxHops ?? 4,
|
|
8437
|
-
axes: anchors.map((anchor) => ({
|
|
8438
|
-
axesSpec: anchor.spec.axesSpec,
|
|
8439
|
-
qualifications: []
|
|
8440
|
-
}))
|
|
8441
|
-
}).hits.reduce((acc, hit) => {
|
|
8442
|
-
const origId = hit.hit.columnId;
|
|
8443
|
-
const col = this.columnsMap.get(origId) ?? throwError(`Column with id ${origId} not found in collection`);
|
|
8444
|
-
const path = hit.path.map((step) => {
|
|
8445
|
-
if (step.type !== "linker") throw new Error(`Unexpected discover-columns step type: ${step.type}`);
|
|
8446
|
-
return { linker: this.columnsMap.get(step.linker.columnId) ?? throwError(`Linker column with id ${step.linker.columnId} not found in collection`) };
|
|
8447
|
-
});
|
|
8448
|
-
const variants = hit.mappingVariants.map((v) => ({
|
|
8449
|
-
path,
|
|
8450
|
-
qualifications: remapFromIdxToId(v.qualifications, anchors)
|
|
8451
|
-
}));
|
|
8452
|
-
const existing = acc.get(origId);
|
|
8453
|
-
return acc.set(origId, existing === void 0 ? {
|
|
8454
|
-
column: col,
|
|
8455
|
-
variants
|
|
8456
|
-
} : {
|
|
8457
|
-
...existing,
|
|
8458
|
-
variants: [...existing.variants, ...variants]
|
|
8459
|
-
});
|
|
8460
|
-
}, /* @__PURE__ */ new Map());
|
|
8461
|
-
return Array.from(byColumn.values());
|
|
8462
|
-
}
|
|
8463
|
-
findColumnVariants(options) {
|
|
8464
|
-
return this.findColumns(options).flatMap((match) => match.variants.map((variant) => ({
|
|
8465
|
-
column: match.column,
|
|
8466
|
-
path: variant.path,
|
|
8467
|
-
qualifications: variant.qualifications
|
|
8468
|
-
})));
|
|
8469
|
-
}
|
|
8470
|
-
};
|
|
8471
|
-
/**
|
|
8472
|
-
* Collect all columns from all providers, dedup by NativePObjectId.
|
|
8473
|
-
* First source wins.
|
|
8474
|
-
*/
|
|
8475
|
-
function collectColumns(providers) {
|
|
8476
|
-
const seen = /* @__PURE__ */ new Set();
|
|
8477
|
-
const result = [];
|
|
8478
|
-
for (const provider of providers) {
|
|
8479
|
-
const columns = provider.getAllColumns();
|
|
8480
|
-
for (const col of columns) {
|
|
8481
|
-
const nativeId = deriveNativeId(col.spec);
|
|
8482
|
-
if (seen.has(nativeId)) continue;
|
|
8483
|
-
seen.add(nativeId);
|
|
8484
|
-
result.push(col);
|
|
8485
|
-
}
|
|
8486
|
-
}
|
|
8487
|
-
return result;
|
|
8488
|
-
}
|
|
8489
|
-
/** Normalize ColumnSelector (relaxed, single or array) to MultiColumnSelector[]. */
|
|
8490
|
-
function toMultiColumnSelectors(input) {
|
|
8491
|
-
return convertColumnSelectorToMultiColumnSelector(input);
|
|
8492
|
-
}
|
|
8493
|
-
/**
|
|
8494
|
-
* Resolve each anchor entry to a ColumnSnapshot from the collected columns.
|
|
8495
|
-
* - PObjectId (string): looked up by id in the collected columns
|
|
8496
|
-
* - PColumnSpec: matched by deriveNativeId against collected columns
|
|
8497
|
-
* - RelaxedColumnSelector: resolved via discoverColumns in "exact" mode;
|
|
8498
|
-
* must match exactly one column
|
|
8499
|
-
* Throws on unresolved, ambiguous, or duplicated matches. Requires at least one
|
|
8500
|
-
* anchor to resolve.
|
|
8501
|
-
*/
|
|
8502
|
-
function resolveAnchorMap(anchors, columns, discoverColumns) {
|
|
8503
|
-
const result = /* @__PURE__ */ new Map();
|
|
8504
|
-
const resovedIds = /* @__PURE__ */ new Set();
|
|
8505
|
-
const getDuplicateError = (key) => `Anchor "${key}": selector matched a column that was already matched by another anchor; please refine the selector to match a different column`;
|
|
8506
|
-
for (const [name, anchor] of Object.entries(anchors)) if (typeof anchor === "string") {
|
|
8507
|
-
const found = columns.find((col) => col.id === anchor) ?? throwError(`Anchor "${name}": column with id "${anchor}" not found in sources`);
|
|
8508
|
-
if (resovedIds.has(found.id)) throwError(getDuplicateError(name));
|
|
8509
|
-
result.set(name, found);
|
|
8510
|
-
resovedIds.add(found.id);
|
|
8511
|
-
} else if ("kind" in anchor) {
|
|
8512
|
-
if (!isPColumnSpec(anchor)) throwError(`Anchor "${name}": invalid PColumnSpec`);
|
|
8513
|
-
const nativeId = deriveNativeId(anchor);
|
|
8514
|
-
const found = columns.find((col) => deriveNativeId(col.spec) === nativeId) ?? throwError(`Anchor "${name}": no column matching spec found in sources`);
|
|
8515
|
-
if (resovedIds.has(found.id)) throwError(getDuplicateError(name));
|
|
8516
|
-
result.set(name, found);
|
|
8517
|
-
resovedIds.add(found.id);
|
|
8518
|
-
} else {
|
|
8519
|
-
const matched = discoverColumns({
|
|
8520
|
-
includeColumns: toMultiColumnSelectors(anchor),
|
|
8521
|
-
excludeColumns: void 0,
|
|
8522
|
-
axes: [],
|
|
8523
|
-
maxHops: 0,
|
|
8524
|
-
constraints: matchingModeToConstraints("related")
|
|
8525
|
-
});
|
|
8526
|
-
if (matched.hits.length === 0) throwError(`Anchor "${name}": no columns matched selector`);
|
|
8527
|
-
if (matched.hits.length > 1) throwError(`Anchor "${name}": selector is ambiguous and matched multiple columns; please refine the selector to match exactly one column`);
|
|
8528
|
-
if (resovedIds.has(matched.hits[0].hit.columnId)) throwError(getDuplicateError(name));
|
|
8529
|
-
const id = matched.hits[0].hit.columnId;
|
|
8530
|
-
const snap = columns.find((col) => col.id === id) ?? throwError(`Anchor "${name}": matched column with id "${id}" not found in sources`);
|
|
8531
|
-
result.set(name, snap);
|
|
8532
|
-
resovedIds.add(snap.id);
|
|
8533
|
-
}
|
|
8534
|
-
if (resovedIds.size === 0) throwError("At least one anchor must be resolved to a valid column");
|
|
8535
|
-
return result;
|
|
8536
|
-
}
|
|
8537
|
-
function remapFromIdxToId(qualifications, anchors) {
|
|
8538
|
-
const forQueries = qualifications.forQueries.reduce((acc, qs, i) => anchors[i] && qs.length > 0 ? acc.set(anchors[i].id, qs) : acc, /* @__PURE__ */ new Map());
|
|
8539
|
-
return {
|
|
8540
|
-
forQueries: forQueries.size > 0 ? Object.fromEntries(forQueries) : void 0,
|
|
8541
|
-
forHit: qualifications.forHit.length > 0 ? qualifications.forHit : void 0
|
|
8542
|
-
};
|
|
8543
|
-
}
|
|
8544
|
-
function matchingModeToConstraints(mode) {
|
|
8545
|
-
switch (mode) {
|
|
8546
|
-
case "enrichment": return {
|
|
8547
|
-
allowFloatingSourceAxes: true,
|
|
8548
|
-
allowFloatingHitAxes: false,
|
|
8549
|
-
allowSourceQualifications: true,
|
|
8550
|
-
allowHitQualifications: true
|
|
8551
|
-
};
|
|
8552
|
-
case "related": return {
|
|
8553
|
-
allowFloatingSourceAxes: true,
|
|
8554
|
-
allowFloatingHitAxes: true,
|
|
8555
|
-
allowSourceQualifications: true,
|
|
8556
|
-
allowHitQualifications: true
|
|
8557
|
-
};
|
|
8558
|
-
case "exact": return {
|
|
8559
|
-
allowFloatingSourceAxes: false,
|
|
8560
|
-
allowFloatingHitAxes: false,
|
|
8561
|
-
allowSourceQualifications: false,
|
|
8562
|
-
allowHitQualifications: false
|
|
8563
|
-
};
|
|
8564
|
-
}
|
|
8180
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
|
|
8181
|
+
function getAllRelatedColumns(ctx, predicate) {
|
|
8182
|
+
const columns = new PColumnCollection();
|
|
8183
|
+
columns.addColumnProvider(ctx.resultPool);
|
|
8184
|
+
const allColumns = columns.getColumns(predicate, {
|
|
8185
|
+
dontWaitAllData: true,
|
|
8186
|
+
overrideLabelAnnotation: false
|
|
8187
|
+
}) ?? [];
|
|
8188
|
+
return enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {
|
|
8189
|
+
return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
|
|
8190
|
+
})), allColumns);
|
|
8191
|
+
}
|
|
8192
|
+
function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
|
|
8193
|
+
const columns = new PColumnCollection();
|
|
8194
|
+
columns.addColumnProvider(ctx.resultPool);
|
|
8195
|
+
columns.addColumns(rootColumns);
|
|
8196
|
+
const blockAxes = /* @__PURE__ */ new Map();
|
|
8197
|
+
const allAxes = /* @__PURE__ */ new Map();
|
|
8198
|
+
for (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
|
|
8199
|
+
const aid = getAxisId(spec);
|
|
8200
|
+
blockAxes.set(canonicalizeJson(aid), spec);
|
|
8201
|
+
allAxes.set(canonicalizeJson(aid), spec);
|
|
8202
|
+
}
|
|
8203
|
+
const availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);
|
|
8204
|
+
for (const item of availableWithLinkersAxes) {
|
|
8205
|
+
blockAxes.set(...item);
|
|
8206
|
+
allAxes.set(...item);
|
|
8207
|
+
}
|
|
8208
|
+
const blockAxesArr = Array.from(blockAxes.values());
|
|
8209
|
+
let compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
|
|
8210
|
+
const axisId = getAxisId(axisSpec);
|
|
8211
|
+
return blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
8212
|
+
}), {
|
|
8213
|
+
dontWaitAllData: true,
|
|
8214
|
+
overrideLabelAnnotation: false
|
|
8215
|
+
}) ?? []).filter((column) => !isLabelColumn(column.spec));
|
|
8216
|
+
for (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
|
|
8217
|
+
const aid = getAxisId(spec);
|
|
8218
|
+
allAxes.set(canonicalizeJson(aid), spec);
|
|
8219
|
+
}
|
|
8220
|
+
const allAxesArr = Array.from(allAxes.values());
|
|
8221
|
+
compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {
|
|
8222
|
+
const axisId = getAxisId(axisSpec);
|
|
8223
|
+
return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
8224
|
+
}), {
|
|
8225
|
+
dontWaitAllData: true,
|
|
8226
|
+
overrideLabelAnnotation: false
|
|
8227
|
+
}) ?? []).filter((column) => !isLabelColumn(column.spec));
|
|
8228
|
+
const compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
|
|
8229
|
+
const axisId = getAxisId(axisSpec);
|
|
8230
|
+
return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
|
|
8231
|
+
}), {
|
|
8232
|
+
dontWaitAllData: true,
|
|
8233
|
+
overrideLabelAnnotation: false
|
|
8234
|
+
}) ?? []).filter((column) => isLabelColumn(column.spec));
|
|
8235
|
+
return enrichCompatible(blockAxes, [...compatibleWithoutLabels, ...compatibleLabels]);
|
|
8565
8236
|
}
|
|
8566
8237
|
//#endregion
|
|
8567
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
* `resultPool` in that order. Dedup keeps the first occurrence per
|
|
8571
|
-
* `NativePObjectId`, so a block re-publishing its own columns keeps
|
|
8572
|
-
* the `outputs`-rooted canonical id instead of the result-pool variant.
|
|
8573
|
-
*/
|
|
8574
|
-
function collectCtxColumnSnapshotProviders(ctx) {
|
|
8575
|
-
const providers = [];
|
|
8576
|
-
const outputs = ctx.outputs;
|
|
8577
|
-
if (outputs) providers.push(...collectPFrameProviders(outputs));
|
|
8578
|
-
const prerun = ctx.prerun;
|
|
8579
|
-
if (prerun) providers.push(...collectPFrameProviders(prerun));
|
|
8580
|
-
providers.push(new ResultPoolColumnSnapshotProvider(ctx.resultPool));
|
|
8581
|
-
return providers;
|
|
8238
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
|
|
8239
|
+
function isHiddenFromGraphColumn(column) {
|
|
8240
|
+
return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
|
|
8582
8241
|
}
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
*
|
|
8586
|
-
* - `isColumnListComplete()` always returns true — the result pool
|
|
8587
|
-
* is a stable snapshot within a single render cycle.
|
|
8588
|
-
* - Data status is derived from the underlying TreeNodeAccessor:
|
|
8589
|
-
* ready (getIsReadyOrError), computing, or absent (no data resource).
|
|
8590
|
-
*/
|
|
8591
|
-
var ResultPoolColumnSnapshotProvider = class {
|
|
8592
|
-
constructor(pool) {
|
|
8593
|
-
this.pool = pool;
|
|
8594
|
-
}
|
|
8595
|
-
getAllColumns() {
|
|
8596
|
-
return this.pool.selectColumns(() => true).map((col) => toSnapshot(col.id, col.spec, col.data));
|
|
8597
|
-
}
|
|
8598
|
-
isColumnListComplete() {
|
|
8599
|
-
return true;
|
|
8600
|
-
}
|
|
8601
|
-
};
|
|
8602
|
-
function toSnapshot(id, spec, accessor) {
|
|
8603
|
-
if (accessor === void 0) return {
|
|
8604
|
-
id,
|
|
8605
|
-
spec,
|
|
8606
|
-
dataStatus: "absent",
|
|
8607
|
-
data: void 0
|
|
8608
|
-
};
|
|
8609
|
-
const isReady = accessor.getIsReadyOrError();
|
|
8610
|
-
return {
|
|
8611
|
-
id,
|
|
8612
|
-
spec,
|
|
8613
|
-
dataStatus: isReady ? "ready" : "computing",
|
|
8614
|
-
data: { get: () => isReady ? accessor : void 0 }
|
|
8615
|
-
};
|
|
8242
|
+
function isHiddenFromUIColumn(column) {
|
|
8243
|
+
return !!readAnnotationJson(column, Annotation.HideDataFromUi);
|
|
8616
8244
|
}
|
|
8617
8245
|
/**
|
|
8618
|
-
|
|
8619
|
-
|
|
8620
|
-
|
|
8621
|
-
|
|
8246
|
+
The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool
|
|
8247
|
+
(including linker columns and all label columns).
|
|
8248
|
+
Block’s columns are added to pframe as is.
|
|
8249
|
+
Other columns are added basing on set of axes of block’s columns, considering available with linker columns.
|
|
8250
|
+
Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from
|
|
8251
|
+
result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values
|
|
8252
|
+
among existing ones).
|
|
8253
|
+
In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case
|
|
8254
|
+
of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)
|
|
8255
|
+
and modified label (with added domain values in case if more than one copy with different domains exist).
|
|
8622
8256
|
*/
|
|
8623
|
-
function
|
|
8624
|
-
const
|
|
8625
|
-
|
|
8626
|
-
return
|
|
8627
|
-
|
|
8628
|
-
|
|
8629
|
-
|
|
8630
|
-
if (typeName === ResourceTypeName.PFrame) {
|
|
8631
|
-
out.push(new OutputColumnProvider(node));
|
|
8632
|
-
return;
|
|
8633
|
-
}
|
|
8634
|
-
if (typeName === ResourceTypeName.StdMap || typeName === ResourceTypeName.StdMapSlash) for (const field of node.listInputFields()) {
|
|
8635
|
-
const child = node.resolve(field);
|
|
8636
|
-
if (child) walkTree(child, out);
|
|
8637
|
-
}
|
|
8257
|
+
function createPFrameForGraphs(ctx, blockColumns) {
|
|
8258
|
+
const suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);
|
|
8259
|
+
if (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));
|
|
8260
|
+
return ctx.createPFrame(getRelatedColumns(ctx, {
|
|
8261
|
+
columns: blockColumns,
|
|
8262
|
+
predicate: suitableSpec
|
|
8263
|
+
}));
|
|
8638
8264
|
}
|
|
8639
8265
|
//#endregion
|
|
8640
8266
|
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/filters/traverse.js
|
|
@@ -9325,283 +8951,64 @@
|
|
|
9325
8951
|
};
|
|
9326
8952
|
}
|
|
9327
8953
|
//#endregion
|
|
9328
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_tooltips.js
|
|
9329
|
-
/** Format tooltip strings for each entry. Returns `undefined` when nothing useful. */
|
|
9330
|
-
function deriveDistinctTooltips(entries) {
|
|
9331
|
-
return entries.map(formatTooltip);
|
|
9332
|
-
}
|
|
9333
|
-
function formatTooltip(entry) {
|
|
9334
|
-
const sections = [];
|
|
9335
|
-
const header = formatHeader(entry);
|
|
9336
|
-
if (header !== void 0) sections.push(header);
|
|
9337
|
-
const origin = formatOriginPath(entry);
|
|
9338
|
-
if (origin !== void 0) sections.push(origin);
|
|
9339
|
-
const anchors = formatAnchors(entry.qualifications);
|
|
9340
|
-
if (anchors !== void 0) sections.push(anchors);
|
|
9341
|
-
const hit = formatHit(entry.qualifications);
|
|
9342
|
-
if (hit !== void 0) sections.push(hit);
|
|
9343
|
-
if (sections.length <= 1) return void 0;
|
|
9344
|
-
return sections.join("\n\n");
|
|
9345
|
-
}
|
|
9346
|
-
const BULLET_1 = " • ";
|
|
9347
|
-
function formatHeader(entry) {
|
|
9348
|
-
const lines = [];
|
|
9349
|
-
if (entry.variantCount !== void 0 && entry.variantCount > 1) lines.push(`Variant: ${entry.variantIndex ?? "?"} of ${entry.variantCount}`);
|
|
9350
|
-
return lines.join("\n");
|
|
9351
|
-
}
|
|
9352
|
-
function formatOriginPath(entry) {
|
|
9353
|
-
const path = entry.linkerPath ?? [];
|
|
9354
|
-
if (path.length === 0) return void 0;
|
|
9355
|
-
const lines = ["Origin path"];
|
|
9356
|
-
path.forEach((step, i) => {
|
|
9357
|
-
const label = readAnnotation(step.linker.spec, Annotation.LinkLabel) ?? readAnnotation(step.linker.spec, Annotation.Label) ?? step.linker.spec.name;
|
|
9358
|
-
lines.push(`${BULLET_1}linker ${i + 1}: ${label}`);
|
|
9359
|
-
});
|
|
9360
|
-
const hitName = readAnnotation(entry.spec, Annotation.Label) ?? entry.spec.name;
|
|
9361
|
-
lines.push(`${BULLET_1}hit column: ${hitName}`);
|
|
9362
|
-
return lines.join("\n");
|
|
9363
|
-
}
|
|
9364
|
-
function formatAnchors(q) {
|
|
9365
|
-
if (isNil(q)) return void 0;
|
|
9366
|
-
if (isNil(q.forQueries)) return void 0;
|
|
9367
|
-
const ids = Object.keys(q.forQueries);
|
|
9368
|
-
if (ids.length === 0) return void 0;
|
|
9369
|
-
const lines = [];
|
|
9370
|
-
for (const id of ids) {
|
|
9371
|
-
const item = q.forQueries[id];
|
|
9372
|
-
if (item.length === 0) continue;
|
|
9373
|
-
const rendered = formatAxisQualifications(item);
|
|
9374
|
-
lines.push(`${BULLET_1}${id}${rendered !== void 0 ? ` ${rendered}` : ""}`);
|
|
9375
|
-
}
|
|
9376
|
-
return lines.length > 0 ? ["Anchors (bound via this variant)"].concat(lines).join("\n") : void 0;
|
|
9377
|
-
}
|
|
9378
|
-
function formatHit(q) {
|
|
9379
|
-
if (isNil(q) || isNil(q.forHit) || q.forHit.length === 0) return void 0;
|
|
9380
|
-
const rendered = formatAxisQualifications(q.forHit);
|
|
9381
|
-
if (rendered === void 0) return void 0;
|
|
9382
|
-
return ["Hit column qualifications", `${BULLET_1}${rendered}`].join("\n");
|
|
9383
|
-
}
|
|
9384
|
-
function formatAxisQualifications(qs) {
|
|
9385
|
-
if (qs.length === 0) return void 0;
|
|
9386
|
-
return qs.map(formatQualification).join("; ");
|
|
9387
|
-
}
|
|
9388
|
-
function formatQualification(q) {
|
|
9389
|
-
const axisName = typeof q.axis === "string" ? q.axis : q.axis.name ?? JSON.stringify(q.axis);
|
|
9390
|
-
const entries = Object.entries(q.contextDomain);
|
|
9391
|
-
if (entries.length === 0) return axisName;
|
|
9392
|
-
return `${axisName} context: ${entries.map(([k, v]) => `${k}=${v}`).join(", ")}`;
|
|
9393
|
-
}
|
|
9394
|
-
//#endregion
|
|
9395
8954
|
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
|
|
9396
|
-
/** Check if column should be omitted from the table */
|
|
9397
|
-
function isColumnHidden(spec) {
|
|
9398
|
-
return readAnnotation(spec, Annotation.Table.Visibility) === "hidden";
|
|
9399
|
-
}
|
|
9400
8955
|
/** Check if column is hidden by default */
|
|
9401
8956
|
function isColumnOptional(spec) {
|
|
9402
8957
|
return readAnnotation(spec, Annotation.Table.Visibility) === "optional";
|
|
9403
8958
|
}
|
|
9404
|
-
|
|
9405
|
-
|
|
9406
|
-
|
|
9407
|
-
|
|
9408
|
-
|
|
9409
|
-
|
|
9410
|
-
|
|
9411
|
-
|
|
9412
|
-
|
|
9413
|
-
const
|
|
9414
|
-
|
|
9415
|
-
|
|
9416
|
-
|
|
9417
|
-
|
|
9418
|
-
|
|
9419
|
-
|
|
9420
|
-
|
|
9421
|
-
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
|
|
9433
|
-
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
const
|
|
9438
|
-
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9445
|
-
|
|
9446
|
-
|
|
8959
|
+
//#endregion
|
|
8960
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/labels.js
|
|
8961
|
+
/** Get label columns matching the provided columns from the result pool */
|
|
8962
|
+
function getMatchingLabelColumns(columns, allLabelColumns) {
|
|
8963
|
+
const inputLabelColumns = [];
|
|
8964
|
+
const inputValueColumns = [];
|
|
8965
|
+
for (const column of columns) if (isLabelColumn(column.spec)) inputLabelColumns.push(column);
|
|
8966
|
+
else inputValueColumns.push(column);
|
|
8967
|
+
const unlabeledAxes = [];
|
|
8968
|
+
for (const column of inputValueColumns) for (const axis of column.spec.axesSpec) {
|
|
8969
|
+
const axisId = getAxisId(axis);
|
|
8970
|
+
if (!unlabeledAxes.some((id) => matchAxisId(id, axisId))) unlabeledAxes.push(axisId);
|
|
8971
|
+
}
|
|
8972
|
+
for (const labelColumn of inputLabelColumns) {
|
|
8973
|
+
const labelAxisId = getAxisId(labelColumn.spec.axesSpec[0]);
|
|
8974
|
+
const labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));
|
|
8975
|
+
if (labelMatch !== -1) unlabeledAxes.splice(labelMatch, 1);
|
|
8976
|
+
}
|
|
8977
|
+
const colId = (id, domain, contextDomain) => {
|
|
8978
|
+
let wid = id.toString();
|
|
8979
|
+
if (domain) for (const k in domain) {
|
|
8980
|
+
wid += k;
|
|
8981
|
+
wid += domain[k];
|
|
8982
|
+
}
|
|
8983
|
+
if (contextDomain) for (const k in contextDomain) {
|
|
8984
|
+
wid += k;
|
|
8985
|
+
wid += contextDomain[k];
|
|
8986
|
+
}
|
|
8987
|
+
return wid;
|
|
8988
|
+
};
|
|
8989
|
+
const labelColumns = [];
|
|
8990
|
+
for (const labelColumn of allLabelColumns) {
|
|
8991
|
+
const labelAxis = labelColumn.spec.axesSpec[0];
|
|
8992
|
+
const labelAxisId = getAxisId(labelAxis);
|
|
8993
|
+
const labelMatch = unlabeledAxes.findIndex((axisId) => matchAxisId(axisId, labelAxisId));
|
|
8994
|
+
if (labelMatch !== -1) {
|
|
8995
|
+
const axisId = unlabeledAxes[labelMatch];
|
|
8996
|
+
if (Object.keys(axisId.domain ?? {}).length + Object.keys(axisId.contextDomain ?? {}).length > Object.keys(labelAxis.domain ?? {}).length + Object.keys(labelAxis.contextDomain ?? {}).length) labelColumns.push({
|
|
8997
|
+
id: colId(labelColumn.id, axisId.domain, axisId.contextDomain),
|
|
8998
|
+
spec: {
|
|
8999
|
+
...labelColumn.spec,
|
|
9000
|
+
axesSpec: [{
|
|
9001
|
+
...axisId,
|
|
9002
|
+
annotations: labelAxis.annotations
|
|
9003
|
+
}]
|
|
9004
|
+
},
|
|
9005
|
+
data: labelColumn.data
|
|
9006
|
+
});
|
|
9007
|
+
else labelColumns.push(labelColumn);
|
|
9008
|
+
unlabeledAxes.splice(labelMatch, 1);
|
|
9447
9009
|
}
|
|
9448
9010
|
}
|
|
9449
|
-
|
|
9450
|
-
result.set(col.id, rule);
|
|
9451
|
-
break;
|
|
9452
|
-
}
|
|
9453
|
-
return result;
|
|
9454
|
-
}
|
|
9455
|
-
function dedupeById(columns) {
|
|
9456
|
-
const seen = /* @__PURE__ */ new Set();
|
|
9457
|
-
const result = [];
|
|
9458
|
-
for (const col of columns) {
|
|
9459
|
-
if (seen.has(col.id)) continue;
|
|
9460
|
-
seen.add(col.id);
|
|
9461
|
-
result.push(col);
|
|
9462
|
-
}
|
|
9463
|
-
return result;
|
|
9464
|
-
}
|
|
9465
|
-
/**
|
|
9466
|
-
* Writes derived labels into column and axis annotations.
|
|
9467
|
-
* Returns new column objects with modified specs — original columns are not mutated.
|
|
9468
|
-
*
|
|
9469
|
-
* For each column: writes derived label into Annotation.Label (if present in derivedLabels).
|
|
9470
|
-
* For each axis in column specs: writes derived axis label into AxisSpec annotations.
|
|
9471
|
-
*/
|
|
9472
|
-
function withLabelAnnotations(derivedLabels, columns) {
|
|
9473
|
-
if (derivedLabels === void 0) return columns;
|
|
9474
|
-
return columns.map((col) => {
|
|
9475
|
-
const colLabel = derivedLabels[col.id];
|
|
9476
|
-
return {
|
|
9477
|
-
...col,
|
|
9478
|
-
spec: {
|
|
9479
|
-
...col.spec,
|
|
9480
|
-
...isNil(colLabel) ? {} : { annotations: {
|
|
9481
|
-
...col.spec.annotations,
|
|
9482
|
-
[Annotation.Label]: colLabel
|
|
9483
|
-
} },
|
|
9484
|
-
axesSpec: col.spec.axesSpec.map((axis) => {
|
|
9485
|
-
const label = derivedLabels[canonicalizeAxisId(axis)];
|
|
9486
|
-
return isNil(label) ? axis : {
|
|
9487
|
-
...axis,
|
|
9488
|
-
annotations: {
|
|
9489
|
-
...axis.annotations,
|
|
9490
|
-
[Annotation.Label]: label
|
|
9491
|
-
}
|
|
9492
|
-
};
|
|
9493
|
-
})
|
|
9494
|
-
}
|
|
9495
|
-
};
|
|
9496
|
-
});
|
|
9497
|
-
}
|
|
9498
|
-
function withDataStatusAnnotations(columns) {
|
|
9499
|
-
return columns.map((col) => {
|
|
9500
|
-
return {
|
|
9501
|
-
...col,
|
|
9502
|
-
spec: {
|
|
9503
|
-
...col.spec,
|
|
9504
|
-
annotations: {
|
|
9505
|
-
...col.spec.annotations,
|
|
9506
|
-
[Annotation.DataStatus]: col.dataStatus
|
|
9507
|
-
}
|
|
9508
|
-
}
|
|
9509
|
-
};
|
|
9510
|
-
});
|
|
9511
|
-
}
|
|
9512
|
-
/**
|
|
9513
|
-
* Writes effective display properties (OrderPriority, Visibility) from precomputed rule maps
|
|
9514
|
-
* into column annotations. Returns new column objects — originals are not mutated.
|
|
9515
|
-
*/
|
|
9516
|
-
function withTableVisualAnnotations(visibilityByColId, orderByColId, columns) {
|
|
9517
|
-
if (visibilityByColId === void 0 && orderByColId === void 0) return columns;
|
|
9518
|
-
return columns.map((col) => {
|
|
9519
|
-
const annotations = { ...col.spec.annotations };
|
|
9520
|
-
const visibility = getEffectiveVisibility(col, visibilityByColId);
|
|
9521
|
-
if (!isNil(visibility)) annotations[Annotation.Table.Visibility] = visibility;
|
|
9522
|
-
const orderPriority = getOrderPriority(col, orderByColId);
|
|
9523
|
-
if (!isNil(orderPriority)) annotations[Annotation.Table.OrderPriority] = String(orderPriority);
|
|
9524
|
-
return {
|
|
9525
|
-
...col,
|
|
9526
|
-
spec: {
|
|
9527
|
-
...col.spec,
|
|
9528
|
-
annotations
|
|
9529
|
-
}
|
|
9530
|
-
};
|
|
9531
|
-
});
|
|
9532
|
-
}
|
|
9533
|
-
/**
|
|
9534
|
-
* Writes derived info annotations into column annotations.
|
|
9535
|
-
* Columns without an info entry are passed through unchanged.
|
|
9536
|
-
*/
|
|
9537
|
-
function withInfoAnnotations(infoById, columns) {
|
|
9538
|
-
if (isNil(infoById)) return columns;
|
|
9539
|
-
return columns.map((col) => {
|
|
9540
|
-
const info = infoById[col.id];
|
|
9541
|
-
if (isNil(info)) return col;
|
|
9542
|
-
return {
|
|
9543
|
-
...col,
|
|
9544
|
-
spec: {
|
|
9545
|
-
...col.spec,
|
|
9546
|
-
annotations: {
|
|
9547
|
-
...col.spec.annotations,
|
|
9548
|
-
[Annotation.Table.Info]: info
|
|
9549
|
-
}
|
|
9550
|
-
}
|
|
9551
|
-
};
|
|
9552
|
-
});
|
|
9553
|
-
}
|
|
9554
|
-
function withHidenAxesAnnotations(columns) {
|
|
9555
|
-
return columns.map((col) => ({
|
|
9556
|
-
...col,
|
|
9557
|
-
spec: {
|
|
9558
|
-
...col.spec,
|
|
9559
|
-
axesSpec: col.spec.axesSpec.map((axis) => ({
|
|
9560
|
-
...axis,
|
|
9561
|
-
annotations: {
|
|
9562
|
-
...axis.annotations,
|
|
9563
|
-
[Annotation.Table.Visibility]: "hidden"
|
|
9564
|
-
}
|
|
9565
|
-
}))
|
|
9566
|
-
}
|
|
9567
|
-
}));
|
|
9568
|
-
}
|
|
9569
|
-
/** Derive labels for all table elements: columns via deriveDistinctLabels, axes from label columns. */
|
|
9570
|
-
function deriveAllLabels(options) {
|
|
9571
|
-
const { columns, deriveLabelsOptions } = options;
|
|
9572
|
-
return deriveDistinctLabels(columns.map((c) => ({
|
|
9573
|
-
spec: c.spec,
|
|
9574
|
-
linkerPath: c.linkerPath?.map((step) => ({ spec: step.linker.spec })),
|
|
9575
|
-
qualifications: c.qualifications
|
|
9576
|
-
})), deriveLabelsOptions).reduce((acc, label, index) => (acc[columns[index].id] = label, acc), {});
|
|
9577
|
-
}
|
|
9578
|
-
/** Derive origin tooltips for columns whose qualifications or linker path carry info. */
|
|
9579
|
-
function deriveAllTooltips(options) {
|
|
9580
|
-
const { columns } = options;
|
|
9581
|
-
const variantCountByOriginal = columns.reduce((acc, c) => {
|
|
9582
|
-
return acc.set(getField(c, "originalId") ?? c.id, (acc.get(c.originalId ?? c.id) ?? 0) + 1);
|
|
9583
|
-
}, /* @__PURE__ */ new Map());
|
|
9584
|
-
const { entries } = columns.reduce(({ entries, variantSeen }, c) => {
|
|
9585
|
-
const id = getField(c, "originalId") ?? c.id;
|
|
9586
|
-
const variantCount = variantCountByOriginal.get(id);
|
|
9587
|
-
const variantIndex = (variantSeen.set(id, (variantSeen.get(id) ?? 0) + 1), variantSeen.get(id));
|
|
9588
|
-
entries.push({
|
|
9589
|
-
spec: c.spec,
|
|
9590
|
-
linkerPath: c.linkerPath,
|
|
9591
|
-
qualifications: c.qualifications,
|
|
9592
|
-
variantIndex,
|
|
9593
|
-
variantCount
|
|
9594
|
-
});
|
|
9595
|
-
return {
|
|
9596
|
-
entries,
|
|
9597
|
-
variantSeen
|
|
9598
|
-
};
|
|
9599
|
-
}, {
|
|
9600
|
-
entries: [],
|
|
9601
|
-
variantSeen: /* @__PURE__ */ new Map()
|
|
9602
|
-
});
|
|
9603
|
-
const tooltips = deriveDistinctTooltips(entries);
|
|
9604
|
-
return Object.fromEntries(tooltips.flatMap((t, i) => isNil(t) ? [] : [[columns[i].id, t]]));
|
|
9011
|
+
return labelColumns;
|
|
9605
9012
|
}
|
|
9606
9013
|
//#endregion
|
|
9607
9014
|
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
|
|
@@ -9675,387 +9082,126 @@
|
|
|
9675
9082
|
};
|
|
9676
9083
|
}
|
|
9677
9084
|
//#endregion
|
|
9678
|
-
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
const
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9085
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV2.js
|
|
9086
|
+
function createPTableDefV2(params) {
|
|
9087
|
+
let coreColumns = params.columns;
|
|
9088
|
+
const secondaryColumns = [];
|
|
9089
|
+
if (isFunction(params.coreColumnPredicate)) {
|
|
9090
|
+
coreColumns = [];
|
|
9091
|
+
for (const c of params.columns) if (params.coreColumnPredicate(getColumnIdAndSpec(c))) coreColumns.push(c);
|
|
9092
|
+
else secondaryColumns.push(c);
|
|
9093
|
+
}
|
|
9094
|
+
secondaryColumns.push(...params.labelColumns);
|
|
9095
|
+
return createPTableDefV3({
|
|
9096
|
+
primary: coreColumns.map((column) => ({ column })),
|
|
9097
|
+
secondary: secondaryColumns.map((column) => ({ entries: [{ column }] })),
|
|
9098
|
+
primaryJoinType: params.coreJoinType,
|
|
9099
|
+
filters: params.filters,
|
|
9100
|
+
sorting: params.sorting
|
|
9101
|
+
});
|
|
9694
9102
|
}
|
|
9103
|
+
//#endregion
|
|
9104
|
+
//#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV2.js
|
|
9695
9105
|
/**
|
|
9696
|
-
*
|
|
9697
|
-
*
|
|
9698
|
-
*
|
|
9106
|
+
* Create p-table spec and handle given ui table state
|
|
9107
|
+
*
|
|
9108
|
+
* @deprecated This version of createPlDataTable is deprecated and will be removed in future. Please migrate to v3 by switching to the new options format and providing necessary information for column discovery and display configuration. See createPlDataTableOptionsV3 for details.
|
|
9109
|
+
* @param ctx context
|
|
9110
|
+
* @param columns column list
|
|
9111
|
+
* @param tableState table ui state
|
|
9112
|
+
* @returns PlAgDataTableV2 table source
|
|
9699
9113
|
*/
|
|
9700
|
-
function
|
|
9701
|
-
if (columns.length === 0) return
|
|
9702
|
-
const
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
})
|
|
9706
|
-
try {
|
|
9707
|
-
const axes = columns.flatMap((col) => col.column.spec.axesSpec);
|
|
9708
|
-
return collection.findColumnVariants({
|
|
9709
|
-
include: axes.map((a) => ({
|
|
9710
|
-
name: {
|
|
9711
|
-
type: "exact",
|
|
9712
|
-
value: PColumnName.Label
|
|
9713
|
-
},
|
|
9714
|
-
axes: [{ name: {
|
|
9715
|
-
type: "exact",
|
|
9716
|
-
value: a.name
|
|
9717
|
-
} }]
|
|
9718
|
-
})),
|
|
9719
|
-
maxHops: columns.reduce((acc, c) => Math.max(acc, c.path?.length ?? 0), 0)
|
|
9720
|
-
}).map((variant) => ({
|
|
9721
|
-
...variant,
|
|
9722
|
-
column: {
|
|
9723
|
-
...variant.column,
|
|
9724
|
-
id: createDiscoveredPColumnId({
|
|
9725
|
-
column: variant.column.id,
|
|
9726
|
-
path: variant.path?.map((p) => ({
|
|
9727
|
-
type: "linker",
|
|
9728
|
-
column: p.linker.id
|
|
9729
|
-
})),
|
|
9730
|
-
columnQualifications: variant.qualifications?.forHit,
|
|
9731
|
-
queriesQualifications: variant.qualifications?.forQueries
|
|
9732
|
-
}),
|
|
9733
|
-
originalId: variant.column.id
|
|
9734
|
-
}
|
|
9735
|
-
}));
|
|
9736
|
-
} finally {
|
|
9737
|
-
collection.dispose();
|
|
9738
|
-
}
|
|
9739
|
-
}
|
|
9740
|
-
/** Resolve PlRef values in anchors to PColumnSpec via the result pool. */
|
|
9741
|
-
function resolveAnchors$1(ctx, anchors) {
|
|
9742
|
-
const result = {};
|
|
9743
|
-
for (const [key, value] of Object.entries(anchors)) if (isPlRef(value)) result[key] = ctx.resultPool.getPColumnSpecByRef(value) ?? throwError(`Anchor ${key} with ref ${JSON.stringify(value)} could not be resolved to a PColumnSpec`);
|
|
9744
|
-
else result[key] = value;
|
|
9745
|
-
return result;
|
|
9746
|
-
}
|
|
9747
|
-
/** Resolve column snapshot providers from explicit sources or context. */
|
|
9748
|
-
function resolveProviders(ctx, sources) {
|
|
9749
|
-
return sources !== void 0 ? sources.map(toColumnSnapshotProvider) : collectCtxColumnSnapshotProviders(ctx);
|
|
9750
|
-
}
|
|
9751
|
-
/** Map column variants into TableColumnVariant list with anchor-derived isPrimary flag. */
|
|
9752
|
-
function mapToTableColumnVariants(variants, anchors) {
|
|
9753
|
-
const columnIdToAnchorName = new Map(Array.from(anchors.entries(), ([key, { id }]) => [id, key]));
|
|
9754
|
-
return variants.map((variant) => {
|
|
9755
|
-
const snap = variant.column;
|
|
9756
|
-
const isPrimary = columnIdToAnchorName.get(snap.id) !== void 0;
|
|
9114
|
+
function createPlDataTableV2(ctx, columns, tableState, options) {
|
|
9115
|
+
if (columns.length === 0) return void 0;
|
|
9116
|
+
const tableStateNormalized = upgradePlDataTableStateV2(tableState);
|
|
9117
|
+
const allLabelColumns = getAllLabelColumns(ctx.resultPool) ?? [];
|
|
9118
|
+
let fullLabelColumns = getMatchingLabelColumns(columns, allLabelColumns);
|
|
9119
|
+
fullLabelColumns = deriveLabels(fullLabelColumns, identity, { includeNativeLabel: true }).map((v) => {
|
|
9757
9120
|
return {
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
queriesQualifications: variant.qualifications?.forQueries
|
|
9767
|
-
}),
|
|
9768
|
-
spec: snap.spec,
|
|
9769
|
-
data: snap.data,
|
|
9770
|
-
dataStatus: snap.dataStatus
|
|
9771
|
-
},
|
|
9772
|
-
path: variant.path,
|
|
9773
|
-
qualifications: variant.qualifications,
|
|
9774
|
-
originalId: snap.id,
|
|
9775
|
-
isPrimary
|
|
9121
|
+
...v.value,
|
|
9122
|
+
spec: {
|
|
9123
|
+
...v.value.spec,
|
|
9124
|
+
annotations: {
|
|
9125
|
+
...v.value.spec.annotations,
|
|
9126
|
+
[Annotation.Label]: v.label
|
|
9127
|
+
}
|
|
9128
|
+
}
|
|
9776
9129
|
};
|
|
9777
9130
|
});
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9786
|
-
|
|
9787
|
-
const
|
|
9788
|
-
const
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9793
|
-
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
spec: dc.column.spec,
|
|
9804
|
-
linkerPath: dc.path,
|
|
9805
|
-
qualifications: dc.qualifications
|
|
9806
|
-
})) });
|
|
9807
|
-
const annotated = annotateColumnGroups({
|
|
9808
|
-
pframeSpec,
|
|
9809
|
-
...splited,
|
|
9810
|
-
derivedLabels,
|
|
9811
|
-
derivedTooltips,
|
|
9812
|
-
displayOptions: options.displayOptions
|
|
9813
|
-
});
|
|
9814
|
-
const primarySnapshots = annotated.direct.filter((c) => c.isPrimary);
|
|
9815
|
-
const secondarySnapshots = annotated.direct.filter((c) => !c.isPrimary);
|
|
9816
|
-
if (primarySnapshots.length === 0) return void 0;
|
|
9817
|
-
const columnIsAvailable = createColumnValidationById([...annotated.direct.map((v) => v.column), ...annotated.linked.flatMap((lc) => [...(lc.path ?? []).map((s) => s.linker), lc.column])]);
|
|
9818
|
-
const remapedDefaultFilters = remapFilterColumnIds(options.filters, discovered);
|
|
9819
|
-
const filters = filterFilters(concatFilters(state.pTableParams.filters, state.pTableParams.defaultFilters ?? remapedDefaultFilters), columnIsAvailable);
|
|
9820
|
-
const sorting = filterSorting(resolveSorting(state.pTableParams.sorting, remapSortingColumnIds(options.sorting, discovered)), columnIsAvailable);
|
|
9821
|
-
const primaryEntries = primarySnapshots.map((v) => ({ column: resolveSnapshot(v.column) }));
|
|
9822
|
-
const fullDef = createPTableDefV3({
|
|
9823
|
-
primaryJoinType,
|
|
9824
|
-
primary: primaryEntries,
|
|
9825
|
-
secondary: buildSecondaryGroups(secondarySnapshots, annotated.linked),
|
|
9131
|
+
const fullColumns = [...columns, ...fullLabelColumns];
|
|
9132
|
+
const fullColumnsIds = [...uniqueBy(fullColumns.flatMap((c) => c.spec.axesSpec.map((a) => getAxisId(a))), (a) => canonicalizeJson(a)).map((a) => ({
|
|
9133
|
+
type: "axis",
|
|
9134
|
+
id: a
|
|
9135
|
+
})), ...fullColumns.map((c) => ({
|
|
9136
|
+
type: "column",
|
|
9137
|
+
id: c.id
|
|
9138
|
+
}))];
|
|
9139
|
+
const fullColumnsIdsSet = new Set(fullColumnsIds.map((c) => canonicalizeJson(c)));
|
|
9140
|
+
const isValidColumnId = (id) => fullColumnsIdsSet.has(id);
|
|
9141
|
+
const filters = tableStateNormalized.pTableParams.filters;
|
|
9142
|
+
const defaultFilters = options?.filters ?? void 0;
|
|
9143
|
+
const firstInvalidFilterColumn = (filters !== null ? collectFilterSpecColumns(filters) : []).find((col) => !isValidColumnId(col));
|
|
9144
|
+
if (firstInvalidFilterColumn) throw new Error(`Invalid filter column ${firstInvalidFilterColumn}: column reference does not match the table columns`);
|
|
9145
|
+
const firstInvalidDefaultFilterColumn = (defaultFilters !== void 0 ? collectFilterSpecColumns(defaultFilters) : []).find((col) => !isValidColumnId(col));
|
|
9146
|
+
if (firstInvalidDefaultFilterColumn) throw new Error(`Invalid default filter column ${firstInvalidDefaultFilterColumn}: column reference does not match the table columns`);
|
|
9147
|
+
const userSorting = tableStateNormalized.pTableParams.sorting;
|
|
9148
|
+
const sorting = (isEmpty(userSorting) ? options?.sorting : userSorting) ?? [];
|
|
9149
|
+
const firstInvalidSortingColumn = sorting.find((s) => !isValidColumnId(canonicalizeJson(s.column)));
|
|
9150
|
+
if (firstInvalidSortingColumn) throw new Error(`Invalid sorting column ${JSON.stringify(firstInvalidSortingColumn.column)}: column reference does not match the table columns`);
|
|
9151
|
+
const coreJoinType = options?.coreJoinType ?? "full";
|
|
9152
|
+
const fullDef = createPTableDefV2({
|
|
9153
|
+
columns,
|
|
9154
|
+
labelColumns: fullLabelColumns,
|
|
9155
|
+
coreJoinType,
|
|
9826
9156
|
filters,
|
|
9827
|
-
sorting
|
|
9157
|
+
sorting,
|
|
9158
|
+
coreColumnPredicate: options?.coreColumnPredicate
|
|
9828
9159
|
});
|
|
9829
9160
|
const fullHandle = ctx.createPTableV2(fullDef);
|
|
9830
|
-
const pframeHandle = ctx.createPFrame(
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
|
|
9836
|
-
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9161
|
+
const pframeHandle = ctx.createPFrame(fullColumns);
|
|
9162
|
+
if (!fullHandle || !pframeHandle) return void 0;
|
|
9163
|
+
const hiddenColumns = new Set((() => {
|
|
9164
|
+
if (coreJoinType === "inner") return [];
|
|
9165
|
+
const hiddenColIds = tableStateNormalized.pTableParams.hiddenColIds;
|
|
9166
|
+
if (hiddenColIds !== null) return hiddenColIds.filter((s) => s.type === "column").map((s) => s.id);
|
|
9167
|
+
return columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);
|
|
9168
|
+
})());
|
|
9169
|
+
columns.filter((c) => isLinkerColumn(c.spec)).forEach((c) => hiddenColumns.delete(c.id));
|
|
9170
|
+
const coreColumnPredicate = options?.coreColumnPredicate;
|
|
9171
|
+
if (coreColumnPredicate) columns.flatMap((c) => coreColumnPredicate(getColumnIdAndSpec(c)) ? [c.id] : []).forEach((c) => hiddenColumns.delete(c));
|
|
9172
|
+
sorting.map((s) => s.column).filter((c) => c.type === "column").forEach((c) => hiddenColumns.delete(c.id));
|
|
9173
|
+
if (filters) collectFilterSpecColumns(filters).flatMap((c) => {
|
|
9174
|
+
const obj = parseJson(c);
|
|
9175
|
+
return obj.type === "column" ? [obj.id] : [];
|
|
9176
|
+
}).forEach((c) => hiddenColumns.delete(c));
|
|
9177
|
+
const visibleColumns = columns.filter((c) => !hiddenColumns.has(c.id));
|
|
9178
|
+
const visibleLabelColumns = getMatchingLabelColumns(visibleColumns.map(getColumnIdAndSpec), allLabelColumns);
|
|
9179
|
+
if (!allPColumnsReady([...visibleColumns, ...visibleLabelColumns])) return void 0;
|
|
9180
|
+
const visibleDef = createPTableDefV2({
|
|
9181
|
+
columns: visibleColumns,
|
|
9182
|
+
labelColumns: visibleLabelColumns,
|
|
9183
|
+
coreJoinType,
|
|
9841
9184
|
filters,
|
|
9842
|
-
sorting
|
|
9185
|
+
sorting,
|
|
9186
|
+
coreColumnPredicate
|
|
9843
9187
|
});
|
|
9844
9188
|
const visibleHandle = ctx.createPTableV2(visibleDef);
|
|
9189
|
+
if (!visibleHandle) return void 0;
|
|
9845
9190
|
return {
|
|
9846
|
-
sourceId:
|
|
9191
|
+
sourceId: tableStateNormalized.pTableParams.sourceId,
|
|
9847
9192
|
fullTableHandle: fullHandle,
|
|
9848
9193
|
fullPframeHandle: pframeHandle,
|
|
9849
9194
|
visibleTableHandle: visibleHandle,
|
|
9850
|
-
defaultFilters
|
|
9851
|
-
};
|
|
9852
|
-
}
|
|
9853
|
-
/** Split discovered columns into direct (no linker path) and linked (with linker path). */
|
|
9854
|
-
function splitDiscoveredColumns(columns) {
|
|
9855
|
-
return {
|
|
9856
|
-
direct: columns.filter((dc) => (dc.path?.length ?? 0) === 0),
|
|
9857
|
-
linked: columns.filter((dc) => (dc.path?.length ?? 0) > 0)
|
|
9858
|
-
};
|
|
9859
|
-
}
|
|
9860
|
-
/** All linker snapshots across the given linked columns, deduped by id. */
|
|
9861
|
-
function collectLinkerSnapshots(linked) {
|
|
9862
|
-
return uniqueBy(linked.flatMap((lc) => (lc.path ?? []).map((s) => s.linker)), (c) => c.id);
|
|
9863
|
-
}
|
|
9864
|
-
/**
|
|
9865
|
-
* Annotate all column groups with derived labels and display-rule annotations.
|
|
9866
|
-
* Evaluates `displayOptions` rules against all discovered columns (direct,
|
|
9867
|
-
* linked, labels, linkers) and writes the winning visibility/priority into
|
|
9868
|
-
* column annotations via `withTableVisualAnnotations`.
|
|
9869
|
-
*/
|
|
9870
|
-
function annotateColumnGroups(params) {
|
|
9871
|
-
const { direct, linked, derivedLabels, derivedTooltips, displayOptions, pframeSpec } = params;
|
|
9872
|
-
const allColumnsForRules = [
|
|
9873
|
-
...direct.map((v) => v.column),
|
|
9874
|
-
...linked.map((v) => v.column),
|
|
9875
|
-
...collectLinkerSnapshots(linked)
|
|
9876
|
-
];
|
|
9877
|
-
const visibilityByColId = evaluateRules(displayOptions?.visibility ?? [], allColumnsForRules, pframeSpec);
|
|
9878
|
-
const orderByColId = evaluateRules(displayOptions?.ordering ?? [], allColumnsForRules, pframeSpec);
|
|
9879
|
-
return {
|
|
9880
|
-
direct: liftToVariantColumns(direct, flow((cols) => withDataStatusAnnotations(cols), (cols) => withLabelAnnotations(derivedLabels, cols), (cols) => withInfoAnnotations(derivedTooltips, cols), (cols) => withTableVisualAnnotations(visibilityByColId, orderByColId, cols))),
|
|
9881
|
-
linked: liftToVariantColumns(linked, flow((cols) => withDataStatusAnnotations(cols), (cols) => withHidenAxesAnnotations(cols), (cols) => withLabelAnnotations(derivedLabels, cols), (cols) => withInfoAnnotations(derivedTooltips, cols), (cols) => withTableVisualAnnotations(visibilityByColId, orderByColId, cols))).map((lc) => ({
|
|
9882
|
-
...lc,
|
|
9883
|
-
path: annotateLinkerPath(derivedLabels, lc.path)
|
|
9884
|
-
}))
|
|
9885
|
-
};
|
|
9886
|
-
}
|
|
9887
|
-
/** Lift a snapshot-array transform so it runs on the inner `column` of each variant. */
|
|
9888
|
-
function liftToVariantColumns(variants, fn) {
|
|
9889
|
-
const cols = fn(variants.map((v) => v.column));
|
|
9890
|
-
if (cols.length !== variants.length) throw new Error(`liftToVariantColumns: fn must preserve array length (got ${cols.length}, expected ${variants.length})`);
|
|
9891
|
-
return variants.map((v, i) => ({
|
|
9892
|
-
...v,
|
|
9893
|
-
column: cols[i]
|
|
9894
|
-
}));
|
|
9895
|
-
}
|
|
9896
|
-
function annotateLinkerPath(derivedLabels, path) {
|
|
9897
|
-
if (isNil$1(path) || path.length === 0) return path;
|
|
9898
|
-
const annotatedLinkers = withHidenAxesAnnotations(withLabelAnnotations(derivedLabels, path.map((s) => s.linker)));
|
|
9899
|
-
return path.map((s, i) => ({
|
|
9900
|
-
...s,
|
|
9901
|
-
linker: annotatedLinkers[i]
|
|
9902
|
-
}));
|
|
9903
|
-
}
|
|
9904
|
-
/** Build an index of all valid column IDs (axes + columns) for filter/sorting validation. */
|
|
9905
|
-
function createColumnValidationById(fullColumns) {
|
|
9906
|
-
const allIds = [...uniqueBy(fullColumns.flatMap((c) => c.spec.axesSpec.map(getAxisId)), (a) => canonicalizeJson(a)).map((a) => ({
|
|
9907
|
-
type: "axis",
|
|
9908
|
-
id: a
|
|
9909
|
-
})), ...fullColumns.map((c) => ({
|
|
9910
|
-
type: "column",
|
|
9911
|
-
id: c.id
|
|
9912
|
-
}))];
|
|
9913
|
-
const validIdSet = new Set(allIds.map((c) => canonicalizeJson(c)));
|
|
9914
|
-
return (id) => {
|
|
9915
|
-
return validIdSet.has(id);
|
|
9916
|
-
};
|
|
9917
|
-
}
|
|
9918
|
-
/** Drop filter leaves whose column references are not available in the table. */
|
|
9919
|
-
function filterFilters(filters, isValidColumnId) {
|
|
9920
|
-
if (isNil$1(filters)) return filters;
|
|
9921
|
-
const isLeafValid = (leaf) => {
|
|
9922
|
-
if (leaf.type === void 0) return true;
|
|
9923
|
-
if ("column" in leaf && !isValidColumnId(leaf.column)) return false;
|
|
9924
|
-
if ("rhs" in leaf && !isValidColumnId(leaf.rhs)) return false;
|
|
9925
|
-
return true;
|
|
9926
|
-
};
|
|
9927
|
-
const prune = (node) => {
|
|
9928
|
-
if (node.type === "and" || node.type === "or") {
|
|
9929
|
-
const kept = node.filters.map((f) => prune(f)).filter((f) => !isNil$1(f));
|
|
9930
|
-
return {
|
|
9931
|
-
type: node.type,
|
|
9932
|
-
filters: kept
|
|
9933
|
-
};
|
|
9934
|
-
}
|
|
9935
|
-
if (node.type === "not") {
|
|
9936
|
-
const inner = prune(node.filter);
|
|
9937
|
-
return isNil$1(inner) ? void 0 : {
|
|
9938
|
-
type: "not",
|
|
9939
|
-
filter: inner
|
|
9940
|
-
};
|
|
9941
|
-
}
|
|
9942
|
-
return isLeafValid(node) ? node : void 0;
|
|
9943
|
-
};
|
|
9944
|
-
return prune(filters);
|
|
9945
|
-
}
|
|
9946
|
-
/** Merge two filter trees into one AND-combined tree. Returns the non-nil one if the other is nil. */
|
|
9947
|
-
function concatFilters(a, b) {
|
|
9948
|
-
if (isNil$1(a)) return b;
|
|
9949
|
-
if (isNil$1(b)) return a;
|
|
9950
|
-
return {
|
|
9951
|
-
...a,
|
|
9952
|
-
filters: [...a.filters, ...b.filters]
|
|
9953
|
-
};
|
|
9954
|
-
}
|
|
9955
|
-
/** Pick user sorting from state if non-empty, otherwise fall back to options default. */
|
|
9956
|
-
function resolveSorting(userSorting, defaultSorting) {
|
|
9957
|
-
return (isEmpty(userSorting) ? defaultSorting : userSorting) ?? [];
|
|
9958
|
-
}
|
|
9959
|
-
/** Drop sorting entries whose column is not available in the table. */
|
|
9960
|
-
function filterSorting(sorting, isValidColumnId) {
|
|
9961
|
-
return sorting.filter((s) => isValidColumnId(canonicalizeJson(s.column)));
|
|
9962
|
-
}
|
|
9963
|
-
function buildSecondaryGroups(direct, linked) {
|
|
9964
|
-
return [...direct.map((c) => ({
|
|
9965
|
-
entries: [{
|
|
9966
|
-
column: resolveSnapshot(c.column),
|
|
9967
|
-
qualifications: c.qualifications?.forHit
|
|
9968
|
-
}],
|
|
9969
|
-
primaryQualifications: c.qualifications?.forQueries
|
|
9970
|
-
})), ...linked.map((lc) => ({
|
|
9971
|
-
entries: [{
|
|
9972
|
-
column: resolveSnapshot(lc.column),
|
|
9973
|
-
linkers: lc.path?.map((s) => resolveSnapshot(s.linker)),
|
|
9974
|
-
qualifications: lc.qualifications?.forHit
|
|
9975
|
-
}],
|
|
9976
|
-
primaryQualifications: lc.qualifications?.forQueries
|
|
9977
|
-
}))];
|
|
9978
|
-
}
|
|
9979
|
-
/** Determine which columns should be hidden based on state or optional-column defaults. */
|
|
9980
|
-
function computeHiddenColumns(columns, sorting, filters, hiddenSpecs) {
|
|
9981
|
-
const alwaysHidden = columns.filter((c) => isColumnHidden(c.spec)).map((c) => c.id);
|
|
9982
|
-
const optionalHidden = !isNil$1(hiddenSpecs) ? hiddenSpecs.filter((s) => s.type === "column").map((s) => s.id) : columns.filter((c) => isColumnOptional(c.spec)).map((c) => c.id);
|
|
9983
|
-
const initial = [...alwaysHidden, ...optionalHidden];
|
|
9984
|
-
const preserved = collectPreservedColumnIds(sorting, filters);
|
|
9985
|
-
return new Set(initial.filter((id) => !preserved.has(id)));
|
|
9986
|
-
}
|
|
9987
|
-
/** Collect IDs of columns that must remain visible (sorted, filtered). */
|
|
9988
|
-
function collectPreservedColumnIds(sorting, filters) {
|
|
9989
|
-
const sortedIds = (sorting ?? []).map((s) => s.column).filter((c) => c.type === "column").map((c) => c.id);
|
|
9990
|
-
const filterIds = !isNil$1(filters) ? collectFilterSpecColumns(filters).flatMap((c) => {
|
|
9991
|
-
const obj = parseJson(c);
|
|
9992
|
-
return obj.type === "column" ? [obj.id] : [];
|
|
9993
|
-
}) : [];
|
|
9994
|
-
return new Set([...sortedIds, ...filterIds]);
|
|
9995
|
-
}
|
|
9996
|
-
/** Filter annotated columns to only visible ones, re-matching label columns for the visible subset. */
|
|
9997
|
-
function buildVisibleColumns(annotated, hiddenColumns) {
|
|
9998
|
-
return {
|
|
9999
|
-
direct: annotated.direct.filter((c) => !hiddenColumns.has(c.column.id)),
|
|
10000
|
-
linked: annotated.linked.filter((c) => !hiddenColumns.has(c.column.id))
|
|
10001
|
-
};
|
|
10002
|
-
}
|
|
10003
|
-
/** Resolve a ColumnSnapshot to a PColumn with lazily-evaluated data. */
|
|
10004
|
-
function resolveSnapshot(snap) {
|
|
10005
|
-
return {
|
|
10006
|
-
id: snap.id,
|
|
10007
|
-
spec: snap.spec,
|
|
10008
|
-
data: snap.data?.get()
|
|
9195
|
+
defaultFilters
|
|
10009
9196
|
};
|
|
10010
9197
|
}
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
return [{
|
|
10019
|
-
...s,
|
|
10020
|
-
column: {
|
|
10021
|
-
type: "column",
|
|
10022
|
-
id: column.column.id
|
|
10023
|
-
}
|
|
10024
|
-
}];
|
|
10025
|
-
});
|
|
10026
|
-
}
|
|
10027
|
-
/** Remap column references in a filter tree. */
|
|
10028
|
-
function remapFilterColumnIds(filters, columns) {
|
|
10029
|
-
if (isNil$1(filters)) return filters;
|
|
10030
|
-
const map = (tableColumnId) => {
|
|
10031
|
-
const parsed = parseJson(tableColumnId);
|
|
10032
|
-
if (parsed.type === "axis") return tableColumnId;
|
|
10033
|
-
const originalId = parsed.id;
|
|
10034
|
-
return canonicalizeJson({
|
|
10035
|
-
type: "column",
|
|
10036
|
-
id: (columns.find((c) => (getField(c, "originalId") ?? c.column.id) === originalId) ?? throwError(`Column ID "${parsed.id}" in filters does not match any discovered column`)).column.id
|
|
10037
|
-
});
|
|
10038
|
-
};
|
|
10039
|
-
return traverseFilterSpec(filters, {
|
|
10040
|
-
leaf: (leaf) => {
|
|
10041
|
-
if (leaf.type === void 0) return leaf;
|
|
10042
|
-
const result = { ...leaf };
|
|
10043
|
-
if ("column" in result) result.column = map(result.column);
|
|
10044
|
-
if ("rhs" in result) result.rhs = map(result.rhs);
|
|
10045
|
-
return result;
|
|
10046
|
-
},
|
|
10047
|
-
and: (results) => ({
|
|
10048
|
-
type: "and",
|
|
10049
|
-
filters: results
|
|
10050
|
-
}),
|
|
10051
|
-
or: (results) => ({
|
|
10052
|
-
type: "or",
|
|
10053
|
-
filters: results
|
|
10054
|
-
}),
|
|
10055
|
-
not: (result) => ({
|
|
10056
|
-
type: "not",
|
|
10057
|
-
filter: result
|
|
10058
|
-
})
|
|
9198
|
+
function getAllLabelColumns(resultPool) {
|
|
9199
|
+
return new PColumnCollection().addAxisLabelProvider(resultPool).addColumnProvider(resultPool).getColumns({
|
|
9200
|
+
name: PColumnName.Label,
|
|
9201
|
+
axes: [{}]
|
|
9202
|
+
}, {
|
|
9203
|
+
dontWaitAllData: true,
|
|
9204
|
+
overrideLabelAnnotation: false
|
|
10059
9205
|
});
|
|
10060
9206
|
}
|
|
10061
9207
|
(/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
@@ -10158,38 +9304,7 @@
|
|
|
10158
9304
|
if (ctx.data.inputAnchor === void 0) return void 0;
|
|
10159
9305
|
const ownCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
10160
9306
|
if (ownCols === void 0) return void 0;
|
|
10161
|
-
|
|
10162
|
-
if (info === void 0) return void 0;
|
|
10163
|
-
const tier = info.coverageTier;
|
|
10164
|
-
const sources = [new ArrayColumnProvider(ctx.resultPool.selectColumns((spec) => !spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties"))), new ArrayColumnProvider(ownCols)];
|
|
10165
|
-
return createPlDataTableV3(ctx, {
|
|
10166
|
-
tableState: ctx.data.tableState,
|
|
10167
|
-
columns: {
|
|
10168
|
-
sources,
|
|
10169
|
-
anchors: { main: ctx.data.inputAnchor },
|
|
10170
|
-
selector: { mode: "enrichment" }
|
|
10171
|
-
},
|
|
10172
|
-
displayOptions: { visibility: [{
|
|
10173
|
-
match: (spec) => {
|
|
10174
|
-
if (spec.domain?.["pl7.app/vdj/scClonotypeChain/index"] === "secondary") return false;
|
|
10175
|
-
if (spec.domain?.["pl7.app/alphabet"] !== "aminoacid") return false;
|
|
10176
|
-
const isVdj = spec.name === "pl7.app/vdj/sequence";
|
|
10177
|
-
const isUniversal = spec.name === "pl7.app/sequence";
|
|
10178
|
-
if (!isVdj && !isUniversal) return false;
|
|
10179
|
-
const feature = isVdj ? spec.domain?.["pl7.app/vdj/feature"] : spec.domain?.["pl7.app/feature"];
|
|
10180
|
-
if (tier === "peptide") return isUniversal && feature === "peptide";
|
|
10181
|
-
const chain = spec.domain?.["pl7.app/vdj/scClonotypeChain"];
|
|
10182
|
-
if (chain !== void 0 && chain !== "A") return false;
|
|
10183
|
-
if (tier === "full_chain") return feature === "VDJRegion" || feature === "VDJRegionInFrame";
|
|
10184
|
-
if (tier === "cdr3_only" || tier === "partial") return feature === "CDR3";
|
|
10185
|
-
return false;
|
|
10186
|
-
},
|
|
10187
|
-
visibility: "default"
|
|
10188
|
-
}, {
|
|
10189
|
-
match: (spec) => !spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties") && spec.annotations?.["pl7.app/isLinkerColumn"] !== "true",
|
|
10190
|
-
visibility: "optional"
|
|
10191
|
-
}] }
|
|
10192
|
-
});
|
|
9307
|
+
return createPlDataTableV2(ctx, ownCols.filter((c) => c.spec.axesSpec.length === 1), ctx.data.tableState);
|
|
10193
9308
|
}).outputWithStatus("propertiesPfHandle", (ctx) => {
|
|
10194
9309
|
const allPCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
10195
9310
|
if (allPCols === void 0) return void 0;
|
|
@@ -10202,7 +9317,7 @@
|
|
|
10202
9317
|
anchor: "main",
|
|
10203
9318
|
idx: 1
|
|
10204
9319
|
}] }]) ?? []).filter((c) => !c.spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties")) : [];
|
|
10205
|
-
return ctx
|
|
9320
|
+
return createPFrameForGraphs(ctx, [...pCols, ...upstreamMeta]);
|
|
10206
9321
|
}).output("propertiesPfCols", (ctx) => {
|
|
10207
9322
|
const pCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
|
|
10208
9323
|
if (pCols === void 0) return void 0;
|