@rivm-loculus-tools/sequence-editor 0.1.4 → 0.1.5
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/dist/_chunks/Box.js +6737 -0
- package/dist/_chunks/Box.js.map +1 -0
- package/dist/_chunks/Close.js +7 -0
- package/dist/_chunks/Close.js.map +1 -0
- package/dist/_chunks/EditorWorkerService.js +126 -0
- package/dist/_chunks/EditorWorkerService.js.map +1 -0
- package/dist/_chunks/KeyboardArrowDown.js +1023 -0
- package/dist/_chunks/KeyboardArrowDown.js.map +1 -0
- package/dist/_chunks/Redo.js +2559 -0
- package/dist/_chunks/Redo.js.map +1 -0
- package/dist/_chunks/SequenceEditor.js +860 -0
- package/dist/_chunks/SequenceEditor.js.map +1 -0
- package/dist/_chunks/SequenceEditorEventBusService.js +102 -0
- package/dist/_chunks/SequenceEditorEventBusService.js.map +1 -0
- package/dist/_chunks/SequenceEditorMainPage.js +552 -0
- package/dist/_chunks/SequenceEditorMainPage.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js +49842 -0
- package/dist/_chunks/SequenceEditorPageDrawer.js.map +1 -0
- package/dist/_chunks/SequenceEditorPageHeader.js +236 -0
- package/dist/_chunks/SequenceEditorPageHeader.js.map +1 -0
- package/dist/_chunks/SequenceEditorSearchBar.js +143 -0
- package/dist/_chunks/SequenceEditorSearchBar.js.map +1 -0
- package/dist/_chunks/TestIdUtil.js +4695 -0
- package/dist/_chunks/TestIdUtil.js.map +1 -0
- package/dist/_chunks/TextField.js +3083 -0
- package/dist/_chunks/TextField.js.map +1 -0
- package/dist/_chunks/rolldown-runtime.js +13 -0
- package/dist/_chunks/sequenceEditorStore.js +407 -0
- package/dist/_chunks/sequenceEditorStore.js.map +1 -0
- package/dist/_chunks/sequence_editor.js +517 -0
- package/dist/_chunks/sequence_editor.js.map +1 -0
- package/dist/_chunks/withDialog.js +289 -0
- package/dist/_chunks/withDialog.js.map +1 -0
- package/dist/assets/index-C5rc-pJV.js +8 -0
- package/dist/assets/index-C5rc-pJV.js.map +1 -0
- package/dist/classes/services/EditorWorkerService/EditorWorkerService.d.ts +27 -0
- package/dist/classes/services/EditorWorkerService/index.js +2 -0
- package/dist/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.d.ts +25 -0
- package/dist/classes/services/SequenceEditorEventBusService/index.js +2 -0
- package/dist/classes/workers/EngineWorker/EngineWorker.d.ts +46 -0
- package/dist/classes/workers/EngineWorker/index.js +110 -0
- package/dist/classes/workers/EngineWorker/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +1 -0
- package/dist/components/app/App/index.js +957 -0
- package/dist/components/app/App/index.js.map +1 -0
- package/dist/components/pages/EmptyWorkspace.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.d.ts +3 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js +12 -0
- package/dist/components/pages/SequenceEditorErrorPage/index.js.map +1 -0
- package/dist/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.d.ts +1 -0
- package/dist/components/pages/SequenceEditorMainPage/index.js +2 -0
- package/dist/components/ui/SequenceEditor/SequenceEditor.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.d.ts +8 -0
- package/dist/components/ui/SequenceEditor/SequenceEditorStatusBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditor/index.js +2 -0
- package/dist/components/ui/SequenceEditorPage/SequenceEditorPage.d.ts +5 -0
- package/dist/components/ui/SequenceEditorPage/index.js +15 -0
- package/dist/components/ui/SequenceEditorPage/index.js.map +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.d.ts +7 -0
- package/dist/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageDrawer/index.js +2 -0
- package/dist/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.d.ts +1 -0
- package/dist/components/ui/SequenceEditorPageHeader/index.js +2 -0
- package/dist/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.d.ts +1 -0
- package/dist/components/ui/SequenceEditorSearchBar/index.js +2 -0
- package/dist/constants/editor.d.ts +4 -0
- package/dist/constants/editor.js +14 -0
- package/dist/constants/editor.js.map +1 -0
- package/dist/constants/index.js +4 -0
- package/dist/constants/keyboard.d.ts +10 -0
- package/dist/constants/keyboard.js +179 -0
- package/dist/constants/keyboard.js.map +1 -0
- package/dist/constants/palette.d.ts +15 -0
- package/dist/constants/palette.js +196 -0
- package/dist/constants/palette.js.map +1 -0
- package/dist/models/editor.d.ts +6 -0
- package/dist/models/editor.js +8 -0
- package/dist/models/editor.js.map +1 -0
- package/dist/models/model.d.ts +250 -0
- package/dist/models/model.js +10 -0
- package/dist/models/model.js.map +1 -0
- package/dist/models/palette.d.ts +61 -0
- package/dist/models/palette.js +10 -0
- package/dist/models/palette.js.map +1 -0
- package/dist/stores/sequenceEditorStore/index.js +2 -0
- package/dist/stores/sequenceEditorStore/sequenceEditorStore.d.ts +36 -0
- package/dist/utils/EditorUtil/EditorUtil.d.ts +96 -0
- package/dist/utils/EditorUtil/index.js +544 -0
- package/dist/utils/EditorUtil/index.js.map +1 -0
- package/dist/utils/EngineErrorUtil/EngineErrorUtil.d.ts +4 -0
- package/dist/utils/PaletteUtil/PaletteUtil.d.ts +6 -0
- package/dist/utils/PaletteUtil/index.js +19 -0
- package/dist/utils/PaletteUtil/index.js.map +1 -0
- package/package.json +5 -2
- package/.gitkeep +0 -0
- package/CHANGELOG.md +0 -37
- package/eslint.config.js +0 -16
- package/scripts/update-exports.js +0 -9
- package/src/classes/services/EditorWorkerService/EditorWorkerService.ts +0 -163
- package/src/classes/services/SequenceEditorEventBusService/SequenceEditorEventBusService.ts +0 -37
- package/src/classes/workers/EngineWorker/EngineWorker.ts +0 -196
- package/src/components/app/App/App.tsx +0 -22
- package/src/components/pages/EmptyWorkspace.tsx +0 -43
- package/src/components/pages/SequenceEditorErrorPage/SequenceEditorErrorPage.tsx +0 -16
- package/src/components/pages/SequenceEditorMainPage/SequenceEditorMainPage.tsx +0 -76
- package/src/components/ui/SequenceEditor/SequenceEditor.tsx +0 -896
- package/src/components/ui/SequenceEditor/SequenceEditorGotoPositionDialog.tsx +0 -108
- package/src/components/ui/SequenceEditor/SequenceEditorStatusBar.tsx +0 -72
- package/src/components/ui/SequenceEditorPage/SequenceEditorPage.tsx +0 -23
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawer.tsx +0 -234
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerColorForm.tsx +0 -73
- package/src/components/ui/SequenceEditorPageDrawer/SequenceEditorPageDrawerKeyboardShortcuts.tsx +0 -230
- package/src/components/ui/SequenceEditorPageHeader/SequenceEditorPageHeader.tsx +0 -71
- package/src/components/ui/SequenceEditorSearchBar/SequenceEditorSearchBar.tsx +0 -35
- package/src/constants/editor.ts +0 -15
- package/src/constants/keyboard.ts +0 -154
- package/src/constants/palette.ts +0 -227
- package/src/models/editor.ts +0 -6
- package/src/models/model.ts +0 -295
- package/src/models/palette.ts +0 -68
- package/src/stores/sequenceEditorStore/sequenceEditorStore.ts +0 -103
- package/src/utils/EditorUtil/EditorUtil.ts +0 -892
- package/src/utils/EngineErrorUtil/EngineErrorUtil.ts +0 -25
- package/src/utils/PaletteUtil/PaletteUtil.ts +0 -31
- package/tsconfig.build.json +0 -14
- package/tsconfig.json +0 -32
- package/vite.config.ts +0 -177
- /package/{src/classes/services/EditorWorkerService/index.ts → dist/classes/services/EditorWorkerService/index.d.ts} +0 -0
- /package/{src/classes/services/SequenceEditorEventBusService/index.ts → dist/classes/services/SequenceEditorEventBusService/index.d.ts} +0 -0
- /package/{src/classes/workers/EngineWorker/index.ts → dist/classes/workers/EngineWorker/index.d.ts} +0 -0
- /package/{src/components/app/App/index.ts → dist/components/app/App/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorErrorPage/index.ts → dist/components/pages/SequenceEditorErrorPage/index.d.ts} +0 -0
- /package/{src/components/pages/SequenceEditorMainPage/index.ts → dist/components/pages/SequenceEditorMainPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditor/index.ts → dist/components/ui/SequenceEditor/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPage/index.ts → dist/components/ui/SequenceEditorPage/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageDrawer/index.ts → dist/components/ui/SequenceEditorPageDrawer/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorPageHeader/index.ts → dist/components/ui/SequenceEditorPageHeader/index.d.ts} +0 -0
- /package/{src/components/ui/SequenceEditorSearchBar/index.ts → dist/components/ui/SequenceEditorSearchBar/index.d.ts} +0 -0
- /package/{src/constants/index.ts → dist/constants/index.d.ts} +0 -0
- /package/{src/models/index.ts → dist/models/index.d.ts} +0 -0
- /package/{src/stores/sequenceEditorStore/index.ts → dist/stores/sequenceEditorStore/index.d.ts} +0 -0
- /package/{src/utils/EditorUtil/index.ts → dist/utils/EditorUtil/index.d.ts} +0 -0
- /package/{src/utils/PaletteUtil/index.ts → dist/utils/PaletteUtil/index.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","names":[],"sources":["../../src/constants/palette.ts"],"sourcesContent":["import {\n AminoAcidSymbol,\n NucleotideSymbol,\n} from '../models/palette';\nimport type {\n AminoAcidPalette,\n AminoAcidPaletteColors,\n NucleotidePalette,\n NucleotidePaletteColors,\n} from '../models/palette';\nimport { PaletteUtil } from '../utils/PaletteUtil';\n\nexport const NUCLEOTIDE_SYMBOLS: readonly NucleotideSymbol[] = [\n NucleotideSymbol.A,\n NucleotideSymbol.C,\n NucleotideSymbol.G,\n NucleotideSymbol.T,\n NucleotideSymbol.U,\n NucleotideSymbol.R,\n NucleotideSymbol.Y,\n NucleotideSymbol.S,\n NucleotideSymbol.W,\n NucleotideSymbol.K,\n NucleotideSymbol.M,\n NucleotideSymbol.B,\n NucleotideSymbol.D,\n NucleotideSymbol.H,\n NucleotideSymbol.V,\n NucleotideSymbol.N,\n NucleotideSymbol.GAP,\n NucleotideSymbol.UNKNOWN,\n] as const;\n\nexport const AMINO_ACID_SYMBOLS: readonly AminoAcidSymbol[] = [\n AminoAcidSymbol.A,\n AminoAcidSymbol.C,\n AminoAcidSymbol.D,\n AminoAcidSymbol.E,\n AminoAcidSymbol.F,\n AminoAcidSymbol.G,\n AminoAcidSymbol.H,\n AminoAcidSymbol.I,\n AminoAcidSymbol.K,\n AminoAcidSymbol.L,\n AminoAcidSymbol.M,\n AminoAcidSymbol.N,\n AminoAcidSymbol.P,\n AminoAcidSymbol.Q,\n AminoAcidSymbol.R,\n AminoAcidSymbol.S,\n AminoAcidSymbol.T,\n AminoAcidSymbol.V,\n AminoAcidSymbol.W,\n AminoAcidSymbol.Y,\n AminoAcidSymbol.X,\n AminoAcidSymbol.STOP,\n AminoAcidSymbol.GAP,\n] as const;\n\nexport const ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {\n [AminoAcidSymbol.A]: PaletteUtil.createEntry('#276EB7', '#000000', '#3769FF', '#808080'),\n [AminoAcidSymbol.C]: PaletteUtil.createEntry('#E68080', '#000000', '#FFB6B6', '#808080'),\n [AminoAcidSymbol.D]: PaletteUtil.createEntry('#CC4DCC', '#000000', '#FF6EFF', '#808080'),\n [AminoAcidSymbol.E]: PaletteUtil.createEntry('#984097', '#000000', '#D95BD7', '#808080'),\n [AminoAcidSymbol.F]: PaletteUtil.createEntry('#1980E6', '#000000', '#23B6FF', '#808080'),\n [AminoAcidSymbol.G]: PaletteUtil.createEntry('#E6994D', '#000000', '#FFDA6E', '#808080'),\n [AminoAcidSymbol.GAP]: PaletteUtil.createEntry('#E6E6E6', '#404040', '#FFFFFF', '#808080'),\n [AminoAcidSymbol.H]: PaletteUtil.createEntry('#19B3B3', '#000000', '#23FFFF', '#808080'),\n [AminoAcidSymbol.I]: PaletteUtil.createEntry('#4EA0F3', '#000000', '#6FE4FF', '#808080'),\n [AminoAcidSymbol.K]: PaletteUtil.createEntry('#E63319', '#000000', '#FF4823', '#808080'),\n [AminoAcidSymbol.L]: PaletteUtil.createEntry('#78A6D5', '#000000', '#ABEDFF', '#808080'),\n [AminoAcidSymbol.M]: PaletteUtil.createEntry('#0F549B', '#000000', '#1578DD', '#808080'),\n [AminoAcidSymbol.N]: PaletteUtil.createEntry('#19CC19', '#000000', '#23FF23', '#808080'),\n [AminoAcidSymbol.P]: PaletteUtil.createEntry('#CCCC00', '#000000', '#FFFF00', '#808080'),\n [AminoAcidSymbol.Q]: PaletteUtil.createEntry('#5CED5C', '#000000', '#83FF83', '#808080'),\n [AminoAcidSymbol.R]: PaletteUtil.createEntry('#F6442C', '#000000', '#FF613E', '#808080'),\n [AminoAcidSymbol.S]: PaletteUtil.createEntry('#029602', '#000000', '#03D603', '#808080'),\n [AminoAcidSymbol.STOP]: PaletteUtil.createEntry('#404040', '#00FFFF', '#5B5B5B', '#808080'),\n [AminoAcidSymbol.T]: PaletteUtil.createEntry('#45C945', '#000000', '#62FF62', '#808080'),\n [AminoAcidSymbol.V]: PaletteUtil.createEntry('#047DF9', '#000000', '#05B2FF', '#808080'),\n [AminoAcidSymbol.W]: PaletteUtil.createEntry('#0355A9', '#000000', '#0479F1', '#808080'),\n [AminoAcidSymbol.X]: PaletteUtil.createEntry('#FFFFFF', '#00FFFF', '#FFFFFF', '#808080'),\n [AminoAcidSymbol.Y]: PaletteUtil.createEntry('#14C6C8', '#000000', '#1CFFFF', '#808080'),\n};\n\nexport const ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {\n [NucleotideSymbol.A]: PaletteUtil.createEntry('#5ADC5A', '#018001', '#058705', '#97FF97'),\n [NucleotideSymbol.B]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.C]: PaletteUtil.createEntry('#6464FA', '#0101FF', '#0F0FA5', '#9797FF'),\n [NucleotideSymbol.D]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.G]: PaletteUtil.createEntry('#5A5A5A', '#000000', '#050505', '#969696'),\n [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#FAFAFA', '#868686', '#A5A5A5', '#FFFFFF'),\n [NucleotideSymbol.H]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.K]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.M]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.N]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.R]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.S]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.T]: PaletteUtil.createEntry('#F58282', '#FF0101', '#A02D2D', '#FF9797'),\n [NucleotideSymbol.U]: PaletteUtil.createEntry('#F58282', '#FF0101', '#A02D2D', '#FF9797'),\n [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#FFFFFF', '#00FFFF', '#AAAAAA', '#96FFFF'),\n [NucleotideSymbol.V]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.W]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n [NucleotideSymbol.Y]: PaletteUtil.createEntry('#FFFFFF', '#FF00FF', '#AAAAAA', '#FF96FF'),\n};\n\nexport const ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {\n ...ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS,\n [NucleotideSymbol.A]: PaletteUtil.createEntry('#5ADC5A', '#2C2C2C', '#058705', '#1E1E1E'),\n [NucleotideSymbol.B]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.C]: PaletteUtil.createEntry('#6464FA', '#2C2C2C', '#0F0FA5', '#1E1E1E'),\n [NucleotideSymbol.D]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.G]: PaletteUtil.createEntry('#5A5A5A', '#2C2C2C', '#050505', '#1E1E1E'),\n [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#FAFAFA', '#2C2C2C', '#A5A5A5', '#1E1E1E'),\n [NucleotideSymbol.H]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.K]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.M]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.N]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.R]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.S]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.T]: PaletteUtil.createEntry('#F58282', '#2C2C2C', '#A02D2D', '#1E1E1E'),\n [NucleotideSymbol.U]: PaletteUtil.createEntry('#F58282', '#2C2C2C', '#A02D2D', '#1E1E1E'),\n [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.V]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.W]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n [NucleotideSymbol.Y]: PaletteUtil.createEntry('#FFFFFF', '#2C2C2C', '#AAAAAA', '#1E1E1E'),\n};\n\nexport const ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS: NucleotidePaletteColors = {\n [NucleotideSymbol.A]: PaletteUtil.createEntry('#FF0000', '#000000', '#870000', '#040404'),\n [NucleotideSymbol.B]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.C]: PaletteUtil.createEntry('#00FF00', '#000000', '#008700', '#040404'),\n [NucleotideSymbol.D]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.G]: PaletteUtil.createEntry('#FFFF00', '#000000', '#878700', '#040404'),\n [NucleotideSymbol.GAP]: PaletteUtil.createEntry('#E0E0E0', '#000000', '#9B9B9B', '#040404'),\n [NucleotideSymbol.H]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.K]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.M]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.N]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.R]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.S]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.T]: PaletteUtil.createEntry('#0000FF', '#000000', '#000087', '#040404'),\n [NucleotideSymbol.U]: PaletteUtil.createEntry('#0000FF', '#000000', '#000087', '#040404'),\n [NucleotideSymbol.UNKNOWN]: PaletteUtil.createEntry('#E0E0E0', '#00FFFF', '#9B9B9B', '#040404'),\n [NucleotideSymbol.V]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.W]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n [NucleotideSymbol.Y]: PaletteUtil.createEntry('#9D9D9D', '#000000', '#6D6D6D', '#040404'),\n};\n\nexport const ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {\n ...ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS,\n};\n\nconst ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS: Record<string, string> = {\n A: '#80B3E6',\n C: '#80B3E6',\n D: '#CC4DCC',\n E: '#CC4DCC',\n F: '#80B3E6',\n G: '#E6994D',\n H: '#1AB3B3',\n I: '#80B3E6',\n K: '#E6331A',\n L: '#80B3E6',\n M: '#80B3E6',\n N: '#1ACC1A',\n P: '#CCCC00',\n Q: '#1ACC1A',\n R: '#E6331A',\n S: '#1ACC1A',\n T: '#1ACC1A',\n V: '#80B3E6',\n W: '#80B3E6',\n Y: '#1AB3B3',\n};\n\nexport const ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS: AminoAcidPaletteColors = {\n [AminoAcidSymbol.A]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.A, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.A, '#FFFFFF'),\n [AminoAcidSymbol.C]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.C, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.C, '#FFFFFF'),\n [AminoAcidSymbol.D]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.D, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.D, '#FFFFFF'),\n [AminoAcidSymbol.E]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.E, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.E, '#FFFFFF'),\n [AminoAcidSymbol.F]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.F, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.F, '#FFFFFF'),\n [AminoAcidSymbol.G]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.G, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.G, '#FFFFFF'),\n [AminoAcidSymbol.GAP]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),\n [AminoAcidSymbol.H]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.H, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.H, '#FFFFFF'),\n [AminoAcidSymbol.I]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.I, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.I, '#FFFFFF'),\n [AminoAcidSymbol.K]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.K, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.K, '#FFFFFF'),\n [AminoAcidSymbol.L]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.L, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.L, '#FFFFFF'),\n [AminoAcidSymbol.M]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.M, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.M, '#FFFFFF'),\n [AminoAcidSymbol.N]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.N, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.N, '#FFFFFF'),\n [AminoAcidSymbol.P]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.P, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.P, '#FFFFFF'),\n [AminoAcidSymbol.Q]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Q, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Q, '#FFFFFF'),\n [AminoAcidSymbol.R]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.R, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.R, '#FFFFFF'),\n [AminoAcidSymbol.S]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.S, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.S, '#FFFFFF'),\n [AminoAcidSymbol.STOP]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),\n [AminoAcidSymbol.T]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.T, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.T, '#FFFFFF'),\n [AminoAcidSymbol.V]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.V, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.V, '#FFFFFF'),\n [AminoAcidSymbol.W]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.W, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.W, '#FFFFFF'),\n [AminoAcidSymbol.X]: PaletteUtil.createEntry('#FFFFFF', '#000000', '#868686', '#FFFFFF'),\n [AminoAcidSymbol.Y]: PaletteUtil.createEntry(ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Y, '#000000', ALI_VIEW_CLUSTAL_X_AMINO_ACID_COLORS.Y, '#FFFFFF'),\n};\n\nexport const ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE: NucleotidePalette = {\n name: 'Default',\n paletteColors: ALI_VIEW_DEFAULT_NUCLEOTIDE_PALETTE_COLORS,\n};\nexport const ALI_VIEW_FAST_NUCLEOTIDE_PALETTE: NucleotidePalette = {\n name: 'Fast',\n paletteColors: ALI_VIEW_FAST_NUCLEOTIDE_PALETTE_COLORS,\n};\nexport const ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE: NucleotidePalette = {\n name: 'SeaView',\n paletteColors: ALI_VIEW_SEA_VIEW_NUCLEOTIDE_PALETTE_COLORS,\n};\n\nexport const ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE: AminoAcidPalette = {\n name: 'Default',\n paletteColors: ALI_VIEW_DEFAULT_AMINO_ACID_PALETTE_COLORS,\n};\nexport const ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE: AminoAcidPalette = {\n name: 'SeaView',\n paletteColors: ALI_VIEW_SEA_VIEW_AMINO_ACID_PALETTE_COLORS,\n};\nexport const ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE: AminoAcidPalette = {\n name: 'Clustal X',\n paletteColors: ALI_VIEW_CLUSTAL_X_AMINO_ACID_PALETTE_COLORS,\n};\n"],"mappings":";;;AAYA,IAAa,IAAkD;CAC7D,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB,EAAiB;CACjB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,EAAqC,GAAG,SAAS;EAChJ,EAAgB,OAAO,EAAY,YAAY,WAAW,WAAW,WAAW,SAAS;EACzF,EAAgB,IAAI,EAAY,YAAY,EAAqC,GAAG,WAAW,EAAqC,GAAG,SAAS;EAChJ,EAAgB,IAAI,EAAY,YAAY,EAAqC,GAAG,WAAW,EAAqC,GAAG,SAAS;EAChJ,EAAgB,IAAI,EAAY,YAAY,EAAqC,GAAG,WAAW,EAAqC,GAAG,SAAS;EAChJ,EAAgB,IAAI,EAAY,YAAY,WAAW,WAAW,WAAW,SAAS;EACtF,EAAgB,IAAI,EAAY,YAAY,EAAqC,GAAG,WAAW,EAAqC,GAAG,SAAS;AACnJ,GAEa,IAAyD;CACpE,MAAM;CACN,eAAe;AACjB,GACa,IAAsD;CACjE,MAAM;CACN,eAAe;AACjB,GACa,IAA0D;CACrE,MAAM;CACN,eAAe;AACjB,GAEa,IAAwD;CACnE,MAAM;CACN,eAAe;AACjB,GACa,IAAyD;CACpE,MAAM;CACN,eAAe;AACjB,GACa,IAA0D;CACrE,MAAM;CACN,eAAe;AACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor.js","names":[],"sources":["../../src/models/editor.ts"],"sourcesContent":["export enum EDITOR_DIRECTION {\n DOWN = 'DOWN',\n LEFT = 'LEFT',\n RIGHT = 'RIGHT',\n UP = 'UP',\n}\n"],"mappings":";AAAA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,OAAA,QACA,EAAA,QAAA,SACA,EAAA,KAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';
|
|
2
|
+
export declare enum EDITOR_PATH_PROPERTIES_TYPE {
|
|
3
|
+
CELL = "CELL",
|
|
4
|
+
DIVIDER = "DIVIDER",
|
|
5
|
+
LABEL = "LABEL",
|
|
6
|
+
RULER = "RULER"
|
|
7
|
+
}
|
|
8
|
+
export declare enum MATRIX_TYPE {
|
|
9
|
+
AMINO_ACID = "amino_acid",
|
|
10
|
+
NUCLEOTIDE = "nucleotide",
|
|
11
|
+
RECORD_NAME = "record_name"
|
|
12
|
+
}
|
|
13
|
+
export type EditorAssembly = {
|
|
14
|
+
cells: EditorAssemblyCells;
|
|
15
|
+
divider: EditorAssemblyDivider;
|
|
16
|
+
labels: EditorAssemblyLabels;
|
|
17
|
+
ruler: EditorAssemblyRuler;
|
|
18
|
+
};
|
|
19
|
+
export type EditorAssemblyCells = {
|
|
20
|
+
pathPropertiesMap: Map<Path2D, EditorPathProperties>;
|
|
21
|
+
};
|
|
22
|
+
export type EditorAssemblyDivider = {
|
|
23
|
+
pathPropertiesMap: Map<Path2D, EditorPathProperties>;
|
|
24
|
+
};
|
|
25
|
+
export type EditorAssemblyLabels = {
|
|
26
|
+
pathPropertiesMap: Map<Path2D, EditorPathProperties>;
|
|
27
|
+
};
|
|
28
|
+
export type EditorAssemblyRuler = {
|
|
29
|
+
pathPropertiesMap: Map<Path2D, EditorPathProperties>;
|
|
30
|
+
};
|
|
31
|
+
export type EditorPathProperties = {
|
|
32
|
+
col: number;
|
|
33
|
+
row: number;
|
|
34
|
+
type: EDITOR_PATH_PROPERTIES_TYPE.CELL;
|
|
35
|
+
} | {
|
|
36
|
+
col: number;
|
|
37
|
+
type: EDITOR_PATH_PROPERTIES_TYPE.RULER;
|
|
38
|
+
} | {
|
|
39
|
+
row: number;
|
|
40
|
+
type: EDITOR_PATH_PROPERTIES_TYPE.LABEL;
|
|
41
|
+
} | {
|
|
42
|
+
type: EDITOR_PATH_PROPERTIES_TYPE.DIVIDER;
|
|
43
|
+
};
|
|
44
|
+
export type EditorSelection = {
|
|
45
|
+
cells?: {
|
|
46
|
+
endCol: number;
|
|
47
|
+
endRow: number;
|
|
48
|
+
startCol: number;
|
|
49
|
+
startRow: number;
|
|
50
|
+
};
|
|
51
|
+
cols?: number[];
|
|
52
|
+
rows?: number[];
|
|
53
|
+
};
|
|
54
|
+
/** Metadata describing the currently loaded alignment. */
|
|
55
|
+
export type EngineMeta = {
|
|
56
|
+
alignmentWidth: number;
|
|
57
|
+
redoDepth: number;
|
|
58
|
+
sequenceCount: number;
|
|
59
|
+
undoDepth: number;
|
|
60
|
+
};
|
|
61
|
+
/** A single search match, matching the Rust `search_algorithms::Match`. */
|
|
62
|
+
export type EngineSearchMatch = {
|
|
63
|
+
col: number;
|
|
64
|
+
matrix_type: MATRIX_TYPE;
|
|
65
|
+
row: number;
|
|
66
|
+
};
|
|
67
|
+
/** Search results, matching the Rust `search_algorithms::SearchResult`. */
|
|
68
|
+
export type EngineSearchResult = {
|
|
69
|
+
num_matches: number;
|
|
70
|
+
positions: EngineSearchMatch[];
|
|
71
|
+
query: string;
|
|
72
|
+
truncated: boolean;
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Timing breakdown for a single request, measured in milliseconds via
|
|
76
|
+
* `performance.now()`. All fields are optional so non-instrumented responses
|
|
77
|
+
* (e.g. `ready`) can omit them.
|
|
78
|
+
*
|
|
79
|
+
* The full call-to-render latency decomposes as:
|
|
80
|
+
*
|
|
81
|
+
* total = bridgeOut + engineMs + bridgeBack + renderMs
|
|
82
|
+
*
|
|
83
|
+
* where:
|
|
84
|
+
* - `engineMs` : time spent inside the Rust call (measured in worker)
|
|
85
|
+
* - `workerMs` : total time the worker held the request, including the
|
|
86
|
+
* Rust call + response postMessage setup (measured in worker)
|
|
87
|
+
* - `bridgeOut` : main→worker postMessage latency (computed on main thread
|
|
88
|
+
* as `workerReceiveTs - sentTs`, see `TimingMarks`)
|
|
89
|
+
* - `bridgeBack` : worker→main postMessage latency (computed on main thread
|
|
90
|
+
* as `receivedTs - workerDoneTs`)
|
|
91
|
+
* - `renderMs` : time from promise resolution to browser paint (measured
|
|
92
|
+
* with `requestAnimationFrame` in the harness)
|
|
93
|
+
*/
|
|
94
|
+
export type EngineTiming = {
|
|
95
|
+
/** Time inside the Rust engine call (ms). */
|
|
96
|
+
engineMs: number;
|
|
97
|
+
/** Total time the worker held the request (ms): from receive to postMessage. */
|
|
98
|
+
workerMs: number;
|
|
99
|
+
};
|
|
100
|
+
/** A fetched viewport or translation slice plus the metadata to interpret it. */
|
|
101
|
+
export type EngineViewportResult = {
|
|
102
|
+
/** Row-major bytes, transferred from the worker via comlink. */
|
|
103
|
+
bytes: Uint8Array;
|
|
104
|
+
/** Number of columns per row (may be less than requested if clamped). */
|
|
105
|
+
cols: number;
|
|
106
|
+
/** Number of rows actually present in `bytes`. */
|
|
107
|
+
rows: number;
|
|
108
|
+
/** Column index of the first column in the slice. */
|
|
109
|
+
startCol: number;
|
|
110
|
+
/** Row index of the first row in the slice. */
|
|
111
|
+
startRow: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Contract implemented by the `EngineWorker` class and exposed to the main
|
|
115
|
+
* thread through comlink. Every method is asynchronous so comlink can proxy it
|
|
116
|
+
* across the worker boundary.
|
|
117
|
+
*/
|
|
118
|
+
export interface EngineWorkerApi {
|
|
119
|
+
delete: (rows: number[], column: number) => Promise<void>;
|
|
120
|
+
deleteColumn: (column: number) => Promise<void>;
|
|
121
|
+
exportFasta: () => Promise<string>;
|
|
122
|
+
/** Idempotently initializes the WASM engine; resolves once it is ready. */
|
|
123
|
+
initialize: () => Promise<void>;
|
|
124
|
+
insert: (rows: number[], column: number) => Promise<void>;
|
|
125
|
+
load: (fastaContent: string) => Promise<number>;
|
|
126
|
+
meta: () => Promise<EngineMeta>;
|
|
127
|
+
moveHorizontal: (row: number, columns: number[], direction: MoveDirection) => Promise<void>;
|
|
128
|
+
moveRowsDown: (rows: number[]) => Promise<void>;
|
|
129
|
+
moveRowsUp: (rows: number[]) => Promise<void>;
|
|
130
|
+
mutate: (rows: number[], column: number, base: string) => Promise<void>;
|
|
131
|
+
name: (row: number) => Promise<string>;
|
|
132
|
+
redo: () => Promise<boolean>;
|
|
133
|
+
search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;
|
|
134
|
+
translate: (bounds: ViewportBounds, readingFrame: number) => Promise<EngineViewportResult>;
|
|
135
|
+
undo: () => Promise<boolean>;
|
|
136
|
+
viewport: (bounds: ViewportBounds) => Promise<EngineViewportResult>;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Wire protocol between the main thread and the MSA Web Worker.
|
|
140
|
+
*
|
|
141
|
+
* Design goals:
|
|
142
|
+
* - **Zero-copy for binary payloads via SharedArrayBuffer.** Viewport
|
|
143
|
+
* responses write into a single SAB created at worker init. The worker
|
|
144
|
+
* sends a tiny control message (`{sabLen, data: ViewportResult}`) and the
|
|
145
|
+
* main thread reads bytes directly from shared memory — no per-call
|
|
146
|
+
* structured clone of binary data.
|
|
147
|
+
* - **O(1) response correlation.** Every request carries a monotonically
|
|
148
|
+
* increasing `reqId`; the client keeps a `Map<reqId, resolver>` for
|
|
149
|
+
* constant-time dispatch.
|
|
150
|
+
* - **Typed arrays for index vectors.** Row-index lists travel as
|
|
151
|
+
* `Uint32Array` (not `number[]`) to avoid per-element number boxing and to
|
|
152
|
+
* match the wasm-bindgen `&[usize]` slice mapping directly.
|
|
153
|
+
* - **No JSON for hot paths.** Only small plain objects are structured-cloned;
|
|
154
|
+
* binary data is always transferred via the shared SAB.
|
|
155
|
+
*/
|
|
156
|
+
export type GridGeometry = {
|
|
157
|
+
cellHeight: number;
|
|
158
|
+
cellWidth: number;
|
|
159
|
+
dividerWidth: number;
|
|
160
|
+
labelWidth: number;
|
|
161
|
+
numOverscanCols: number;
|
|
162
|
+
numOverscanRows: number;
|
|
163
|
+
rulerHeight: number;
|
|
164
|
+
};
|
|
165
|
+
export type GridPoint = {
|
|
166
|
+
col: number;
|
|
167
|
+
row: number;
|
|
168
|
+
surface: 'cell' | 'gutter' | 'ruler';
|
|
169
|
+
};
|
|
170
|
+
export type GridRange = {
|
|
171
|
+
endCol: number;
|
|
172
|
+
endRow: number;
|
|
173
|
+
startCol: number;
|
|
174
|
+
startRow: number;
|
|
175
|
+
};
|
|
176
|
+
export type GridRangeWithRowNames = {
|
|
177
|
+
range: GridRange;
|
|
178
|
+
rowNames: string[];
|
|
179
|
+
};
|
|
180
|
+
export type GridRangeWithViewportResults = {
|
|
181
|
+
range: GridRange;
|
|
182
|
+
viewportResult: EngineViewportResult;
|
|
183
|
+
};
|
|
184
|
+
export type Meta = {
|
|
185
|
+
redoDepth: number;
|
|
186
|
+
sequences: number;
|
|
187
|
+
undoDepth: number;
|
|
188
|
+
width: number;
|
|
189
|
+
};
|
|
190
|
+
/**The following types match the Rust `search_algorithms::Match` and search_algorithms::SearchResult structures. */
|
|
191
|
+
export type SearchMatch = {
|
|
192
|
+
col: number;
|
|
193
|
+
matrix_type: MATRIX_TYPE;
|
|
194
|
+
row: number;
|
|
195
|
+
};
|
|
196
|
+
export type SearchResult = EngineSearchResult;
|
|
197
|
+
/** Summary statistics for a set of measured values. */
|
|
198
|
+
export type Stats = {
|
|
199
|
+
count: number;
|
|
200
|
+
max: number;
|
|
201
|
+
mean: number;
|
|
202
|
+
median: number;
|
|
203
|
+
min: number;
|
|
204
|
+
p95: number;
|
|
205
|
+
};
|
|
206
|
+
export type StatusBarSelectionStats = {
|
|
207
|
+
cols: number;
|
|
208
|
+
pos: number;
|
|
209
|
+
selectedSeqs: number;
|
|
210
|
+
totalSelectedChars: number;
|
|
211
|
+
};
|
|
212
|
+
/** Inclusive column/row bounds for a viewport or translation request. */
|
|
213
|
+
export type ViewportBounds = {
|
|
214
|
+
endCol: number;
|
|
215
|
+
endRow: number;
|
|
216
|
+
startCol: number;
|
|
217
|
+
startRow: number;
|
|
218
|
+
};
|
|
219
|
+
/** A fetched viewport slice plus the metadata needed to interpret it. */
|
|
220
|
+
export type ViewportResult = {
|
|
221
|
+
/** Number of columns per row (may be less than requested if clamped). */
|
|
222
|
+
cols: number;
|
|
223
|
+
/** Number of rows actually present in `bytes`. */
|
|
224
|
+
rows: number;
|
|
225
|
+
/** Column index of the first column in the slice. */
|
|
226
|
+
startCol: number;
|
|
227
|
+
/** Row index of the first row in the slice. */
|
|
228
|
+
startRow: number;
|
|
229
|
+
};
|
|
230
|
+
export type VisibleGridRange = {
|
|
231
|
+
cache: GridRange;
|
|
232
|
+
visible: GridRange;
|
|
233
|
+
};
|
|
234
|
+
export type VisibleGridRangeWithArguments = {
|
|
235
|
+
geometry: GridGeometry;
|
|
236
|
+
scrollLeft: number;
|
|
237
|
+
scrollTop: number;
|
|
238
|
+
viewportHeight: number;
|
|
239
|
+
viewportWidth: number;
|
|
240
|
+
visibleGridRange: VisibleGridRange;
|
|
241
|
+
};
|
|
242
|
+
/** Debug info exposed to the scrolling viewport status bar. */
|
|
243
|
+
export type WindowInfo = {
|
|
244
|
+
bufBytes: number;
|
|
245
|
+
bufEnd: number;
|
|
246
|
+
bufStart: number;
|
|
247
|
+
fetching: boolean;
|
|
248
|
+
visEnd: number;
|
|
249
|
+
visStart: number;
|
|
250
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/models/model.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.CELL = "CELL", e.DIVIDER = "DIVIDER", e.LABEL = "LABEL", e.RULER = "RULER", e;
|
|
4
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.AMINO_ACID = "amino_acid", e.NUCLEOTIDE = "nucleotide", e.RECORD_NAME = "record_name", e;
|
|
6
|
+
}({});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as EDITOR_PATH_PROPERTIES_TYPE, t as MATRIX_TYPE };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model.js","names":[],"sources":["../../src/models/model.ts"],"sourcesContent":["import type { MoveDirection } from '@rivm-loculus-tools/sequence-editor-wasm';\n\nexport enum EDITOR_PATH_PROPERTIES_TYPE {\n CELL = 'CELL',\n DIVIDER = 'DIVIDER',\n LABEL = 'LABEL',\n RULER = 'RULER',\n}\n\n\nexport enum MATRIX_TYPE {\n AMINO_ACID = 'amino_acid',\n NUCLEOTIDE = 'nucleotide',\n RECORD_NAME = 'record_name',\n}\n\nexport type EditorAssembly = {\n cells: EditorAssemblyCells;\n divider: EditorAssemblyDivider;\n labels: EditorAssemblyLabels;\n ruler: EditorAssemblyRuler;\n};\n\nexport type EditorAssemblyCells = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyDivider = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyLabels = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorAssemblyRuler = {\n pathPropertiesMap: Map<Path2D, EditorPathProperties>;\n};\n\nexport type EditorPathProperties = {\n col: number;\n row: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.CELL;\n} | {\n col: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.RULER;\n} | {\n row: number;\n type: EDITOR_PATH_PROPERTIES_TYPE.LABEL;\n} | {\n type: EDITOR_PATH_PROPERTIES_TYPE.DIVIDER;\n};\n\nexport type EditorSelection = {\n cells?: { // when a rectangular block of cells is selected\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n };\n cols?: number[]; // when entire columns are selected\n rows?: number[]; // when entire rows are selected\n};\n\n/** Metadata describing the currently loaded alignment. */\nexport type EngineMeta = {\n alignmentWidth: number;\n redoDepth: number;\n sequenceCount: number;\n undoDepth: number;\n};\n\n/** A single search match, matching the Rust `search_algorithms::Match`. */\nexport type EngineSearchMatch = {\n col: number;\n matrix_type: MATRIX_TYPE;\n row: number;\n};\n\n/** Search results, matching the Rust `search_algorithms::SearchResult`. */\nexport type EngineSearchResult = {\n num_matches: number;\n positions: EngineSearchMatch[];\n query: string;\n truncated: boolean;\n};\n\n/**\n * Timing breakdown for a single request, measured in milliseconds via\n * `performance.now()`. All fields are optional so non-instrumented responses\n * (e.g. `ready`) can omit them.\n *\n * The full call-to-render latency decomposes as:\n *\n * total = bridgeOut + engineMs + bridgeBack + renderMs\n *\n * where:\n * - `engineMs` : time spent inside the Rust call (measured in worker)\n * - `workerMs` : total time the worker held the request, including the\n * Rust call + response postMessage setup (measured in worker)\n * - `bridgeOut` : main→worker postMessage latency (computed on main thread\n * as `workerReceiveTs - sentTs`, see `TimingMarks`)\n * - `bridgeBack` : worker→main postMessage latency (computed on main thread\n * as `receivedTs - workerDoneTs`)\n * - `renderMs` : time from promise resolution to browser paint (measured\n * with `requestAnimationFrame` in the harness)\n */\nexport type EngineTiming = {\n /** Time inside the Rust engine call (ms). */\n engineMs: number;\n /** Total time the worker held the request (ms): from receive to postMessage. */\n workerMs: number;\n};\n\n/** A fetched viewport or translation slice plus the metadata to interpret it. */\nexport type EngineViewportResult = {\n /** Row-major bytes, transferred from the worker via comlink. */\n bytes: Uint8Array;\n /** Number of columns per row (may be less than requested if clamped). */\n cols: number;\n /** Number of rows actually present in `bytes`. */\n rows: number;\n /** Column index of the first column in the slice. */\n startCol: number;\n /** Row index of the first row in the slice. */\n startRow: number;\n};\n\n/**\n * Contract implemented by the `EngineWorker` class and exposed to the main\n * thread through comlink. Every method is asynchronous so comlink can proxy it\n * across the worker boundary.\n */\nexport interface EngineWorkerApi {\n delete: (rows: number[], column: number) => Promise<void>;\n deleteColumn: (column: number) => Promise<void>;\n exportFasta: () => Promise<string>;\n /** Idempotently initializes the WASM engine; resolves once it is ready. */\n initialize: () => Promise<void>;\n insert: (rows: number[], column: number) => Promise<void>;\n load: (fastaContent: string) => Promise<number>;\n meta: () => Promise<EngineMeta>;\n moveHorizontal: (row: number, columns: number[], direction: MoveDirection) => Promise<void>;\n moveRowsDown: (rows: number[]) => Promise<void>;\n moveRowsUp: (rows: number[]) => Promise<void>;\n mutate: (rows: number[], column: number, base: string) => Promise<void>;\n name: (row: number) => Promise<string>;\n redo: () => Promise<boolean>;\n search: (query: string, checkRecordNames: boolean) => Promise<EngineSearchResult>;\n translate: (bounds: ViewportBounds, readingFrame: number) => Promise<EngineViewportResult>;\n undo: () => Promise<boolean>;\n viewport: (bounds: ViewportBounds) => Promise<EngineViewportResult>;\n}\n\n\n/**\n * Wire protocol between the main thread and the MSA Web Worker.\n *\n * Design goals:\n * - **Zero-copy for binary payloads via SharedArrayBuffer.** Viewport\n * responses write into a single SAB created at worker init. The worker\n * sends a tiny control message (`{sabLen, data: ViewportResult}`) and the\n * main thread reads bytes directly from shared memory — no per-call\n * structured clone of binary data.\n * - **O(1) response correlation.** Every request carries a monotonically\n * increasing `reqId`; the client keeps a `Map<reqId, resolver>` for\n * constant-time dispatch.\n * - **Typed arrays for index vectors.** Row-index lists travel as\n * `Uint32Array` (not `number[]`) to avoid per-element number boxing and to\n * match the wasm-bindgen `&[usize]` slice mapping directly.\n * - **No JSON for hot paths.** Only small plain objects are structured-cloned;\n * binary data is always transferred via the shared SAB.\n */\n\n// ---------------------------------------------------------------------------\n// Shared types\n// ---------------------------------------------------------------------------\n\nexport type GridGeometry = {\n cellHeight: number;\n cellWidth: number;\n dividerWidth: number;\n labelWidth: number;\n numOverscanCols: number;\n numOverscanRows: number;\n rulerHeight: number;\n};\n\nexport type GridPoint = {\n col: number;\n row: number;\n surface: 'cell' | 'gutter' | 'ruler';\n};\n\nexport type GridRange = {\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n};\n\nexport type GridRangeWithRowNames = {\n range: GridRange;\n rowNames: string[];\n};\n\nexport type GridRangeWithViewportResults = {\n range: GridRange;\n viewportResult: EngineViewportResult;\n};\n\nexport type Meta = {\n redoDepth: number;\n sequences: number;\n undoDepth: number;\n width: number;\n};\n\n// ---------------------------------------------------------------------------\n// Main → Worker requests\n// ---------------------------------------------------------------------------\n\n/**The following types match the Rust `search_algorithms::Match` and search_algorithms::SearchResult structures. */\nexport type SearchMatch = {\n col: number;\n matrix_type: MATRIX_TYPE;\n row: number;\n};\n\n// ---------------------------------------------------------------------------\n// Worker → Main responses\n// ---------------------------------------------------------------------------\n\nexport type SearchResult = EngineSearchResult;\n\n/** Summary statistics for a set of measured values. */\nexport type Stats = {\n count: number;\n max: number;\n mean: number;\n median: number;\n min: number;\n p95: number;\n};\n\nexport type StatusBarSelectionStats = {\n cols: number;\n pos: number;\n selectedSeqs: number;\n totalSelectedChars: number;\n};\n\n/** Inclusive column/row bounds for a viewport or translation request. */\nexport type ViewportBounds = {\n endCol: number;\n endRow: number;\n startCol: number;\n startRow: number;\n};\n\n/** A fetched viewport slice plus the metadata needed to interpret it. */\nexport type ViewportResult = {\n /** Number of columns per row (may be less than requested if clamped). */\n cols: number;\n /** Number of rows actually present in `bytes`. */\n rows: number;\n /** Column index of the first column in the slice. */\n startCol: number;\n /** Row index of the first row in the slice. */\n startRow: number;\n};\n\nexport type VisibleGridRange = {\n cache: GridRange;\n visible: GridRange;\n};\n\nexport type VisibleGridRangeWithArguments = {\n geometry: GridGeometry;\n scrollLeft: number;\n scrollTop: number;\n viewportHeight: number;\n viewportWidth: number;\n visibleGridRange: VisibleGridRange;\n};\n\n/** Debug info exposed to the scrolling viewport status bar. */\nexport type WindowInfo = {\n bufBytes: number;\n bufEnd: number;\n bufStart: number;\n fetching: boolean;\n visEnd: number;\n visStart: number;\n};\n"],"mappings":";AAEA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,OAAA,QACA,EAAA,UAAA,WACA,EAAA,QAAA,SACA,EAAA,QAAA;AACF,EAAA,CAAA,CAAA,GAGY,IAAL,yBAAA,GAAA;QACL,EAAA,aAAA,cACA,EAAA,aAAA,cACA,EAAA,cAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export declare enum AminoAcidSymbol {
|
|
2
|
+
A = "A",
|
|
3
|
+
C = "C",
|
|
4
|
+
D = "D",
|
|
5
|
+
E = "E",
|
|
6
|
+
F = "F",
|
|
7
|
+
G = "G",
|
|
8
|
+
GAP = "-",
|
|
9
|
+
H = "H",
|
|
10
|
+
I = "I",
|
|
11
|
+
K = "K",
|
|
12
|
+
L = "L",
|
|
13
|
+
M = "M",
|
|
14
|
+
N = "N",
|
|
15
|
+
P = "P",
|
|
16
|
+
Q = "Q",
|
|
17
|
+
R = "R",
|
|
18
|
+
S = "S",
|
|
19
|
+
STOP = "*",
|
|
20
|
+
T = "T",
|
|
21
|
+
V = "V",
|
|
22
|
+
W = "W",
|
|
23
|
+
X = "X",
|
|
24
|
+
Y = "Y"
|
|
25
|
+
}
|
|
26
|
+
export declare enum NucleotideSymbol {
|
|
27
|
+
A = "A",
|
|
28
|
+
B = "B",
|
|
29
|
+
C = "C",
|
|
30
|
+
D = "D",
|
|
31
|
+
G = "G",
|
|
32
|
+
GAP = "-",
|
|
33
|
+
H = "H",
|
|
34
|
+
K = "K",
|
|
35
|
+
M = "M",
|
|
36
|
+
N = "N",
|
|
37
|
+
R = "R",
|
|
38
|
+
S = "S",
|
|
39
|
+
T = "T",
|
|
40
|
+
U = "U",
|
|
41
|
+
UNKNOWN = "X",
|
|
42
|
+
V = "V",
|
|
43
|
+
W = "W",
|
|
44
|
+
Y = "Y"
|
|
45
|
+
}
|
|
46
|
+
export type AminoAcidPalette = {
|
|
47
|
+
name: string;
|
|
48
|
+
paletteColors: AminoAcidPaletteColors;
|
|
49
|
+
};
|
|
50
|
+
export type AminoAcidPaletteColors = Record<AminoAcidSymbol, PaletteEntry>;
|
|
51
|
+
export type NucleotidePalette = {
|
|
52
|
+
name: string;
|
|
53
|
+
paletteColors: NucleotidePaletteColors;
|
|
54
|
+
};
|
|
55
|
+
export type NucleotidePaletteColors = Record<NucleotideSymbol, PaletteEntry>;
|
|
56
|
+
export type PaletteEntry = {
|
|
57
|
+
background: string;
|
|
58
|
+
backgroundSelected: string;
|
|
59
|
+
foreground: string;
|
|
60
|
+
foregroundSelected: string;
|
|
61
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/models/palette.ts
|
|
2
|
+
var e = /* @__PURE__ */ function(e) {
|
|
3
|
+
return e.A = "A", e.C = "C", e.D = "D", e.E = "E", e.F = "F", e.G = "G", e.GAP = "-", e.H = "H", e.I = "I", e.K = "K", e.L = "L", e.M = "M", e.N = "N", e.P = "P", e.Q = "Q", e.R = "R", e.S = "S", e.STOP = "*", e.T = "T", e.V = "V", e.W = "W", e.X = "X", e.Y = "Y", e;
|
|
4
|
+
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.A = "A", e.B = "B", e.C = "C", e.D = "D", e.G = "G", e.GAP = "-", e.H = "H", e.K = "K", e.M = "M", e.N = "N", e.R = "R", e.S = "S", e.T = "T", e.U = "U", e.UNKNOWN = "X", e.V = "V", e.W = "W", e.Y = "Y", e;
|
|
6
|
+
}({});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as AminoAcidSymbol, t as NucleotideSymbol };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=palette.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"palette.js","names":[],"sources":["../../src/models/palette.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum AminoAcidSymbol {\n A = 'A',\n C = 'C',\n D = 'D',\n E = 'E',\n F = 'F',\n G = 'G',\n GAP = '-',\n H = 'H',\n I = 'I',\n K = 'K',\n L = 'L',\n M = 'M',\n N = 'N',\n P = 'P',\n Q = 'Q',\n R = 'R',\n S = 'S',\n STOP = '*',\n T = 'T',\n V = 'V',\n W = 'W',\n X = 'X',\n Y = 'Y',\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport enum NucleotideSymbol {\n A = 'A',\n B = 'B',\n C = 'C',\n D = 'D',\n G = 'G',\n GAP = '-',\n H = 'H',\n K = 'K',\n M = 'M',\n N = 'N',\n R = 'R',\n S = 'S',\n T = 'T',\n U = 'U',\n UNKNOWN = 'X',\n V = 'V',\n W = 'W',\n Y = 'Y',\n}\n\nexport type AminoAcidPalette = {\n name: string;\n paletteColors: AminoAcidPaletteColors;\n};\nexport type AminoAcidPaletteColors = Record<AminoAcidSymbol, PaletteEntry>;\n\nexport type NucleotidePalette = {\n name: string;\n paletteColors: NucleotidePaletteColors;\n};\n\nexport type NucleotidePaletteColors = Record<NucleotideSymbol, PaletteEntry>;\n\nexport type PaletteEntry = {\n background: string;\n backgroundSelected: string;\n foreground: string;\n foregroundSelected: string;\n};\n"],"mappings":";AACA,IAAY,IAAL,yBAAA,GAAA;QACL,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,MAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,OAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA;AACF,EAAA,CAAA,CAAA,GAGY,IAAL,yBAAA,GAAA;QACL,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,MAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,UAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA,KACA,EAAA,IAAA;AACF,EAAA,CAAA,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FastaDataStoreActions, FastaDataStoreState } from '@rivm-loculus-tools/common-frontend/stores/fastaDataStore';
|
|
2
|
+
import { AminoAcidPalette, EditorSelection, EngineMeta, EngineSearchResult, NucleotidePalette } from '../../models';
|
|
3
|
+
export type SequenceEditorStore = SequenceEditorStoreActions & SequenceEditorStoreState;
|
|
4
|
+
export interface SequenceEditorStoreActions extends FastaDataStoreActions {
|
|
5
|
+
setAminoAcidPalette: (palette: AminoAcidPalette) => void;
|
|
6
|
+
setLatestMessage: (message: null | string) => void;
|
|
7
|
+
setMeta: (meta: EngineMeta | null) => void;
|
|
8
|
+
setNucleotidePalette: (palette: NucleotidePalette) => void;
|
|
9
|
+
setSearchQuery: (query: string) => void;
|
|
10
|
+
setSearchResult: (results: EngineSearchResult | null) => void;
|
|
11
|
+
setSearchResultHighlightedIndex: (index: null | number) => void;
|
|
12
|
+
setSelection: (selection: EditorSelection | null) => void;
|
|
13
|
+
}
|
|
14
|
+
export interface SequenceEditorStoreState extends FastaDataStoreState {
|
|
15
|
+
aminoAcidPalette: AminoAcidPalette;
|
|
16
|
+
latestMessage: null | string;
|
|
17
|
+
meta: EngineMeta | null;
|
|
18
|
+
nucleotidePalette: NucleotidePalette;
|
|
19
|
+
searchQuery: string;
|
|
20
|
+
searchResult: EngineSearchResult | null;
|
|
21
|
+
searchResultHighlightedIndex: null | number;
|
|
22
|
+
selection: EditorSelection | null;
|
|
23
|
+
}
|
|
24
|
+
export declare const sequenceEditorStore: Omit<import('zustand').StoreApi<SequenceEditorStore>, "setState" | "persist"> & {
|
|
25
|
+
setState(partial: SequenceEditorStore | Partial<SequenceEditorStore> | ((state: SequenceEditorStore) => SequenceEditorStore | Partial<SequenceEditorStore>), replace?: false | undefined): unknown;
|
|
26
|
+
setState(state: SequenceEditorStore | ((state: SequenceEditorStore) => SequenceEditorStore), replace: true): unknown;
|
|
27
|
+
persist: {
|
|
28
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<SequenceEditorStore, unknown, unknown>>) => void;
|
|
29
|
+
clearStorage: () => void;
|
|
30
|
+
rehydrate: () => Promise<void> | void;
|
|
31
|
+
hasHydrated: () => boolean;
|
|
32
|
+
onHydrate: (fn: (state: SequenceEditorStore) => void) => () => void;
|
|
33
|
+
onFinishHydration: (fn: (state: SequenceEditorStore) => void) => () => void;
|
|
34
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<SequenceEditorStore, unknown, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { AminoAcidPalette, EditorAssembly, EditorPathProperties, EditorSelection, EngineMeta, EngineSearchResult, EngineViewportResult, GridGeometry, GridRange, NucleotidePalette, StatusBarSelectionStats, VisibleGridRange } from '../../models';
|
|
2
|
+
import { EDITOR_DIRECTION } from '../../models/editor';
|
|
3
|
+
export declare class EditorUtil {
|
|
4
|
+
static drawCanvas({ canvasElement, devicePixelRatio, geometry, meta, palette, rowNames, rowNamesStartRow, scrollLeft, scrollTop, searchResult, searchResultHighlightedIndex, selection, viewport, viewportHeight, viewportWidth, }: {
|
|
5
|
+
canvasElement: HTMLCanvasElement;
|
|
6
|
+
devicePixelRatio: number;
|
|
7
|
+
geometry: GridGeometry;
|
|
8
|
+
meta: EngineMeta;
|
|
9
|
+
palette: AminoAcidPalette | NucleotidePalette;
|
|
10
|
+
rowNames: string[];
|
|
11
|
+
rowNamesStartRow: number;
|
|
12
|
+
scrollLeft: number;
|
|
13
|
+
scrollTop: number;
|
|
14
|
+
searchResult: EngineSearchResult | null;
|
|
15
|
+
searchResultHighlightedIndex: null | number;
|
|
16
|
+
selection: EditorSelection | null;
|
|
17
|
+
viewport: EngineViewportResult;
|
|
18
|
+
viewportHeight: number;
|
|
19
|
+
viewportWidth: number;
|
|
20
|
+
}): EditorAssembly;
|
|
21
|
+
static getExpandedSelection(currentSelection: EditorSelection, initialSelection: EditorSelection, direction: EDITOR_DIRECTION, metaData: EngineMeta): EditorSelection | null;
|
|
22
|
+
static getMovedSelection(selection: EditorSelection | null, direction: EDITOR_DIRECTION, metaData: EngineMeta): EditorSelection | null;
|
|
23
|
+
static getMutateArguments(selection: EditorSelection | null, metaData: EngineMeta, offset?: number): {
|
|
24
|
+
endCol: number;
|
|
25
|
+
rows: number[];
|
|
26
|
+
startCol: number;
|
|
27
|
+
} | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Performs a hit-test against the tree assembly's path maps to find the
|
|
30
|
+
* tree node or line segment under the mouse cursor.
|
|
31
|
+
*
|
|
32
|
+
* Checks in priority order: node dots (via `isPointInPath`) -> horizontal
|
|
33
|
+
* branch lines (with ±1 px vertical tolerance) -> vertical connector lines
|
|
34
|
+
* (with ±1 px horizontal tolerance).
|
|
35
|
+
*
|
|
36
|
+
* @param params.canvas - The canvas element that received the mouse event.
|
|
37
|
+
* @param params.event - The mouse event providing cursor coordinates.
|
|
38
|
+
* @param params.treeAssembly - The assembly containing path maps to hit-test against.
|
|
39
|
+
* @param params.devicePixelRatio - Screen DPR used when the canvas backing store is scaled.
|
|
40
|
+
* @returns The {@link EditorPathProperties} of the hit cell, or `undefined` if nothing was hit.
|
|
41
|
+
*/
|
|
42
|
+
static getPathPropertiesFromCanvas(params: {
|
|
43
|
+
canvas: HTMLCanvasElement;
|
|
44
|
+
devicePixelRatio: number;
|
|
45
|
+
editorAssembly: EditorAssembly;
|
|
46
|
+
event: MouseEvent;
|
|
47
|
+
}): EditorPathProperties | undefined;
|
|
48
|
+
static getPostUpsertSelection(selection: EditorSelection | null, direction: EDITOR_DIRECTION): EditorSelection | null;
|
|
49
|
+
static getRowsToMove(selection: EditorSelection | null, direction: EDITOR_DIRECTION, metaData: EngineMeta): number[] | undefined;
|
|
50
|
+
static getSelectionFromPathProperties(params: {
|
|
51
|
+
endPath: EditorPathProperties;
|
|
52
|
+
startPath: EditorPathProperties;
|
|
53
|
+
}): EditorSelection | undefined;
|
|
54
|
+
static getStatusBarSelectionStats(selection: EditorSelection | null, meta?: EngineMeta | null): StatusBarSelectionStats;
|
|
55
|
+
static getUpsertArguments(selection: EditorSelection | null, metaData: EngineMeta, offset?: number): {
|
|
56
|
+
col: number;
|
|
57
|
+
rows: number[];
|
|
58
|
+
} | undefined;
|
|
59
|
+
static getVisibleGridRange(params: {
|
|
60
|
+
geometry?: GridGeometry;
|
|
61
|
+
numCols: number;
|
|
62
|
+
numRows: number;
|
|
63
|
+
scrollLeft: number;
|
|
64
|
+
scrollTop: number;
|
|
65
|
+
viewportHeight: number;
|
|
66
|
+
viewportWidth: number;
|
|
67
|
+
}): VisibleGridRange;
|
|
68
|
+
static isWithinGridRange(params: {
|
|
69
|
+
cachedGridRange: GridRange;
|
|
70
|
+
visibleGridRange: GridRange;
|
|
71
|
+
}): boolean;
|
|
72
|
+
static scrollToPosition(params: {
|
|
73
|
+
geometry: GridGeometry;
|
|
74
|
+
scrollContainer: HTMLDivElement | null;
|
|
75
|
+
x: null | number;
|
|
76
|
+
y: null | number;
|
|
77
|
+
}): void;
|
|
78
|
+
static scrollToSearchResult(params: {
|
|
79
|
+
geometry: GridGeometry;
|
|
80
|
+
scrollContainer: HTMLDivElement | null;
|
|
81
|
+
searchResult: EngineSearchResult | null;
|
|
82
|
+
searchResultHighlightedIndex: null | number;
|
|
83
|
+
}): void;
|
|
84
|
+
/**
|
|
85
|
+
* Helper that wraps a canvas drawing callback with a DPR-aware transform, then
|
|
86
|
+
* restores the context to its pre-call state.
|
|
87
|
+
*
|
|
88
|
+
* @param canvas - The canvas element whose 2D context to use.
|
|
89
|
+
* @param devicePixelRatio - Screen DPR to scale up for HiDPI rendering.
|
|
90
|
+
* @param callback - Drawing operations to perform inside the transform.
|
|
91
|
+
*/
|
|
92
|
+
private static draw;
|
|
93
|
+
private static getCanvasContext;
|
|
94
|
+
private static searchHitAt;
|
|
95
|
+
private static searchHitContainsCell;
|
|
96
|
+
}
|