@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
|
@@ -1,168 +1,199 @@
|
|
|
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, regionRunBounds, withRegionMoved, withRegionRemoved, withRegionReversed, withRegionsKept, } from '../util.js';
|
|
9
|
+
import { scalebarRefLabelProps } from './util.js';
|
|
6
10
|
const useStyles = makeStyles()(theme => ({
|
|
7
11
|
refLabel: {
|
|
8
|
-
|
|
12
|
+
// the width the fit test in getScalebarRefNameLabels measures against
|
|
13
|
+
fontSize: REF_NAME_LABEL_FONT_SIZE,
|
|
14
|
+
// maxWidth is the label's whole box, paddingLeft included — stated here
|
|
15
|
+
// rather than inherited from whatever box-sizing the embedding page sets,
|
|
16
|
+
// since under content-box the padding comes off the text twice (once in the
|
|
17
|
+
// maxWidth the fit test was given, once in the layout) and every name wide
|
|
18
|
+
// enough to need the space is clipped mid-glyph
|
|
19
|
+
boxSizing: 'border-box',
|
|
9
20
|
position: 'absolute',
|
|
10
|
-
|
|
21
|
+
// x-position is driven by transform:translateX (compositor-only) not left
|
|
22
|
+
left: 0,
|
|
11
23
|
top: -1,
|
|
12
24
|
fontWeight: 'bold',
|
|
13
25
|
lineHeight: 'normal',
|
|
14
26
|
zIndex: 1,
|
|
15
27
|
background: theme.palette.background.paper,
|
|
16
|
-
|
|
17
|
-
|
|
28
|
+
// clip, not hidden: transform/maxWidth are patched on every scroll-zoom
|
|
29
|
+
// frame, and `hidden` would make each label its own scroll container —
|
|
30
|
+
// scrollable-overflow bookkeeping and scroll anchoring per label per frame,
|
|
31
|
+
// for a box that never scrolls. clip is a paint-time rect instead
|
|
32
|
+
overflow: 'clip',
|
|
18
33
|
whiteSpace: 'nowrap',
|
|
34
|
+
},
|
|
35
|
+
// refName labels only: the caption chip opens no menu
|
|
36
|
+
clickable: {
|
|
37
|
+
cursor: 'pointer',
|
|
19
38
|
'&:hover': {
|
|
20
|
-
background: theme.palette.
|
|
39
|
+
background: theme.palette.action.hover,
|
|
21
40
|
},
|
|
22
41
|
},
|
|
23
|
-
|
|
24
|
-
left: 0,
|
|
42
|
+
caption: {
|
|
25
43
|
zIndex: 100,
|
|
26
44
|
},
|
|
27
45
|
}));
|
|
28
46
|
const ScalebarRefNameLabels = observer(function ScalebarRefNameLabels({ model, }) {
|
|
29
47
|
const { classes, cx } = useStyles();
|
|
30
|
-
const { staticBlocks, offsetPx, scalebarDisplayPrefix } = model;
|
|
31
48
|
const [menuState, setMenuState] = useState();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
lastLeftBlock = 0;
|
|
38
|
-
}
|
|
39
|
-
staticBlocks.forEach((block, i) => {
|
|
40
|
-
if (block.type === 'ContentBlock' && block.offsetPx - offsetPx < 0) {
|
|
41
|
-
lastLeftBlock = i;
|
|
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: () => {
|
|
49
|
+
const { labels, caption } = model.scalebarRefNameLabels;
|
|
50
|
+
return (_jsxs(_Fragment, { children: [labels.map((label, i) => (_jsx(RefLabel
|
|
51
|
+
// 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
|
|
52
|
+
, { model: model, label: label, onOpenMenu: setMenuState }, i))), caption === undefined ? null : (_jsx("span", { className: cx(classes.caption, classes.refLabel), "data-testid": "refLabel-prefix", children: caption })), menuState ? (_jsx(RefNameMenu, { model: model, menuState: menuState, onClose: () => {
|
|
53
|
+
model.setIsScalebarRefNameMenuOpen(false);
|
|
83
54
|
setMenuState(undefined);
|
|
84
55
|
} })) : null] }));
|
|
85
56
|
});
|
|
86
|
-
|
|
57
|
+
// Not an observer: `label` is plain data from the parent. The attribute tells
|
|
58
|
+
// the scalebar's rubberband to leave a click here to this label's onClick.
|
|
59
|
+
function RefLabel({ model, label, onOpenMenu, }) {
|
|
60
|
+
const { classes, cx } = useStyles();
|
|
61
|
+
const { refName, transform, maxWidth, paddingLeft, text } = label;
|
|
62
|
+
return (_jsx("span", { className: cx(classes.refLabel, classes.clickable), style: {
|
|
63
|
+
transform: `translateX(${transform}px)`,
|
|
64
|
+
paddingLeft,
|
|
65
|
+
maxWidth,
|
|
66
|
+
}, "data-testid": `refLabel-${refName}`, ...scalebarRefLabelProps, onClick: e => {
|
|
67
|
+
model.setIsScalebarRefNameMenuOpen(true);
|
|
68
|
+
onOpenMenu({ anchorEl: e.currentTarget, label });
|
|
69
|
+
}, children: text }));
|
|
70
|
+
}
|
|
71
|
+
const RefNameMenu = observer(function RefNameMenu({ model, menuState, onClose, }) {
|
|
87
72
|
const { displayedRegions } = model;
|
|
88
|
-
const { refName,
|
|
73
|
+
const { refName, displayedRegionIndex: idx, lastDisplayedRegionIndex: lastIdx, } = menuState.label;
|
|
89
74
|
const numRegions = displayedRegions.length;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
...(
|
|
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) => {
|
|
75
|
+
const labeled = displayedRegions.slice(idx, lastIdx + 1);
|
|
76
|
+
// A label naming several regions is the collapsed-intron case: adjacent
|
|
77
|
+
// regions sharing a refName get one label between them. Reverse/move/remove
|
|
78
|
+
// are per-region and this label names no particular one — it used to act on
|
|
79
|
+
// whichever region the label happened to ride, which for the pinned label
|
|
80
|
+
// changed as you scrolled — so a run offers only the two items that mean the
|
|
81
|
+
// whole run.
|
|
82
|
+
const oneRegion = idx === lastIdx;
|
|
83
|
+
// one region keeps its `{assembly}` qualifier; a run drops the qualifier the
|
|
84
|
+
// regions all share, as the view header does for the same list
|
|
85
|
+
const locString = oneRegion
|
|
86
|
+
? assembleLocString(displayedRegions[idx])
|
|
87
|
+
: assembleLocStrings(labeled);
|
|
88
|
+
// The region this label's blocks were cut out of. Taken over the WHOLE run
|
|
89
|
+
// rather than `labeled`, which the viewport clips: a collapsed-introns view
|
|
90
|
+
// zoomed into two exons would otherwise offer a span that is not the gene's.
|
|
91
|
+
const { first: runFirst, last: runLast } = regionRunBounds(displayedRegions, idx, lastIdx);
|
|
92
|
+
const run = displayedRegions.slice(runFirst, runLast + 1);
|
|
93
|
+
const wholeSpan = {
|
|
94
|
+
...run[0],
|
|
95
|
+
start: Math.min(...run.map(r => r.start)),
|
|
96
|
+
end: Math.max(...run.map(r => r.end)),
|
|
97
|
+
};
|
|
98
|
+
return (_jsx(Menu, { anchorEl: menuState.anchorEl, open: true, onClose: onClose, onMenuItemClick: callback => {
|
|
149
99
|
callback();
|
|
150
100
|
onClose();
|
|
151
101
|
}, menuItems: [
|
|
152
102
|
{
|
|
153
103
|
label: `Focus on ${refName}`,
|
|
104
|
+
// moveTo by index, not navTo by refName: navTo resolves to the FIRST
|
|
105
|
+
// region carrying the name, so on a duplicated refName (a chromosome
|
|
106
|
+
// displayed twice) clicking the third chr1 label jumped to the first.
|
|
107
|
+
// Every other item in this menu is already idx-based.
|
|
154
108
|
onClick: () => {
|
|
155
|
-
|
|
109
|
+
const last = displayedRegions[lastIdx];
|
|
110
|
+
model.moveTo({ index: idx, offset: 0 }, { index: lastIdx, offset: last.end - last.start });
|
|
156
111
|
},
|
|
157
112
|
},
|
|
158
|
-
...(
|
|
113
|
+
...(labeled.length < numRegions
|
|
114
|
+
? [
|
|
115
|
+
{
|
|
116
|
+
label: oneRegion
|
|
117
|
+
? 'Show only this region'
|
|
118
|
+
: `Show only ${refName}`,
|
|
119
|
+
onClick: () => {
|
|
120
|
+
model.editDisplayedRegions(withRegionsKept(displayedRegions, idx, lastIdx));
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
]
|
|
124
|
+
: []),
|
|
125
|
+
...(runLast > runFirst
|
|
126
|
+
? [
|
|
127
|
+
{
|
|
128
|
+
// Names its subject the way the two rows above it do; the span
|
|
129
|
+
// it lands on is not spelled into the label, which would move
|
|
130
|
+
// under the reader as they navigate.
|
|
131
|
+
label: `Show the whole span of ${refName}`,
|
|
132
|
+
// Focused rather than centre-kept: the rejoined region is one
|
|
133
|
+
// the old viewport never saw, so there is no centre to hold,
|
|
134
|
+
// and showing the span is the whole point of the row.
|
|
135
|
+
onClick: () => {
|
|
136
|
+
model.setDisplayedRegions([
|
|
137
|
+
...displayedRegions.slice(0, runFirst),
|
|
138
|
+
wholeSpan,
|
|
139
|
+
...displayedRegions.slice(runLast + 1),
|
|
140
|
+
]);
|
|
141
|
+
model.moveTo({ index: runFirst, offset: 0 }, {
|
|
142
|
+
index: runFirst,
|
|
143
|
+
offset: wholeSpan.end - wholeSpan.start,
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
},
|
|
147
|
+
]
|
|
148
|
+
: []),
|
|
149
|
+
{
|
|
150
|
+
label: 'Copy to clipboard',
|
|
151
|
+
subMenu: [
|
|
152
|
+
{
|
|
153
|
+
label: 'Reference sequence name',
|
|
154
|
+
onClick: () => {
|
|
155
|
+
void copyText(model, refName, 'reference sequence name');
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: 'Region',
|
|
160
|
+
onClick: () => {
|
|
161
|
+
void copyText(model, locString, 'region');
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
...(oneRegion
|
|
159
167
|
? [
|
|
160
168
|
{
|
|
161
169
|
label: 'Actions',
|
|
162
|
-
subMenu:
|
|
170
|
+
subMenu: [
|
|
171
|
+
{
|
|
172
|
+
label: 'Reverse region',
|
|
173
|
+
onClick: () => {
|
|
174
|
+
model.editDisplayedRegions(withRegionReversed(displayedRegions, idx));
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
...regionMoveActions(idx, numRegions).map(({ label, to }) => ({
|
|
178
|
+
label,
|
|
179
|
+
onClick: () => {
|
|
180
|
+
model.editDisplayedRegions(withRegionMoved(displayedRegions, idx, to));
|
|
181
|
+
},
|
|
182
|
+
})),
|
|
183
|
+
...(numRegions > 1
|
|
184
|
+
? [
|
|
185
|
+
{
|
|
186
|
+
label: 'Remove this region from view',
|
|
187
|
+
onClick: () => {
|
|
188
|
+
model.editDisplayedRegions(withRegionRemoved(displayedRegions, idx));
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
]
|
|
192
|
+
: []),
|
|
193
|
+
],
|
|
163
194
|
},
|
|
164
195
|
]
|
|
165
196
|
: []),
|
|
166
197
|
] }));
|
|
167
|
-
}
|
|
198
|
+
});
|
|
168
199
|
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,75 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { RefNameAutocomplete, RefNameAutocompleteEndAdornment, adornmentReservePx, getInputWidth, useRecentLocations, } from '@jbrowse/core/ui';
|
|
3
|
+
import { usePalette } from '@jbrowse/core/ui/PaletteContext';
|
|
4
|
+
import { alpha } from '@jbrowse/core/ui/palette';
|
|
2
5
|
import { getSession } from '@jbrowse/core/util';
|
|
3
|
-
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
4
|
-
import { alpha, useTheme } from '@mui/material';
|
|
5
6
|
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
|
-
}
|
|
7
|
+
import { fetchResults, navigateToSelectedOption, notifySearchFailure, } from '../../searchUtils.js';
|
|
8
|
+
import { SPACING, WIDGET_HEIGHT } from '../consts.js';
|
|
9
|
+
import { recentLocationOf, recentLocationsMenu } from './recentLocationsMenu.js';
|
|
10
|
+
const defaultStyle = { margin: SPACING };
|
|
11
|
+
// The header box's floor and ceiling. A stacked view's row passes its own, and
|
|
12
|
+
// `searchBoxWidth` answers for these.
|
|
13
|
+
const MIN_WIDTH = 175;
|
|
14
|
+
const MAX_WIDTH = 550;
|
|
15
|
+
/**
|
|
16
|
+
* What the box asks its row for at `value`, margins included — the number
|
|
17
|
+
* `headerFit` sheds against.
|
|
18
|
+
*
|
|
19
|
+
* The ask follows the locstring, which is the whole point of asking: 194px at
|
|
20
|
+
* `ctgA:1..20,000` and 284px at `chr22:10,510,000..10,610,000`, so a row sized
|
|
21
|
+
* against the 189px floor sheds too little and flexbox squeezes the box anyway.
|
|
22
|
+
* It is `getInputWidth`, the same function the box sizes itself with, rather
|
|
23
|
+
* than that arithmetic done again out here.
|
|
24
|
+
*
|
|
25
|
+
* `showHelp` is the component's own default below, and with help on
|
|
26
|
+
* `adornmentReservePx` returns the same number whatever the recent-locations
|
|
27
|
+
* menu holds — so the count only this component's hook knows cannot change the
|
|
28
|
+
* answer.
|
|
29
|
+
*/
|
|
30
|
+
export function searchBoxWidth(value) {
|
|
31
|
+
return (getInputWidth(value, MIN_WIDTH, MAX_WIDTH, adornmentReservePx({ showHelp: true })) +
|
|
32
|
+
2 * SPACING);
|
|
36
33
|
}
|
|
37
|
-
const SearchBox = observer(function SearchBox({ model, showHelp = true, }) {
|
|
38
|
-
const
|
|
39
|
-
const theme = useTheme();
|
|
34
|
+
const SearchBox = observer(function SearchBox({ model, showHelp = true, minWidth = MIN_WIDTH, maxWidth = MAX_WIDTH, style = defaultStyle, }) {
|
|
35
|
+
const palette = usePalette();
|
|
40
36
|
const session = getSession(model);
|
|
41
37
|
const { textSearchManager, assemblyManager } = session;
|
|
42
|
-
const { assemblyNames
|
|
38
|
+
const { assemblyNames } = model;
|
|
43
39
|
const assemblyName = assemblyNames[0];
|
|
44
40
|
const assembly = assemblyManager.get(assemblyName);
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
const { recentLocations, addRecentLocation, clearRecentLocations } = useRecentLocations(assemblyName);
|
|
42
|
+
async function navigate(option) {
|
|
43
|
+
try {
|
|
44
|
+
await navigateToSelectedOption({ model, assemblyName, option });
|
|
45
|
+
addRecentLocation(recentLocationOf(option));
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
notifySearchFailure(session, e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const recentMenuItems = recentLocationsMenu({
|
|
52
|
+
recentLocations,
|
|
53
|
+
onNavigate: option => {
|
|
54
|
+
void navigate(option);
|
|
55
|
+
},
|
|
56
|
+
onClear: clearRecentLocations,
|
|
57
|
+
});
|
|
58
|
+
return (_jsx(RefNameAutocomplete, { onSelect: option => {
|
|
59
|
+
void navigate(option);
|
|
60
|
+
}, assemblyName: assemblyName, fetchResults: (queryString, signal) => fetchResults({
|
|
59
61
|
queryString,
|
|
60
|
-
|
|
61
|
-
rankSearchResults,
|
|
62
|
+
assemblyName,
|
|
62
63
|
textSearchManager,
|
|
63
64
|
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
|
-
},
|
|
65
|
+
signal,
|
|
66
|
+
}), session: session, value: model.coarseVisibleLocStrings, minWidth: minWidth, maxWidth: maxWidth, adornmentWidth: adornmentReservePx({
|
|
67
|
+
showHelp,
|
|
68
|
+
menuItemCount: recentMenuItems.length,
|
|
69
|
+
}), style: style, endAdornment: _jsx(RefNameAutocompleteEndAdornment, { showHelp: showHelp, menuItems: recentMenuItems }), inputStyle: {
|
|
70
|
+
padding: 0,
|
|
71
|
+
height: WIDGET_HEIGHT,
|
|
72
|
+
background: alpha(palette.background.paper, 0.8),
|
|
80
73
|
} }));
|
|
81
74
|
});
|
|
82
75
|
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
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../../index.ts';
|
|
2
2
|
import type BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
3
|
-
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }: {
|
|
3
|
+
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, onPick, }: {
|
|
4
4
|
model: LinearGenomeViewModel;
|
|
5
|
-
assemblyName
|
|
5
|
+
assemblyName: string;
|
|
6
6
|
searchQuery: string;
|
|
7
|
-
searchResults
|
|
7
|
+
searchResults: BaseResult[];
|
|
8
8
|
handleClose: () => void;
|
|
9
|
-
|
|
9
|
+
onPick: (result: BaseResult) => Promise<unknown>;
|
|
10
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import SearchResultsTable from
|
|
5
|
-
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, }) {
|
|
6
|
-
return (
|
|
7
|
-
handleClose();
|
|
8
|
-
}, color: "primary", children: "Cancel" }) })] }));
|
|
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
|
+
export default function SearchResultsDialog({ model, assemblyName, searchQuery, searchResults, handleClose, onPick, }) {
|
|
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, onPick: onPick })] })) }));
|
|
9
7
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
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, onPick, }: {
|
|
4
4
|
searchResults: BaseResult[];
|
|
5
|
-
assemblyName
|
|
5
|
+
assemblyName: string;
|
|
6
6
|
model: LinearGenomeViewModel;
|
|
7
7
|
handleClose: () => void;
|
|
8
|
-
|
|
8
|
+
onPick: (result: BaseResult) => Promise<unknown>;
|
|
9
|
+
}) => import("react").JSX.Element;
|
|
10
|
+
export default SearchResultsTable;
|