@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/FeatureTrack/configSchema.d.ts +104 -65
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +250 -121
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +16 -7
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +32 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +19 -23
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +13 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/Rubberband.js +13 -16
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +16 -21
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +58 -66
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
- package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
- package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
- package/esm/LinearGenomeView/components/util.d.ts +20 -6
- package/esm/LinearGenomeView/components/util.js +27 -6
- package/esm/LinearGenomeView/consts.d.ts +7 -2
- package/esm/LinearGenomeView/consts.js +18 -2
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +27 -0
- package/esm/LinearGenomeView/headerFit.js +59 -0
- package/esm/LinearGenomeView/index.d.ts +32 -2
- package/esm/LinearGenomeView/index.js +16 -6
- package/esm/LinearGenomeView/initKeys.d.ts +12 -0
- package/esm/LinearGenomeView/initKeys.js +68 -0
- package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
- package/esm/LinearGenomeView/keyboardHandler.js +10 -0
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +23 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
- package/esm/LinearGenomeView/lazyDialogs.js +3 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
- package/esm/LinearGenomeView/linkedViewSync.js +58 -0
- package/esm/LinearGenomeView/menuItems.d.ts +27 -2
- package/esm/LinearGenomeView/menuItems.js +137 -101
- package/esm/LinearGenomeView/model.d.ts +3238 -136
- package/esm/LinearGenomeView/model.js +2425 -528
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
- package/esm/LinearGenomeView/stickyChrome.js +30 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
- package/esm/LinearGenomeView/types.d.ts +17 -31
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +332 -12
- package/esm/LinearGenomeView/util.js +606 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
- package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +1 -0
- package/esm/MultiLevelRubberband/types.d.ts +6 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
- package/esm/displayKitTests/perRegionTestEnv.js +138 -0
- package/esm/index.d.ts +122 -1235
- package/esm/index.js +101 -24
- package/esm/lazyPluginExports.d.ts +23 -0
- package/esm/lazyPluginExports.js +36 -0
- package/esm/searchUtils.d.ts +55 -11
- package/esm/searchUtils.js +342 -45
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +33 -0
- package/esm/shared/coordLabels.d.ts +40 -0
- package/esm/shared/coordLabels.js +119 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
/**
|
|
3
|
+
* A container's zoom-out ceiling for the rows it stacks. Unanswered is its own
|
|
4
|
+
* state rather than a zero: a row that has not been laid out yet cannot supply
|
|
5
|
+
* a fit, and reading that as "no shared ceiling" is a different claim. See
|
|
6
|
+
* `LinearComparativeView/sharedFit.ts`.
|
|
7
|
+
*/
|
|
8
|
+
export type SharedFit = {
|
|
9
|
+
answered: false;
|
|
10
|
+
} | {
|
|
11
|
+
answered: true;
|
|
12
|
+
bpPerPx: number;
|
|
13
|
+
};
|
|
14
|
+
export interface SharedScaleContainer {
|
|
15
|
+
sharedFit: SharedFit;
|
|
16
|
+
}
|
|
17
|
+
export declare function isSharedScaleContainer(thing: unknown): thing is SharedScaleContainer;
|
|
18
|
+
export declare function sharedScaleContainerOf(node: IAnyStateTreeNode): SharedScaleContainer | undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getParent, hasParent, isAlive } from '@jbrowse/mobx-state-tree';
|
|
2
|
+
export function isSharedScaleContainer(thing) {
|
|
3
|
+
return typeof thing === 'object' && thing !== null && 'sharedFit' in thing;
|
|
4
|
+
}
|
|
5
|
+
// Walks rather than using findParentThatIs because having no such container is
|
|
6
|
+
// the ordinary standalone case here, not the error that helper reports.
|
|
7
|
+
export function sharedScaleContainerOf(node) {
|
|
8
|
+
let current = node;
|
|
9
|
+
let found;
|
|
10
|
+
while (!found && hasParent(current) && isAlive(current)) {
|
|
11
|
+
current = getParent(current);
|
|
12
|
+
if (isSharedScaleContainer(current)) {
|
|
13
|
+
found = current;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return found;
|
|
17
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from './model.ts';
|
|
2
|
+
import type { Region } from '@jbrowse/core/util/types';
|
|
3
|
+
/**
|
|
4
|
+
* Replace a view's displayed regions with a set someone asked for, frame them,
|
|
5
|
+
* and offer an Undo that puts the view back exactly as it was.
|
|
6
|
+
*
|
|
7
|
+
* This is the "navigate the view you are looking at" half of a launcher, as
|
|
8
|
+
* against `session.addView`, which opens a second one. Two features do it —
|
|
9
|
+
* plugin-canvas's collapsed introns and plugin-alignments' "view mate region" —
|
|
10
|
+
* and both had their own copy of the same fifteen lines, including the same two
|
|
11
|
+
* decisions worth stating once:
|
|
12
|
+
*
|
|
13
|
+
* - **`fitAllRegions`, not `showAllRegions`.** The caller named the regions it
|
|
14
|
+
* wants, so it gets the width. `showAllRegions` goes to the zoom-out LIMIT,
|
|
15
|
+
* whose 10% margin is a framing choice for "show me everything" and dead frame
|
|
16
|
+
* here — and both of these callers already padded their regions by the context
|
|
17
|
+
* they wanted, so a second margin is one nothing asked for.
|
|
18
|
+
* - **The captured viewport is a bp WINDOW, not a pixel pair.** A capture and its
|
|
19
|
+
* Undo can be a window resize apart, and pixels mean nothing without the width
|
|
20
|
+
* they were measured at. Both copies captured `{bpPerPx, offsetPx}` and
|
|
21
|
+
* restored through `setNewView`, so undoing after a resize landed somewhere
|
|
22
|
+
* else. `displayedRegions` rides along by reference: it is a `types.frozen`,
|
|
23
|
+
* so the array is already immutable and `getSnapshot` would refuse it anyway.
|
|
24
|
+
*
|
|
25
|
+
* `alsoUndo` is for state the caller changed that is not the view's location —
|
|
26
|
+
* the collapsed-intron launch isolates the track to one gene, and an Undo that
|
|
27
|
+
* restored the regions and left the isolation on would be a worse lie than not
|
|
28
|
+
* offering one.
|
|
29
|
+
*/
|
|
30
|
+
export declare function showRegionsWithUndo({ view, regions, message, alsoUndo, }: {
|
|
31
|
+
view: LinearGenomeViewModel;
|
|
32
|
+
regions: Region[];
|
|
33
|
+
message: string;
|
|
34
|
+
alsoUndo?: () => void;
|
|
35
|
+
}): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getNotificationSink } from '@jbrowse/core/util';
|
|
2
|
+
/**
|
|
3
|
+
* Replace a view's displayed regions with a set someone asked for, frame them,
|
|
4
|
+
* and offer an Undo that puts the view back exactly as it was.
|
|
5
|
+
*
|
|
6
|
+
* This is the "navigate the view you are looking at" half of a launcher, as
|
|
7
|
+
* against `session.addView`, which opens a second one. Two features do it —
|
|
8
|
+
* plugin-canvas's collapsed introns and plugin-alignments' "view mate region" —
|
|
9
|
+
* and both had their own copy of the same fifteen lines, including the same two
|
|
10
|
+
* decisions worth stating once:
|
|
11
|
+
*
|
|
12
|
+
* - **`fitAllRegions`, not `showAllRegions`.** The caller named the regions it
|
|
13
|
+
* wants, so it gets the width. `showAllRegions` goes to the zoom-out LIMIT,
|
|
14
|
+
* whose 10% margin is a framing choice for "show me everything" and dead frame
|
|
15
|
+
* here — and both of these callers already padded their regions by the context
|
|
16
|
+
* they wanted, so a second margin is one nothing asked for.
|
|
17
|
+
* - **The captured viewport is a bp WINDOW, not a pixel pair.** A capture and its
|
|
18
|
+
* Undo can be a window resize apart, and pixels mean nothing without the width
|
|
19
|
+
* they were measured at. Both copies captured `{bpPerPx, offsetPx}` and
|
|
20
|
+
* restored through `setNewView`, so undoing after a resize landed somewhere
|
|
21
|
+
* else. `displayedRegions` rides along by reference: it is a `types.frozen`,
|
|
22
|
+
* so the array is already immutable and `getSnapshot` would refuse it anyway.
|
|
23
|
+
*
|
|
24
|
+
* `alsoUndo` is for state the caller changed that is not the view's location —
|
|
25
|
+
* the collapsed-intron launch isolates the track to one gene, and an Undo that
|
|
26
|
+
* restored the regions and left the isolation on would be a worse lie than not
|
|
27
|
+
* offering one.
|
|
28
|
+
*/
|
|
29
|
+
export function showRegionsWithUndo({ view, regions, message, alsoUndo, }) {
|
|
30
|
+
const previous = {
|
|
31
|
+
displayedRegions: view.displayedRegions,
|
|
32
|
+
windowWidthBp: view.windowWidthBp,
|
|
33
|
+
windowStartBp: view.windowStartBp,
|
|
34
|
+
};
|
|
35
|
+
view.showRegions(regions);
|
|
36
|
+
getNotificationSink(view).notify(message, 'info', {
|
|
37
|
+
name: 'Undo',
|
|
38
|
+
onClick: () => {
|
|
39
|
+
view.setDisplayedRegions(previous.displayedRegions);
|
|
40
|
+
view.setWindow(previous.windowWidthBp, previous.windowStartBp);
|
|
41
|
+
alsoUndo?.();
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the sticky boxes below the view's chrome pin, as CSS rather than as a
|
|
3
|
+
* pixel sum.
|
|
4
|
+
*
|
|
5
|
+
* The model's `rubberbandTop` / `pinnedTracksTop` answer the same question in
|
|
6
|
+
* numbers, and still have to — `height`, `getTrackYOffset` and the SVG export
|
|
7
|
+
* have no DOM to read. But the numbers are nominal. Both boxes above are now
|
|
8
|
+
* minimum-height, since pinning them to their constants clipped their content
|
|
9
|
+
* at a larger root font size, and one of them is briefly absent during a slow
|
|
10
|
+
* load. Anything positioning against them in the DOM reads what they publish
|
|
11
|
+
* and keeps the constant only as the fallback for the first frame.
|
|
12
|
+
*/
|
|
13
|
+
export declare function stickyChromeTops({ stickyViewHeaders, headerHeight, }: {
|
|
14
|
+
stickyViewHeaders: boolean;
|
|
15
|
+
headerHeight: number;
|
|
16
|
+
}): {
|
|
17
|
+
scalebar: string | undefined;
|
|
18
|
+
pinnedTracks: string;
|
|
19
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { VIEW_HEADER_HEIGHT } from '@jbrowse/core/ui';
|
|
2
|
+
import { LGV_HEADER_HEIGHT_VAR, VIEW_HEADER_HEIGHT_VAR, } from '@jbrowse/core/util/hooks';
|
|
3
|
+
import { SCALE_BAR_HEIGHT } from './consts.js';
|
|
4
|
+
/**
|
|
5
|
+
* Where the sticky boxes below the view's chrome pin, as CSS rather than as a
|
|
6
|
+
* pixel sum.
|
|
7
|
+
*
|
|
8
|
+
* The model's `rubberbandTop` / `pinnedTracksTop` answer the same question in
|
|
9
|
+
* numbers, and still have to — `height`, `getTrackYOffset` and the SVG export
|
|
10
|
+
* have no DOM to read. But the numbers are nominal. Both boxes above are now
|
|
11
|
+
* minimum-height, since pinning them to their constants clipped their content
|
|
12
|
+
* at a larger root font size, and one of them is briefly absent during a slow
|
|
13
|
+
* load. Anything positioning against them in the DOM reads what they publish
|
|
14
|
+
* and keeps the constant only as the fallback for the first frame.
|
|
15
|
+
*/
|
|
16
|
+
export function stickyChromeTops({ stickyViewHeaders, headerHeight, }) {
|
|
17
|
+
// `scalebar` is undefined rather than 0 when the chrome does not pin: its
|
|
18
|
+
// readers use that to stay in flow. A pinned *track* block pins either way —
|
|
19
|
+
// pinning tracks is its own feature — so it always has a top, and with no
|
|
20
|
+
// chrome above it that top is the container's own edge.
|
|
21
|
+
const scalebar = stickyViewHeaders
|
|
22
|
+
? `calc(var(${VIEW_HEADER_HEIGHT_VAR}, ${VIEW_HEADER_HEIGHT}px) + var(${LGV_HEADER_HEIGHT_VAR}, ${headerHeight}px))`
|
|
23
|
+
: undefined;
|
|
24
|
+
return {
|
|
25
|
+
scalebar,
|
|
26
|
+
pinnedTracks: scalebar
|
|
27
|
+
? `calc(${scalebar} + ${SCALE_BAR_HEIGHT}px)`
|
|
28
|
+
: '0px',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
3
|
+
import { svgNodeId } from '@jbrowse/core/svg/svgId';
|
|
4
|
+
import { getStrokeProps } from '@jbrowse/core/util';
|
|
3
5
|
import { useTheme } from '@mui/material';
|
|
4
|
-
import {
|
|
6
|
+
import { gridlineTickXs, vlinePath } from './util.js';
|
|
5
7
|
export default function SVGGridlines({ model, height, }) {
|
|
6
|
-
const {
|
|
8
|
+
const { width } = model;
|
|
7
9
|
const theme = useTheme();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return (_jsx("line", { x1: x, x2: x, y1: 0, y2: height, strokeWidth: 1, stroke: c, strokeOpacity: isMajor ? 0.3 : 0.15 }, `gridline-${tick.base}`));
|
|
18
|
-
}) })] }, key));
|
|
19
|
-
}) }));
|
|
10
|
+
// share the on-screen gridline colors; getStrokeProps splits the rgba alpha
|
|
11
|
+
// into strokeOpacity so the exported SVG stays renderer-safe
|
|
12
|
+
const minorProps = getStrokeProps(theme.palette.gridlineMinor);
|
|
13
|
+
const majorProps = getStrokeProps(theme.palette.gridlineMajor);
|
|
14
|
+
const { major, minor } = gridlineTickXs(model);
|
|
15
|
+
// gridlineTicks spans the whole staticBlocks frame, which overhangs the
|
|
16
|
+
// viewport on both sides, so clip to the view width rather than letting ticks
|
|
17
|
+
// bleed into the export margin
|
|
18
|
+
return (_jsxs(SvgClipRect, { id: `gridline-clip-${svgNodeId(model)}`, width: width, height: height, children: [_jsx("path", { d: vlinePath(minor, 0, height), strokeWidth: 1, fill: "none", ...minorProps }), _jsx("path", { d: vlinePath(major, 0, height), strokeWidth: 1, fill: "none", ...majorProps })] }));
|
|
20
19
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
-
export default function SVGHeader({ model, fontSize,
|
|
2
|
+
export default function SVGHeader({ model, fontSize, rulerHeight, }: {
|
|
3
3
|
model: LinearGenomeViewModel;
|
|
4
4
|
rulerHeight: number;
|
|
5
5
|
fontSize: number;
|
|
6
|
-
|
|
7
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,41 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { getSession, stripAlpha } from '@jbrowse/core/util';
|
|
3
|
-
import
|
|
3
|
+
import { createOverviewLayout, getOverviewRegionPxSpan, } from '@jbrowse/core/util/Base1DUtils';
|
|
4
|
+
import calculateDynamicBlocks from '@jbrowse/core/util/calculateDynamicBlocks';
|
|
4
5
|
import { useTheme } from '@mui/material';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
import Cytobands from '../components/Cytobands.js';
|
|
7
|
+
import OverviewScalebarPolygon from '../components/OverviewScalebarPolygon.js';
|
|
8
|
+
import { getCytobands } from '../components/util.js';
|
|
9
|
+
import { HEADER_OVERVIEW_HEIGHT } from '../consts.js';
|
|
10
|
+
import SVGRuler from './SVGRuler.js';
|
|
11
|
+
import SVGScalebar from './SVGScalebar.js';
|
|
12
|
+
import { getHeaderLayout } from './util.js';
|
|
13
|
+
// "you are here" cytoband overview rendered above the ruler. Self-contained so
|
|
14
|
+
// the overview-layout work only runs when cytobands are actually shown.
|
|
15
|
+
function CytobandOverview({ model, assembly, y, }) {
|
|
16
|
+
const { width, displayedRegions, minimumBlockWidth, bpPerPx } = model;
|
|
17
|
+
const overview = createOverviewLayout({
|
|
18
|
+
displayedRegions,
|
|
19
|
+
width,
|
|
20
|
+
minimumBlockWidth,
|
|
21
|
+
});
|
|
22
|
+
const block = calculateDynamicBlocks(overview).contentBlocks[0];
|
|
23
|
+
// same span the polygon below draws its top edge from, so the rectangle and
|
|
24
|
+
// the trapezoid under it always cover the same regions
|
|
25
|
+
const span = getOverviewRegionPxSpan({
|
|
26
|
+
overview,
|
|
27
|
+
bpPerPx,
|
|
28
|
+
blocks: model.dynamicBlocks.blocks,
|
|
29
|
+
});
|
|
30
|
+
return block && span ? (_jsxs("g", { transform: `translate(0 ${y})`, children: [_jsx(Cytobands, { overview: overview, cytobands: getCytobands(assembly, block.refName), block: block }), _jsx("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(span.rightPx - span.leftPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: span.leftPx, y: 0.5 }), _jsx("g", { transform: `translate(0,${HEADER_OVERVIEW_HEIGHT})`, children: _jsx(OverviewScalebarPolygon, { overview: overview, model: model, exportSvg: true }) })] })) : null;
|
|
31
|
+
}
|
|
32
|
+
export default function SVGHeader({ model, fontSize, rulerHeight, }) {
|
|
33
|
+
const { assemblyNames, effectiveShowCytobands } = model;
|
|
12
34
|
const { assemblyManager } = getSession(model);
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
// cytobands need a single unambiguous assembly, but the header label names
|
|
36
|
+
// every assembly in the view
|
|
37
|
+
const cytobandAssemblyName = assemblyNames.length === 1 ? assemblyNames[0] : undefined;
|
|
38
|
+
const assembly = cytobandAssemblyName
|
|
39
|
+
? assemblyManager.get(cytobandAssemblyName)
|
|
40
|
+
: undefined;
|
|
15
41
|
const theme = useTheme();
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
interRegionPaddingWidth: 0,
|
|
20
|
-
minimumBlockWidth: model.minimumBlockWidth,
|
|
21
|
-
});
|
|
22
|
-
const visibleRegions = model.dynamicBlocks.contentBlocks;
|
|
23
|
-
if (!visibleRegions.length) {
|
|
42
|
+
const fill = stripAlpha(theme.palette.text.primary);
|
|
43
|
+
// nothing on screen to label: no assembly name, scalebar or ruler
|
|
44
|
+
if (!model.hasVisibleContent) {
|
|
24
45
|
return null;
|
|
25
46
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
...first,
|
|
33
|
-
coord: first.reversed ? first.end : first.start,
|
|
34
|
-
}) || 0;
|
|
35
|
-
const lastOverviewPx = overview.bpToPx({
|
|
36
|
-
...last,
|
|
37
|
-
coord: last.reversed ? last.start : last.end,
|
|
38
|
-
}) || 0;
|
|
39
|
-
const y = +showCytobands * cytobandHeight;
|
|
40
|
-
return (_jsxs("g", { id: "header", children: [_jsx("text", { x: 0, y: 0, dominantBaseline: "hanging", fontSize: fontSize, fill: c, children: assemblyName }), showCytobands ? (_jsxs("g", { transform: `translate(0 ${rulerHeight})`, children: [_jsx(Cytobands, { overview: overview, assembly: assembly, block: block }), _jsx("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }), _jsx("g", { transform: `translate(0,${HEADER_OVERVIEW_HEIGHT})`, children: _jsx(OverviewScalebarPolygon, { overview: overview, model: model, useOffset: false }) })] })) : null, _jsx("g", { transform: `translate(0 ${fontSize + y})`, children: _jsx(SVGScalebar, { model: model, fontSize: fontSize }) }), _jsx("g", { transform: `translate(0 ${rulerHeight + y})`, children: _jsx(SVGRuler, { model: model, fontSize: fontSize }) })] }));
|
|
47
|
+
const { assemblyLabelBaselineY, cytobandTop, scalebarLineY, rulerTop } = getHeaderLayout({
|
|
48
|
+
fontSize,
|
|
49
|
+
showCytobands: effectiveShowCytobands,
|
|
50
|
+
rulerHeight,
|
|
51
|
+
});
|
|
52
|
+
return (_jsxs("g", { id: "header", children: [_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: fill, children: assemblyNames.join(', ') }), effectiveShowCytobands ? (_jsx(CytobandOverview, { model: model, assembly: assembly, y: cytobandTop })) : null, _jsx("g", { transform: `translate(0 ${scalebarLineY})`, children: _jsx(SVGScalebar, { model: model, fontSize: fontSize }) }), _jsx("g", { transform: `translate(0 ${rulerTop})`, children: _jsx(SVGRuler, { model: model, rulerHeight: rulerHeight }) })] }));
|
|
41
53
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { getSession } from '@jbrowse/core/util';
|
|
3
|
+
import { useTheme } from '@mui/material';
|
|
4
|
+
import SVGHighlightBand from '../components/SVGHighlightBand.js';
|
|
5
|
+
import { getHighlightColor, highlightKey } from '../components/util.js';
|
|
6
|
+
// Native LGV highlights (model.highlight) drawn as full-height bands over the
|
|
7
|
+
// tracks area, with an optional label at the top. Bookmark highlights are added
|
|
8
|
+
// separately via the LinearGenomeView-HighlightSVGComponent extension point.
|
|
9
|
+
//
|
|
10
|
+
// Deliberately NOT an observer, and that is the whole of what keeps a live
|
|
11
|
+
// figure coherent. `useViewSvgFigure` freezes a figure by memoizing it against
|
|
12
|
+
// its snapshot, which stops a parent render from advancing the drawing — but a
|
|
13
|
+
// `memo` cannot stop an observer inside it from re-rendering itself, and an
|
|
14
|
+
// observer here reads `getHighlightCoords`, i.e. `offsetPx`. A pan then slid the
|
|
15
|
+
// bands across track bodies that were still drawn where the snapshot left them.
|
|
16
|
+
// The file export renders the whole document in one synchronous pass, so it
|
|
17
|
+
// never needed the subscription either.
|
|
18
|
+
export default function SVGHighlights({ model, height, }) {
|
|
19
|
+
const theme = useTheme();
|
|
20
|
+
return getSession(model).highlightsVisible
|
|
21
|
+
? model.highlight.map((h, idx) => {
|
|
22
|
+
const coords = model.getHighlightCoords(h);
|
|
23
|
+
return coords ? (_jsx(SVGHighlightBand, { coords: coords, height: height, color: getHighlightColor(h, theme).toRgbString(), label: model.labelsVisible ? h.label : undefined, labelColor: theme.palette.text.primary }, highlightKey(h, idx))) : null;
|
|
24
|
+
})
|
|
25
|
+
: null;
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
3
|
+
import { svgNodeId } from '@jbrowse/core/svg/svgId';
|
|
4
|
+
import { PluggableElements } from '@jbrowse/core/ui';
|
|
5
|
+
import { getEnv } from '@jbrowse/core/util';
|
|
6
|
+
import SVGHighlights from './SVGHighlights.js';
|
|
7
|
+
// The highlight layer over one view's tracks area: native LGV highlights plus
|
|
8
|
+
// whatever plugins contribute (bookmarks), clipped to the view width. Callers
|
|
9
|
+
// translate this to the top-left of the tracks area.
|
|
10
|
+
export default function SVGHighlightsOverlay({ model, tracksHeight, }) {
|
|
11
|
+
const { pluginManager } = getEnv(model);
|
|
12
|
+
return (_jsxs(SvgClipRect, { id: `highlight-clip-${svgNodeId(model)}`, width: model.width, height: tracksHeight, children: [_jsx(SVGHighlights, { model: model, height: tracksHeight }), _jsx(PluggableElements, { pluginManager: pluginManager, name: "LinearGenomeView-HighlightSVGComponent", props: { model, height: tracksHeight } })] }));
|
|
13
|
+
}
|
|
@@ -2,6 +2,4 @@ import type { LinearGenomeViewModel } from '../index.ts';
|
|
|
2
2
|
import type { ExportSvgOptions } from '../types.ts';
|
|
3
3
|
type LGV = LinearGenomeViewModel;
|
|
4
4
|
export declare function renderToSvg(model: LGV, opts: ExportSvgOptions): Promise<string>;
|
|
5
|
-
export {
|
|
6
|
-
export { default as SVGRuler } from './SVGRuler.tsx';
|
|
7
|
-
export { default as SVGTracks } from './SVGTracks.tsx';
|
|
5
|
+
export {};
|
|
@@ -1,45 +1,81 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import SVGTracks from "./SVGTracks.js";
|
|
12
|
-
import { totalHeight } from "./util.js";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { exportMargin } from '@jbrowse/core/svg/constants';
|
|
3
|
+
import { awaitViewInitialized } from '@jbrowse/core/svg/svgReady';
|
|
4
|
+
import { notifySkippedSvgTracks } from '@jbrowse/core/svg/trackNames';
|
|
5
|
+
import { wrapSvgExport } from '@jbrowse/core/svg/wrapSvgExport';
|
|
6
|
+
import { getSession } from '@jbrowse/core/util';
|
|
7
|
+
import SVGHeader from './SVGHeader.js';
|
|
8
|
+
import SVGView from './SVGView.js';
|
|
9
|
+
import { renderViewTracks } from './renderViewTracks.js';
|
|
10
|
+
import { defaultTextHeight, getHeaderLayout, trackLabelLeftOffset, } from './util.js';
|
|
13
11
|
export async function renderToSvg(model, opts) {
|
|
14
|
-
await
|
|
15
|
-
|
|
12
|
+
await awaitViewInitialized(model);
|
|
13
|
+
// `initialized` only answers "have the assemblies loaded" — navigating is the
|
|
14
|
+
// second async step, so an initialized view can still hold no regions: one
|
|
15
|
+
// sitting on its import form, or one a `clearView` emptied. There is no
|
|
16
|
+
// ruler, no scalebar and no track content to draw there, and the export used
|
|
17
|
+
// to save the header's reserved height as a blank themed rectangle. Say why
|
|
18
|
+
// instead, which the dialog shows as an error banner and a headless caller
|
|
19
|
+
// (jbrowse-img) gets as a nonzero exit rather than a blank image. Same guard,
|
|
20
|
+
// and the same reason, as the circular view's import-form export.
|
|
21
|
+
if (!model.hasDisplayedRegions) {
|
|
22
|
+
throw new Error('Cannot export: no regions are displayed');
|
|
23
|
+
}
|
|
24
|
+
const { fontSize = 13,
|
|
25
|
+
// the label band scales with the font it holds; destructured after
|
|
26
|
+
// fontSize so the default can read it
|
|
27
|
+
textHeight = defaultTextHeight(fontSize), rulerHeight = 34, trackLabels = 'offset', themeName = 'default', fontFamily, showGridlines = false, Wrapper, } = opts;
|
|
16
28
|
const session = getSession(model);
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
const theme = session.getActiveThemeOptions?.(themeName);
|
|
30
|
+
// owns the two orderings this used to spell out by hand: legendWidth before
|
|
31
|
+
// the awaits, tracksHeight after them. Every display's `renderSvg` owns its
|
|
32
|
+
// own readiness wait — an LGV display through `renderDisplaySvg`'s
|
|
33
|
+
// `awaitSvgReady`, a non-LGV one (dotplot, synteny, circular) by calling that
|
|
34
|
+
// itself.
|
|
35
|
+
const { tracks, displayResults, tracksHeight, legendWidth, skippedTracks } = await renderViewTracks({
|
|
36
|
+
view: model,
|
|
37
|
+
opts,
|
|
38
|
+
theme,
|
|
39
|
+
textHeight,
|
|
40
|
+
trackLabels,
|
|
41
|
+
// the standalone export is the one with room to give: it widens its
|
|
42
|
+
// canvas below so a legend sits beside the plot rather than over it
|
|
43
|
+
reserveLegendWidth: true,
|
|
44
|
+
});
|
|
45
|
+
notifySkippedSvgTracks(session, skippedTracks);
|
|
46
|
+
// The view geometry is read *after* the displays' waits, never before —
|
|
47
|
+
// SVGHeader re-reads both of these when it renders (later still, inside
|
|
48
|
+
// wrapSvgExport) and lays itself out with the same getHeaderLayout call, so a
|
|
49
|
+
// value that moved during the awaits would leave the reserved `tracksTop` and
|
|
50
|
+
// the drawn header describing different rows. Same rule the dotplot, circular
|
|
51
|
+
// and synteny exports each shipped a violation of.
|
|
52
|
+
const { width, effectiveShowCytobands } = model;
|
|
53
|
+
const { tracksTop } = getHeaderLayout({
|
|
54
|
+
fontSize,
|
|
55
|
+
showCytobands: effectiveShowCytobands,
|
|
56
|
+
rulerHeight,
|
|
57
|
+
});
|
|
58
|
+
const height = tracksHeight + tracksTop + exportMargin;
|
|
59
|
+
const trackLabelOffset = trackLabelLeftOffset({
|
|
60
|
+
tracks,
|
|
61
|
+
trackLabels,
|
|
62
|
+
fontSize,
|
|
63
|
+
fontFamily,
|
|
64
|
+
session,
|
|
65
|
+
});
|
|
39
66
|
const w = width + trackLabelOffset + legendWidth;
|
|
40
|
-
|
|
41
|
-
return
|
|
67
|
+
// the xlink namespace is used for rendering <image> tag
|
|
68
|
+
return wrapSvgExport({
|
|
69
|
+
theme,
|
|
70
|
+
width: w,
|
|
71
|
+
height,
|
|
72
|
+
fontFamily,
|
|
73
|
+
Wrapper,
|
|
74
|
+
children: (_jsx("g", { transform: `translate(${exportMargin} 0)`, children: _jsx(SVGView, { view: model, displayResults: displayResults,
|
|
75
|
+
// the standalone export is the one with room above the tracks, so its
|
|
76
|
+
// header is the full one: cytoband overview and total-bp scalebar as
|
|
77
|
+
// well as the assembly name and ruler. `tracksTop` is the height
|
|
78
|
+
// getHeaderLayout gave it.
|
|
79
|
+
header: _jsx(SVGHeader, { model: model, fontSize: fontSize, rulerHeight: rulerHeight }), fontSize: fontSize, textHeight: textHeight, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset, contentTop: tracksTop, tracksHeight: tracksHeight, showGridlines: showGridlines, leftBuffer: exportMargin, legendWidth: legendWidth }) })),
|
|
80
|
+
});
|
|
42
81
|
}
|
|
43
|
-
export { default as SVGGridlines } from "./SVGGridlines.js";
|
|
44
|
-
export { default as SVGRuler } from "./SVGRuler.js";
|
|
45
|
-
export { default as SVGTracks } from "./SVGTracks.js";
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTheme } from '@mui/material';
|
|
3
|
+
// SVG counterpart of the on-screen PaddingBlocks region separators: an opaque
|
|
4
|
+
// 3px bar at the right edge of every displayed region, in the same per-mode grey
|
|
5
|
+
// (a translucent fill would tint the track data it masks rather than hide it).
|
|
6
|
+
// Keyed off isRightEndOfDisplayedRegion like PaddingBlocks, so the bar at the
|
|
7
|
+
// last region's right edge isn't dropped.
|
|
8
|
+
//
|
|
9
|
+
// The seam is ALL of PaddingBlocks this draws, which is why it walks
|
|
10
|
+
// dynamicBlocks itself rather than reading `model.paddingSpans` like the
|
|
11
|
+
// on-screen component. The other two span kinds are chrome for an interactive
|
|
12
|
+
// row, not information a figure carries: `elided`'s striped grey says "regions
|
|
13
|
+
// here are too narrow to draw", which in a static image is noise, and at
|
|
14
|
+
// whole-genome zoom it is most of the row. Don't put this on paddingSpans to
|
|
15
|
+
// close the "divergence".
|
|
2
16
|
export default function SVGRegionSeparators({ model, height, }) {
|
|
3
|
-
const { dynamicBlocks, offsetPx
|
|
4
|
-
|
|
17
|
+
const { dynamicBlocks, offsetPx } = model;
|
|
18
|
+
const theme = useTheme();
|
|
19
|
+
const fill = theme.palette.mode === 'dark'
|
|
20
|
+
? theme.palette.grey[500]
|
|
21
|
+
: theme.palette.grey[600];
|
|
22
|
+
return (_jsx(_Fragment, { children: dynamicBlocks.contentBlocks
|
|
23
|
+
.filter(block => block.isRightEndOfDisplayedRegion)
|
|
24
|
+
.map(block => (_jsx("rect", { x: block.offsetPx + block.widthPx - offsetPx - 1, width: 3, y: 0, height: height, fill: fill }, block.key))) }));
|
|
5
25
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
+
export default function SVGRowHeader({ view, fontSize, rulerHeight, showAssemblyName, showScalebar, }: {
|
|
3
|
+
view: LinearGenomeViewModel;
|
|
4
|
+
fontSize: number;
|
|
5
|
+
rulerHeight: number;
|
|
6
|
+
showAssemblyName?: boolean;
|
|
7
|
+
showScalebar?: boolean;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { stripAlpha } from '@jbrowse/core/util';
|
|
3
|
+
import { useTheme } from '@mui/material';
|
|
4
|
+
import SVGRuler from './SVGRuler.js';
|
|
5
|
+
import SVGScalebar from './SVGScalebar.js';
|
|
6
|
+
import { getRowHeaderLayout } from './util.js';
|
|
7
|
+
// The compact header a *stacked* export gives each of its rows: the assembly
|
|
8
|
+
// name, optionally the total-bp scalebar, and the ruler. The standalone LGV
|
|
9
|
+
// export fills the same slot in SVGView with SVGHeader, which additionally
|
|
10
|
+
// draws the cytoband overview — there is room for that above a single view, and
|
|
11
|
+
// none between two rows of a synteny stack.
|
|
12
|
+
export default function SVGRowHeader({ view, fontSize,
|
|
13
|
+
// Must be the height the caller also passes SVGView as `contentTop`: the
|
|
14
|
+
// ruler hangs its ticks off the bottom of this budget so they meet the
|
|
15
|
+
// tracks, and the tracks start at `contentTop`.
|
|
16
|
+
rulerHeight,
|
|
17
|
+
// Whether this row draws its assembly name. Default true, which is what a
|
|
18
|
+
// stack of DIFFERENT assemblies wants — a synteny export names each row
|
|
19
|
+
// because each row is a different genome. A breakpoint split view is usually
|
|
20
|
+
// one assembly seen at several loci, and there the name is the same string
|
|
21
|
+
// printed once per panel, so that caller passes false on every row after the
|
|
22
|
+
// first whose assembly matches the row above it. The reserved band above the
|
|
23
|
+
// ruler is unchanged either way: it is the caller's offset, not this
|
|
24
|
+
// component's.
|
|
25
|
+
showAssemblyName = true,
|
|
26
|
+
// Whether this row draws the capped bar labelled with its span. Off by
|
|
27
|
+
// default, since it costs `getRowHeaderLayout().bandHeight` of the caller's
|
|
28
|
+
// band and every caller has to reserve that much before asking for it. See
|
|
29
|
+
// getRowHeaderLayout for what it is for.
|
|
30
|
+
showScalebar = false, }) {
|
|
31
|
+
const theme = useTheme();
|
|
32
|
+
const { assemblyLabelBaselineY, scalebarLineY } = getRowHeaderLayout({
|
|
33
|
+
fontSize,
|
|
34
|
+
showScalebar,
|
|
35
|
+
});
|
|
36
|
+
return (_jsxs(_Fragment, { children: [showAssemblyName ? (_jsx("text", { x: 0, y: assemblyLabelBaselineY, fontSize: fontSize, fill: stripAlpha(theme.palette.text.primary), children: view.assemblyNames.join(', ') })) : null, scalebarLineY === undefined ? null : (_jsx("g", { transform: `translate(0 ${scalebarLineY})`, children: _jsx(SVGScalebar, { model: view, fontSize: fontSize }) })), _jsx(SVGRuler, { model: view, rulerHeight: rulerHeight })] }));
|
|
37
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
2
|
type LGV = LinearGenomeViewModel;
|
|
3
|
-
export default function SVGRuler({ model,
|
|
3
|
+
export default function SVGRuler({ model, rulerHeight, }: {
|
|
4
4
|
model: LGV;
|
|
5
|
-
|
|
6
|
-
}): import("react
|
|
5
|
+
rulerHeight: number;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
7
7
|
export {};
|