@platforma-open/milaboratories.humanization-score.model 0.2.0 → 0.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/dist/bundle.js CHANGED
@@ -25,14 +25,14 @@
25
25
  enumerable: true
26
26
  }) : target, mod));
27
27
  //#endregion
28
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/plugin_handle.js
28
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/plugin_handle.js
29
29
  const PLUGIN_OUTPUT_PREFIX = "plugin-output#";
30
30
  /** Construct the output key for a plugin output in the block outputs map. */
31
31
  function pluginOutputKey(handle, outputKey) {
32
32
  return `${PLUGIN_OUTPUT_PREFIX}${handle}#${outputKey}`;
33
33
  }
34
34
  //#endregion
35
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/block_storage.js
35
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/block_storage.js
36
36
  /**
37
37
  * Discriminator key for BlockStorage format detection.
38
38
  * This unique hash-based key identifies data as BlockStorage vs legacy formats.
@@ -274,7 +274,7 @@
274
274
  return pluginEntry.__data;
275
275
  }
276
276
  //#endregion
277
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/block_migrations.js
277
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/block_migrations.js
278
278
  /** Create a DataVersioned wrapper with correct shape */
279
279
  function makeVersionedData(version, data) {
280
280
  return {
@@ -769,7 +769,7 @@
769
769
  }
770
770
  };
771
771
  //#endregion
772
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/internal.js
772
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/internal.js
773
773
  /** Utility code helping to identify whether the code is running in actual UI environment */
774
774
  function isInUI() {
775
775
  return typeof globalThis.getPlatforma !== "undefined" || typeof globalThis.platforma !== "undefined";
@@ -839,7 +839,7 @@
839
839
  futureResolves.get(handle).push(onResolve);
840
840
  }
841
841
  //#endregion
842
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
842
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/block_storage_facade.js
843
843
  /**
844
844
  * All facade callback names as constants.
845
845
  * These are the source of truth - the interface is derived from these.
@@ -874,7 +874,7 @@
874
874
  for (const key of Object.values(BlockStorageFacadeCallbacks)) tryRegisterCallback(key, callbacks[key]);
875
875
  }
876
876
  //#endregion
877
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/future.js
877
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/future.js
878
878
  var FutureRef = class FutureRef {
879
879
  isResolved = false;
880
880
  resolvedValue;
@@ -4960,6 +4960,9 @@
4960
4960
  Sequence: "pl7.app/vdj/sequence"
4961
4961
  }
4962
4962
  };
4963
+ function isLabelColumn(column) {
4964
+ return column.axesSpec.length === 1 && column.name === PColumnName.Label;
4965
+ }
4963
4966
  /** Get column id and spec from a column */
4964
4967
  function getColumnIdAndSpec(column) {
4965
4968
  return {
@@ -5998,7 +6001,7 @@
5998
6001
  buildMethodMap(getServiceUiMethods);
5999
6002
  buildMethodMap(getServiceModelMethods);
6000
6003
  //#endregion
6001
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/accessor.js
6004
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/accessor.js
6002
6005
  function ifDef(value, cb) {
6003
6006
  return value === void 0 ? void 0 : cb(value);
6004
6007
  }
@@ -6209,11 +6212,11 @@
6209
6212
  }
6210
6213
  };
6211
6214
  //#endregion
6212
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/internal.js
6215
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/internal.js
6213
6216
  const StagingAccessorName = "staging";
6214
6217
  const MainAccessorName = "main";
6215
6218
  //#endregion
6216
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
6219
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/util/axis_filtering.js
6217
6220
  function filterDataInfoEntries(dataInfoEntries, axisFilters) {
6218
6221
  const sortedFilters = [...axisFilters].sort((a, b) => b[0] - a[0]);
6219
6222
  const { type } = dataInfoEntries;
@@ -6312,7 +6315,7 @@
6312
6315
  return x == null;
6313
6316
  }
6314
6317
  //#endregion
6315
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
6318
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_labels.js
6316
6319
  const DISTANCE_PENALTY = .001;
6317
6320
  const LABEL_TYPE = "__LABEL__";
6318
6321
  const LABEL_TYPE_FULL = "__LABEL__@1";
@@ -6578,7 +6581,7 @@
6578
6581
  return result;
6579
6582
  }
6580
6583
  //#endregion
6581
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/util/label.js
6584
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/util/label.js
6582
6585
  /** @deprecated Use deriveDistinctLabels */
6583
6586
  function deriveLabels(values, getSpec, options = {}) {
6584
6587
  return deriveDistinctLabels(values.map(getSpec), options).map((label, i) => ({
@@ -6587,7 +6590,7 @@
6587
6590
  }));
6588
6591
  }
6589
6592
  //#endregion
6590
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
6593
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/util/pcolumn_data.js
6591
6594
  const PCD_PREFIX = "PColumnData/";
6592
6595
  const RT_RESOURCE_MAP = PCD_PREFIX + "ResourceMap";
6593
6596
  const RT_RESOURCE_MAP_PARTITIONED = PCD_PREFIX + "Partitioned/ResourceMap";
@@ -6887,7 +6890,7 @@
6887
6890
  return columns.every(isPColumnReady);
6888
6891
  }
6889
6892
  //#endregion
6890
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
6893
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/util/column_collection.js
6891
6894
  function isPColumnValues(value) {
6892
6895
  if (!Array.isArray(value)) return false;
6893
6896
  if (value.length === 0) return true;
@@ -7162,7 +7165,7 @@
7162
7165
  }
7163
7166
  };
7164
7167
  //#endregion
7165
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/services/block_services.js
7168
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/services/block_services.js
7166
7169
  /**
7167
7170
  * Services required by all V3 blocks by default.
7168
7171
  * Edit this when a new service should be available to all blocks.
@@ -7177,7 +7180,7 @@
7177
7180
  };
7178
7181
  resolveRequiredServices(BLOCK_SERVICE_FLAGS);
7179
7182
  //#endregion
7180
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
7183
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/services/service_bridge.js
7181
7184
  /**
7182
7185
  * Builds a ServiceProxy from a ServiceDispatch.
7183
7186
  * Each service method call is forwarded to dispatch.callServiceMethod.
@@ -7186,7 +7189,7 @@
7186
7189
  return ((serviceId) => Object.freeze(Object.fromEntries(dispatch.getServiceMethods(serviceId).map((method) => [method, (...args) => dispatch.callServiceMethod(serviceId, method, ...args)]))));
7187
7190
  }
7188
7191
  //#endregion
7189
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/services/get_services.js
7192
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/services/get_services.js
7190
7193
  const cachedServices = /* @__PURE__ */ new WeakMap();
7191
7194
  function getService(name) {
7192
7195
  const ctx = getCfgRenderCtx();
@@ -7200,7 +7203,7 @@
7200
7203
  })();
7201
7204
  }
7202
7205
  //#endregion
7203
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
7206
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/util/pframe_upgraders.js
7204
7207
  function patchInSetFilters(filters) {
7205
7208
  const inSetToOrEqual = (predicate) => {
7206
7209
  if (predicate.operator !== "InSet") return predicate;
@@ -7238,7 +7241,7 @@
7238
7241
  return filters.map((filter) => mapFilter(filter, inSetToOrEqual));
7239
7242
  }
7240
7243
  //#endregion
7241
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/render/api.js
7244
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/render/api.js
7242
7245
  /**
7243
7246
  * Helper function to match domain objects
7244
7247
  * @param query Optional domain to match against
@@ -7689,26 +7692,26 @@
7689
7692
  }
7690
7693
  };
7691
7694
  //#endregion
7692
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/version.js
7693
- const PlatformaSDKVersion = "1.77.15";
7695
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/version.js
7696
+ const PlatformaSDKVersion = "1.77.17";
7694
7697
  //#endregion
7695
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/bconfig/types.js
7698
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/bconfig/types.js
7696
7699
  function isConfigLambda(cfgOrFh) {
7697
7700
  return cfgOrFh.__renderLambda === true;
7698
7701
  }
7699
7702
  //#endregion
7700
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
7703
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/bconfig/normalization.js
7701
7704
  function downgradeCfgOrLambda(data) {
7702
7705
  if (data === void 0) return void 0;
7703
7706
  if (isConfigLambda(data)) return data.handle;
7704
7707
  return data;
7705
7708
  }
7706
7709
  //#endregion
7707
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/plugin_model.js
7710
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/plugin_model.js
7708
7711
  /** Symbol for internal plugin model creation — not accessible to external consumers */
7709
7712
  const CREATE_PLUGIN_MODEL = Symbol("createPluginModel");
7710
7713
  //#endregion
7711
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
7714
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/block_storage_callbacks.js
7712
7715
  /**
7713
7716
  * BlockStorage Callback Implementations - wired to facade callbacks in BlockModelV3.done().
7714
7717
  *
@@ -7885,7 +7888,7 @@
7885
7888
  }
7886
7889
  }
7887
7890
  //#endregion
7888
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/block_model.js
7891
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/block_model.js
7889
7892
  /**
7890
7893
  * Merges two feature flag objects with type-aware logic:
7891
7894
  * - `supports*` (boolean): OR — `true` if either side is `true`
@@ -8196,7 +8199,199 @@
8196
8199
  }
8197
8200
  };
8198
8201
  //#endregion
8199
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/columns/column_selector.js
8202
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
8203
+ /** Create id for column copy with added keys in axes domains */
8204
+ const colId = (id, domains, contextDomains) => {
8205
+ let wid = id.toString();
8206
+ domains?.forEach((domain) => {
8207
+ if (domain) for (const [k, v] of Object.entries(domain)) {
8208
+ wid += k;
8209
+ wid += v;
8210
+ }
8211
+ });
8212
+ contextDomains?.forEach((contextDomain) => {
8213
+ if (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {
8214
+ wid += k;
8215
+ wid += v;
8216
+ }
8217
+ });
8218
+ return wid;
8219
+ };
8220
+ /** All combinations with 1 key from each list */
8221
+ function getKeysCombinations(idsLists) {
8222
+ if (!idsLists.length) return [];
8223
+ let result = [[]];
8224
+ idsLists.forEach((list) => {
8225
+ const nextResult = [];
8226
+ list.forEach((key) => {
8227
+ nextResult.push(...result.map((resultItem) => [...resultItem, key]));
8228
+ });
8229
+ result = nextResult;
8230
+ });
8231
+ return result;
8232
+ }
8233
+ function getAvailableWithLinkersAxes(linkerColumns, blockAxes) {
8234
+ const availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));
8235
+ return new Map(availableAxes.map((axisSpec) => {
8236
+ return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
8237
+ }));
8238
+ }
8239
+ /** Add columns with fully compatible axes created from partial compatible ones */
8240
+ function enrichCompatible(blockAxes, columns) {
8241
+ return columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));
8242
+ }
8243
+ function getAdditionalColumnsForColumn(blockAxes, column) {
8244
+ const columnAxesIds = column.spec.axesSpec.map(getAxisId);
8245
+ if (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];
8246
+ const secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {
8247
+ const result = [];
8248
+ for (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);
8249
+ return result;
8250
+ }));
8251
+ const allAddedDomainValues = /* @__PURE__ */ new Set();
8252
+ const addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();
8253
+ const addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {
8254
+ const addedSet = /* @__PURE__ */ new Set();
8255
+ idsList.map((axisId, idx) => {
8256
+ const d1 = column.spec.axesSpec[idx].domain;
8257
+ const d2 = axisId.domain;
8258
+ Object.entries(d2 ?? {}).forEach(([key, value]) => {
8259
+ if (d1?.[key] === void 0) {
8260
+ const item = JSON.stringify([key, value]);
8261
+ addedSet.add(item);
8262
+ allAddedDomainValues.add(item);
8263
+ }
8264
+ });
8265
+ const cd1 = column.spec.axesSpec[idx].contextDomain;
8266
+ const cd2 = axisId.contextDomain;
8267
+ Object.entries(cd2 ?? {}).forEach(([key, value]) => {
8268
+ if (cd1?.[key] === void 0) {
8269
+ const item = JSON.stringify(["ctx:" + key, value]);
8270
+ addedSet.add(item);
8271
+ allAddedDomainValues.add(item);
8272
+ }
8273
+ });
8274
+ return {
8275
+ ...axisId,
8276
+ annotations: column.spec.axesSpec[idx].annotations
8277
+ };
8278
+ });
8279
+ return addedSet;
8280
+ });
8281
+ [...allAddedDomainValues].forEach((addedPart) => {
8282
+ if (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);
8283
+ });
8284
+ return [column, ...secondaryIdsVariants.map((idsList, idx) => {
8285
+ const id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));
8286
+ const label = readAnnotation(column.spec, Annotation.Label) ?? "";
8287
+ const labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(" / ");
8288
+ const annotations = {
8289
+ ...column.spec.annotations,
8290
+ [Annotation.Graph.IsVirtual]: stringifyJson(true)
8291
+ };
8292
+ if (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + " / " + labelDomainPart : label + labelDomainPart;
8293
+ return {
8294
+ ...column,
8295
+ id,
8296
+ spec: {
8297
+ ...column.spec,
8298
+ axesSpec: idsList.map((axisId, idx) => ({
8299
+ ...axisId,
8300
+ annotations: column.spec.axesSpec[idx].annotations
8301
+ })),
8302
+ annotations
8303
+ }
8304
+ };
8305
+ })];
8306
+ }
8307
+ //#endregion
8308
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
8309
+ function getAllRelatedColumns(ctx, predicate) {
8310
+ const columns = new PColumnCollection();
8311
+ columns.addColumnProvider(ctx.resultPool);
8312
+ const allColumns = columns.getColumns(predicate, {
8313
+ dontWaitAllData: true,
8314
+ overrideLabelAnnotation: false
8315
+ }) ?? [];
8316
+ return enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {
8317
+ return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
8318
+ })), allColumns);
8319
+ }
8320
+ function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
8321
+ const columns = new PColumnCollection();
8322
+ columns.addColumnProvider(ctx.resultPool);
8323
+ columns.addColumns(rootColumns);
8324
+ const blockAxes = /* @__PURE__ */ new Map();
8325
+ const allAxes = /* @__PURE__ */ new Map();
8326
+ for (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
8327
+ const aid = getAxisId(spec);
8328
+ blockAxes.set(canonicalizeJson(aid), spec);
8329
+ allAxes.set(canonicalizeJson(aid), spec);
8330
+ }
8331
+ const availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);
8332
+ for (const item of availableWithLinkersAxes) {
8333
+ blockAxes.set(...item);
8334
+ allAxes.set(...item);
8335
+ }
8336
+ const blockAxesArr = Array.from(blockAxes.values());
8337
+ let compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
8338
+ const axisId = getAxisId(axisSpec);
8339
+ return blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8340
+ }), {
8341
+ dontWaitAllData: true,
8342
+ overrideLabelAnnotation: false
8343
+ }) ?? []).filter((column) => !isLabelColumn(column.spec));
8344
+ for (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
8345
+ const aid = getAxisId(spec);
8346
+ allAxes.set(canonicalizeJson(aid), spec);
8347
+ }
8348
+ const allAxesArr = Array.from(allAxes.values());
8349
+ compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {
8350
+ const axisId = getAxisId(axisSpec);
8351
+ return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8352
+ }), {
8353
+ dontWaitAllData: true,
8354
+ overrideLabelAnnotation: false
8355
+ }) ?? []).filter((column) => !isLabelColumn(column.spec));
8356
+ const compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
8357
+ const axisId = getAxisId(axisSpec);
8358
+ return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8359
+ }), {
8360
+ dontWaitAllData: true,
8361
+ overrideLabelAnnotation: false
8362
+ }) ?? []).filter((column) => isLabelColumn(column.spec));
8363
+ return enrichCompatible(blockAxes, [...compatibleWithoutLabels, ...compatibleLabels]);
8364
+ }
8365
+ //#endregion
8366
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
8367
+ function isHiddenFromGraphColumn(column) {
8368
+ return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
8369
+ }
8370
+ function isHiddenFromUIColumn(column) {
8371
+ return !!readAnnotationJson(column, Annotation.HideDataFromUi);
8372
+ }
8373
+ /**
8374
+ The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool
8375
+ (including linker columns and all label columns).
8376
+ Block’s columns are added to pframe as is.
8377
+ Other columns are added basing on set of axes of block’s columns, considering available with linker columns.
8378
+ Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from
8379
+ result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values
8380
+ among existing ones).
8381
+ In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case
8382
+ of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)
8383
+ and modified label (with added domain values in case if more than one copy with different domains exist).
8384
+ */
8385
+ function createPFrameForGraphs(ctx, blockColumns) {
8386
+ const suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);
8387
+ if (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));
8388
+ return ctx.createPFrame(getRelatedColumns(ctx, {
8389
+ columns: blockColumns,
8390
+ predicate: suitableSpec
8391
+ }));
8392
+ }
8393
+ //#endregion
8394
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/columns/column_selector.js
8200
8395
  function normalizeStringMatchers(input) {
8201
8396
  if (typeof input === "string") return [{
8202
8397
  type: "regex",
@@ -8240,7 +8435,7 @@
8240
8435
  return (Array.isArray(input) ? input : [input]).map(convertRelaxedColumnSelectorToMultiColumnSelector);
8241
8436
  }
8242
8437
  //#endregion
8243
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/columns/column_snapshot_provider.js
8438
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/columns/column_snapshot_provider.js
8244
8439
  /**
8245
8440
  * Simple provider wrapping an array of PColumns.
8246
8441
  * Always complete, data status always 'ready'.
@@ -8365,7 +8560,7 @@
8365
8560
  throw new Error("Unknown ColumnSource type");
8366
8561
  }
8367
8562
  //#endregion
8368
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/columns/column_collection_builder.js
8563
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/columns/column_collection_builder.js
8369
8564
  /**
8370
8565
  * Mutable builder that accumulates column sources, then produces
8371
8566
  * a ColumnCollection (plain) or AnchoredColumnCollection (with anchors).
@@ -8593,7 +8788,7 @@
8593
8788
  }
8594
8789
  }
8595
8790
  //#endregion
8596
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/columns/ctx_column_sources.js
8791
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/columns/ctx_column_sources.js
8597
8792
  /**
8598
8793
  * Collect ColumnSnapshotProviders from `outputs`, `prerun`, and
8599
8794
  * `resultPool` in that order. Dedup keeps the first occurrence per
@@ -8666,7 +8861,7 @@
8666
8861
  }
8667
8862
  }
8668
8863
  //#endregion
8669
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/filters/traverse.js
8864
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/filters/traverse.js
8670
8865
  /**
8671
8866
  * Recursively traverses a FilterSpec tree bottom-up, applying visitor callbacks.
8672
8867
  *
@@ -8705,7 +8900,7 @@
8705
8900
  });
8706
8901
  }
8707
8902
  //#endregion
8708
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js
8903
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/filters/converters/filterToQuery.js
8709
8904
  /** Parses a CanonicalizedJson<PTableColumnId> string into a SpecQueryExpression reference. */
8710
8905
  function resolveColumnRef(columnStr) {
8711
8906
  const parsed = JSON.parse(columnStr);
@@ -9018,7 +9213,7 @@
9018
9213
  return true;
9019
9214
  }
9020
9215
  //#endregion
9021
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/filters/distill.js
9216
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/filters/distill.js
9022
9217
  /**
9023
9218
  * Strips non-FilterSpec metadata (whitelist approach) and removes
9024
9219
  * unfilled leaves (type is undefined or any required field is undefined).
@@ -9123,7 +9318,7 @@
9123
9318
  greaterThanColumnOrEqual: ["column", "rhs"]
9124
9319
  };
9125
9320
  //#endregion
9126
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js
9321
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PlDataTable/state-migration.js
9127
9322
  /** Upgrade PlDataTableStateV2 to the latest version */
9128
9323
  function upgradePlDataTableStateV2(state) {
9129
9324
  if (!state) return createPlDataTableStateV2();
@@ -9384,7 +9579,7 @@
9384
9579
  };
9385
9580
  }
9386
9581
  //#endregion
9387
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_tooltips.js
9582
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/labels/derive_distinct_tooltips.js
9388
9583
  /** Format tooltip strings for each entry. Returns `undefined` when nothing useful. */
9389
9584
  function deriveDistinctTooltips(entries) {
9390
9585
  return entries.map(formatTooltip);
@@ -9451,7 +9646,7 @@
9451
9646
  return `${axisName} context: ${entries.map(([k, v]) => `${k}=${v}`).join(", ")}`;
9452
9647
  }
9453
9648
  //#endregion
9454
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
9649
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/utils.js
9455
9650
  /** Check if column should be omitted from the table */
9456
9651
  function isColumnHidden(spec) {
9457
9652
  return readAnnotation(spec, Annotation.Table.Visibility) === "hidden";
@@ -9663,7 +9858,7 @@
9663
9858
  return Object.fromEntries(tooltips.flatMap((t, i) => isNil(t) ? [] : [[columns[i].id, t]]));
9664
9859
  }
9665
9860
  //#endregion
9666
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
9861
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPTableDefV3.js
9667
9862
  function createPTableDefV3(params) {
9668
9863
  let query = {
9669
9864
  type: params.primaryJoinType === "inner" ? "innerJoin" : "fullJoin",
@@ -9734,7 +9929,7 @@
9734
9929
  };
9735
9930
  }
9736
9931
  //#endregion
9737
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js
9932
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/discoverColumns.js
9738
9933
  /** Discover columns from sources/anchors and normalize into a flat TableColumnVariant list. */
9739
9934
  function discoverTableColumnSnaphots(ctx, options) {
9740
9935
  const resolvedOptions = {
@@ -9836,7 +10031,7 @@
9836
10031
  });
9837
10032
  }
9838
10033
  //#endregion
9839
- //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.15/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js
10034
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.77.17/node_modules/@platforma-sdk/model/dist/components/PlDataTable/createPlDataTable/createPlDataTableV3.js
9840
10035
  function createPlDataTableV3(ctx, options) {
9841
10036
  const pframeSpec = ctx.getService("pframeSpec");
9842
10037
  const state = upgradePlDataTableStateV2(options.tableState);
@@ -10170,29 +10365,39 @@
10170
10365
  });
10171
10366
  //#endregion
10172
10367
  //#region src/index.ts
10368
+ const HUMANNESS_SCORE_COLUMN = "pl7.app/humannessScore";
10369
+ const defaultGraphStateHistogram = () => ({
10370
+ title: "Humanness Score Distribution",
10371
+ template: "bins",
10372
+ currentTab: null,
10373
+ axesSettings: { other: { binsCount: 20 } },
10374
+ layersSettings: { bins: { fillColor: "#2D93FA" } }
10375
+ });
10376
+ const inputSelectors = [{
10377
+ axes: [{ name: "pl7.app/sampleId" }, { name: "pl7.app/vdj/clonotypeKey" }],
10378
+ annotations: { "pl7.app/isAnchor": "true" }
10379
+ }, {
10380
+ axes: [{ name: "pl7.app/sampleId" }, { name: "pl7.app/vdj/scClonotypeKey" }],
10381
+ annotations: { "pl7.app/isAnchor": "true" }
10382
+ }];
10173
10383
  const dataModel = new DataModelBuilder().from("v1").upgradeLegacy(({ args, uiState }) => ({
10174
10384
  ...args,
10175
- tableState: uiState.tableState
10385
+ tableState: uiState.tableState,
10386
+ graphStateHistogram: uiState.graphStateHistogram ?? defaultGraphStateHistogram()
10176
10387
  })).init(() => ({
10177
10388
  customBlockLabel: "",
10178
- tableState: createPlDataTableStateV2()
10389
+ tableState: createPlDataTableStateV2(),
10390
+ graphStateHistogram: defaultGraphStateHistogram()
10179
10391
  }));
10180
- //#endregion
10181
- exports.platforma = BlockModelV3.create(dataModel).args((data) => {
10392
+ const platforma$1 = BlockModelV3.create(dataModel).args((data) => {
10182
10393
  if (!data.inputAnchor) throw new Error("Input anchor is required");
10183
10394
  return {
10184
- customBlockLabel: data.customBlockLabel || "Humanness Score",
10395
+ customBlockLabel: data.customBlockLabel || "",
10185
10396
  inputAnchor: data.inputAnchor,
10186
10397
  mem: data.mem
10187
10398
  };
10188
- }).output("inputOptions", (ctx) => ctx.resultPool.getOptions([{
10189
- axes: [{ name: "pl7.app/sampleId" }, { name: "pl7.app/vdj/clonotypeKey" }],
10190
- annotations: { "pl7.app/isAnchor": "true" }
10191
- }, {
10192
- axes: [{ name: "pl7.app/sampleId" }, { name: "pl7.app/vdj/scClonotypeKey" }],
10193
- annotations: { "pl7.app/isAnchor": "true" }
10194
- }])).outputWithStatus("pt", (ctx) => {
10195
- const pCols = ctx.outputs?.resolve("outputLiabilities")?.getPColumns();
10399
+ }).output("inputOptions", (ctx) => ctx.resultPool.getOptions(inputSelectors)).outputWithStatus("pt", (ctx) => {
10400
+ const pCols = ctx.outputs?.resolve("outputHumanness")?.getPColumns();
10196
10401
  if (pCols === void 0) return;
10197
10402
  return createPlDataTableV3(ctx, {
10198
10403
  tableState: ctx.data.tableState,
@@ -10201,11 +10406,33 @@
10201
10406
  isPrimary: true
10202
10407
  }))
10203
10408
  });
10204
- }).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title(() => "Humanness Score").subtitle((ctx) => ctx.data.customBlockLabel || "Humanness Score").sections((_) => [{
10409
+ }).outputWithStatus("histogramPf", (ctx) => {
10410
+ const pCols = ctx.outputs?.resolve("outputHumanness")?.getPColumns();
10411
+ if (pCols === void 0) return void 0;
10412
+ return createPFrameForGraphs(ctx, pCols);
10413
+ }).output("histogramPfPcols", (ctx) => {
10414
+ const pCols = ctx.outputs?.resolve("outputHumanness")?.getPColumns();
10415
+ if (pCols === void 0 || pCols.length === 0) return void 0;
10416
+ return pCols.map((c) => ({
10417
+ columnId: c.id,
10418
+ spec: c.spec
10419
+ }));
10420
+ }).output("isRunning", (ctx) => ctx.outputs?.getIsReadyOrError() === false).title(() => "Humanization Score").subtitle((ctx) => {
10421
+ if (ctx.data.customBlockLabel) return ctx.data.customBlockLabel;
10422
+ return "Humanization Score";
10423
+ }).sections((_) => [{
10205
10424
  type: "link",
10206
10425
  href: "/",
10207
10426
  label: "Table"
10427
+ }, {
10428
+ type: "link",
10429
+ href: "/histogram",
10430
+ label: "Score Distribution"
10208
10431
  }]).done();
10432
+ //#endregion
10433
+ exports.HUMANNESS_SCORE_COLUMN = HUMANNESS_SCORE_COLUMN;
10434
+ exports.defaultGraphStateHistogram = defaultGraphStateHistogram;
10435
+ exports.platforma = platforma$1;
10209
10436
  });
10210
10437
 
10211
10438
  //# sourceMappingURL=bundle.js.map