@platforma-open/milaboratories.repertoire-diversity-2.model 1.3.1 → 1.4.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/.turbo/turbo-build.log +13 -13
- package/CHANGELOG.md +6 -0
- package/dist/bundle.js +860 -725
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +17 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.js +18 -14
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
- package/src/index.ts +17 -11
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-open/milaboratories.repertoire-diversity-2.model",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.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.
|
|
11
|
-
"@milaboratories/graph-maker": "^1.1.
|
|
10
|
+
"@platforma-sdk/model": "^1.38.0",
|
|
11
|
+
"@milaboratories/graph-maker": "^1.1.127"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@platforma-sdk/block-tools": "^2.5.57",
|
package/src/index.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import type { GraphMakerState } from '@milaboratories/graph-maker';
|
|
2
|
-
import type { InferOutputsType, PColumnIdAndSpec,
|
|
3
|
-
import { BlockModel, createPFrameForGraphs,
|
|
2
|
+
import type { InferOutputsType, PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';
|
|
3
|
+
import { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';
|
|
4
4
|
|
|
5
5
|
export type DiversityType = 'chao1' | 'd50' | 'efronThisted' |
|
|
6
6
|
'observed' | 'shannonWienerIndex' | 'shannonWiener' |
|
|
7
7
|
'normalizedShannonWiener' | 'inverseSimpson' | 'gini';
|
|
8
8
|
|
|
9
9
|
export type Metric = {
|
|
10
|
+
id: string;
|
|
10
11
|
type: DiversityType | undefined;
|
|
11
12
|
downsampling: {
|
|
12
13
|
type?: 'none' | 'top' | 'cumtop' | 'hypergeometric' ;
|
|
13
14
|
valueChooser?: 'min' | 'fixed' | 'max' | 'auto';
|
|
14
15
|
n?: number;
|
|
15
16
|
};
|
|
17
|
+
isExpanded?: boolean;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
export type BlockArgs = {
|
|
@@ -22,7 +24,7 @@ export type BlockArgs = {
|
|
|
22
24
|
|
|
23
25
|
export type UiState = {
|
|
24
26
|
blockTitle: string;
|
|
25
|
-
tableState
|
|
27
|
+
tableState: PlDataTableStateV2;
|
|
26
28
|
graphState: GraphMakerState;
|
|
27
29
|
};
|
|
28
30
|
|
|
@@ -31,39 +33,49 @@ export const model = BlockModel.create()
|
|
|
31
33
|
.withArgs<BlockArgs>({
|
|
32
34
|
metrics: [
|
|
33
35
|
{
|
|
36
|
+
id: 'observed',
|
|
34
37
|
type: 'observed',
|
|
35
38
|
downsampling: {
|
|
36
39
|
type: 'hypergeometric',
|
|
37
40
|
valueChooser: 'auto',
|
|
38
41
|
},
|
|
42
|
+
isExpanded: false,
|
|
39
43
|
},
|
|
40
44
|
{
|
|
45
|
+
id: 'shannonWiener',
|
|
41
46
|
type: 'shannonWiener',
|
|
42
47
|
downsampling: {
|
|
43
48
|
type: 'hypergeometric',
|
|
44
49
|
valueChooser: 'auto',
|
|
45
50
|
},
|
|
51
|
+
isExpanded: false,
|
|
46
52
|
},
|
|
47
53
|
{
|
|
54
|
+
id: 'chao1',
|
|
48
55
|
type: 'chao1',
|
|
49
56
|
downsampling: {
|
|
50
57
|
type: 'hypergeometric',
|
|
51
58
|
valueChooser: 'auto',
|
|
52
59
|
},
|
|
60
|
+
isExpanded: false,
|
|
53
61
|
},
|
|
54
62
|
{
|
|
63
|
+
id: 'gini',
|
|
55
64
|
type: 'gini',
|
|
56
65
|
downsampling: {
|
|
57
66
|
type: 'hypergeometric',
|
|
58
67
|
valueChooser: 'auto',
|
|
59
68
|
},
|
|
69
|
+
isExpanded: false,
|
|
60
70
|
},
|
|
61
71
|
{
|
|
72
|
+
id: 'd50',
|
|
62
73
|
type: 'd50',
|
|
63
74
|
downsampling: {
|
|
64
75
|
type: 'hypergeometric',
|
|
65
76
|
valueChooser: 'auto',
|
|
66
77
|
},
|
|
78
|
+
isExpanded: false,
|
|
67
79
|
},
|
|
68
80
|
],
|
|
69
81
|
})
|
|
@@ -76,13 +88,7 @@ export const model = BlockModel.create()
|
|
|
76
88
|
currentTab: null,
|
|
77
89
|
},
|
|
78
90
|
|
|
79
|
-
tableState:
|
|
80
|
-
gridState: {},
|
|
81
|
-
pTableParams: {
|
|
82
|
-
sorting: [],
|
|
83
|
-
filters: [],
|
|
84
|
-
},
|
|
85
|
-
},
|
|
91
|
+
tableState: createPlDataTableStateV2(),
|
|
86
92
|
})
|
|
87
93
|
|
|
88
94
|
.argsValid((ctx) => ctx.args.abundanceRef !== undefined)
|
|
@@ -108,7 +114,7 @@ export const model = BlockModel.create()
|
|
|
108
114
|
return undefined;
|
|
109
115
|
}
|
|
110
116
|
|
|
111
|
-
return
|
|
117
|
+
return createPlDataTableV2(ctx, pCols, ctx.uiState?.tableState);
|
|
112
118
|
})
|
|
113
119
|
|
|
114
120
|
.output('pf', (ctx) => {
|