@rivm-loculus-tools/sequence-editor 0.1.4 → 0.1.7

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 (127) hide show
  1. package/dist/_chunks/EditorWorkerService.js +127 -0
  2. package/dist/_chunks/EditorWorkerService.js.map +1 -0
  3. package/dist/_chunks/SequenceEditor.js +733 -0
  4. package/dist/_chunks/SequenceEditor.js.map +1 -0
  5. package/dist/_chunks/SequenceEditorPageDrawer.js +425 -0
  6. package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -0
  7. package/dist/_chunks/comlink.js +228 -0
  8. package/dist/_chunks/comlink.js.map +1 -0
  9. package/dist/_chunks/react.js +11 -0
  10. package/dist/_chunks/react.js.map +1 -0
  11. package/dist/_chunks/sequenceEditorStore.js +174 -0
  12. package/dist/_chunks/sequenceEditorStore.js.map +1 -0
  13. package/dist/assets/index-Dn92arD_.js +8 -0
  14. package/dist/assets/index-Dn92arD_.js.map +1 -0
  15. package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +27 -0
  16. package/dist/classes/services/EditorWorkerService/index.js +2 -0
  17. package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +25 -0
  18. package/dist/classes/services/SequenceEditorEventBusService/index.js +16 -0
  19. package/dist/classes/services/SequenceEditorEventBusService/index.js.map +1 -0
  20. package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +46 -0
  21. package/dist/classes/workers/EngineWorker/index.js +111 -0
  22. package/dist/classes/workers/EngineWorker/index.js.map +1 -0
  23. package/dist/components/app/App/App.d.ts +1 -0
  24. package/dist/components/app/App/index.js +21 -0
  25. package/dist/components/app/App/index.js.map +1 -0
  26. package/dist/components/pages/EmptyWorkspace.d.ts +3 -0
  27. package/dist/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.d.ts +3 -0
  28. package/dist/components/pages/SequenceEditorErrorPage/index.js +12 -0
  29. package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -0
  30. package/dist/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.d.ts +1 -0
  31. package/dist/components/pages/SequenceEditorMainPage/index.js +61 -0
  32. package/dist/components/pages/SequenceEditorMainPage/index.js.map +1 -0
  33. package/dist/components/ui/SequenceEditor/SequenceEditor.d.ts +1 -0
  34. package/dist/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.d.ts +8 -0
  35. package/dist/components/ui/SequenceEditor/SequenceEditorStatusBar.d.ts +1 -0
  36. package/dist/components/ui/SequenceEditor/index.js +2 -0
  37. package/dist/components/ui/SequenceEditorPage/SequenceEditorPage.d.ts +5 -0
  38. package/dist/components/ui/SequenceEditorPage/index.js +15 -0
  39. package/dist/components/ui/SequenceEditorPage/index.js.map +1 -0
  40. package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.d.ts +1 -0
  41. package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +7 -0
  42. package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +1 -0
  43. package/dist/components/ui/SequenceEditorPageDrawer/index.js +2 -0
  44. package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.d.ts +1 -0
  45. package/dist/components/ui/SequenceEditorPageHeader/index.js +60 -0
  46. package/dist/components/ui/SequenceEditorPageHeader/index.js.map +1 -0
  47. package/dist/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.d.ts +1 -0
  48. package/dist/components/ui/SequenceEditorSearchBar/index.js +27 -0
  49. package/dist/components/ui/SequenceEditorSearchBar/index.js.map +1 -0
  50. package/dist/constants/editor.d.ts +4 -0
  51. package/dist/constants/editor.js +14 -0
  52. package/dist/constants/editor.js.map +1 -0
  53. package/dist/constants/index.js +4 -0
  54. package/dist/constants/keyboard.d.ts +10 -0
  55. package/dist/constants/keyboard.js +179 -0
  56. package/dist/constants/keyboard.js.map +1 -0
  57. package/dist/constants/palette.d.ts +15 -0
  58. package/dist/constants/palette.js +196 -0
  59. package/dist/constants/palette.js.map +1 -0
  60. package/dist/models/editor.d.ts +6 -0
  61. package/dist/models/editor.js +8 -0
  62. package/dist/models/editor.js.map +1 -0
  63. package/dist/models/model.d.ts +250 -0
  64. package/dist/models/model.js +10 -0
  65. package/dist/models/model.js.map +1 -0
  66. package/dist/models/palette.d.ts +61 -0
  67. package/dist/models/palette.js +10 -0
  68. package/dist/models/palette.js.map +1 -0
  69. package/dist/stores/sequenceEditorStore/index.js +2 -0
  70. package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +36 -0
  71. package/dist/utils/EditorUtil/EditorUtil.d.ts +96 -0
  72. package/dist/utils/EditorUtil/index.js +552 -0
  73. package/dist/utils/EditorUtil/index.js.map +1 -0
  74. package/dist/utils/EngineErrorUtil/EngineErrorUtil.d.ts +4 -0
  75. package/dist/utils/PaletteUtil/PaletteUtil.d.ts +6 -0
  76. package/dist/utils/PaletteUtil/index.js +19 -0
  77. package/dist/utils/PaletteUtil/index.js.map +1 -0
  78. package/package.json +47 -21
  79. package/.gitkeep +0 -0
  80. package/CHANGELOG.md +0 -37
  81. package/eslint.config.js +0 -16
  82. package/scripts/update-exports.js +0 -9
  83. package/src/classes/services/EditorWorkerService/EditorWorkerService.ts +0 -163
  84. package/src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts +0 -37
  85. package/src/classes/workers/EngineWorker/EngineWorker.ts +0 -196
  86. package/src/components/app/App/App.tsx +0 -22
  87. package/src/components/pages/EmptyWorkspace.tsx +0 -43
  88. package/src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx +0 -16
  89. package/src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx +0 -76
  90. package/src/components/ui/SequenceEditor/SequenceEditor.tsx +0 -896
  91. package/src/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.tsx +0 -108
  92. package/src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx +0 -72
  93. package/src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx +0 -23
  94. package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.tsx +0 -234
  95. package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.tsx +0 -73
  96. package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.tsx +0 -230
  97. package/src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx +0 -71
  98. package/src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx +0 -35
  99. package/src/constants/editor.ts +0 -15
  100. package/src/constants/keyboard.ts +0 -154
  101. package/src/constants/palette.ts +0 -227
  102. package/src/models/editor.ts +0 -6
  103. package/src/models/model.ts +0 -295
  104. package/src/models/palette.ts +0 -68
  105. package/src/stores/sequenceEditorStore/sequenceEditorStore.ts +0 -103
  106. package/src/utils/EditorUtil/EditorUtil.ts +0 -892
  107. package/src/utils/EngineErrorUtil/EngineErrorUtil.ts +0 -25
  108. package/src/utils/PaletteUtil/PaletteUtil.ts +0 -31
  109. package/tsconfig.build.json +0 -14
  110. package/tsconfig.json +0 -32
  111. package/vite.config.ts +0 -177
  112. /package/{src/classes/services/EditorWorkerService/index.ts → dist/classes/services/EditorWorkerService/index.d.ts} +0 -0
  113. /package/{src/classes/services/SequenceEditorEventBusService/index.ts → dist/classes/services/SequenceEditorEventBusService/index.d.ts} +0 -0
  114. /package/{src/classes/workers/EngineWorker/index.ts → dist/classes/workers/EngineWorker/index.d.ts} +0 -0
  115. /package/{src/components/app/App/index.ts → dist/components/app/App/index.d.ts} +0 -0
  116. /package/{src/components/pages/SequenceEditorErrorPage/index.ts → dist/components/pages/SequenceEditorErrorPage/index.d.ts} +0 -0
  117. /package/{src/components/pages/SequenceEditorMainPage/index.ts → dist/components/pages/SequenceEditorMainPage/index.d.ts} +0 -0
  118. /package/{src/components/ui/SequenceEditor/index.ts → dist/components/ui/SequenceEditor/index.d.ts} +0 -0
  119. /package/{src/components/ui/SequenceEditorPage/index.ts → dist/components/ui/SequenceEditorPage/index.d.ts} +0 -0
  120. /package/{src/components/ui/SequenceEditorPageDrawer/index.ts → dist/components/ui/SequenceEditorPageDrawer/index.d.ts} +0 -0
  121. /package/{src/components/ui/SequenceEditorPageHeader/index.ts → dist/components/ui/SequenceEditorPageHeader/index.d.ts} +0 -0
  122. /package/{src/components/ui/SequenceEditorSearchBar/index.ts → dist/components/ui/SequenceEditorSearchBar/index.d.ts} +0 -0
  123. /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
  124. /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
  125. /package/{src/stores/sequenceEditorStore/index.ts → dist/stores/sequenceEditorStore/index.d.ts} +0 -0
  126. /package/{src/utils/EditorUtil/index.ts → dist/utils/EditorUtil/index.d.ts} +0 -0
  127. /package/{src/utils/PaletteUtil/index.ts → dist/utils/PaletteUtil/index.d.ts} +0 -0
@@ -1,227 +0,0 @@
1
- import {
2
- AminoAcidSymbol,
3
- NucleotideSymbol,
4
- } from '../models/palette';
5
- import type {
6
- AminoAcidPalette,
7
- AminoAcidPaletteColors,
8
- NucleotidePalette,
9
- NucleotidePaletteColors,
10
- } from '../models/palette';
11
- import { PaletteUtil } from '../utils/PaletteUtil';
12
-
13
- export const NUCLEOTIDE_SYMBOLS: readonly NucleotideSymbol[] = [
14
- NucleotideSymbol.A,
15
- NucleotideSymbol.C,
16
- NucleotideSymbol.G,
17
- NucleotideSymbol.T,
18
- NucleotideSymbol.U,
19
- NucleotideSymbol.R,
20
- NucleotideSymbol.Y,
21
- NucleotideSymbol.S,
22
- NucleotideSymbol.W,
23
- NucleotideSymbol.K,
24
- NucleotideSymbol.M,
25
- NucleotideSymbol.B,
26
- NucleotideSymbol.D,
27
- NucleotideSymbol.H,
28
- NucleotideSymbol.V,
29
- NucleotideSymbol.N,
30
- NucleotideSymbol.GAP,
31
- NucleotideSymbol.UNKNOWN,
32
- ] as const;
33
-
34
- export const AMINO_ACID_SYMBOLS: readonly AminoAcidSymbol[] = [
35
- AminoAcidSymbol.A,
36
- AminoAcidSymbol.C,
37
- AminoAcidSymbol.D,
38
- AminoAcidSymbol.E,
39
- AminoAcidSymbol.F,
40
- AminoAcidSymbol.G,
41
- AminoAcidSymbol.H,
42
- AminoAcidSymbol.I,
43
- AminoAcidSymbol.K,
44
- AminoAcidSymbol.L,
45
- AminoAcidSymbol.M,
46
- AminoAcidSymbol.N,
47
- AminoAcidSymbol.P,
48
- AminoAcidSymbol.Q,
49
- AminoAcidSymbol.R,
50
- AminoAcidSymbol.S,
51
- AminoAcidSymbol.T,
52
- AminoAcidSymbol.V,
53
- AminoAcidSymbol.W,
54
- AminoAcidSymbol.Y,
55
- AminoAcidSymbol.X,
56
- AminoAcidSymbol.STOP,
57
- AminoAcidSymbol.GAP,
58
- ] as const;
59
-
60
- export const ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {
61
- [AminoAcidSymbol.A]: PaletteUtil.createEntry('#276EB7', '#000000', '#3769FF', '#808080'),
62
- [AminoAcidSymbol.C]: PaletteUtil.createEntry('#E68080', '#000000', '#FFB6B6', '#808080'),
63
- [AminoAcidSymbol.D]: PaletteUtil.createEntry('#CC4DCC', '#000000', '#FF6EFF', '#808080'),
64
- [AminoAcidSymbol.E]: PaletteUtil.createEntry('#984097', '#000000', '#D95BD7', '#808080'),
65
- [AminoAcidSymbol.F]: PaletteUtil.createEntry('#1980E6', '#000000', '#23B6FF', '#808080'),
66
- [AminoAcidSymbol.G]: PaletteUtil.createEntry('#E6994D', '#000000', '#FFDA6E', '#808080'),
67
- [AminoAcidSymbol.GAP]: PaletteUtil.createEntry('#E6E6E6', '#404040', '#FFFFFF', '#808080'),
68
- [AminoAcidSymbol.H]: PaletteUtil.createEntry('#19B3B3', '#000000', '#23FFFF', '#808080'),
69
- [AminoAcidSymbol.I]: PaletteUtil.createEntry('#4EA0F3', '#000000', '#6FE4FF', '#808080'),
70
- [AminoAcidSymbol.K]: PaletteUtil.createEntry('#E63319', '#000000', '#FF4823', '#808080'),
71
- [AminoAcidSymbol.L]: PaletteUtil.createEntry('#78A6D5', '#000000', '#ABEDFF', '#808080'),
72
- [AminoAcidSymbol.M]: PaletteUtil.createEntry('#0F549B', '#000000', '#1578DD', '#808080'),
73
- [AminoAcidSymbol.N]: PaletteUtil.createEntry('#19CC19', '#000000', '#23FF23', '#808080'),
74
- [AminoAcidSymbol.P]: PaletteUtil.createEntry('#CCCC00', '#000000', '#FFFF00', '#808080'),
75
- [AminoAcidSymbol.Q]: PaletteUtil.createEntry('#5CED5C', '#000000', '#83FF83', '#808080'),
76
- [AminoAcidSymbol.R]: PaletteUtil.createEntry('#F6442C', '#000000', '#FF613E', '#808080'),
77
- [AminoAcidSymbol.S]: PaletteUtil.createEntry('#029602', '#000000', '#03D603', '#808080'),
78
- [AminoAcidSymbol.STOP]: PaletteUtil.createEntry('#404040', '#00FFFF', '#5B5B5B', '#808080'),
79
- [AminoAcidSymbol.T]: PaletteUtil.createEntry('#45C945', '#000000', '#62FF62', '#808080'),
80
- [AminoAcidSymbol.V]: PaletteUtil.createEntry('#047DF9', '#000000', '#05B2FF', '#808080'),
81
- [AminoAcidSymbol.W]: PaletteUtil.createEntry('#0355A9', '#000000', '#0479F1', '#808080'),
82
- [AminoAcidSymbol.X]: PaletteUtil.createEntry('#FFFFFF', '#00FFFF', '#FFFFFF', '#808080'),
83
- [AminoAcidSymbol.Y]: PaletteUtil.createEntry('#14C6C8', '#000000', '#1CFFFF', '#808080'),
84
- };
85
-
86
- export const ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {
87
- [NucleotideSymbol.A]: PaletteUtil.createEntry('#5ADC5A', '#018001', '#058705', '#97FF97'),
88
- [NucleotideSymbol.B]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
89
- [NucleotideSymbol.C]: PaletteUtil.createEntry('#6464FA', '#0101FF', '#0F0FA5', '#9797FF'),
90
- [NucleotideSymbol.D]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
91
- [NucleotideSymbol.G]: PaletteUtil.createEntry('#5A5A5A', '#000000', '#050505', '#969696'),
92
- [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#FAFAFA', '#868686', '#A5A5A5', '#FFFFFF'),
93
- [NucleotideSymbol.H]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
94
- [NucleotideSymbol.K]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
95
- [NucleotideSymbol.M]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
96
- [NucleotideSymbol.N]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
97
- [NucleotideSymbol.R]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
98
- [NucleotideSymbol.S]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
99
- [NucleotideSymbol.T]: PaletteUtil.createEntry('#F58282', '#FF0101', '#A02D2D', '#FF9797'),
100
- [NucleotideSymbol.U]: PaletteUtil.createEntry('#F58282', '#FF0101', '#A02D2D', '#FF9797'),
101
- [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#FFFFFF', '#00FFFF', '#AAAAAA', '#96FFFF'),
102
- [NucleotideSymbol.V]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
103
- [NucleotideSymbol.W]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
104
- [NucleotideSymbol.Y]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),
105
- };
106
-
107
- export const ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {
108
- ...ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS,
109
- [NucleotideSymbol.A]: PaletteUtil.createEntry('#5ADC5A', '#2C2C2C', '#058705', '#1E1E1E'),
110
- [NucleotideSymbol.B]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
111
- [NucleotideSymbol.C]: PaletteUtil.createEntry('#6464FA', '#2C2C2C', '#0F0FA5', '#1E1E1E'),
112
- [NucleotideSymbol.D]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
113
- [NucleotideSymbol.G]: PaletteUtil.createEntry('#5A5A5A', '#2C2C2C', '#050505', '#1E1E1E'),
114
- [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#FAFAFA', '#2C2C2C', '#A5A5A5', '#1E1E1E'),
115
- [NucleotideSymbol.H]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
116
- [NucleotideSymbol.K]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
117
- [NucleotideSymbol.M]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
118
- [NucleotideSymbol.N]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
119
- [NucleotideSymbol.R]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
120
- [NucleotideSymbol.S]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
121
- [NucleotideSymbol.T]: PaletteUtil.createEntry('#F58282', '#2C2C2C', '#A02D2D', '#1E1E1E'),
122
- [NucleotideSymbol.U]: PaletteUtil.createEntry('#F58282', '#2C2C2C', '#A02D2D', '#1E1E1E'),
123
- [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
124
- [NucleotideSymbol.V]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
125
- [NucleotideSymbol.W]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
126
- [NucleotideSymbol.Y]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),
127
- };
128
-
129
- export const ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {
130
- [NucleotideSymbol.A]: PaletteUtil.createEntry('#FF0000', '#000000', '#870000', '#040404'),
131
- [NucleotideSymbol.B]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
132
- [NucleotideSymbol.C]: PaletteUtil.createEntry('#00FF00', '#000000', '#008700', '#040404'),
133
- [NucleotideSymbol.D]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
134
- [NucleotideSymbol.G]: PaletteUtil.createEntry('#FFFF00', '#000000', '#878700', '#040404'),
135
- [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#E0E0E0', '#000000', '#9B9B9B', '#040404'),
136
- [NucleotideSymbol.H]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
137
- [NucleotideSymbol.K]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
138
- [NucleotideSymbol.M]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
139
- [NucleotideSymbol.N]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
140
- [NucleotideSymbol.R]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
141
- [NucleotideSymbol.S]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
142
- [NucleotideSymbol.T]: PaletteUtil.createEntry('#0000FF', '#000000', '#000087', '#040404'),
143
- [NucleotideSymbol.U]: PaletteUtil.createEntry('#0000FF', '#000000', '#000087', '#040404'),
144
- [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#E0E0E0', '#00FFFF', '#9B9B9B', '#040404'),
145
- [NucleotideSymbol.V]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
146
- [NucleotideSymbol.W]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
147
- [NucleotideSymbol.Y]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),
148
- };
149
-
150
- export const ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {
151
- ...ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS,
152
- };
153
-
154
- const ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS: Record<string, string> = {
155
- A: '#80B3E6',
156
- C: '#80B3E6',
157
- D: '#CC4DCC',
158
- E: '#CC4DCC',
159
- F: '#80B3E6',
160
- G: '#E6994D',
161
- H: '#1AB3B3',
162
- I: '#80B3E6',
163
- K: '#E6331A',
164
- L: '#80B3E6',
165
- M: '#80B3E6',
166
- N: '#1ACC1A',
167
- P: '#CCCC00',
168
- Q: '#1ACC1A',
169
- R: '#E6331A',
170
- S: '#1ACC1A',
171
- T: '#1ACC1A',
172
- V: '#80B3E6',
173
- W: '#80B3E6',
174
- Y: '#1AB3B3',
175
- };
176
-
177
- export const ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {
178
- [AminoAcidSymbol.A]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.A, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.A, '#FFFFFF'),
179
- [AminoAcidSymbol.C]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.C, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.C, '#FFFFFF'),
180
- [AminoAcidSymbol.D]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.D, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.D, '#FFFFFF'),
181
- [AminoAcidSymbol.E]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.E, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.E, '#FFFFFF'),
182
- [AminoAcidSymbol.F]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.F, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.F, '#FFFFFF'),
183
- [AminoAcidSymbol.G]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.G, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.G, '#FFFFFF'),
184
- [AminoAcidSymbol.GAP]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),
185
- [AminoAcidSymbol.H]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.H, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.H, '#FFFFFF'),
186
- [AminoAcidSymbol.I]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.I, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.I, '#FFFFFF'),
187
- [AminoAcidSymbol.K]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.K, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.K, '#FFFFFF'),
188
- [AminoAcidSymbol.L]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.L, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.L, '#FFFFFF'),
189
- [AminoAcidSymbol.M]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.M, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.M, '#FFFFFF'),
190
- [AminoAcidSymbol.N]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.N, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.N, '#FFFFFF'),
191
- [AminoAcidSymbol.P]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.P, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.P, '#FFFFFF'),
192
- [AminoAcidSymbol.Q]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Q, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Q, '#FFFFFF'),
193
- [AminoAcidSymbol.R]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.R, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.R, '#FFFFFF'),
194
- [AminoAcidSymbol.S]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.S, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.S, '#FFFFFF'),
195
- [AminoAcidSymbol.STOP]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),
196
- [AminoAcidSymbol.T]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.T, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.T, '#FFFFFF'),
197
- [AminoAcidSymbol.V]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.V, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.V, '#FFFFFF'),
198
- [AminoAcidSymbol.W]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.W, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.W, '#FFFFFF'),
199
- [AminoAcidSymbol.X]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),
200
- [AminoAcidSymbol.Y]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Y, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Y, '#FFFFFF'),
201
- };
202
-
203
- export const ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE: NucleotidePalette = {
204
- name: 'Default',
205
- paletteColors: ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS,
206
- };
207
- export const ALI_VIEW_FAST_NUCLEOTIDE_PALETTE: NucleotidePalette = {
208
- name: 'Fast',
209
- paletteColors: ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS,
210
- };
211
- export const ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE: NucleotidePalette = {
212
- name: 'SeaView',
213
- paletteColors: ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS,
214
- };
215
-
216
- export const ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE: AminoAcidPalette = {
217
- name: 'Default',
218
- paletteColors: ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS,
219
- };
220
- export const ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE: AminoAcidPalette = {
221
- name: 'SeaView',
222
- paletteColors: ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS,
223
- };
224
- export const ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE: AminoAcidPalette = {
225
- name: 'Clustal X',
226
- paletteColors: ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS,
227
- };
@@ -1,6 +0,0 @@
1
- export enum EDITOR_DIRECTION {
2
- DOWN = 'DOWN',
3
- LEFT = 'LEFT',
4
- RIGHT = 'RIGHT',
5
- UP = 'UP',
6
- }
@@ -1,295 +0,0 @@
1
- import type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';
2
-
3
- export enum EDITOR_PATH_PROPERTIES_TYPE {
4
- CELL = 'CELL',
5
- DIVIDER = 'DIVIDER',
6
- LABEL = 'LABEL',
7
- RULER = 'RULER',
8
- }
9
-
10
-
11
- export enum MATRIX_TYPE {
12
- AMINO_ACID = 'amino_acid',
13
- NUCLEOTIDE = 'nucleotide',
14
- RECORD_NAME = 'record_name',
15
- }
16
-
17
- export type EditorAssembly = {
18
- cells: EditorAssemblyCells;
19
- divider: EditorAssemblyDivider;
20
- labels: EditorAssemblyLabels;
21
- ruler: EditorAssemblyRuler;
22
- };
23
-
24
- export type EditorAssemblyCells = {
25
- pathPropertiesMap: Map<Path2D, EditorPathProperties>;
26
- };
27
-
28
- export type EditorAssemblyDivider = {
29
- pathPropertiesMap: Map<Path2D, EditorPathProperties>;
30
- };
31
-
32
- export type EditorAssemblyLabels = {
33
- pathPropertiesMap: Map<Path2D, EditorPathProperties>;
34
- };
35
-
36
- export type EditorAssemblyRuler = {
37
- pathPropertiesMap: Map<Path2D, EditorPathProperties>;
38
- };
39
-
40
- export type EditorPathProperties = {
41
- col: number;
42
- row: number;
43
- type: EDITOR_PATH_PROPERTIES_TYPE.CELL;
44
- } | {
45
- col: number;
46
- type: EDITOR_PATH_PROPERTIES_TYPE.RULER;
47
- } | {
48
- row: number;
49
- type: EDITOR_PATH_PROPERTIES_TYPE.LABEL;
50
- } | {
51
- type: EDITOR_PATH_PROPERTIES_TYPE.DIVIDER;
52
- };
53
-
54
- export type EditorSelection = {
55
- cells?: { // when a rectangular block of cells is selected
56
- endCol: number;
57
- endRow: number;
58
- startCol: number;
59
- startRow: number;
60
- };
61
- cols?: number[]; // when entire columns are selected
62
- rows?: number[]; // when entire rows are selected
63
- };
64
-
65
- /** Metadata describing the currently loaded alignment. */
66
- export type EngineMeta = {
67
- alignmentWidth: number;
68
- redoDepth: number;
69
- sequenceCount: number;
70
- undoDepth: number;
71
- };
72
-
73
- /** A single search match, matching the Rust `search_algorithms::Match`. */
74
- export type EngineSearchMatch = {
75
- col: number;
76
- matrix_type: MATRIX_TYPE;
77
- row: number;
78
- };
79
-
80
- /** Search results, matching the Rust `search_algorithms::SearchResult`. */
81
- export type EngineSearchResult = {
82
- num_matches: number;
83
- positions: EngineSearchMatch[];
84
- query: string;
85
- truncated: boolean;
86
- };
87
-
88
- /**
89
- * Timing breakdown for a single request, measured in milliseconds via
90
- * `performance.now()`. All fields are optional so non-instrumented responses
91
- * (e.g. `ready`) can omit them.
92
- *
93
- * The full call-to-render latency decomposes as:
94
- *
95
- * total = bridgeOut + engineMs + bridgeBack + renderMs
96
- *
97
- * where:
98
- * - `engineMs` : time spent inside the Rust call (measured in worker)
99
- * - `workerMs` : total time the worker held the request, including the
100
- * Rust call + response postMessage setup (measured in worker)
101
- * - `bridgeOut` : main→worker postMessage latency (computed on main thread
102
- * as `workerReceiveTs - sentTs`, see `TimingMarks`)
103
- * - `bridgeBack` : worker→main postMessage latency (computed on main thread
104
- * as `receivedTs - workerDoneTs`)
105
- * - `renderMs` : time from promise resolution to browser paint (measured
106
- * with `requestAnimationFrame` in the harness)
107
- */
108
- export type EngineTiming = {
109
- /** Time inside the Rust engine call (ms). */
110
- engineMs: number;
111
- /** Total time the worker held the request (ms): from receive to postMessage. */
112
- workerMs: number;
113
- };
114
-
115
- /** A fetched viewport or translation slice plus the metadata to interpret it. */
116
- export type EngineViewportResult = {
117
- /** Row-major bytes, transferred from the worker via comlink. */
118
- bytes: Uint8Array;
119
- /** Number of columns per row (may be less than requested if clamped). */
120
- cols: number;
121
- /** Number of rows actually present in `bytes`. */
122
- rows: number;
123
- /** Column index of the first column in the slice. */
124
- startCol: number;
125
- /** Row index of the first row in the slice. */
126
- startRow: number;
127
- };
128
-
129
- /**
130
- * Contract implemented by the `EngineWorker` class and exposed to the main
131
- * thread through comlink. Every method is asynchronous so comlink can proxy it
132
- * across the worker boundary.
133
- */
134
- export interface EngineWorkerApi {
135
- delete: (rows: number[], column: number) => Promise<void>;
136
- deleteColumn: (column: number) => Promise<void>;
137
- exportFasta: () => Promise<string>;
138
- /** Idempotently initializes the WASM engine; resolves once it is ready. */
139
- initialize: () => Promise<void>;
140
- insert: (rows: number[], column: number) => Promise<void>;
141
- load: (fastaContent: string) => Promise<number>;
142
- meta: () => Promise<EngineMeta>;
143
- moveHorizontal: (row: number, columns: number[], direction: MoveDirection) => Promise<void>;
144
- moveRowsDown: (rows: number[]) => Promise<void>;
145
- moveRowsUp: (rows: number[]) => Promise<void>;
146
- mutate: (rows: number[], column: number, base: string) => Promise<void>;
147
- name: (row: number) => Promise<string>;
148
- redo: () => Promise<boolean>;
149
- search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;
150
- translate: (bounds: ViewportBounds, readingFrame: number) => Promise<EngineViewportResult>;
151
- undo: () => Promise<boolean>;
152
- viewport: (bounds: ViewportBounds) => Promise<EngineViewportResult>;
153
- }
154
-
155
-
156
- /**
157
- * Wire protocol between the main thread and the MSA Web Worker.
158
- *
159
- * Design goals:
160
- * - **Zero-copy for binary payloads via SharedArrayBuffer.** Viewport
161
- * responses write into a single SAB created at worker init. The worker
162
- * sends a tiny control message (`{sabLen, data: ViewportResult}`) and the
163
- * main thread reads bytes directly from shared memory — no per-call
164
- * structured clone of binary data.
165
- * - **O(1) response correlation.** Every request carries a monotonically
166
- * increasing `reqId`; the client keeps a `Map<reqId, resolver>` for
167
- * constant-time dispatch.
168
- * - **Typed arrays for index vectors.** Row-index lists travel as
169
- * `Uint32Array` (not `number[]`) to avoid per-element number boxing and to
170
- * match the wasm-bindgen `&[usize]` slice mapping directly.
171
- * - **No JSON for hot paths.** Only small plain objects are structured-cloned;
172
- * binary data is always transferred via the shared SAB.
173
- */
174
-
175
- // ---------------------------------------------------------------------------
176
- // Shared types
177
- // ---------------------------------------------------------------------------
178
-
179
- export type GridGeometry = {
180
- cellHeight: number;
181
- cellWidth: number;
182
- dividerWidth: number;
183
- labelWidth: number;
184
- numOverscanCols: number;
185
- numOverscanRows: number;
186
- rulerHeight: number;
187
- };
188
-
189
- export type GridPoint = {
190
- col: number;
191
- row: number;
192
- surface: 'cell' | 'gutter' | 'ruler';
193
- };
194
-
195
- export type GridRange = {
196
- endCol: number;
197
- endRow: number;
198
- startCol: number;
199
- startRow: number;
200
- };
201
-
202
- export type GridRangeWithRowNames = {
203
- range: GridRange;
204
- rowNames: string[];
205
- };
206
-
207
- export type GridRangeWithViewportResults = {
208
- range: GridRange;
209
- viewportResult: EngineViewportResult;
210
- };
211
-
212
- export type Meta = {
213
- redoDepth: number;
214
- sequences: number;
215
- undoDepth: number;
216
- width: number;
217
- };
218
-
219
- // ---------------------------------------------------------------------------
220
- // Main → Worker requests
221
- // ---------------------------------------------------------------------------
222
-
223
- /**The following types match the Rust `search_algorithms::Match` and search_algorithms::SearchResult structures. */
224
- export type SearchMatch = {
225
- col: number;
226
- matrix_type: MATRIX_TYPE;
227
- row: number;
228
- };
229
-
230
- // ---------------------------------------------------------------------------
231
- // Worker → Main responses
232
- // ---------------------------------------------------------------------------
233
-
234
- export type SearchResult = EngineSearchResult;
235
-
236
- /** Summary statistics for a set of measured values. */
237
- export type Stats = {
238
- count: number;
239
- max: number;
240
- mean: number;
241
- median: number;
242
- min: number;
243
- p95: number;
244
- };
245
-
246
- export type StatusBarSelectionStats = {
247
- cols: number;
248
- pos: number;
249
- selectedSeqs: number;
250
- totalSelectedChars: number;
251
- };
252
-
253
- /** Inclusive column/row bounds for a viewport or translation request. */
254
- export type ViewportBounds = {
255
- endCol: number;
256
- endRow: number;
257
- startCol: number;
258
- startRow: number;
259
- };
260
-
261
- /** A fetched viewport slice plus the metadata needed to interpret it. */
262
- export type ViewportResult = {
263
- /** Number of columns per row (may be less than requested if clamped). */
264
- cols: number;
265
- /** Number of rows actually present in `bytes`. */
266
- rows: number;
267
- /** Column index of the first column in the slice. */
268
- startCol: number;
269
- /** Row index of the first row in the slice. */
270
- startRow: number;
271
- };
272
-
273
- export type VisibleGridRange = {
274
- cache: GridRange;
275
- visible: GridRange;
276
- };
277
-
278
- export type VisibleGridRangeWithArguments = {
279
- geometry: GridGeometry;
280
- scrollLeft: number;
281
- scrollTop: number;
282
- viewportHeight: number;
283
- viewportWidth: number;
284
- visibleGridRange: VisibleGridRange;
285
- };
286
-
287
- /** Debug info exposed to the scrolling viewport status bar. */
288
- export type WindowInfo = {
289
- bufBytes: number;
290
- bufEnd: number;
291
- bufStart: number;
292
- fetching: boolean;
293
- visEnd: number;
294
- visStart: number;
295
- };
@@ -1,68 +0,0 @@
1
- // eslint-disable-next-line @typescript-eslint/naming-convention
2
- export enum AminoAcidSymbol {
3
- A = 'A',
4
- C = 'C',
5
- D = 'D',
6
- E = 'E',
7
- F = 'F',
8
- G = 'G',
9
- GAP = '-',
10
- H = 'H',
11
- I = 'I',
12
- K = 'K',
13
- L = 'L',
14
- M = 'M',
15
- N = 'N',
16
- P = 'P',
17
- Q = 'Q',
18
- R = 'R',
19
- S = 'S',
20
- STOP = '*',
21
- T = 'T',
22
- V = 'V',
23
- W = 'W',
24
- X = 'X',
25
- Y = 'Y',
26
- }
27
-
28
- // eslint-disable-next-line @typescript-eslint/naming-convention
29
- export enum NucleotideSymbol {
30
- A = 'A',
31
- B = 'B',
32
- C = 'C',
33
- D = 'D',
34
- G = 'G',
35
- GAP = '-',
36
- H = 'H',
37
- K = 'K',
38
- M = 'M',
39
- N = 'N',
40
- R = 'R',
41
- S = 'S',
42
- T = 'T',
43
- U = 'U',
44
- UNKNOWN = 'X',
45
- V = 'V',
46
- W = 'W',
47
- Y = 'Y',
48
- }
49
-
50
- export type AminoAcidPalette = {
51
- name: string;
52
- paletteColors: AminoAcidPaletteColors;
53
- };
54
- export type AminoAcidPaletteColors = Record<AminoAcidSymbol, PaletteEntry>;
55
-
56
- export type NucleotidePalette = {
57
- name: string;
58
- paletteColors: NucleotidePaletteColors;
59
- };
60
-
61
- export type NucleotidePaletteColors = Record<NucleotideSymbol, PaletteEntry>;
62
-
63
- export type PaletteEntry = {
64
- background: string;
65
- backgroundSelected: string;
66
- foreground: string;
67
- foregroundSelected: string;
68
- };