Skip to content

Commit 0f1d539

Browse files
committed
saving graph maker state and add comments
1 parent 9114d24 commit 0f1d539

File tree

8 files changed

+214
-80
lines changed

8 files changed

+214
-80
lines changed

model/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
},
1212
"dependencies": {
1313
"@platforma-sdk/model": "catalog:",
14+
"@milaboratories/graph-maker": "catalog:",
1415
"zod": "catalog:"
1516
},
1617
"devDependencies": {

model/src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
isPColumn,
99
isPColumnSpec
1010
} from '@platforma-sdk/model';
11+
import { GraphMakerSettings } from '@milaboratories/graph-maker/dist/GraphMaker/types';
1112
import { parseResourceMap } from './helpers';
1213

1314
/**
@@ -32,6 +33,7 @@ export type UiState = {
3233
treeTableState?: PlDataTableState;
3334
treeSelectionForTreeNodesTable: TreeSelection;
3435
reportSelection: ReportSelection;
36+
treeNodesGraphState: GraphMakerSettings
3537
};
3638

3739
export type ColumnOption = {

pnpm-lock.yaml

Lines changed: 113 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ catalog:
1111

1212
'@platforma-sdk/model': ^1.2.27
1313
'@platforma-sdk/test': ^1.5.23
14-
"@milaboratories/graph-maker": ^1.0.5
14+
"@milaboratories/graph-maker": ^1.0.7
1515

1616
'@platforma-sdk/workflow-tengo': ^1.2.8
1717
'@milaboratories/software-pframes-conv': ^1.5.6

ui/src/ReportsPage.vue

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,25 @@
11
<script setup lang="ts">
2-
import { platforma } from '@platforma-open/milaboratories.mixcr-shm-trees.model';
32
import { useApp } from './app';
43
import { computed, reactive, watch } from 'vue';
54
import { ListOption, PlBlockPage, PlBtnGroup, PlDropdown, PlTextArea, SimpleOption } from '@platforma-sdk/ui-vue';
65
76
const app = useApp();
87
8+
// TODO should be moved to model
99
const uiState = app.createUiModel({}, () => ({
1010
treeSelectionForTreeNodesTable: {},
1111
reportSelection: {
1212
type: 'alleles'
13+
},
14+
treeNodesGraphState: {
15+
title: "",
16+
chartType: "dendro",
17+
template: "dendro",
18+
optionsState: null,
19+
statisticsSettings: null,
20+
axesSettings: null,
21+
layersSettings: null,
22+
dataBindAes: null
1323
}
1424
}))
1525
@@ -28,6 +38,7 @@ watch(() => app.getOutputFieldOkOptional('allelesReports'), (reports) => {
2838
for (const data of reports.data) {
2939
donors.push(data.key[0] as string)
3040
}
41+
// update selection choises
3142
state.donors = donors.map((donor) => ({ text: donor, value: donor }))
3243
3344
// if previously selected donor isn't in available options, remove selection
@@ -37,12 +48,14 @@ watch(() => app.getOutputFieldOkOptional('allelesReports'), (reports) => {
3748
}
3849
}, { immediate: true })
3950
51+
// extract report to show
4052
const reportText = computed(() => {
4153
const selecetedDonor = uiState.model.reportSelection.donor
4254
if (selecetedDonor === undefined) {
4355
return undefined
4456
}
4557
58+
// choose an output to extract report from
4659
var field
4760
switch(uiState.model.reportSelection.type) {
4861
case 'alleles': {
@@ -59,13 +72,7 @@ const reportText = computed(() => {
5972
return undefined
6073
}
6174
62-
const selectedReport = field.data.find((data) => data.key[0] === selecetedDonor)
63-
64-
if (selectedReport === undefined || selectedReport.value === undefined) {
65-
return undefined
66-
}
67-
68-
return selectedReport.value
75+
return field.data.find((data) => data.key[0] === selecetedDonor)?.value
6976
})
7077
7178
const reportOptions = [

0 commit comments

Comments
 (0)