@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,145 +1,290 @@
|
|
|
1
|
-
import { getSession, localStorageSetItem,
|
|
1
|
+
import { getSession, isSessionModelWithWidgets, localStorageSetItem, resolveNamedRegions, } from '@jbrowse/core/util';
|
|
2
|
+
import { coerceHighlight } from '@jbrowse/core/util/highlights';
|
|
3
|
+
import { installInitAutorun } from '@jbrowse/core/util/installInitAutorun';
|
|
4
|
+
import { normalizeTrackInit, warmTrackDisplayGeneric, } from '@jbrowse/core/util/tracks';
|
|
2
5
|
import { addDisposer } from '@jbrowse/mobx-state-tree';
|
|
3
|
-
import { autorun, when } from 'mobx';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
import { autorun, untracked, when } from 'mobx';
|
|
7
|
+
import { SearchResultsNotFoundError } from '../searchUtils.js';
|
|
8
|
+
// `init` is a frozen blob that often comes from hand-authored JSON, where a
|
|
9
|
+
// lone entry gets written bare (`tracks: 'genes'`). A string is iterable, so
|
|
10
|
+
// looping over it directly walked its characters — one track opened per letter.
|
|
11
|
+
function asArray(arg) {
|
|
12
|
+
return arg === undefined ? [] : Array.isArray(arg) ? arg : [arg];
|
|
13
|
+
}
|
|
14
|
+
// Activate tracklist first so the drawer opens before we navigate, so
|
|
15
|
+
// volatileWidth accounts for the drawer; otherwise navigation computes the
|
|
16
|
+
// region at full width and the drawer then obscures part of it. Opening the
|
|
17
|
+
// drawer shrinks the view, which the ResizeObserver reports as a volatileWidth
|
|
18
|
+
// change — but only if the drawer wasn't already taking that width. So wait for
|
|
19
|
+
// the change only when activating it actually opens the column.
|
|
20
|
+
async function openTracklist(self, session, superseded) {
|
|
21
|
+
// activateTrackSelector throws without widget support, which would abort the
|
|
22
|
+
// rest of init (navigation included) over an optional extra
|
|
23
|
+
if (isSessionModelWithWidgets(session)) {
|
|
24
|
+
// `drawerVisible` is the line App.tsx draws to render the drawer column at
|
|
25
|
+
// all: a minimized, popped-out or modal-only widget takes no width. It
|
|
26
|
+
// lives on SessionWithDrawerWidgets, whose type guard is product-core's, so
|
|
27
|
+
// it is duck-typed rather than taken as an upward dependency; a session
|
|
28
|
+
// without it has no drawer column.
|
|
29
|
+
const drawerVisible = () => 'drawerVisible' in session && session.drawerVisible === true;
|
|
30
|
+
const drawerWasVisible = drawerVisible();
|
|
31
|
+
const widthBefore = self.volatileWidth;
|
|
32
|
+
self.activateTrackSelector();
|
|
33
|
+
// a width change is only coming if the drawer just started taking space
|
|
34
|
+
if (!drawerWasVisible && drawerVisible()) {
|
|
35
|
+
// Bounded so init can't wedge here if the drawer doesn't shrink the view
|
|
36
|
+
// (e.g. embedded or modal-drawer layouts, where no width change is
|
|
37
|
+
// coming), and superseded so a re-launch landing mid-wait isn't held
|
|
38
|
+
// behind an init that no longer matters
|
|
39
|
+
await when(() => self.volatileWidth !== widthBefore || superseded(), {
|
|
40
|
+
timeout: 1000,
|
|
41
|
+
}).catch(() => { });
|
|
42
|
+
}
|
|
10
43
|
}
|
|
11
|
-
|
|
12
|
-
|
|
44
|
+
else {
|
|
45
|
+
session.notify('init.tracklist was ignored: this application has no track selector drawer', 'warning');
|
|
13
46
|
}
|
|
14
47
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
48
|
+
// Restrict a whole-genome view to a named subset of the assembly's regions, in
|
|
49
|
+
// the requested order. Entries may be globs (`*_hap1`) — see selectNamedRegions,
|
|
50
|
+
// shared with the dotplot's per-axis `displayedRegionNames` so both views read
|
|
51
|
+
// the same name list the same way.
|
|
52
|
+
function showNamedRegions(self, session, assemblyName, names) {
|
|
53
|
+
const assembly = session.assemblyManager.get(assemblyName);
|
|
54
|
+
const all = assembly?.regions;
|
|
55
|
+
if (all) {
|
|
56
|
+
// resolveNamedRegions is what reports a list that matched nothing —
|
|
57
|
+
// otherwise a typo'd refName silently shows the whole genome and reads as
|
|
58
|
+
// displayedRegionNames being ignored. The FALLBACK stays here because it is
|
|
59
|
+
// this view's alone: nothing shown yet means show the whole genome rather
|
|
60
|
+
// than an empty view, but already navigated (URL params layered onto a
|
|
61
|
+
// defaultSession) means keep what's there, since a typo shouldn't discard
|
|
62
|
+
// the session's own navigation.
|
|
63
|
+
const regions = resolveNamedRegions({
|
|
64
|
+
regions: all,
|
|
65
|
+
names,
|
|
66
|
+
assemblyName,
|
|
67
|
+
getCanonicalRefName: assembly.getCanonicalRefName2,
|
|
68
|
+
allRefNames: assembly.allRefNames,
|
|
69
|
+
notify: message => {
|
|
70
|
+
session.notify(message, 'warning');
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
if (regions) {
|
|
74
|
+
// showRegions, not showAllRegionsInAssembly: `displayedRegionNames` is
|
|
75
|
+
// the spec naming what it wants shown, so it gets the width
|
|
76
|
+
self.showRegions(regions);
|
|
20
77
|
}
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
78
|
+
else if (!self.hasDisplayedRegions) {
|
|
79
|
+
// The fallback IS "show me everything", so it keeps the margin.
|
|
80
|
+
self.showAllRegionsInAssembly(assemblyName);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async function navigateInit(self, session, init) {
|
|
85
|
+
try {
|
|
86
|
+
if (init.loc) {
|
|
87
|
+
// navToLocString waits for the assembly itself, and this autorun only
|
|
88
|
+
// runs once `initialized` confirms init.assembly has loaded regions, so
|
|
89
|
+
// no explicit waitForAssembly is needed here
|
|
90
|
+
// a spec that listed its tracks gets those tracks; one that only named
|
|
91
|
+
// a gene gets the track the gene was found in, as the search box would
|
|
92
|
+
await self.navToLocString(init.loc, init.assembly, init.grow, {
|
|
93
|
+
showHitTrack: init.showHitTrack ?? asArray(init.tracks).length === 0,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
else if (init.displayedRegionNames?.length) {
|
|
97
|
+
// an explicit region list is a navigation request just like `loc`, so it
|
|
98
|
+
// applies even when regions already exist (URL params layered onto a
|
|
99
|
+
// defaultSession that already navigated)
|
|
100
|
+
//
|
|
101
|
+
// `?.length`, not the bare key: an empty array is truthy, so a spec
|
|
102
|
+
// writing `displayedRegionNames: []` took this path with nothing to name
|
|
103
|
+
// and got told its list of no names had matched no regions. That is why
|
|
104
|
+
// LinearSyntenyView's doSubmit omits the key rather than passing [].
|
|
105
|
+
showNamedRegions(self, session, init.assembly, init.displayedRegionNames);
|
|
106
|
+
}
|
|
107
|
+
else if (!self.hasDisplayedRegions) {
|
|
108
|
+
// a highlight-only init (nothing to navigate to) must not clobber a
|
|
109
|
+
// defaultSession's existing navigation, so only auto-navigate when
|
|
110
|
+
// nothing is shown yet
|
|
111
|
+
self.showAllRegionsInAssembly(init.assembly);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
catch (e) {
|
|
115
|
+
console.error(init, e);
|
|
116
|
+
if (e instanceof SearchResultsNotFoundError) {
|
|
117
|
+
// a &loc= gene name that matched nothing is a soft miss, not an app error
|
|
118
|
+
session.notify(e.message, 'warning');
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
session.notifyError(`${e}`, e);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// launchTrack funnels through showTrackGeneric, which surfaces any failure
|
|
126
|
+
// (unresolved id, bad config, etc) as its own snackbar, and loads the picked
|
|
127
|
+
// display's state model first when it is registered lazily
|
|
128
|
+
async function showInitTracks(self, init) {
|
|
129
|
+
for (const t of asArray(init.tracks)) {
|
|
130
|
+
const { trackId, trackSnapshot, displaySnapshot } = normalizeTrackInit(t);
|
|
131
|
+
await self.launchTrack(trackId, trackSnapshot, displaySnapshot);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Add an init blob's `highlight` entries to the session, coercing each
|
|
136
|
+
* locstring or wire-format object and reporting a bad one without taking out
|
|
137
|
+
* its siblings. An entry without an assembly takes the launch's.
|
|
138
|
+
*
|
|
139
|
+
* Exported because a LinearSyntenyView row is a LinearGenomeView that does NOT
|
|
140
|
+
* go through this file's init autorun — the synteny view builds each row's
|
|
141
|
+
* snapshot and navigates it itself — so the row's own `highlight` had nowhere
|
|
142
|
+
* to be applied and was dropped in silence.
|
|
143
|
+
*/
|
|
144
|
+
export function applyInitHighlights(session, init) {
|
|
145
|
+
for (const h of asArray(init.highlight)) {
|
|
146
|
+
// parseLocString throws on an unknown refName or a malformed locstring, and
|
|
147
|
+
// one bad entry must take out neither its siblings nor the rest of init
|
|
148
|
+
try {
|
|
149
|
+
const highlight = coerceHighlight(h, init.assembly, refName => session.assemblyManager.isValidRefName(refName, init.assembly));
|
|
150
|
+
if (highlight) {
|
|
151
|
+
session.addHighlight(highlight);
|
|
50
152
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
console.error(e);
|
|
156
|
+
session.notifyError(`Invalid init highlight ${JSON.stringify(h)}: ${e}`, e);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async function applyInit(self, pending, { superseded }) {
|
|
161
|
+
const session = getSession(self);
|
|
162
|
+
// A re-launch of a view already showing an assembly need not restate it:
|
|
163
|
+
// jb.setSession writes `loc` and track entries beside the built state, and
|
|
164
|
+
// the readiness gate resolved the same default before letting this run.
|
|
165
|
+
const init = pending.assembly
|
|
166
|
+
? pending
|
|
167
|
+
: { ...pending, assembly: self.launchAssemblyName ?? pending.assembly };
|
|
168
|
+
if (init.tracklist) {
|
|
169
|
+
await openTracklist(self, session, superseded);
|
|
170
|
+
}
|
|
171
|
+
// `superseded`, not a bare isAlive: it subsumes the liveness check (the view
|
|
172
|
+
// may have been removed while the drawer or the navigation resolved, and
|
|
173
|
+
// reading or mutating a detached node throws) and also covers the case
|
|
174
|
+
// isAlive misses — a newer setLaunch landed mid-apply, so the rest of *this*
|
|
175
|
+
// blob is stale. Finishing it anyway appends its tracks and highlights under
|
|
176
|
+
// the one that replaced it. The drain loop applies the newer init next either
|
|
177
|
+
// way.
|
|
178
|
+
//
|
|
179
|
+
// Checked after each await rather than once at the top, and as early returns
|
|
180
|
+
// rather than nesting, so a step added later takes a guard beside it instead
|
|
181
|
+
// of another level of indent.
|
|
182
|
+
if (superseded()) {
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
await navigateInit(self, session, init);
|
|
186
|
+
if (superseded()) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await showInitTracks(self, init);
|
|
190
|
+
if (superseded()) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (init.nav !== undefined) {
|
|
194
|
+
self.setHideHeader(!init.nav);
|
|
195
|
+
}
|
|
196
|
+
applyInitHighlights(session, init);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The init autorun below waits for the view's width, which exists only once its
|
|
200
|
+
* component has rendered, and then loads the assembly and launches the tracks
|
|
201
|
+
* one at a time. The assembly and the display code each pending track needs can
|
|
202
|
+
* start loading now, all at once.
|
|
203
|
+
*/
|
|
204
|
+
function setupInitWarmup(self) {
|
|
205
|
+
addDisposer(self, autorun(function initWarmupAutorun() {
|
|
206
|
+
const pending = self.pendingLaunch;
|
|
207
|
+
const tracks = asArray(pending?.tracks);
|
|
208
|
+
// eslint-disable-next-line no-restricted-syntax -- EFFECT INPUT: the assembly and track configs only feed the loads started here; the pending launch is the key
|
|
209
|
+
untracked(() => {
|
|
210
|
+
const assembly = pending?.assembly ?? self.launchAssemblyName;
|
|
211
|
+
if (pending && assembly) {
|
|
212
|
+
try {
|
|
213
|
+
getSession(self)
|
|
214
|
+
.assemblyManager.waitForAssembly(assembly)
|
|
215
|
+
.catch(() => { });
|
|
74
216
|
}
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
self.setHideHeader(!init.nav);
|
|
78
|
-
}
|
|
79
|
-
if (self.highlight.length) {
|
|
80
|
-
const fallback = self.assemblyNames[0];
|
|
81
|
-
if (fallback) {
|
|
82
|
-
const normalized = self.highlight.map(h => h.assemblyName ? h : { ...h, assemblyName: fallback });
|
|
83
|
-
if (normalized.some((h, i) => h !== self.highlight[i])) {
|
|
84
|
-
self.setHighlight(normalized);
|
|
85
|
-
}
|
|
217
|
+
catch {
|
|
218
|
+
// navigation reports an assembly that cannot load
|
|
86
219
|
}
|
|
87
220
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (json &&
|
|
92
|
-
typeof json.refName === 'string' &&
|
|
93
|
-
typeof json.start === 'number' &&
|
|
94
|
-
typeof json.end === 'number') {
|
|
95
|
-
self.addToHighlights({
|
|
96
|
-
refName: json.refName,
|
|
97
|
-
start: json.start,
|
|
98
|
-
end: json.end,
|
|
99
|
-
assemblyName: typeof json.assemblyName === 'string'
|
|
100
|
-
? json.assemblyName
|
|
101
|
-
: init.assembly,
|
|
102
|
-
color: typeof json.color === 'string' ? json.color : undefined,
|
|
103
|
-
label: typeof json.label === 'string' ? json.label : undefined,
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
const p = parseLocString(h, refName => assemblyManager.isValidRefName(refName, init.assembly));
|
|
108
|
-
const { start, end } = p;
|
|
109
|
-
if (start !== undefined && end !== undefined) {
|
|
110
|
-
self.addToHighlights({
|
|
111
|
-
...p,
|
|
112
|
-
start,
|
|
113
|
-
end,
|
|
114
|
-
assemblyName: init.assembly,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
221
|
+
for (const t of tracks) {
|
|
222
|
+
const { trackId, displaySnapshot } = normalizeTrackInit(t);
|
|
223
|
+
warmTrackDisplayGeneric(self, trackId, displaySnapshot, assembly);
|
|
119
224
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}, { name: 'LGVInit' }));
|
|
225
|
+
});
|
|
226
|
+
}, { name: 'LGVInitWarmup' }));
|
|
123
227
|
}
|
|
124
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Autorun that handles the init state - navigating to initial location,
|
|
230
|
+
* showing tracks, etc.
|
|
231
|
+
*/
|
|
232
|
+
export function setupInitAutorun(self) {
|
|
233
|
+
installInitAutorun(self, {
|
|
234
|
+
name: 'LGVInit',
|
|
235
|
+
// `init` is what makes hasSomethingToShow / awaitingInitNavigation report
|
|
236
|
+
// "loading"
|
|
237
|
+
// until navigation populates displayedRegions, so the alternative gate
|
|
238
|
+
// (clearing `init` up front, the way SpreadsheetView does) would flash the
|
|
239
|
+
// import form mid-load.
|
|
240
|
+
ready: () => self.initialized,
|
|
241
|
+
// No pre-materialization phase to protect: the view is its own single row,
|
|
242
|
+
// and `error` already derives a failed init assembly declaratively (via
|
|
243
|
+
// initAssembly), so anything thrown out of applyInit is a failure of a
|
|
244
|
+
// step, not of the view coming up.
|
|
245
|
+
materialized: () => true,
|
|
246
|
+
apply: (init, ctx) => applyInit(self, init, ctx),
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Autorun that updates coarse dynamic blocks with a delay
|
|
251
|
+
*/
|
|
252
|
+
function setupCoarseDynamicBlocksAutorun(self) {
|
|
125
253
|
addDisposer(self, autorun(function coarseDynamicBlocksAutorun() {
|
|
126
254
|
if (self.initialized) {
|
|
127
|
-
self.setCoarseDynamicBlocks(self.dynamicBlocks);
|
|
255
|
+
self.setCoarseDynamicBlocks(self.dynamicBlocks, self.bpPerPx);
|
|
128
256
|
}
|
|
129
|
-
}, {
|
|
257
|
+
}, {
|
|
258
|
+
delay: 500,
|
|
259
|
+
name: 'LGVCoarseDynamicBlocks',
|
|
260
|
+
}));
|
|
130
261
|
}
|
|
131
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Autorun that syncs view settings to localStorage
|
|
264
|
+
*/
|
|
265
|
+
function setupLocalStorageAutorun(self) {
|
|
132
266
|
addDisposer(self, autorun(function localStorageAutorun() {
|
|
133
267
|
const s = (s) => JSON.stringify(s);
|
|
134
|
-
const {
|
|
135
|
-
localStorageSetItem('lgv-showCytobands', s(
|
|
268
|
+
const { showCytobands, showCenterLine, colorByCDS, showAminoAcids, showTrackOutlines, trackLabels, } = self;
|
|
269
|
+
localStorageSetItem('lgv-showCytobands', s(showCytobands));
|
|
136
270
|
localStorageSetItem('lgv-showCenterLine', s(showCenterLine));
|
|
137
271
|
localStorageSetItem('lgv-colorByCDS', s(colorByCDS));
|
|
272
|
+
localStorageSetItem('lgv-showAminoAcids', s(showAminoAcids));
|
|
138
273
|
localStorageSetItem('lgv-showTrackOutlines', s(showTrackOutlines));
|
|
139
|
-
|
|
140
|
-
|
|
274
|
+
// skip writing the empty default — otherwise reads later round-trip to
|
|
275
|
+
// '' instead of null, hiding the config-fallback path
|
|
276
|
+
if (trackLabels) {
|
|
277
|
+
localStorageSetItem('lgv-trackLabels', trackLabels);
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
name: 'LGVLocalStorage',
|
|
281
|
+
}));
|
|
141
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Sets up all afterAttach autoruns for the LinearGenomeView
|
|
285
|
+
*/
|
|
142
286
|
export function doAfterAttach(self) {
|
|
287
|
+
setupInitWarmup(self);
|
|
143
288
|
setupInitAutorun(self);
|
|
144
289
|
setupCoarseDynamicBlocksAutorun(self);
|
|
145
290
|
setupLocalStorageAutorun(self);
|
|
@@ -2,5 +2,5 @@ import type { LinearGenomeViewModel } from '../index.ts';
|
|
|
2
2
|
type LGV = LinearGenomeViewModel;
|
|
3
3
|
declare const CenterLine: ({ model }: {
|
|
4
4
|
model: LGV;
|
|
5
|
-
}) => import("react
|
|
5
|
+
}) => import("react").JSX.Element | null;
|
|
6
6
|
export default CenterLine;
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { clamp } from '@jbrowse/core/util';
|
|
3
|
+
import { basePaintedAt } from '@jbrowse/core/util/Base1DUtils';
|
|
3
4
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
5
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
6
|
+
import { IconButton, Tooltip } from '@mui/material';
|
|
4
7
|
import { observer } from 'mobx-react';
|
|
5
8
|
const useStyles = makeStyles()(theme => ({
|
|
6
9
|
centerLineContainer: {
|
|
7
10
|
background: 'transparent',
|
|
8
11
|
height: '100%',
|
|
9
|
-
zIndex: 4,
|
|
12
|
+
zIndex: 4, // above the track but under menu
|
|
10
13
|
position: 'absolute',
|
|
11
14
|
left: 0,
|
|
12
15
|
border: `1px ${theme.palette.action.active} dashed`,
|
|
@@ -17,22 +20,30 @@ const useStyles = makeStyles()(theme => ({
|
|
|
17
20
|
centerLineText: {
|
|
18
21
|
position: 'absolute',
|
|
19
22
|
left: 0,
|
|
20
|
-
|
|
23
|
+
bottom: 0,
|
|
24
|
+
display: 'flex',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
gap: 2,
|
|
21
27
|
whiteSpace: 'nowrap',
|
|
22
28
|
fontWeight: 'bold',
|
|
23
29
|
},
|
|
30
|
+
dismiss: {
|
|
31
|
+
// re-enable clicks disabled on the pointer-events:none container
|
|
32
|
+
pointerEvents: 'auto',
|
|
33
|
+
padding: 2,
|
|
34
|
+
},
|
|
24
35
|
}));
|
|
25
36
|
const CenterLine = observer(function CenterLine({ model }) {
|
|
26
|
-
const { bpPerPx, centerLineInfo,
|
|
27
|
-
const ref = useRef(null);
|
|
37
|
+
const { bpPerPx, centerLineInfo, tracks, width } = model;
|
|
28
38
|
const { classes } = useStyles();
|
|
29
39
|
const startingPosition = width / 2;
|
|
30
|
-
return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation",
|
|
40
|
+
return tracks.length ? (_jsx("div", { "data-testid": "centerline_container", className: classes.centerLineContainer, role: "presentation", style: {
|
|
31
41
|
transform: `translateX(${startingPosition}px)`,
|
|
32
42
|
width: Math.max(1 / bpPerPx, 1),
|
|
33
43
|
}, children: centerLineInfo && (_jsxs("div", { "data-testid": "centerline_text", className: classes.centerLineText, role: "presentation", style: {
|
|
34
44
|
transform: `translateX(${Math.max(1 / bpPerPx, 1) + 5}px)`,
|
|
35
|
-
|
|
36
|
-
|
|
45
|
+
}, children: [centerLineInfo.refName, ":", ' ', (clamp(basePaintedAt(centerLineInfo, centerLineInfo.offset), centerLineInfo.start, centerLineInfo.end - 1) + 1).toLocaleString('en-US'), _jsx(Tooltip, { title: "Hide center line", children: _jsx(IconButton, { className: classes.dismiss, onClick: () => {
|
|
46
|
+
model.setShowCenterLine(false);
|
|
47
|
+
}, children: _jsx(CloseIcon, { fontSize: "inherit" }) }) })] })) })) : null;
|
|
37
48
|
});
|
|
38
49
|
export default CenterLine;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../model.ts';
|
|
2
|
+
import type { HoverHighlightPosition } from './HoverPositionHighlight.tsx';
|
|
3
|
+
declare const ConnectedHoverHighlight: ({ model, getPosition, }: {
|
|
4
|
+
model: LinearGenomeViewModel;
|
|
5
|
+
getPosition: (widget: unknown, viewId: string) => HoverHighlightPosition | undefined;
|
|
6
|
+
}) => import("react").JSX.Element | null;
|
|
7
|
+
export default ConnectedHoverHighlight;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { observer } from 'mobx-react';
|
|
4
|
+
import HoverPositionHighlight from './HoverPositionHighlight.js';
|
|
5
|
+
// Draws a crosshair for every session widget "connected" to this view that is
|
|
6
|
+
// currently publishing a hover position. Each cross-widget hover overlay (the
|
|
7
|
+
// feature-detail sequence panel, the MAF sequence widget) supplies only its own
|
|
8
|
+
// `getPosition`, which narrows an arbitrary widget to its model and returns the
|
|
9
|
+
// hovered interval or undefined; the widget iteration and drawing are shared.
|
|
10
|
+
const ConnectedHoverHighlight = observer(function ConnectedHoverHighlight({ model, getPosition, }) {
|
|
11
|
+
const session = getSession(model);
|
|
12
|
+
const widgets = 'widgets' in session ? session.widgets : undefined;
|
|
13
|
+
return !widgets ? null : (_jsx(_Fragment, { children: [...widgets].flatMap(([id, widget]) => {
|
|
14
|
+
const position = getPosition(widget, model.id);
|
|
15
|
+
return position
|
|
16
|
+
? [
|
|
17
|
+
_jsx(HoverPositionHighlight, { model: model, position: position }, `hover-${id}`),
|
|
18
|
+
]
|
|
19
|
+
: [];
|
|
20
|
+
}) }));
|
|
21
|
+
});
|
|
22
|
+
export default ConnectedHoverHighlight;
|