@platforma-sdk/ui-vue 1.42.53 → 1.43.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.
Files changed (84) hide show
  1. package/.turbo/turbo-build.log +213 -207
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +14 -0
  4. package/dist/AgGridVue/useAgGridOptions.js +2 -3
  5. package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
  6. package/dist/assets/multi-sequence-alignment.worker-Cm0gZp19.js +6 -0
  7. package/dist/assets/multi-sequence-alignment.worker-Cm0gZp19.js.map +1 -0
  8. package/dist/assets/phylogenetic-tree.worker-4CrExYEo.js +5 -0
  9. package/dist/assets/phylogenetic-tree.worker-4CrExYEo.js.map +1 -0
  10. package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +2 -3
  11. package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
  12. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +11 -12
  13. package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
  14. package/dist/components/PlAgRowNumHeader.vue.js +8 -9
  15. package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
  16. package/dist/components/PlMultiSequenceAlignment/Consensus.vue.d.ts +1 -0
  17. package/dist/components/PlMultiSequenceAlignment/Consensus.vue2.js +48 -46
  18. package/dist/components/PlMultiSequenceAlignment/Consensus.vue2.js.map +1 -1
  19. package/dist/components/PlMultiSequenceAlignment/Consensus.vue3.js +5 -7
  20. package/dist/components/PlMultiSequenceAlignment/Consensus.vue3.js.map +1 -1
  21. package/dist/components/PlMultiSequenceAlignment/Legend.vue2.js +14 -13
  22. package/dist/components/PlMultiSequenceAlignment/Legend.vue2.js.map +1 -1
  23. package/dist/components/PlMultiSequenceAlignment/Legend.vue3.js +9 -8
  24. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue.d.ts +16 -9
  25. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js +117 -85
  26. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue2.js.map +1 -1
  27. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js +25 -18
  28. package/dist/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue3.js.map +1 -1
  29. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.d.ts +8 -0
  30. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.js +10 -0
  31. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue.js.map +1 -0
  32. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue2.js +77 -0
  33. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue2.js.map +1 -0
  34. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue3.js +9 -0
  35. package/dist/components/PlMultiSequenceAlignment/PhylogeneticTree.vue3.js.map +1 -0
  36. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue.d.ts +26 -18
  37. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js +119 -120
  38. package/dist/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue2.js.map +1 -1
  39. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue.js +7 -124
  40. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue.js.map +1 -1
  41. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue2.js +124 -2
  42. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue2.js.map +1 -1
  43. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue3.js +9 -0
  44. package/dist/components/PlMultiSequenceAlignment/SeqLogo.vue3.js.map +1 -0
  45. package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js +90 -90
  46. package/dist/components/PlMultiSequenceAlignment/Toolbar.vue2.js.map +1 -1
  47. package/dist/components/PlMultiSequenceAlignment/Toolbar.vue3.js +9 -7
  48. package/dist/components/PlMultiSequenceAlignment/cell-size.d.ts +4 -0
  49. package/dist/components/PlMultiSequenceAlignment/cell-size.js +8 -0
  50. package/dist/components/PlMultiSequenceAlignment/cell-size.js.map +1 -0
  51. package/dist/components/PlMultiSequenceAlignment/data.d.ts +15 -10
  52. package/dist/components/PlMultiSequenceAlignment/data.js +309 -202
  53. package/dist/components/PlMultiSequenceAlignment/data.js.map +1 -1
  54. package/dist/components/PlMultiSequenceAlignment/markup.js +9 -7
  55. package/dist/components/PlMultiSequenceAlignment/markup.js.map +1 -1
  56. package/dist/components/PlMultiSequenceAlignment/migrations.js +15 -13
  57. package/dist/components/PlMultiSequenceAlignment/migrations.js.map +1 -1
  58. package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.worker.d.ts +6 -0
  59. package/dist/components/PlMultiSequenceAlignment/phylogenetic-tree.worker.d.ts +7 -0
  60. package/dist/components/PlMultiSequenceAlignment/settings.js +3 -4
  61. package/dist/components/PlMultiSequenceAlignment/settings.js.map +1 -1
  62. package/dist/index.js +25 -27
  63. package/dist/index.js.map +1 -1
  64. package/dist/lib.d.ts +1 -2
  65. package/package.json +6 -6
  66. package/src/components/PlMultiSequenceAlignment/Consensus.vue +38 -39
  67. package/src/components/PlMultiSequenceAlignment/Legend.vue +9 -9
  68. package/src/components/PlMultiSequenceAlignment/MultiSequenceAlignmentView.vue +222 -126
  69. package/src/components/PlMultiSequenceAlignment/PhylogeneticTree.vue +110 -0
  70. package/src/components/PlMultiSequenceAlignment/PlMultiSequenceAlignment.vue +28 -22
  71. package/src/components/PlMultiSequenceAlignment/SeqLogo.vue +77 -69
  72. package/src/components/PlMultiSequenceAlignment/Toolbar.vue +47 -39
  73. package/src/components/PlMultiSequenceAlignment/cell-size.ts +4 -0
  74. package/src/components/PlMultiSequenceAlignment/data.ts +361 -149
  75. package/src/components/PlMultiSequenceAlignment/markup.ts +10 -8
  76. package/src/components/PlMultiSequenceAlignment/migrations.ts +6 -1
  77. package/src/components/PlMultiSequenceAlignment/multi-sequence-alignment.worker.ts +54 -0
  78. package/src/components/PlMultiSequenceAlignment/phylogenetic-tree.worker.ts +89 -0
  79. package/src/components/PlMultiSequenceAlignment/settings.ts +1 -2
  80. package/src/lib.ts +1 -3
  81. package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.d.ts +0 -7
  82. package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.js +0 -51
  83. package/dist/components/PlMultiSequenceAlignment/multi-sequence-alignment.js.map +0 -1
  84. package/src/components/PlMultiSequenceAlignment/multi-sequence-alignment.ts +0 -101
@@ -0,0 +1,110 @@
1
+ <script lang="ts" setup>
2
+ import type {
3
+ ChartInterface,
4
+ DataByColumns,
5
+ Settings,
6
+ } from '@milaboratories/miplots4';
7
+ import { PlAlert } from '@milaboratories/uikit';
8
+ import {
9
+ computed,
10
+ onBeforeUnmount,
11
+ shallowRef,
12
+ useCssModule,
13
+ useTemplateRef,
14
+ watchEffect,
15
+ } from 'vue';
16
+ import { cellSize } from './cell-size';
17
+ import type { TreeNodeData } from './phylogenetic-tree.worker';
18
+ import { useMiPlots } from './useMiPlots';
19
+
20
+ const props = defineProps<{
21
+ tree: TreeNodeData[];
22
+ }>();
23
+
24
+ const classes = useCssModule();
25
+
26
+ const plotEl = useTemplateRef('plotEl');
27
+
28
+ const settings: Settings = {
29
+ type: 'dendro',
30
+ title: { show: false, name: '' },
31
+ size: {
32
+ width: 149,
33
+ minCellHeight: cellSize.block,
34
+ maxCellHeight: cellSize.block,
35
+ marginLeft: 1,
36
+ marginRight: 0,
37
+ marginTop: 0,
38
+ marginBottom: 0,
39
+ },
40
+ mode: 'normal',
41
+ leavesMode: 'alignLeavesToLine',
42
+ leavesOrder: 'indexAsc',
43
+ legend: { show: false },
44
+ id: {
45
+ type: 'column',
46
+ value: 'nodeId',
47
+ },
48
+ parentId: {
49
+ type: 'column',
50
+ value: 'parentId',
51
+ },
52
+ height: {
53
+ type: 'column',
54
+ value: 'distance',
55
+ },
56
+ showNodes: false,
57
+ showNodesLabels: false,
58
+ showLeavesLabels: false,
59
+ rootPosition: 'left',
60
+ };
61
+
62
+ const data = computed<DataByColumns>(() => {
63
+ const nodeId: number[] = [];
64
+ const parentId: (number | null)[] = [];
65
+ const distance: number[] = [];
66
+ for (const node of props.tree) {
67
+ nodeId.push(node.id);
68
+ parentId.push(node.parentId ?? null);
69
+ distance.push(node.length ?? 0);
70
+ }
71
+ return ({
72
+ type: 'columns',
73
+ id: `phylogeneticTree-${crypto.randomUUID()}`,
74
+ values: { nodeId, parentId, distance },
75
+ });
76
+ });
77
+
78
+ const { miplots, error } = useMiPlots();
79
+
80
+ const plot = shallowRef<ChartInterface>();
81
+
82
+ watchEffect(async () => {
83
+ if (!plotEl.value || !miplots.value) return;
84
+ if (!plot.value) {
85
+ plot.value = miplots.value.newPlot(data.value, settings);
86
+ plot.value.mount(plotEl.value);
87
+ } else {
88
+ plot.value.updateSettingsAndData(data.value, settings);
89
+ }
90
+ });
91
+
92
+ onBeforeUnmount(() => {
93
+ plot.value?.unmount();
94
+ });
95
+ </script>
96
+
97
+ <template>
98
+ <PlAlert v-if="error" type="error">
99
+ {{ error.message }}
100
+ </PlAlert>
101
+ <div v-else ref="plotEl" :class="classes.container" />
102
+ </template>
103
+
104
+ <style module>
105
+ .container {
106
+ svg {
107
+ display: block;
108
+ }
109
+ }
110
+ </style>
@@ -17,12 +17,14 @@ import {
17
17
  import {
18
18
  computed,
19
19
  onBeforeMount,
20
+ onUnmounted,
20
21
  reactive,
22
+ useCssModule,
21
23
  useTemplateRef,
22
24
  watchEffect,
23
25
  } from 'vue';
24
26
  import {
25
- sequenceLimit,
27
+ SEQUENCE_LIMIT,
26
28
  useLabelColumnsOptions,
27
29
  useMarkupColumnsOptions,
28
30
  useMultipleAlignmentData,
@@ -62,6 +64,8 @@ const props = defineProps<{
62
64
  readonly selection?: PlSelectionModel;
63
65
  }>();
64
66
 
67
+ const classes = useCssModule();
68
+
65
69
  const sequenceColumns = reactive(useSequenceColumnsOptions(() => ({
66
70
  pFrame: props.pFrame,
67
71
  sequenceColumnPredicate: props.sequenceColumnPredicate,
@@ -84,6 +88,7 @@ const multipleAlignmentData = reactive(useMultipleAlignmentData(() => ({
84
88
  selection: props.selection,
85
89
  colorScheme: settings.colorScheme,
86
90
  alignmentParams: settings.alignmentParams,
91
+ shouldBuildPhylogeneticTree: settings.widgets.includes('tree'),
87
92
  })));
88
93
 
89
94
  const formatNumber = new Intl.NumberFormat('en').format;
@@ -104,7 +109,7 @@ const colorSchemeOptions = computed<
104
109
  label,
105
110
  value: {
106
111
  type: 'markup' as const,
107
- columnId: value,
112
+ columnIds: value,
108
113
  },
109
114
  })),
110
115
  ],
@@ -167,15 +172,15 @@ watchEffect(() => {
167
172
  settingsToReset.push('labelColumnIds');
168
173
  }
169
174
 
170
- const markupColumnId = settings.colorScheme?.type === 'markup'
171
- ? settings.colorScheme.columnId
175
+ const markupColumnIds = settings.colorScheme?.type === 'markup'
176
+ ? settings.colorScheme.columnIds
172
177
  : undefined;
173
178
 
174
179
  if (
175
180
  !markupColumns.isLoading
176
- && markupColumnId
181
+ && markupColumnIds
177
182
  && (markupColumns.data ?? []).every(
178
- ({ value }) => !isJsonEqual(value, markupColumnId),
183
+ ({ value }) => !isJsonEqual(value, markupColumnIds),
179
184
  )
180
185
  ) {
181
186
  settingsToReset.push('colorScheme');
@@ -243,6 +248,10 @@ async function exportPdf() {
243
248
  }
244
249
  }
245
250
  }
251
+
252
+ onUnmounted(() => {
253
+ multipleAlignmentData.data = undefined;
254
+ });
246
255
  </script>
247
256
 
248
257
  <template>
@@ -258,8 +267,7 @@ async function exportPdf() {
258
267
  {{ error }}
259
268
  </PlAlert>
260
269
  <PlAlert
261
- v-else-if="!multipleAlignmentData.isLoading
262
- && (multipleAlignmentData.data?.sequences ?? []).length < 2"
270
+ v-else-if="!multipleAlignmentData.isLoading && !multipleAlignmentData.data"
263
271
  type="warn"
264
272
  icon
265
273
  >
@@ -274,25 +282,23 @@ async function exportPdf() {
274
282
  label="Visualization is limited"
275
283
  >
276
284
  MSA visualization supports {{ formatNumber(2) }} to
277
- {{ formatNumber(sequenceLimit) }} sequences. Only the first
278
- {{ formatNumber(sequenceLimit) }} will be displayed.
285
+ {{ formatNumber(SEQUENCE_LIMIT) }} sequences. Only the first
286
+ {{ formatNumber(SEQUENCE_LIMIT) }} will be displayed.
279
287
  </PlAlert>
280
288
  <PlSplash
281
289
  type="transparent"
282
- :class="$style.splash"
290
+ :class="classes.splash"
283
291
  :loading="multipleAlignmentData.isLoading"
284
292
  >
285
- <template v-if="multipleAlignmentData.data?.sequences.length">
286
- <MultiSequenceAlignmentView
287
- ref="msa"
288
- :sequences="multipleAlignmentData.data.sequences"
289
- :sequence-names="multipleAlignmentData.data.sequenceNames"
290
- :label-rows="multipleAlignmentData.data.labelRows"
291
- :residue-counts="multipleAlignmentData.data.residueCounts"
292
- :highlight-image="multipleAlignmentData.data.highlightImage"
293
- :widgets="settings.widgets"
294
- />
295
- </template>
293
+ <MultiSequenceAlignmentView
294
+ v-if="multipleAlignmentData.data"
295
+ ref="msa"
296
+ :sequences="multipleAlignmentData.data.sequences"
297
+ :labels="multipleAlignmentData.data.labels"
298
+ :highlight-legend="multipleAlignmentData.data.highlightLegend"
299
+ :phylogenetic-tree="multipleAlignmentData.data.phylogeneticTree"
300
+ :widgets="settings.widgets"
301
+ />
296
302
  </PlSplash>
297
303
  </template>
298
304
  </template>
@@ -9,16 +9,20 @@ import {
9
9
  computed,
10
10
  onBeforeUnmount,
11
11
  shallowRef,
12
+ useCssModule,
12
13
  useTemplateRef,
13
14
  watchEffect,
14
15
  } from 'vue';
16
+ import { cellSize } from './cell-size';
15
17
  import type { ResidueCounts } from './types';
16
18
  import { useMiPlots } from './useMiPlots';
17
19
 
18
- const { residueCounts } = defineProps<{
20
+ const props = defineProps<{
19
21
  residueCounts: ResidueCounts;
20
22
  }>();
21
23
 
24
+ const classes = useCssModule();
25
+
22
26
  const plotEl = useTemplateRef('plotEl');
23
27
 
24
28
  const palette = {
@@ -59,84 +63,80 @@ const residueColors = {
59
63
  Z: palette.black,
60
64
  };
61
65
 
62
- const settings = computed<Settings | undefined>(() => {
63
- return ({
64
- type: 'discrete',
65
- title: {
66
- name: '',
67
- show: false,
68
- },
69
- size: {
70
- width: residueCounts.length * 20,
71
- height: 80,
72
- innerOffset: 0,
73
- outerOffset: 0,
74
- },
75
- frame: {
76
- type: 'empty',
77
- },
78
- xAxis: {
79
- title: '',
80
- showGrid: false,
81
- showTicks: false,
82
- hiddenLabels: true,
83
- },
84
- yAxis: {
85
- title: '',
86
- showGrid: false,
87
- showTicks: false,
88
- hiddenLabels: true,
89
- },
90
- y: {
66
+ const settings = computed(() => ({
67
+ type: 'discrete',
68
+ title: {
69
+ name: '',
70
+ show: false,
71
+ },
72
+ size: {
73
+ width: props.residueCounts.length * cellSize.inline,
74
+ height: 80,
75
+ innerOffset: 0,
76
+ outerOffset: 0,
77
+ },
78
+ frame: {
79
+ type: 'empty',
80
+ },
81
+ xAxis: {
82
+ title: '',
83
+ showGrid: false,
84
+ showTicks: false,
85
+ hiddenLabels: true,
86
+ },
87
+ yAxis: {
88
+ title: '',
89
+ showGrid: false,
90
+ showTicks: false,
91
+ hiddenLabels: true,
92
+ },
93
+ y: {
94
+ type: 'column',
95
+ value: 'countKey',
96
+ },
97
+ primaryGrouping: {
98
+ columnName: {
91
99
  type: 'column',
92
- value: 'countKey',
100
+ value: 'columnKey',
93
101
  },
94
- primaryGrouping: {
95
- columnName: {
96
- type: 'column',
97
- value: 'columnKey',
98
- },
99
- },
100
- secondaryGrouping: {
101
- columnName: {
102
- type: 'column',
103
- value: 'residueKey',
104
- },
102
+ },
103
+ secondaryGrouping: {
104
+ columnName: {
105
+ type: 'column',
106
+ value: 'residueKey',
105
107
  },
106
- layers: [{
107
- type: 'logo',
108
- aes: { fillColor: residueColors },
109
- }],
110
- });
111
- });
108
+ },
109
+ layers: [{
110
+ type: 'logo',
111
+ aes: { fillColor: residueColors },
112
+ }],
113
+ } satisfies Settings));
112
114
 
113
- const data = computed<DataByColumns>(
114
- () => {
115
- const countKey: number[] = [];
116
- const columnKey: number[] = [];
117
- const residueKey: string[] = [];
118
- for (const [columnIndex, column] of residueCounts.entries()) {
119
- for (const [residue, count] of Object.entries(column)) {
120
- if (residue === '-') continue;
121
- countKey.push(count);
122
- columnKey.push(columnIndex);
123
- residueKey.push(residue);
124
- }
115
+ const data = computed<DataByColumns>(() => {
116
+ const countKey: number[] = [];
117
+ const columnKey: number[] = [];
118
+ const residueKey: string[] = [];
119
+ for (const [columnIndex, column] of props.residueCounts.entries()) {
120
+ for (const [residue, count] of Object.entries(column)) {
121
+ if (residue === '-') continue;
122
+ countKey.push(count);
123
+ columnKey.push(columnIndex);
124
+ residueKey.push(residue);
125
125
  }
126
- return ({
127
- type: 'columns',
128
- id: `seq-logo-${crypto.randomUUID()}`,
129
- values: { countKey, columnKey, residueKey },
130
- });
131
- },
132
- );
126
+ }
127
+ return ({
128
+ type: 'columns',
129
+ id: `seq-logo-${crypto.randomUUID()}`,
130
+ values: { countKey, columnKey, residueKey },
131
+ });
132
+ });
133
133
 
134
134
  const { miplots, error } = useMiPlots();
135
135
 
136
136
  const plot = shallowRef<ChartInterface>();
137
137
 
138
138
  watchEffect(async () => {
139
- if (!settings.value || !plotEl.value || !miplots.value) return;
139
+ if (!plotEl.value || !miplots.value) return;
140
140
  if (!plot.value) {
141
141
  plot.value = miplots.value.newPlot(data.value, settings.value);
142
142
  plot.value.mount(plotEl.value);
@@ -154,5 +154,13 @@ onBeforeUnmount(() => {
154
154
  <PlAlert v-if="error" type="error">
155
155
  {{ error.message }}
156
156
  </PlAlert>
157
- <div v-else ref="plotEl" />
157
+ <div v-else ref="plotEl" :class="classes.container" />
158
158
  </template>
159
+
160
+ <style module>
161
+ .container {
162
+ svg {
163
+ display: block;
164
+ }
165
+ }
166
+ </style>
@@ -14,13 +14,14 @@ import {
14
14
  import type {
15
15
  PlMultiSequenceAlignmentColorSchemeOption as ColorSchemeOption,
16
16
  PlMultiSequenceAlignmentSettings as Settings,
17
+ PlMultiSequenceAlignmentWidget,
17
18
  PObjectId,
18
19
  PTableColumnId,
19
20
  } from '@platforma-sdk/model';
20
- import { computed, ref, watchEffect } from 'vue';
21
- import { defaultAlignmentParams } from './multi-sequence-alignment';
21
+ import { computed, ref, useCssModule, watchEffect } from 'vue';
22
+ import { defaultSettings } from './settings';
22
23
 
23
- const { settings } = defineProps<{
24
+ const props = defineProps<{
24
25
  settings: Settings;
25
26
  sequenceColumnOptions: ListOptionNormalized<PObjectId>[] | undefined;
26
27
  labelColumnOptions: ListOptionNormalized<PTableColumnId>[] | undefined;
@@ -32,6 +33,8 @@ const emit = defineEmits<{
32
33
  export: [];
33
34
  }>();
34
35
 
36
+ const classes = useCssModule();
37
+
35
38
  const settingsOpen = ref(false);
36
39
 
37
40
  function updateSetting<K extends keyof Settings>(
@@ -42,85 +45,90 @@ function updateSetting<K extends keyof Settings>(
42
45
  }
43
46
 
44
47
  function toggleWidget(
45
- widget: 'seqLogo' | 'consensus' | 'legend',
48
+ widget: PlMultiSequenceAlignmentWidget,
46
49
  checked: boolean,
47
50
  ) {
48
51
  updateSetting(
49
52
  'widgets',
50
53
  checked
51
- ? [...settings.widgets, widget]
52
- : settings.widgets.filter((w) => widget !== w),
54
+ ? [...props.settings.widgets, widget]
55
+ : props.settings.widgets.filter((w) => widget !== w),
53
56
  );
54
57
  }
55
58
 
56
- const alignmentParams = ref({ ...settings.alignmentParams });
59
+ const alignmentParams = ref({ ...props.settings.alignmentParams });
57
60
  watchEffect(() => {
58
- alignmentParams.value = { ...settings.alignmentParams };
61
+ alignmentParams.value = { ...props.settings.alignmentParams };
59
62
  });
60
63
 
61
64
  const alignmentParamsChangesPending = computed(() =>
62
- !isJsonEqual(settings.alignmentParams, alignmentParams.value),
65
+ !isJsonEqual(props.settings.alignmentParams, alignmentParams.value),
63
66
  );
64
67
 
65
68
  const canResetAlignmentParams = computed(() =>
66
- !isJsonEqual(settings.alignmentParams, defaultAlignmentParams),
69
+ !isJsonEqual(props.settings.alignmentParams, defaultSettings.alignmentParams),
67
70
  );
68
71
  </script>
69
72
 
70
73
  <template>
71
- <div :class="$style.container">
72
- <div :class="$style.line">
73
- <div :class="$style.section">
74
+ <div :class="classes.container">
75
+ <div :class="classes.line">
76
+ <div :class="classes.section">
74
77
  <PlDropdownMulti
75
78
  label="Sequence Columns"
76
- :model-value="settings.sequenceColumnIds ?? []"
77
- :options="sequenceColumnOptions"
79
+ :model-value="props.settings.sequenceColumnIds ?? []"
80
+ :options="props.sequenceColumnOptions"
78
81
  clearable
79
- @update:model-value="updateSetting('sequenceColumnIds', $event)"
82
+ @update:model-value="event => updateSetting('sequenceColumnIds', event)"
80
83
  />
81
84
  <PlDropdownMulti
82
- :model-value="settings.labelColumnIds ?? []"
85
+ :model-value="props.settings.labelColumnIds ?? []"
83
86
  label="Label Columns"
84
- :options="labelColumnOptions"
87
+ :options="props.labelColumnOptions"
85
88
  clearable
86
- @update:model-value="updateSetting('labelColumnIds', $event)"
89
+ @update:model-value="event => updateSetting('labelColumnIds', event)"
87
90
  />
88
91
  <PlDropdown
89
- :model-value="settings.colorScheme"
92
+ :model-value="props.settings.colorScheme"
90
93
  label="Color Scheme"
91
- :options="colorSchemeOptions"
92
- @update:model-value="updateSetting('colorScheme', $event)"
94
+ :options="props.colorSchemeOptions"
95
+ @update:model-value="event => updateSetting('colorScheme', event)"
93
96
  />
94
97
  </div>
95
- <div :class="$style.buttons">
98
+ <div :class="classes.buttons">
96
99
  <PlBtnGhost icon="settings" @click.stop="settingsOpen = true">
97
100
  Settings
98
101
  </PlBtnGhost>
99
- <PlBtnGhost icon="export" @click.stop="$emit('export')">
102
+ <PlBtnGhost icon="export" @click.stop="emit('export')">
100
103
  Export
101
104
  </PlBtnGhost>
102
105
  </div>
103
106
  </div>
104
- <div :class="$style.line">
105
- <div :class="$style.section">
107
+ <div :class="classes.line">
108
+ <div :class="classes.section">
106
109
  <PlCheckbox
107
- :model-value="settings.widgets.includes('seqLogo')"
108
- @update:model-value="toggleWidget('seqLogo', $event)"
110
+ :model-value="props.settings.widgets.includes('seqLogo')"
111
+ @update:model-value="event => toggleWidget('seqLogo', event)"
109
112
  >
110
113
  Seq logo
111
114
  </PlCheckbox>
112
115
  <PlCheckbox
113
- :model-value="settings.widgets.includes('consensus')"
114
- @update:model-value="toggleWidget('consensus', $event)"
116
+ :model-value="props.settings.widgets.includes('consensus')"
117
+ @update:model-value="event => toggleWidget('consensus', event)"
115
118
  >
116
119
  Consensus
117
120
  </PlCheckbox>
118
121
  <PlCheckbox :model-value="false" disabled>Navigator</PlCheckbox>
119
- <PlCheckbox :model-value="false" disabled>Tree</PlCheckbox>
120
122
  <PlCheckbox
121
- :model-value="settings.widgets.includes('legend')"
122
- :disabled="settings.colorScheme.type === 'no-color'"
123
- @update:model-value="toggleWidget('legend', $event)"
123
+ :model-value="props.settings.widgets.includes('tree')"
124
+ @update:model-value="event => toggleWidget('tree', event)"
125
+ >
126
+ Tree
127
+ </PlCheckbox>
128
+ <PlCheckbox
129
+ :model-value="props.settings.widgets.includes('legend')"
130
+ :disabled="props.settings.colorScheme.type === 'no-color'"
131
+ @update:model-value="event => toggleWidget('legend', event)"
124
132
  >
125
133
  Legend
126
134
  </PlCheckbox>
@@ -162,18 +170,18 @@ const canResetAlignmentParams = computed(() =>
162
170
  </PlNumberField>
163
171
  <div
164
172
  v-if="alignmentParamsChangesPending"
165
- :class="$style['pending-changes']"
173
+ :class="classes.pendingChanges"
166
174
  >
167
175
  <PlBtnPrimary @click="updateSetting('alignmentParams', alignmentParams)">
168
176
  Apply
169
177
  </PlBtnPrimary>
170
- <PlBtnGhost @click="alignmentParams = settings.alignmentParams">
178
+ <PlBtnGhost @click="alignmentParams = props.settings.alignmentParams">
171
179
  Cancel
172
180
  </PlBtnGhost>
173
181
  </div>
174
182
  <PlBtnSecondary
175
183
  v-if="canResetAlignmentParams"
176
- :class="$style['reset-button']"
184
+ :class="classes.resetButton"
177
185
  icon="reverse"
178
186
  @click="updateSetting('alignmentParams', undefined)"
179
187
  >
@@ -204,14 +212,14 @@ const canResetAlignmentParams = computed(() =>
204
212
  display: flex;
205
213
  }
206
214
 
207
- .pending-changes {
215
+ .pendingChanges {
208
216
  display: flex;
209
217
  button {
210
218
  min-width: 160px;
211
219
  }
212
220
  }
213
221
 
214
- .reset-button {
222
+ .resetButton {
215
223
  margin-block-start: auto;
216
224
  span {
217
225
  text-transform: none;
@@ -0,0 +1,4 @@
1
+ export const cellSize = {
2
+ inline: 20,
3
+ block: 24,
4
+ };