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
|
@@ -3,38 +3,46 @@ import ExpandLess from '@mui/icons-material/ExpandLess';
|
|
|
3
3
|
import ExpandMore from '@mui/icons-material/ExpandMore';
|
|
4
4
|
import { IconButton, Paper, Typography } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
+
import { legendZIndex } from '../../constants.js';
|
|
7
|
+
import { legendRows } from './legendRows.js';
|
|
6
8
|
const AnnotationLegend = observer(function ({ model, }) {
|
|
7
|
-
const {
|
|
9
|
+
const { legends, showDomainLegend: expanded } = model;
|
|
10
|
+
const rows = legendRows(legends);
|
|
8
11
|
const ExpandIcon = expanded ? ExpandLess : ExpandMore;
|
|
9
|
-
return
|
|
12
|
+
return rows.length > 0 ? (React.createElement(Paper, { elevation: 3, style: {
|
|
10
13
|
position: 'absolute',
|
|
11
14
|
top: 4,
|
|
12
15
|
right: 4,
|
|
13
|
-
zIndex:
|
|
14
|
-
maxWidth:
|
|
16
|
+
zIndex: legendZIndex,
|
|
17
|
+
maxWidth: 220,
|
|
15
18
|
maxHeight: '60%',
|
|
16
19
|
display: 'flex',
|
|
17
20
|
flexDirection: 'column',
|
|
18
21
|
opacity: 0.95,
|
|
19
22
|
} },
|
|
20
|
-
React.createElement("
|
|
23
|
+
React.createElement(IconButton, { size: "small", title: expanded ? 'Collapse key' : 'Expand key', style: expanded
|
|
24
|
+
? { position: 'absolute', top: 0, right: 0, padding: 1 }
|
|
25
|
+
: { padding: 1 }, onClick: () => {
|
|
26
|
+
model.setShowDomainLegend(!expanded);
|
|
27
|
+
} },
|
|
28
|
+
React.createElement(ExpandIcon, { style: { fontSize: 14 } })),
|
|
29
|
+
expanded ? (React.createElement("div", { style: { overflow: 'auto', padding: '2px 6px 4px' } }, rows.map((row, i) => (React.createElement("div", { key: row.key, style: {
|
|
21
30
|
display: 'flex',
|
|
22
31
|
alignItems: 'center',
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} },
|
|
26
|
-
React.createElement(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
React.createElement(ExpandIcon, { fontSize: "small" }))),
|
|
30
|
-
expanded ? (React.createElement("div", { style: { overflow: 'auto', padding: '0 8px 6px' } }, visible.map(({ accession, name }) => (React.createElement("div", { key: accession, style: { display: 'flex', alignItems: 'center', gap: 6 }, title: accession },
|
|
31
|
-
React.createElement("div", { style: {
|
|
32
|
-
width: 12,
|
|
33
|
-
height: 12,
|
|
32
|
+
gap: 4,
|
|
33
|
+
marginRight: i === 0 ? 18 : 0,
|
|
34
|
+
}, title: row.hint },
|
|
35
|
+
row.color ? (React.createElement("div", { style: {
|
|
36
|
+
width: 9,
|
|
37
|
+
height: 9,
|
|
34
38
|
flexShrink: 0,
|
|
35
|
-
background:
|
|
36
|
-
} }),
|
|
37
|
-
React.createElement(Typography, { variant: "caption", noWrap: true
|
|
39
|
+
background: row.color,
|
|
40
|
+
} })) : null,
|
|
41
|
+
React.createElement(Typography, { variant: "caption", noWrap: true, style: {
|
|
42
|
+
fontSize: 10,
|
|
43
|
+
lineHeight: 1.4,
|
|
44
|
+
fontWeight: row.color ? undefined : 'bold',
|
|
45
|
+
} }, row.label)))))) : null)) : null;
|
|
38
46
|
});
|
|
39
47
|
export default AnnotationLegend;
|
|
40
48
|
//# sourceMappingURL=AnnotationLegend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationLegend.js","sourceRoot":"","sources":["../../../src/components/msa/AnnotationLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,UAAU,MAAM,gCAAgC,CAAA;AACvD,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,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AC,CAAC,CAAC,MAAM;iBAC3C,IAEA,GAAG,CAAC,KAAK,CACC,CACT,CACP,CAAC,CACE,CACP,CAAC,CAAC,CAAC,IAAI,CACF,CACT,CAAC,CAAC,CAAC,IAAI,CAAA;AACV,CAAC,CAAC,CAAA;AAEF,eAAe,gBAAgB,CAAA"}
|
|
@@ -13,7 +13,7 @@ const MSACanvas = observer(function ({ model }) {
|
|
|
13
13
|
model.doScrollY(d);
|
|
14
14
|
}, [model]);
|
|
15
15
|
const onZoom = useCallback((scaleFactor, offsetX, offsetY) => {
|
|
16
|
-
model.zoomToPos(scaleFactor, offsetX, offsetY);
|
|
16
|
+
model.zoomToPos(scaleFactor, offsetX, offsetY, model.wheelZoomAxis);
|
|
17
17
|
}, [model]);
|
|
18
18
|
const { onMouseDown, onMouseUp } = useWheelScroll({
|
|
19
19
|
ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSACanvas.js","sourceRoot":"","sources":["../../../src/components/msa/MSACanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAElD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,OAAO,MAAM,cAAe,CAAA;AACnC,OAAO,cAAc,MAAM,qBAAsB,CAAA;AAIjD,MAAM,SAAS,GAAG,QAAQ,CAAC,UAAU,EAAE,KAAK,EAA2B;IACrE,MAAM,EACJ,GAAG,EACH,aAAa,EACb,MAAM,EACN,cAAc,EACd,QAAQ,EACR,UAAU,EACV,OAAO,EACP,OAAO,GACR,GAAG,KAAK,CAAA;IACT,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAA;IACxC,MAAM,SAAS,GAAG,WAAW,CAC3B,CAAC,CAAS,EAAE,EAAE;QACZ,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC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,OAAG,CACZ,CACG,CACP,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,SAAS,CAAA"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import BaseTooltip from '@jbrowse/core/ui/BaseTooltip';
|
|
3
|
+
import { useTheme } from '@mui/material';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
5
|
import { useCanvasAutorun } from '../../useCanvasAutorun.js';
|
|
5
|
-
import { useColorContrast } from '../../useColorContrast.js';
|
|
6
|
-
import ColumnStats from './ColumnStats.js';
|
|
7
6
|
import { drawMsaRaster, rasterSupported } from './msaRaster.js';
|
|
8
7
|
import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock.js';
|
|
9
8
|
import { renderMSABlock } from './renderMSABlock.js';
|
|
10
9
|
import { useMsaBlockMouse } from './useMsaBlockMouse.js';
|
|
11
10
|
const MSACanvasBlock = observer(function ({ model, offsetX, offsetY, }) {
|
|
12
|
-
const {
|
|
13
|
-
const
|
|
11
|
+
const { blockSize, highResScaleFactor } = model;
|
|
12
|
+
const theme = useTheme();
|
|
14
13
|
const { tooltipPoint, onMouseMove, onClick, onMouseLeave } = useMsaBlockMouse({
|
|
15
14
|
model,
|
|
16
15
|
offsetX,
|
|
@@ -23,6 +22,7 @@ const MSACanvasBlock = observer(function ({ model, offsetX, offsetY, }) {
|
|
|
23
22
|
ctx.clearRect(0, 0, canvasSize, canvasSize);
|
|
24
23
|
renderBoxFeatureCanvasBlock({
|
|
25
24
|
ctx,
|
|
25
|
+
theme,
|
|
26
26
|
offsetX,
|
|
27
27
|
offsetY,
|
|
28
28
|
model,
|
|
@@ -39,16 +39,15 @@ const MSACanvasBlock = observer(function ({ model, offsetX, offsetY, }) {
|
|
|
39
39
|
theme,
|
|
40
40
|
offsetX,
|
|
41
41
|
offsetY,
|
|
42
|
-
contrastScheme,
|
|
43
42
|
model,
|
|
44
43
|
rasterTiles,
|
|
45
44
|
});
|
|
46
45
|
},
|
|
47
46
|
width: canvasSize,
|
|
48
47
|
height: canvasSize,
|
|
49
|
-
deps: [model, offsetX, offsetY, theme
|
|
48
|
+
deps: [model, offsetX, offsetY, theme],
|
|
50
49
|
});
|
|
51
|
-
const { hoveredInsertion, mouseOverDomains
|
|
50
|
+
const { hoveredInsertion, mouseOverDomains } = model;
|
|
52
51
|
return (React.createElement(React.Fragment, null,
|
|
53
52
|
React.createElement("canvas", { ref: ref, onMouseMove: event => {
|
|
54
53
|
if (ref.current) {
|
|
@@ -75,19 +74,17 @@ const MSACanvasBlock = observer(function ({ model, offsetX, offsetY, }) {
|
|
|
75
74
|
' ',
|
|
76
75
|
hoveredInsertion.letters.length > 20
|
|
77
76
|
? `${hoveredInsertion.letters.slice(0, 20)}...`
|
|
78
|
-
: hoveredInsertion.letters)) : (React.createElement(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
d.description)) : null))),
|
|
90
|
-
showColumnStats ? React.createElement(ColumnStats, { model: model }) : null)))) : null));
|
|
77
|
+
: hoveredInsertion.letters)) : (mouseOverDomains.map(d => (React.createElement("div", { key: `${d.accession}-${d.start}-${d.end}` },
|
|
78
|
+
React.createElement("b", null, d.name),
|
|
79
|
+
" (",
|
|
80
|
+
d.accession,
|
|
81
|
+
") ",
|
|
82
|
+
d.start,
|
|
83
|
+
"-",
|
|
84
|
+
d.end,
|
|
85
|
+
d.description ? (React.createElement(React.Fragment, null,
|
|
86
|
+
React.createElement("br", null),
|
|
87
|
+
d.description)) : null)))))) : null));
|
|
91
88
|
});
|
|
92
89
|
export default MSACanvasBlock;
|
|
93
90
|
//# sourceMappingURL=MSACanvasBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSACanvasBlock.js","sourceRoot":"","sources":["../../../src/components/msa/MSACanvasBlock.tsx"],"names":[],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Alive } from '@jbrowse/mobx-state-tree';
|
|
3
3
|
import { useTheme } from '@mui/material';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
+
import { msaOverlayZIndex } from '../../constants.js';
|
|
5
6
|
import { useCanvasAutorun } from '../../useCanvasAutorun.js';
|
|
6
7
|
import { renderMouseover } from './renderMSAMouseover.js';
|
|
7
8
|
const MSAMouseoverCanvas = observer(function ({ model, }) {
|
|
@@ -25,7 +26,7 @@ const MSAMouseoverCanvas = observer(function ({ model, }) {
|
|
|
25
26
|
left: 0,
|
|
26
27
|
width,
|
|
27
28
|
height,
|
|
28
|
-
zIndex:
|
|
29
|
+
zIndex: msaOverlayZIndex,
|
|
29
30
|
pointerEvents: 'none',
|
|
30
31
|
} }));
|
|
31
32
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MSAMouseoverCanvas.js","sourceRoot":"","sources":["../../../src/components/msa/MSAMouseoverCanvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAIzD,MAAM,kBAAkB,GAAG,QAAQ,CAAC,UAAU,EAC5C,KAAK,GAGN;IACC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAA;IACnE,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,WAAW,GAAG,KAAK,GAAG,kBAAkB,CAAA;IAC9C,MAAM,YAAY,GAAG,MAAM,GAAG,kBAAkB,CAAA;IAChD,MAAM,GAAG,GAAG,gBAAgB,CAAC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9C,MAAM,YAAY,GAAG,MAAM,GAAG,kBAAkB,CAAA;IAChD,MAAM,GAAG,GAAG,gBAAgB,CAAC;QAC3B,IAAI,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACnB,eAAe,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAA;YACxC,CAAC;QACH,CAAC;QACD,KAAK,EAAE,WAAW;QAClB,MAAM,EAAE,YAAY;QACpB,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;KACrB,CAAC,CAAA;IAEF,OAAO,CACL,gCACE,GAAG,EAAE,GAAG,EACR,EAAE,EAAC,WAAW,EACd,KAAK,EAAE,WAAW,EAClB,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE;YACL,QAAQ,EAAE,UAAU;YACpB,GAAG,EAAE,CAAC;YACN,IAAI,EAAE,CAAC;YACP,KAAK;YACL,MAAM;YACN,MAAM,EAAE,gBAAgB;YACxB,aAAa,EAAE,MAAM;SACtB,GACD,CACH,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,kBAAkB,CAAA"}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import type { DomainBand } from '../../types.ts';
|
|
2
2
|
/**
|
|
3
|
-
* Left-to-right cursor over one row's domain bands
|
|
4
|
-
*
|
|
5
|
-
* against.
|
|
3
|
+
* Left-to-right cursor over one row's domain bands that returns the band drawn
|
|
4
|
+
* on top at a column, for a letter's contrast color.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* actually sees is the last one painted over that column. `stackIndex` is that
|
|
11
|
-
* paint order.
|
|
6
|
+
* The overlay paints in `domainBands` order, largest first, so where signatures
|
|
7
|
+
* nest (InterProScan often emits a family enclosing a domain) the visible band
|
|
8
|
+
* is the last one painted. `stackIndex` is that paint order.
|
|
12
9
|
*
|
|
13
|
-
* `bands` must be sorted by start column (`domainBandsByStart`)
|
|
14
|
-
*
|
|
15
|
-
* Both keep this to one pass over the bands per row rather than a scan per cell.
|
|
10
|
+
* `bands` must be sorted by start column (`domainBandsByStart`) and columns
|
|
11
|
+
* visited in increasing order, which keeps this to one pass per row.
|
|
16
12
|
*/
|
|
17
13
|
export declare function domainBandCursor(bands: DomainBand[] | undefined): (col: number) => DomainBand | undefined;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Left-to-right cursor over one row's domain bands
|
|
3
|
-
*
|
|
4
|
-
* against.
|
|
2
|
+
* Left-to-right cursor over one row's domain bands that returns the band drawn
|
|
3
|
+
* on top at a column, for a letter's contrast color.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* actually sees is the last one painted over that column. `stackIndex` is that
|
|
10
|
-
* paint order.
|
|
5
|
+
* The overlay paints in `domainBands` order, largest first, so where signatures
|
|
6
|
+
* nest (InterProScan often emits a family enclosing a domain) the visible band
|
|
7
|
+
* is the last one painted. `stackIndex` is that paint order.
|
|
11
8
|
*
|
|
12
|
-
* `bands` must be sorted by start column (`domainBandsByStart`)
|
|
13
|
-
*
|
|
14
|
-
* Both keep this to one pass over the bands per row rather than a scan per cell.
|
|
9
|
+
* `bands` must be sorted by start column (`domainBandsByStart`) and columns
|
|
10
|
+
* visited in increasing order, which keeps this to one pass per row.
|
|
15
11
|
*/
|
|
16
12
|
export function domainBandCursor(bands) {
|
|
17
13
|
let next = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domainBandCursor.js","sourceRoot":"","sources":["../../../src/components/msa/domainBandCursor.ts"],"names":[],"mappings":"AAEA
|
|
1
|
+
{"version":3,"file":"domainBandCursor.js","sourceRoot":"","sources":["../../../src/components/msa/domainBandCursor.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAA+B;IAC9D,IAAI,IAAI,GAAG,CAAC,CAAA;IACZ,IAAI,MAAM,GAAiB,EAAE,CAAA;IAE7B,OAAO,CAAC,GAAW,EAAE,EAAE;QACrB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,OAAO,IAAI,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,IAAI,CAAE,CAAC,QAAQ,IAAI,GAAG,EAAE,CAAC;YAC3D,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAE,CAAC,CAAA;YACzB,IAAI,EAAE,CAAA;QACR,CAAC;QACD,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,EAAE,CAAC;YAC5C,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,CAAC,CAAA;QACnD,CAAC;QACD,IAAI,GAA2B,CAAA;QAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,UAAU,EAAE,CAAC;gBAC7C,GAAG,GAAG,IAAI,CAAA;YACZ,CAAC;QACH,CAAC;QACD,OAAO,GAAG,CAAA;IACZ,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { HierarchyNode } from '../../hierarchy.ts';
|
|
2
|
+
import type { Annotation, NodeWithIdsAndLength } from '../../types.ts';
|
|
3
|
+
import type { RenderCtx } from '../renderCtx.ts';
|
|
4
|
+
/** one drawn span: a feature, the lane it sits in, and its row's depth */
|
|
5
|
+
export interface SpanBand {
|
|
6
|
+
annotation: Annotation;
|
|
7
|
+
lane: number;
|
|
8
|
+
laneCount: number;
|
|
9
|
+
}
|
|
10
|
+
/** one row's spans, at the row baseline `y` the tree layout gives it */
|
|
11
|
+
export interface SpanRow<T extends SpanBand> {
|
|
12
|
+
y: number;
|
|
13
|
+
bands: T[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Where a band lands inside its row. The alignment overlay fills the row, bars
|
|
17
|
+
* it along the bottom, or stacks thin sub-rows; a `features` row panel divides
|
|
18
|
+
* the row between its lanes.
|
|
19
|
+
*/
|
|
20
|
+
export interface SpanLayout {
|
|
21
|
+
/** the band height in a row needing `laneCount` lanes */
|
|
22
|
+
height: (laneCount: number) => number;
|
|
23
|
+
/** the band's top edge, from its row baseline, its lane and its height */
|
|
24
|
+
top: (y: number, lane: number, height: number) => number;
|
|
25
|
+
/** how far a strand head reaches past the body */
|
|
26
|
+
headLength: (height: number) => number;
|
|
27
|
+
}
|
|
28
|
+
/** the rows of `bandsByRow` that `leaves` covers, in display order */
|
|
29
|
+
export declare function spanRows<T extends SpanBand>(leaves: HierarchyNode<NodeWithIdsAndLength>[], bandsByRow: Map<string, T[]>): SpanRow<T>[];
|
|
30
|
+
/**
|
|
31
|
+
* The span mark, in whatever x space the caller maps its bands into: alignment
|
|
32
|
+
* columns for the domain overlay, panel pixels for a `features` row panel. A
|
|
33
|
+
* feature with a strand draws as an arrow, one without as a box, and a label
|
|
34
|
+
* draws inside the span wherever the text fits.
|
|
35
|
+
*
|
|
36
|
+
* `xOf` returns the span's `[xStart, xEnd]` in the context's coordinates, and
|
|
37
|
+
* the context is translated so that `y - rowHeight` is the row's top edge.
|
|
38
|
+
*/
|
|
39
|
+
export declare function drawFeatureSpans<T extends SpanBand>({ ctx, rows, layout, xOf, colors, labelOf, labelDrawn, contrastText, xMin, xMax, }: {
|
|
40
|
+
ctx: RenderCtx;
|
|
41
|
+
rows: SpanRow<T>[];
|
|
42
|
+
layout: SpanLayout;
|
|
43
|
+
xOf: (band: T) => [number, number];
|
|
44
|
+
colors: Map<Annotation, {
|
|
45
|
+
fill: string;
|
|
46
|
+
stroke: string;
|
|
47
|
+
}>;
|
|
48
|
+
labelOf?: (band: T) => string | undefined;
|
|
49
|
+
labelDrawn?: (band: T) => void;
|
|
50
|
+
contrastText: (color: string) => string;
|
|
51
|
+
xMin: number;
|
|
52
|
+
xMax: number;
|
|
53
|
+
}): void;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** the rows of `bandsByRow` that `leaves` covers, in display order */
|
|
2
|
+
export function spanRows(leaves, bandsByRow) {
|
|
3
|
+
const rows = [];
|
|
4
|
+
for (const leaf of leaves) {
|
|
5
|
+
const bands = bandsByRow.get(leaf.data.name);
|
|
6
|
+
if (bands && bands.length > 0) {
|
|
7
|
+
rows.push({ y: leaf.x, bands });
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return rows;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The span mark, in whatever x space the caller maps its bands into: alignment
|
|
14
|
+
* columns for the domain overlay, panel pixels for a `features` row panel. A
|
|
15
|
+
* feature with a strand draws as an arrow, one without as a box, and a label
|
|
16
|
+
* draws inside the span wherever the text fits.
|
|
17
|
+
*
|
|
18
|
+
* `xOf` returns the span's `[xStart, xEnd]` in the context's coordinates, and
|
|
19
|
+
* the context is translated so that `y - rowHeight` is the row's top edge.
|
|
20
|
+
*/
|
|
21
|
+
export function drawFeatureSpans({ ctx, rows, layout, xOf, colors, labelOf, labelDrawn, contrastText, xMin, xMax, }) {
|
|
22
|
+
for (const { y, bands } of rows) {
|
|
23
|
+
const h = layout.height(bands[0].laneCount);
|
|
24
|
+
const headLen = layout.headLength(h);
|
|
25
|
+
for (const band of bands) {
|
|
26
|
+
const [xStart, xEnd] = xOf(band);
|
|
27
|
+
const w = xEnd - xStart;
|
|
28
|
+
if (xEnd < xMin || xStart > xMax) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const t = layout.top(y, band.lane, h);
|
|
32
|
+
const { fill, stroke } = colors.get(band.annotation);
|
|
33
|
+
ctx.fillStyle = fill;
|
|
34
|
+
ctx.strokeStyle = stroke;
|
|
35
|
+
const { strand } = band.annotation;
|
|
36
|
+
if (strand === undefined) {
|
|
37
|
+
ctx.fillRect(xStart, t, w, h);
|
|
38
|
+
ctx.strokeRect(xStart, t, w, h);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
drawGeneArrow({ ctx, x: xStart, t, w, h, headLen, strand });
|
|
42
|
+
}
|
|
43
|
+
const label = labelOf?.(band);
|
|
44
|
+
if (label !== undefined) {
|
|
45
|
+
const fontSize = Math.min(h - 2, 11);
|
|
46
|
+
ctx.font = `${fontSize}px sans-serif`;
|
|
47
|
+
if (ctx.measureText(label).width + 2 <= w) {
|
|
48
|
+
labelDrawn?.(band);
|
|
49
|
+
ctx.fillStyle = contrastText(fill);
|
|
50
|
+
ctx.textAlign = 'center';
|
|
51
|
+
ctx.textBaseline = 'middle';
|
|
52
|
+
ctx.fillText(label, xStart + w / 2, t + h / 2);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
// A gene arrow: a full-width rectangular body spanning the feature's
|
|
59
|
+
// start..end columns, plus a triangular head that points *beyond* that end in
|
|
60
|
+
// the strand direction (right for +, left for -). Keeping the body aligned to
|
|
61
|
+
// the exact start/end columns means + and - strand features read as having the
|
|
62
|
+
// same boundaries; the arrow lives outside them purely to show transcription
|
|
63
|
+
// direction, preserving the column-by-column homology down the rows.
|
|
64
|
+
function drawGeneArrow({ ctx, x, t, w, h, headLen, strand, }) {
|
|
65
|
+
const dir = strand > 0 ? 1 : -1;
|
|
66
|
+
const bodyStart = strand > 0 ? x : x + w;
|
|
67
|
+
const bodyEnd = strand > 0 ? x + w : x;
|
|
68
|
+
ctx.beginPath();
|
|
69
|
+
ctx.moveTo(bodyStart, t);
|
|
70
|
+
ctx.lineTo(bodyEnd, t);
|
|
71
|
+
ctx.lineTo(bodyEnd + dir * headLen, t + h / 2);
|
|
72
|
+
ctx.lineTo(bodyEnd, t + h);
|
|
73
|
+
ctx.lineTo(bodyStart, t + h);
|
|
74
|
+
ctx.closePath();
|
|
75
|
+
ctx.fill();
|
|
76
|
+
ctx.stroke();
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=drawFeatureSpans.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawFeatureSpans.js","sourceRoot":"","sources":["../../../src/components/msa/drawFeatureSpans.ts"],"names":[],"mappings":"AA+BA,sEAAsE;AACtE,MAAM,UAAU,QAAQ,CACtB,MAA6C,EAC7C,UAA4B;IAE5B,MAAM,IAAI,GAAiB,EAAE,CAAA;IAC7B,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5C,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAE,EAAE,KAAK,EAAE,CAAC,CAAA;QAClC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAAqB,EACnD,GAAG,EACH,IAAI,EACJ,MAAM,EACN,GAAG,EACH,MAAM,EACN,OAAO,EACP,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,IAAI,GAYL;IACC,KAAK,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,IAAI,IAAI,EAAE,CAAC;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,SAAS,CAAC,CAAA;QAC5C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;QACpC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,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AC,CAAC,CAAA;IAC1B,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;IAC5B,GAAG,CAAC,SAAS,EAAE,CAAA;IACf,GAAG,CAAC,IAAI,EAAE,CAAA;IACV,GAAG,CAAC,MAAM,EAAE,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// the legends flattened into the rows both the overlay and the export stack
|
|
2
|
+
// top to bottom. A title row separates one legend from the next, and a lone
|
|
3
|
+
// legend needs no title.
|
|
4
|
+
export function legendRows(legends) {
|
|
5
|
+
const titled = legends.length > 1;
|
|
6
|
+
return legends.flatMap(legend => [
|
|
7
|
+
...(titled ? [{ key: legend.id, label: legend.title }] : []),
|
|
8
|
+
...legend.entries.map(entry => ({
|
|
9
|
+
key: `${legend.id}:${entry.id}`,
|
|
10
|
+
label: entry.label,
|
|
11
|
+
color: entry.color,
|
|
12
|
+
hint: entry.id,
|
|
13
|
+
})),
|
|
14
|
+
]);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=legendRows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"legendRows.js","sourceRoot":"","sources":["../../../src/components/msa/legendRows.ts"],"names":[],"mappings":"AASA,4EAA4E;AAC5E,4EAA4E;AAC5E,yBAAyB;AACzB,MAAM,UAAU,UAAU,CAAC,OAAiB;IAC1C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,CAAC,CAAA;IACjC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC9B,GAAG,EAAE,GAAG,MAAM,CAAC,EAAE,IAAI,KAAK,CAAC,EAAE,EAAE;YAC/B,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE,KAAK,CAAC,EAAE;SACf,CAAC,CAAC;KACJ,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -12,21 +12,21 @@ export interface RasterSpec {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* CSS color string -> the packed pixel an ImageData holds for it. Painting a 1x1
|
|
15
|
-
* canvas and reading it back
|
|
16
|
-
*
|
|
17
|
-
* each distinct color is resolved once per session rather than once per cell.
|
|
15
|
+
* canvas and reading it back parses hex, rgb(), hsl() and named colors; the
|
|
16
|
+
* cache resolves each distinct color once per session.
|
|
18
17
|
*/
|
|
19
18
|
export declare function cssColorToPixel(css: string): number;
|
|
20
19
|
/**
|
|
21
20
|
* Packs a rectangle of the alignment into one pixel per cell, in `rowNames`
|
|
22
21
|
* order, ready to hand to putImageData. Cells past the end of a row, and rows
|
|
23
|
-
* with no sequence
|
|
24
|
-
* also leaves behind.
|
|
22
|
+
* with no sequence, stay transparent, as in the per-cell painter.
|
|
25
23
|
*
|
|
26
|
-
* `colStep`/`rowStep` sample
|
|
27
|
-
*
|
|
24
|
+
* `colStep`/`rowStep` sample every nth cell, which fits a whole alignment into
|
|
25
|
+
* the minimap's 12px bar. `colSpan`/`rowSpan` average each block of that many
|
|
26
|
+
* cells into one pixel, so a zoom below a device pixel per column still shows
|
|
27
|
+
* every column's color without blending neighbouring rows.
|
|
28
28
|
*/
|
|
29
|
-
export declare function rasterPixels({ spec, col0, row0, width, height, colStep, rowStep, toPixel, }: {
|
|
29
|
+
export declare function rasterPixels({ spec, col0, row0, width, height, colStep, rowStep, colSpan, rowSpan, toPixel, out, }: {
|
|
30
30
|
spec: RasterSpec;
|
|
31
31
|
col0: number;
|
|
32
32
|
row0: number;
|
|
@@ -34,14 +34,21 @@ export declare function rasterPixels({ spec, col0, row0, width, height, colStep,
|
|
|
34
34
|
height: number;
|
|
35
35
|
colStep?: number;
|
|
36
36
|
rowStep?: number;
|
|
37
|
+
colSpan?: number;
|
|
38
|
+
rowSpan?: number;
|
|
37
39
|
toPixel?: (css: string) => number;
|
|
38
|
-
|
|
40
|
+
out?: Uint32Array;
|
|
41
|
+
}): Uint32Array<ArrayBufferLike>;
|
|
39
42
|
export declare function rasterSupported(): boolean;
|
|
40
43
|
/**
|
|
41
44
|
* Paints the alignment background of one MSA block from cached
|
|
42
45
|
* one-pixel-per-cell tiles. The tiles do not depend on the zoom level, so a zoom
|
|
43
|
-
* frame costs a handful of drawImage calls
|
|
44
|
-
*
|
|
46
|
+
* frame costs a handful of drawImage calls. A fillRect per visible cell measured
|
|
47
|
+
* 885ms per block at the minimum column width.
|
|
48
|
+
*
|
|
49
|
+
* Below a device pixel per cell the tiles average cells together, per axis.
|
|
50
|
+
* The browser's image smoothing blurs both axes, which turns every row
|
|
51
|
+
* boundary into a gradient at fit-to-width, where only the columns are narrow.
|
|
45
52
|
*/
|
|
46
53
|
export declare function drawMsaRaster({ ctx, model, theme, offsetX, offsetY, }: {
|
|
47
54
|
ctx: CanvasRenderingContext2D;
|
|
@@ -53,26 +60,23 @@ export declare function drawMsaRaster({ ctx, model, theme, offsetX, offsetY, }:
|
|
|
53
60
|
/**
|
|
54
61
|
* A raster canvas as a PNG data URI, for embedding in the SVG export.
|
|
55
62
|
*
|
|
56
|
-
* toDataURL is the synchronous read-back. The DOM canvas
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* signal to fall back to drawing the thing in vector.
|
|
63
|
+
* toDataURL is the synchronous read-back. The DOM canvas and a headless node
|
|
64
|
+
* canvas have it; a browser OffscreenCanvas, which the tile and thumbnail
|
|
65
|
+
* caches hold where it exists, is copied onto a DOM canvas first. Returns
|
|
66
|
+
* undefined where read-back is unavailable (jsdom), and the caller then draws
|
|
67
|
+
* in vector.
|
|
62
68
|
*/
|
|
63
69
|
export declare function canvasHref(canvas: RasterCanvas | undefined): string | undefined;
|
|
64
70
|
/**
|
|
65
71
|
* The alignment rectangle [col0, col0+numCols) x [row0, row0+numRows) as a PNG
|
|
66
72
|
* data URI, for the SVG export.
|
|
67
73
|
*
|
|
68
|
-
* SVG has no blit, so the export
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
* path emits a <rect> per cell, and a 200x500 alignment exhausts the heap
|
|
72
|
-
* building them.
|
|
74
|
+
* SVG has no blit, so the export draws the whole background as one <image>. The
|
|
75
|
+
* vector path emits a <rect> per cell, and a 200x500 alignment exhausts the
|
|
76
|
+
* heap building them.
|
|
73
77
|
*
|
|
74
|
-
* Returns undefined
|
|
75
|
-
*
|
|
78
|
+
* Returns undefined where a canvas cannot be read back (jsdom), and the caller
|
|
79
|
+
* then keeps the per-cell path.
|
|
76
80
|
*/
|
|
77
81
|
export declare function rasterImageHref({ model, theme, col0, row0, numCols, numRows, }: {
|
|
78
82
|
model: MsaViewModel;
|
|
@@ -83,9 +87,8 @@ export declare function rasterImageHref({ model, theme, col0, row0, numCols, num
|
|
|
83
87
|
numRows: number;
|
|
84
88
|
}): string | undefined;
|
|
85
89
|
/**
|
|
86
|
-
* The whole alignment sampled down to a strip
|
|
87
|
-
*
|
|
88
|
-
* exactly the same conditions.
|
|
90
|
+
* The whole alignment sampled down to a strip behind the minimap thumb, cached
|
|
91
|
+
* with the block tiles since the same keys invalidate both.
|
|
89
92
|
*/
|
|
90
93
|
export declare function msaThumbnail({ model, theme, height, }: {
|
|
91
94
|
model: MsaViewModel;
|