@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.2
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/esm/FeatureTrack/configSchema.d.ts +104 -65
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +250 -121
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +16 -7
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +32 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +19 -23
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +13 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/Rubberband.js +13 -16
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +16 -21
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +58 -66
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
- package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
- package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
- package/esm/LinearGenomeView/components/util.d.ts +20 -6
- package/esm/LinearGenomeView/components/util.js +27 -6
- package/esm/LinearGenomeView/consts.d.ts +7 -2
- package/esm/LinearGenomeView/consts.js +18 -2
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +27 -0
- package/esm/LinearGenomeView/headerFit.js +59 -0
- package/esm/LinearGenomeView/index.d.ts +32 -2
- package/esm/LinearGenomeView/index.js +16 -6
- package/esm/LinearGenomeView/initKeys.d.ts +12 -0
- package/esm/LinearGenomeView/initKeys.js +68 -0
- package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
- package/esm/LinearGenomeView/keyboardHandler.js +10 -0
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +23 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
- package/esm/LinearGenomeView/lazyDialogs.js +3 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
- package/esm/LinearGenomeView/linkedViewSync.js +58 -0
- package/esm/LinearGenomeView/menuItems.d.ts +27 -2
- package/esm/LinearGenomeView/menuItems.js +137 -101
- package/esm/LinearGenomeView/model.d.ts +3238 -136
- package/esm/LinearGenomeView/model.js +2425 -528
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
- package/esm/LinearGenomeView/stickyChrome.js +30 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
- package/esm/LinearGenomeView/types.d.ts +17 -31
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +332 -12
- package/esm/LinearGenomeView/util.js +606 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
- package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +1 -0
- package/esm/MultiLevelRubberband/types.d.ts +6 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
- package/esm/displayKitTests/perRegionTestEnv.js +138 -0
- package/esm/index.d.ts +122 -1235
- package/esm/index.js +101 -24
- package/esm/lazyPluginExports.d.ts +23 -0
- package/esm/lazyPluginExports.js +36 -0
- package/esm/searchUtils.d.ts +55 -11
- package/esm/searchUtils.js +342 -45
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +33 -0
- package/esm/shared/coordLabels.d.ts +40 -0
- package/esm/shared/coordLabels.js +119 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { useLocalStorage } from '@jbrowse/core/util/hooks';
|
|
2
|
+
/**
|
|
3
|
+
* Visibility and orientation of the search-box strip a stacked-LGV header
|
|
4
|
+
* draws, persisted per regime (few vs many rows) rather than under one global
|
|
5
|
+
* key, so the "compact default" heuristic isn't permanently overridden by a
|
|
6
|
+
* choice made in a differently-sized view.
|
|
7
|
+
*
|
|
8
|
+
* `prefix` keys the storage per container — the comparative view and the
|
|
9
|
+
* breakpoint split view remember their own. Everything else is shared, because
|
|
10
|
+
* the two headers held a copy each and the copies carried a comment telling the
|
|
11
|
+
* next editor to change the labels in both. They already import
|
|
12
|
+
* `HeaderSearchBoxRow` from this plugin, so the shared home costs no new
|
|
13
|
+
* dependency edge.
|
|
14
|
+
*/
|
|
15
|
+
export function useSearchBoxPrefs(prefix, numViews) {
|
|
16
|
+
const compact = numViews <= 3;
|
|
17
|
+
const regime = compact ? 'compact' : 'large';
|
|
18
|
+
const [showSearchBoxes, setShowSearchBoxes] = useLocalStorage(`${prefix}-showSearchBoxes-${regime}`, compact);
|
|
19
|
+
const [sideBySide, setSideBySide] = useLocalStorage(`${prefix}-sideBySide-${regime}`, compact);
|
|
20
|
+
return { showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide };
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The menu rows that drive those prefs. "Stacked" rather than "Vertical": the
|
|
24
|
+
* two headers name the same state and had drifted apart on it once already.
|
|
25
|
+
*/
|
|
26
|
+
export function searchBoxMenuItems({ showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide, }) {
|
|
27
|
+
return [
|
|
28
|
+
{
|
|
29
|
+
label: 'Show search boxes',
|
|
30
|
+
type: 'checkbox',
|
|
31
|
+
checked: showSearchBoxes,
|
|
32
|
+
onClick: () => {
|
|
33
|
+
setShowSearchBoxes(!showSearchBoxes);
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Search box orientation',
|
|
38
|
+
subMenu: [
|
|
39
|
+
{
|
|
40
|
+
label: 'Side-by-side',
|
|
41
|
+
type: 'radio',
|
|
42
|
+
checked: sideBySide,
|
|
43
|
+
onClick: () => {
|
|
44
|
+
setSideBySide(true);
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
label: 'Stacked',
|
|
49
|
+
type: 'radio',
|
|
50
|
+
checked: !sideBySide,
|
|
51
|
+
onClick: () => {
|
|
52
|
+
setSideBySide(false);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
export declare function useSideScroll(model: LinearGenomeViewModel): {
|
|
4
4
|
mouseDown: (event: React.MouseEvent) => void;
|
|
5
5
|
mouseUp: (event: React.MouseEvent) => void;
|
|
@@ -1,27 +1,64 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
+
// A press that travels further than this is a pan, and the click that ends it
|
|
3
|
+
// is not a click. A hand that wobbles two pixels can still select something.
|
|
4
|
+
const PAN_CLICK_THRESHOLD_PX = 4;
|
|
5
|
+
// The pan publishes its state as attributes on the element the press landed in
|
|
6
|
+
// (TracksContainer), so a track's own pointer handlers read it with `closest`
|
|
7
|
+
// and nothing has to hand them a ref or a model field — the same marker shape
|
|
8
|
+
// as `data-gesture-owner`. `data-pan-dragging` is present from mousedown to
|
|
9
|
+
// mouseup; `data-pan-moved` is set once the press travels past the threshold
|
|
10
|
+
// and cleared by the next press, so it still answers for the click that
|
|
11
|
+
// follows mouseup.
|
|
12
|
+
const PAN_DRAGGING_ATTR = 'data-pan-dragging';
|
|
13
|
+
const PAN_MOVED_ATTR = 'data-pan-moved';
|
|
2
14
|
export function useSideScroll(model) {
|
|
3
15
|
const [mouseDragging, setMouseDragging] = useState(false);
|
|
4
|
-
const
|
|
5
|
-
const
|
|
16
|
+
const scheduledRef = useRef(false);
|
|
17
|
+
const rafRef = useRef(null);
|
|
18
|
+
const startXRef = useRef(0);
|
|
19
|
+
const prevXRef = useRef(0);
|
|
20
|
+
const currXRef = useRef(0);
|
|
21
|
+
const hostRef = useRef(null);
|
|
6
22
|
useEffect(() => {
|
|
7
|
-
|
|
23
|
+
// apply the movement accumulated since the previous frame, then advance the
|
|
24
|
+
// baseline. shared by the rAF tick and the mouseup flush
|
|
25
|
+
function flushScroll() {
|
|
26
|
+
const distance = currXRef.current - prevXRef.current;
|
|
27
|
+
if (distance) {
|
|
28
|
+
model.horizontalScroll(-distance);
|
|
29
|
+
prevXRef.current = currXRef.current;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
8
32
|
function globalMouseMove(event) {
|
|
9
33
|
event.preventDefault();
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
34
|
+
currXRef.current = event.clientX;
|
|
35
|
+
if (Math.abs(currXRef.current - startXRef.current) > PAN_CLICK_THRESHOLD_PX) {
|
|
36
|
+
hostRef.current?.setAttribute(PAN_MOVED_ATTR, '');
|
|
37
|
+
}
|
|
38
|
+
const distance = currXRef.current - prevXRef.current;
|
|
39
|
+
// use rAF to make it so multiple event handlers aren't fired per-frame
|
|
40
|
+
// see https://calendar.perfplanet.com/2013/the-runtime-performance-checklist/
|
|
41
|
+
if (distance && !scheduledRef.current) {
|
|
42
|
+
scheduledRef.current = true;
|
|
43
|
+
rafRef.current = window.requestAnimationFrame(() => {
|
|
44
|
+
rafRef.current = null;
|
|
45
|
+
scheduledRef.current = false;
|
|
46
|
+
flushScroll();
|
|
47
|
+
});
|
|
21
48
|
}
|
|
22
49
|
}
|
|
23
50
|
function globalMouseUp() {
|
|
24
|
-
|
|
51
|
+
// flush any movement still queued for the next frame before ending the
|
|
52
|
+
// drag; otherwise a quick flick (mousedown/move/up within one frame) or
|
|
53
|
+
// the cleanup below would cancel it and drop the scroll
|
|
54
|
+
if (rafRef.current !== null) {
|
|
55
|
+
window.cancelAnimationFrame(rafRef.current);
|
|
56
|
+
rafRef.current = null;
|
|
57
|
+
scheduledRef.current = false;
|
|
58
|
+
flushScroll();
|
|
59
|
+
}
|
|
60
|
+
prevXRef.current = 0;
|
|
61
|
+
hostRef.current?.removeAttribute(PAN_DRAGGING_ATTR);
|
|
25
62
|
if (mouseDragging) {
|
|
26
63
|
setMouseDragging(false);
|
|
27
64
|
}
|
|
@@ -29,28 +66,59 @@ export function useSideScroll(model) {
|
|
|
29
66
|
if (mouseDragging) {
|
|
30
67
|
window.addEventListener('mousemove', globalMouseMove, true);
|
|
31
68
|
window.addEventListener('mouseup', globalMouseUp, true);
|
|
32
|
-
|
|
69
|
+
return () => {
|
|
33
70
|
window.removeEventListener('mousemove', globalMouseMove, true);
|
|
34
71
|
window.removeEventListener('mouseup', globalMouseUp, true);
|
|
72
|
+
// drop a frame queued mid-drag so it can't fire a stray scroll after
|
|
73
|
+
// unmount (matches `useVirtualScrollWheel`'s cleanup)
|
|
74
|
+
if (rafRef.current !== null) {
|
|
75
|
+
window.cancelAnimationFrame(rafRef.current);
|
|
76
|
+
rafRef.current = null;
|
|
77
|
+
}
|
|
78
|
+
scheduledRef.current = false;
|
|
35
79
|
};
|
|
36
80
|
}
|
|
37
|
-
return
|
|
81
|
+
return undefined;
|
|
38
82
|
}, [model, mouseDragging]);
|
|
39
83
|
function mouseDown(event) {
|
|
84
|
+
// Cleared for EVERY press, ahead of the returns below, because the marker
|
|
85
|
+
// outlives the gesture that set it: a pan, then a shift-press or a press on
|
|
86
|
+
// a button, used to leave `data-pan-moved` standing on the container. The
|
|
87
|
+
// one reader today re-enters through a press that reaches the bottom of
|
|
88
|
+
// this function, so nothing was wrong — but these attributes are a DOM
|
|
89
|
+
// contract other displays read with `closest`, and a stale true is what the
|
|
90
|
+
// next reader would inherit.
|
|
91
|
+
event.currentTarget.removeAttribute(PAN_MOVED_ATTR);
|
|
40
92
|
if (event.shiftKey) {
|
|
41
93
|
return;
|
|
42
94
|
}
|
|
95
|
+
// skip the click-drag pan when pressing an interactive control: a
|
|
96
|
+
// draggable element, a control that claimed the press (resize handles, the
|
|
97
|
+
// scalebar), or a button (e.g. the menu button on a highlight/bookmark
|
|
98
|
+
// chip, whose actual target is the icon inside it). All three are matched
|
|
99
|
+
// with `closest`, since the press usually lands on a child of the control
|
|
100
|
+
// rather than the control itself.
|
|
43
101
|
const target = event.target;
|
|
44
|
-
if (target.draggable ||
|
|
102
|
+
if (target.draggable ||
|
|
103
|
+
target.closest('[data-gesture-owner]') ||
|
|
104
|
+
target.closest('button')) {
|
|
45
105
|
return;
|
|
46
106
|
}
|
|
107
|
+
// otherwise do click and drag scroll
|
|
47
108
|
if (event.button === 0) {
|
|
48
|
-
|
|
109
|
+
hostRef.current = event.currentTarget;
|
|
110
|
+
event.currentTarget.setAttribute(PAN_DRAGGING_ATTR, '');
|
|
111
|
+
startXRef.current = event.clientX;
|
|
112
|
+
prevXRef.current = event.clientX;
|
|
113
|
+
currXRef.current = event.clientX;
|
|
49
114
|
setMouseDragging(true);
|
|
50
115
|
}
|
|
51
116
|
}
|
|
117
|
+
// this local mouseup is used in addition to the global because sometimes
|
|
118
|
+
// the global add/remove are not called in time, resulting in issue #533
|
|
52
119
|
function mouseUp(event) {
|
|
53
120
|
event.preventDefault();
|
|
121
|
+
hostRef.current?.removeAttribute(PAN_DRAGGING_ATTR);
|
|
54
122
|
setMouseDragging(false);
|
|
55
123
|
}
|
|
56
124
|
return { mouseDown, mouseUp };
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
|
|
3
|
+
export { getHighlightColor, highlightKey } from '@jbrowse/core/util/highlights';
|
|
4
|
+
export declare const elidedBlockStyles: {
|
|
5
|
+
readonly backgroundColor: '#999';
|
|
6
|
+
readonly backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)';
|
|
7
|
+
};
|
|
8
|
+
export type Cytoband = ReturnType<typeof getCytobands>[number];
|
|
7
9
|
export declare function getCytobands(assembly: Assembly | undefined, refName: string): {
|
|
8
10
|
refName: string;
|
|
9
11
|
start: number;
|
|
10
12
|
end: number;
|
|
11
13
|
type: string;
|
|
12
|
-
name:
|
|
14
|
+
name: string | undefined;
|
|
13
15
|
}[];
|
|
16
|
+
/**
|
|
17
|
+
* The bp under a pixel of the overview strip. The strip spans the whole view,
|
|
18
|
+
* but the overview *layout* is laid out in the pixels after the chromosome-name
|
|
19
|
+
* gutter (cytobandOffset), so a press or hover on that gutter sits left of the
|
|
20
|
+
* layout's own origin. `pxToBp` extrapolates there rather than refusing, and
|
|
21
|
+
* every overview reader took it at face value: the hover and rubberband labels
|
|
22
|
+
* read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
|
|
23
|
+
* silently, because `centerAt` cannot resolve a coordinate that is in no region.
|
|
24
|
+
* Clamping into the layout's own span makes all three name the genome's start,
|
|
25
|
+
* which is what the gutter is adjacent to.
|
|
26
|
+
*/
|
|
27
|
+
export declare function overviewPxToBp(overview: ViewLayout, px: number, cytobandOffset: number): import("@jbrowse/core/util/Base1DUtils").PxToBpResult;
|
|
14
28
|
export declare function shouldSwapTracks(lastSwapY: number | undefined, currentY: number, movingDown: boolean): boolean;
|
|
@@ -1,17 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { clamp } from '@jbrowse/core/util';
|
|
2
|
+
import { pxToBp } from '@jbrowse/core/util/Base1DUtils';
|
|
3
|
+
// getHighlightColor/highlightKey live in core so the dotplot highlight bands can
|
|
4
|
+
// share the exact same color and React-key semantics
|
|
5
|
+
export { getHighlightColor, highlightKey } from '@jbrowse/core/util/highlights';
|
|
6
|
+
// Shared style for elided (collapsed) blocks — striped grey pattern used
|
|
7
|
+
// consistently across OverviewScalebar, ScalebarCoordinateLabels, and Gridlines
|
|
8
|
+
export const elidedBlockStyles = {
|
|
9
|
+
backgroundColor: '#999',
|
|
10
|
+
backgroundImage: 'repeating-linear-gradient(90deg, transparent, transparent 1px, rgba(255,255,255,.5) 1px, rgba(255,255,255,.5) 3px)',
|
|
11
|
+
};
|
|
5
12
|
export function getCytobands(assembly, refName) {
|
|
6
13
|
return (assembly?.cytobands
|
|
7
14
|
?.map(f => ({
|
|
8
|
-
refName: assembly.
|
|
15
|
+
refName: assembly.getCanonicalRefName2(f.get('refName')),
|
|
9
16
|
start: f.get('start'),
|
|
10
17
|
end: f.get('end'),
|
|
11
18
|
type: f.get('gieStain'),
|
|
12
19
|
name: f.get('name'),
|
|
13
20
|
}))
|
|
14
|
-
.filter(f => f.refName === refName)
|
|
21
|
+
.filter(f => f.refName === refName) ?? []);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The bp under a pixel of the overview strip. The strip spans the whole view,
|
|
25
|
+
* but the overview *layout* is laid out in the pixels after the chromosome-name
|
|
26
|
+
* gutter (cytobandOffset), so a press or hover on that gutter sits left of the
|
|
27
|
+
* layout's own origin. `pxToBp` extrapolates there rather than refusing, and
|
|
28
|
+
* every overview reader took it at face value: the hover and rubberband labels
|
|
29
|
+
* read out an impossible "ctgA:-12,345,678", and a click did nothing at all,
|
|
30
|
+
* silently, because `centerAt` cannot resolve a coordinate that is in no region.
|
|
31
|
+
* Clamping into the layout's own span makes all three name the genome's start,
|
|
32
|
+
* which is what the gutter is adjacent to.
|
|
33
|
+
*/
|
|
34
|
+
export function overviewPxToBp(overview, px, cytobandOffset) {
|
|
35
|
+
return pxToBp(overview, clamp(px - cytobandOffset, 0, overview.width - 1));
|
|
15
36
|
}
|
|
16
37
|
const MIN_DRAG_DISTANCE = 30;
|
|
17
38
|
export function shouldSwapTracks(lastSwapY, currentY, movingDown) {
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
export declare const MIN_BP_PER_PX: number;
|
|
2
|
+
export declare const SHOW_ALL_REGIONS_FILL = 0.9;
|
|
1
3
|
export declare const HEADER_BAR_HEIGHT = 48;
|
|
2
4
|
export declare const HEADER_OVERVIEW_HEIGHT = 20;
|
|
3
5
|
export declare const SCALE_BAR_HEIGHT = 17;
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
+
export declare const SVG_SCALEBAR_CAP = 5;
|
|
7
|
+
export declare const RESIZE_HANDLE_HEIGHT = 4;
|
|
8
|
+
export declare const TRACK_TOP_GAP = 2;
|
|
9
|
+
export declare const TRACK_OUTLINE_BORDER = 1;
|
|
10
|
+
export declare const MINIMIZED_TRACK_HEIGHT = 20;
|
|
6
11
|
export declare const SPACING = 7;
|
|
7
12
|
export declare const WIDGET_HEIGHT = 32;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
|
+
// most zoomed-in level: 50px per bp
|
|
2
|
+
export const MIN_BP_PER_PX = 1 / 50;
|
|
3
|
+
// fraction of the view width the whole genome fills at the most zoomed-out
|
|
4
|
+
// level, leaving a 10% margin
|
|
5
|
+
export const SHOW_ALL_REGIONS_FILL = 0.9;
|
|
1
6
|
export const HEADER_BAR_HEIGHT = 48;
|
|
2
7
|
export const HEADER_OVERVIEW_HEIGHT = 20;
|
|
3
8
|
export const SCALE_BAR_HEIGHT = 17;
|
|
4
|
-
|
|
5
|
-
|
|
9
|
+
// Half-height of the total-bp scalebar's end caps in the SVG export; also the
|
|
10
|
+
// clearance the bar needs below the assembly label.
|
|
11
|
+
export const SVG_SCALEBAR_CAP = 5;
|
|
12
|
+
// The three pieces of chrome TrackContainer puts around a track's rendering
|
|
13
|
+
// container. The model sums them to place a track without measuring the DOM, so
|
|
14
|
+
// TrackContainer lays its Paper out from these same three and nothing else —
|
|
15
|
+
// the previous spelling had the model on a 3 while the CSS rendered 2 + 1 + 4,
|
|
16
|
+
// which put every model-derived track offset 5px per track above the pixels.
|
|
17
|
+
// The track *label* is deliberately not among them; see `trackChromeHeight`.
|
|
18
|
+
export const RESIZE_HANDLE_HEIGHT = 4;
|
|
19
|
+
export const TRACK_TOP_GAP = 2;
|
|
20
|
+
export const TRACK_OUTLINE_BORDER = 1;
|
|
21
|
+
export const MINIMIZED_TRACK_HEIGHT = 20;
|
|
6
22
|
export const SPACING = 7;
|
|
7
23
|
export const WIDGET_HEIGHT = 32;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A window of the view's linearized bp space — the space `windowStartBp` is in,
|
|
3
|
+
* so a position here is invariant under zoom and a flight can be planned once
|
|
4
|
+
* for a path whose scale changes under it.
|
|
5
|
+
*/
|
|
6
|
+
export interface FlightViewport {
|
|
7
|
+
centerBp: number;
|
|
8
|
+
windowWidthBp: number;
|
|
9
|
+
}
|
|
10
|
+
export interface Flight {
|
|
11
|
+
durationMs: number;
|
|
12
|
+
/** the viewport at `t` in [0,1]; exactly the destination at t >= 1 */
|
|
13
|
+
at: (t: number) => FlightViewport;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The viewport path from `from` to `to`, and how long to spend on it.
|
|
17
|
+
*
|
|
18
|
+
* The path is equation (9) of the paper cited at the top of this file: it zooms
|
|
19
|
+
* out as it travels and back in as it arrives, along the geodesic that holds
|
|
20
|
+
* the *perceived* velocity constant, so the reader can follow the whole journey
|
|
21
|
+
* rather than watching one blurred smear.
|
|
22
|
+
*
|
|
23
|
+
* A STRAIGHT PAN IS NOT THE ALTERNATIVE, it is the thing this exists to avoid.
|
|
24
|
+
* The jump that wants animating here is a synteny row showing a whole assembly
|
|
25
|
+
* being sent to a mate on another chromosome: tens of megabases at a window of
|
|
26
|
+
* tens of kilobases, which is a thousand screens of travel. Panned at constant
|
|
27
|
+
* scale that is a thousand screens of unreadable streaking and no frame in
|
|
28
|
+
* which the reader is anywhere identifiable. Pulled back to where both ends fit
|
|
29
|
+
* and then dropped in, it is a picture of where they came from and where they
|
|
30
|
+
* landed.
|
|
31
|
+
*
|
|
32
|
+
* The zoomed-out apex is `w0 * cosh(r0)` — for a same-zoom hop, about the
|
|
33
|
+
* distance travelled — so the arc naturally tops out at "both endpoints on
|
|
34
|
+
* screen". A view whose `maxBpPerPx` is tighter than that simply clamps there
|
|
35
|
+
* and flies the middle of the path flat; nothing here has to know the limit,
|
|
36
|
+
* because the caller writes through `zoomTo` and reads back what it got.
|
|
37
|
+
*/
|
|
38
|
+
export declare function planFlight(from: FlightViewport, to: FlightViewport): Flight;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { clamp } from '@jbrowse/core/util';
|
|
2
|
+
// The paper's rho: how much the path is willing to zoom out to cover distance.
|
|
3
|
+
// Their section 6 user experiment measured 1.42 (sd 0.47), and they note that
|
|
4
|
+
// it "suggests that rho = sqrt(2) is possibly an optimal value" without being
|
|
5
|
+
// able to say why; d3-interpolateZoom takes the same sqrt(2). Lower flattens
|
|
6
|
+
// the arc into a pan, higher pulls further back and travels faster, and it is
|
|
7
|
+
// the one knob to reach for if the zoomed-out apex ever proves too expensive to
|
|
8
|
+
// fetch through.
|
|
9
|
+
//
|
|
10
|
+
// IT DOES NOT TODAY, and the arithmetic that says it should is worth
|
|
11
|
+
// contradicting explicitly. A cross-chromosome flight over stacked whole
|
|
12
|
+
// assemblies traces ~15 octaves of zoom out and ~15 back, and synteny's fetch
|
|
13
|
+
// key buckets on `floor(log2(bpPerPx))` — so a flight crosses ~30 fetch buckets
|
|
14
|
+
// where a pan at constant zoom crosses none. Measured against
|
|
15
|
+
// `demos/grape_peach_cacao` it costs exactly ONE extra RPC over the instant
|
|
16
|
+
// jump (2 against 1), because the 500ms leading-edge debounce absorbs the whole
|
|
17
|
+
// excursion: one fetch leaving, one on landing.
|
|
18
|
+
// `agent-docs/measurements/synteny-mate-flight.json`.
|
|
19
|
+
const RHO = Math.sqrt(2);
|
|
20
|
+
// WHERE WE PART COMPANY WITH THE PAPER, and the one number in here that is not
|
|
21
|
+
// theirs. `S` is a path length in their dimensionless units of perceived
|
|
22
|
+
// motion, growing with the LOG of the distance: half a screen scores 0.7, one
|
|
23
|
+
// screen 1.2, a hundred screens 7.5, a whole genome 12. Their section 6
|
|
24
|
+
// measured an animation speed V of 0.90 of those units per second, which would
|
|
25
|
+
// put that whole-genome flight at THIRTEEN SECONDS — a wait, not a transition,
|
|
26
|
+
// and their own scenario (a map of the US) never asks for a path that long.
|
|
27
|
+
//
|
|
28
|
+
// So the duration is clamped instead: a floor for the hops too short to need
|
|
29
|
+
// time, a ceiling for the cross-genome one, and a rate between. At the ceiling
|
|
30
|
+
// that is an effective V around 11, an order of magnitude above what they
|
|
31
|
+
// measured, and it is the deliberate cost of not making the reader wait.
|
|
32
|
+
// Perceived velocity is still constant WITHIN a flight — that is equation (9)'s
|
|
33
|
+
// doing, not this — and this only picks the total.
|
|
34
|
+
const MS_PER_UNIT = 90;
|
|
35
|
+
const MIN_MS = 250;
|
|
36
|
+
const MAX_MS = 1100;
|
|
37
|
+
// Below this much motion, relative to the window it happens in, the pan is
|
|
38
|
+
// treated as none at all. RELATIVE, not absolute: the general solution divides
|
|
39
|
+
// by the distance, so a sub-bp move between two different zooms sends `b`
|
|
40
|
+
// through infinity and `at` returns NaN — and an absolute epsilon that is small
|
|
41
|
+
// against a 250Mb chromosome is not small against a 500bp window.
|
|
42
|
+
const STATIONARY = 1e-6;
|
|
43
|
+
/**
|
|
44
|
+
* The viewport path from `from` to `to`, and how long to spend on it.
|
|
45
|
+
*
|
|
46
|
+
* The path is equation (9) of the paper cited at the top of this file: it zooms
|
|
47
|
+
* out as it travels and back in as it arrives, along the geodesic that holds
|
|
48
|
+
* the *perceived* velocity constant, so the reader can follow the whole journey
|
|
49
|
+
* rather than watching one blurred smear.
|
|
50
|
+
*
|
|
51
|
+
* A STRAIGHT PAN IS NOT THE ALTERNATIVE, it is the thing this exists to avoid.
|
|
52
|
+
* The jump that wants animating here is a synteny row showing a whole assembly
|
|
53
|
+
* being sent to a mate on another chromosome: tens of megabases at a window of
|
|
54
|
+
* tens of kilobases, which is a thousand screens of travel. Panned at constant
|
|
55
|
+
* scale that is a thousand screens of unreadable streaking and no frame in
|
|
56
|
+
* which the reader is anywhere identifiable. Pulled back to where both ends fit
|
|
57
|
+
* and then dropped in, it is a picture of where they came from and where they
|
|
58
|
+
* landed.
|
|
59
|
+
*
|
|
60
|
+
* The zoomed-out apex is `w0 * cosh(r0)` — for a same-zoom hop, about the
|
|
61
|
+
* distance travelled — so the arc naturally tops out at "both endpoints on
|
|
62
|
+
* screen". A view whose `maxBpPerPx` is tighter than that simply clamps there
|
|
63
|
+
* and flies the middle of the path flat; nothing here has to know the limit,
|
|
64
|
+
* because the caller writes through `zoomTo` and reads back what it got.
|
|
65
|
+
*/
|
|
66
|
+
export function planFlight(from, to) {
|
|
67
|
+
const w0 = from.windowWidthBp;
|
|
68
|
+
const w1 = to.windowWidthBp;
|
|
69
|
+
const delta = to.centerBp - from.centerBp;
|
|
70
|
+
const dist = Math.abs(delta);
|
|
71
|
+
const at = dist > Math.max(w0, w1) * STATIONARY
|
|
72
|
+
? zoomAndPan(from, to, dist, Math.sign(delta))
|
|
73
|
+
: zoomInPlace(from, to);
|
|
74
|
+
return {
|
|
75
|
+
durationMs: at ? clamp(at.S * MS_PER_UNIT, MIN_MS, MAX_MS) : 0,
|
|
76
|
+
// Snapped at the end rather than left to the closed form, whose `u(S)`
|
|
77
|
+
// reaches the destination only to within the rounding of two hyperbolics.
|
|
78
|
+
at: t => (at && t < 1 ? at.at(t) : to),
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
// Equation (9), term for term. `u` runs along the path in world units from the
|
|
82
|
+
// start, and the two `r` are where the start and end sit on the ellipse the
|
|
83
|
+
// path traces. The paper's `u1 - u0` is signed; here the caller's sign is
|
|
84
|
+
// carried separately in `direction` and `dist` is its magnitude, so that u0 = 0
|
|
85
|
+
// and the two forms agree.
|
|
86
|
+
function zoomAndPan(from, to, dist, direction) {
|
|
87
|
+
const w0 = from.windowWidthBp;
|
|
88
|
+
const w1 = to.windowWidthBp;
|
|
89
|
+
const rho2 = RHO * RHO;
|
|
90
|
+
const rho4 = rho2 * rho2;
|
|
91
|
+
const b0 = (w1 * w1 - w0 * w0 + rho4 * dist * dist) / (2 * w0 * rho2 * dist);
|
|
92
|
+
const b1 = (w1 * w1 - w0 * w0 - rho4 * dist * dist) / (2 * w1 * rho2 * dist);
|
|
93
|
+
// asinh(-b), which is exactly the ln(-b + sqrt(b*b + 1)) equation (9) writes
|
|
94
|
+
// (and d3 implements literally) — but evaluated without the catastrophic
|
|
95
|
+
// cancellation those two terms suffer at the far end of a cross-genome jump,
|
|
96
|
+
// where b runs to a thousand and they agree to seven digits before
|
|
97
|
+
// subtracting. Same value, better conditioned.
|
|
98
|
+
const r0 = Math.asinh(-b0);
|
|
99
|
+
const r1 = Math.asinh(-b1);
|
|
100
|
+
const S = (r1 - r0) / RHO;
|
|
101
|
+
const coshR0 = Math.cosh(r0);
|
|
102
|
+
const sinhR0 = Math.sinh(r0);
|
|
103
|
+
return S > 0
|
|
104
|
+
? {
|
|
105
|
+
S,
|
|
106
|
+
at: (t) => {
|
|
107
|
+
const s = t * S * RHO + r0;
|
|
108
|
+
return {
|
|
109
|
+
centerBp: from.centerBp +
|
|
110
|
+
direction *
|
|
111
|
+
((w0 / rho2) * coshR0 * Math.tanh(s) - (w0 / rho2) * sinhR0),
|
|
112
|
+
windowWidthBp: (w0 * coshR0) / Math.cosh(s),
|
|
113
|
+
};
|
|
114
|
+
},
|
|
115
|
+
}
|
|
116
|
+
: undefined;
|
|
117
|
+
}
|
|
118
|
+
// The paper's u0 = u1 case, given unnumbered just after equation (9): the
|
|
119
|
+
// endpoints are the same place at different scales, so there is no path to
|
|
120
|
+
// trace and the zoom is exponential in `s` on its own. Their `w0 exp(k*rho*s)`
|
|
121
|
+
// over `S = |ln(w1/w0)|/rho` is `w0 * ratio**t` here, which is the same curve
|
|
122
|
+
// with `t = s/S` and their sign `k` folded into the ratio.
|
|
123
|
+
function zoomInPlace(from, to) {
|
|
124
|
+
const ratio = to.windowWidthBp / from.windowWidthBp;
|
|
125
|
+
const S = Math.abs(Math.log(ratio)) / RHO;
|
|
126
|
+
return S > 0
|
|
127
|
+
? {
|
|
128
|
+
S,
|
|
129
|
+
at: (t) => ({
|
|
130
|
+
centerBp: from.centerBp + (to.centerBp - from.centerBp) * t,
|
|
131
|
+
windowWidthBp: from.windowWidthBp * ratio ** t,
|
|
132
|
+
}),
|
|
133
|
+
}
|
|
134
|
+
: undefined;
|
|
135
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare const SHEDDABLE: readonly [readonly ['trackSelectorIndent', 16], readonly ['panButtonSpacing', 100], readonly ['scrollZoomLabel', 83], readonly ['zoomSlider', 100], readonly ['regionWidth', 54]];
|
|
2
|
+
export type HeaderFit = Record<(typeof SHEDDABLE)[number][0], boolean>;
|
|
3
|
+
/**
|
|
4
|
+
* Which of the header bar's optional pieces a header `width` px wide still has
|
|
5
|
+
* room for, given what the search box is asking for — `searchBoxWidth`, margins
|
|
6
|
+
* included — and whether the clear-highlights button is currently in the row.
|
|
7
|
+
* An unmeasured width — the first render, before the ResizeObserver has
|
|
8
|
+
* reported — keeps all of them, so the common wide case paints its final form
|
|
9
|
+
* immediately rather than flashing the compact one.
|
|
10
|
+
*
|
|
11
|
+
* `searchBoxPx` is the box's ask and not its floor, because the two differ by
|
|
12
|
+
* the locstring — 189px empty, 194 at `ctgA:1..20,000`, 284 at
|
|
13
|
+
* `chr22:10,510,000..10,610,000`. Shedding against the floor is what left
|
|
14
|
+
* flexbox squeezing the box this whole table exists to protect: against the
|
|
15
|
+
* floor the probe read 184px of an asked 210 at an 800px window and 186 at 600.
|
|
16
|
+
*
|
|
17
|
+
* The fully shed row costs 238px, so under `238 + searchBoxPx` the row overflows
|
|
18
|
+
* whatever it gives up and the box shrinks like any flex item. That is a floor,
|
|
19
|
+
* not a cliff: it shrinks from what it asked for rather than from the 101px the
|
|
20
|
+
* unshed row used to leave it.
|
|
21
|
+
*/
|
|
22
|
+
export declare function headerFit({ width, searchBoxPx, clearHighlight, }: {
|
|
23
|
+
width: number | undefined;
|
|
24
|
+
searchBoxPx: number;
|
|
25
|
+
clearHighlight?: boolean;
|
|
26
|
+
}): HeaderFit;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Widths measured against a built jbrowse-web at the default theme and root
|
|
2
|
+
// font size — `products/jbrowse-web/browser-tests/probe-lgv-header-fit.ts`
|
|
3
|
+
// prints the row piece by piece. It spends 591px on everything that is not the
|
|
4
|
+
// search box (47 track selector, 114 scroll-zoom toggle, 156 pan buttons, 50 bp
|
|
5
|
+
// readout, 192 zoom controls, 32 of flex gap). What the box itself asks for is
|
|
6
|
+
// the caller's, because it follows the locstring rather than being a constant.
|
|
7
|
+
const ROW_WITHOUT_SEARCH_PX = 591;
|
|
8
|
+
// The one piece of the row that comes and goes on its own. A text search that
|
|
9
|
+
// lands on a feature raises it — the same flow that was just using the search
|
|
10
|
+
// box this whole table exists to protect — so its width is taken off the top
|
|
11
|
+
// rather than left for the search box to absorb.
|
|
12
|
+
const CLEAR_HIGHLIGHT_PX = 35;
|
|
13
|
+
// What the header gives up as its window narrows, cheapest first, with the
|
|
14
|
+
// pixels each one frees. Whitespace goes before words, words before a redundant
|
|
15
|
+
// control, and that before a readout. The search box is not on the list: it is
|
|
16
|
+
// the one control in the row with no equivalent anywhere else in the view, so
|
|
17
|
+
// everything else exists to keep it on screen.
|
|
18
|
+
const SHEDDABLE = [
|
|
19
|
+
['trackSelectorIndent', 16],
|
|
20
|
+
['panButtonSpacing', 100],
|
|
21
|
+
['scrollZoomLabel', 83],
|
|
22
|
+
['zoomSlider', 100],
|
|
23
|
+
['regionWidth', 54],
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Which of the header bar's optional pieces a header `width` px wide still has
|
|
27
|
+
* room for, given what the search box is asking for — `searchBoxWidth`, margins
|
|
28
|
+
* included — and whether the clear-highlights button is currently in the row.
|
|
29
|
+
* An unmeasured width — the first render, before the ResizeObserver has
|
|
30
|
+
* reported — keeps all of them, so the common wide case paints its final form
|
|
31
|
+
* immediately rather than flashing the compact one.
|
|
32
|
+
*
|
|
33
|
+
* `searchBoxPx` is the box's ask and not its floor, because the two differ by
|
|
34
|
+
* the locstring — 189px empty, 194 at `ctgA:1..20,000`, 284 at
|
|
35
|
+
* `chr22:10,510,000..10,610,000`. Shedding against the floor is what left
|
|
36
|
+
* flexbox squeezing the box this whole table exists to protect: against the
|
|
37
|
+
* floor the probe read 184px of an asked 210 at an 800px window and 186 at 600.
|
|
38
|
+
*
|
|
39
|
+
* The fully shed row costs 238px, so under `238 + searchBoxPx` the row overflows
|
|
40
|
+
* whatever it gives up and the box shrinks like any flex item. That is a floor,
|
|
41
|
+
* not a cliff: it shrinks from what it asked for rather than from the 101px the
|
|
42
|
+
* unshed row used to leave it.
|
|
43
|
+
*/
|
|
44
|
+
export function headerFit({ width, searchBoxPx, clearHighlight = false, }) {
|
|
45
|
+
const fit = Object.fromEntries(SHEDDABLE.map(([k]) => [k, true]));
|
|
46
|
+
if (width === undefined) {
|
|
47
|
+
return fit;
|
|
48
|
+
}
|
|
49
|
+
const room = width - (clearHighlight ? CLEAR_HIGHLIGHT_PX : 0);
|
|
50
|
+
let need = ROW_WITHOUT_SEARCH_PX + searchBoxPx;
|
|
51
|
+
for (const [key, saves] of SHEDDABLE) {
|
|
52
|
+
if (need <= room) {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
fit[key] = false;
|
|
56
|
+
need -= saves;
|
|
57
|
+
}
|
|
58
|
+
return fit;
|
|
59
|
+
}
|
|
@@ -1,5 +1,35 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from './model.ts';
|
|
1
2
|
import type PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
+
import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
|
|
4
|
+
declare module '@jbrowse/core/PluginManager' {
|
|
5
|
+
interface ExtensionPointRegistry {
|
|
6
|
+
/** #extensionPoint LinearGenomeView-TracksContainerComponent | sync | Add a component into the LGV tracks container */
|
|
7
|
+
'LinearGenomeView-TracksContainerComponent': ElementList<{
|
|
8
|
+
model: LinearGenomeViewModel;
|
|
9
|
+
}>;
|
|
10
|
+
/** #extensionPoint LinearGenomeView-ScalebarHighlightComponent | sync | Add a highlight component to the scalebar */
|
|
11
|
+
'LinearGenomeView-ScalebarHighlightComponent': ElementList<{
|
|
12
|
+
model: LinearGenomeViewModel;
|
|
13
|
+
}>;
|
|
14
|
+
/** #extensionPoint LinearGenomeView-HighlightSVGComponent | sync | Add an SVG highlight overlay in the LGV SVG export */
|
|
15
|
+
'LinearGenomeView-HighlightSVGComponent': ElementList<{
|
|
16
|
+
model: LinearGenomeViewModel;
|
|
17
|
+
height: number;
|
|
18
|
+
}>;
|
|
19
|
+
/** #extensionPoint LinearGenomeView-OverviewScalebarComponent | sync | Add a component to the overview scalebar */
|
|
20
|
+
'LinearGenomeView-OverviewScalebarComponent': ElementList<{
|
|
21
|
+
model: LinearGenomeViewModel;
|
|
22
|
+
overview: ViewLayout;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
2
26
|
export default function LinearGenomeViewF(pluginManager: PluginManager): void;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
27
|
+
export { stateModelFactory } from './model.ts';
|
|
28
|
+
export { lgvLaunchKeys } from './launchKeys.ts';
|
|
29
|
+
export type { LinearGenomeViewModel, LinearGenomeViewStateModel, } from './model.ts';
|
|
30
|
+
export type { BpOffset, ExportSvgOptions, HighlightType, InitState, LinearGenomeViewLaunchProps, NavLocation, TrackLabelMode, VolatileGuide, } from './types.ts';
|
|
31
|
+
export { type SyncableViewAction, installLinkedViewSync, } from './linkedViewSync.ts';
|
|
5
32
|
export { default as HighlightBand } from './components/HighlightBand.tsx';
|
|
33
|
+
export { default as HighlightChip } from './components/HighlightChip.tsx';
|
|
34
|
+
export { default as OverviewHighlightBand } from './components/OverviewHighlightBand.tsx';
|
|
35
|
+
export { default as SVGHighlightBand } from './components/SVGHighlightBand.tsx';
|