@platforma-open/milaboratories.sequence-properties.model 1.2.1 → 1.2.2

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.
@@ -1,6 +1,6 @@
1
1
   WARN  Issue while reading "/home/runner/work/sequence-properties/sequence-properties/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.sequence-properties.model@1.2.1 build /home/runner/work/sequence-properties/sequence-properties/model
3
+ > @platforma-open/milaboratories.sequence-properties.model@1.2.2 build /home/runner/work/sequence-properties/sequence-properties/model
4
4
  > ts-builder build --target block-model && block-tools build-model
5
5
 
6
6
  Building block-model project...
@@ -11,18 +11,18 @@ Building block-model project...
11
11
  [log] <DIR>/types.d.ts.map asset │ size: 0.39 kB
12
12
  [log] <DIR>/dataModel.js.map asset │ size: 1.54 kB
13
13
  [log] <DIR>/index.d.ts.map asset │ size: 2.00 kB
14
- [log] <DIR>/index.js.map asset │ size: 11.83 kB
14
+ [log] <DIR>/index.js.map asset │ size: 11.98 kB
15
15
  [log] <DIR>/dataModel.d.ts chunk │ size: 0.29 kB
16
16
  [log] <DIR>/dataModel.js chunk │ size: 0.84 kB
17
17
  [log] <DIR>/types.d.ts chunk │ size: 0.89 kB
18
- [log] <DIR>/index.js chunk │ size: 4.46 kB
18
+ [log] <DIR>/index.js chunk │ size: 4.55 kB
19
19
  [log] <DIR>/index.d.ts chunk │ size: 58.05 kB
20
20
  [log] <DIR>/dataModel.cjs.map asset │ size: 1.58 kB
21
- [log] <DIR>/index.cjs.map asset │ size: 11.96 kB
21
+ [log] <DIR>/index.cjs.map asset │ size: 12.12 kB
22
22
  [log] <DIR>/dataModel.cjs chunk │ size: 0.88 kB
23
- [log] <DIR>/index.cjs chunk │ size: 4.72 kB
24
- [log] <DIR>/bundle.js.map asset │ size: 696.37 kB
25
- [log] <DIR>/bundle.js chunk │ size: 351.91 kB
23
+ [log] <DIR>/index.cjs chunk │ size: 4.81 kB
24
+ [log] <DIR>/bundle.js.map asset │ size: 711.70 kB
25
+ [log] <DIR>/bundle.js chunk │ size: 360.85 kB
26
26
  [log]
27
- [success] rolldown v1.0.0-rc.16 Finished in 7.06 s
27
+ [success] rolldown v1.0.0-rc.16 Finished in 4.81 s
28
28
  Build completed successfully
@@ -1,21 +1,21 @@
1
1
   WARN  Issue while reading "/home/runner/work/sequence-properties/sequence-properties/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
2
2
 
3
- > @platforma-open/milaboratories.sequence-properties.model@1.2.1 check /home/runner/work/sequence-properties/sequence-properties/model
3
+ > @platforma-open/milaboratories.sequence-properties.model@1.2.2 check /home/runner/work/sequence-properties/sequence-properties/model
4
4
  > ts-builder check --target block-model
5
5
 
6
6
  ↳ tsc --noEmit --project ./tsconfig.json --customConditions ,
7
7
  Linting project...
8
8
  ↳ oxlint --config /home/runner/work/sequence-properties/sequence-properties/model/.oxlintrc.json --deny-warnings
9
9
  Found 0 warnings and 0 errors.
10
- Finished in 13ms on 3 files with 90 rules using 2 threads.
10
+ Finished in 12ms on 3 files with 90 rules using 2 threads.
11
11
  Linting completed successfully
12
12
  Checking formatting...
13
13
  ↳ oxfmt --check --config /home/runner/work/sequence-properties/sequence-properties/model/.oxfmtrc.json
14
- (node:2570) ExperimentalWarning: glob is an experimental feature and might change at any time
14
+ (node:2578) ExperimentalWarning: glob is an experimental feature and might change at any time
15
15
  (Use `node --trace-warnings ...` to show where the warning was created)
16
16
  Checking formatting...
17
17
 
18
18
  All matched files use the correct format.
19
- Finished in 458ms on 7 files using 2 threads.
19
+ Finished in 369ms on 7 files using 2 threads.
20
20
  Format check completed successfully
21
21
  All checks passed!
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @platforma-open/MiLaboratories.sequence-properties.model
2
2
 
3
+ ## 1.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 73b4e4d: Enable linker usage to show plot options
8
+
3
9
  ## 1.2.1
4
10
 
5
11
  ### Patch Changes
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 {
@@ -8170,6 +8173,198 @@
8170
8173
  }
8171
8174
  };
8172
8175
  //#endregion
8176
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/axes.js
8177
+ /** Create id for column copy with added keys in axes domains */
8178
+ const colId = (id, domains, contextDomains) => {
8179
+ let wid = id.toString();
8180
+ domains?.forEach((domain) => {
8181
+ if (domain) for (const [k, v] of Object.entries(domain)) {
8182
+ wid += k;
8183
+ wid += v;
8184
+ }
8185
+ });
8186
+ contextDomains?.forEach((contextDomain) => {
8187
+ if (contextDomain) for (const [k, v] of Object.entries(contextDomain)) {
8188
+ wid += k;
8189
+ wid += v;
8190
+ }
8191
+ });
8192
+ return wid;
8193
+ };
8194
+ /** All combinations with 1 key from each list */
8195
+ function getKeysCombinations(idsLists) {
8196
+ if (!idsLists.length) return [];
8197
+ let result = [[]];
8198
+ idsLists.forEach((list) => {
8199
+ const nextResult = [];
8200
+ list.forEach((key) => {
8201
+ nextResult.push(...result.map((resultItem) => [...resultItem, key]));
8202
+ });
8203
+ result = nextResult;
8204
+ });
8205
+ return result;
8206
+ }
8207
+ function getAvailableWithLinkersAxes(linkerColumns, blockAxes) {
8208
+ const availableAxes = LinkerMap.fromColumns(linkerColumns.map(getColumnIdAndSpec)).getReachableByLinkersAxesFromAxesNormalized([...blockAxes.values()], (linkerKeyId, sourceAxisId) => matchAxisId(sourceAxisId, linkerKeyId));
8209
+ return new Map(availableAxes.map((axisSpec) => {
8210
+ return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
8211
+ }));
8212
+ }
8213
+ /** Add columns with fully compatible axes created from partial compatible ones */
8214
+ function enrichCompatible(blockAxes, columns) {
8215
+ return columns.flatMap((column) => getAdditionalColumnsForColumn(blockAxes, column));
8216
+ }
8217
+ function getAdditionalColumnsForColumn(blockAxes, column) {
8218
+ const columnAxesIds = column.spec.axesSpec.map(getAxisId);
8219
+ if (columnAxesIds.every((id) => blockAxes.has(canonicalizeJson(id)))) return [column];
8220
+ const secondaryIdsVariants = getKeysCombinations(columnAxesIds.map((id) => {
8221
+ const result = [];
8222
+ for (const [_, mainId] of blockAxes) if (matchAxisId(mainId, id) && !matchAxisId(id, mainId)) result.push(mainId);
8223
+ return result;
8224
+ }));
8225
+ const allAddedDomainValues = /* @__PURE__ */ new Set();
8226
+ const addedNotToAllVariantsDomainValues = /* @__PURE__ */ new Set();
8227
+ const addedByVariantsDomainValues = secondaryIdsVariants.map((idsList) => {
8228
+ const addedSet = /* @__PURE__ */ new Set();
8229
+ idsList.map((axisId, idx) => {
8230
+ const d1 = column.spec.axesSpec[idx].domain;
8231
+ const d2 = axisId.domain;
8232
+ Object.entries(d2 ?? {}).forEach(([key, value]) => {
8233
+ if (d1?.[key] === void 0) {
8234
+ const item = JSON.stringify([key, value]);
8235
+ addedSet.add(item);
8236
+ allAddedDomainValues.add(item);
8237
+ }
8238
+ });
8239
+ const cd1 = column.spec.axesSpec[idx].contextDomain;
8240
+ const cd2 = axisId.contextDomain;
8241
+ Object.entries(cd2 ?? {}).forEach(([key, value]) => {
8242
+ if (cd1?.[key] === void 0) {
8243
+ const item = JSON.stringify(["ctx:" + key, value]);
8244
+ addedSet.add(item);
8245
+ allAddedDomainValues.add(item);
8246
+ }
8247
+ });
8248
+ return {
8249
+ ...axisId,
8250
+ annotations: column.spec.axesSpec[idx].annotations
8251
+ };
8252
+ });
8253
+ return addedSet;
8254
+ });
8255
+ [...allAddedDomainValues].forEach((addedPart) => {
8256
+ if (addedByVariantsDomainValues.some((s) => !s.has(addedPart))) addedNotToAllVariantsDomainValues.add(addedPart);
8257
+ });
8258
+ return [column, ...secondaryIdsVariants.map((idsList, idx) => {
8259
+ const id = colId(column.id, idsList.map((id) => id.domain), idsList.map((id) => id.contextDomain));
8260
+ const label = readAnnotation(column.spec, Annotation.Label) ?? "";
8261
+ const labelDomainPart = [...addedByVariantsDomainValues[idx]].filter((str) => addedNotToAllVariantsDomainValues.has(str)).sort().map((v) => JSON.parse(v)?.[1]).join(" / ");
8262
+ const annotations = {
8263
+ ...column.spec.annotations,
8264
+ [Annotation.Graph.IsVirtual]: stringifyJson(true)
8265
+ };
8266
+ if (label || labelDomainPart) annotations[Annotation.Label] = label && labelDomainPart ? label + " / " + labelDomainPart : label + labelDomainPart;
8267
+ return {
8268
+ ...column,
8269
+ id,
8270
+ spec: {
8271
+ ...column.spec,
8272
+ axesSpec: idsList.map((axisId, idx) => ({
8273
+ ...axisId,
8274
+ annotations: column.spec.axesSpec[idx].annotations
8275
+ })),
8276
+ annotations
8277
+ }
8278
+ };
8279
+ })];
8280
+ }
8281
+ //#endregion
8282
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/pframe_utils/columns.js
8283
+ function getAllRelatedColumns(ctx, predicate) {
8284
+ const columns = new PColumnCollection();
8285
+ columns.addColumnProvider(ctx.resultPool);
8286
+ const allColumns = columns.getColumns(predicate, {
8287
+ dontWaitAllData: true,
8288
+ overrideLabelAnnotation: false
8289
+ }) ?? [];
8290
+ return enrichCompatible(new Map(allColumns.flatMap((column) => getNormalizedAxesList(column.spec.axesSpec)).map((axisSpec) => {
8291
+ return [canonicalizeJson(getAxisId(axisSpec)), axisSpec];
8292
+ })), allColumns);
8293
+ }
8294
+ function getRelatedColumns(ctx, { columns: rootColumns, predicate }) {
8295
+ const columns = new PColumnCollection();
8296
+ columns.addColumnProvider(ctx.resultPool);
8297
+ columns.addColumns(rootColumns);
8298
+ const blockAxes = /* @__PURE__ */ new Map();
8299
+ const allAxes = /* @__PURE__ */ new Map();
8300
+ for (const c of rootColumns) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
8301
+ const aid = getAxisId(spec);
8302
+ blockAxes.set(canonicalizeJson(aid), spec);
8303
+ allAxes.set(canonicalizeJson(aid), spec);
8304
+ }
8305
+ const availableWithLinkersAxes = getAvailableWithLinkersAxes(columns.getColumns((spec) => predicate(spec) && isLinkerColumn(spec), { dontWaitAllData: true }) ?? [], blockAxes);
8306
+ for (const item of availableWithLinkersAxes) {
8307
+ blockAxes.set(...item);
8308
+ allAxes.set(...item);
8309
+ }
8310
+ const blockAxesArr = Array.from(blockAxes.values());
8311
+ let compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
8312
+ const axisId = getAxisId(axisSpec);
8313
+ return blockAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8314
+ }), {
8315
+ dontWaitAllData: true,
8316
+ overrideLabelAnnotation: false
8317
+ }) ?? []).filter((column) => !isLabelColumn(column.spec));
8318
+ for (const c of compatibleWithoutLabels) for (const spec of getNormalizedAxesList(c.spec.axesSpec)) {
8319
+ const aid = getAxisId(spec);
8320
+ allAxes.set(canonicalizeJson(aid), spec);
8321
+ }
8322
+ const allAxesArr = Array.from(allAxes.values());
8323
+ compatibleWithoutLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.every((axisSpec) => {
8324
+ const axisId = getAxisId(axisSpec);
8325
+ return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8326
+ }), {
8327
+ dontWaitAllData: true,
8328
+ overrideLabelAnnotation: false
8329
+ }) ?? []).filter((column) => !isLabelColumn(column.spec));
8330
+ const compatibleLabels = (columns.getColumns((spec) => predicate(spec) && spec.axesSpec.some((axisSpec) => {
8331
+ const axisId = getAxisId(axisSpec);
8332
+ return allAxesArr.some((selectorAxisSpec) => matchAxisId(getAxisId(selectorAxisSpec), axisId));
8333
+ }), {
8334
+ dontWaitAllData: true,
8335
+ overrideLabelAnnotation: false
8336
+ }) ?? []).filter((column) => isLabelColumn(column.spec));
8337
+ return enrichCompatible(blockAxes, [...compatibleWithoutLabels, ...compatibleLabels]);
8338
+ }
8339
+ //#endregion
8340
+ //#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/components/PFrameForGraphs.js
8341
+ function isHiddenFromGraphColumn(column) {
8342
+ return !!readAnnotationJson(column, Annotation.HideDataFromGraphs);
8343
+ }
8344
+ function isHiddenFromUIColumn(column) {
8345
+ return !!readAnnotationJson(column, Annotation.HideDataFromUi);
8346
+ }
8347
+ /**
8348
+ The aim of createPFrameForGraphs: to create pframe with block’s columns and all compatible columns from result pool
8349
+ (including linker columns and all label columns).
8350
+ Block’s columns are added to pframe as is.
8351
+ Other columns are added basing on set of axes of block’s columns, considering available with linker columns.
8352
+ Compatible columns must have at least one axis from block’s axes set. This axis of the compatible column from
8353
+ result pool must satisfy matchAxisId (it can have less domain keys than in block’s axis, but without conflicting values
8354
+ among existing ones).
8355
+ In requests to pframe (calculateTableData) columns must have strictly the same axes. For compatibility in case
8356
+ of partially matched axis we add to pframe a copy of this column with modified axis (with filled missed domains)
8357
+ and modified label (with added domain values in case if more than one copy with different domains exist).
8358
+ */
8359
+ function createPFrameForGraphs(ctx, blockColumns) {
8360
+ const suitableSpec = (spec) => !isHiddenFromUIColumn(spec) && !isHiddenFromGraphColumn(spec);
8361
+ if (!blockColumns) return ctx.createPFrame(getAllRelatedColumns(ctx, suitableSpec));
8362
+ return ctx.createPFrame(getRelatedColumns(ctx, {
8363
+ columns: blockColumns,
8364
+ predicate: suitableSpec
8365
+ }));
8366
+ }
8367
+ //#endregion
8173
8368
  //#region ../node_modules/.pnpm/@platforma-sdk+model@1.75.5/node_modules/@platforma-sdk/model/dist/columns/column_selector.js
8174
8369
  function normalizeStringMatchers(input) {
8175
8370
  if (typeof input === "string") return [{
@@ -10186,7 +10381,7 @@
10186
10381
  },
10187
10382
  visibility: "default"
10188
10383
  }, {
10189
- match: (spec) => !spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties") && spec.annotations?.["pl7.app/isLinkerColumn"] !== "true",
10384
+ match: (spec) => !spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties") && spec.annotations?.["pl7.app/isLinkerColumn"] !== "true" && spec.annotations?.["pl7.app/isOutput"] !== "true",
10190
10385
  visibility: "optional"
10191
10386
  }] }
10192
10387
  });
@@ -10202,7 +10397,7 @@
10202
10397
  anchor: "main",
10203
10398
  idx: 1
10204
10399
  }] }]) ?? []).filter((c) => !c.spec.annotations?.[Annotation.Trace]?.includes("milaboratories.sequence-properties")) : [];
10205
- return ctx.createPFrame([...pCols, ...upstreamMeta]);
10400
+ return createPFrameForGraphs(ctx, [...pCols, ...upstreamMeta]);
10206
10401
  }).output("propertiesPfCols", (ctx) => {
10207
10402
  const pCols = ctx.outputs?.resolve("propertiesPf")?.getPColumns();
10208
10403
  if (pCols === void 0) return void 0;