@platforma-open/milaboratories.repertoire-diversity-2.model 1.5.7 → 1.5.8

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-open/milaboratories.repertoire-diversity-2.model",
3
- "version": "1.5.7",
3
+ "version": "1.5.8",
4
4
  "description": "Block model",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -16,15 +16,16 @@
16
16
  "./dist/model.json": "./dist/model.json"
17
17
  },
18
18
  "dependencies": {
19
- "@platforma-sdk/model": "1.51.5",
20
- "@milaboratories/graph-maker": "1.1.206"
19
+ "@platforma-sdk/model": "1.53.3",
20
+ "@milaboratories/graph-maker": "1.1.216",
21
+ "@milaboratories/strings": "0.1.0"
21
22
  },
22
23
  "devDependencies": {
23
- "@milaboratories/ts-builder": "1.2.1",
24
+ "@milaboratories/ts-builder": "1.2.4",
24
25
  "@milaboratories/ts-configs": "1.2.0",
25
- "@platforma-sdk/block-tools": "2.6.29",
26
+ "@platforma-sdk/block-tools": "2.6.36",
26
27
  "@platforma-sdk/eslint-config": "1.2.0",
27
- "@platforma-sdk/test": "1.51.5",
28
+ "@platforma-sdk/test": "1.53.3",
28
29
  "typescript": "~5.6.3",
29
30
  "vitest": "^4.0.7",
30
31
  "eslint": "^9.25.1"
package/src/index.ts CHANGED
@@ -1,6 +1,8 @@
1
1
  import type { GraphMakerState } from '@milaboratories/graph-maker';
2
2
  import type { PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';
3
3
  import { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';
4
+ import strings from '@milaboratories/strings';
5
+ import { getDefaultBlockLabel } from './label';
4
6
 
5
7
  export * from './converters';
6
8
 
@@ -38,7 +40,7 @@ export type UiState = {
38
40
  export const model = BlockModel.create()
39
41
  .withArgs<BlockArgs>({
40
42
  metrics: [],
41
- defaultBlockLabel: 'Select abundance and metrics',
43
+ defaultBlockLabel: getDefaultBlockLabel({}),
42
44
  customBlockLabel: '',
43
45
  })
44
46
 
@@ -160,8 +162,10 @@ export const model = BlockModel.create()
160
162
  .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
161
163
 
162
164
  .sections((_) => [
163
- { type: 'link', href: '/', label: 'Main' },
165
+ { type: 'link', href: '/', label: strings.titles.main },
164
166
  { type: 'link', href: '/diversityGraph', label: 'Diversity Graph' },
165
167
  ])
166
168
 
167
169
  .done(2);
170
+
171
+ export { getDefaultBlockLabel } from './label';
package/src/label.ts ADDED
@@ -0,0 +1,10 @@
1
+ export function getDefaultBlockLabel(data: {
2
+ abundanceLabel?: string;
3
+ }) {
4
+ // Return abundance label if available, otherwise default message
5
+ if (data.abundanceLabel) {
6
+ return data.abundanceLabel;
7
+ }
8
+
9
+ return 'Select Abundance and Metrics';
10
+ }