@platforma-open/milaboratories.repertoire-diversity-2.model 1.2.0 → 1.3.0

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/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.repertoire-diversity-2.model",
3
- "version": "1.2.0",
3
+ "version": "1.3.0",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "dependencies": {
10
- "@platforma-sdk/model": "^1.29.17",
11
- "@milaboratories/graph-maker": "^1.1.74"
10
+ "@platforma-sdk/model": "^1.34.8",
11
+ "@milaboratories/graph-maker": "^1.1.114"
12
12
  },
13
13
  "devDependencies": {
14
- "@platforma-sdk/block-tools": "^2.5.38",
14
+ "@platforma-sdk/block-tools": "^2.5.55",
15
15
  "typescript": "~5.5.4",
16
16
  "vite": "^6.2.2",
17
17
  "tsup": "~8.3.5",
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { GraphMakerState } from '@milaboratories/graph-maker';
2
- import type { InferOutputsType, PColumnSpec, PlDataTableState, PlRef } from '@platforma-sdk/model';
2
+ import type { InferOutputsType, PColumnIdAndSpec, PlDataTableState, PlRef } from '@platforma-sdk/model';
3
3
  import { BlockModel, createPFrameForGraphs, createPlDataTable } from '@platforma-sdk/model';
4
4
 
5
5
  export type DiversityType = 'chao1' | 'd50' | 'efronThisted' |
@@ -26,10 +26,6 @@ export type UiState = {
26
26
  graphState: GraphMakerState;
27
27
  };
28
28
 
29
- function isNumericType(c: PColumnSpec): boolean {
30
- return c.valueType === 'Double' || c.valueType === 'Int' || c.valueType === 'Float' || c.valueType === 'Long';
31
- }
32
-
33
29
  export const model = BlockModel.create()
34
30
 
35
31
  .withArgs<BlockArgs>({
@@ -124,6 +120,23 @@ export const model = BlockModel.create()
124
120
  return createPFrameForGraphs(ctx, pCols);
125
121
  })
126
122
 
123
+ // Return a list of Pcols for plot defaults
124
+ .output('pcols', (ctx) => {
125
+ const pCols = ctx.outputs?.resolve('pf')?.getPColumns();
126
+
127
+ if (pCols === undefined || pCols.length === 0) {
128
+ return undefined;
129
+ }
130
+
131
+ return pCols.map(
132
+ (c) =>
133
+ ({
134
+ columnId: c.id,
135
+ spec: c.spec,
136
+ } satisfies PColumnIdAndSpec),
137
+ );
138
+ })
139
+
127
140
  .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)
128
141
 
129
142
  .title((ctx) => ctx.uiState?.blockTitle ?? 'Repertoire Diversity')