@platforma-open/milaboratories.vj-usage.ui 2.0.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.
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="Content-Security-Policy" content="script-src 'self' blob:">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <script type="module" crossorigin src="./assets/index-Bfhy4qws.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/index-DhNsiPnN.css">
9
+ </head>
10
+ <body>
11
+ <div id="app"></div>
12
+ </body>
13
+ </html>
@@ -0,0 +1,4 @@
1
+ import { ui } from '@platforma-sdk/eslint-config';
2
+
3
+ /** @type {import('eslint').Linter.Config[]} */
4
+ export default [...ui];
package/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta http-equiv="Content-Security-Policy" content="script-src 'self' blob:">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ </head>
8
+ <body>
9
+ <div id="app"></div>
10
+ <script type="module" src="/src/main.ts"></script>
11
+ </body>
12
+ </html>
package/package.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "@platforma-open/milaboratories.vj-usage.ui",
3
+ "version": "2.0.0",
4
+ "type": "module",
5
+ "dependencies": {
6
+ "@milaboratories/graph-maker": "^1.1.71",
7
+ "@platforma-sdk/ui-vue": "^1.29.2",
8
+ "@platforma-sdk/model": "^1.29.2",
9
+ "vue": "^3.5.13",
10
+ "@platforma-open/milaboratories.vj-usage.model": "2.0.0"
11
+ },
12
+ "devDependencies": {
13
+ "@vitejs/plugin-vue": "^5.2.1",
14
+ "typescript": "~5.5.4",
15
+ "vite": "^6.2.2",
16
+ "vue-tsc": "^2.2.8",
17
+ "@platforma-sdk/eslint-config": "^1.0.3"
18
+ },
19
+ "scripts": {
20
+ "dev": "vite",
21
+ "watch": "vue-tsc && vite build --watch",
22
+ "build": "vue-tsc -b && vite build",
23
+ "lint": "eslint .",
24
+ "preview": "vite preview"
25
+ }
26
+ }
package/src/app.ts ADDED
@@ -0,0 +1,17 @@
1
+ import { model } from '@platforma-open/milaboratories.vj-usage.model';
2
+ import { defineApp } from '@platforma-sdk/ui-vue';
3
+ import JUsage from './pages/JUsage.vue';
4
+ import VJUsage from './pages/VJUsage.vue';
5
+ import VUsage from './pages/VUsage.vue';
6
+
7
+ export const sdkPlugin = defineApp(model, () => {
8
+ return {
9
+ routes: {
10
+ '/': () => VUsage,
11
+ '/jUsage': () => JUsage,
12
+ '/vjUsage': () => VJUsage,
13
+ },
14
+ };
15
+ });
16
+
17
+ export const useApp = sdkPlugin.useApp;
package/src/main.ts ADDED
@@ -0,0 +1,6 @@
1
+ import { BlockLayout } from '@platforma-sdk/ui-vue';
2
+ import '@platforma-sdk/ui-vue/styles';
3
+ import { createApp } from 'vue';
4
+ import { sdkPlugin } from './app';
5
+
6
+ createApp(BlockLayout).use(sdkPlugin).mount('#app');
@@ -0,0 +1,76 @@
1
+ <script setup lang="ts">
2
+ import type { GraphMakerProps } from '@milaboratories/graph-maker';
3
+ import { GraphMaker } from '@milaboratories/graph-maker';
4
+ import '@milaboratories/graph-maker/styles';
5
+ import type { PDataColumnSpec } from '@platforma-sdk/model';
6
+ import { PlBtnGroup } from '@platforma-sdk/ui-vue';
7
+ import { computed, useTemplateRef } from 'vue';
8
+ import { useApp } from '../app';
9
+
10
+ const app = useApp();
11
+
12
+ const defaultOptions = computed((): GraphMakerProps['defaultOptions'] => {
13
+ const mainCol: PDataColumnSpec = {
14
+ kind: 'PColumn',
15
+ valueType: 'Double',
16
+ name: 'pl7.app/vdj/jGeneUsage',
17
+ domain: {
18
+ 'pl7.app/vdj/vjGeneUsage/type': app.model.ui.weightedFlag ? 'weighted' : 'unweighted',
19
+ },
20
+ axesSpec: [],
21
+ };
22
+ return [
23
+ {
24
+ inputName: 'value',
25
+ selectedSource: mainCol,
26
+ },
27
+ {
28
+ inputName: 'y',
29
+ selectedSource: {
30
+ type: 'String',
31
+ name: 'pl7.app/vdj/jGene',
32
+ },
33
+ },
34
+ {
35
+ inputName: 'x',
36
+ selectedSource: {
37
+ type: 'String',
38
+ name: 'pl7.app/sampleId',
39
+ },
40
+ },
41
+ ];
42
+ });
43
+
44
+ const weightOptions = [
45
+ {
46
+ label: 'Weighted',
47
+ value: true,
48
+ },
49
+ {
50
+ label: 'Unweighted',
51
+ value: false,
52
+ },
53
+ ];
54
+
55
+ const graphMakerRef = useTemplateRef('graphMaker');
56
+
57
+ const setWeightedFlag = (flag: boolean) => {
58
+ app.model.ui.weightedFlag = flag;
59
+ graphMakerRef.value?.reset();
60
+ };
61
+ </script>
62
+
63
+ <template>
64
+ <GraphMaker
65
+ ref="graphMaker"
66
+ v-model="app.model.ui.jUsagePlotState"
67
+ chart-type="heatmap"
68
+ :p-frame="app.model.outputs.pf"
69
+ :default-options="defaultOptions"
70
+ :readonly-inputs="['value']"
71
+ >
72
+ <template #titleLineSlot>
73
+ <PlBtnGroup v-model="app.model.ui.weightedFlag" :options="weightOptions" @v-model:set="setWeightedFlag"/>
74
+ </template>
75
+ </GraphMaker>
76
+ </template>
@@ -0,0 +1,83 @@
1
+ <script setup lang="ts">
2
+ import type { GraphMakerProps } from '@milaboratories/graph-maker';
3
+ import { GraphMaker } from '@milaboratories/graph-maker';
4
+ import '@milaboratories/graph-maker/styles';
5
+ import type { PDataColumnSpec } from '@platforma-sdk/model';
6
+ import { PlBtnGroup } from '@platforma-sdk/ui-vue';
7
+ import { computed, useTemplateRef } from 'vue';
8
+ import { useApp } from '../app';
9
+
10
+ const app = useApp();
11
+
12
+ const defaultOptions = computed((): GraphMakerProps['defaultOptions'] => {
13
+ const mainCol: PDataColumnSpec = {
14
+ kind: 'PColumn',
15
+ valueType: 'Double',
16
+ name: 'pl7.app/vdj/vjGeneUsage',
17
+ domain: {
18
+ 'pl7.app/vdj/vjGeneUsage/type': app.model.ui.weightedFlag ? 'weighted' : 'unweighted',
19
+ },
20
+ axesSpec: [],
21
+ };
22
+ return [
23
+ {
24
+ inputName: 'value',
25
+ selectedSource: mainCol,
26
+ },
27
+ {
28
+ inputName: 'x',
29
+ selectedSource: {
30
+ type: 'String',
31
+ name: 'pl7.app/vdj/vGene',
32
+ },
33
+ },
34
+ {
35
+ inputName: 'y',
36
+ selectedSource: {
37
+ type: 'String',
38
+ name: 'pl7.app/vdj/jGene',
39
+ },
40
+ },
41
+ {
42
+ inputName: 'tabBy',
43
+ selectedSource: {
44
+ type: 'String',
45
+ name: 'pl7.app/sampleId',
46
+ },
47
+ },
48
+ ];
49
+ });
50
+
51
+ const weightOptions = [
52
+ {
53
+ label: 'Weighted',
54
+ value: true,
55
+ },
56
+ {
57
+ label: 'Unweighted',
58
+ value: false,
59
+ },
60
+ ];
61
+
62
+ const graphMakerRef = useTemplateRef('graphMaker');
63
+
64
+ const setWeightedFlag = (flag: boolean) => {
65
+ app.model.ui.weightedFlag = flag;
66
+ graphMakerRef.value?.reset();
67
+ };
68
+ </script>
69
+
70
+ <template>
71
+ <GraphMaker
72
+ ref="graphMaker"
73
+ v-model="app.model.ui.vjUsagePlotState"
74
+ chart-type="heatmap"
75
+ :p-frame="app.model.outputs.pf"
76
+ :default-options="defaultOptions"
77
+ :readonly-inputs="['value']"
78
+ >
79
+ <template #titleLineSlot>
80
+ <PlBtnGroup v-model="app.model.ui.weightedFlag" :options="weightOptions" @v-model:set="setWeightedFlag"/>
81
+ </template>
82
+ </GraphMaker>
83
+ </template>
@@ -0,0 +1,98 @@
1
+ <script setup lang="ts">
2
+ import type { GraphMakerProps } from '@milaboratories/graph-maker';
3
+ import { GraphMaker } from '@milaboratories/graph-maker';
4
+ import '@milaboratories/graph-maker/styles';
5
+ import type { PDataColumnSpec } from '@platforma-sdk/model';
6
+ import { PlBtnGroup, PlDropdown, PlDropdownRef } from '@platforma-sdk/ui-vue';
7
+ import { computed, useTemplateRef } from 'vue';
8
+ import { useApp } from '../app';
9
+
10
+ const app = useApp();
11
+
12
+ const defaultOptions = computed((): GraphMakerProps['defaultOptions'] => {
13
+ const mainCol: PDataColumnSpec = {
14
+ kind: 'PColumn',
15
+ valueType: 'Double',
16
+ name: 'pl7.app/vdj/vGeneUsage',
17
+ domain: {
18
+ 'pl7.app/vdj/vjGeneUsage/type': app.model.ui.weightedFlag ? 'weighted' : 'unweighted',
19
+ },
20
+ axesSpec: [],
21
+ };
22
+ return [
23
+ {
24
+ inputName: 'value',
25
+ selectedSource: mainCol,
26
+ },
27
+ {
28
+ inputName: 'y',
29
+ selectedSource: {
30
+ type: 'String',
31
+ name: 'pl7.app/vdj/vGene',
32
+ },
33
+ },
34
+ {
35
+ inputName: 'x',
36
+ selectedSource: {
37
+ type: 'String',
38
+ name: 'pl7.app/sampleId',
39
+ },
40
+ },
41
+ ];
42
+ });
43
+
44
+ const weightOptions = [
45
+ {
46
+ label: 'Weighted',
47
+ value: true,
48
+ },
49
+ {
50
+ label: 'Unweighted',
51
+ value: false,
52
+ },
53
+ ];
54
+
55
+ const graphMakerRef = useTemplateRef('graphMaker');
56
+
57
+ const setWeightedFlag = (flag: boolean) => {
58
+ app.model.ui.weightedFlag = flag;
59
+ graphMakerRef.value?.reset();
60
+ };
61
+ </script>
62
+
63
+ <template>
64
+ <GraphMaker
65
+ ref="graphMaker"
66
+ v-model="app.model.ui.vUsagePlotState"
67
+ chart-type="heatmap"
68
+ :p-frame="app.model.outputs.pf"
69
+ :default-options="defaultOptions"
70
+ :readonly-inputs="['value']"
71
+ >
72
+ <template #titleLineSlot>
73
+ <PlBtnGroup v-model="app.model.ui.weightedFlag" :options="weightOptions" @v-model:set="setWeightedFlag"/>
74
+ </template>
75
+ <template #settingsSlot>
76
+ <PlDropdownRef
77
+ v-model="app.model.args.vGeneRef"
78
+ :options="app.model.outputs.vGeneOptions"
79
+ label="V gene"
80
+ required
81
+ />
82
+
83
+ <PlDropdown
84
+ v-model="app.model.args.jGeneRef"
85
+ :options="app.model.outputs.jGeneOptions"
86
+ label="J gene"
87
+ required
88
+ />
89
+
90
+ <PlDropdown
91
+ v-model="app.model.args.abundanceRef"
92
+ :options="app.model.outputs.abundanceOptions"
93
+ label="Abundance (weight)"
94
+ required
95
+ />
96
+ </template>
97
+ </GraphMaker>
98
+ </template>
@@ -0,0 +1,26 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": false,
4
+ "target": "ES2020",
5
+ "useDefineForClassFields": true,
6
+ "module": "ESNext",
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "skipLibCheck": true,
9
+
10
+ /* Bundler mode */
11
+ "moduleResolution": "bundler",
12
+ "allowImportingTsExtensions": true,
13
+ "resolveJsonModule": true,
14
+ "isolatedModules": true,
15
+ "moduleDetection": "force",
16
+ "noEmit": true,
17
+ "jsx": "preserve",
18
+
19
+ /* Linting */
20
+ "strict": true,
21
+ // "noUnusedLocals": true,
22
+ // "noUnusedParameters": true,
23
+ "noFallthroughCasesInSwitch": true
24
+ },
25
+ "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
26
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": false,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true,
9
+ "noEmit": true
10
+ },
11
+ "include": ["vite.config.ts"]
12
+ }
package/vite.config.ts ADDED
@@ -0,0 +1,11 @@
1
+ import { defineConfig } from 'vite';
2
+ import vue from '@vitejs/plugin-vue';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ base: './',
8
+ build: {
9
+ sourcemap: true,
10
+ },
11
+ });