@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/FeatureTrack/configSchema.d.ts +104 -65
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +250 -121
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +16 -7
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +32 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +19 -23
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +13 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/Rubberband.js +13 -16
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +16 -21
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +58 -66
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
- package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
- package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
- package/esm/LinearGenomeView/components/util.d.ts +20 -6
- package/esm/LinearGenomeView/components/util.js +27 -6
- package/esm/LinearGenomeView/consts.d.ts +7 -2
- package/esm/LinearGenomeView/consts.js +18 -2
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +27 -0
- package/esm/LinearGenomeView/headerFit.js +59 -0
- package/esm/LinearGenomeView/index.d.ts +32 -2
- package/esm/LinearGenomeView/index.js +16 -6
- package/esm/LinearGenomeView/initKeys.d.ts +12 -0
- package/esm/LinearGenomeView/initKeys.js +68 -0
- package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
- package/esm/LinearGenomeView/keyboardHandler.js +10 -0
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +23 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
- package/esm/LinearGenomeView/lazyDialogs.js +3 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
- package/esm/LinearGenomeView/linkedViewSync.js +58 -0
- package/esm/LinearGenomeView/menuItems.d.ts +27 -2
- package/esm/LinearGenomeView/menuItems.js +137 -101
- package/esm/LinearGenomeView/model.d.ts +3238 -136
- package/esm/LinearGenomeView/model.js +2425 -528
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
- package/esm/LinearGenomeView/stickyChrome.js +30 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
- package/esm/LinearGenomeView/types.d.ts +17 -31
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +332 -12
- package/esm/LinearGenomeView/util.js +606 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
- package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +1 -0
- package/esm/MultiLevelRubberband/types.d.ts +6 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
- package/esm/displayKitTests/perRegionTestEnv.js +138 -0
- package/esm/index.d.ts +122 -1235
- package/esm/index.js +101 -24
- package/esm/lazyPluginExports.d.ts +23 -0
- package/esm/lazyPluginExports.js +36 -0
- package/esm/searchUtils.d.ts +55 -11
- package/esm/searchUtils.js +342 -45
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +33 -0
- package/esm/shared/coordLabels.d.ts +40 -0
- package/esm/shared/coordLabels.js +119 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -1,168 +1,184 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { Menu } from '@jbrowse/core/ui';
|
|
4
|
+
import { assembleLocString, assembleLocStrings } from '@jbrowse/core/util';
|
|
5
|
+
import { copyText } from '@jbrowse/core/util/copyText';
|
|
4
6
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
5
7
|
import { observer } from 'mobx-react';
|
|
8
|
+
import { REF_NAME_LABEL_FONT_SIZE, regionMoveActions, withRegionMoved, withRegionRemoved, withRegionReversed, } from '../util.js';
|
|
6
9
|
const useStyles = makeStyles()(theme => ({
|
|
7
10
|
refLabel: {
|
|
8
|
-
|
|
11
|
+
// the width the fit test in getScalebarRefNameLabels measures against
|
|
12
|
+
fontSize: REF_NAME_LABEL_FONT_SIZE,
|
|
13
|
+
// maxWidth is the label's whole box, paddingLeft included — stated here
|
|
14
|
+
// rather than inherited from whatever box-sizing the embedding page sets,
|
|
15
|
+
// since under content-box the padding comes off the text twice (once in the
|
|
16
|
+
// maxWidth the fit test was given, once in the layout) and every name wide
|
|
17
|
+
// enough to need the space is clipped mid-glyph
|
|
18
|
+
boxSizing: 'border-box',
|
|
9
19
|
position: 'absolute',
|
|
10
|
-
|
|
20
|
+
// x-position is driven by transform:translateX (compositor-only) not left
|
|
21
|
+
left: 0,
|
|
11
22
|
top: -1,
|
|
12
23
|
fontWeight: 'bold',
|
|
13
24
|
lineHeight: 'normal',
|
|
14
25
|
zIndex: 1,
|
|
15
26
|
background: theme.palette.background.paper,
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
// clip, not hidden: transform/maxWidth are patched on every scroll-zoom
|
|
28
|
+
// frame, and `hidden` would make each label its own scroll container —
|
|
29
|
+
// scrollable-overflow bookkeeping and scroll anchoring per label per frame,
|
|
30
|
+
// for a box that never scrolls. clip is a paint-time rect instead
|
|
31
|
+
overflow: 'clip',
|
|
18
32
|
whiteSpace: 'nowrap',
|
|
33
|
+
},
|
|
34
|
+
// only a refName label opens a menu. The assembly-name chip beside it is a
|
|
35
|
+
// caption, and wearing the pointer and the hover tint made it look like the
|
|
36
|
+
// one thing on the row that does nothing when clicked
|
|
37
|
+
clickable: {
|
|
38
|
+
cursor: 'pointer',
|
|
19
39
|
'&:hover': {
|
|
20
|
-
|
|
40
|
+
// action.hover is a mode-aware translucent overlay; the old hardcoded
|
|
41
|
+
// grey[300] stayed light in dark mode, washing out the light label text
|
|
42
|
+
background: theme.palette.action.hover,
|
|
21
43
|
},
|
|
22
44
|
},
|
|
23
|
-
|
|
24
|
-
left: 0,
|
|
45
|
+
prefixLabel: {
|
|
25
46
|
zIndex: 100,
|
|
26
47
|
},
|
|
27
48
|
}));
|
|
28
49
|
const ScalebarRefNameLabels = observer(function ScalebarRefNameLabels({ model, }) {
|
|
29
50
|
const { classes, cx } = useStyles();
|
|
30
|
-
const { staticBlocks, offsetPx, scalebarDisplayPrefix } = model;
|
|
31
51
|
const [menuState, setMenuState] = useState();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
const val = scalebarDisplayPrefix();
|
|
45
|
-
const b0 = staticBlocks.blocks[0];
|
|
46
|
-
const regionEndPx = new Map();
|
|
47
|
-
for (const block of staticBlocks.blocks) {
|
|
48
|
-
if (block.type === 'ContentBlock' && block.regionNumber !== undefined) {
|
|
49
|
-
const endPx = block.offsetPx + block.widthPx;
|
|
50
|
-
const current = regionEndPx.get(block.regionNumber);
|
|
51
|
-
if (current === undefined || endPx > current) {
|
|
52
|
-
regionEndPx.set(block.regionNumber, endPx);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return (_jsxs(_Fragment, { children: [b0?.type !== 'ContentBlock' && val ? (_jsx("span", { className: cx(classes.b0, classes.refLabel), children: val })) : null, staticBlocks.map((block, index) => {
|
|
57
|
-
const { offsetPx: blockOffsetPx, isLeftEndOfDisplayedRegion, key, type, refName, regionNumber, } = block;
|
|
58
|
-
const last = index === lastLeftBlock;
|
|
59
|
-
const regEndPx = regionNumber !== undefined ? regionEndPx.get(regionNumber) : undefined;
|
|
60
|
-
const labelStartPx = last ? offsetPx : blockOffsetPx;
|
|
61
|
-
const maxWidth = regEndPx !== undefined ? regEndPx - labelStartPx - 2 : undefined;
|
|
62
|
-
const minLabelWidth = 20;
|
|
63
|
-
const hasEnoughSpace = maxWidth === undefined || maxWidth >= minLabelWidth;
|
|
64
|
-
return type === 'ContentBlock' &&
|
|
65
|
-
(isLeftEndOfDisplayedRegion || last) &&
|
|
66
|
-
hasEnoughSpace ? (_jsxs("span", { style: {
|
|
67
|
-
left: last
|
|
68
|
-
? Math.max(0, -offsetPx)
|
|
69
|
-
: blockOffsetPx - offsetPx - 1,
|
|
70
|
-
paddingLeft: last ? 0 : 1,
|
|
71
|
-
maxWidth: maxWidth !== undefined && maxWidth > 0 ? maxWidth : undefined,
|
|
72
|
-
}, className: classes.refLabel, "data-testid": `refLabel-${refName}`, onMouseDown: () => {
|
|
73
|
-
model.setScalebarRefNameClickPending(true);
|
|
74
|
-
}, onClick: event => {
|
|
75
|
-
model.setScalebarRefNameClickPending(false);
|
|
76
|
-
setMenuState({
|
|
77
|
-
anchorEl: event.currentTarget,
|
|
78
|
-
refName,
|
|
79
|
-
regionNumber: regionNumber,
|
|
80
|
-
});
|
|
81
|
-
}, children: [last && val ? `${val}:` : '', refName] }, `refLabel-${key}-${index}`)) : null;
|
|
82
|
-
}), menuState ? (_jsx(RefNameMenu, { model: model, menuState: menuState, onClose: () => {
|
|
52
|
+
// `model.scalebarRefNameLabels`, not a getScalebarRefNameLabels call of its
|
|
53
|
+
// own: a host drawing its own region names reads the same getter, so the
|
|
54
|
+
// sticky/dedup/fit rules can't be one thing here and another there. The SVG
|
|
55
|
+
// export still calls the helper directly, deliberately and with no prefix.
|
|
56
|
+
const { labels, caption } = model.scalebarRefNameLabels;
|
|
57
|
+
return (_jsxs(_Fragment, { children: [labels.map((label, i) => (_jsx(RefLabel
|
|
58
|
+
// eslint-disable-next-line @eslint-react/no-array-index-key -- position IS the identity here; keying by the run makes the list churn on zoom
|
|
59
|
+
, { model: model, label: label, onOpenMenu: state => {
|
|
60
|
+
setMenuState(state);
|
|
61
|
+
} }, i))), caption === undefined ? null : (_jsx("span", { className: cx(classes.prefixLabel, classes.refLabel), "data-testid": "refLabel-prefix", children: caption })), menuState ? (_jsx(RefNameMenu, { model: model, menuState: menuState, onClose: () => {
|
|
62
|
+
model.setIsScalebarRefNameMenuOpen(false);
|
|
83
63
|
setMenuState(undefined);
|
|
84
64
|
} })) : null] }));
|
|
85
65
|
});
|
|
86
|
-
|
|
66
|
+
// One refName label. Not an observer: `label` is already plain data computed by
|
|
67
|
+
// the parent, and `model` is only used to fire actions. mouseDown flags the
|
|
68
|
+
// click as starting on a label so the scalebar's rubberband hands the click to
|
|
69
|
+
// this label's own onClick instead of opening the range menu.
|
|
70
|
+
function RefLabel({ model, label, onOpenMenu, }) {
|
|
71
|
+
const { classes, cx } = useStyles();
|
|
72
|
+
const { refName, displayedRegionIndex, lastDisplayedRegionIndex, transform, maxWidth, paddingLeft, text, } = label;
|
|
73
|
+
return (_jsx("span", { className: cx(classes.refLabel, classes.clickable), style: {
|
|
74
|
+
transform: `translateX(${transform}px)`,
|
|
75
|
+
paddingLeft,
|
|
76
|
+
maxWidth,
|
|
77
|
+
}, "data-testid": `refLabel-${refName}`, onMouseDown: () => {
|
|
78
|
+
model.setScalebarRefNameClickPending(true);
|
|
79
|
+
}, onClick: e => {
|
|
80
|
+
model.setScalebarRefNameClickPending(false);
|
|
81
|
+
model.setIsScalebarRefNameMenuOpen(true);
|
|
82
|
+
onOpenMenu({
|
|
83
|
+
anchorEl: e.currentTarget,
|
|
84
|
+
refName,
|
|
85
|
+
displayedRegionIndex,
|
|
86
|
+
lastDisplayedRegionIndex,
|
|
87
|
+
});
|
|
88
|
+
}, children: text }));
|
|
89
|
+
}
|
|
90
|
+
const RefNameMenu = observer(function RefNameMenu({ model, menuState, onClose, }) {
|
|
87
91
|
const { displayedRegions } = model;
|
|
88
|
-
const { refName,
|
|
92
|
+
const { refName, displayedRegionIndex: idx, lastDisplayedRegionIndex: lastIdx, } = menuState;
|
|
89
93
|
const numRegions = displayedRegions.length;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
label: 'Move left',
|
|
105
|
-
onClick: () => {
|
|
106
|
-
moveRegion(regionNumber, regionNumber - 1);
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
]
|
|
110
|
-
: []),
|
|
111
|
-
...(regionNumber < numRegions - 1
|
|
112
|
-
? [
|
|
113
|
-
{
|
|
114
|
-
label: 'Move right',
|
|
115
|
-
onClick: () => {
|
|
116
|
-
moveRegion(regionNumber, regionNumber + 1);
|
|
117
|
-
},
|
|
118
|
-
},
|
|
119
|
-
]
|
|
120
|
-
: []),
|
|
121
|
-
...(numRegions > 2 && regionNumber > 0
|
|
122
|
-
? [
|
|
123
|
-
{
|
|
124
|
-
label: 'Move to far left',
|
|
125
|
-
onClick: () => {
|
|
126
|
-
moveRegion(regionNumber, 0);
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
]
|
|
130
|
-
: []),
|
|
131
|
-
...(numRegions > 2 && regionNumber < numRegions - 1
|
|
132
|
-
? [
|
|
133
|
-
{
|
|
134
|
-
label: 'Move to far right',
|
|
135
|
-
onClick: () => {
|
|
136
|
-
moveRegion(regionNumber, numRegions - 1);
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
]
|
|
140
|
-
: []),
|
|
141
|
-
{
|
|
142
|
-
label: 'Remove this region from view',
|
|
143
|
-
onClick: () => {
|
|
144
|
-
removeRegion(regionNumber);
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
];
|
|
148
|
-
return (_jsx(Menu, { anchorEl: menuState.anchorEl, open: true, onClose: onClose, onMenuItemClick: (_, callback) => {
|
|
94
|
+
const labeled = displayedRegions.slice(idx, lastIdx + 1);
|
|
95
|
+
// A label naming several regions is the collapsed-intron case: adjacent
|
|
96
|
+
// regions sharing a refName get one label between them. Reverse/move/remove
|
|
97
|
+
// are per-region and this label names no particular one — it used to act on
|
|
98
|
+
// whichever region the label happened to ride, which for the pinned label
|
|
99
|
+
// changed as you scrolled — so a run offers only the two items that mean the
|
|
100
|
+
// whole run.
|
|
101
|
+
const oneRegion = idx === lastIdx;
|
|
102
|
+
// one region keeps its `{assembly}` qualifier; a run drops the qualifier the
|
|
103
|
+
// regions all share, as the view header does for the same list
|
|
104
|
+
const locString = oneRegion
|
|
105
|
+
? assembleLocString(displayedRegions[idx])
|
|
106
|
+
: assembleLocStrings(labeled);
|
|
107
|
+
return (_jsx(Menu, { anchorEl: menuState.anchorEl, open: true, onClose: onClose, onMenuItemClick: callback => {
|
|
149
108
|
callback();
|
|
150
109
|
onClose();
|
|
151
110
|
}, menuItems: [
|
|
152
111
|
{
|
|
153
112
|
label: `Focus on ${refName}`,
|
|
113
|
+
// moveTo by index, not navTo by refName: navTo resolves to the FIRST
|
|
114
|
+
// region carrying the name, so on a duplicated refName (a chromosome
|
|
115
|
+
// displayed twice) clicking the third chr1 label jumped to the first.
|
|
116
|
+
// Every other item in this menu is already idx-based.
|
|
154
117
|
onClick: () => {
|
|
155
|
-
|
|
118
|
+
const last = displayedRegions[lastIdx];
|
|
119
|
+
model.moveTo({ index: idx, offset: 0 }, { index: lastIdx, offset: last.end - last.start });
|
|
156
120
|
},
|
|
157
121
|
},
|
|
158
|
-
...(
|
|
122
|
+
...(labeled.length < numRegions
|
|
123
|
+
? [
|
|
124
|
+
{
|
|
125
|
+
label: oneRegion
|
|
126
|
+
? 'Show only this region'
|
|
127
|
+
: `Show only ${refName}`,
|
|
128
|
+
onClick: () => {
|
|
129
|
+
model.setDisplayedRegions(labeled);
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
]
|
|
133
|
+
: []),
|
|
134
|
+
{
|
|
135
|
+
label: 'Copy to clipboard',
|
|
136
|
+
subMenu: [
|
|
137
|
+
{
|
|
138
|
+
label: 'Reference sequence name',
|
|
139
|
+
onClick: () => {
|
|
140
|
+
void copyText(model, refName, 'reference sequence name');
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: 'Region',
|
|
145
|
+
onClick: () => {
|
|
146
|
+
void copyText(model, locString, 'region');
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
...(oneRegion
|
|
159
152
|
? [
|
|
160
153
|
{
|
|
161
154
|
label: 'Actions',
|
|
162
|
-
subMenu:
|
|
155
|
+
subMenu: [
|
|
156
|
+
{
|
|
157
|
+
label: 'Reverse region',
|
|
158
|
+
onClick: () => {
|
|
159
|
+
model.setDisplayedRegions(withRegionReversed(displayedRegions, idx));
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
...regionMoveActions(idx, numRegions).map(({ label, to }) => ({
|
|
163
|
+
label,
|
|
164
|
+
onClick: () => {
|
|
165
|
+
model.setDisplayedRegions(withRegionMoved(displayedRegions, idx, to));
|
|
166
|
+
},
|
|
167
|
+
})),
|
|
168
|
+
...(numRegions > 1
|
|
169
|
+
? [
|
|
170
|
+
{
|
|
171
|
+
label: 'Remove this region from view',
|
|
172
|
+
onClick: () => {
|
|
173
|
+
model.setDisplayedRegions(withRegionRemoved(displayedRegions, idx));
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
]
|
|
177
|
+
: []),
|
|
178
|
+
],
|
|
163
179
|
},
|
|
164
180
|
]
|
|
165
181
|
: []),
|
|
166
182
|
] }));
|
|
167
|
-
}
|
|
183
|
+
});
|
|
168
184
|
export default ScalebarRefNameLabels;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../model.ts';
|
|
2
|
-
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* What the box asks its row for at `value`, margins included — the number
|
|
5
|
+
* `headerFit` sheds against.
|
|
6
|
+
*
|
|
7
|
+
* The ask follows the locstring, which is the whole point of asking: 194px at
|
|
8
|
+
* `ctgA:1..20,000` and 284px at `chr22:10,510,000..10,610,000`, so a row sized
|
|
9
|
+
* against the 189px floor sheds too little and flexbox squeezes the box anyway.
|
|
10
|
+
* It is `getInputWidth`, the same function the box sizes itself with, rather
|
|
11
|
+
* than that arithmetic done again out here.
|
|
12
|
+
*
|
|
13
|
+
* `showHelp` is the component's own default below, and with help on
|
|
14
|
+
* `adornmentReservePx` returns the same number whatever the recent-locations
|
|
15
|
+
* menu holds — so the count only this component's hook knows cannot change the
|
|
16
|
+
* answer.
|
|
17
|
+
*/
|
|
18
|
+
export declare function searchBoxWidth(value: string): number;
|
|
19
|
+
declare const SearchBox: ({ model, showHelp, minWidth, maxWidth, style, }: {
|
|
3
20
|
showHelp?: boolean;
|
|
4
21
|
model: LinearGenomeViewModel;
|
|
5
|
-
|
|
22
|
+
minWidth?: number;
|
|
23
|
+
maxWidth?: number;
|
|
24
|
+
style?: React.CSSProperties;
|
|
25
|
+
}) => React.JSX.Element;
|
|
6
26
|
export default SearchBox;
|
|
@@ -1,82 +1,74 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RefNameAutocomplete, RefNameAutocompleteEndAdornment, adornmentReservePx, getInputWidth, useRecentLocations, } from '@jbrowse/core/ui';
|
|
2
3
|
import { getSession } from '@jbrowse/core/util';
|
|
3
|
-
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
4
|
import { alpha, useTheme } from '@mui/material';
|
|
5
5
|
import { observer } from 'mobx-react';
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
assembly,
|
|
33
|
-
model,
|
|
34
|
-
});
|
|
35
|
-
}
|
|
6
|
+
import { fetchResults, navigateToSelectedOption, notifySearchFailure, } from '../../searchUtils.js';
|
|
7
|
+
import { SPACING, WIDGET_HEIGHT } from '../consts.js';
|
|
8
|
+
import { recentLocationOf, recentLocationsMenu } from './recentLocationsMenu.js';
|
|
9
|
+
const defaultStyle = { margin: SPACING };
|
|
10
|
+
// The header box's floor and ceiling. A stacked view's row passes its own, and
|
|
11
|
+
// `searchBoxWidth` answers for these.
|
|
12
|
+
const MIN_WIDTH = 175;
|
|
13
|
+
const MAX_WIDTH = 550;
|
|
14
|
+
/**
|
|
15
|
+
* What the box asks its row for at `value`, margins included — the number
|
|
16
|
+
* `headerFit` sheds against.
|
|
17
|
+
*
|
|
18
|
+
* The ask follows the locstring, which is the whole point of asking: 194px at
|
|
19
|
+
* `ctgA:1..20,000` and 284px at `chr22:10,510,000..10,610,000`, so a row sized
|
|
20
|
+
* against the 189px floor sheds too little and flexbox squeezes the box anyway.
|
|
21
|
+
* It is `getInputWidth`, the same function the box sizes itself with, rather
|
|
22
|
+
* than that arithmetic done again out here.
|
|
23
|
+
*
|
|
24
|
+
* `showHelp` is the component's own default below, and with help on
|
|
25
|
+
* `adornmentReservePx` returns the same number whatever the recent-locations
|
|
26
|
+
* menu holds — so the count only this component's hook knows cannot change the
|
|
27
|
+
* answer.
|
|
28
|
+
*/
|
|
29
|
+
export function searchBoxWidth(value) {
|
|
30
|
+
return (getInputWidth(value, MIN_WIDTH, MAX_WIDTH, adornmentReservePx({ showHelp: true })) +
|
|
31
|
+
2 * SPACING);
|
|
36
32
|
}
|
|
37
|
-
const SearchBox = observer(function SearchBox({ model, showHelp = true, }) {
|
|
38
|
-
const { classes } = useStyles();
|
|
33
|
+
const SearchBox = observer(function SearchBox({ model, showHelp = true, minWidth = MIN_WIDTH, maxWidth = MAX_WIDTH, style = defaultStyle, }) {
|
|
39
34
|
const theme = useTheme();
|
|
40
35
|
const session = getSession(model);
|
|
41
36
|
const { textSearchManager, assemblyManager } = session;
|
|
42
|
-
const { assemblyNames
|
|
37
|
+
const { assemblyNames } = model;
|
|
43
38
|
const assemblyName = assemblyNames[0];
|
|
44
39
|
const assembly = assemblyManager.get(assemblyName);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
40
|
+
const { recentLocations, addRecentLocation, clearRecentLocations } = useRecentLocations(assemblyName);
|
|
41
|
+
async function navigate(option) {
|
|
42
|
+
try {
|
|
43
|
+
await navigateToSelectedOption({ model, assemblyName, option });
|
|
44
|
+
addRecentLocation(recentLocationOf(option));
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
notifySearchFailure(session, e);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const recentMenuItems = recentLocationsMenu({
|
|
51
|
+
recentLocations,
|
|
52
|
+
onNavigate: option => {
|
|
53
|
+
navigate(option).catch(() => { });
|
|
54
|
+
},
|
|
55
|
+
onClear: clearRecentLocations,
|
|
56
|
+
});
|
|
57
|
+
return (_jsx(RefNameAutocomplete, { onSelect: option => {
|
|
58
|
+
navigate(option).catch(() => { });
|
|
59
|
+
}, assemblyName: assemblyName, fetchResults: (queryString, stopToken) => fetchResults({
|
|
59
60
|
queryString,
|
|
60
|
-
|
|
61
|
-
rankSearchResults,
|
|
61
|
+
assemblyName,
|
|
62
62
|
textSearchManager,
|
|
63
63
|
assembly,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
style: {
|
|
73
|
-
padding: 0,
|
|
74
|
-
height: WIDGET_HEIGHT,
|
|
75
|
-
background: alpha(theme.palette.background.paper, 0.8),
|
|
76
|
-
},
|
|
77
|
-
endAdornment: _jsx(EndAdornment, { showHelp: showHelp }),
|
|
78
|
-
},
|
|
79
|
-
},
|
|
64
|
+
stopToken,
|
|
65
|
+
}), session: session, value: model.coarseVisibleLocStrings, minWidth: minWidth, maxWidth: maxWidth, adornmentWidth: adornmentReservePx({
|
|
66
|
+
showHelp,
|
|
67
|
+
menuItemCount: recentMenuItems.length,
|
|
68
|
+
}), style: style, endAdornment: _jsx(RefNameAutocompleteEndAdornment, { showHelp: showHelp, menuItems: recentMenuItems }), inputStyle: {
|
|
69
|
+
padding: 0,
|
|
70
|
+
height: WIDGET_HEIGHT,
|
|
71
|
+
background: alpha(theme.palette.background.paper, 0.8),
|
|
80
72
|
} }));
|
|
81
73
|
});
|
|
82
74
|
export default SearchBox;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export default function SearchPanelForm({ onSubmit, handleClose, submitDisabled, submitText, actions, children, }: {
|
|
3
|
+
onSubmit: () => void;
|
|
4
|
+
handleClose: () => void;
|
|
5
|
+
submitDisabled: boolean;
|
|
6
|
+
submitText?: string;
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { SubmitForm } from '@jbrowse/core/ui';
|
|
3
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
|
+
const useStyles = makeStyles()({
|
|
5
|
+
dialogContent: {
|
|
6
|
+
width: '34em',
|
|
7
|
+
display: 'flex',
|
|
8
|
+
flexDirection: 'column',
|
|
9
|
+
gap: 12,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
// The chrome shared by the sequence-search mode panels: the fixed-width column
|
|
13
|
+
// their fields lay out in, plus SubmitForm's Cancel/Submit footer. Each panel
|
|
14
|
+
// still owns its own fields and its own submit, so this is only the frame.
|
|
15
|
+
export default function SearchPanelForm({ onSubmit, handleClose, submitDisabled, submitText, actions, children, }) {
|
|
16
|
+
const { classes } = useStyles();
|
|
17
|
+
return (_jsx(SubmitForm, { contentClassName: classes.dialogContent, onSubmit: onSubmit, onCancel: handleClose, submitDisabled: submitDisabled, submitText: submitText, actions: actions, children: children }));
|
|
18
|
+
}
|
|
@@ -2,8 +2,8 @@ import type { LinearGenomeViewModel } from '../../index.ts';
|
|
|
2
2
|
import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
3
|
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }: {
|
|
4
4
|
model: LinearGenomeViewModel;
|
|
5
|
-
assemblyName
|
|
5
|
+
assemblyName: string;
|
|
6
6
|
searchQuery: string;
|
|
7
|
-
searchResults
|
|
7
|
+
searchResults: BaseResult[];
|
|
8
8
|
handleClose: () => void;
|
|
9
|
-
}): import("react
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import SearchResultsTable from
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { InfoDialog } from '@jbrowse/core/ui';
|
|
3
|
+
import { Typography } from '@mui/material';
|
|
4
|
+
import SearchResultsTable from './SearchResultsTable.js';
|
|
5
5
|
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }) {
|
|
6
|
-
return (
|
|
7
|
-
handleClose();
|
|
8
|
-
}, color: "primary", children: "Cancel" }) })] }));
|
|
6
|
+
return (_jsx(InfoDialog, { open: true, maxWidth: "xl", onClose: handleClose, title: "Search results", children: !searchResults.length ? (_jsxs(Typography, { children: ["No results found for ", _jsx("b", { children: searchQuery })] })) : (_jsxs(_Fragment, { children: [_jsxs(Typography, { children: ["Showing results for ", _jsx("b", { children: searchQuery })] }), _jsx(SearchResultsTable, { model: model, handleClose: handleClose, assemblyName: assemblyName, searchResults: searchResults })] })) }));
|
|
9
7
|
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../../index.ts';
|
|
2
2
|
import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
|
-
|
|
3
|
+
declare const SearchResultsTable: ({ searchResults, assemblyName, model, handleClose, }: {
|
|
4
4
|
searchResults: BaseResult[];
|
|
5
|
-
assemblyName
|
|
5
|
+
assemblyName: string;
|
|
6
6
|
model: LinearGenomeViewModel;
|
|
7
7
|
handleClose: () => void;
|
|
8
|
-
})
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
|
+
export default SearchResultsTable;
|