@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/FeatureTrack/configSchema.d.ts +202 -71
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +265 -120
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +20 -9
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +142 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +8 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +42 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +18 -8
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +38 -52
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +21 -25
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +13 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -6
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +14 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +25 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +87 -83
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +56 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
- package/esm/LinearGenomeView/components/Rubberband.js +15 -17
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
- package/esm/LinearGenomeView/components/Scalebar.js +20 -22
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +61 -68
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
- package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
- package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
- package/esm/LinearGenomeView/components/util.d.ts +24 -6
- package/esm/LinearGenomeView/components/util.js +28 -5
- package/esm/LinearGenomeView/consts.d.ts +9 -2
- package/esm/LinearGenomeView/consts.js +20 -2
- package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
- package/esm/LinearGenomeView/containingLgv.js +23 -0
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +29 -0
- package/esm/LinearGenomeView/headerFit.js +72 -0
- package/esm/LinearGenomeView/index.d.ts +28 -3
- package/esm/LinearGenomeView/index.js +13 -7
- package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
- package/esm/LinearGenomeView/keyboardHandler.js +25 -1
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +27 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
- package/esm/LinearGenomeView/lazyDialogs.js +4 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
- package/esm/LinearGenomeView/linkedViewSync.js +36 -0
- package/esm/LinearGenomeView/menuItems.d.ts +25 -2
- package/esm/LinearGenomeView/menuItems.js +306 -179
- package/esm/LinearGenomeView/model.d.ts +3363 -164
- package/esm/LinearGenomeView/model.js +2548 -565
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
- package/esm/LinearGenomeView/stickyChrome.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
- package/esm/LinearGenomeView/types.d.ts +20 -37
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +347 -12
- package/esm/LinearGenomeView/util.js +577 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
- package/esm/MultiLevelRubberband/index.d.ts +4 -0
- package/esm/MultiLevelRubberband/index.js +3 -0
- package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
- package/esm/MultiLevelRubberband/menuItems.js +52 -0
- package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
- package/esm/MultiLevelRubberband/rowLabel.js +27 -0
- package/esm/MultiLevelRubberband/types.d.ts +7 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
- package/esm/displayKitTests/perRegionTestEnv.js +142 -0
- package/esm/index.d.ts +50 -1245
- package/esm/index.js +88 -33
- package/esm/searchUtils.d.ts +62 -12
- package/esm/searchUtils.js +335 -48
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +34 -0
- package/esm/shared/coordLabels.d.ts +47 -0
- package/esm/shared/coordLabels.js +133 -0
- package/esm/shared/useWindowDrag.d.ts +18 -0
- package/esm/shared/useWindowDrag.js +45 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { LabeledCheckbox } from '@jbrowse/core/ui';
|
|
4
|
+
import { IUPAC_MOTIF_REGEX } from '@jbrowse/core/util';
|
|
5
|
+
import { makeStyles } from '@jbrowse/core/util/tss-react';
|
|
6
|
+
import { MenuItem, TextField, ToggleButton, ToggleButtonGroup, Typography, } from '@mui/material';
|
|
7
|
+
import { observer } from 'mobx-react';
|
|
8
|
+
import SearchPanelForm from './SearchPanelForm.js';
|
|
9
|
+
import StrandCheckboxes from './StrandCheckboxes.js';
|
|
10
|
+
import { addReferenceScanTrack } from './searchModes.js';
|
|
11
|
+
const useStyles = makeStyles()({
|
|
12
|
+
row: {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
gap: 12,
|
|
15
|
+
'& > *': {
|
|
16
|
+
flex: 1,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
toggleRow: {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
alignItems: 'center',
|
|
22
|
+
gap: 12,
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
// PAM 3' of the protospacer for Cas9-type enzymes, 5' for Cas12a. The two cut
|
|
26
|
+
// offsets are bp from the PAM-proximal end of the protospacer to each strand's
|
|
27
|
+
// cut: equal for a blunt cutter, staggered for Cas12a, which leaves a 5-nt 5'
|
|
28
|
+
// overhang.
|
|
29
|
+
const ENZYME_PRESETS = {
|
|
30
|
+
SpCas9: {
|
|
31
|
+
pam: 'NGG',
|
|
32
|
+
guideLength: 20,
|
|
33
|
+
pamLocation: '3prime',
|
|
34
|
+
cutOffset: 3,
|
|
35
|
+
cutOffsetBottom: 3,
|
|
36
|
+
},
|
|
37
|
+
SaCas9: {
|
|
38
|
+
pam: 'NNGRRT',
|
|
39
|
+
guideLength: 21,
|
|
40
|
+
pamLocation: '3prime',
|
|
41
|
+
cutOffset: 3,
|
|
42
|
+
cutOffsetBottom: 3,
|
|
43
|
+
},
|
|
44
|
+
'Cas12a (Cpf1)': {
|
|
45
|
+
pam: 'TTTV',
|
|
46
|
+
guideLength: 23,
|
|
47
|
+
pamLocation: '5prime',
|
|
48
|
+
cutOffset: 18,
|
|
49
|
+
cutOffsetBottom: 23,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
// The one filter preset the panel offers. The adapter's slots are a free GC
|
|
53
|
+
// range plus a poly-T flag; these are the conventional cutoffs, named in the
|
|
54
|
+
// checkbox label so the numbers aren't hidden behind a word like "usable".
|
|
55
|
+
const GC_FILTER = { minGcPercent: 40, maxGcPercent: 60 };
|
|
56
|
+
const NO_FILTER = { minGcPercent: 0, maxGcPercent: 100 };
|
|
57
|
+
const DEFAULT_ENZYME = 'SpCas9';
|
|
58
|
+
const DEFAULT_PRESET = ENZYME_PRESETS[DEFAULT_ENZYME];
|
|
59
|
+
const toBpCount = (str) => (str.trim() ? Number(str) : Number.NaN);
|
|
60
|
+
const CrisprGuidePanel = observer(function CrisprGuidePanel({ model, handleClose, }) {
|
|
61
|
+
const { classes } = useStyles();
|
|
62
|
+
const [enzyme, setEnzyme] = useState(DEFAULT_ENZYME);
|
|
63
|
+
const [pam, setPam] = useState(DEFAULT_PRESET.pam);
|
|
64
|
+
const [pamLocation, setPamLocation] = useState(DEFAULT_PRESET.pamLocation);
|
|
65
|
+
const [guideLengthStr, setGuideLengthStr] = useState(String(DEFAULT_PRESET.guideLength));
|
|
66
|
+
const [cutOffsetStr, setCutOffsetStr] = useState(String(DEFAULT_PRESET.cutOffset));
|
|
67
|
+
const [searchForward, setSearchForward] = useState(true);
|
|
68
|
+
const [searchReverse, setSearchReverse] = useState(true);
|
|
69
|
+
const [filterQuality, setFilterQuality] = useState(false);
|
|
70
|
+
// `Number('')` is 0, so an emptied field would otherwise read as a valid zero
|
|
71
|
+
const guideLength = toBpCount(guideLengthStr);
|
|
72
|
+
const cutOffset = toBpCount(cutOffsetStr);
|
|
73
|
+
// Custom is a blunt cutter: config can express a staggered one directly
|
|
74
|
+
const cutOffsetBottom = ENZYME_PRESETS[enzyme]?.cutOffsetBottom ?? cutOffset;
|
|
75
|
+
// both are bp counts used for fixed-length string slicing, so a fractional
|
|
76
|
+
// value would silently truncate and skew the placement
|
|
77
|
+
const guideLengthValid = Number.isInteger(guideLength) && guideLength > 0;
|
|
78
|
+
// a cut beyond either end of the protospacer draws its tick outside the glyph
|
|
79
|
+
// that is supposed to carry it, and outside the box that can be clicked
|
|
80
|
+
const cutOffsetValid = Number.isInteger(cutOffset) && cutOffset >= 0 && cutOffset <= guideLength;
|
|
81
|
+
// each PAM position must be a single IUPAC code (one base); other characters
|
|
82
|
+
// would leak into the match regex and break the fixed-length placement
|
|
83
|
+
const pamValid = IUPAC_MOTIF_REGEX.test(pam);
|
|
84
|
+
const canSubmit = pamValid &&
|
|
85
|
+
guideLengthValid &&
|
|
86
|
+
cutOffsetValid &&
|
|
87
|
+
(searchForward || searchReverse);
|
|
88
|
+
// a staggered cutter shows both offsets, e.g. "cut 18/23 bp from PAM"
|
|
89
|
+
const cutSummary = cutOffsetBottom === cutOffset
|
|
90
|
+
? cutOffset
|
|
91
|
+
: `${cutOffset}/${cutOffsetBottom}`;
|
|
92
|
+
const presetSummary = ENZYME_PRESETS[enzyme]
|
|
93
|
+
? `PAM ${pam} · ${guideLength} bp guide · cut ${cutSummary} bp from PAM`
|
|
94
|
+
: 'Set a custom PAM and geometry below';
|
|
95
|
+
function applyPreset(name) {
|
|
96
|
+
setEnzyme(name);
|
|
97
|
+
const preset = ENZYME_PRESETS[name];
|
|
98
|
+
if (preset) {
|
|
99
|
+
setPam(preset.pam);
|
|
100
|
+
setPamLocation(preset.pamLocation);
|
|
101
|
+
setGuideLengthStr(String(preset.guideLength));
|
|
102
|
+
setCutOffsetStr(String(preset.cutOffset));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
function handleSubmit() {
|
|
106
|
+
addReferenceScanTrack(model, {
|
|
107
|
+
trackId: `crispr_guides_${Date.now()}`,
|
|
108
|
+
name: enzyme === 'Custom'
|
|
109
|
+
? `CRISPR guides ${pam}`
|
|
110
|
+
: `CRISPR guides ${enzyme} (${pam})`,
|
|
111
|
+
adapter: {
|
|
112
|
+
type: 'CrisprGuideAdapter',
|
|
113
|
+
pam,
|
|
114
|
+
guideLength,
|
|
115
|
+
pamLocation,
|
|
116
|
+
cutOffset,
|
|
117
|
+
cutOffsetBottom,
|
|
118
|
+
searchForward,
|
|
119
|
+
searchReverse,
|
|
120
|
+
excludePolyT: filterQuality,
|
|
121
|
+
...(filterQuality ? GC_FILTER : NO_FILTER),
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
handleClose();
|
|
125
|
+
}
|
|
126
|
+
return (_jsxs(SearchPanelForm, { onSubmit: handleSubmit, handleClose: handleClose, submitDisabled: !canSubmit, children: [_jsx(TextField, { select: true, variant: "outlined", size: "small", label: "Enzyme", value: enzyme, helperText: presetSummary, onChange: event => {
|
|
127
|
+
applyPreset(event.target.value);
|
|
128
|
+
}, children: [...Object.keys(ENZYME_PRESETS), 'Custom'].map(name => (_jsx(MenuItem, { value: name, children: name }, name))) }), enzyme === 'Custom' ? (_jsxs(_Fragment, { children: [_jsx(TextField, { size: "small", label: "PAM (IUPAC)", value: pam, error: !pamValid, helperText: pamValid ? undefined : 'Use IUPAC codes only', onChange: event => {
|
|
129
|
+
setPam(event.target.value.toUpperCase());
|
|
130
|
+
} }), _jsxs("div", { className: classes.row, children: [_jsx(TextField, { size: "small", label: "Guide length (bp)", value: guideLengthStr, error: !guideLengthValid, helperText: guideLengthValid ? undefined : 'A whole number of bp', onChange: event => {
|
|
131
|
+
setGuideLengthStr(event.target.value);
|
|
132
|
+
} }), _jsx(TextField, { size: "small", label: "Cut offset (bp)", value: cutOffsetStr, error: !cutOffsetValid, helperText: cutOffsetValid ? undefined : 'bp from the PAM, within the guide', onChange: event => {
|
|
133
|
+
setCutOffsetStr(event.target.value);
|
|
134
|
+
} })] }), _jsxs("div", { className: classes.toggleRow, children: [_jsx(Typography, { variant: "body2", color: "textSecondary", children: "PAM location" }), _jsxs(ToggleButtonGroup, { exclusive: true, size: "small", value: pamLocation, onChange: (_event, value) => {
|
|
135
|
+
if (value) {
|
|
136
|
+
setPamLocation(value);
|
|
137
|
+
}
|
|
138
|
+
}, children: [_jsx(ToggleButton, { value: "3prime", children: "3\u2032 (Cas9)" }), _jsx(ToggleButton, { value: "5prime", children: "5\u2032 (Cas12a)" })] })] })] })) : null, _jsx(StrandCheckboxes, { searchForward: searchForward, searchReverse: searchReverse, setSearchForward: setSearchForward, setSearchReverse: setSearchReverse }), _jsx(LabeledCheckbox, { size: "small", checked: filterQuality, onChange: val => {
|
|
139
|
+
setFilterQuality(val);
|
|
140
|
+
}, label: "Keep only guides with 40-60% GC and no poly-T run" })] }));
|
|
141
|
+
});
|
|
142
|
+
export default CrisprGuidePanel;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Cytoband } from './util.ts';
|
|
2
|
+
import type { ViewLayout } from '@jbrowse/core/util/Base1DUtils';
|
|
3
3
|
import type { ContentBlock } from '@jbrowse/core/util/blockTypes';
|
|
4
|
-
declare const Cytobands: ({ overview, block,
|
|
5
|
-
overview:
|
|
6
|
-
|
|
4
|
+
declare const Cytobands: ({ overview, block, cytobands, }: {
|
|
5
|
+
overview: ViewLayout;
|
|
6
|
+
cytobands: Cytoband[];
|
|
7
7
|
block: ContentBlock;
|
|
8
|
-
}) => import("react
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
9
|
export default Cytobands;
|
|
@@ -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,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TrackLabelMode, ViewTrackLabelMode } from '../types.ts';
|
|
2
|
+
import type { BaseExportSvgOptions } from '@jbrowse/core/ui';
|
|
2
3
|
export default function ExportSvgDialog({ model, handleClose, }: {
|
|
3
4
|
model: {
|
|
4
|
-
|
|
5
|
+
effectiveTrackLabels?: ViewTrackLabelMode;
|
|
6
|
+
exportSvg(opts: BaseExportSvgOptions & {
|
|
7
|
+
trackLabels: TrackLabelMode;
|
|
8
|
+
showGridlines: boolean;
|
|
9
|
+
}): Promise<unknown>;
|
|
5
10
|
};
|
|
6
11
|
handleClose: () => void;
|
|
7
|
-
}): import("react
|
|
12
|
+
}): import("react").JSX.Element;
|
|
@@ -1,70 +1,18 @@
|
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const [
|
|
21
|
-
const [
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
// The view's own setting is already an export mode, so a user who has not
|
|
8
|
+
// picked one here gets the figure their screen shows. The key is `-mode`
|
|
9
|
+
// because the modes were once spelled `overlay`/`none`, and a stored one of
|
|
10
|
+
// those would select nothing in the dropdown.
|
|
11
|
+
const [trackLabels, setTrackLabels] = useExportSvgPreference('tracklabels-mode', model.effectiveTrackLabels ?? 'offset');
|
|
12
|
+
const [showGridlines, setShowGridlines] = useExportSvgPreference('gridlines', false);
|
|
13
|
+
return (_jsx(BaseExportSvgDialog, { model: model, handleClose: handleClose, exportSvg: opts => model.exportSvg({ ...opts, trackLabels, showGridlines }), checkboxes: _jsx(LabeledCheckbox, { checked: showGridlines, onChange: val => {
|
|
14
|
+
setShowGridlines(val);
|
|
15
|
+
}, label: "Show gridlines" }), children: _jsxs(TextField, { select: true, label: "Track label positioning", variant: "outlined", style: { minWidth: 200 }, value: trackLabels, onChange: event => {
|
|
16
|
+
setTrackLabels(event.target.value);
|
|
17
|
+
}, children: [_jsx(MenuItem, { value: "offset", children: "Offset" }), _jsx(MenuItem, { value: "overlapping", children: "Overlapping" }), _jsx(MenuItem, { value: "left", children: "Left" }), _jsx(MenuItem, { value: "hidden", children: "Hidden" })] }) }));
|
|
70
18
|
}
|
|
@@ -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;
|