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,31 +3,17 @@ import React, { useState } from 'react'
|
|
|
3
3
|
import { makeStyles } from '@jbrowse/core/util/tss-react'
|
|
4
4
|
import { useTheme } from '@mui/material'
|
|
5
5
|
import { observer } from 'mobx-react'
|
|
6
|
-
import { createPortal } from 'react-dom'
|
|
7
6
|
|
|
8
7
|
import { useCanvasAutorun } from '../../useCanvasAutorun.ts'
|
|
8
|
+
import PortalTooltip from '../PortalTooltip.tsx'
|
|
9
9
|
import TreeBranchMenu from './TreeBranchMenu.tsx'
|
|
10
10
|
import TreeNodeMenu from './TreeNodeMenu.tsx'
|
|
11
|
-
import {
|
|
11
|
+
import { renderTreeCanvas } from './renderTreeCanvas.ts'
|
|
12
12
|
import { useTreeHover } from './useTreeHover.ts'
|
|
13
13
|
|
|
14
14
|
import type { MsaViewModel } from '../../model.ts'
|
|
15
15
|
|
|
16
|
-
const useStyles = makeStyles()(
|
|
17
|
-
tooltip: {
|
|
18
|
-
position: 'fixed',
|
|
19
|
-
pointerEvents: 'none',
|
|
20
|
-
zIndex: 10000,
|
|
21
|
-
backgroundColor: theme.palette.grey[700],
|
|
22
|
-
color: theme.palette.common.white,
|
|
23
|
-
padding: '4px 8px',
|
|
24
|
-
borderRadius: 4,
|
|
25
|
-
fontSize: 12,
|
|
26
|
-
whiteSpace: 'nowrap',
|
|
27
|
-
maxWidth: 300,
|
|
28
|
-
overflow: 'hidden',
|
|
29
|
-
textOverflow: 'ellipsis',
|
|
30
|
-
},
|
|
16
|
+
const useStyles = makeStyles()(() => ({
|
|
31
17
|
hover: {
|
|
32
18
|
position: 'absolute',
|
|
33
19
|
pointerEvents: 'none',
|
|
@@ -58,7 +44,8 @@ const TreeCanvasBlock = observer(function ({
|
|
|
58
44
|
useTreeHover({ model, offsetY })
|
|
59
45
|
|
|
60
46
|
const { treeAreaWidth, blockSize, highResScaleFactor } = model
|
|
61
|
-
|
|
47
|
+
// TreePanel clips to treeAreaWidth, so a wider canvas is wasted backing store
|
|
48
|
+
const width = treeAreaWidth
|
|
62
49
|
const height = blockSize
|
|
63
50
|
|
|
64
51
|
const canvasWidth = width * highResScaleFactor
|
|
@@ -152,20 +139,11 @@ const TreeCanvasBlock = observer(function ({
|
|
|
152
139
|
/>
|
|
153
140
|
) : null}
|
|
154
141
|
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<div
|
|
161
|
-
className={classes.tooltip}
|
|
162
|
-
style={{ left: hovered.clientX + 12, top: hovered.clientY + 12 }}
|
|
163
|
-
>
|
|
164
|
-
{hovered.name}
|
|
165
|
-
</div>,
|
|
166
|
-
document.body,
|
|
167
|
-
)
|
|
168
|
-
: null}
|
|
142
|
+
{hovered ? (
|
|
143
|
+
<PortalTooltip clientX={hovered.clientX} clientY={hovered.clientY}>
|
|
144
|
+
{hovered.name}
|
|
145
|
+
</PortalTooltip>
|
|
146
|
+
) : null}
|
|
169
147
|
</>
|
|
170
148
|
)
|
|
171
149
|
})
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '@mui/material'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
5
|
+
|
|
6
|
+
import { useCanvasAutorun } from '../../useCanvasAutorun.ts'
|
|
7
|
+
import {
|
|
8
|
+
drawTreeOverview,
|
|
9
|
+
drawTreeOverviewBox,
|
|
10
|
+
treeOverviewImage,
|
|
11
|
+
} from './renderTreeOverview.ts'
|
|
12
|
+
|
|
13
|
+
import type { MsaViewModel } from '../../model.ts'
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The brush on the row scale: the whole tree drawn small above the tree panel,
|
|
17
|
+
* with the focused subtree boxed. A click focuses the subtree under the
|
|
18
|
+
* pointer, and a click inside the box clears the focus.
|
|
19
|
+
*
|
|
20
|
+
* The tree itself comes off a cached offscreen canvas, so the frames a pointer
|
|
21
|
+
* moving across it costs are a blit and two boxes.
|
|
22
|
+
*/
|
|
23
|
+
const TreeOverview = observer(function ({ model }: { model: MsaViewModel }) {
|
|
24
|
+
const { treeAreaWidth, overviewHeight, highResScaleFactor } = model
|
|
25
|
+
const theme = useTheme()
|
|
26
|
+
const [hover, setHover] = useState<{ id: string; rows: [number, number] }>()
|
|
27
|
+
const width = Math.round(treeAreaWidth * highResScaleFactor)
|
|
28
|
+
const height = Math.round(overviewHeight * highResScaleFactor)
|
|
29
|
+
|
|
30
|
+
const ref = useCanvasAutorun({
|
|
31
|
+
draw: ctx => {
|
|
32
|
+
ctx.resetTransform()
|
|
33
|
+
ctx.clearRect(0, 0, width, height)
|
|
34
|
+
const image = treeOverviewImage({
|
|
35
|
+
model,
|
|
36
|
+
theme,
|
|
37
|
+
width: treeAreaWidth,
|
|
38
|
+
height: overviewHeight,
|
|
39
|
+
scale: highResScaleFactor,
|
|
40
|
+
})
|
|
41
|
+
ctx.scale(highResScaleFactor, highResScaleFactor)
|
|
42
|
+
const box = { model, ctx, width: treeAreaWidth, height: overviewHeight }
|
|
43
|
+
if (image) {
|
|
44
|
+
ctx.drawImage(
|
|
45
|
+
image,
|
|
46
|
+
0,
|
|
47
|
+
0,
|
|
48
|
+
image.width,
|
|
49
|
+
image.height,
|
|
50
|
+
0,
|
|
51
|
+
0,
|
|
52
|
+
box.width,
|
|
53
|
+
box.height,
|
|
54
|
+
)
|
|
55
|
+
} else {
|
|
56
|
+
drawTreeOverview({ ...box, theme })
|
|
57
|
+
}
|
|
58
|
+
if (hover) {
|
|
59
|
+
drawTreeOverviewBox({
|
|
60
|
+
...box,
|
|
61
|
+
rows: hover.rows,
|
|
62
|
+
color: theme.palette.text.secondary,
|
|
63
|
+
})
|
|
64
|
+
}
|
|
65
|
+
const focus = model.treeOverviewFocusRows
|
|
66
|
+
if (focus) {
|
|
67
|
+
drawTreeOverviewBox({
|
|
68
|
+
...box,
|
|
69
|
+
rows: focus,
|
|
70
|
+
color: theme.palette.text.primary,
|
|
71
|
+
})
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
width,
|
|
75
|
+
height,
|
|
76
|
+
deps: [model, theme, hover],
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
return (
|
|
80
|
+
<canvas
|
|
81
|
+
data-testid="tree_overview"
|
|
82
|
+
ref={ref}
|
|
83
|
+
width={width}
|
|
84
|
+
height={height}
|
|
85
|
+
style={{
|
|
86
|
+
display: 'block',
|
|
87
|
+
flexShrink: 0,
|
|
88
|
+
cursor: 'pointer',
|
|
89
|
+
width: treeAreaWidth,
|
|
90
|
+
height: overviewHeight,
|
|
91
|
+
}}
|
|
92
|
+
onMouseMove={event => {
|
|
93
|
+
const hit = model.treeOverviewHit(event.nativeEvent.offsetY)
|
|
94
|
+
setHover(prev => (prev?.id === hit?.id ? prev : hit))
|
|
95
|
+
}}
|
|
96
|
+
onMouseLeave={() => {
|
|
97
|
+
setHover(undefined)
|
|
98
|
+
}}
|
|
99
|
+
onClick={event => {
|
|
100
|
+
model.treeOverviewClick(event.nativeEvent.offsetY)
|
|
101
|
+
}}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
})
|
|
105
|
+
|
|
106
|
+
export default TreeOverview
|
|
@@ -1,16 +1,40 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
|
|
3
|
+
import { useTheme } from '@mui/material'
|
|
3
4
|
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
6
|
+
import { treeScaleBarHeight as h } from '../../constants.ts'
|
|
7
|
+
|
|
5
8
|
import type { MsaViewModel } from '../../model.ts'
|
|
6
9
|
|
|
7
|
-
// The gutter above the tree panel
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
+
// The gutter above the tree panel, the width of the tree area, so the strip
|
|
11
|
+
// headers beside it start where the strips do. A phylogram fills it with a
|
|
12
|
+
// scale bar: without one the branch lengths are drawn to a scale nothing
|
|
13
|
+
// states.
|
|
10
14
|
const TreeRuler = observer(({ model }: { model: MsaViewModel }) => {
|
|
11
|
-
const { treeAreaWidth,
|
|
15
|
+
const { treeAreaWidth, marginLeft, treeScaleBar: bar } = model
|
|
16
|
+
const theme = useTheme()
|
|
17
|
+
|
|
12
18
|
return (
|
|
13
|
-
<div style={{ flexShrink: 0, width: treeAreaWidth
|
|
19
|
+
<div style={{ flexShrink: 0, width: treeAreaWidth }}>
|
|
20
|
+
{bar ? (
|
|
21
|
+
<svg
|
|
22
|
+
width={treeAreaWidth}
|
|
23
|
+
height={h}
|
|
24
|
+
style={{ display: 'block' }}
|
|
25
|
+
color={theme.palette.text.primary}
|
|
26
|
+
>
|
|
27
|
+
<text x={marginLeft} y={h - 9} fontSize={10} fill="currentColor">
|
|
28
|
+
{bar.label}
|
|
29
|
+
</text>
|
|
30
|
+
<path
|
|
31
|
+
d={`M${marginLeft} ${h - 7} v6 h${bar.px} v-6`}
|
|
32
|
+
fill="none"
|
|
33
|
+
stroke="currentColor"
|
|
34
|
+
/>
|
|
35
|
+
</svg>
|
|
36
|
+
) : null}
|
|
37
|
+
</div>
|
|
14
38
|
)
|
|
15
39
|
})
|
|
16
40
|
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { measureTextCanvas } from '../../measureTextCanvas.ts'
|
|
2
|
+
|
|
3
|
+
import type { ResolvedClade } from '../../types.ts'
|
|
4
|
+
|
|
5
|
+
// The bar of the bracket mark and the space around it, in px.
|
|
6
|
+
export const bracketBarWidth = 3
|
|
7
|
+
export const bracketGap = 4
|
|
8
|
+
|
|
9
|
+
// The widest gutter the bracket mark takes. A longer label is clipped, so one
|
|
10
|
+
// long name cannot squeeze the tree it annotates.
|
|
11
|
+
export const maxCladeGutterWidth = 140
|
|
12
|
+
|
|
13
|
+
/** whether a clade draws in the gutter: a bracket, or a highlight with a label */
|
|
14
|
+
export function cladeInGutter(clade: ResolvedClade) {
|
|
15
|
+
return (
|
|
16
|
+
clade.mark === 'bracket' || (clade.mark === 'highlight' && !!clade.label)
|
|
17
|
+
)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** the pixel height of the rows a clade covers */
|
|
21
|
+
export function cladeHeight(clade: ResolvedClade, rowHeight: number) {
|
|
22
|
+
return (clade.rows[1] - clade.rows[0] + 1) * rowHeight
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Whether a label reads across the rows. It does where they are taller than the
|
|
27
|
+
* font, and runs up the bar where they are not.
|
|
28
|
+
*/
|
|
29
|
+
export function cladeLabelHorizontal(
|
|
30
|
+
clade: ResolvedClade,
|
|
31
|
+
rowHeight: number,
|
|
32
|
+
fontSize: number,
|
|
33
|
+
) {
|
|
34
|
+
return cladeHeight(clade, rowHeight) >= fontSize
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** the px between the left edge of the gutter and the label's own column */
|
|
38
|
+
export function cladeLabelOffset(clade: ResolvedClade) {
|
|
39
|
+
return clade.mark === 'bracket'
|
|
40
|
+
? bracketGap + bracketBarWidth + bracketGap
|
|
41
|
+
: bracketGap
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The gutter the bracket mark needs at the right of the tree area: the bar plus
|
|
46
|
+
* the widest label at the tree font, zero where no clade draws there, and at
|
|
47
|
+
* most maxCladeGutterWidth.
|
|
48
|
+
*/
|
|
49
|
+
export function cladeGutterWidth({
|
|
50
|
+
clades,
|
|
51
|
+
rowHeight,
|
|
52
|
+
fontSize,
|
|
53
|
+
}: {
|
|
54
|
+
clades: ResolvedClade[]
|
|
55
|
+
rowHeight: number
|
|
56
|
+
fontSize: number
|
|
57
|
+
}) {
|
|
58
|
+
let widest = 0
|
|
59
|
+
for (const clade of clades) {
|
|
60
|
+
if (!cladeInGutter(clade)) {
|
|
61
|
+
continue
|
|
62
|
+
}
|
|
63
|
+
const text = clade.label
|
|
64
|
+
? cladeLabelHorizontal(clade, rowHeight, fontSize)
|
|
65
|
+
? measureTextCanvas(clade.label, fontSize)
|
|
66
|
+
: fontSize
|
|
67
|
+
: 0
|
|
68
|
+
widest = Math.max(widest, cladeLabelOffset(clade) + text + bracketGap)
|
|
69
|
+
}
|
|
70
|
+
// a whole pixel, so the room the renderers measure against covers the label
|
|
71
|
+
// the measurement here sized the gutter for
|
|
72
|
+
return Math.min(maxCladeGutterWidth, Math.ceil(widest))
|
|
73
|
+
}
|
|
@@ -21,8 +21,8 @@ const TreeNodeInfoDialog = observer(function ({
|
|
|
21
21
|
nodeName: string
|
|
22
22
|
onClose: () => void
|
|
23
23
|
}) {
|
|
24
|
-
const {
|
|
25
|
-
const metadata =
|
|
24
|
+
const { rows } = model
|
|
25
|
+
const metadata = model.rowDataOf(nodeName)
|
|
26
26
|
const res = rows.find(f => f[0] === nodeName)
|
|
27
27
|
return (
|
|
28
28
|
<Dialog
|