@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.10
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 +202 -71
- 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 +265 -120
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +20 -9
- 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 +142 -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 +8 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -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 +42 -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 +18 -8
- 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 +38 -52
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +21 -25
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +13 -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 +7 -6
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +14 -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 +25 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
- 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 +87 -83
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -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 +56 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
- package/esm/LinearGenomeView/components/Rubberband.js +15 -17
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
- package/esm/LinearGenomeView/components/Scalebar.js +20 -22
- 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 +157 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +61 -68
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
- 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 +3 -5
- 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 +136 -38
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
- 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 +35 -87
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
- 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 +6 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -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 +9 -67
- package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
- package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
- package/esm/LinearGenomeView/components/util.d.ts +24 -6
- package/esm/LinearGenomeView/components/util.js +28 -5
- package/esm/LinearGenomeView/consts.d.ts +9 -2
- package/esm/LinearGenomeView/consts.js +20 -2
- package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
- package/esm/LinearGenomeView/containingLgv.js +23 -0
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +29 -0
- package/esm/LinearGenomeView/headerFit.js +72 -0
- package/esm/LinearGenomeView/index.d.ts +28 -3
- package/esm/LinearGenomeView/index.js +13 -7
- package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
- package/esm/LinearGenomeView/keyboardHandler.js +25 -1
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +27 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
- package/esm/LinearGenomeView/lazyDialogs.js +4 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
- package/esm/LinearGenomeView/linkedViewSync.js +36 -0
- package/esm/LinearGenomeView/menuItems.d.ts +25 -2
- package/esm/LinearGenomeView/menuItems.js +306 -179
- package/esm/LinearGenomeView/model.d.ts +3363 -164
- package/esm/LinearGenomeView/model.js +2548 -565
- 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 +50 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
- package/esm/LinearGenomeView/stickyChrome.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
- 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 +73 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -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 +245 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
- package/esm/LinearGenomeView/types.d.ts +20 -37
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +347 -12
- package/esm/LinearGenomeView/util.js +577 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
- package/esm/MultiLevelRubberband/index.d.ts +4 -0
- package/esm/MultiLevelRubberband/index.js +3 -0
- package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
- package/esm/MultiLevelRubberband/menuItems.js +52 -0
- package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
- package/esm/MultiLevelRubberband/rowLabel.js +27 -0
- package/esm/MultiLevelRubberband/types.d.ts +7 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
- package/esm/displayKitTests/perRegionTestEnv.js +142 -0
- package/esm/index.d.ts +50 -1245
- package/esm/index.js +88 -33
- package/esm/searchUtils.d.ts +62 -12
- package/esm/searchUtils.js +335 -48
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +34 -0
- package/esm/shared/coordLabels.d.ts +47 -0
- package/esm/shared/coordLabels.js +133 -0
- package/esm/shared/useWindowDrag.d.ts +18 -0
- package/esm/shared/useWindowDrag.js +45 -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,6 @@
|
|
|
1
|
+
import type { MultiLevelRubberbandModel } from './types.ts';
|
|
2
|
+
declare const MultiLevelRubberband: ({ model, ControlComponent, }: {
|
|
3
|
+
model: MultiLevelRubberbandModel;
|
|
4
|
+
ControlComponent?: React.ReactElement;
|
|
5
|
+
}) => import("react").JSX.Element;
|
|
6
|
+
export default MultiLevelRubberband;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from 'react';
|
|
3
|
+
import { Menu } from '@jbrowse/core/ui';
|
|
4
|
+
import { getBpDisplayStr, stringify } from '@jbrowse/core/util';
|
|
5
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
6
|
+
import { observer } from 'mobx-react';
|
|
7
|
+
import RubberbandSpan from '../shared/RubberbandSpan.js';
|
|
8
|
+
import { VerticalGuideLine } from '../shared/coordLabels.js';
|
|
9
|
+
import { useRangeSelect } from './useRangeSelect.js';
|
|
10
|
+
const useStyles = makeStyles()({
|
|
11
|
+
rubberbandControl: {
|
|
12
|
+
cursor: 'crosshair',
|
|
13
|
+
width: '100%',
|
|
14
|
+
minHeight: 8,
|
|
15
|
+
position: 'relative',
|
|
16
|
+
zIndex: 900,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const MultiLevelRubberband = observer(function MultiLevelRubberband({ model, ControlComponent = _jsx("div", {}), }) {
|
|
20
|
+
const ref = useRef(null);
|
|
21
|
+
const { classes } = useStyles();
|
|
22
|
+
const { isClick, guideX, rubberbandOn, leftBpOffset, rightBpOffset, numOfBpSelected, width, left, anchorPosition, handleMenuItemClick, handleClose, mouseMove, mouseDown, mouseOut, } = useRangeSelect(ref, model);
|
|
23
|
+
const viewWidth = Math.min(...model.views.map(view => view.width));
|
|
24
|
+
return (_jsxs(_Fragment, { children: [guideX !== undefined ? (_jsx(VerticalGuideLine, { coordX: guideX, viewWidth: viewWidth, stickyTop: undefined, children: _jsx(PerLevelRows, { rows: model.views.map(view => stringify(view.pxToBp(guideX), true)) }) })) : rubberbandOn ? (_jsx(RubberbandSpan, { leftLabel: _jsx(PerLevelRows, { rows: leftBpOffset.map(l => stringify(l, true)) }), rightLabel: _jsx(PerLevelRows, { rows: rightBpOffset.map(r => stringify(r, true)) }), size: _jsx(PerLevelRows, { rows: numOfBpSelected.map(getBpDisplayStr) }), width: width, left: left, viewWidth: viewWidth, stickyTop: undefined })) : null, anchorPosition ? (_jsx(Menu, { anchorReference: "anchorPosition", anchorPosition: {
|
|
25
|
+
left: anchorPosition.clientX,
|
|
26
|
+
top: anchorPosition.clientY,
|
|
27
|
+
}, onMenuItemClick: handleMenuItemClick, open: true, onClose: handleClose, menuItems: isClick
|
|
28
|
+
? model.rubberbandClickMenuItemsAtPx(anchorPosition.offsetX)
|
|
29
|
+
: model.rubberBandMenuItems() })) : null, _jsx("div", { "data-testid": "rubberband_controls", className: classes.rubberbandControl, ref: ref, onMouseDown: mouseDown, onMouseMove: mouseMove,
|
|
30
|
+
// Leave, not out: mouseout bubbles up from every child, so moving across
|
|
31
|
+
// the ControlComponent's own children fired it and flickered the guide.
|
|
32
|
+
// Matches Rubberband/OverviewRubberband.
|
|
33
|
+
onMouseLeave: mouseOut, children: ControlComponent })] }));
|
|
34
|
+
});
|
|
35
|
+
// one row per rubberband level, in level order. values repeat across levels
|
|
36
|
+
// whenever the assemblies line up, so the index is the only stable key
|
|
37
|
+
function PerLevelRows({ rows }) {
|
|
38
|
+
return rows.map((row, idx) => (_jsx("div", { children: row }, idx)));
|
|
39
|
+
}
|
|
40
|
+
export default MultiLevelRubberband;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as MultiLevelRubberband } from './MultiLevelRubberband.tsx';
|
|
2
|
+
export { multiLevelRowClickMenuItems, multiLevelRowMenuItems, } from './menuItems.ts';
|
|
3
|
+
export { rowLabels } from './rowLabel.ts';
|
|
4
|
+
export type { MultiLevelRubberbandModel } from './types.ts';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../LinearGenomeView/model.ts';
|
|
2
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
3
|
+
/**
|
|
4
|
+
* One row per genome row, each holding that row's own rubberband menu — Get
|
|
5
|
+
* sequence, Copy range, Highlight region, and whatever a plugin contributes
|
|
6
|
+
* under Launch.
|
|
7
|
+
*
|
|
8
|
+
* A drag on the multi-level strip commits offsets on EVERY row (see
|
|
9
|
+
* `useRangeSelect`), so each row's `rubberBandMenuItems()` already describes a
|
|
10
|
+
* real selection and was simply never offered: the stacked views' menu held
|
|
11
|
+
* "Zoom to region(s)" and nothing else, while the same drag in a plain linear
|
|
12
|
+
* genome view offered five actions. Per row rather than applied across rows
|
|
13
|
+
* because each row is its own assembly — one sequence to fetch, one range to
|
|
14
|
+
* copy, one highlight to place — so there is no "all rows" answer to give.
|
|
15
|
+
*
|
|
16
|
+
* Zoom is the exception and stays where each view already has it: zooming every
|
|
17
|
+
* row at once is what the gesture means, and the synteny view holds its follow
|
|
18
|
+
* anchor across the loop.
|
|
19
|
+
*/
|
|
20
|
+
export declare function multiLevelRowMenuItems(views: LinearGenomeViewModel[]): MenuItem[];
|
|
21
|
+
/**
|
|
22
|
+
* The same per-row rows for a bare CLICK on the strip rather than a drag — each
|
|
23
|
+
* row's Center view here, Zoom to base level and Copy coordinate, at the base
|
|
24
|
+
* that row paints under `px`.
|
|
25
|
+
*
|
|
26
|
+
* No all-rows row above them, unlike the drag's "Zoom to region(s)". A drag
|
|
27
|
+
* names a span in pixels and every row can act on it; a click names a
|
|
28
|
+
* COORDINATE, and the rows are different assemblies, so which genome's base the
|
|
29
|
+
* pointer is over is the question the menu has to ask rather than answer.
|
|
30
|
+
*
|
|
31
|
+
* `px` rather than a resolved offset: each row maps the pixel through its own
|
|
32
|
+
* `pxToBp`, so there is no one offset to pass.
|
|
33
|
+
*/
|
|
34
|
+
export declare function multiLevelRowClickMenuItems(views: LinearGenomeViewModel[], px: number): MenuItem[];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { rowLabels } from './rowLabel.js';
|
|
2
|
+
/**
|
|
3
|
+
* One row per genome row, each holding that row's own rubberband menu — Get
|
|
4
|
+
* sequence, Copy range, Highlight region, and whatever a plugin contributes
|
|
5
|
+
* under Launch.
|
|
6
|
+
*
|
|
7
|
+
* A drag on the multi-level strip commits offsets on EVERY row (see
|
|
8
|
+
* `useRangeSelect`), so each row's `rubberBandMenuItems()` already describes a
|
|
9
|
+
* real selection and was simply never offered: the stacked views' menu held
|
|
10
|
+
* "Zoom to region(s)" and nothing else, while the same drag in a plain linear
|
|
11
|
+
* genome view offered five actions. Per row rather than applied across rows
|
|
12
|
+
* because each row is its own assembly — one sequence to fetch, one range to
|
|
13
|
+
* copy, one highlight to place — so there is no "all rows" answer to give.
|
|
14
|
+
*
|
|
15
|
+
* Zoom is the exception and stays where each view already has it: zooming every
|
|
16
|
+
* row at once is what the gesture means, and the synteny view holds its follow
|
|
17
|
+
* anchor across the loop.
|
|
18
|
+
*/
|
|
19
|
+
export function multiLevelRowMenuItems(views) {
|
|
20
|
+
return rowLabels(views).map((label, idx) => ({
|
|
21
|
+
label,
|
|
22
|
+
subMenu: views[idx].rubberBandMenuItems(),
|
|
23
|
+
}));
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The same per-row rows for a bare CLICK on the strip rather than a drag — each
|
|
27
|
+
* row's Center view here, Zoom to base level and Copy coordinate, at the base
|
|
28
|
+
* that row paints under `px`.
|
|
29
|
+
*
|
|
30
|
+
* No all-rows row above them, unlike the drag's "Zoom to region(s)". A drag
|
|
31
|
+
* names a span in pixels and every row can act on it; a click names a
|
|
32
|
+
* COORDINATE, and the rows are different assemblies, so which genome's base the
|
|
33
|
+
* pointer is over is the question the menu has to ask rather than answer.
|
|
34
|
+
*
|
|
35
|
+
* `px` rather than a resolved offset: each row maps the pixel through its own
|
|
36
|
+
* `pxToBp`, so there is no one offset to pass.
|
|
37
|
+
*/
|
|
38
|
+
export function multiLevelRowClickMenuItems(views, px) {
|
|
39
|
+
return rowLabels(views).flatMap((label, idx) => {
|
|
40
|
+
const view = views[idx];
|
|
41
|
+
// A row with no regions is dropped, because `pxToBp` THROWS on one rather
|
|
42
|
+
// than answering an offset that names no base — so gating on the built
|
|
43
|
+
// submenu being empty, which is what this did, was a guard that could never
|
|
44
|
+
// fire in front of a call that had already thrown. Reachable: a row's
|
|
45
|
+
// `initialized` is assembly readiness, and the stack mounts this strip once
|
|
46
|
+
// ANY row is ready.
|
|
47
|
+
if (!view.displayedRegions.length) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
return [{ label, subMenu: view.rubberbandClickMenuItems(view.pxToBp(px)) }];
|
|
51
|
+
});
|
|
52
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What to call each genome row, one label per row. The assembly name where
|
|
3
|
+
* there is one, and the row's position where a row is still loading, so a label
|
|
4
|
+
* stays true whatever the assemblies turn out to be called.
|
|
5
|
+
*
|
|
6
|
+
* A NAME THAT REPEATS PICKS UP ITS ROW NUMBER, because a stack can hold one
|
|
7
|
+
* assembly twice — two loci of the same genome, a read against its own
|
|
8
|
+
* reference — and there the bare name gives two menu rows that open different
|
|
9
|
+
* things under identical text. Only the repeats pay for it: the ordinary
|
|
10
|
+
* pairwise view still reads "hg38" and "mm39".
|
|
11
|
+
*
|
|
12
|
+
* One function over the whole list rather than one row at a time, since
|
|
13
|
+
* uniqueness is a property of the list. Shared by every menu that names the
|
|
14
|
+
* rows — the track selectors, the row menus, the follow anchors, the
|
|
15
|
+
* rubberband — so they cannot drift into calling the same row two different
|
|
16
|
+
* things one click apart. Here rather than in the synteny view because the
|
|
17
|
+
* breakpoint split view is the same stack of rows and had been numbering them
|
|
18
|
+
* itself.
|
|
19
|
+
*/
|
|
20
|
+
export declare function rowLabels(views: {
|
|
21
|
+
assemblyNames: string[];
|
|
22
|
+
}[]): string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What to call each genome row, one label per row. The assembly name where
|
|
3
|
+
* there is one, and the row's position where a row is still loading, so a label
|
|
4
|
+
* stays true whatever the assemblies turn out to be called.
|
|
5
|
+
*
|
|
6
|
+
* A NAME THAT REPEATS PICKS UP ITS ROW NUMBER, because a stack can hold one
|
|
7
|
+
* assembly twice — two loci of the same genome, a read against its own
|
|
8
|
+
* reference — and there the bare name gives two menu rows that open different
|
|
9
|
+
* things under identical text. Only the repeats pay for it: the ordinary
|
|
10
|
+
* pairwise view still reads "hg38" and "mm39".
|
|
11
|
+
*
|
|
12
|
+
* One function over the whole list rather than one row at a time, since
|
|
13
|
+
* uniqueness is a property of the list. Shared by every menu that names the
|
|
14
|
+
* rows — the track selectors, the row menus, the follow anchors, the
|
|
15
|
+
* rubberband — so they cannot drift into calling the same row two different
|
|
16
|
+
* things one click apart. Here rather than in the synteny view because the
|
|
17
|
+
* breakpoint split view is the same stack of rows and had been numbering them
|
|
18
|
+
* itself.
|
|
19
|
+
*/
|
|
20
|
+
export function rowLabels(views) {
|
|
21
|
+
const names = views.map((view, idx) => view.assemblyNames[0] ?? `Row ${idx + 1}`);
|
|
22
|
+
const counts = new Map();
|
|
23
|
+
for (const name of names) {
|
|
24
|
+
counts.set(name, (counts.get(name) ?? 0) + 1);
|
|
25
|
+
}
|
|
26
|
+
return names.map((name, idx) => counts.get(name) > 1 ? `${name} (row ${idx + 1})` : name);
|
|
27
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../LinearGenomeView/model.ts';
|
|
2
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
3
|
+
export interface MultiLevelRubberbandModel {
|
|
4
|
+
views: LinearGenomeViewModel[];
|
|
5
|
+
rubberBandMenuItems: () => MenuItem[];
|
|
6
|
+
rubberbandClickMenuItemsAtPx: (px: number) => MenuItem[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { MultiLevelRubberbandModel } from './types.ts';
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
interface AnchorPosition {
|
|
4
|
+
offsetX: number;
|
|
5
|
+
clientX: number;
|
|
6
|
+
clientY: number;
|
|
7
|
+
isClick: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function useRangeSelect(ref: React.RefObject<HTMLDivElement | null>, model: MultiLevelRubberbandModel): {
|
|
10
|
+
isClick: boolean | undefined;
|
|
11
|
+
rubberbandOn: boolean;
|
|
12
|
+
guideX: number | undefined;
|
|
13
|
+
anchorPosition: AnchorPosition | undefined;
|
|
14
|
+
left: number;
|
|
15
|
+
width: number;
|
|
16
|
+
leftBpOffset: import("@jbrowse/core/util/Base1DUtils").PxToBpResult[];
|
|
17
|
+
rightBpOffset: import("@jbrowse/core/util/Base1DUtils").PxToBpResult[];
|
|
18
|
+
numOfBpSelected: number[];
|
|
19
|
+
mouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
20
|
+
mouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
21
|
+
mouseOut: () => void;
|
|
22
|
+
handleClose: () => void;
|
|
23
|
+
handleMenuItemClick: (callback: () => void) => void;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { getRelativeX } from '@jbrowse/core/util/getRelativeX';
|
|
3
|
+
import { transaction } from 'mobx';
|
|
4
|
+
import { useWindowDrag } from '../shared/useWindowDrag.js';
|
|
5
|
+
export function useRangeSelect(ref, model) {
|
|
6
|
+
const [startX, setStartX] = useState();
|
|
7
|
+
const [currentX, setCurrentX] = useState(0);
|
|
8
|
+
const [anchorPosition, setAnchorPosition] = useState();
|
|
9
|
+
const [guideX, setGuideX] = useState();
|
|
10
|
+
const mouseDragging = startX !== undefined && anchorPosition === undefined;
|
|
11
|
+
// one selection spans every level, so it is released from all of them at once.
|
|
12
|
+
// Committing is not the mirror of this and stays inline below: each level maps
|
|
13
|
+
// the same pixels through its own pxToBp, so the offsets differ per view.
|
|
14
|
+
const clearOffsets = useCallback(() => {
|
|
15
|
+
transaction(() => {
|
|
16
|
+
for (const view of model.views) {
|
|
17
|
+
view.setOffsets(undefined, undefined);
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}, [model]);
|
|
21
|
+
// releases the committed offsets too, since mouseOut no longer does while the
|
|
22
|
+
// menu is open — dismissing the menu, by its backdrop or Escape, is the point
|
|
23
|
+
// the selection is actually finished with. A bare click on the strip no longer
|
|
24
|
+
// comes through here: it opens the click menu instead.
|
|
25
|
+
//
|
|
26
|
+
// `CascadingMenu` dismisses BEFORE it runs the clicked row's callback, so this
|
|
27
|
+
// clears the offsets out from under it. Every menu built here captures them
|
|
28
|
+
// when the rows are built, which is why that works — the plain linear genome
|
|
29
|
+
// view's host never clears, so a row written to read them live works there
|
|
30
|
+
// and silently no-ops from a stacked row.
|
|
31
|
+
const handleClose = useCallback(() => {
|
|
32
|
+
setAnchorPosition(undefined);
|
|
33
|
+
setStartX(undefined);
|
|
34
|
+
setCurrentX(0);
|
|
35
|
+
setGuideX(undefined);
|
|
36
|
+
clearOffsets();
|
|
37
|
+
}, [clearOffsets]);
|
|
38
|
+
useWindowDrag(ref, mouseDragging ? startX : undefined, {
|
|
39
|
+
onMove: setCurrentX,
|
|
40
|
+
onEnd: ({ startX, endX, isClick, clientX, clientY }) => {
|
|
41
|
+
setAnchorPosition({ offsetX: endX, clientX, clientY, isClick });
|
|
42
|
+
if (isClick) {
|
|
43
|
+
// the click menu names a coordinate, not a span, so nothing is
|
|
44
|
+
// committed; the guide stays at the click so the menu says where
|
|
45
|
+
setGuideX(endX);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
const leftPx = Math.min(startX, endX);
|
|
49
|
+
const rightPx = Math.max(startX, endX);
|
|
50
|
+
transaction(() => {
|
|
51
|
+
for (const view of model.views) {
|
|
52
|
+
view.setOffsets(view.pxToBp(leftPx), view.pxToBp(rightPx));
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
setGuideX(undefined);
|
|
56
|
+
},
|
|
57
|
+
onCancel: handleClose,
|
|
58
|
+
});
|
|
59
|
+
function mouseDown(event) {
|
|
60
|
+
event.preventDefault();
|
|
61
|
+
event.stopPropagation();
|
|
62
|
+
// clear any leftover menu/selection so a fresh drag isn't blocked by a
|
|
63
|
+
// stale anchorPosition keeping mouseDragging false
|
|
64
|
+
setAnchorPosition(undefined);
|
|
65
|
+
// the guide is what the pointer was showing up to now, and mouseMove won't
|
|
66
|
+
// touch it during the drag — leaving it set keeps the selection span from
|
|
67
|
+
// ever rendering, since the guide wins that either/or
|
|
68
|
+
setGuideX(undefined);
|
|
69
|
+
const relativeX = getRelativeX(event, ref.current);
|
|
70
|
+
setStartX(relativeX);
|
|
71
|
+
setCurrentX(relativeX);
|
|
72
|
+
}
|
|
73
|
+
function mouseMove(event) {
|
|
74
|
+
// Don't update guideX while a menu is open — the guide is what the click
|
|
75
|
+
// menu's rows refer to, so it stays at the click rather than following the
|
|
76
|
+
// pointer to the menu — or while a drag-selection is in progress (the
|
|
77
|
+
// rubberband should show, not the guide)
|
|
78
|
+
if (anchorPosition || mouseDragging) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
setGuideX(getRelativeX(event, ref.current));
|
|
82
|
+
}
|
|
83
|
+
function mouseOut() {
|
|
84
|
+
// Leave both the guide and the committed offsets alone once the menu is up
|
|
85
|
+
// (anchorPosition) or a drag is running: the offsets are exactly what the
|
|
86
|
+
// menu's items act on, and moving the pointer off the strip toward the menu
|
|
87
|
+
// used to clear them out from under it — "Zoom to region" then no-opped and
|
|
88
|
+
// "Get sequence" saw no regions.
|
|
89
|
+
if (!anchorPosition && !mouseDragging) {
|
|
90
|
+
setGuideX(undefined);
|
|
91
|
+
clearOffsets();
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function handleMenuItemClick(callback) {
|
|
95
|
+
callback();
|
|
96
|
+
handleClose();
|
|
97
|
+
}
|
|
98
|
+
const isClick = anchorPosition?.isClick;
|
|
99
|
+
const rubberbandOn = startX !== undefined && !isClick;
|
|
100
|
+
const right = anchorPosition?.offsetX ?? currentX;
|
|
101
|
+
const left = rubberbandOn ? Math.min(right, startX) : 0;
|
|
102
|
+
const width = rubberbandOn ? Math.abs(right - startX) : 0;
|
|
103
|
+
const views = rubberbandOn ? model.views : [];
|
|
104
|
+
return {
|
|
105
|
+
isClick,
|
|
106
|
+
rubberbandOn,
|
|
107
|
+
guideX,
|
|
108
|
+
anchorPosition,
|
|
109
|
+
left,
|
|
110
|
+
width,
|
|
111
|
+
leftBpOffset: views.map(v => v.pxToBp(left)),
|
|
112
|
+
rightBpOffset: views.map(v => v.pxToBp(left + width)),
|
|
113
|
+
numOfBpSelected: views.map(v => Math.ceil(width * v.bpPerPx)),
|
|
114
|
+
mouseDown,
|
|
115
|
+
mouseMove,
|
|
116
|
+
mouseOut,
|
|
117
|
+
handleClose,
|
|
118
|
+
handleMenuItemClick,
|
|
119
|
+
};
|
|
120
|
+
}
|