react-msaview 6.5.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -11
- package/bundle/index.js +122 -112
- package/bundle/index.js.map +4 -4
- package/dist/colorSchemes.js +1 -2
- package/dist/colorSchemes.js.map +1 -1
- package/dist/columnStats.d.ts +28 -0
- package/dist/columnStats.js +34 -0
- package/dist/columnStats.js.map +1 -0
- package/dist/components/DragHandle.d.ts +3 -2
- package/dist/components/DragHandle.js +11 -5
- package/dist/components/DragHandle.js.map +1 -1
- package/dist/components/Loading.js +2 -2
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.js +17 -6
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/MSAViewer.d.ts +69 -4
- package/dist/components/MSAViewer.js +201 -8
- package/dist/components/MSAViewer.js.map +1 -1
- package/dist/components/PortalTooltip.d.ts +11 -0
- package/dist/components/PortalTooltip.js +29 -0
- package/dist/components/PortalTooltip.js.map +1 -0
- package/dist/components/ResizeHandles.d.ts +3 -3
- package/dist/components/ResizeHandles.js +13 -24
- package/dist/components/ResizeHandles.js.map +1 -1
- package/dist/components/SequenceTextArea.js +3 -3
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/Track.js +41 -22
- package/dist/components/Track.js.map +1 -1
- package/dist/components/dialogs/{InterProScanDialog.d.ts → AnnotationFileDialog.d.ts} +2 -2
- package/dist/components/dialogs/AnnotationFileDialog.js +92 -0
- package/dist/components/dialogs/AnnotationFileDialog.js.map +1 -0
- package/dist/components/dialogs/ExportSVGDialog.js +5 -3
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.js +13 -9
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/header/GappynessSlider.js +6 -11
- package/dist/components/header/GappynessSlider.js.map +1 -1
- package/dist/components/header/Header.js +7 -0
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.js +0 -2
- package/dist/components/header/HeaderStatusArea.js.map +1 -1
- package/dist/components/header/LoadWarnings.d.ts +6 -0
- package/dist/components/header/LoadWarnings.js +35 -0
- package/dist/components/header/LoadWarnings.js.map +1 -0
- package/dist/components/header/MultiAlignmentSelector.js +0 -0
- package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
- package/dist/components/header/ScrollZoomIcons.d.ts +6 -0
- package/dist/components/header/ScrollZoomIcons.js +35 -0
- package/dist/components/header/ScrollZoomIcons.js.map +1 -0
- package/dist/components/header/TreeSettingsMenu.js +7 -1
- package/dist/components/header/TreeSettingsMenu.js.map +1 -1
- package/dist/components/header/UnshareableDataWarning.d.ts +6 -0
- package/dist/components/header/UnshareableDataWarning.js +40 -0
- package/dist/components/header/UnshareableDataWarning.js.map +1 -0
- package/dist/components/header/ZoomControls.js +49 -6
- package/dist/components/header/ZoomControls.js.map +1 -1
- package/dist/components/header/getAnnotationsMenu.js +11 -14
- package/dist/components/header/getAnnotationsMenu.js.map +1 -1
- package/dist/components/header/settingsMenuItems.js +10 -7
- package/dist/components/header/settingsMenuItems.js.map +1 -1
- package/dist/components/import/ImportForm.js +1 -1
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.js +2 -6
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/import/util.js +2 -0
- package/dist/components/import/util.js.map +1 -1
- package/dist/components/minimap/Minimap.js +1 -2
- package/dist/components/minimap/Minimap.js.map +1 -1
- package/dist/components/msa/AnnotationLegend.js +27 -19
- package/dist/components/msa/AnnotationLegend.js.map +1 -1
- package/dist/components/msa/MSACanvas.js +1 -1
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +17 -20
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +2 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/domainBandCursor.d.ts +7 -11
- package/dist/components/msa/domainBandCursor.js +7 -11
- package/dist/components/msa/domainBandCursor.js.map +1 -1
- package/dist/components/msa/drawFeatureSpans.d.ts +53 -0
- package/dist/components/msa/drawFeatureSpans.js +78 -0
- package/dist/components/msa/drawFeatureSpans.js.map +1 -0
- package/dist/components/msa/legendRows.d.ts +8 -0
- package/dist/components/msa/legendRows.js +16 -0
- package/dist/components/msa/legendRows.js.map +1 -0
- package/dist/components/msa/msaRaster.d.ts +30 -27
- package/dist/components/msa/msaRaster.js +193 -90
- package/dist/components/msa/msaRaster.js.map +1 -1
- package/dist/components/msa/packDomainLanes.d.ts +20 -0
- package/dist/components/msa/packDomainLanes.js +33 -0
- package/dist/components/msa/packDomainLanes.js.map +1 -0
- package/dist/components/msa/renderBoxFeatureCanvasBlock.d.ts +3 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js +51 -87
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
- package/dist/components/msa/renderHighlights.d.ts +44 -4
- package/dist/components/msa/renderHighlights.js +99 -11
- package/dist/components/msa/renderHighlights.js.map +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -2
- package/dist/components/msa/renderMSABlock.js +28 -31
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/msa/renderMSAMouseover.js +9 -30
- package/dist/components/msa/renderMSAMouseover.js.map +1 -1
- package/dist/components/msa/tileColor.js +4 -7
- package/dist/components/msa/tileColor.js.map +1 -1
- package/dist/components/msa/useMsaBlockMouse.d.ts +5 -3
- package/dist/components/msa/useMsaBlockMouse.js +6 -6
- package/dist/components/msa/useMsaBlockMouse.js.map +1 -1
- package/dist/components/renderCtx.d.ts +1 -1
- package/dist/components/rowpanels/RowPanelBlock.d.ts +9 -0
- package/dist/components/rowpanels/RowPanelBlock.js +86 -0
- package/dist/components/rowpanels/RowPanelBlock.js.map +1 -0
- package/dist/components/rowpanels/RowPanelHeaders.d.ts +12 -0
- package/dist/components/rowpanels/RowPanelHeaders.js +38 -0
- package/dist/components/rowpanels/RowPanelHeaders.js.map +1 -0
- package/dist/components/{msa/ColumnStats.d.ts → rowpanels/RowPanels.d.ts} +2 -2
- package/dist/components/rowpanels/RowPanels.js +32 -0
- package/dist/components/rowpanels/RowPanels.js.map +1 -0
- package/dist/components/rowpanels/headerLayout.d.ts +1 -0
- package/dist/components/rowpanels/headerLayout.js +5 -0
- package/dist/components/rowpanels/headerLayout.js.map +1 -0
- package/dist/components/rowpanels/renderFeaturePanel.d.ts +21 -0
- package/dist/components/rowpanels/renderFeaturePanel.js +37 -0
- package/dist/components/rowpanels/renderFeaturePanel.js.map +1 -0
- package/dist/components/rowpanels/renderRowPanel.d.ts +23 -0
- package/dist/components/rowpanels/renderRowPanel.js +22 -0
- package/dist/components/rowpanels/renderRowPanel.js.map +1 -0
- package/dist/components/rowpanels/renderStrip.d.ts +20 -0
- package/dist/components/rowpanels/renderStrip.js +26 -0
- package/dist/components/rowpanels/renderStrip.js.map +1 -0
- package/dist/components/tracks/TrackBlocks.js +13 -16
- package/dist/components/tracks/TrackBlocks.js.map +1 -1
- package/dist/components/tracks/TrackTooltipContent.d.ts +15 -0
- package/dist/components/tracks/TrackTooltipContent.js +109 -0
- package/dist/components/tracks/TrackTooltipContent.js.map +1 -0
- package/dist/components/tracks/drawTracks.d.ts +30 -12
- package/dist/components/tracks/drawTracks.js +127 -34
- package/dist/components/tracks/drawTracks.js.map +1 -1
- package/dist/components/tracks/useTrackHover.d.ts +22 -0
- package/dist/components/tracks/useTrackHover.js +30 -0
- package/dist/components/tracks/useTrackHover.js.map +1 -0
- package/dist/components/tree/CladeLabels.d.ts +12 -0
- package/dist/components/tree/CladeLabels.js +48 -0
- package/dist/components/tree/CladeLabels.js.map +1 -0
- package/dist/components/tree/TreeCanvas.js +6 -4
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +6 -21
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeOverview.d.ts +14 -0
- package/dist/components/tree/TreeOverview.js +75 -0
- package/dist/components/tree/TreeOverview.js.map +1 -0
- package/dist/components/tree/TreeRuler.js +11 -5
- package/dist/components/tree/TreeRuler.js.map +1 -1
- package/dist/components/tree/cladeBrackets.d.ts +25 -0
- package/dist/components/tree/cladeBrackets.js +51 -0
- package/dist/components/tree/cladeBrackets.js.map +1 -0
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -2
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +0 -1
- package/dist/components/tree/renderTreeCanvas.js +221 -47
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/components/tree/renderTreeOverview.d.ts +52 -0
- package/dist/components/tree/renderTreeOverview.js +138 -0
- package/dist/components/tree/renderTreeOverview.js.map +1 -0
- package/dist/components/tree/scaleBar.d.ts +10 -0
- package/dist/components/tree/scaleBar.js +24 -0
- package/dist/components/tree/scaleBar.js.map +1 -0
- package/dist/components/tree/useTreeHover.js +2 -4
- package/dist/components/tree/useTreeHover.js.map +1 -1
- package/dist/constants.d.ts +18 -1
- package/dist/constants.js +51 -8
- package/dist/constants.js.map +1 -1
- package/dist/createPaletteMap.d.ts +7 -6
- package/dist/createPaletteMap.js +10 -9
- package/dist/createPaletteMap.js.map +1 -1
- package/dist/element.d.ts +13 -0
- package/dist/element.js +269 -0
- package/dist/element.js.map +1 -0
- package/dist/featureFields.d.ts +11 -0
- package/dist/featureFields.js +17 -0
- package/dist/featureFields.js.map +1 -0
- package/dist/fetchUtils.d.ts +7 -7
- package/dist/fetchUtils.js +4 -32
- package/dist/fetchUtils.js.map +1 -1
- package/dist/flatToTree.js +1 -2
- package/dist/flatToTree.js.map +1 -1
- package/dist/ggplotPalettes.d.ts +10 -0
- package/dist/ggplotPalettes.js +58 -0
- package/dist/ggplotPalettes.js.map +1 -1
- package/dist/hierarchy.d.ts +29 -1
- package/dist/hierarchy.js +82 -19
- package/dist/hierarchy.js.map +1 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/model/DataModel.js +4 -4
- package/dist/model/DataModel.js.map +1 -1
- package/dist/model/msaModel.d.ts +3 -2
- package/dist/model/msaModel.js +3 -2
- package/dist/model/msaModel.js.map +1 -1
- package/dist/model/treeModel.d.ts +30 -0
- package/dist/model/treeModel.js +37 -1
- package/dist/model/treeModel.js.map +1 -1
- package/dist/model.d.ts +792 -259
- package/dist/model.js +2092 -675
- package/dist/model.js.map +1 -1
- package/dist/mount.d.ts +11 -0
- package/dist/mount.js +22 -0
- package/dist/mount.js.map +1 -0
- package/dist/neighborJoining.js +8 -32
- package/dist/neighborJoining.js.map +1 -1
- package/dist/renderToStaticMarkup.d.ts +15 -13
- package/dist/renderToStaticMarkup.js +37 -25
- package/dist/renderToStaticMarkup.js.map +1 -1
- package/dist/renderToSvg.js +198 -68
- package/dist/renderToSvg.js.map +1 -1
- package/dist/rowCoordinateCalculations.d.ts +26 -28
- package/dist/rowCoordinateCalculations.js +13 -39
- package/dist/rowCoordinateCalculations.js.map +1 -1
- package/dist/scales.d.ts +22 -0
- package/dist/scales.js +30 -0
- package/dist/scales.js.map +1 -0
- package/dist/seqPosToGlobalCol.d.ts +2 -3
- package/dist/seqPosToGlobalCol.js +5 -4
- package/dist/seqPosToGlobalCol.js.map +1 -1
- package/dist/sequenceLogo.d.ts +6 -11
- package/dist/sequenceLogo.js +6 -11
- package/dist/sequenceLogo.js.map +1 -1
- package/dist/stripDefault.d.ts +7 -14
- package/dist/stripDefault.js +7 -14
- package/dist/stripDefault.js.map +1 -1
- package/dist/svgTestUtil.d.ts +306 -124
- package/dist/types.d.ts +295 -3
- package/dist/umd.d.ts +2 -0
- package/dist/umd.js +4 -2
- package/dist/umd.js.map +1 -1
- package/dist/useCanvasAutorun.d.ts +5 -10
- package/dist/useCanvasAutorun.js +5 -10
- package/dist/useCanvasAutorun.js.map +1 -1
- package/dist/useMsaSvgFigure.d.ts +20 -0
- package/dist/useMsaSvgFigure.js +46 -0
- package/dist/useMsaSvgFigure.js.map +1 -0
- package/dist/util.d.ts +10 -4
- package/dist/util.js +37 -10
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wuss.d.ts +14 -0
- package/dist/wuss.js +55 -0
- package/dist/wuss.js.map +1 -0
- package/package.json +23 -14
- package/src/colorSchemes.ts +1 -2
- package/src/columnStats.ts +58 -0
- package/src/components/DragHandle.tsx +18 -7
- package/src/components/Loading.tsx +14 -8
- package/src/components/MSAView.tsx +19 -5
- package/src/components/MSAViewer.tsx +326 -10
- package/src/components/PortalTooltip.tsx +47 -0
- package/src/components/ResizeHandles.tsx +21 -36
- package/src/components/SequenceTextArea.tsx +3 -3
- package/src/components/Track.tsx +55 -18
- package/src/components/dialogs/AnnotationFileDialog.tsx +162 -0
- package/src/components/dialogs/ExportSVGDialog.tsx +7 -2
- package/src/components/dialogs/FeatureDialog.tsx +13 -9
- package/src/components/dialogs/TrackInfoDialog.tsx +1 -1
- package/src/components/header/GappynessSlider.tsx +6 -11
- package/src/components/header/Header.tsx +10 -0
- package/src/components/header/HeaderStatusArea.tsx +0 -5
- package/src/components/header/LoadWarnings.tsx +48 -0
- package/src/components/header/MultiAlignmentSelector.tsx +0 -0
- package/src/components/header/ScrollZoomIcons.tsx +52 -0
- package/src/components/header/TreeSettingsMenu.tsx +7 -1
- package/src/components/header/UnshareableDataWarning.tsx +56 -0
- package/src/components/header/ZoomControls.tsx +74 -14
- package/src/components/header/getAnnotationsMenu.ts +13 -17
- package/src/components/header/settingsMenuItems.ts +11 -6
- package/src/components/import/ImportForm.tsx +2 -2
- package/src/components/import/ImportFormExamples.tsx +4 -8
- package/src/components/import/util.ts +2 -0
- package/src/components/minimap/Minimap.tsx +1 -2
- package/src/components/msa/AnnotationLegend.tsx +48 -38
- package/src/components/msa/MSACanvas.tsx +3 -5
- package/src/components/msa/MSACanvasBlock.tsx +17 -21
- package/src/components/msa/MSAMouseoverCanvas.tsx +2 -1
- package/src/components/msa/domainBandCursor.ts +7 -11
- package/src/components/msa/drawFeatureSpans.ts +150 -0
- package/src/components/msa/legendRows.ts +24 -0
- package/src/components/msa/msaRaster.ts +236 -88
- package/src/components/msa/packDomainLanes.ts +36 -0
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +69 -123
- package/src/components/msa/renderHighlights.ts +141 -10
- package/src/components/msa/renderMSABlock.ts +29 -38
- package/src/components/msa/renderMSAMouseover.ts +9 -39
- package/src/components/msa/tileColor.ts +4 -7
- package/src/components/msa/useMsaBlockMouse.ts +6 -6
- package/src/components/renderCtx.ts +1 -0
- package/src/components/rowpanels/RowPanelBlock.tsx +139 -0
- package/src/components/rowpanels/RowPanelHeaders.tsx +57 -0
- package/src/components/rowpanels/RowPanels.tsx +77 -0
- package/src/components/rowpanels/headerLayout.ts +5 -0
- package/src/components/rowpanels/renderFeaturePanel.ts +66 -0
- package/src/components/rowpanels/renderRowPanel.ts +41 -0
- package/src/components/rowpanels/renderStrip.ts +46 -0
- package/src/components/tracks/TrackBlocks.tsx +13 -18
- package/src/components/tracks/TrackTooltipContent.tsx +156 -0
- package/src/components/tracks/drawTracks.ts +169 -38
- package/src/components/tracks/useTrackHover.ts +42 -0
- package/src/components/tree/CladeLabels.tsx +77 -0
- package/src/components/tree/TreeCanvas.tsx +4 -3
- package/src/components/tree/TreeCanvasBlock.tsx +10 -32
- package/src/components/tree/TreeOverview.tsx +106 -0
- package/src/components/tree/TreeRuler.tsx +29 -5
- package/src/components/tree/cladeBrackets.ts +73 -0
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +2 -2
- package/src/components/tree/renderTreeCanvas.ts +312 -48
- package/src/components/tree/renderTreeOverview.ts +212 -0
- package/src/components/tree/scaleBar.ts +23 -0
- package/src/components/tree/useTreeHover.ts +2 -4
- package/src/constants.ts +61 -8
- package/src/createPaletteMap.ts +10 -9
- package/src/element.ts +321 -0
- package/src/featureFields.ts +19 -0
- package/src/fetchUtils.ts +7 -40
- package/src/flatToTree.ts +1 -2
- package/src/ggplotPalettes.ts +60 -0
- package/src/hierarchy.ts +97 -20
- package/src/index.ts +46 -6
- package/src/model/DataModel.ts +5 -4
- package/src/model/msaModel.ts +3 -2
- package/src/model/treeModel.ts +42 -0
- package/src/model.ts +2492 -793
- package/src/mount.tsx +32 -0
- package/src/neighborJoining.ts +8 -32
- package/src/rawImports.d.ts +9 -0
- package/src/renderToStaticMarkup.ts +41 -25
- package/src/renderToSvg.tsx +365 -92
- package/src/rowCoordinateCalculations.ts +16 -62
- package/src/scales.ts +47 -0
- package/src/seqPosToGlobalCol.ts +5 -4
- package/src/sequenceLogo.ts +6 -11
- package/src/stripDefault.ts +7 -14
- package/src/types.ts +352 -12
- package/src/umd.ts +4 -2
- package/src/useCanvasAutorun.ts +5 -10
- package/src/useMsaSvgFigure.ts +72 -0
- package/src/util.ts +40 -14
- package/src/version.ts +1 -1
- package/src/wuss.ts +62 -0
- package/dist/components/dialogs/InterProScanDialog.js +0 -137
- package/dist/components/dialogs/InterProScanDialog.js.map +0 -1
- package/dist/components/dialogs/InterProScanFileDialog.d.ts +0 -7
- package/dist/components/dialogs/InterProScanFileDialog.js +0 -64
- package/dist/components/dialogs/InterProScanFileDialog.js.map +0 -1
- package/dist/components/msa/ColumnStats.js +0 -42
- package/dist/components/msa/ColumnStats.js.map +0 -1
- package/dist/launchInterProScan.d.ts +0 -13
- package/dist/launchInterProScan.js +0 -110
- package/dist/launchInterProScan.js.map +0 -1
- package/dist/useColorContrast.d.ts +0 -10
- package/dist/useColorContrast.js +0 -13
- package/dist/useColorContrast.js.map +0 -1
- package/src/clustalX.test.ts +0 -74
- package/src/colSpace.test.ts +0 -67
- package/src/collapseLogic.test.ts +0 -115
- package/src/colorSchemes.docs.test.ts +0 -57
- package/src/columnCounts.test.ts +0 -73
- package/src/columnStats.test.ts +0 -94
- package/src/columnTracks.test.ts +0 -97
- package/src/components/dialogs/InterProScanDialog.tsx +0 -214
- package/src/components/dialogs/InterProScanFileDialog.tsx +0 -138
- package/src/components/minimap/minimapLayout.test.ts +0 -71
- package/src/components/msa/ColumnStats.tsx +0 -54
- package/src/components/msa/msaRaster.test.ts +0 -145
- package/src/components/msa/renderBoxFeatureCanvasBlock.test.ts +0 -51
- package/src/components/tree/renderTreeCanvas.test.ts +0 -296
- package/src/dataInitialized.test.ts +0 -42
- package/src/domainBands.test.ts +0 -122
- package/src/domainLetterColor.test.ts +0 -80
- package/src/exportFileName.test.ts +0 -40
- package/src/fetchUtils.test.ts +0 -83
- package/src/flatToTree.test.ts +0 -51
- package/src/hierarchy.test.ts +0 -228
- package/src/highlights.test.ts +0 -70
- package/src/impgRender.test.tsx +0 -68
- package/src/largeTree.test.ts +0 -67
- package/src/launchInterProScan.ts +0 -167
- package/src/loadErrorDisplay.test.tsx +0 -102
- package/src/modelFilehandleLoaders.test.ts +0 -137
- package/src/modelReset.test.ts +0 -120
- package/src/neighborJoining.test.ts +0 -164
- package/src/parseAsn1.test.ts +0 -36
- package/src/propertyConservation.test.ts +0 -36
- package/src/renderColumnTracksSvg.test.tsx +0 -108
- package/src/renderDomainsSvg.test.tsx +0 -118
- package/src/renderHighlightsSvg.test.tsx +0 -85
- package/src/renderMinimapSvg.test.tsx +0 -62
- package/src/renderRasterSvg.test.tsx +0 -144
- package/src/renderSequenceLogoSvg.test.tsx +0 -165
- package/src/renderToSvg.test.tsx +0 -65
- package/src/reset.test.ts +0 -61
- package/src/rowCoordinateCalculations.test.ts +0 -211
- package/src/rowSpace.test.ts +0 -46
- package/src/segmentOverlay.test.ts +0 -70
- package/src/seqPosToGlobalCol.test.ts +0 -59
- package/src/sequenceLogo.test.ts +0 -88
- package/src/setFontSize.test.ts +0 -33
- package/src/stripDefault.test.ts +0 -48
- package/src/stripDefaultSnapshot.test.ts +0 -87
- package/src/treeMetadata.test.ts +0 -39
- package/src/useCanvasAutorun.test.tsx +0 -98
- package/src/useColorContrast.ts +0 -18
- package/src/viewChrome.test.tsx +0 -134
- package/src/wheelZoom.test.ts +0 -46
|
@@ -1,98 +1,62 @@
|
|
|
1
|
-
import { subFeatureRowHeight } from '../../constants.js';
|
|
1
|
+
import { domainUnderlineHeight, subFeatureRowHeight } from '../../constants.js';
|
|
2
|
+
import { contrastTextFn } from '../../util.js';
|
|
2
3
|
import { getVisibleLeaves } from '../getVisibleLeaves.js';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const by = blockSizeYOverride ?? blockSize;
|
|
9
|
-
ctx.resetTransform();
|
|
10
|
-
ctx.scale(k, k);
|
|
11
|
-
ctx.translate(-offsetX, rowHeight / 2 - offsetY);
|
|
12
|
-
drawTiles({
|
|
13
|
-
model,
|
|
14
|
-
ctx,
|
|
15
|
-
visibleLeaves: getVisibleLeaves({ model, offsetY, blockSizeY: by }),
|
|
16
|
-
offsetX,
|
|
17
|
-
blockWidth: bx,
|
|
18
|
-
});
|
|
4
|
+
import { drawFeatureSpans, spanRows } from './drawFeatureSpans.js';
|
|
5
|
+
export function renderBoxFeatureCanvasBlock({ model, theme, offsetX, offsetY, ctx, highResScaleFactorOverride, blockSizeXOverride, blockSizeYOverride, }) {
|
|
6
|
+
const { blockSize, rowHeight, highResScaleFactor, actuallyShowDomains, subFeatureRows, colWidth, featureColors, featureLabels, segmentLabels, showMsaLetters, domainUnderline, domainBands, } = model;
|
|
7
|
+
if (!actuallyShowDomains) {
|
|
8
|
+
return;
|
|
19
9
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
10
|
+
const k = highResScaleFactorOverride ?? highResScaleFactor;
|
|
11
|
+
const bx = blockSizeXOverride ?? blockSize;
|
|
12
|
+
const by = blockSizeYOverride ?? blockSize;
|
|
13
|
+
ctx.resetTransform();
|
|
14
|
+
ctx.scale(k, k);
|
|
15
|
+
ctx.translate(-offsetX, rowHeight / 2 - offsetY);
|
|
16
|
+
// the plain and underline modes give every band the same height; a sub-row
|
|
17
|
+
// band is thinner, and how thin depends on how many lanes its row needs
|
|
18
|
+
const barHeight = domainUnderline
|
|
19
|
+
? Math.min(domainUnderlineHeight, rowHeight)
|
|
20
|
+
: rowHeight;
|
|
24
21
|
// exon numbers label the bands only when residue letters aren't drawn (zoomed
|
|
25
22
|
// out); when letters show, the alternating shades alone mark the boundaries
|
|
26
|
-
// and a number would collide with the sequence
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
// window enough that a band just outside the block still draws its head
|
|
30
|
-
const cull = h + colWidth;
|
|
31
|
-
const xMin = offsetX - cull;
|
|
32
|
-
const xMax = offsetX + blockWidth + cull;
|
|
23
|
+
// and a number would collide with the sequence. A featureLabel encoding names
|
|
24
|
+
// what every span carries instead
|
|
25
|
+
const drawSegmentLabels = !featureLabels && !showMsaLetters && !subFeatureRows && barHeight >= 9;
|
|
33
26
|
// a segment (exon) number labels its band once per block, on the topmost
|
|
34
27
|
// visible row carrying that segment, so it reads as a column header for the
|
|
35
28
|
// whole band. Keyed by accession rather than drawn on row 0, because the rows
|
|
36
29
|
// carrying the gene model are often not the first ones in the alignment
|
|
37
30
|
const labelled = drawSegmentLabels ? new Set() : undefined;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
else {
|
|
69
|
-
drawGeneArrow({ ctx, x, t, w: lw, h, strand });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// A gene arrow: a full-width rectangular body spanning the feature's
|
|
77
|
-
// start..end columns, plus a triangular head that points *beyond* that end in
|
|
78
|
-
// the strand direction (right for +, left for -). Keeping the body aligned to
|
|
79
|
-
// the exact start/end columns means + and - strand features read as having the
|
|
80
|
-
// same boundaries; the arrow lives outside them purely to show transcription
|
|
81
|
-
// direction, preserving the column-by-column homology down the rows.
|
|
82
|
-
function drawGeneArrow({ ctx, x, t, w, h, strand, }) {
|
|
83
|
-
// body spans bodyStart..bodyEnd (the exact columns); the head extends one
|
|
84
|
-
// row-height past bodyEnd in the strand direction
|
|
85
|
-
const dir = strand > 0 ? 1 : -1;
|
|
86
|
-
const bodyStart = strand > 0 ? x : x + w;
|
|
87
|
-
const bodyEnd = strand > 0 ? x + w : x;
|
|
88
|
-
ctx.beginPath();
|
|
89
|
-
ctx.moveTo(bodyStart, t);
|
|
90
|
-
ctx.lineTo(bodyEnd, t);
|
|
91
|
-
ctx.lineTo(bodyEnd + dir * h, t + h / 2);
|
|
92
|
-
ctx.lineTo(bodyEnd, t + h);
|
|
93
|
-
ctx.lineTo(bodyStart, t + h);
|
|
94
|
-
ctx.closePath();
|
|
95
|
-
ctx.fill();
|
|
96
|
-
ctx.stroke();
|
|
31
|
+
// gene arrow heads stick out up to a row height past the band, so pad the
|
|
32
|
+
// cull window enough that a band just outside the block still draws its head
|
|
33
|
+
const cull = rowHeight + colWidth;
|
|
34
|
+
drawFeatureSpans({
|
|
35
|
+
ctx,
|
|
36
|
+
rows: spanRows(getVisibleLeaves({ model, offsetY, blockSizeY: by }), domainBands),
|
|
37
|
+
layout: {
|
|
38
|
+
// sub-rows are thin, but a row whose lanes would spill onto the row below
|
|
39
|
+
// shares out the row height between them instead
|
|
40
|
+
height: laneCount => subFeatureRows
|
|
41
|
+
? Math.min(subFeatureRowHeight, rowHeight / laneCount)
|
|
42
|
+
: barHeight,
|
|
43
|
+
top: (y, lane, h) => y -
|
|
44
|
+
rowHeight +
|
|
45
|
+
(subFeatureRows ? lane * h : domainUnderline ? rowHeight - h : 0),
|
|
46
|
+
// the head keeps its full size on an underline bar, since a head as short
|
|
47
|
+
// as the bar reads as a nub rather than as a direction
|
|
48
|
+
headLength: h => (domainUnderline ? rowHeight / 2 : h),
|
|
49
|
+
},
|
|
50
|
+
xOf: band => [band.startCol * colWidth, band.endCol * colWidth],
|
|
51
|
+
colors: featureColors,
|
|
52
|
+
labelOf: band => featureLabels?.get(band.annotation) ??
|
|
53
|
+
(labelled && !labelled.has(band.annotation.accession)
|
|
54
|
+
? segmentLabels.get(band.annotation.accession)
|
|
55
|
+
: undefined),
|
|
56
|
+
labelDrawn: band => labelled?.add(band.annotation.accession),
|
|
57
|
+
contrastText: contrastTextFn(theme),
|
|
58
|
+
xMin: offsetX - cull,
|
|
59
|
+
xMax: offsetX + bx + cull,
|
|
60
|
+
});
|
|
97
61
|
}
|
|
98
62
|
//# sourceMappingURL=renderBoxFeatureCanvasBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderBoxFeatureCanvasBlock.js","sourceRoot":"","sources":["../../../src/components/msa/renderBoxFeatureCanvasBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"renderBoxFeatureCanvasBlock.js","sourceRoot":"","sources":["../../../src/components/msa/renderBoxFeatureCanvasBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,EAAE,gBAAg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U,CAAC,SAAS,CAAC;gBAC9C,CAAC,CAAC,SAAS,CAAC;QAChB,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAC5D,YAAY,EAAE,cAAc,CAAC,KAAK,CAAC;QACnC,IAAI,EAAE,OAAO,GAAG,IAAI;QACpB,IAAI,EAAE,OAAO,GAAG,EAAE,GAAG,IAAI;KAC1B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -5,20 +5,45 @@ export declare const highlightFill = "rgba(255,140,0,0.28)";
|
|
|
5
5
|
export declare const highlightBorder = "rgba(210,90,0,0.95)";
|
|
6
6
|
export declare const highlightRowFill = "rgba(255,140,0,0.18)";
|
|
7
7
|
export declare const labelFontSize = 11;
|
|
8
|
-
export declare
|
|
8
|
+
export declare const highlightLabelHeight: number;
|
|
9
|
+
export interface LabelBox {
|
|
10
|
+
left: number;
|
|
11
|
+
right: number;
|
|
12
|
+
top: number;
|
|
13
|
+
bottom: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A highlight's label, over its band where it fits and beside it where it does
|
|
17
|
+
* not, kept inside `bounds` and out of the way of the labels already placed.
|
|
18
|
+
*
|
|
19
|
+
* `bounds` keeps the label of a band scrolled partly off the left edge visible.
|
|
20
|
+
* With `placed`, a label that would overlap an earlier one, as two
|
|
21
|
+
* single-residue highlights a column apart do, steps down a row.
|
|
22
|
+
*/
|
|
23
|
+
export declare function drawHighlightLabel({ ctx, theme, label, x, y, spanWidth, bounds, placed, }: {
|
|
9
24
|
ctx: RenderCtx;
|
|
10
25
|
theme: Theme;
|
|
11
26
|
label: string;
|
|
12
27
|
x: number;
|
|
13
28
|
y: number;
|
|
14
29
|
spanWidth: number;
|
|
30
|
+
bounds?: {
|
|
31
|
+
min: number;
|
|
32
|
+
max: number;
|
|
33
|
+
};
|
|
34
|
+
placed?: LabelBox[];
|
|
15
35
|
}): void;
|
|
16
36
|
/**
|
|
17
|
-
* The persistent
|
|
18
|
-
*
|
|
19
|
-
*
|
|
37
|
+
* The persistent overlay on the alignment: the band behind each clade of
|
|
38
|
+
* `clades`, the `rowTint` encoding's wash, the row tints and bordered column
|
|
39
|
+
* bands of `highlights`, and a label above each band. `offsetX`/`offsetY` are
|
|
40
|
+
* the content coordinates at the canvas origin, the convention renderMSABlock
|
|
20
41
|
* uses, so the live overlay passes -scrollX/-scrollY and the export passes its
|
|
21
42
|
* layout offsets.
|
|
43
|
+
*
|
|
44
|
+
* Rows are culled to the ones this block covers. A tint over every row of a
|
|
45
|
+
* large alignment would otherwise draw the whole column of rects in each block,
|
|
46
|
+
* and again on every pointer move through renderMouseover.
|
|
22
47
|
*/
|
|
23
48
|
export declare function renderHighlights({ ctx, model, theme, offsetX, offsetY, width, height, }: {
|
|
24
49
|
ctx: RenderCtx;
|
|
@@ -29,3 +54,18 @@ export declare function renderHighlights({ ctx, model, theme, offsetX, offsetY,
|
|
|
29
54
|
width: number;
|
|
30
55
|
height: number;
|
|
31
56
|
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* The overlay parts that come from the snapshot: the reference row's tint, a
|
|
59
|
+
* bordered band per run of highlighted columns, and the `highlights` layer. The
|
|
60
|
+
* live overlay draws these under its hover and click bands; the SVG export
|
|
61
|
+
* draws only these.
|
|
62
|
+
*/
|
|
63
|
+
export declare function renderPersistentHighlights({ ctx, model, theme, offsetX, offsetY, width, height, }: {
|
|
64
|
+
ctx: RenderCtx;
|
|
65
|
+
model: MsaViewModel;
|
|
66
|
+
theme: Theme;
|
|
67
|
+
offsetX: number;
|
|
68
|
+
offsetY: number;
|
|
69
|
+
width: number;
|
|
70
|
+
height: number;
|
|
71
|
+
}): void;
|
|
@@ -1,34 +1,90 @@
|
|
|
1
1
|
import { setFontSize } from '../../setFontSize.js';
|
|
2
|
+
import { referenceColor } from '../overlayColors.js';
|
|
3
|
+
// a fill plus a solid border; the hover wash alone is invisible over clustalx
|
|
4
|
+
// coloring
|
|
2
5
|
export const highlightFill = 'rgba(255,140,0,0.28)';
|
|
3
6
|
export const highlightBorder = 'rgba(210,90,0,0.95)';
|
|
4
7
|
export const highlightRowFill = 'rgba(255,140,0,0.18)';
|
|
5
8
|
export const labelFontSize = 11;
|
|
6
9
|
const labelPad = 3;
|
|
7
|
-
|
|
10
|
+
// the label box above a highlight band; tree blocks also check rows this far
|
|
11
|
+
// outside themselves
|
|
12
|
+
export const highlightLabelHeight = labelFontSize + labelPad * 2;
|
|
13
|
+
/**
|
|
14
|
+
* A highlight's label, over its band where it fits and beside it where it does
|
|
15
|
+
* not, kept inside `bounds` and out of the way of the labels already placed.
|
|
16
|
+
*
|
|
17
|
+
* `bounds` keeps the label of a band scrolled partly off the left edge visible.
|
|
18
|
+
* With `placed`, a label that would overlap an earlier one, as two
|
|
19
|
+
* single-residue highlights a column apart do, steps down a row.
|
|
20
|
+
*/
|
|
21
|
+
export function drawHighlightLabel({ ctx, theme, label, x, y, spanWidth, bounds, placed, }) {
|
|
8
22
|
setFontSize(ctx, labelFontSize);
|
|
9
23
|
ctx.textAlign = 'start';
|
|
10
24
|
const boxWidth = ctx.measureText(label).width + labelPad * 2;
|
|
11
|
-
const boxHeight =
|
|
12
|
-
|
|
25
|
+
const boxHeight = highlightLabelHeight;
|
|
26
|
+
let left = boxWidth <= spanWidth ? x : x + spanWidth + 2;
|
|
27
|
+
if (bounds) {
|
|
28
|
+
left = Math.max(bounds.min, Math.min(left, bounds.max - boxWidth));
|
|
29
|
+
}
|
|
30
|
+
let top = y;
|
|
31
|
+
if (placed) {
|
|
32
|
+
const overlaps = (box) => box.left < left + boxWidth &&
|
|
33
|
+
box.right > left &&
|
|
34
|
+
box.top < top + boxHeight &&
|
|
35
|
+
box.bottom > top;
|
|
36
|
+
while (placed.some(overlaps)) {
|
|
37
|
+
top += boxHeight;
|
|
38
|
+
}
|
|
39
|
+
placed.push({ left, right: left + boxWidth, top, bottom: top + boxHeight });
|
|
40
|
+
}
|
|
13
41
|
ctx.fillStyle = theme.palette.background.paper;
|
|
14
|
-
ctx.fillRect(left,
|
|
42
|
+
ctx.fillRect(left, top, boxWidth, boxHeight);
|
|
15
43
|
ctx.fillStyle = theme.palette.text.primary;
|
|
16
|
-
ctx.fillText(label, left + labelPad,
|
|
44
|
+
ctx.fillText(label, left + labelPad, top + labelPad + labelFontSize - 2);
|
|
17
45
|
}
|
|
18
46
|
/**
|
|
19
|
-
* The persistent
|
|
20
|
-
*
|
|
21
|
-
*
|
|
47
|
+
* The persistent overlay on the alignment: the band behind each clade of
|
|
48
|
+
* `clades`, the `rowTint` encoding's wash, the row tints and bordered column
|
|
49
|
+
* bands of `highlights`, and a label above each band. `offsetX`/`offsetY` are
|
|
50
|
+
* the content coordinates at the canvas origin, the convention renderMSABlock
|
|
22
51
|
* uses, so the live overlay passes -scrollX/-scrollY and the export passes its
|
|
23
52
|
* layout offsets.
|
|
53
|
+
*
|
|
54
|
+
* Rows are culled to the ones this block covers. A tint over every row of a
|
|
55
|
+
* large alignment would otherwise draw the whole column of rects in each block,
|
|
56
|
+
* and again on every pointer move through renderMouseover.
|
|
24
57
|
*/
|
|
25
58
|
export function renderHighlights({ ctx, model, theme, offsetX, offsetY, width, height, }) {
|
|
26
|
-
const { resolvedHighlights, colWidth, rowHeight } = model;
|
|
59
|
+
const { resolvedClades, resolvedHighlights, rowTints, colWidth, rowHeight } = model;
|
|
60
|
+
const placed = [];
|
|
27
61
|
ctx.lineWidth = 2;
|
|
62
|
+
const firstRow = Math.max(0, Math.floor(offsetY / rowHeight));
|
|
63
|
+
const lastRow = Math.ceil((offsetY + height) / rowHeight);
|
|
64
|
+
const fillRow = (index) => {
|
|
65
|
+
ctx.fillRect(0, index * rowHeight - offsetY, width, rowHeight);
|
|
66
|
+
};
|
|
67
|
+
for (const { rows, color, mark } of resolvedClades) {
|
|
68
|
+
if (mark === 'highlight' && rows[1] >= firstRow && rows[0] <= lastRow) {
|
|
69
|
+
ctx.fillStyle = color;
|
|
70
|
+
ctx.fillRect(0, rows[0] * rowHeight - offsetY, width, (rows[1] - rows[0] + 1) * rowHeight);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (rowTints) {
|
|
74
|
+
for (let index = firstRow; index <= Math.min(lastRow, rowTints.length - 1); index++) {
|
|
75
|
+
const color = rowTints[index];
|
|
76
|
+
if (color) {
|
|
77
|
+
ctx.fillStyle = color;
|
|
78
|
+
fillRow(index);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
28
82
|
for (const { rowIndices, color } of resolvedHighlights) {
|
|
29
83
|
ctx.fillStyle = color ?? highlightRowFill;
|
|
30
84
|
for (const index of rowIndices) {
|
|
31
|
-
|
|
85
|
+
if (index >= firstRow && index <= lastRow) {
|
|
86
|
+
fillRow(index);
|
|
87
|
+
}
|
|
32
88
|
}
|
|
33
89
|
}
|
|
34
90
|
for (const { startCol, endCol, label, color } of resolvedHighlights) {
|
|
@@ -42,8 +98,40 @@ export function renderHighlights({ ctx, model, theme, offsetX, offsetY, width, h
|
|
|
42
98
|
ctx.strokeStyle = color ?? highlightBorder;
|
|
43
99
|
ctx.strokeRect(x, 0, spanWidth, height);
|
|
44
100
|
if (label) {
|
|
45
|
-
drawHighlightLabel({
|
|
101
|
+
drawHighlightLabel({
|
|
102
|
+
ctx,
|
|
103
|
+
theme,
|
|
104
|
+
label,
|
|
105
|
+
x,
|
|
106
|
+
y: 0,
|
|
107
|
+
spanWidth,
|
|
108
|
+
bounds: { min: 0, max: width },
|
|
109
|
+
placed,
|
|
110
|
+
});
|
|
46
111
|
}
|
|
47
112
|
}
|
|
48
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* The overlay parts that come from the snapshot: the reference row's tint, a
|
|
116
|
+
* bordered band per run of highlighted columns, and the `highlights` layer. The
|
|
117
|
+
* live overlay draws these under its hover and click bands; the SVG export
|
|
118
|
+
* draws only these.
|
|
119
|
+
*/
|
|
120
|
+
export function renderPersistentHighlights({ ctx, model, theme, offsetX, offsetY, width, height, }) {
|
|
121
|
+
const { colWidth, rowHeight, referenceRowIndex, highlightedColumnRuns } = model;
|
|
122
|
+
if (referenceRowIndex !== undefined) {
|
|
123
|
+
ctx.fillStyle = referenceColor;
|
|
124
|
+
ctx.fillRect(0, referenceRowIndex * rowHeight - offsetY, width, rowHeight);
|
|
125
|
+
}
|
|
126
|
+
ctx.lineWidth = 2;
|
|
127
|
+
for (const { start, end } of highlightedColumnRuns) {
|
|
128
|
+
const x = start * colWidth - offsetX;
|
|
129
|
+
const w = (end - start + 1) * colWidth;
|
|
130
|
+
ctx.fillStyle = highlightFill;
|
|
131
|
+
ctx.fillRect(x, 0, w, height);
|
|
132
|
+
ctx.strokeStyle = highlightBorder;
|
|
133
|
+
ctx.strokeRect(x, 0, w, height);
|
|
134
|
+
}
|
|
135
|
+
renderHighlights({ ctx, model, theme, offsetX, offsetY, width, height });
|
|
136
|
+
}
|
|
49
137
|
//# sourceMappingURL=renderHighlights.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderHighlights.js","sourceRoot":"","sources":["../../../src/components/msa/renderHighlights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"renderHighlights.js","sourceRoot":"","sources":["../../../src/components/msa/renderHighlights.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAMpD,8EAA8E;AAC9E,WAAW;AACX,MAAM,CAAC,MAAM,aAAa,GAAG,sBAAsB,CAAA;AACnD,MAAM,CAAC,MAAM,eAAe,GAAG,qBAAqB,CAAA;AACpD,MAAM,CAAC,MAAM,gBAAgB,GAAG,sBAAsB,CAAA;AAEtD,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAA;AAC/B,MAAM,QAAQ,GAAG,CAAC,CAAA;AAClB,6EAA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AAA;IAC5E,CAAC;IAED,GAAG,CAAC,SAAS,GAAG,CAAC,CAAA;IACjB,KAAK,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,qBAAqB,EAAE,CAAC;QACnD,MAAM,CAAC,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAA;QACpC,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAA;QACtC,GAAG,CAAC,SAAS,GAAG,aAAa,CAAA;QAC7B,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;QAC7B,GAAG,CAAC,WAAW,GAAG,eAAe,CAAA;QACjC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAA;IACjC,CAAC;IAED,gBAAgB,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAA;AAC1E,CAAC"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { MsaViewModel } from '../../model.ts';
|
|
2
2
|
import type { RenderCtx } from '../renderCtx.ts';
|
|
3
3
|
import type { Theme } from '@mui/material';
|
|
4
|
-
export declare function renderMSABlock({ model, offsetX, offsetY,
|
|
4
|
+
export declare function renderMSABlock({ model, offsetX, offsetY, ctx, theme, highResScaleFactorOverride, blockSizeXOverride, blockSizeYOverride, rasterTiles, }: {
|
|
5
5
|
offsetX: number;
|
|
6
6
|
offsetY: number;
|
|
7
7
|
theme: Theme;
|
|
8
8
|
model: MsaViewModel;
|
|
9
|
-
contrastScheme: Record<string, string>;
|
|
10
9
|
ctx: RenderCtx;
|
|
11
10
|
highResScaleFactorOverride?: number;
|
|
12
11
|
blockSizeXOverride?: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { setFontSize } from '../../setFontSize.js';
|
|
2
|
-
import { adjustColorForContrast } from '../../util.js';
|
|
2
|
+
import { adjustColorForContrast, contrastTextFn } from '../../util.js';
|
|
3
3
|
import { getVisibleLeaves } from '../getVisibleLeaves.js';
|
|
4
4
|
import { domainBandCursor } from './domainBandCursor.js';
|
|
5
5
|
import { tileColorFn } from './tileColor.js';
|
|
6
6
|
import { visibleColRange } from './visibleColRange.js';
|
|
7
|
-
export function renderMSABlock({ model, offsetX, offsetY,
|
|
7
|
+
export function renderMSABlock({ model, offsetX, offsetY, ctx, theme, highResScaleFactorOverride, blockSizeXOverride, blockSizeYOverride, rasterTiles, }) {
|
|
8
8
|
const { colWidth, blockSize, rowHeight, fontSize, highResScaleFactor, actuallyShowDomains, bgColor, } = model;
|
|
9
9
|
const k = highResScaleFactorOverride ?? highResScaleFactor;
|
|
10
10
|
const bx = blockSizeXOverride ?? blockSize;
|
|
@@ -29,7 +29,6 @@ export function renderMSABlock({ model, offsetX, offsetY, contrastScheme, ctx, t
|
|
|
29
29
|
model,
|
|
30
30
|
ctx,
|
|
31
31
|
theme,
|
|
32
|
-
contrastScheme,
|
|
33
32
|
xStart,
|
|
34
33
|
xEnd,
|
|
35
34
|
visibleLeaves,
|
|
@@ -50,35 +49,28 @@ export function renderMSABlock({ model, offsetX, offsetY, contrastScheme, ctx, t
|
|
|
50
49
|
});
|
|
51
50
|
ctx.resetTransform();
|
|
52
51
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
// readable text color per fill instead of assuming dark-on-light.
|
|
56
|
-
function domainLetterColors(model, theme) {
|
|
57
|
-
return new Map(Object.entries(model.fillPalette).map(([accession, fill]) => [
|
|
58
|
-
accession,
|
|
59
|
-
theme.palette.getContrastText(fill),
|
|
60
|
-
]));
|
|
61
|
-
}
|
|
62
|
-
function drawTilesAndText({ model, ctx, theme, contrastScheme, visibleLeaves, xStart, xEnd, referenceSeq, drawTiles, rasterTiles, }) {
|
|
63
|
-
const { bgColor, columns, colWidth, rowHeight, relativeTo, showMsaLetters, subFeatureRows, domainBandsByStart, } = model;
|
|
52
|
+
function drawTilesAndText({ model, ctx, theme, visibleLeaves, xStart, xEnd, referenceSeq, drawTiles, rasterTiles, }) {
|
|
53
|
+
const { bgColor, columns, colWidth, rowHeight, relativeTo, showMsaLetters, subFeatureRows, domainUnderline, domainBandsByStart, } = model;
|
|
64
54
|
const tiles = drawTiles && bgColor;
|
|
65
55
|
const paintTiles = tiles && !rasterTiles;
|
|
66
56
|
if (paintTiles || showMsaLetters) {
|
|
67
|
-
//
|
|
68
|
-
//
|
|
69
|
-
const needsColor = paintTiles ||
|
|
57
|
+
// a letter takes its color from the cell it lands on, so the scheme lookup
|
|
58
|
+
// is only waste when nothing draws letters
|
|
59
|
+
const needsColor = paintTiles || showMsaLetters;
|
|
70
60
|
const tileColor = tileColorFn(model);
|
|
61
|
+
// Domain fills come from a categorical palette with no fixed lightness, and
|
|
62
|
+
// a dynamic scheme colors a cell from its column, so a readable letter color
|
|
63
|
+
// is a question about the cell's own color rather than about its letter.
|
|
64
|
+
const contrastText = contrastTextFn(theme);
|
|
71
65
|
const offsetXAligned = xStart * colWidth;
|
|
72
66
|
const halfColWidth = colWidth / 2;
|
|
73
67
|
// note: -rowHeight/4 matches +rowHeight/4 in tree
|
|
74
68
|
const quarterRowHeight = rowHeight / 4;
|
|
75
69
|
// with the tiles coming from the domain overlay instead, letters sit either
|
|
76
70
|
// on a domain box or on the plain background; sub-row layout stacks the boxes
|
|
77
|
-
// above the letters
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
? domainLetterColors(model, theme)
|
|
81
|
-
: undefined;
|
|
71
|
+
// above the letters and letter-color mode shrinks them to a bar under the
|
|
72
|
+
// row, so neither leaves anything behind a letter
|
|
73
|
+
const overDomains = !drawTiles && !subFeatureRows && !domainUnderline;
|
|
82
74
|
for (let i = 0, l1 = visibleLeaves.length; i < l1; i++) {
|
|
83
75
|
const node = visibleLeaves[i];
|
|
84
76
|
const { name } = node.data;
|
|
@@ -104,15 +96,20 @@ function drawTilesAndText({ model, ctx, theme, contrastScheme, visibleLeaves, xS
|
|
|
104
96
|
const covering = bandAt(col);
|
|
105
97
|
ctx.fillStyle = covering
|
|
106
98
|
? // on top of a domain box: contrast against the box fill
|
|
107
|
-
|
|
108
|
-
:
|
|
109
|
-
? // on
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
99
|
+
contrastText(model.fillPalette[covering.annotation.accession])
|
|
100
|
+
: isMatchingReference
|
|
101
|
+
? // the dot sits on the faint reference-match wash, which is
|
|
102
|
+
// the theme's background with a little of its text color in it
|
|
103
|
+
theme.palette.text.primary
|
|
104
|
+
: tiles
|
|
105
|
+
? // on top of a colored tile, or on the background where the
|
|
106
|
+
// scheme gives that cell no color
|
|
107
|
+
contrastText(color)
|
|
108
|
+
: bgColor || !color
|
|
109
|
+
? // plain background, uncolored letters
|
|
110
|
+
theme.palette.text.primary
|
|
111
|
+
: // letter-color mode: darken/lighten to stay readable
|
|
112
|
+
adjustColorForContrast(color, theme.palette.background.default);
|
|
116
113
|
ctx.fillText(isMatchingReference ? '.' : letter, x + halfColWidth, textY);
|
|
117
114
|
}
|
|
118
115
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderMSABlock.js","sourceRoot":"","sources":["../../../src/components/msa/renderMSABlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"renderMSABlock.js","sourceRoot":"","sources":["../../../src/components/msa/renderMSABlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CA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,MAAM,CAAC,GAAG,IAAI,CAAC,CAAE,CAAA;YACjB,KAAK,MAAM,EAAE,GAAG,EAAE,IAAI,UAAU,EAAE,CAAC;gBACjC,IAAI,GAAG,IAAI,MAAM,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBAChC,MAAM,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAA;oBACxB,MAAM,GAAG,GAAG,CAAC,GAAG,SAAS,CAAA;oBACzB,MAAM,MAAM,GAAG,CAAC,CAAA;oBAChB,GAAG,CAAC,SAAS,EAAE,CAAA;oBACf,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,GAAG,GAAG,MAAM,CAAC,CAAA;oBACpC,IAAI,QAAQ,GAAG,GAAG,CAAA;oBAClB,IAAI,OAAO,GAAG,IAAI,CAAA;oBAClB,OAAO,QAAQ,GAAG,MAAM,EAAE,CAAC;wBACzB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;wBACtD,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,OAAO,CAAA;wBACjD,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,MAAM,EAAE,KAAK,GAAG,MAAM,CAAC,CAAA;wBAC1C,QAAQ,GAAG,KAAK,CAAA;wBAChB,OAAO,GAAG,CAAC,OAAO,CAAA;oBACpB,CAAC;oBACD,GAAG,CAAC,MAAM,EAAE,CAAA;gBACd,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import { clickColor, hoverColor, multiRowHoverColor
|
|
2
|
-
import {
|
|
3
|
-
// the persistent highlightColumns overlay: a stronger fill plus a solid border
|
|
4
|
-
// so a domain/motif band reads clearly over the colored alignment cells (the
|
|
5
|
-
// faint hover-style wash alone is invisible against clustalx coloring)
|
|
6
|
-
const highlightColumnsFill = 'rgba(255,140,0,0.28)';
|
|
7
|
-
const highlightColumnsBorder = 'rgba(210,90,0,0.95)';
|
|
1
|
+
import { clickColor, hoverColor, multiRowHoverColor } from '../overlayColors.js';
|
|
2
|
+
import { renderPersistentHighlights } from './renderHighlights.js';
|
|
8
3
|
export function renderMouseover({ ctx, model, theme, }) {
|
|
9
|
-
const { mouseCol, colWidth, msaCanvasWidth: width, height, rowHeight, scrollX, scrollY, mouseRow, mouseClickRow, mouseClickCol, highResScaleFactor,
|
|
4
|
+
const { mouseCol, colWidth, msaCanvasWidth: width, height, rowHeight, scrollX, scrollY, mouseRow, mouseClickRow, mouseClickCol, highResScaleFactor, hoveredRowIndices, } = model;
|
|
10
5
|
ctx.resetTransform();
|
|
11
6
|
ctx.clearRect(0, 0, width * highResScaleFactor, height * highResScaleFactor);
|
|
12
7
|
ctx.scale(highResScaleFactor, highResScaleFactor);
|
|
@@ -18,28 +13,7 @@ export function renderMouseover({ ctx, model, theme, }) {
|
|
|
18
13
|
const colBand = (index) => {
|
|
19
14
|
ctx.fillRect(index * colWidth + scrollX, 0, colWidth, height);
|
|
20
15
|
};
|
|
21
|
-
|
|
22
|
-
// tree node
|
|
23
|
-
if (referenceRowIndex !== undefined) {
|
|
24
|
-
ctx.fillStyle = referenceColor;
|
|
25
|
-
rowBand(referenceRowIndex);
|
|
26
|
-
}
|
|
27
|
-
ctx.fillStyle = multiRowHoverColor;
|
|
28
|
-
for (const rowIndex of hoveredRowIndices) {
|
|
29
|
-
rowBand(rowIndex);
|
|
30
|
-
}
|
|
31
|
-
// each contiguous run of highlighted columns draws as one filled, bordered
|
|
32
|
-
// band, so a domain/motif highlight stays visible over the alignment
|
|
33
|
-
ctx.lineWidth = 2;
|
|
34
|
-
for (const { start, end } of highlightedColumnRuns) {
|
|
35
|
-
const x = start * colWidth + scrollX;
|
|
36
|
-
const w = (end - start + 1) * colWidth;
|
|
37
|
-
ctx.fillStyle = highlightColumnsFill;
|
|
38
|
-
ctx.fillRect(x, 0, w, height);
|
|
39
|
-
ctx.strokeStyle = highlightColumnsBorder;
|
|
40
|
-
ctx.strokeRect(x, 0, w, height);
|
|
41
|
-
}
|
|
42
|
-
renderHighlights({
|
|
16
|
+
renderPersistentHighlights({
|
|
43
17
|
ctx,
|
|
44
18
|
model,
|
|
45
19
|
theme,
|
|
@@ -48,6 +22,11 @@ export function renderMouseover({ ctx, model, theme, }) {
|
|
|
48
22
|
width,
|
|
49
23
|
height,
|
|
50
24
|
});
|
|
25
|
+
// every tip under a hovered tree node stays lit
|
|
26
|
+
ctx.fillStyle = multiRowHoverColor;
|
|
27
|
+
for (const rowIndex of hoveredRowIndices) {
|
|
28
|
+
rowBand(rowIndex);
|
|
29
|
+
}
|
|
51
30
|
ctx.fillStyle = hoverColor;
|
|
52
31
|
if (mouseCol !== undefined) {
|
|
53
32
|
colBand(mouseCol);
|