@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,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
const useStyles = makeStyles()({
|
|
5
|
+
zoomContainer: {
|
|
6
|
+
position: 'absolute',
|
|
7
|
+
top: 0,
|
|
8
|
+
height: '100%',
|
|
9
|
+
width: '100%',
|
|
10
|
+
pointerEvents: 'none',
|
|
11
|
+
},
|
|
12
|
+
innerContainer: {
|
|
13
|
+
position: 'absolute',
|
|
14
|
+
height: '100%',
|
|
15
|
+
pointerEvents: 'none',
|
|
16
|
+
// its own compositor layer: a pan then moves the layer instead of
|
|
17
|
+
// re-rasterizing the root layer's tiles, which paid for the gridline paths
|
|
18
|
+
// on every frame
|
|
19
|
+
willChange: 'transform',
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
// Shared zoom/scroll-transform wrapper for the gridline ticks and padding-block
|
|
23
|
+
// overlays. Lays the overlay out in the staticBlocks frame and shifts it into
|
|
24
|
+
// the viewport by `staticBlocksTranslateX`, so it tracks scroll — but a
|
|
25
|
+
// re-render only patches this div's transform plus the child's path `d`
|
|
26
|
+
// strings, so it stays cheap per frame.
|
|
27
|
+
const ZoomTransform = observer(function ZoomTransform({ model, offset = 0, children, }) {
|
|
28
|
+
const { classes } = useStyles();
|
|
29
|
+
const { staticBlocks, staticBlocksTranslateX } = model;
|
|
30
|
+
return (_jsx("div", { className: classes.zoomContainer, children: _jsx("div", { className: classes.innerContainer, style: {
|
|
31
|
+
// unrounded, unlike ScalebarCoordinateLabels: the children here are
|
|
32
|
+
// paths and boxes rather than text, so there is no glyph to blur
|
|
33
|
+
transform: `translateX(${staticBlocksTranslateX - offset}px)`,
|
|
34
|
+
width: staticBlocks.totalWidthPx,
|
|
35
|
+
}, children: children }) }));
|
|
36
|
+
});
|
|
37
|
+
export default ZoomTransform;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_MOTIFS = "# name<space>site \u2014 '^' or, cutting downstream, '(n/m)'. Edit freely.\nEcoRI G^AATTC\nBamHI G^GATCC\nHindIII A^AGCTT\nNotI GC^GGCCGC\nXhoI C^TCGAG\nSalI G^TCGAC\nPstI CTGCA^G\nSmaI CCC^GGG\nKpnI GGTAC^C\nSacI GAGCT^C\nXbaI T^CTAGA\nSpeI A^CTAGT\nNcoI C^CATGG\nNdeI CA^TATG\nEcoRV GAT^ATC\nBglII A^GATCT";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// A starting point, not a database: this is only the initial value of the motif
|
|
2
|
+
// textarea, so a user can wipe it and paste their own enzyme set (or any motif
|
|
3
|
+
// set at all) from REBASE or elsewhere. Sites use REBASE notation: '^' for a cut
|
|
4
|
+
// inside the site, '(n/m)' for the type IIS enzymes that cut downstream of it —
|
|
5
|
+
// the prefill sticks to the classic '^' cutters, but both parse.
|
|
6
|
+
export const DEFAULT_MOTIFS = `# name<space>site — '^' or, cutting downstream, '(n/m)'. Edit freely.
|
|
7
|
+
EcoRI G^AATTC
|
|
8
|
+
BamHI G^GATCC
|
|
9
|
+
HindIII A^AGCTT
|
|
10
|
+
NotI GC^GGCCGC
|
|
11
|
+
XhoI C^TCGAG
|
|
12
|
+
SalI G^TCGAC
|
|
13
|
+
PstI CTGCA^G
|
|
14
|
+
SmaI CCC^GGG
|
|
15
|
+
KpnI GGTAC^C
|
|
16
|
+
SacI GAGCT^C
|
|
17
|
+
XbaI T^CTAGA
|
|
18
|
+
SpeI A^CTAGT
|
|
19
|
+
NcoI C^CATGG
|
|
20
|
+
NdeI CA^TATG
|
|
21
|
+
EcoRV GAT^ATC
|
|
22
|
+
BglII A^GATCT`;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { Feature } from '@jbrowse/core/util';
|
|
1
|
+
import type { StatusCallback } from '@jbrowse/core/util';
|
|
3
2
|
import type { Region } from '@jbrowse/core/util/types';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}, regions: Region[]): Promise<Feature[]>;
|
|
3
|
+
import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
4
|
+
export declare function fetchSequence(model: IAnyStateTreeNode, regions: Region[], opts?: {
|
|
5
|
+
signal?: AbortSignal;
|
|
6
|
+
statusCallback?: StatusCallback;
|
|
7
|
+
}): Promise<import("@jbrowse/core/util").Feature[]>;
|
|
@@ -1,26 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getSequenceAdapterConfig } from '@jbrowse/core/assemblyManager/assembly';
|
|
2
2
|
import { getSession } from '@jbrowse/core/util';
|
|
3
|
-
export async function fetchSequence(model, regions) {
|
|
3
|
+
export async function fetchSequence(model, regions, opts = {}) {
|
|
4
4
|
const session = getSession(model);
|
|
5
|
-
const { leftOffset, rightOffset } = model;
|
|
6
|
-
if (!leftOffset || !rightOffset) {
|
|
7
|
-
throw new Error('no offsets on model to use for range');
|
|
8
|
-
}
|
|
9
5
|
const assemblyNames = new Set(regions.map(r => r.assemblyName));
|
|
10
6
|
if (assemblyNames.size > 1) {
|
|
11
7
|
throw new Error('not able to fetch sequences from multiple assemblies currently');
|
|
12
8
|
}
|
|
13
9
|
const { rpcManager, assemblyManager } = session;
|
|
14
|
-
const assemblyName =
|
|
10
|
+
const assemblyName = regions[0]?.assemblyName;
|
|
11
|
+
if (!assemblyName) {
|
|
12
|
+
throw new Error('no assemblyName found on the selected region');
|
|
13
|
+
}
|
|
15
14
|
const assembly = assemblyManager.get(assemblyName);
|
|
16
15
|
if (!assembly) {
|
|
17
16
|
throw new Error(`assembly ${assemblyName} not found`);
|
|
18
17
|
}
|
|
19
|
-
|
|
18
|
+
// Undefined here means the assembly's `configuration` safeReference is
|
|
19
|
+
// unresolved — the assembly outlived the config entry it points at. NOT an
|
|
20
|
+
// assembly whose sequence carries no residues: a ChromSizesAdapter one still
|
|
21
|
+
// has a `sequence.adapter`, and fails later, inside the adapter. Say which
|
|
22
|
+
// this is; passing the undefined on fails in getAdapterPre as "could not
|
|
23
|
+
// determine adapter type", naming neither the assembly nor what was wanted.
|
|
24
|
+
const adapterConfig = getSequenceAdapterConfig(assembly);
|
|
25
|
+
if (!adapterConfig) {
|
|
26
|
+
throw new Error(`assembly ${assemblyName} has no resolved configuration, so its sequence adapter cannot be read`);
|
|
27
|
+
}
|
|
20
28
|
const sessionId = 'getSequence';
|
|
21
29
|
return rpcManager.call(sessionId, 'CoreGetFeatures', {
|
|
22
30
|
adapterConfig,
|
|
23
31
|
regions,
|
|
24
|
-
|
|
32
|
+
...opts,
|
|
25
33
|
});
|
|
26
34
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
2
|
+
import type { MenuItem, RecentLocation } from '@jbrowse/core/ui';
|
|
3
|
+
/**
|
|
4
|
+
* What a navigated result is worth remembering as. The display string is what
|
|
5
|
+
* the row shows; the location is what reopening it opens, and is absent for a
|
|
6
|
+
* freehand query, whose label is the searchable thing. Paired with the
|
|
7
|
+
* `BaseResult` the menu rebuilds below so the round trip stays visible in one
|
|
8
|
+
* place: a row replayed through it records the same pair it came from.
|
|
9
|
+
*/
|
|
10
|
+
export declare function recentLocationOf(option: BaseResult): RecentLocation;
|
|
11
|
+
export declare function recentLocationsMenu({ recentLocations, onNavigate, onClear, }: {
|
|
12
|
+
recentLocations: RecentLocation[];
|
|
13
|
+
onNavigate: (option: BaseResult) => void;
|
|
14
|
+
onClear: () => void;
|
|
15
|
+
}): MenuItem[];
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
2
|
+
/**
|
|
3
|
+
* What a navigated result is worth remembering as. The display string is what
|
|
4
|
+
* the row shows; the location is what reopening it opens, and is absent for a
|
|
5
|
+
* freehand query, whose label is the searchable thing. Paired with the
|
|
6
|
+
* `BaseResult` the menu rebuilds below so the round trip stays visible in one
|
|
7
|
+
* place: a row replayed through it records the same pair it came from.
|
|
8
|
+
*/
|
|
9
|
+
export function recentLocationOf(option) {
|
|
10
|
+
return { label: option.getDisplayString(), loc: option.getLocation() };
|
|
11
|
+
}
|
|
12
|
+
// Builds the "Recent ▸" submenu shared by the header search box and the import
|
|
13
|
+
// form overflow menus, so both surfaces stay identical. Empty when there is no
|
|
14
|
+
// history yet, so the ⋮ button only appears once there is something to show.
|
|
15
|
+
export function recentLocationsMenu({ recentLocations, onNavigate, onClear, }) {
|
|
16
|
+
return recentLocations.length
|
|
17
|
+
? [
|
|
18
|
+
{
|
|
19
|
+
label: 'Recent',
|
|
20
|
+
subMenu: [
|
|
21
|
+
...recentLocations.map(({ label, loc }) => ({
|
|
22
|
+
// the list dedupes on the location, so two rows can share a
|
|
23
|
+
// display string — two features of the same name at different
|
|
24
|
+
// loci, or two snippets ellipsized to the same text. `id` is what
|
|
25
|
+
// keeps them separate rows to React, which otherwise keys both on
|
|
26
|
+
// that one label.
|
|
27
|
+
//
|
|
28
|
+
// Prefixed, because a freehand row has no location and falls back
|
|
29
|
+
// to its label, which may itself be a locstring — unprefixed, that
|
|
30
|
+
// row and a recorded one at the same locus share an id.
|
|
31
|
+
id: loc ? `loc:${loc}` : `query:${label}`,
|
|
32
|
+
label,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
// a row that recorded a location navigates straight to it; one
|
|
35
|
+
// with only a label goes back through the search path, which is
|
|
36
|
+
// where a freehand query resolved the first time
|
|
37
|
+
onNavigate(new BaseResult({ label, locString: loc }));
|
|
38
|
+
},
|
|
39
|
+
})),
|
|
40
|
+
{ type: 'divider' },
|
|
41
|
+
{ label: 'Clear recent locations', onClick: onClear },
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
]
|
|
45
|
+
: [];
|
|
46
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface SequenceSearchModel {
|
|
2
|
+
assemblyNames: string[];
|
|
3
|
+
launchTrack: (trackId: string) => Promise<unknown>;
|
|
4
|
+
}
|
|
5
|
+
export interface SequenceSearchModeProps {
|
|
6
|
+
model: SequenceSearchModel;
|
|
7
|
+
handleClose: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare function addReferenceScanTrack(model: SequenceSearchModel, args: {
|
|
10
|
+
trackId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
adapter: Record<string, unknown>;
|
|
13
|
+
}): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { getSession, isSessionWithAddSessionTrack } from '@jbrowse/core/util';
|
|
2
|
+
// Creates a FeatureTrack that scans the assembly's reference sequence and shows
|
|
3
|
+
// it. `adapter` carries the type + params only: the scan adapters resolve the
|
|
4
|
+
// sequence from the track's assembly at fetch time (getSequenceSubAdapter), so
|
|
5
|
+
// no sequence adapter is baked into the track config here.
|
|
6
|
+
export function addReferenceScanTrack(model, args) {
|
|
7
|
+
const session = getSession(model);
|
|
8
|
+
const assemblyName = model.assemblyNames[0];
|
|
9
|
+
if (isSessionWithAddSessionTrack(session)) {
|
|
10
|
+
session.addSessionTrackConf({
|
|
11
|
+
trackId: args.trackId,
|
|
12
|
+
name: args.name,
|
|
13
|
+
assemblyNames: [assemblyName],
|
|
14
|
+
type: 'FeatureTrack',
|
|
15
|
+
adapter: args.adapter,
|
|
16
|
+
});
|
|
17
|
+
void model.launchTrack(args.trackId);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
session.notify('This session does not support adding tracks', 'warning');
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../model.ts';
|
|
2
|
+
import type { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
4
|
+
export declare function getTrackOrderSubMenu({ view, track, }: {
|
|
5
|
+
view: LinearGenomeViewModel;
|
|
6
|
+
track: BaseTrackModel;
|
|
7
|
+
}): MenuItem[];
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|
|
2
|
+
import KeyboardArrowUpIcon from '@mui/icons-material/KeyboardArrowUp';
|
|
3
|
+
import KeyboardDoubleArrowDownIcon from '@mui/icons-material/KeyboardDoubleArrowDown';
|
|
4
|
+
import KeyboardDoubleArrowUpIcon from '@mui/icons-material/KeyboardDoubleArrowUp';
|
|
5
|
+
import PushPinIcon from '@mui/icons-material/PushPin';
|
|
6
|
+
// Pin/unpin and reorder items for a single track. Pinning is only meaningful in
|
|
7
|
+
// a top-level view; the to-top/to-bottom jumps are redundant with up/down when
|
|
8
|
+
// there are only two tracks, so they need a third track to appear.
|
|
9
|
+
export function getTrackOrderSubMenu({ view, track, }) {
|
|
10
|
+
const { isTopLevelView, tracks } = view;
|
|
11
|
+
const { pinned } = track;
|
|
12
|
+
const canMove = tracks.length > 1;
|
|
13
|
+
const canJump = tracks.length > 2;
|
|
14
|
+
return [
|
|
15
|
+
...(isTopLevelView
|
|
16
|
+
? [
|
|
17
|
+
{
|
|
18
|
+
label: pinned ? 'Unpin track' : 'Pin track',
|
|
19
|
+
icon: PushPinIcon,
|
|
20
|
+
onClick: () => {
|
|
21
|
+
track.setPinned(!pinned);
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
]
|
|
25
|
+
: []),
|
|
26
|
+
...(canJump
|
|
27
|
+
? [
|
|
28
|
+
{
|
|
29
|
+
label: 'Move track to top',
|
|
30
|
+
icon: KeyboardDoubleArrowUpIcon,
|
|
31
|
+
onClick: () => {
|
|
32
|
+
view.moveTrackToTop(track.id);
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
]
|
|
36
|
+
: []),
|
|
37
|
+
...(canMove
|
|
38
|
+
? [
|
|
39
|
+
{
|
|
40
|
+
label: 'Move track up',
|
|
41
|
+
icon: KeyboardArrowUpIcon,
|
|
42
|
+
onClick: () => {
|
|
43
|
+
view.moveTrackUp(track.id);
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Move track down',
|
|
48
|
+
icon: KeyboardArrowDownIcon,
|
|
49
|
+
onClick: () => {
|
|
50
|
+
view.moveTrackDown(track.id);
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
]
|
|
54
|
+
: []),
|
|
55
|
+
...(canJump
|
|
56
|
+
? [
|
|
57
|
+
{
|
|
58
|
+
label: 'Move track to bottom',
|
|
59
|
+
icon: KeyboardDoubleArrowDownIcon,
|
|
60
|
+
onClick: () => {
|
|
61
|
+
view.moveTrackToBottom(track.id);
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
]
|
|
65
|
+
: []),
|
|
66
|
+
];
|
|
67
|
+
}
|
|
@@ -1,84 +1,26 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
+
import type React from 'react';
|
|
3
3
|
interface AnchorPosition {
|
|
4
4
|
offsetX: number;
|
|
5
5
|
clientX: number;
|
|
6
6
|
clientY: number;
|
|
7
|
-
isClick
|
|
7
|
+
isClick: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare function useRangeSelect(ref: React.RefObject<HTMLDivElement | null>, model: LinearGenomeViewModel, shiftOnly?: boolean): {
|
|
10
|
-
open: boolean;
|
|
11
10
|
isClick: boolean | undefined;
|
|
12
|
-
clickBpOffset: {
|
|
13
|
-
coord: number;
|
|
14
|
-
index: number;
|
|
15
|
-
refName: string;
|
|
16
|
-
oob: boolean;
|
|
17
|
-
assemblyName: string;
|
|
18
|
-
offset: number;
|
|
19
|
-
start: number;
|
|
20
|
-
end: number;
|
|
21
|
-
reversed?: boolean;
|
|
22
|
-
} | undefined;
|
|
23
11
|
guideX: number | undefined;
|
|
24
12
|
mouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
25
13
|
mouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
26
14
|
mouseOut: () => void;
|
|
27
15
|
handleClose: () => void;
|
|
28
|
-
handleMenuItemClick: (
|
|
16
|
+
handleMenuItemClick: (callback: () => void) => void;
|
|
29
17
|
anchorPosition: AnchorPosition | undefined;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} | {
|
|
37
|
-
open: boolean;
|
|
38
|
-
isClick: boolean | undefined;
|
|
39
|
-
clickBpOffset: {
|
|
40
|
-
coord: number;
|
|
41
|
-
index: number;
|
|
42
|
-
refName: string;
|
|
43
|
-
oob: boolean;
|
|
44
|
-
assemblyName: string;
|
|
45
|
-
offset: number;
|
|
46
|
-
start: number;
|
|
47
|
-
end: number;
|
|
48
|
-
reversed?: boolean;
|
|
18
|
+
rubberband: {
|
|
19
|
+
leftBpOffset: ReturnType<LinearGenomeViewModel['pxToBp']>;
|
|
20
|
+
rightBpOffset: ReturnType<LinearGenomeViewModel['pxToBp']>;
|
|
21
|
+
numOfBpSelected: number;
|
|
22
|
+
width: number;
|
|
23
|
+
left: number;
|
|
49
24
|
} | undefined;
|
|
50
|
-
guideX: number | undefined;
|
|
51
|
-
rubberbandOn: boolean;
|
|
52
|
-
mouseDown: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
53
|
-
mouseMove: (event: React.MouseEvent<HTMLDivElement>) => void;
|
|
54
|
-
mouseOut: () => void;
|
|
55
|
-
handleClose: () => void;
|
|
56
|
-
handleMenuItemClick: (_: unknown, callback: () => void) => void;
|
|
57
|
-
leftBpOffset: {
|
|
58
|
-
coord: number;
|
|
59
|
-
index: number;
|
|
60
|
-
refName: string;
|
|
61
|
-
oob: boolean;
|
|
62
|
-
assemblyName: string;
|
|
63
|
-
offset: number;
|
|
64
|
-
start: number;
|
|
65
|
-
end: number;
|
|
66
|
-
reversed?: boolean;
|
|
67
|
-
};
|
|
68
|
-
rightBpOffset: {
|
|
69
|
-
coord: number;
|
|
70
|
-
index: number;
|
|
71
|
-
refName: string;
|
|
72
|
-
oob: boolean;
|
|
73
|
-
assemblyName: string;
|
|
74
|
-
offset: number;
|
|
75
|
-
start: number;
|
|
76
|
-
end: number;
|
|
77
|
-
reversed?: boolean;
|
|
78
|
-
};
|
|
79
|
-
anchorPosition: AnchorPosition | undefined;
|
|
80
|
-
numOfBpSelected: number;
|
|
81
|
-
width: number;
|
|
82
|
-
left: number;
|
|
83
25
|
};
|
|
84
26
|
export {};
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import { useCallback,
|
|
2
|
-
import { getRelativeX } from
|
|
1
|
+
import { useCallback, useState } from 'react';
|
|
2
|
+
import { getRelativeX } from '@jbrowse/core/util/getRelativeX';
|
|
3
|
+
import { useWindowDrag } from '../../shared/useWindowDrag.js';
|
|
4
|
+
import { isOnScalebarRefLabel } from './util.js';
|
|
3
5
|
export function useRangeSelect(ref, model, shiftOnly) {
|
|
4
6
|
const [startX, setStartX] = useState();
|
|
5
7
|
const [currentX, setCurrentX] = useState();
|
|
8
|
+
const [startedOnRefLabel, setStartedOnRefLabel] = useState(false);
|
|
9
|
+
// clientX and clientY used for anchorPosition for menu
|
|
10
|
+
// offsetX used for calculations about width of selection
|
|
6
11
|
const [anchorPosition, setAnchorPosition] = useState();
|
|
7
12
|
const [guideX, setGuideX] = useState();
|
|
8
13
|
const mouseDragging = startX !== undefined && anchorPosition === undefined;
|
|
@@ -12,147 +17,94 @@ export function useRangeSelect(ref, model, shiftOnly) {
|
|
|
12
17
|
setCurrentX(undefined);
|
|
13
18
|
setGuideX(undefined);
|
|
14
19
|
}, []);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
useWindowDrag(ref, mouseDragging ? startX : undefined, {
|
|
21
|
+
onMove: setCurrentX,
|
|
22
|
+
onEnd: ({ startX, endX, isClick, clientX, clientY }) => {
|
|
23
|
+
// A click on a scalebar refName label belongs to the label's own menu.
|
|
24
|
+
// Drop the hover guide too: that menu covers it, and nothing else clears
|
|
25
|
+
// it once the menu closes
|
|
26
|
+
if (isClick && startedOnRefLabel) {
|
|
27
|
+
setStartX(undefined);
|
|
28
|
+
setCurrentX(undefined);
|
|
29
|
+
setGuideX(undefined);
|
|
18
30
|
return;
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
leftOffset: model.pxToBp(leftPx),
|
|
24
|
-
rightOffset: model.pxToBp(rightPx),
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
function globalMouseMove(event) {
|
|
28
|
-
if (ref.current && mouseDragging) {
|
|
29
|
-
const relativeX = getRelativeX(event, ref.current);
|
|
30
|
-
setCurrentX(relativeX);
|
|
32
|
+
setAnchorPosition({ offsetX: endX, clientX, clientY, isClick });
|
|
33
|
+
if (isClick) {
|
|
34
|
+
setGuideX(endX);
|
|
31
35
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const { clientX, clientY } = event;
|
|
36
|
-
const offsetX = getRelativeX(event, ref.current);
|
|
37
|
-
const isClick = Math.abs(offsetX - startX) <= 3;
|
|
38
|
-
if (isClick && model.scalebarRefNameClickPending) {
|
|
39
|
-
setStartX(undefined);
|
|
40
|
-
setCurrentX(undefined);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
if (!isClick && model.scalebarRefNameClickPending) {
|
|
44
|
-
model.setScalebarRefNameClickPending(false);
|
|
45
|
-
}
|
|
46
|
-
setAnchorPosition({
|
|
47
|
-
offsetX,
|
|
48
|
-
clientX,
|
|
49
|
-
clientY,
|
|
50
|
-
isClick,
|
|
51
|
-
});
|
|
52
|
-
if (isClick) {
|
|
53
|
-
setGuideX(offsetX);
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
const args = computeOffsets(offsetX);
|
|
57
|
-
if (args) {
|
|
58
|
-
model.setOffsets(args.leftOffset, args.rightOffset);
|
|
59
|
-
}
|
|
60
|
-
setGuideX(undefined);
|
|
61
|
-
}
|
|
36
|
+
else {
|
|
37
|
+
model.setOffsets(model.pxToBp(Math.min(startX, endX)), model.pxToBp(Math.max(startX, endX)));
|
|
38
|
+
setGuideX(undefined);
|
|
62
39
|
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
window.removeEventListener('mouseup', globalMouseUp);
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
return () => { };
|
|
73
|
-
}, [startX, mouseDragging, model, ref, handleClose]);
|
|
40
|
+
},
|
|
41
|
+
onCancel: () => {
|
|
42
|
+
setStartX(undefined);
|
|
43
|
+
setCurrentX(undefined);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
74
46
|
function mouseDown(event) {
|
|
75
47
|
if (shiftOnly && !event.shiftKey) {
|
|
76
48
|
return;
|
|
77
49
|
}
|
|
50
|
+
// a press with the refName menu already open reopens it on the label under
|
|
51
|
+
// the pointer; same stranded-guide reasoning as the mouseup path above
|
|
78
52
|
if (model.isScalebarRefNameMenuOpen) {
|
|
53
|
+
setGuideX(undefined);
|
|
79
54
|
return;
|
|
80
55
|
}
|
|
81
56
|
event.preventDefault();
|
|
82
57
|
event.stopPropagation();
|
|
58
|
+
// clear any leftover menu/selection so a fresh drag isn't blocked by a
|
|
59
|
+
// stale anchorPosition keeping mouseDragging false
|
|
60
|
+
setAnchorPosition(undefined);
|
|
61
|
+
setStartedOnRefLabel(isOnScalebarRefLabel(event.target));
|
|
83
62
|
const relativeX = getRelativeX(event, ref.current);
|
|
84
63
|
setStartX(relativeX);
|
|
85
64
|
setCurrentX(relativeX);
|
|
86
65
|
}
|
|
87
66
|
function mouseMove(event) {
|
|
67
|
+
// Keep the rubberband visible while a drag-selection menu is open
|
|
88
68
|
if (anchorPosition?.isClick === false) {
|
|
89
69
|
return;
|
|
90
70
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
else if (shiftOnly) {
|
|
95
|
-
if (event.shiftKey) {
|
|
96
|
-
setGuideX(getRelativeX(event, ref.current));
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
setGuideX(undefined);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
else {
|
|
103
|
-
setGuideX(getRelativeX(event, ref.current));
|
|
104
|
-
}
|
|
71
|
+
const wantsGuide = !mouseDragging && (!shiftOnly || event.shiftKey);
|
|
72
|
+
setGuideX(wantsGuide ? getRelativeX(event, ref.current) : undefined);
|
|
105
73
|
}
|
|
106
74
|
function mouseOut() {
|
|
107
75
|
if (!anchorPosition?.isClick) {
|
|
108
76
|
setGuideX(undefined);
|
|
109
77
|
}
|
|
110
78
|
}
|
|
111
|
-
function handleMenuItemClick(
|
|
79
|
+
function handleMenuItemClick(callback) {
|
|
112
80
|
callback();
|
|
113
81
|
handleClose();
|
|
114
82
|
}
|
|
115
|
-
const open = Boolean(anchorPosition);
|
|
116
83
|
const isClick = anchorPosition?.isClick;
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (startX
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
handleMenuItemClick,
|
|
131
|
-
anchorPosition,
|
|
84
|
+
// rubberband geometry only exists while a drag is in progress (startX set);
|
|
85
|
+
// grouped so a single truthiness check narrows all fields for RubberbandSpan
|
|
86
|
+
let rubberband;
|
|
87
|
+
if (startX !== undefined) {
|
|
88
|
+
const right = anchorPosition ? anchorPosition.offsetX : (currentX ?? startX);
|
|
89
|
+
const left = Math.min(right, startX);
|
|
90
|
+
const width = Math.abs(right - startX);
|
|
91
|
+
rubberband = {
|
|
92
|
+
leftBpOffset: model.pxToBp(left),
|
|
93
|
+
rightBpOffset: model.pxToBp(left + width),
|
|
94
|
+
numOfBpSelected: Math.ceil(width * model.bpPerPx),
|
|
95
|
+
width,
|
|
96
|
+
left,
|
|
132
97
|
};
|
|
133
98
|
}
|
|
134
|
-
const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
|
|
135
|
-
const left = Math.min(right, startX);
|
|
136
|
-
const width = Math.abs(right - startX);
|
|
137
|
-
const leftBpOffset = model.pxToBp(left);
|
|
138
|
-
const rightBpOffset = model.pxToBp(left + width);
|
|
139
|
-
const numOfBpSelected = Math.ceil(width * model.bpPerPx);
|
|
140
99
|
return {
|
|
141
|
-
open,
|
|
142
100
|
isClick,
|
|
143
|
-
clickBpOffset,
|
|
144
101
|
guideX,
|
|
145
|
-
rubberbandOn: !isClick,
|
|
146
102
|
mouseDown,
|
|
147
103
|
mouseMove,
|
|
148
104
|
mouseOut,
|
|
149
105
|
handleClose,
|
|
150
106
|
handleMenuItemClick,
|
|
151
|
-
leftBpOffset,
|
|
152
|
-
rightBpOffset,
|
|
153
107
|
anchorPosition,
|
|
154
|
-
|
|
155
|
-
width,
|
|
156
|
-
left,
|
|
108
|
+
rubberband,
|
|
157
109
|
};
|
|
158
110
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
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 declare function useSearchBoxPrefs(prefix: string, numViews: number): {
|
|
16
|
+
showSearchBoxes: boolean;
|
|
17
|
+
setShowSearchBoxes: (value: boolean | ((val: boolean) => boolean)) => void;
|
|
18
|
+
sideBySide: boolean;
|
|
19
|
+
setSideBySide: (value: boolean | ((val: boolean) => boolean)) => void;
|
|
20
|
+
};
|
|
21
|
+
export type SearchBoxPrefs = ReturnType<typeof useSearchBoxPrefs>;
|
|
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 declare function searchBoxMenuItems({ showSearchBoxes, setShowSearchBoxes, sideBySide, setSideBySide, }: SearchBoxPrefs): MenuItem[];
|