@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/.turbo/turbo-build.log +5 -5
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +6 -0
- package/dist/bundle.js +451 -29
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +5 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +17 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/dist/label.cjs +12 -0
- package/dist/label.cjs.map +1 -0
- package/dist/label.d.ts +4 -0
- package/dist/label.d.ts.map +1 -0
- package/dist/label.js +10 -0
- package/dist/label.js.map +1 -0
- package/dist/model.json +1 -1
- package/package.json +7 -6
- package/src/index.ts +6 -2
- package/src/label.ts +10 -0
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var model$1 = require('@platforma-sdk/model');
|
|
4
|
+
var strings = require('@milaboratories/strings');
|
|
5
|
+
var label = require('./label.cjs');
|
|
4
6
|
var converters = require('./converters.cjs');
|
|
5
7
|
|
|
6
8
|
const model = model$1.BlockModel.create()
|
|
7
9
|
.withArgs({
|
|
8
10
|
metrics: [],
|
|
9
|
-
defaultBlockLabel:
|
|
11
|
+
defaultBlockLabel: label.getDefaultBlockLabel({}),
|
|
10
12
|
customBlockLabel: '',
|
|
11
13
|
})
|
|
12
14
|
.withUiState({
|
|
@@ -107,11 +109,12 @@ const model = model$1.BlockModel.create()
|
|
|
107
109
|
.title(() => 'Repertoire Diversity')
|
|
108
110
|
.subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
|
|
109
111
|
.sections((_) => [
|
|
110
|
-
{ type: 'link', href: '/', label:
|
|
112
|
+
{ type: 'link', href: '/', label: strings.titles.main },
|
|
111
113
|
{ type: 'link', href: '/diversityGraph', label: 'Diversity Graph' },
|
|
112
114
|
])
|
|
113
115
|
.done(2);
|
|
114
116
|
|
|
117
|
+
exports.getDefaultBlockLabel = label.getDefaultBlockLabel;
|
|
115
118
|
exports.convertMetricsUiToArgs = converters.convertMetricsUiToArgs;
|
|
116
119
|
exports.model = model;
|
|
117
120
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';\n\nexport * from './converters';\n\nexport type DiversityType = 'chao1' | 'd50' | 'efronThisted' |\n 'observed' | 'shannonWienerIndex' | 'shannonWiener' |\n 'normalizedShannonWiener' | 'inverseSimpson' | 'gini';\n\nexport type Metric = {\n type: DiversityType | undefined;\n downsampling: {\n type?: 'none' | 'top' | 'cumtop' | 'hypergeometric' ;\n valueChooser?: 'min' | 'fixed' | 'max' | 'auto';\n n?: number;\n };\n};\n\nexport type MetricUI = Metric & {\n id: string;\n isExpanded?: boolean;\n};\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n abundanceRef?: PlRef;\n metrics: Metric[];\n};\n\nexport type UiState = {\n metrics: MetricUI[];\n tableState: PlDataTableStateV2;\n graphState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n metrics: [],\n defaultBlockLabel:
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';\nimport strings from '@milaboratories/strings';\nimport { getDefaultBlockLabel } from './label';\n\nexport * from './converters';\n\nexport type DiversityType = 'chao1' | 'd50' | 'efronThisted' |\n 'observed' | 'shannonWienerIndex' | 'shannonWiener' |\n 'normalizedShannonWiener' | 'inverseSimpson' | 'gini';\n\nexport type Metric = {\n type: DiversityType | undefined;\n downsampling: {\n type?: 'none' | 'top' | 'cumtop' | 'hypergeometric' ;\n valueChooser?: 'min' | 'fixed' | 'max' | 'auto';\n n?: number;\n };\n};\n\nexport type MetricUI = Metric & {\n id: string;\n isExpanded?: boolean;\n};\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n abundanceRef?: PlRef;\n metrics: Metric[];\n};\n\nexport type UiState = {\n metrics: MetricUI[];\n tableState: PlDataTableStateV2;\n graphState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n metrics: [],\n defaultBlockLabel: getDefaultBlockLabel({}),\n customBlockLabel: '',\n })\n\n .withUiState<UiState>({\n graphState: {\n title: 'Repertoire Diversity',\n template: 'bar',\n currentTab: null,\n },\n\n tableState: createPlDataTableStateV2(),\n\n metrics: [\n {\n id: 'observed',\n type: 'observed',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'shannonWiener',\n type: 'shannonWiener',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'chao1',\n type: 'chao1',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'gini',\n type: 'gini',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'd50',\n type: 'd50',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n ],\n })\n\n .argsValid((ctx) => ctx.args.abundanceRef !== undefined\n && ctx.args.metrics.every((metric) => metric.type !== undefined))\n\n .output('abundanceOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { },\n ],\n annotations: {\n 'pl7.app/isAbundance': 'true',\n 'pl7.app/abundance/normalized': 'false',\n 'pl7.app/abundance/isPrimary': 'true',\n },\n },\n ], { includeNativeLabel: true }),\n )\n\n .outputWithStatus('pt', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPlDataTableV2(ctx, pCols, ctx.uiState.tableState);\n })\n\n .outputWithStatus('pf', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPFrameForGraphs(ctx, pCols);\n })\n\n // Return a list of Pcols for plot defaults\n .output('pcols', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n\n if (pCols === undefined || pCols.length === 0) {\n return undefined;\n }\n\n return pCols.map(\n (c) =>\n ({\n columnId: c.id,\n spec: c.spec,\n } satisfies PColumnIdAndSpec),\n );\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title(() => 'Repertoire Diversity')\n\n .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)\n\n .sections((_) => [\n { type: 'link', href: '/', label: strings.titles.main },\n { type: 'link', href: '/diversityGraph', label: 'Diversity Graph' },\n ])\n\n .done(2);\n\nexport { getDefaultBlockLabel } from './label';\n"],"names":["BlockModel","getDefaultBlockLabel","createPlDataTableStateV2","createPlDataTableV2","createPFrameForGraphs"],"mappings":";;;;;;;AAuCO,MAAM,KAAK,GAAGA,kBAAU,CAAC,MAAM;AACnC,KAAA,QAAQ,CAAY;AACnB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,iBAAiB,EAAEC,0BAAoB,CAAC,EAAE,CAAC;A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AA,OAAOC,6BAAqB,CAAC,GAAG,EAAE,KAAK,CAAC;AAC1C,CAAC;;AAGA,KAAA,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,KAAI;AACvB,IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE;IAEvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7C,QAAA,OAAO,SAAS;IAClB;IAEA,OAAO,KAAK,CAAC,GAAG,CACd,CAAC,CAAC,MACC;QACC,QAAQ,EAAE,CAAC,CAAC,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,IAAI;AACe,KAAA,CAAA,CAChC;AACH,CAAC;AAEA,KAAA,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,KAAK;AAEvE,KAAA,KAAK,CAAC,MAAM,sBAAsB;AAElC,KAAA,QAAQ,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB;AAEzE,KAAA,QAAQ,CAAC,CAAC,CAAC,KAAK;AACf,IAAA,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;IACvD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACpE;KAEA,IAAI,CAAC,CAAC;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -25,8 +25,8 @@ export type UiState = {
|
|
|
25
25
|
tableState: PlDataTableStateV2;
|
|
26
26
|
graphState: GraphMakerState;
|
|
27
27
|
};
|
|
28
|
-
export declare const model: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV2<BlockArgs, {
|
|
29
|
-
abundanceOptions: import("@platforma-sdk/model").
|
|
28
|
+
export declare const model: import("@platforma-sdk/model").PlatformaExtended<import("@platforma-sdk/model").PlatformaV2<BlockArgs, import("@platforma-sdk/model").InferOutputsFromConfigs<BlockArgs, {
|
|
29
|
+
abundanceOptions: import("@platforma-sdk/model").ConfigRenderLambda<{
|
|
30
30
|
readonly ref: {
|
|
31
31
|
readonly __isRef: true;
|
|
32
32
|
readonly blockId: string;
|
|
@@ -34,20 +34,21 @@ export declare const model: import("@platforma-sdk/model").PlatformaExtended<imp
|
|
|
34
34
|
readonly requireEnrichments?: true | undefined;
|
|
35
35
|
};
|
|
36
36
|
readonly label: string;
|
|
37
|
-
}[]
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
pt: import("@platforma-sdk/model").OutputWithStatus<{
|
|
37
|
+
}[]>;
|
|
38
|
+
} & {
|
|
39
|
+
pt: import("@platforma-sdk/model").ConfigRenderLambda<{
|
|
41
40
|
sourceId: string | null;
|
|
42
41
|
fullTableHandle: import("@platforma-sdk/model").PTableHandle;
|
|
43
42
|
visibleTableHandle: import("@platforma-sdk/model").PTableHandle;
|
|
44
|
-
}> & {
|
|
45
|
-
|
|
43
|
+
} | undefined> & {
|
|
44
|
+
withStatus: true;
|
|
46
45
|
};
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
} & {
|
|
47
|
+
pf: import("@platforma-sdk/model").ConfigRenderLambda<import("@platforma-sdk/model").PFrameHandle | undefined> & {
|
|
48
|
+
withStatus: true;
|
|
49
49
|
};
|
|
50
|
-
|
|
50
|
+
} & {
|
|
51
|
+
pcols: import("@platforma-sdk/model").ConfigRenderLambda<{
|
|
51
52
|
columnId: import("@platforma-sdk/model").PObjectId;
|
|
52
53
|
spec: {
|
|
53
54
|
readonly kind: "PColumn";
|
|
@@ -72,11 +73,9 @@ export declare const model: import("@platforma-sdk/model").PlatformaExtended<imp
|
|
|
72
73
|
readonly parentAxes?: number[] | undefined;
|
|
73
74
|
}[];
|
|
74
75
|
};
|
|
75
|
-
}[] | undefined
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
}, UiState, "/" | "/diversityGraph">>;
|
|
76
|
+
}[] | undefined>;
|
|
77
|
+
} & {
|
|
78
|
+
isRunning: import("@platforma-sdk/model").ConfigRenderLambda<boolean>;
|
|
79
|
+
}, UiState>, UiState, "/" | "/diversityGraph">>;
|
|
80
|
+
export { getDefaultBlockLabel } from './label';
|
|
82
81
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAoB,kBAAkB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAoB,kBAAkB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAKxF,cAAc,cAAc,CAAC;AAE7B,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,KAAK,GAAG,cAAc,GAC1D,UAAU,GAAG,oBAAoB,GAAG,eAAe,GACnD,yBAAyB,GAAG,gBAAgB,GAAG,MAAM,CAAC;AAExD,MAAM,MAAM,MAAM,GAAG;IACnB,IAAI,EAAE,aAAa,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,gBAAgB,CAAE;QACrD,YAAY,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,CAAC;QAChD,CAAC,CAAC,EAAE,MAAM,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,KAAK,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACpB,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,UAAU,EAAE,eAAe,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+CAiIR,CAAC;AAEX,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { BlockModel, createPlDataTableStateV2, createPlDataTableV2, createPFrameForGraphs } from '@platforma-sdk/model';
|
|
2
|
+
import strings from '@milaboratories/strings';
|
|
3
|
+
import { getDefaultBlockLabel } from './label.js';
|
|
2
4
|
export { convertMetricsUiToArgs } from './converters.js';
|
|
3
5
|
|
|
4
6
|
const model = BlockModel.create()
|
|
5
7
|
.withArgs({
|
|
6
8
|
metrics: [],
|
|
7
|
-
defaultBlockLabel:
|
|
9
|
+
defaultBlockLabel: getDefaultBlockLabel({}),
|
|
8
10
|
customBlockLabel: '',
|
|
9
11
|
})
|
|
10
12
|
.withUiState({
|
|
@@ -105,10 +107,10 @@ const model = BlockModel.create()
|
|
|
105
107
|
.title(() => 'Repertoire Diversity')
|
|
106
108
|
.subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)
|
|
107
109
|
.sections((_) => [
|
|
108
|
-
{ type: 'link', href: '/', label:
|
|
110
|
+
{ type: 'link', href: '/', label: strings.titles.main },
|
|
109
111
|
{ type: 'link', href: '/diversityGraph', label: 'Diversity Graph' },
|
|
110
112
|
])
|
|
111
113
|
.done(2);
|
|
112
114
|
|
|
113
|
-
export { model };
|
|
115
|
+
export { getDefaultBlockLabel, model };
|
|
114
116
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';\n\nexport * from './converters';\n\nexport type DiversityType = 'chao1' | 'd50' | 'efronThisted' |\n 'observed' | 'shannonWienerIndex' | 'shannonWiener' |\n 'normalizedShannonWiener' | 'inverseSimpson' | 'gini';\n\nexport type Metric = {\n type: DiversityType | undefined;\n downsampling: {\n type?: 'none' | 'top' | 'cumtop' | 'hypergeometric' ;\n valueChooser?: 'min' | 'fixed' | 'max' | 'auto';\n n?: number;\n };\n};\n\nexport type MetricUI = Metric & {\n id: string;\n isExpanded?: boolean;\n};\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n abundanceRef?: PlRef;\n metrics: Metric[];\n};\n\nexport type UiState = {\n metrics: MetricUI[];\n tableState: PlDataTableStateV2;\n graphState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n metrics: [],\n defaultBlockLabel:
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import type { GraphMakerState } from '@milaboratories/graph-maker';\nimport type { PColumnIdAndSpec, PlDataTableStateV2, PlRef } from '@platforma-sdk/model';\nimport { BlockModel, createPFrameForGraphs, createPlDataTableStateV2, createPlDataTableV2 } from '@platforma-sdk/model';\nimport strings from '@milaboratories/strings';\nimport { getDefaultBlockLabel } from './label';\n\nexport * from './converters';\n\nexport type DiversityType = 'chao1' | 'd50' | 'efronThisted' |\n 'observed' | 'shannonWienerIndex' | 'shannonWiener' |\n 'normalizedShannonWiener' | 'inverseSimpson' | 'gini';\n\nexport type Metric = {\n type: DiversityType | undefined;\n downsampling: {\n type?: 'none' | 'top' | 'cumtop' | 'hypergeometric' ;\n valueChooser?: 'min' | 'fixed' | 'max' | 'auto';\n n?: number;\n };\n};\n\nexport type MetricUI = Metric & {\n id: string;\n isExpanded?: boolean;\n};\n\nexport type BlockArgs = {\n defaultBlockLabel: string;\n customBlockLabel: string;\n abundanceRef?: PlRef;\n metrics: Metric[];\n};\n\nexport type UiState = {\n metrics: MetricUI[];\n tableState: PlDataTableStateV2;\n graphState: GraphMakerState;\n};\n\nexport const model = BlockModel.create()\n .withArgs<BlockArgs>({\n metrics: [],\n defaultBlockLabel: getDefaultBlockLabel({}),\n customBlockLabel: '',\n })\n\n .withUiState<UiState>({\n graphState: {\n title: 'Repertoire Diversity',\n template: 'bar',\n currentTab: null,\n },\n\n tableState: createPlDataTableStateV2(),\n\n metrics: [\n {\n id: 'observed',\n type: 'observed',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'shannonWiener',\n type: 'shannonWiener',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'chao1',\n type: 'chao1',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'gini',\n type: 'gini',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n {\n id: 'd50',\n type: 'd50',\n downsampling: {\n type: 'hypergeometric',\n valueChooser: 'auto',\n },\n isExpanded: false,\n },\n ],\n })\n\n .argsValid((ctx) => ctx.args.abundanceRef !== undefined\n && ctx.args.metrics.every((metric) => metric.type !== undefined))\n\n .output('abundanceOptions', (ctx) =>\n ctx.resultPool.getOptions([{\n axes: [\n { name: 'pl7.app/sampleId' },\n { },\n ],\n annotations: {\n 'pl7.app/isAbundance': 'true',\n 'pl7.app/abundance/normalized': 'false',\n 'pl7.app/abundance/isPrimary': 'true',\n },\n },\n ], { includeNativeLabel: true }),\n )\n\n .outputWithStatus('pt', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPlDataTableV2(ctx, pCols, ctx.uiState.tableState);\n })\n\n .outputWithStatus('pf', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n if (pCols === undefined) {\n return undefined;\n }\n\n return createPFrameForGraphs(ctx, pCols);\n })\n\n // Return a list of Pcols for plot defaults\n .output('pcols', (ctx) => {\n const pCols = ctx.outputs?.resolve('pf')?.getPColumns();\n\n if (pCols === undefined || pCols.length === 0) {\n return undefined;\n }\n\n return pCols.map(\n (c) =>\n ({\n columnId: c.id,\n spec: c.spec,\n } satisfies PColumnIdAndSpec),\n );\n })\n\n .output('isRunning', (ctx) => ctx.outputs?.getIsReadyOrError() === false)\n\n .title(() => 'Repertoire Diversity')\n\n .subtitle((ctx) => ctx.args.customBlockLabel || ctx.args.defaultBlockLabel)\n\n .sections((_) => [\n { type: 'link', href: '/', label: strings.titles.main },\n { type: 'link', href: '/diversityGraph', label: 'Diversity Graph' },\n ])\n\n .done(2);\n\nexport { getDefaultBlockLabel } from './label';\n"],"names":[],"mappings":";;;;;AAuCO,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM;AACnC,KAAA,QAAQ,CAAY;AACnB,IAAA,OAAO,EAAE,EAAE;AACX,IAAA,iBAAiB,EAAE,oBAAoB,CAAC,EAAE,CAAC;AAC3C,IAAA,gBAAgB,EAAE,EAAE;CACrB;AAEA,KAAA,WAAW,CAAU;AACpB,IAAA,UAAU,EAAE;AACV,QAAA,K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AC,GAAG,KAAI;AACvB,IAAA,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE;IAEvD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;AAC7C,QAAA,OAAO,SAAS;IAClB;IAEA,OAAO,KAAK,CAAC,GAAG,CACd,CAAC,CAAC,MACC;QACC,QAAQ,EAAE,CAAC,CAAC,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,IAAI;AACe,KAAA,CAAA,CAChC;AACH,CAAC;AAEA,KAAA,MAAM,CAAC,WAAW,EAAE,CAAC,GAAG,KAAK,GAAG,CAAC,OAAO,EAAE,iBAAiB,EAAE,KAAK,KAAK;AAEvE,KAAA,KAAK,CAAC,MAAM,sBAAsB;AAElC,KAAA,QAAQ,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,IAAI,CAAC,gBAAgB,IAAI,GAAG,CAAC,IAAI,CAAC,iBAAiB;AAEzE,KAAA,QAAQ,CAAC,CAAC,CAAC,KAAK;AACf,IAAA,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;IACvD,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,iBAAiB,EAAE;CACpE;KAEA,IAAI,CAAC,CAAC;;;;"}
|
package/dist/label.cjs
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function getDefaultBlockLabel(data) {
|
|
4
|
+
// Return abundance label if available, otherwise default message
|
|
5
|
+
if (data.abundanceLabel) {
|
|
6
|
+
return data.abundanceLabel;
|
|
7
|
+
}
|
|
8
|
+
return 'Select Abundance and Metrics';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
exports.getDefaultBlockLabel = getDefaultBlockLabel;
|
|
12
|
+
//# sourceMappingURL=label.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.cjs","sources":["../src/label.ts"],"sourcesContent":["export function getDefaultBlockLabel(data: {\n abundanceLabel?: string;\n}) {\n // Return abundance label if available, otherwise default message\n if (data.abundanceLabel) {\n return data.abundanceLabel;\n }\n\n return 'Select Abundance and Metrics';\n}\n"],"names":[],"mappings":";;AAAM,SAAU,oBAAoB,CAAC,IAEpC,EAAA;;AAEC,IAAA,IAAI,IAAI,CAAC,cAAc,EAAE;QACvB,OAAO,IAAI,CAAC,cAAc;IAC5B;AAEA,IAAA,OAAO,8BAA8B;AACvC;;;;"}
|
package/dist/label.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.d.ts","sourceRoot":"","sources":["../src/label.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,IAAI,EAAE;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,UAOA"}
|
package/dist/label.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
function getDefaultBlockLabel(data) {
|
|
2
|
+
// Return abundance label if available, otherwise default message
|
|
3
|
+
if (data.abundanceLabel) {
|
|
4
|
+
return data.abundanceLabel;
|
|
5
|
+
}
|
|
6
|
+
return 'Select Abundance and Metrics';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { getDefaultBlockLabel };
|
|
10
|
+
//# sourceMappingURL=label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../src/label.ts"],"sourcesContent":["export function getDefaultBlockLabel(data: {\n abundanceLabel?: string;\n}) {\n // Return abundance label if available, otherwise default message\n if (data.abundanceLabel) {\n return data.abundanceLabel;\n }\n\n return 'Select Abundance and Metrics';\n}\n"],"names":[],"mappings":"AAAM,SAAU,oBAAoB,CAAC,IAEpC,EAAA;;AAEC,IAAA,IAAI,IAAI,CAAC,cAAc,EAAE;QACvB,OAAO,IAAI,CAAC,cAAc;IAC5B;AAEA,IAAA,OAAO,8BAA8B;AACvC;;;;"}
|