@jbrowse/plugin-linear-genome-view 4.3.0 → 5.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/FeatureTrack/configSchema.d.ts +202 -71
- package/esm/FeatureTrack/configSchema.js +47 -1
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +14 -0
- package/esm/LaunchLinearGenomeView/index.js +6 -12
- package/esm/LinearGenomeView/afterAttach.d.ts +20 -2
- package/esm/LinearGenomeView/afterAttach.js +265 -120
- package/esm/LinearGenomeView/components/CenterLine.d.ts +1 -1
- package/esm/LinearGenomeView/components/CenterLine.js +20 -9
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/ConnectedHoverHighlight.js +22 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/CrisprGuidePanel.js +142 -0
- package/esm/LinearGenomeView/components/Cytobands.d.ts +6 -6
- package/esm/LinearGenomeView/components/Cytobands.js +76 -53
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +8 -3
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +15 -67
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +5 -9
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +84 -88
- package/esm/LinearGenomeView/components/Gridlines.d.ts +1 -1
- package/esm/LinearGenomeView/components/Gridlines.js +29 -58
- package/esm/LinearGenomeView/components/Header.d.ts +1 -1
- package/esm/LinearGenomeView/components/Header.js +42 -16
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.d.ts +21 -0
- package/esm/LinearGenomeView/components/HeaderClearHighlightButton.js +35 -0
- package/esm/LinearGenomeView/components/HeaderPanControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderPanControls.js +18 -8
- package/esm/LinearGenomeView/components/HeaderRegionWidth.d.ts +1 -1
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +9 -6
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.d.ts +6 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxRow.js +27 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.d.ts +5 -0
- package/esm/LinearGenomeView/components/HeaderSearchBoxes.js +28 -0
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +11 -4
- package/esm/LinearGenomeView/components/HeaderZoomControls.d.ts +3 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +38 -52
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +21 -25
- package/esm/LinearGenomeView/components/HighlightBand.d.ts +3 -2
- package/esm/LinearGenomeView/components/HighlightBand.js +25 -8
- package/esm/LinearGenomeView/components/HighlightChip.d.ts +8 -0
- package/esm/LinearGenomeView/components/HighlightChip.js +13 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.d.ts +12 -0
- package/esm/LinearGenomeView/components/HoverPositionHighlight.js +25 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +3 -4
- package/esm/LinearGenomeView/components/ImportForm.js +95 -61
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -6
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +88 -30
- package/esm/LinearGenomeView/components/MiniControls.d.ts +1 -1
- package/esm/LinearGenomeView/components/MiniControls.js +14 -10
- package/esm/LinearGenomeView/components/MotifListPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/MotifListPanel.js +59 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.d.ts +32 -0
- package/esm/LinearGenomeView/components/NavigationAnnouncer.js +51 -0
- package/esm/LinearGenomeView/components/NoTracksActiveButton.d.ts +1 -1
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +2 -4
- package/esm/LinearGenomeView/components/OverviewHighlight.js +23 -44
- package/esm/LinearGenomeView/components/OverviewHighlightBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlightBand.js +25 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +3 -3
- package/esm/LinearGenomeView/components/OverviewRubberband.js +29 -67
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +13 -20
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +3 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +87 -83
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +19 -5
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +57 -32
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +4 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +16 -18
- package/esm/LinearGenomeView/components/PaddingBlocks.d.ts +7 -0
- package/esm/LinearGenomeView/components/PaddingBlocks.js +56 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.d.ts +9 -0
- package/esm/LinearGenomeView/components/RangeSelectOverlay.js +19 -0
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +2 -3
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +19 -26
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.d.ts +5 -0
- package/esm/LinearGenomeView/components/ResizeAllTracksHandle.js +71 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +2 -3
- package/esm/LinearGenomeView/components/Rubberband.js +15 -17
- package/esm/LinearGenomeView/components/SVGHighlightBand.d.ts +10 -0
- package/esm/LinearGenomeView/components/SVGHighlightBand.js +8 -0
- package/esm/LinearGenomeView/components/Scalebar.d.ts +2 -6
- package/esm/LinearGenomeView/components/Scalebar.js +20 -22
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +54 -35
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +157 -126
- package/esm/LinearGenomeView/components/SearchBox.d.ts +22 -2
- package/esm/LinearGenomeView/components/SearchBox.js +61 -68
- package/esm/LinearGenomeView/components/SearchPanelForm.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchPanelForm.js +18 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +5 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +6 -8
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +5 -3
- package/esm/LinearGenomeView/components/SearchResultsTable.js +31 -56
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.d.ts +5 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlight.js +37 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.d.ts +2 -0
- package/esm/LinearGenomeView/components/SequenceFeatureHoverHighlightExtension.js +5 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.d.ts +3 -0
- package/esm/LinearGenomeView/components/SequencePatternPanel.js +42 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +3 -5
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +31 -53
- package/esm/LinearGenomeView/components/StrandCheckboxes.d.ts +8 -0
- package/esm/LinearGenomeView/components/StrandCheckboxes.js +13 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +136 -38
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +2 -3
- package/esm/LinearGenomeView/components/TrackLabel.js +20 -26
- package/esm/LinearGenomeView/components/TrackLabelButtons.d.ts +7 -0
- package/esm/LinearGenomeView/components/TrackLabelButtons.js +33 -0
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.d.ts +2 -5
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +6 -2
- package/esm/LinearGenomeView/components/TrackLabelMenu.d.ts +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +35 -87
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.d.ts +22 -0
- package/esm/LinearGenomeView/components/TrackLabelRefNameWarning.js +46 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +5 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +66 -24
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +53 -32
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -3
- package/esm/LinearGenomeView/components/VerticalGuide.js +6 -26
- package/esm/LinearGenomeView/components/ZoomButton.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomButton.js +27 -0
- package/esm/LinearGenomeView/components/ZoomTransform.d.ts +9 -0
- package/esm/LinearGenomeView/components/ZoomTransform.js +37 -0
- package/esm/LinearGenomeView/components/defaultMotifs.d.ts +1 -0
- package/esm/LinearGenomeView/components/defaultMotifs.js +22 -0
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +6 -8
- package/esm/LinearGenomeView/components/fetchSequence.js +17 -9
- package/esm/LinearGenomeView/components/recentLocationsMenu.d.ts +15 -0
- package/esm/LinearGenomeView/components/recentLocationsMenu.js +46 -0
- package/esm/LinearGenomeView/components/searchModes.d.ts +13 -0
- package/esm/LinearGenomeView/components/searchModes.js +22 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.d.ts +7 -0
- package/esm/LinearGenomeView/components/trackLabelMenuItems.js +67 -0
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +9 -67
- package/esm/LinearGenomeView/components/useRangeSelect.js +54 -102
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.d.ts +26 -0
- package/esm/LinearGenomeView/components/useSearchBoxPrefs.js +58 -0
- package/esm/LinearGenomeView/components/useSideScroll.d.ts +17 -3
- package/esm/LinearGenomeView/components/useSideScroll.js +163 -45
- package/esm/LinearGenomeView/components/util.d.ts +24 -6
- package/esm/LinearGenomeView/components/util.js +28 -5
- package/esm/LinearGenomeView/consts.d.ts +9 -2
- package/esm/LinearGenomeView/consts.js +20 -2
- package/esm/LinearGenomeView/containingLgv.d.ts +21 -0
- package/esm/LinearGenomeView/containingLgv.js +23 -0
- package/esm/LinearGenomeView/flyTo.d.ts +38 -0
- package/esm/LinearGenomeView/flyTo.js +135 -0
- package/esm/LinearGenomeView/headerFit.d.ts +29 -0
- package/esm/LinearGenomeView/headerFit.js +72 -0
- package/esm/LinearGenomeView/index.d.ts +28 -3
- package/esm/LinearGenomeView/index.js +13 -7
- package/esm/LinearGenomeView/keyboardHandler.d.ts +9 -0
- package/esm/LinearGenomeView/keyboardHandler.js +25 -1
- package/esm/LinearGenomeView/launchKeys.d.ts +2 -0
- package/esm/LinearGenomeView/launchKeys.js +27 -0
- package/esm/LinearGenomeView/lazyDialogs.d.ts +8 -14
- package/esm/LinearGenomeView/lazyDialogs.js +4 -3
- package/esm/LinearGenomeView/linkedViewSync.d.ts +12 -0
- package/esm/LinearGenomeView/linkedViewSync.js +36 -0
- package/esm/LinearGenomeView/menuItems.d.ts +25 -2
- package/esm/LinearGenomeView/menuItems.js +306 -179
- package/esm/LinearGenomeView/model.d.ts +3363 -164
- package/esm/LinearGenomeView/model.js +2548 -565
- package/esm/LinearGenomeView/sharedScaleContainer.d.ts +18 -0
- package/esm/LinearGenomeView/sharedScaleContainer.js +17 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.d.ts +35 -0
- package/esm/LinearGenomeView/showRegionsWithUndo.js +50 -0
- package/esm/LinearGenomeView/stickyChrome.d.ts +15 -0
- package/esm/LinearGenomeView/stickyChrome.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +17 -18
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +34 -35
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlights.js +26 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.d.ts +5 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHighlightsOverlay.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +1 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +73 -41
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +20 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.d.ts +8 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRowHeader.js +36 -0
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +3 -3
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +66 -39
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.js +9 -7
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.d.ts +27 -0
- package/esm/LinearGenomeView/svgcomponents/SVGStackedRow.js +12 -0
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +5 -3
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +54 -9
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +9 -15
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +17 -21
- package/esm/LinearGenomeView/svgcomponents/SVGView.d.ts +18 -0
- package/esm/LinearGenomeView/svgcomponents/SVGView.js +13 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.d.ts +45 -0
- package/esm/LinearGenomeView/svgcomponents/figureContract.js +130 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.d.ts +76 -0
- package/esm/LinearGenomeView/svgcomponents/renderViewTracks.js +66 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.d.ts +70 -0
- package/esm/LinearGenomeView/svgcomponents/useViewSvgFigure.js +245 -0
- package/esm/LinearGenomeView/svgcomponents/util.d.ts +96 -5
- package/esm/LinearGenomeView/svgcomponents/util.js +242 -4
- package/esm/LinearGenomeView/types.d.ts +20 -37
- package/esm/LinearGenomeView/types.js +1 -0
- package/esm/LinearGenomeView/util.d.ts +347 -12
- package/esm/LinearGenomeView/util.js +577 -62
- package/esm/MultiLevelRubberband/MultiLevelRubberband.d.ts +6 -0
- package/esm/MultiLevelRubberband/MultiLevelRubberband.js +40 -0
- package/esm/MultiLevelRubberband/index.d.ts +4 -0
- package/esm/MultiLevelRubberband/index.js +3 -0
- package/esm/MultiLevelRubberband/menuItems.d.ts +34 -0
- package/esm/MultiLevelRubberband/menuItems.js +52 -0
- package/esm/MultiLevelRubberband/rowLabel.d.ts +22 -0
- package/esm/MultiLevelRubberband/rowLabel.js +27 -0
- package/esm/MultiLevelRubberband/types.d.ts +7 -0
- package/esm/MultiLevelRubberband/useRangeSelect.d.ts +25 -0
- package/esm/MultiLevelRubberband/useRangeSelect.js +120 -0
- package/esm/displayKitTests/perRegionTestEnv.d.ts +1391 -0
- package/esm/displayKitTests/perRegionTestEnv.js +142 -0
- package/esm/index.d.ts +50 -1245
- package/esm/index.js +88 -33
- package/esm/searchUtils.d.ts +62 -12
- package/esm/searchUtils.js +335 -48
- package/esm/shared/RubberbandSpan.d.ts +15 -0
- package/esm/shared/RubberbandSpan.js +34 -0
- package/esm/shared/coordLabels.d.ts +47 -0
- package/esm/shared/coordLabels.js +133 -0
- package/esm/shared/useWindowDrag.d.ts +18 -0
- package/esm/shared/useWindowDrag.js +45 -0
- package/package.json +18 -19
- package/esm/BaseLinearDisplay/SVGLegend.d.ts +0 -6
- package/esm/BaseLinearDisplay/SVGLegend.js +0 -17
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +0 -2
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +0 -11
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -53
- package/esm/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/esm/BaseLinearDisplay/components/Block.js +0 -45
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +0 -22
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockMsg.js +0 -26
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +0 -9
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +0 -42
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +0 -11
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +0 -40
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +0 -19
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +0 -45
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +0 -75
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +0 -43
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +0 -23
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +0 -5
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +0 -49
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +0 -4
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +0 -26
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +0 -8
- package/esm/BaseLinearDisplay/components/MenuPage.js +0 -24
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +0 -52
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +0 -22
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -12
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -18
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +0 -20
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +0 -13
- package/esm/BaseLinearDisplay/components/Tooltip.js +0 -22
- package/esm/BaseLinearDisplay/components/types.d.ts +0 -1
- package/esm/BaseLinearDisplay/components/util.d.ts +0 -21
- package/esm/BaseLinearDisplay/components/util.js +0 -107
- package/esm/BaseLinearDisplay/index.d.ts +0 -17
- package/esm/BaseLinearDisplay/index.js +0 -13
- package/esm/BaseLinearDisplay/model.d.ts +0 -1197
- package/esm/BaseLinearDisplay/model.js +0 -432
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -113
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +0 -26
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +0 -57
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.d.ts +0 -8
- package/esm/BaseLinearDisplay/models/SvgFloatingLabels.js +0 -19
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +0 -31
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/esm/BaseLinearDisplay/models/configSchema.js +0 -33
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -98
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -242
- package/esm/BaseLinearDisplay/models/util.d.ts +0 -9
- package/esm/BaseLinearDisplay/models/util.js +0 -43
- package/esm/BaseLinearDisplay/renderSvg.d.ts +0 -3
- package/esm/BaseLinearDisplay/renderSvg.js +0 -63
- package/esm/BaseLinearDisplay/types.d.ts +0 -43
- package/esm/BaseLinearDisplay/types.js +0 -3
- package/esm/BaseLinearDisplay/util.d.ts +0 -16
- package/esm/BaseLinearDisplay/util.js +0 -71
- package/esm/BasicTrack/configSchema.d.ts +0 -85
- package/esm/BasicTrack/configSchema.js +0 -8
- package/esm/BasicTrack/index.d.ts +0 -2
- package/esm/BasicTrack/index.js +0 -12
- package/esm/LinearBareDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBareDisplay/configSchema.js +0 -11
- package/esm/LinearBareDisplay/index.d.ts +0 -4
- package/esm/LinearBareDisplay/index.js +0 -20
- package/esm/LinearBareDisplay/model.d.ts +0 -1196
- package/esm/LinearBareDisplay/model.js +0 -32
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +0 -5
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +0 -9
- package/esm/LinearBasicDisplay/configSchema.d.ts +0 -32
- package/esm/LinearBasicDisplay/configSchema.js +0 -11
- package/esm/LinearBasicDisplay/index.d.ts +0 -4
- package/esm/LinearBasicDisplay/index.js +0 -20
- package/esm/LinearBasicDisplay/model.d.ts +0 -1391
- package/esm/LinearBasicDisplay/model.js +0 -158
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearFeatureDisplay/components/AddFiltersDialog.js +0 -58
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearFeatureDisplay/components/SetMaxHeightDialog.js +0 -26
- package/esm/LinearFeatureDisplay/configSchema.d.ts +0 -32
- package/esm/LinearFeatureDisplay/configSchema.js +0 -11
- package/esm/LinearFeatureDisplay/index.d.ts +0 -3
- package/esm/LinearFeatureDisplay/index.js +0 -2
- package/esm/LinearFeatureDisplay/model.d.ts +0 -1443
- package/esm/LinearFeatureDisplay/model.js +0 -305
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +0 -5
- package/esm/LinearGenomeView/SVGErrorBox.js +0 -4
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -27
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -5
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -13
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -17
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -8
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -101
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -45
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/esm/LinearGenomeView/components/RubberbandSpan.js +0 -32
- package/esm/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/esm/LinearGenomeView/components/RubberbandTooltip.js +0 -17
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +0 -25
- package/esm/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/esm/LinearGenomeView/components/useWheelScroll.js +0 -69
- package/esm/LinearGenomeView/svgExportUtil.d.ts +0 -9
- package/esm/LinearGenomeView/svgExportUtil.js +0 -6
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.js +0 -7
- /package/esm/{BaseLinearDisplay/components → MultiLevelRubberband}/types.js +0 -0
|
@@ -1,41 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
3
|
+
import { svgNodeId } from '@jbrowse/core/svg/svgId';
|
|
4
|
+
import { usePalette } from '@jbrowse/core/ui/PaletteContext';
|
|
5
|
+
import { stripAlpha } from '@jbrowse/core/util';
|
|
6
|
+
import { REF_NAME_LABEL_FONT_SIZE, TICK_LABEL_FONT_SIZE, getScalebarRefNameLabels, labelFitsInBlock, refNameLabelFitsInView, tickLabelWidth, } from '../util.js';
|
|
7
|
+
import SVGRegionSeparators from './SVGRegionSeparators.js';
|
|
8
|
+
import { RULER_MAJOR_TICK, RULER_MINOR_TICK, getRulerLayout, gridlineTickXs, refNameLabelBaselineY, refNameLabelBoxHeight, vlinePath, } from './util.js';
|
|
9
|
+
// Tick marks and their coordinate labels, read from the same model getters the
|
|
10
|
+
// on-screen Gridlines/ScalebarCoordinateLabels use (gridlineTicks /
|
|
11
|
+
// scalebarLabels), so tick pitch, label text and label placement can't drift
|
|
12
|
+
// from the screen. Both are computed in the staticBlocks frame, which overhangs
|
|
13
|
+
// the viewport, so shift by the view's `staticBlocksTranslateX` and let the
|
|
14
|
+
// caller's clip trim the overhang.
|
|
15
|
+
function Ruler({ model, tickTopY, numbersBaselineY, }) {
|
|
16
|
+
const palette = usePalette();
|
|
17
|
+
const color = stripAlpha(palette.text.secondary);
|
|
18
|
+
const { scalebarLabels, width } = model;
|
|
19
|
+
const { dx, major, minor } = gridlineTickXs(model);
|
|
20
|
+
// major and minor marks share a stroke and differ only in length, so both
|
|
21
|
+
// collapse into a single path
|
|
22
|
+
const ticks = vlinePath(major, tickTopY, tickTopY + RULER_MAJOR_TICK) +
|
|
23
|
+
vlinePath(minor, tickTopY, tickTopY + RULER_MINOR_TICK);
|
|
24
|
+
return (_jsxs(_Fragment, { children: [_jsx("path", { d: ticks, strokeWidth: 1, stroke: color, fill: "none" }), scalebarLabels
|
|
25
|
+
.filter(({ x, label }) => {
|
|
26
|
+
const w = tickLabelWidth(label);
|
|
27
|
+
return labelFitsInBlock(dx + x - w / 2, w, width);
|
|
28
|
+
})
|
|
29
|
+
.map(({ x, label, key }) => (_jsx("text", { x: dx + x, y: numbersBaselineY, textAnchor: "middle", fontSize: TICK_LABEL_FONT_SIZE, fill: color, children: label }, key)))] }));
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
// Chromosome/refName labels along the ruler. Reuses the on-screen scalebar's
|
|
32
|
+
// sticky-label logic (getScalebarRefNameLabels) so the exported name stays
|
|
33
|
+
// pinned to the viewport's left edge when a region has scrolled off — otherwise
|
|
34
|
+
// the name renders off-canvas whenever you export a view zoomed into a
|
|
35
|
+
// chromosome interior. No assembly-name prefix here (unlike the on-screen
|
|
36
|
+
// scalebar): the SVG export already draws the assembly name above the ruler.
|
|
37
|
+
//
|
|
38
|
+
// `orientation` is not redundant, and this is the surface that needed it most.
|
|
39
|
+
// A stacked export gives each row SVGRowHeader — assembly name, ruler, refName
|
|
40
|
+
// labels — and no locstring, so a flipped row used to leave the numbers
|
|
41
|
+
// counting down as the only evidence it was flipped. On screen the search box
|
|
42
|
+
// says so; a figure has no search box.
|
|
43
|
+
function SVGRefNameLabels({ model }) {
|
|
44
|
+
const palette = usePalette();
|
|
45
|
+
const fill = stripAlpha(palette.text.primary);
|
|
46
|
+
const { labels, caption } = getScalebarRefNameLabels({
|
|
47
|
+
blocks: model.staticBlocks.blocks,
|
|
48
|
+
offsetPx: model.offsetPx,
|
|
49
|
+
prefix: undefined,
|
|
50
|
+
orientation: model.displayedRegionsOrientation,
|
|
51
|
+
});
|
|
52
|
+
return (_jsxs(_Fragment, { children: [caption === undefined ? null : (_jsx("text", { x: 0, y: refNameLabelBaselineY, fontSize: REF_NAME_LABEL_FONT_SIZE, fontWeight: "bold", fill: fill, children: caption })), labels
|
|
53
|
+
.filter(label => refNameLabelFitsInView(label, model.width))
|
|
54
|
+
.map(label => (_jsx(SVGRefNameLabel, { label: label, fill: fill, clipId: `reflabel-${svgNodeId(model)}-${label.key}` }, label.key)))] }));
|
|
55
|
+
}
|
|
56
|
+
// One refName label, clipped to the pixels left before its run of regions ends
|
|
57
|
+
// so a long name can't run past what it names — the vector counterpart of the
|
|
58
|
+
// on-screen label's maxWidth + overflow:clip. The clip rect spans the whole
|
|
59
|
+
// label box from its left edge, paddingLeft included, which is the box-sizing
|
|
60
|
+
// the on-screen span states for the same reason.
|
|
61
|
+
function SVGRefNameLabel({ label, fill, clipId, }) {
|
|
62
|
+
const { transform, maxWidth, paddingLeft, text } = label;
|
|
63
|
+
return (_jsx("g", { transform: `translate(${transform} 0)`, children: _jsx(SvgClipRect, { id: clipId, width: maxWidth, height: refNameLabelBoxHeight, children: _jsx("text", { x: paddingLeft, y: refNameLabelBaselineY, fontSize: REF_NAME_LABEL_FONT_SIZE, fontWeight: "bold", fill: fill, children: text }) }) }));
|
|
64
|
+
}
|
|
65
|
+
export default function SVGRuler({ model, rulerHeight, }) {
|
|
66
|
+
const { tickTopY, numbersBaselineY } = getRulerLayout(rulerHeight);
|
|
67
|
+
return (_jsxs(SvgClipRect, { id: `ruler-clip-${svgNodeId(model)}`, width: model.width, height: rulerHeight, children: [_jsx(SVGRegionSeparators, { model: model, height: rulerHeight }), _jsx(Ruler, { model: model, tickTopY: tickTopY, numbersBaselineY: numbersBaselineY }), _jsx(SVGRefNameLabels, { model: model })] }));
|
|
41
68
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { usePalette } from '@jbrowse/core/ui/PaletteContext';
|
|
2
3
|
import { getBpDisplayStr, stripAlpha } from '@jbrowse/core/util';
|
|
3
|
-
import {
|
|
4
|
+
import { SVG_SCALEBAR_CAP } from '../consts.js';
|
|
5
|
+
import { labelBaselineFromTop } from './util.js';
|
|
4
6
|
export default function SVGScalebar({ model, fontSize, }) {
|
|
5
7
|
const { offsetPx, dynamicBlocks: { totalWidthPxWithoutBorders: totalWidthPx, totalBp }, } = model;
|
|
6
|
-
const
|
|
8
|
+
const palette = usePalette();
|
|
7
9
|
const displayBp = getBpDisplayStr(totalBp);
|
|
8
10
|
const x0 = Math.max(-offsetPx, 0);
|
|
9
11
|
const x1 = x0 + totalWidthPx;
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsx("line", { x1: x0, x2: x1, y1:
|
|
12
|
+
const color = stripAlpha(palette.text.secondary);
|
|
13
|
+
// the bar is drawn on this component's own origin (y=0), with capped ends and
|
|
14
|
+
// the bp label hanging just below; callers translate it to the desired line y
|
|
15
|
+
return (_jsxs(_Fragment, { children: [_jsx("line", { x1: x0, x2: x1, y1: 0, y2: 0, stroke: color }), _jsx("line", { x1: x0, x2: x0, y1: -SVG_SCALEBAR_CAP, y2: SVG_SCALEBAR_CAP, stroke: color }), _jsx("line", { x1: x1, x2: x1, y1: -SVG_SCALEBAR_CAP, y2: SVG_SCALEBAR_CAP, stroke: color }), _jsx("text", { x: (x0 + x1) / 2, y: labelBaselineFromTop(SVG_SCALEBAR_CAP, fontSize), textAnchor: "middle", fontSize: fontSize, fill: color, children: displayBp })] }));
|
|
14
16
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
+
import type { SvgDisplayResult } from './util.ts';
|
|
3
|
+
import type { TrackLabelMode } from '@jbrowse/display-kit/types';
|
|
4
|
+
/**
|
|
5
|
+
* One view of a stacked export: its ruler, with the assembly name and scalebar
|
|
6
|
+
* above it, over its track bodies. `top` is where the ruler starts; the caller
|
|
7
|
+
* reserves `getRowHeaderLayout().bandHeight` above it for the header to draw
|
|
8
|
+
* into, and the row is `rulerHeight + rendered.tracksHeight` tall below it.
|
|
9
|
+
*/
|
|
10
|
+
export default function SVGStackedRow({ view, rendered, top, margin, fontSize, textHeight, rulerHeight, trackLabels, trackLabelOffset, showGridlines, legendWidth, showAssemblyName, showScalebar, }: {
|
|
11
|
+
view: LinearGenomeViewModel;
|
|
12
|
+
rendered: {
|
|
13
|
+
displayResults: SvgDisplayResult[];
|
|
14
|
+
tracksHeight: number;
|
|
15
|
+
};
|
|
16
|
+
top: number;
|
|
17
|
+
margin: number;
|
|
18
|
+
fontSize: number;
|
|
19
|
+
textHeight: number;
|
|
20
|
+
rulerHeight: number;
|
|
21
|
+
trackLabels: TrackLabelMode;
|
|
22
|
+
trackLabelOffset: number;
|
|
23
|
+
showGridlines: boolean;
|
|
24
|
+
legendWidth?: number;
|
|
25
|
+
showAssemblyName?: boolean;
|
|
26
|
+
showScalebar?: boolean;
|
|
27
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import SVGRowHeader from './SVGRowHeader.js';
|
|
3
|
+
import SVGView from './SVGView.js';
|
|
4
|
+
/**
|
|
5
|
+
* One view of a stacked export: its ruler, with the assembly name and scalebar
|
|
6
|
+
* above it, over its track bodies. `top` is where the ruler starts; the caller
|
|
7
|
+
* reserves `getRowHeaderLayout().bandHeight` above it for the header to draw
|
|
8
|
+
* into, and the row is `rulerHeight + rendered.tracksHeight` tall below it.
|
|
9
|
+
*/
|
|
10
|
+
export default function SVGStackedRow({ view, rendered, top, margin, fontSize, textHeight, rulerHeight, trackLabels, trackLabelOffset, showGridlines, legendWidth, showAssemblyName, showScalebar, }) {
|
|
11
|
+
return (_jsx("g", { transform: `translate(${margin} ${top})`, children: _jsx(SVGView, { view: view, displayResults: rendered.displayResults, header: _jsx(SVGRowHeader, { view: view, fontSize: fontSize, rulerHeight: rulerHeight, showAssemblyName: showAssemblyName, showScalebar: showScalebar }), fontSize: fontSize, textHeight: textHeight, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset, contentTop: rulerHeight, tracksHeight: rendered.tracksHeight, showGridlines: showGridlines, leftBuffer: margin, legendWidth: legendWidth }) }));
|
|
12
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { TrackLabelMode } from '../types.ts';
|
|
2
|
+
export default function SVGTrackLabel({ trackLabels, trackName, fontSize, textHeight, trackLabelOffset, x, }: {
|
|
2
3
|
trackName: string;
|
|
3
|
-
trackLabels:
|
|
4
|
+
trackLabels: TrackLabelMode;
|
|
4
5
|
fontSize: number;
|
|
6
|
+
textHeight: number;
|
|
5
7
|
trackLabelOffset: number;
|
|
6
8
|
x: number;
|
|
7
|
-
}): import("react
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -1,11 +1,56 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
import { usePalette } from '@jbrowse/core/ui/PaletteContext';
|
|
3
|
+
import { stripAlpha } from '@jbrowse/core/util';
|
|
4
|
+
import { TRACK_LABEL_GAP, insetLabelBaselineY, offsetLabelBaselineY, } from './util.js';
|
|
5
|
+
// Where the label sits, per mode. 'left' right-aligns in the gutter
|
|
6
|
+
// trackLabelLeftOffset reserved (hence the shared TRACK_LABEL_GAP); the other
|
|
7
|
+
// modes hang off the leftmost visible content at `x`, either just above the
|
|
8
|
+
// track body ('offset') or inset over it ('overlapping').
|
|
9
|
+
//
|
|
10
|
+
// Every mode is placed on its alphabetic baseline (the SVG default, so no
|
|
11
|
+
// dominantBaseline is emitted at all): 'offset' so its descenders land a known
|
|
12
|
+
// distance above the track body — the band it sits in is `textHeight` tall, and
|
|
13
|
+
// offsetLabelBaselineY owns that arithmetic — and 'left'/'overlapping' so their
|
|
14
|
+
// ascenders stay inside the track box they align with. 'left' used to be pinned
|
|
15
|
+
// at a hardcoded y=20 on a hanging baseline, which neither scaled with fontSize
|
|
16
|
+
// nor stayed inside a track shorter than ~35px.
|
|
17
|
+
function labelPosition({ trackLabels, trackLabelOffset, textHeight, fontSize, x, }) {
|
|
18
|
+
if (trackLabels === 'left') {
|
|
19
|
+
return {
|
|
20
|
+
x: trackLabelOffset - TRACK_LABEL_GAP,
|
|
21
|
+
y: insetLabelBaselineY(fontSize),
|
|
22
|
+
textAnchor: 'end',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// the other two are left-aligned, which is the SVG default, so neither emits
|
|
26
|
+
// a textAnchor at all
|
|
27
|
+
if (trackLabels === 'offset') {
|
|
28
|
+
return { x, y: offsetLabelBaselineY(textHeight, fontSize) };
|
|
29
|
+
}
|
|
30
|
+
// inset over the track body, on a baseline far enough down that the ascenders
|
|
31
|
+
// stay inside it (at y=0 they rose into the track above)
|
|
32
|
+
return { x: x + 5, y: insetLabelBaselineY(fontSize) };
|
|
33
|
+
}
|
|
34
|
+
export default function SVGTrackLabel({ trackLabels, trackName, fontSize, textHeight, trackLabelOffset, x, }) {
|
|
35
|
+
const palette = usePalette();
|
|
36
|
+
if (trackLabels === 'hidden') {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
const pos = labelPosition({
|
|
40
|
+
trackLabels,
|
|
41
|
+
trackLabelOffset,
|
|
42
|
+
textHeight,
|
|
43
|
+
fontSize,
|
|
44
|
+
x,
|
|
45
|
+
});
|
|
46
|
+
// 'overlapping' prints over the track's own data, which the on-screen label
|
|
47
|
+
// clears with a paper box, so it carries the halo text over a plot needs
|
|
48
|
+
const halo = trackLabels === 'overlapping'
|
|
49
|
+
? {
|
|
50
|
+
stroke: stripAlpha(palette.background.paper),
|
|
51
|
+
strokeWidth: 3,
|
|
52
|
+
paintOrder: 'stroke',
|
|
53
|
+
}
|
|
54
|
+
: {};
|
|
55
|
+
return (_jsx("text", { x: pos.x, y: pos.y, textAnchor: pos.textAnchor, fontSize: fontSize, fill: stripAlpha(palette.text.primary), ...halo, children: trackName }));
|
|
11
56
|
}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TrackLabelMode } from '../types.ts';
|
|
3
|
+
import type { SvgDisplayResult } from './util.ts';
|
|
3
4
|
type LGV = LinearGenomeViewModel;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
configuration: AnyConfigurationModel;
|
|
7
|
-
displays: {
|
|
8
|
-
height: number;
|
|
9
|
-
}[];
|
|
10
|
-
};
|
|
11
|
-
result: string;
|
|
12
|
-
}
|
|
13
|
-
export default function SVGTracks({ displayResults, model, textHeight, fontSize, trackLabels, trackLabelOffset, }: {
|
|
14
|
-
displayResults: DisplayResult[];
|
|
5
|
+
export default function SVGTracks({ displayResults, model, textHeight, fontSize, trackLabels, trackLabelOffset, leftBuffer, legendWidth, }: {
|
|
6
|
+
displayResults: SvgDisplayResult[];
|
|
15
7
|
model: LGV;
|
|
16
8
|
textHeight: number;
|
|
17
9
|
fontSize: number;
|
|
18
|
-
trackLabels
|
|
19
|
-
trackLabelOffset
|
|
20
|
-
|
|
10
|
+
trackLabels: TrackLabelMode;
|
|
11
|
+
trackLabelOffset: number;
|
|
12
|
+
leftBuffer: number;
|
|
13
|
+
legendWidth: number;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
21
15
|
export {};
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SvgClipRect } from '@jbrowse/core/svg/SvgExport';
|
|
3
|
+
import { svgNodeId } from '@jbrowse/core/svg/svgId';
|
|
4
|
+
import { svgTrackName } from '@jbrowse/core/svg/trackNames';
|
|
2
5
|
import { getSession } from '@jbrowse/core/util';
|
|
3
|
-
import {
|
|
4
|
-
import SVGRegionSeparators from
|
|
5
|
-
import SVGTrackLabel from
|
|
6
|
-
|
|
6
|
+
import { exportsTooLargeNote } from '@jbrowse/display-kit/renderDisplaySvg';
|
|
7
|
+
import SVGRegionSeparators from './SVGRegionSeparators.js';
|
|
8
|
+
import SVGTrackLabel from './SVGTrackLabel.js';
|
|
9
|
+
import { labelOffset, trackBoxOffsets, trackLabelMode } from './util.js';
|
|
10
|
+
export default function SVGTracks({ displayResults, model, textHeight, fontSize, trackLabels, trackLabelOffset, leftBuffer, legendWidth, }) {
|
|
7
11
|
const session = getSession(model);
|
|
8
|
-
const
|
|
9
|
-
|
|
12
|
+
const x = Math.max(-model.offsetPx, 0);
|
|
13
|
+
const offsets = trackBoxOffsets(displayResults.map(r => r.track), trackLabels, textHeight);
|
|
14
|
+
return (_jsx(_Fragment, { children: displayResults.map(({ track, result }, i) => {
|
|
10
15
|
const conf = track.configuration;
|
|
11
|
-
const trackName =
|
|
16
|
+
const trackName = svgTrackName(track, session);
|
|
12
17
|
const display = track.displays[0];
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
return {
|
|
16
|
-
|
|
17
|
-
reactElements: [
|
|
18
|
-
...reactElements,
|
|
19
|
-
_jsxs("g", { transform: `translate(0 ${prevOffset})`, children: [_jsxs("g", { transform: `translate(${trackLabelOffset} ${textOffset})`, children: [_jsx(SVGRegionSeparators, { model: model, height: display.height }), result] }), _jsx(SVGTrackLabel, { trackName: trackName, fontSize: fontSize, trackLabels: trackLabels, trackLabelOffset: trackLabelOffset, x: x })] }, conf.trackId),
|
|
20
|
-
],
|
|
21
|
-
};
|
|
22
|
-
}, {
|
|
23
|
-
prevOffset: 0,
|
|
24
|
-
reactElements: [],
|
|
25
|
-
}).reactElements }));
|
|
18
|
+
const currentOffset = offsets[i];
|
|
19
|
+
const textOffset = labelOffset(track, trackLabels, textHeight);
|
|
20
|
+
return (_jsxs("g", { transform: `translate(0 ${currentOffset})`, children: [_jsx(SvgClipRect, { id: `track-clip-${svgNodeId(model)}-${conf.trackId}`, x: -leftBuffer, y: textOffset, width: model.width + trackLabelOffset + leftBuffer + legendWidth, height: display.height, children: _jsxs("g", { transform: `translate(${trackLabelOffset} ${textOffset})`, children: [result, exportsTooLargeNote(display) ? null : (_jsx(SVGRegionSeparators, { model: model, height: display.height }))] }) }), _jsx(SVGTrackLabel, { trackName: trackName, fontSize: fontSize, textHeight: textHeight, trackLabels: trackLabelMode(track, trackLabels), trackLabelOffset: trackLabelOffset, x: x })] }, conf.trackId));
|
|
21
|
+
}) }));
|
|
26
22
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from '../index.ts';
|
|
2
|
+
import type { TrackLabelMode } from '../types.ts';
|
|
3
|
+
import type { SvgDisplayResult } from './util.ts';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
5
|
+
export default function SVGView({ view, displayResults, header, fontSize, textHeight, trackLabels, trackLabelOffset, contentTop, tracksHeight, showGridlines, leftBuffer, legendWidth, }: {
|
|
6
|
+
view: LinearGenomeViewModel;
|
|
7
|
+
displayResults: SvgDisplayResult[];
|
|
8
|
+
header: ReactNode;
|
|
9
|
+
fontSize: number;
|
|
10
|
+
textHeight: number;
|
|
11
|
+
trackLabels: TrackLabelMode;
|
|
12
|
+
trackLabelOffset: number;
|
|
13
|
+
contentTop: number;
|
|
14
|
+
tracksHeight: number;
|
|
15
|
+
showGridlines: boolean;
|
|
16
|
+
leftBuffer: number;
|
|
17
|
+
legendWidth?: number;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import SVGGridlines from './SVGGridlines.js';
|
|
3
|
+
import SVGHighlightsOverlay from './SVGHighlightsOverlay.js';
|
|
4
|
+
import SVGTracks from './SVGTracks.js';
|
|
5
|
+
// One LGV's worth of exported SVG: a caller-supplied header on top, then
|
|
6
|
+
// optional gridlines, the track bodies, and the highlight layer over them.
|
|
7
|
+
// Shared by all three exports that stack an LGV — the standalone one, and the
|
|
8
|
+
// linear-synteny and breakpoint-split rows — so their per-view layout can't
|
|
9
|
+
// drift. It did drift while the standalone export kept its own copy of these
|
|
10
|
+
// four groups: only that copy widened the per-track clip by `legendWidth`.
|
|
11
|
+
export default function SVGView({ view, displayResults, header, fontSize, textHeight, trackLabels, trackLabelOffset, contentTop, tracksHeight, showGridlines, leftBuffer, legendWidth = 0, }) {
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx("g", { transform: `translate(${trackLabelOffset})`, children: header }), showGridlines ? (_jsx("g", { transform: `translate(${trackLabelOffset} ${contentTop})`, children: _jsx(SVGGridlines, { model: view, height: tracksHeight }) })) : null, _jsx("g", { transform: `translate(0 ${contentTop})`, children: _jsx(SVGTracks, { textHeight: textHeight, trackLabels: trackLabels, fontSize: fontSize, model: view, displayResults: displayResults, trackLabelOffset: trackLabelOffset, leftBuffer: leftBuffer, legendWidth: legendWidth }) }), _jsx("g", { transform: `translate(${trackLabelOffset} ${contentTop})`, children: _jsx(SVGHighlightsOverlay, { model: view, tracksHeight: tracksHeight }) })] }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* One live figure per view.
|
|
4
|
+
*
|
|
5
|
+
* Every id a figure mints is `<what>-${svgNodeId(view)}`, deterministic so that
|
|
6
|
+
* exporting an unchanged view twice produces the same bytes (see `svgNodeId`).
|
|
7
|
+
* The same property makes two figures of ONE view collide on all of them, and
|
|
8
|
+
* SVG ids are document-global with `url(#…)` resolving to the first match — so
|
|
9
|
+
* the second figure's tracks are clipped by the first figure's rects. With
|
|
10
|
+
* different options on the two (the reason to draw two in the first place) those
|
|
11
|
+
* rects are the wrong size, and it reads as a track drawn unclipped or a
|
|
12
|
+
* highlight band cut short.
|
|
13
|
+
*
|
|
14
|
+
* Deliberately not fixed by scoping the ids per figure. The determinism is load
|
|
15
|
+
* bearing for the file export that shares these components, and a second figure
|
|
16
|
+
* of one view is a thing to do differently rather than a case to support.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useOneFigurePerView(view: {
|
|
19
|
+
id: string;
|
|
20
|
+
}): void;
|
|
21
|
+
/**
|
|
22
|
+
* Nothing inside a figure re-renders itself.
|
|
23
|
+
*
|
|
24
|
+
* A figure's track bodies are built once and frozen; its ruler, scalebar and
|
|
25
|
+
* seams re-derive from the model on any render they get. The `memo` in
|
|
26
|
+
* `useViewSvgFigure` is what keeps those in step, and it sits between the figure
|
|
27
|
+
* and its PARENT — it is not between a component inside the figure and MobX. An
|
|
28
|
+
* `observer` in there re-renders on its own subscription and slides across
|
|
29
|
+
* bodies drawn at a moment in the past, which is a rendering bug the picture
|
|
30
|
+
* gives no sign of.
|
|
31
|
+
*
|
|
32
|
+
* Checked as the state rather than the shape, because the shape is not
|
|
33
|
+
* detectable: `observer(f)` on a function component is `memo(f)` with no marker
|
|
34
|
+
* on it, so it cannot be told from a plain `memo`, which is harmless. Watching
|
|
35
|
+
* for the symptom also covers what an enumeration would miss — a plugin's
|
|
36
|
+
* component reached through `LinearGenomeView-HighlightSVGComponent`, an
|
|
37
|
+
* observer a display's `renderSvg` returned, or a subscription that is not
|
|
38
|
+
* MobX's at all.
|
|
39
|
+
*
|
|
40
|
+
* A mutation is only a violation while the snapshot is unchanged. React's own
|
|
41
|
+
* commit for a NEW snapshot mutates this subtree too, so `rendered` moves to
|
|
42
|
+
* that snapshot during the render that precedes the commit and the records are
|
|
43
|
+
* ignored.
|
|
44
|
+
*/
|
|
45
|
+
export declare function useFrozenFigureContract(ref: RefObject<SVGSVGElement | null>, snapshot: object): void;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { svgNodeId } from '@jbrowse/core/svg/svgId';
|
|
3
|
+
import { contractReportsOn, reportContractViolation, } from '@jbrowse/render-core/contractReports';
|
|
4
|
+
/**
|
|
5
|
+
* Checks that a live SVG figure is being used the way it can work.
|
|
6
|
+
*
|
|
7
|
+
* `useViewSvgFigure` publishes a figure whose two halves are drawn at different
|
|
8
|
+
* moments and only agree by construction, and both ways of breaking that are
|
|
9
|
+
* invisible in the output: the drawing is still a plausible picture of
|
|
10
|
+
* somewhere, just not of one moment or not with its own clips. So the run
|
|
11
|
+
* reports instead, through the `[jbrowse <family> contract]` channel every
|
|
12
|
+
* check in the tree uses — `config/jest/contractGate.js` fails the test that
|
|
13
|
+
* collects one, and ARCHITECTURAL_LIMITS.md §"Ordering is the contract" is the
|
|
14
|
+
* register. `figure` rather than `svg-figure` because the gate's family pattern
|
|
15
|
+
* is `\w+`, which a hyphen is not.
|
|
16
|
+
*
|
|
17
|
+
* Reported and never thrown, as the rest of that family: a figure is chrome a
|
|
18
|
+
* host renders beside its own, and taking the host's tree down over a drawing
|
|
19
|
+
* is worse than the drawing being wrong.
|
|
20
|
+
*/
|
|
21
|
+
function report(message) {
|
|
22
|
+
reportContractViolation('figure', message);
|
|
23
|
+
}
|
|
24
|
+
// Live figures per view, keyed the way their SVG ids are. A count rather than a
|
|
25
|
+
// flag: the report belongs on the second mount, and the first has to survive the
|
|
26
|
+
// second unmounting.
|
|
27
|
+
const figuresPerView = new Map();
|
|
28
|
+
/**
|
|
29
|
+
* One live figure per view.
|
|
30
|
+
*
|
|
31
|
+
* Every id a figure mints is `<what>-${svgNodeId(view)}`, deterministic so that
|
|
32
|
+
* exporting an unchanged view twice produces the same bytes (see `svgNodeId`).
|
|
33
|
+
* The same property makes two figures of ONE view collide on all of them, and
|
|
34
|
+
* SVG ids are document-global with `url(#…)` resolving to the first match — so
|
|
35
|
+
* the second figure's tracks are clipped by the first figure's rects. With
|
|
36
|
+
* different options on the two (the reason to draw two in the first place) those
|
|
37
|
+
* rects are the wrong size, and it reads as a track drawn unclipped or a
|
|
38
|
+
* highlight band cut short.
|
|
39
|
+
*
|
|
40
|
+
* Deliberately not fixed by scoping the ids per figure. The determinism is load
|
|
41
|
+
* bearing for the file export that shares these components, and a second figure
|
|
42
|
+
* of one view is a thing to do differently rather than a case to support.
|
|
43
|
+
*/
|
|
44
|
+
export function useOneFigurePerView(view) {
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
// captured, not re-derived on cleanup: by then the view may have left the
|
|
47
|
+
// tree, and `svgNodeId` walks it
|
|
48
|
+
const key = svgNodeId(view);
|
|
49
|
+
const live = (figuresPerView.get(key) ?? 0) + 1;
|
|
50
|
+
figuresPerView.set(key, live);
|
|
51
|
+
if (live > 1) {
|
|
52
|
+
report(`${live} live figures of one view are mounted at once. They mint the ` +
|
|
53
|
+
`same SVG ids (ruler-clip-${key}, track-clip-${key}-<trackId>, …), ` +
|
|
54
|
+
`ids are document-global, and url(#…) resolves to the first match — ` +
|
|
55
|
+
`so every figure after the first is clipped by the first one's rects ` +
|
|
56
|
+
`and draws its tracks and highlights at the wrong extent. Render one ` +
|
|
57
|
+
`figure per view.`);
|
|
58
|
+
}
|
|
59
|
+
return () => {
|
|
60
|
+
const left = (figuresPerView.get(key) ?? 1) - 1;
|
|
61
|
+
if (left > 0) {
|
|
62
|
+
figuresPerView.set(key, left);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
figuresPerView.delete(key);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, [view]);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Nothing inside a figure re-renders itself.
|
|
72
|
+
*
|
|
73
|
+
* A figure's track bodies are built once and frozen; its ruler, scalebar and
|
|
74
|
+
* seams re-derive from the model on any render they get. The `memo` in
|
|
75
|
+
* `useViewSvgFigure` is what keeps those in step, and it sits between the figure
|
|
76
|
+
* and its PARENT — it is not between a component inside the figure and MobX. An
|
|
77
|
+
* `observer` in there re-renders on its own subscription and slides across
|
|
78
|
+
* bodies drawn at a moment in the past, which is a rendering bug the picture
|
|
79
|
+
* gives no sign of.
|
|
80
|
+
*
|
|
81
|
+
* Checked as the state rather than the shape, because the shape is not
|
|
82
|
+
* detectable: `observer(f)` on a function component is `memo(f)` with no marker
|
|
83
|
+
* on it, so it cannot be told from a plain `memo`, which is harmless. Watching
|
|
84
|
+
* for the symptom also covers what an enumeration would miss — a plugin's
|
|
85
|
+
* component reached through `LinearGenomeView-HighlightSVGComponent`, an
|
|
86
|
+
* observer a display's `renderSvg` returned, or a subscription that is not
|
|
87
|
+
* MobX's at all.
|
|
88
|
+
*
|
|
89
|
+
* A mutation is only a violation while the snapshot is unchanged. React's own
|
|
90
|
+
* commit for a NEW snapshot mutates this subtree too, so `rendered` moves to
|
|
91
|
+
* that snapshot during the render that precedes the commit and the records are
|
|
92
|
+
* ignored.
|
|
93
|
+
*/
|
|
94
|
+
export function useFrozenFigureContract(ref, snapshot) {
|
|
95
|
+
const rendered = useRef(snapshot);
|
|
96
|
+
rendered.current = snapshot;
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
const el = ref.current;
|
|
99
|
+
// the one check here with a cost of its own — a `MutationObserver` over the
|
|
100
|
+
// whole figure subtree — so unlike its neighbour it asks whether the
|
|
101
|
+
// channel is armed rather than running and reporting into it
|
|
102
|
+
if (!contractReportsOn() || !el) {
|
|
103
|
+
return undefined;
|
|
104
|
+
}
|
|
105
|
+
const observer = new MutationObserver(() => {
|
|
106
|
+
if (rendered.current !== snapshot) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
// once is the whole message; a drifting subtree mutates every frame
|
|
110
|
+
observer.disconnect();
|
|
111
|
+
report(`a figure redrew part of itself against a snapshot that did not ` +
|
|
112
|
+
`change, so its chrome and its track bodies now describe different ` +
|
|
113
|
+
`moments and a pan slides one across the other. Something inside it ` +
|
|
114
|
+
`is subscribed to the view — most often an observer component a ` +
|
|
115
|
+
`plugin contributed to LinearGenomeView-HighlightSVGComponent, or ` +
|
|
116
|
+
`one a display's renderSvg returned. Nothing inside a figure may be ` +
|
|
117
|
+
`an observer: the memo that freezes it is between the figure and its ` +
|
|
118
|
+
`parent, not between an observer and MobX.`);
|
|
119
|
+
});
|
|
120
|
+
observer.observe(el, {
|
|
121
|
+
subtree: true,
|
|
122
|
+
childList: true,
|
|
123
|
+
attributes: true,
|
|
124
|
+
characterData: true,
|
|
125
|
+
});
|
|
126
|
+
return () => {
|
|
127
|
+
observer.disconnect();
|
|
128
|
+
};
|
|
129
|
+
}, [ref, snapshot]);
|
|
130
|
+
}
|