@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/FeatureTrack/configSchema.d.ts +104 -65
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +250 -121
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +16 -7
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +144 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +7 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +11 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +32 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +16 -7
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +67 -51
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +19 -23
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +9 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +15 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +6 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +89 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +13 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +26 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +44 -57
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +84 -79
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +55 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +61 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +20 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/Rubberband.js +13 -16
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +9 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/Scalebar.js +16 -21
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +142 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +58 -66
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +3 -3
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +5 -7
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +4 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +45 -53
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +83 -39
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +11 -24
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +32 -85
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +72 -18
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +65 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -13
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +36 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +11 -66
- package/esm/LinearGenomeView/components/useRangeSelect.js +82 -91
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +1 -1
- package/esm/LinearGenomeView/components/useSideScroll.js +87 -19
- package/esm/LinearGenomeView/components/util.d.ts +20 -6
- package/esm/LinearGenomeView/components/util.js +27 -6
- package/esm/LinearGenomeView/consts.d.ts +7 -2
- package/esm/LinearGenomeView/consts.js +18 -2
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +27 -0
- package/esm/LinearGenomeView/headerFit.js +59 -0
- package/esm/LinearGenomeView/index.d.ts +32 -2
- package/esm/LinearGenomeView/index.js +16 -6
- package/esm/LinearGenomeView/initKeys.d.ts +12 -0
- package/esm/LinearGenomeView/initKeys.js +68 -0
- package/esm/LinearGenomeView/keyboardHandler.d.ts +7 -0
- package/esm/LinearGenomeView/keyboardHandler.js +10 -0
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +23 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +7 -11
- package/esm/LinearGenomeView/lazyDialogs.js +3 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +20 -0
- package/esm/LinearGenomeView/linkedViewSync.js +58 -0
- package/esm/LinearGenomeView/menuItems.d.ts +27 -2
- package/esm/LinearGenomeView/menuItems.js +137 -101
- package/esm/LinearGenomeView/model.d.ts +3238 -136
- package/esm/LinearGenomeView/model.js +2425 -528
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +44 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +19 -0
- package/esm/LinearGenomeView/stickyChrome.js +30 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +15 -16
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +2 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +45 -33
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +77 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +23 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +37 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +64 -36
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +7 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +43 -7
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +8 -14
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +16 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +263 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +92 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +236 -3
- package/esm/LinearGenomeView/types.d.ts +17 -31
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +332 -12
- package/esm/LinearGenomeView/util.js +606 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +37 -0
- package/esm/MultiLevelRubberband/VerticalGuide.d.ts +6 -0
- package/esm/MultiLevelRubberband/VerticalGuide.js +21 -0
- package/esm/MultiLevelRubberband/index.d.ts +2 -0
- package/esm/MultiLevelRubberband/index.js +1 -0
- package/esm/MultiLevelRubberband/types.d.ts +6 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +24 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +136 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1286 -0
- package/esm/displayKitTests/perRegionTestEnv.js +138 -0
- package/esm/index.d.ts +122 -1235
- package/esm/index.js +101 -24
- package/esm/lazyPluginExports.d.ts +23 -0
- package/esm/lazyPluginExports.js +36 -0
- package/esm/searchUtils.d.ts +55 -11
- package/esm/searchUtils.js +342 -45
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +33 -0
- package/esm/shared/coordLabels.d.ts +40 -0
- package/esm/shared/coordLabels.js +119 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { getFillProps } from '@jbrowse/core/util';
|
|
3
|
+
import { layoutBpToPx } from '@jbrowse/core/util/Base1DUtils';
|
|
3
4
|
import { observer } from 'mobx-react';
|
|
4
|
-
import {
|
|
5
|
-
|
|
5
|
+
import { HEADER_OVERVIEW_HEIGHT } from '../consts.js';
|
|
6
|
+
// rounded rect from https://stackoverflow.com/a/45889603/2129219
|
|
6
7
|
function rightRoundedRect(x, y, width, height, radius) {
|
|
7
8
|
return `M${x},${y}h${width - radius}a${radius},${radius} 0 0 1 ${radius},${radius}v${height - 2 * radius}a${radius},${radius} 0 0 1 ${-radius},${radius}h${radius - width}z`;
|
|
8
9
|
}
|
|
9
10
|
function leftRoundedRect(x, y, width, height, radius) {
|
|
10
11
|
return `M${x + radius},${y}h${width - radius}v${height}h${radius - width}a${radius},${radius} 0 0 1 ${-radius},${-radius}v${2 * radius - height}a${radius},${radius} 0 0 1 ${radius},${-radius}z`;
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function triangleRight(x, y, width, height) {
|
|
13
14
|
return [
|
|
14
|
-
[x,
|
|
15
|
-
[x + width, height / 2],
|
|
16
|
-
[x, height],
|
|
15
|
+
[x, y],
|
|
16
|
+
[x + width, y + height / 2],
|
|
17
|
+
[x, y + height],
|
|
17
18
|
].toString();
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function triangleLeft(x, y, width, height) {
|
|
20
21
|
return [
|
|
21
|
-
[x, height / 2],
|
|
22
|
-
[x + width,
|
|
23
|
-
[x + width, height],
|
|
22
|
+
[x, y + height / 2],
|
|
23
|
+
[x + width, y],
|
|
24
|
+
[x + width, y + height],
|
|
24
25
|
].toString();
|
|
25
26
|
}
|
|
26
27
|
const colorMap = {
|
|
@@ -35,53 +36,75 @@ const colorMap = {
|
|
|
35
36
|
stalk: 'rgb(127,127,127)',
|
|
36
37
|
acen: '#800',
|
|
37
38
|
};
|
|
38
|
-
|
|
39
|
+
// assemblies without Giemsa stains (e.g. dm6's numbered polytene divisions)
|
|
40
|
+
// arrive as 'n/a'; alternate two greys per numbered group so adjacent divisions
|
|
41
|
+
// stay distinguishable without painting a distracting colored block
|
|
42
|
+
function bandColors(cytobands) {
|
|
43
|
+
let prevKey = '';
|
|
44
|
+
let group = 0;
|
|
45
|
+
return cytobands.map(({ name, type }) => {
|
|
46
|
+
if (type !== 'n/a') {
|
|
47
|
+
return colorMap[type] ?? 'black';
|
|
48
|
+
}
|
|
49
|
+
const [, digits, letter] = name?.match(/^(\d+)([A-Za-z])/) ?? [];
|
|
50
|
+
const key = digits && letter ? digits + letter : '';
|
|
51
|
+
if (key && key !== prevKey) {
|
|
52
|
+
prevKey = key;
|
|
53
|
+
group++;
|
|
54
|
+
}
|
|
55
|
+
return group % 2 ? 'rgb(120,120,120)' : 'rgb(190,190,190)';
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// A block covers a single displayed region, which can be a slice of the
|
|
59
|
+
// chromosome, so clip each band to it and drop the ones that fall outside.
|
|
60
|
+
// Projecting an out-of-block coord returns undefined, and treating that as px 0
|
|
61
|
+
// used to draw runaway triangles and duplicate the centromere in every block.
|
|
62
|
+
function layoutBands(cytobands, overview, block) {
|
|
63
|
+
const { displayedRegionIndex, reversed } = block;
|
|
64
|
+
const firstAcenIdx = cytobands.findIndex(({ type }) => type === 'acen');
|
|
65
|
+
const colors = bandColors(cytobands);
|
|
66
|
+
return cytobands
|
|
67
|
+
.map((band, index) => {
|
|
68
|
+
const { refName, type } = band;
|
|
69
|
+
const start = Math.max(band.start, block.start);
|
|
70
|
+
const end = Math.min(band.end, block.end);
|
|
71
|
+
const toPx = (coord) => layoutBpToPx(overview, { refName, coord, displayedRegionIndex });
|
|
72
|
+
const s = toPx(start);
|
|
73
|
+
const e = toPx(end);
|
|
74
|
+
return start < end && s !== undefined && e !== undefined
|
|
75
|
+
? {
|
|
76
|
+
// name can be missing or duplicated; start/end uniquely identify it
|
|
77
|
+
key: `${band.start}-${band.end}`,
|
|
78
|
+
color: colors[index],
|
|
79
|
+
left: Math.min(s, e),
|
|
80
|
+
width: Math.abs(e - s),
|
|
81
|
+
isAcen: type === 'acen',
|
|
82
|
+
// the two acen bands always point at each other, meeting at the
|
|
83
|
+
// centromere: the p arm points right and the q arm left, and both
|
|
84
|
+
// flip when reversed puts the p arm on the right
|
|
85
|
+
// eslint-disable-next-line unicorn/no-chained-comparison -- parenthesised XOR, not `a === b !== c`
|
|
86
|
+
pointsRight: (index === firstAcenIdx) !== reversed,
|
|
87
|
+
}
|
|
88
|
+
: undefined;
|
|
89
|
+
})
|
|
90
|
+
.filter(f => f !== undefined);
|
|
91
|
+
}
|
|
92
|
+
const Cytobands = observer(function Cytobands({ overview, block, cytobands, }) {
|
|
39
93
|
const { offsetPx, reversed } = block;
|
|
40
|
-
const cytobands = getCytobands(assembly, block.refName);
|
|
41
|
-
const lcap = reversed ? cytobands.length - 1 : 0;
|
|
42
|
-
const rcap = reversed ? 0 : cytobands.length - 1;
|
|
43
94
|
const h = HEADER_OVERVIEW_HEIGHT;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return (_jsx("g", { transform: `translate(-${offsetPx})`, children:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const e = overview.bpToPx({ refName, coord: end }) || 0;
|
|
52
|
-
const l = Math.min(s, e);
|
|
53
|
-
const w = Math.abs(e - s);
|
|
54
|
-
if (type === 'n/a') {
|
|
55
|
-
const match = name?.match(/^(\d+)([A-Za-z])/);
|
|
56
|
-
const ret = match[1] + match[2];
|
|
57
|
-
if (ret && ret !== curr) {
|
|
58
|
-
curr = ret;
|
|
59
|
-
idx++;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
const c = type === 'n/a'
|
|
63
|
-
? idx % 2
|
|
64
|
-
? 'black'
|
|
65
|
-
: '#a77'
|
|
66
|
-
: colorMap[type] || 'black';
|
|
67
|
-
if (type === 'acen' && !centromereSeen) {
|
|
68
|
-
centromereSeen = true;
|
|
69
|
-
return (_jsx("polygon", { points: reversed
|
|
70
|
-
? rightTriangle(s - w, 0, w, h)
|
|
71
|
-
: leftTriangle(s, 0, w, h), ...getFillProps(c) }, k));
|
|
72
|
-
}
|
|
73
|
-
if (type === 'acen' && centromereSeen) {
|
|
74
|
-
return (_jsx("polygon", { points: reversed
|
|
75
|
-
? leftTriangle(s - w, 0, w, h)
|
|
76
|
-
: rightTriangle(s, 0, w, h), ...getFillProps(c) }, k));
|
|
77
|
-
}
|
|
78
|
-
if (lcap === index) {
|
|
79
|
-
return (_jsx("path", { d: leftRoundedRect(l, 0, w, h, 8), ...getFillProps(c) }, k));
|
|
95
|
+
const bands = layoutBands(cytobands, overview, block);
|
|
96
|
+
const lcap = reversed ? bands.length - 1 : 0;
|
|
97
|
+
const rcap = reversed ? 0 : bands.length - 1;
|
|
98
|
+
return (_jsx("g", { transform: `translate(-${offsetPx})`, children: bands.map(({ key, color, left, width, isAcen, pointsRight }, index) => {
|
|
99
|
+
if (isAcen) {
|
|
100
|
+
const triangle = pointsRight ? triangleRight : triangleLeft;
|
|
101
|
+
return (_jsx("polygon", { points: triangle(left, 0, width, h), ...getFillProps(color) }, key));
|
|
80
102
|
}
|
|
81
|
-
if (
|
|
82
|
-
|
|
103
|
+
if (index === lcap || index === rcap) {
|
|
104
|
+
const rect = index === lcap ? leftRoundedRect : rightRoundedRect;
|
|
105
|
+
return (_jsx("path", { d: rect(left, 0, width, h, 8), ...getFillProps(color) }, key));
|
|
83
106
|
}
|
|
84
|
-
return (_jsx("rect", { x:
|
|
107
|
+
return (_jsx("rect", { x: left, y: 0, width: width, height: h, ...getFillProps(color) }, key));
|
|
85
108
|
}) }));
|
|
86
109
|
});
|
|
87
110
|
export default Cytobands;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TrackLabelMode } from '../types.ts';
|
|
2
|
+
import type { BaseExportSvgOptions } from '@jbrowse/core/ui';
|
|
2
3
|
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
3
4
|
model: {
|
|
4
|
-
exportSvg(opts:
|
|
5
|
+
exportSvg(opts: BaseExportSvgOptions & {
|
|
6
|
+
trackLabels: TrackLabelMode;
|
|
7
|
+
showGridlines: boolean;
|
|
8
|
+
}): Promise<void>;
|
|
5
9
|
};
|
|
6
10
|
handleClose: () => void;
|
|
7
|
-
}): import("react
|
|
11
|
+
}): import("react").JSX.Element;
|
|
@@ -1,70 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
function LoadingMessage({ format }) {
|
|
7
|
-
return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsxs(Typography, { display: "inline", children: ["Creating ", format.toUpperCase()] })] }));
|
|
8
|
-
}
|
|
9
|
-
function useSvgLocal(key, val) {
|
|
10
|
-
return useLocalStorage(`svg-${key}`, val);
|
|
11
|
-
}
|
|
12
|
-
function TextField2({ children, ...rest }) {
|
|
13
|
-
return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
|
|
14
|
-
}
|
|
2
|
+
import { BaseExportSvgDialog, LabeledCheckbox, useExportSvgPreference, } from '@jbrowse/core/ui';
|
|
3
|
+
import { MenuItem, TextField } from '@mui/material';
|
|
4
|
+
// Shared track-label + gridlines export dialog. Used by LGV, linear-synteny and
|
|
5
|
+
// breakpoint-split views (their lazyDialogs re-export this).
|
|
15
6
|
export default function ExportSvgDialog({ model, handleClose, }) {
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
|
|
24
|
-
const [trackLabels, setTrackLabels] = useSvgLocal('tracklabels', 'offset');
|
|
25
|
-
const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
|
|
26
|
-
return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Export image", children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingMessage, { format: format })) : null, _jsxs("div", { style: { display: 'flex', alignItems: 'center', gap: 8 }, children: [_jsx(TextField, { helperText: "filename", value: filename, onChange: event => {
|
|
27
|
-
setFilename(event.target.value);
|
|
28
|
-
} }), _jsxs(ToggleButtonGroup, { value: format, exclusive: true, onChange: (_event, value) => {
|
|
29
|
-
if (value) {
|
|
30
|
-
setFormat(value);
|
|
31
|
-
if (filename.endsWith('.svg') && value === 'png') {
|
|
32
|
-
setFilename(filename.replace(/\.svg$/, '.png'));
|
|
33
|
-
}
|
|
34
|
-
else if (filename.endsWith('.png') && value === 'svg') {
|
|
35
|
-
setFilename(filename.replace(/\.png$/, '.svg'));
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}, size: "small", children: [_jsx(ToggleButton, { value: "svg", children: "SVG" }), _jsx(ToggleButton, { value: "png", children: "PNG" })] })] }), _jsxs(TextField2, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => {
|
|
39
|
-
setTrackLabels(event.target.value);
|
|
40
|
-
}, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => {
|
|
41
|
-
setThemeName(event.target.value);
|
|
42
|
-
}, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, _jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: showGridlines, onChange: () => {
|
|
43
|
-
setShowGridlines(val => !val);
|
|
44
|
-
} }), label: "Show gridlines" }), offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
|
|
45
|
-
setRasterizeLayers(val => !val);
|
|
46
|
-
} }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (_jsx(Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
|
|
47
|
-
handleClose();
|
|
48
|
-
}, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
|
|
49
|
-
setLoading(true);
|
|
50
|
-
setError(undefined);
|
|
51
|
-
try {
|
|
52
|
-
await model.exportSvg({
|
|
53
|
-
rasterizeLayers,
|
|
54
|
-
format,
|
|
55
|
-
filename,
|
|
56
|
-
trackLabels,
|
|
57
|
-
themeName,
|
|
58
|
-
showGridlines,
|
|
59
|
-
});
|
|
60
|
-
handleClose();
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
console.error(e);
|
|
64
|
-
setError(e);
|
|
65
|
-
}
|
|
66
|
-
finally {
|
|
67
|
-
setLoading(false);
|
|
68
|
-
}
|
|
69
|
-
}, children: "Submit" })] })] }));
|
|
7
|
+
const [trackLabels, setTrackLabels] = useExportSvgPreference('tracklabels', 'offset');
|
|
8
|
+
const [showGridlines, setShowGridlines] = useExportSvgPreference('gridlines', false);
|
|
9
|
+
return (_jsx(BaseExportSvgDialog, { model: model, handleClose: handleClose, exportSvg: opts => model.exportSvg({ ...opts, trackLabels, showGridlines }), checkboxes: _jsx(LabeledCheckbox, { checked: showGridlines, onChange: val => {
|
|
10
|
+
setShowGridlines(val);
|
|
11
|
+
}, label: "Show gridlines" }), children: _jsxs(TextField, { select: true, label: "Track label positioning", variant: "outlined", style: { minWidth: 200 }, value: trackLabels, onChange: event => {
|
|
12
|
+
setTrackLabels(event.target.value);
|
|
13
|
+
}, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlay", children: "Overlay" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "none", children: "None" })] }) }));
|
|
70
14
|
}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import type { BpOffset } from '../types.ts';
|
|
2
1
|
import type { Region } from '@jbrowse/core/util';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
getSelectedRegions: (left?: BpOffset, right?: BpOffset) => Region[];
|
|
8
|
-
setOffsets: (left?: BpOffset, right?: BpOffset) => void;
|
|
9
|
-
};
|
|
2
|
+
import type { IAnyStateTreeNode } from '@jbrowse/mobx-state-tree';
|
|
3
|
+
declare const GetSequenceDialog: ({ model, regions, handleClose, }: {
|
|
4
|
+
model: IAnyStateTreeNode;
|
|
5
|
+
regions: Region[];
|
|
10
6
|
handleClose: () => void;
|
|
11
|
-
}) => import("react
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
12
8
|
export default GetSequenceDialog;
|
|
@@ -1,101 +1,97 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { Dialog,
|
|
4
|
-
import { complement, reverse, toLocale } from '@jbrowse/core/util';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { CopyToClipboardButton, Dialog, ErrorBanner, LabeledCheckbox, LoadingEllipses, MonospaceTextField, } from '@jbrowse/core/ui';
|
|
4
|
+
import { complement, reverse, statusProgressLabel, toLocale, } from '@jbrowse/core/util';
|
|
5
5
|
import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings';
|
|
6
|
-
import {
|
|
6
|
+
import { useFetch } from '@jbrowse/core/util/useFetch';
|
|
7
7
|
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
8
8
|
import GetAppIcon from '@mui/icons-material/GetApp';
|
|
9
|
-
import { Button,
|
|
9
|
+
import { Button, DialogActions, DialogContent, FormGroup, Typography, } from '@mui/material';
|
|
10
10
|
import { observer } from 'mobx-react';
|
|
11
|
-
import { fetchSequence } from
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const [
|
|
23
|
-
const [
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
11
|
+
import { fetchSequence } from './fetchSequence.js';
|
|
12
|
+
// Guard on the requested span, before fetching, so a whole-chromosome request
|
|
13
|
+
// (easy to trigger now that features/regions can open this) never round-trips
|
|
14
|
+
// megabases just to be display-blocked. Above the display limit the sequence is
|
|
15
|
+
// still downloadable; above the fetch limit it is refused outright.
|
|
16
|
+
//
|
|
17
|
+
// The display limit is in FASTA characters, not bp — it caps what goes into the
|
|
18
|
+
// textarea, which is the formatted output including headers and line breaks.
|
|
19
|
+
const MAX_DISPLAY_CHARS = 1_000_000;
|
|
20
|
+
const MAX_FETCH_BP = 10_000_000;
|
|
21
|
+
const GetSequenceDialog = observer(function GetSequenceDialog({ model, regions, handleClose, }) {
|
|
22
|
+
const [rev, setRev] = useState(false);
|
|
23
|
+
const [comp, setComp] = useState(false);
|
|
24
|
+
const totalBp = regions.reduce((a, r) => a + (r.end - r.start), 0);
|
|
25
|
+
const tooLargeToFetch = totalBp > MAX_FETCH_BP;
|
|
26
|
+
const { data: sequenceChunks, error, isLoading: loading, status, } = useFetch(tooLargeToFetch
|
|
27
|
+
? false
|
|
28
|
+
: [
|
|
29
|
+
'fetchSequence',
|
|
30
|
+
regions.map(r => `${r.refName}:${r.start}-${r.end}`),
|
|
31
|
+
],
|
|
32
|
+
// a selection this dialog will happily take is a whole chromosome of
|
|
33
|
+
// sequence, so both handles are forwarded: closing the dialog stops the
|
|
34
|
+
// read rather than leaving the worker on it, and the wait is named
|
|
35
|
+
async (_name, _locs, stopToken, statusCallback) => {
|
|
36
|
+
if (regions.length === 0) {
|
|
37
|
+
throw new Error('Selected region is out of bounds');
|
|
38
|
+
}
|
|
39
|
+
const chunks = await fetchSequence(model, regions, {
|
|
40
|
+
stopToken,
|
|
41
|
+
statusCallback,
|
|
42
|
+
});
|
|
43
|
+
// validate here (in the async path) so a length mismatch surfaces via the
|
|
44
|
+
// dialog's own ErrorBanner rather than throwing during render
|
|
45
|
+
return chunks.map(chunk => {
|
|
46
|
+
const seq = chunk.get('seq');
|
|
47
|
+
const start = chunk.get('start') + 1;
|
|
48
|
+
const end = chunk.get('end');
|
|
49
|
+
const loc = `${chunk.get('refName')}:${start}-${end}`;
|
|
50
|
+
if (seq.length !== end - start + 1) {
|
|
51
|
+
throw new Error(`${loc} returned ${toLocale(seq.length)} bases, but should have returned ${toLocale(end - start + 1)}`);
|
|
42
52
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
return { loc, seq };
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const entries = sequenceChunks?.map(({ loc, seq }) => {
|
|
57
|
+
const revSeq = rev ? reverse(seq) : seq;
|
|
58
|
+
return {
|
|
59
|
+
header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
|
|
60
|
+
seq: comp ? complement(revSeq) : revSeq,
|
|
46
61
|
};
|
|
47
|
-
}
|
|
48
|
-
const sequence =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
chunkSeq = reverse(chunkSeq);
|
|
60
|
-
}
|
|
61
|
-
if (comp) {
|
|
62
|
-
chunkSeq = complement(chunkSeq);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
header: loc + (rev ? '-rev' : '') + (comp ? '-comp' : ''),
|
|
66
|
-
seq: chunkSeq,
|
|
67
|
-
};
|
|
68
|
-
}))
|
|
69
|
-
: '';
|
|
70
|
-
const sequenceTooLarge = sequence ? sequence.length > 1_000_000 : false;
|
|
62
|
+
}) ?? [];
|
|
63
|
+
const sequence = formatSeqFasta(entries);
|
|
64
|
+
const plainSequence = entries.map(e => e.seq).join('\n');
|
|
65
|
+
const sequenceTooLarge = sequence.length > MAX_DISPLAY_CHARS;
|
|
66
|
+
// What the textarea says instead of a sequence. `tooLargeToFetch` disables the
|
|
67
|
+
// fetch, so without this branch it left an empty box with no loading state, no
|
|
68
|
+
// error and no explanation — and a Download FASTA button that wrote 0 bytes.
|
|
69
|
+
const notice = tooLargeToFetch
|
|
70
|
+
? `Selected region is ${toLocale(totalBp)}bp, over the ${toLocale(MAX_FETCH_BP)}bp limit for fetching a reference sequence. Zoom in or select a smaller region.`
|
|
71
|
+
: sequenceTooLarge
|
|
72
|
+
? 'Reference sequence too large to display, use the download FASTA button'
|
|
73
|
+
: undefined;
|
|
71
74
|
return (_jsxs(Dialog, { maxWidth: "xl", open: true, title: "Reference sequence", onClose: () => {
|
|
72
75
|
handleClose();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
:
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} }), label: "Reverse sequence" }), _jsx(FormControlLabel, { control: _jsx(Checkbox, { value: comp, onChange: event => {
|
|
86
|
-
setComplement(event.target.checked);
|
|
87
|
-
} }), label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: async () => {
|
|
88
|
-
const { default: copy } = await import('copy-to-clipboard');
|
|
89
|
-
copy(sequence);
|
|
90
|
-
setCopied(true);
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
setCopied(false);
|
|
93
|
-
}, 500);
|
|
94
|
-
}, disabled: loading || !!error || sequenceTooLarge, color: "primary", startIcon: _jsx(ContentCopyIcon, {}), children: copied ? 'Copied' : 'Copy to clipboard' }), _jsx(Button, { onClick: async () => {
|
|
95
|
-
const { saveAs } = await import('file-saver-es');
|
|
96
|
-
saveAs(new Blob([sequence || ''], {
|
|
76
|
+
}, children: [_jsxs(DialogContent, { style: { width: '80em' }, children: [error ? (_jsx(ErrorBanner, { error: error })) : loading ? (_jsx(LoadingEllipses, { message: statusProgressLabel(status) || 'Retrieving sequences' })) : null, _jsxs("div", { style: {
|
|
77
|
+
display: 'flex',
|
|
78
|
+
justifyContent: 'flex-end',
|
|
79
|
+
gap: 8,
|
|
80
|
+
marginBottom: 4,
|
|
81
|
+
}, children: [_jsx(CopyToClipboardButton, { value: plainSequence, copiedLabel: "Copied", disabled: !plainSequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy plain text" }), _jsx(CopyToClipboardButton, { value: sequence, copiedLabel: "Copied", disabled: !sequence || sequenceTooLarge, variant: "contained", color: "primary", size: "small", startIcon: _jsx(ContentCopyIcon, {}), children: "Copy FASTA" })] }), _jsx(MonospaceTextField, { fullWidth: true, readOnly: true, minRows: 5, maxRows: 10, disabled: notice !== undefined, value: notice ?? sequence }), _jsxs(FormGroup, { children: [_jsx(LabeledCheckbox, { checked: rev, onChange: val => {
|
|
82
|
+
setRev(val);
|
|
83
|
+
}, label: "Reverse sequence" }), _jsx(LabeledCheckbox, { checked: comp, onChange: val => {
|
|
84
|
+
setComp(val);
|
|
85
|
+
}, label: "Complement sequence" })] }), _jsx(Typography, { style: { margin: 10 }, children: "Note: Check both boxes for the \"reverse complement\"" })] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", onClick: async () => {
|
|
86
|
+
const { saveAs } = await import('@jbrowse/core/util/FileSaver');
|
|
87
|
+
saveAs(new Blob([sequence], {
|
|
97
88
|
type: 'text/x-fasta;charset=utf-8',
|
|
98
89
|
}), 'jbrowse_ref_seq.fa');
|
|
99
|
-
},
|
|
90
|
+
},
|
|
91
|
+
// `!sequence` covers every path with nothing to write: still loading,
|
|
92
|
+
// errored, and the over-fetch-limit refusal
|
|
93
|
+
disabled: !sequence, color: "primary", startIcon: _jsx(GetAppIcon, {}), children: "Download FASTA" }), _jsx(Button, { onClick: () => {
|
|
94
|
+
handleClose();
|
|
95
|
+
}, variant: "contained", children: "Close" })] })] }));
|
|
100
96
|
});
|
|
101
97
|
export default GetSequenceDialog;
|
|
@@ -1,72 +1,43 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
3
3
|
import { observer } from 'mobx-react';
|
|
4
|
-
import
|
|
5
|
-
import { makeTicks } from "../util.js";
|
|
4
|
+
import ZoomTransform from './ZoomTransform.js';
|
|
6
5
|
const useStyles = makeStyles()(theme => ({
|
|
7
|
-
|
|
6
|
+
// top/left stay unset: as an inline-level box the svg takes its static
|
|
7
|
+
// position on a line box, and pinning it to 0 shifts the ticks off the
|
|
8
|
+
// canvas's own grid
|
|
9
|
+
absoluteFill: {
|
|
8
10
|
position: 'absolute',
|
|
9
|
-
top: 0,
|
|
10
|
-
height: '100%',
|
|
11
11
|
width: '100%',
|
|
12
|
-
pointerEvents: 'none',
|
|
13
|
-
},
|
|
14
|
-
verticalGuidesContainer: {
|
|
15
|
-
position: 'absolute',
|
|
16
|
-
height: '100%',
|
|
17
|
-
pointerEvents: 'none',
|
|
18
|
-
display: 'flex',
|
|
19
|
-
},
|
|
20
|
-
tick: {
|
|
21
|
-
position: 'absolute',
|
|
22
12
|
height: '100%',
|
|
23
|
-
width: 1,
|
|
24
13
|
},
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
minorLine: {
|
|
15
|
+
stroke: theme.palette.gridlineMinor,
|
|
27
16
|
},
|
|
28
|
-
|
|
29
|
-
|
|
17
|
+
majorLine: {
|
|
18
|
+
stroke: theme.palette.gridlineMajor,
|
|
30
19
|
},
|
|
31
20
|
}));
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return (_jsx(ContentBlockComponent, { block: block, children: ticks.map(({ type, base }) => {
|
|
39
|
-
const x = (reversed ? end - base : base - start) / bpPerPx;
|
|
40
|
-
return (_jsx("div", { className: type === 'major' || type === 'labeledMajor'
|
|
41
|
-
? majorTickClass
|
|
42
|
-
: minorTickClass, style: { left: x } }, base));
|
|
43
|
-
}) }));
|
|
44
|
-
}
|
|
45
|
-
const RenderedVerticalGuides = observer(function RenderedVerticalGuides({ model, }) {
|
|
46
|
-
const { staticBlocks, bpPerPx } = model;
|
|
47
|
-
return (_jsx(_Fragment, { children: staticBlocks.map((block, index) => {
|
|
48
|
-
const k = `${block.key}-${index}`;
|
|
49
|
-
if (block.type === 'ContentBlock') {
|
|
50
|
-
return _jsx(RenderedBlockLines, { block: block, bpPerPx: bpPerPx }, k);
|
|
51
|
-
}
|
|
52
|
-
else if (block.type === 'ElidedBlock') {
|
|
53
|
-
return _jsx(ElidedBlockComponent, { width: block.widthPx }, k);
|
|
54
|
-
}
|
|
55
|
-
else if (block.type === 'InterRegionPaddingBlock') {
|
|
56
|
-
return (_jsx(InterRegionPaddingBlockComponent, { width: block.widthPx, boundary: block.variant === 'boundary' }, k));
|
|
57
|
-
}
|
|
58
|
-
return null;
|
|
59
|
-
}) }));
|
|
60
|
-
});
|
|
21
|
+
// Background gridline ticks; render UNDER track content. Tick marks collapse
|
|
22
|
+
// into two <path>s (minor + major) rather than one div each: zoom rebuilds two
|
|
23
|
+
// `d` strings and patches two attributes instead of reconciling ~150 nodes per
|
|
24
|
+
// frame. Vector stays crisp at any DPR with no canvas pixel-buffer size cap;
|
|
25
|
+
// +0.5 centers the 1px stroke on a pixel column to match the old divs; lines
|
|
26
|
+
// run to y=100000 and are clipped by the svg box, so we never measure height.
|
|
61
27
|
const Gridlines = observer(function Gridlines({ model, offset = 0, }) {
|
|
62
28
|
const { classes } = useStyles();
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
29
|
+
const { gridlineTicks } = model;
|
|
30
|
+
let minorD = '';
|
|
31
|
+
let majorD = '';
|
|
32
|
+
for (const { x, major } of gridlineTicks) {
|
|
33
|
+
const seg = `M${x + 0.5} 0V100000`;
|
|
34
|
+
if (major) {
|
|
35
|
+
majorD += seg;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
minorD += seg;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return (_jsx(ZoomTransform, { model: model, offset: offset, children: _jsxs("svg", { className: classes.absoluteFill, children: [_jsx("path", { d: minorD, className: classes.minorLine, strokeWidth: 1 }), _jsx("path", { d: majorD, className: classes.majorLine, strokeWidth: 1 })] }) }));
|
|
71
42
|
});
|
|
72
43
|
export default Gridlines;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
2
|
declare const LinearGenomeViewHeader: ({ model, }: {
|
|
3
3
|
model: LinearGenomeViewModel;
|
|
4
|
-
}) => import("react
|
|
4
|
+
}) => import("react").JSX.Element | null;
|
|
5
5
|
export default LinearGenomeViewHeader;
|