@jbrowse/plugin-linear-genome-view 3.6.5 → 4.0.0
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/BaseLinearDisplay/SVGLegend.d.ts +6 -0
- package/esm/BaseLinearDisplay/SVGLegend.js +17 -0
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.d.ts +2 -0
- package/esm/BaseLinearDisplay/calculateSvgLegendWidth.js +11 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +3 -3
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +13 -24
- package/esm/BaseLinearDisplay/components/Block.js +2 -2
- package/esm/BaseLinearDisplay/components/BlockErrorMessage.js +2 -2
- package/esm/BaseLinearDisplay/components/BlockMsg.js +11 -2
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/CollapseIntronsDialog.js +42 -0
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.d.ts +11 -0
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/TranscriptTable.js +40 -0
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.d.ts +19 -0
- package/esm/BaseLinearDisplay/components/CollapseIntronsDialog/util.js +45 -0
- package/esm/BaseLinearDisplay/components/FloatingLabels.d.ts +5 -0
- package/esm/BaseLinearDisplay/components/FloatingLabels.js +89 -0
- package/esm/BaseLinearDisplay/components/FloatingLegend.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/FloatingLegend.js +43 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -5
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +5 -42
- package/esm/BaseLinearDisplay/components/LoadingOverlay.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/LoadingOverlay.js +49 -0
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/MaxHeightReachedIndicator.js +26 -0
- package/esm/BaseLinearDisplay/components/MenuPage.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/MenuPage.js +24 -0
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.d.ts +19 -0
- package/esm/BaseLinearDisplay/components/NonBlockCanvasDisplayComponent.js +48 -0
- package/esm/BaseLinearDisplay/components/RenderedBlocks.d.ts +12 -0
- package/esm/BaseLinearDisplay/components/RenderedBlocks.js +22 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +5 -8
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +3 -3
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +2 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +10 -7
- package/esm/BaseLinearDisplay/components/types.d.ts +1 -0
- package/esm/BaseLinearDisplay/components/types.js +1 -0
- package/esm/BaseLinearDisplay/components/util.d.ts +21 -0
- package/esm/BaseLinearDisplay/components/util.js +116 -0
- package/esm/BaseLinearDisplay/index.d.ts +17 -8
- package/esm/BaseLinearDisplay/index.js +13 -6
- package/esm/BaseLinearDisplay/model.d.ts +1177 -0
- package/esm/BaseLinearDisplay/model.js +424 -0
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +5 -5
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +11 -14
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.d.ts +21 -0
- package/esm/BaseLinearDisplay/models/NonBlockCanvasDisplayMixin.js +46 -0
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +3 -3
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +2 -3
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +1 -1
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +2 -3
- package/esm/BaseLinearDisplay/models/calculateLabelPositions.d.ts +24 -0
- package/esm/BaseLinearDisplay/models/calculateLabelPositions.js +60 -0
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -2
- package/esm/BaseLinearDisplay/models/configSchema.js +3 -3
- package/esm/BaseLinearDisplay/models/renderSvg.d.ts +3 -7
- package/esm/BaseLinearDisplay/models/renderSvg.js +22 -11
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +37 -19
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +151 -135
- package/esm/BaseLinearDisplay/models/util.d.ts +4 -4
- package/esm/BaseLinearDisplay/models/util.js +16 -13
- package/esm/BaseLinearDisplay/renderSvg.d.ts +3 -0
- package/esm/BaseLinearDisplay/renderSvg.js +59 -0
- package/esm/BaseLinearDisplay/types.d.ts +47 -0
- package/esm/BaseLinearDisplay/types.js +3 -0
- package/esm/BaseLinearDisplay/util.d.ts +15 -0
- package/esm/BaseLinearDisplay/util.js +61 -0
- package/esm/BasicTrack/configSchema.d.ts +16 -11
- package/esm/BasicTrack/index.js +1 -1
- package/esm/FeatureTrack/configSchema.d.ts +16 -11
- package/esm/FeatureTrack/index.js +1 -1
- package/esm/LaunchLinearGenomeView/index.js +12 -62
- package/esm/LinearBareDisplay/configSchema.d.ts +4 -4
- package/esm/LinearBareDisplay/configSchema.js +1 -1
- package/esm/LinearBareDisplay/index.d.ts +2 -2
- package/esm/LinearBareDisplay/index.js +5 -5
- package/esm/LinearBareDisplay/model.d.ts +959 -92
- package/esm/LinearBareDisplay/model.js +3 -6
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.d.ts +5 -0
- package/esm/LinearBasicDisplay/components/LinearBasicDisplayComponent.js +9 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +4 -4
- package/esm/LinearBasicDisplay/configSchema.js +1 -1
- package/esm/LinearBasicDisplay/index.d.ts +2 -2
- package/esm/LinearBasicDisplay/index.js +6 -6
- package/esm/LinearBasicDisplay/model.d.ts +1134 -122
- package/esm/LinearBasicDisplay/model.js +116 -116
- package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/AddFiltersDialog.js +2 -2
- package/esm/{LinearBasicDisplay → LinearFeatureDisplay}/components/SetMaxHeightDialog.js +3 -3
- package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/configSchema.d.ts +4 -4
- package/esm/LinearFeatureDisplay/configSchema.js +11 -0
- package/esm/LinearFeatureDisplay/index.d.ts +3 -0
- package/esm/LinearFeatureDisplay/index.js +2 -0
- package/esm/LinearFeatureDisplay/model.d.ts +1415 -0
- package/esm/LinearFeatureDisplay/model.js +265 -0
- package/esm/LinearGenomeView/SVGErrorBox.d.ts +5 -0
- package/esm/LinearGenomeView/SVGErrorBox.js +4 -0
- package/esm/LinearGenomeView/afterAttach.d.ts +5 -0
- package/esm/LinearGenomeView/afterAttach.js +95 -0
- package/esm/LinearGenomeView/components/CenterLine.js +6 -4
- package/esm/LinearGenomeView/components/Cytobands.js +4 -4
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +5 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +8 -2
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +13 -16
- package/esm/LinearGenomeView/components/Gridlines.js +18 -15
- package/esm/LinearGenomeView/components/Header.js +9 -9
- package/esm/LinearGenomeView/components/HeaderPanControls.js +2 -2
- package/esm/LinearGenomeView/components/HeaderRegionWidth.js +4 -5
- package/esm/LinearGenomeView/components/HeaderTrackSelectorButton.js +2 -2
- package/esm/LinearGenomeView/components/HeaderZoomControls.js +3 -3
- package/esm/LinearGenomeView/components/Highlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/Highlight.js +6 -6
- package/esm/LinearGenomeView/components/ImportForm.d.ts +1 -1
- package/esm/LinearGenomeView/components/ImportForm.js +14 -12
- package/esm/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +3 -3
- package/esm/LinearGenomeView/components/LinearGenomeView.js +7 -7
- package/esm/LinearGenomeView/components/LinearGenomeViewContainer.js +7 -8
- package/esm/LinearGenomeView/components/MiniControls.js +6 -6
- package/esm/LinearGenomeView/components/NoTracksActiveButton.js +2 -2
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +1 -1
- package/esm/LinearGenomeView/components/OverviewHighlight.js +5 -5
- package/esm/LinearGenomeView/components/OverviewRubberband.js +4 -4
- package/esm/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +9 -5
- package/esm/LinearGenomeView/components/OverviewScalebar.js +36 -28
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +5 -5
- package/esm/LinearGenomeView/components/OverviewScalebarTickLabels.js +7 -7
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +10 -10
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/RegionWidthEditorDialog.js +6 -4
- package/esm/LinearGenomeView/components/Rubberband.js +9 -7
- package/esm/LinearGenomeView/components/RubberbandSpan.js +4 -5
- package/esm/LinearGenomeView/components/Scalebar.js +8 -10
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarCoordinateLabels.js +50 -17
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +1 -1
- package/esm/LinearGenomeView/components/ScalebarRefNameLabels.js +13 -11
- package/esm/LinearGenomeView/components/SearchBox.d.ts +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +8 -9
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +1 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +2 -2
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +1 -1
- package/esm/LinearGenomeView/components/SearchResultsTable.js +4 -6
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +6 -6
- package/esm/LinearGenomeView/components/TrackContainer.js +32 -20
- package/esm/LinearGenomeView/components/TrackLabel.js +10 -11
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +7 -8
- package/esm/LinearGenomeView/components/TrackLabelDragHandle.js +1 -1
- package/esm/LinearGenomeView/components/TrackLabelMenu.js +80 -68
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +1 -2
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +5 -5
- package/esm/LinearGenomeView/components/TracksContainer.js +18 -15
- package/esm/LinearGenomeView/components/VerticalGuide.js +5 -3
- package/esm/LinearGenomeView/components/fetchSequence.d.ts +7 -2
- package/esm/LinearGenomeView/components/useRangeSelect.d.ts +27 -2
- package/esm/LinearGenomeView/components/useRangeSelect.js +26 -20
- package/esm/LinearGenomeView/components/useWheelScroll.js +22 -12
- package/esm/LinearGenomeView/components/util.d.ts +2 -13
- package/esm/LinearGenomeView/components/util.js +12 -31
- package/esm/LinearGenomeView/index.d.ts +1 -1
- package/esm/LinearGenomeView/index.js +3 -3
- package/esm/LinearGenomeView/keyboardHandler.d.ts +2 -0
- package/esm/LinearGenomeView/keyboardHandler.js +29 -0
- package/esm/LinearGenomeView/menuItems.d.ts +7 -0
- package/esm/LinearGenomeView/menuItems.js +299 -0
- package/esm/LinearGenomeView/model.d.ts +92 -89
- package/esm/LinearGenomeView/model.js +166 -414
- package/esm/LinearGenomeView/svgExportUtil.d.ts +9 -0
- package/esm/LinearGenomeView/svgExportUtil.js +6 -0
- package/{dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts → esm/LinearGenomeView/svgcomponents/SVGGridlines.d.ts} +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGGridlines.js +20 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +5 -5
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +4 -3
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +24 -12
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.js +13 -5
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.js +2 -2
- package/esm/LinearGenomeView/types.d.ts +5 -1
- package/esm/LinearGenomeView/util.d.ts +2 -2
- package/esm/LinearGenomeView/util.js +8 -6
- package/esm/index.d.ts +975 -94
- package/esm/index.js +37 -38
- package/esm/searchUtils.d.ts +1 -1
- package/esm/searchUtils.js +6 -4
- package/package.json +28 -33
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +0 -8
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +0 -72
- package/dist/BaseLinearDisplay/components/Block.d.ts +0 -14
- package/dist/BaseLinearDisplay/components/Block.js +0 -50
- package/dist/BaseLinearDisplay/components/BlockErrorMessage.d.ts +0 -7
- package/dist/BaseLinearDisplay/components/BlockErrorMessage.js +0 -27
- package/dist/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
- package/dist/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -26
- package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +0 -6
- package/dist/BaseLinearDisplay/components/BlockMsg.js +0 -20
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +0 -9
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +0 -61
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +0 -11
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +0 -59
- package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +0 -10
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js +0 -25
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +0 -11
- package/dist/BaseLinearDisplay/components/Tooltip.js +0 -24
- package/dist/BaseLinearDisplay/index.d.ts +0 -8
- package/dist/BaseLinearDisplay/index.js +0 -20
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -325
- package/dist/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +0 -32
- package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +0 -122
- package/dist/BaseLinearDisplay/models/TrackHeightMixin.d.ts +0 -11
- package/dist/BaseLinearDisplay/models/TrackHeightMixin.js +0 -35
- package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +0 -2
- package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js +0 -33
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +0 -29
- package/dist/BaseLinearDisplay/models/configSchema.js +0 -35
- package/dist/BaseLinearDisplay/models/renderSvg.d.ts +0 -7
- package/dist/BaseLinearDisplay/models/renderSvg.js +0 -80
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +0 -78
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -229
- package/dist/BaseLinearDisplay/models/util.d.ts +0 -22
- package/dist/BaseLinearDisplay/models/util.js +0 -45
- package/dist/BasicTrack/configSchema.d.ts +0 -80
- package/dist/BasicTrack/configSchema.js +0 -10
- package/dist/BasicTrack/index.d.ts +0 -2
- package/dist/BasicTrack/index.js +0 -18
- package/dist/FeatureTrack/configSchema.d.ts +0 -80
- package/dist/FeatureTrack/configSchema.js +0 -10
- package/dist/FeatureTrack/index.d.ts +0 -2
- package/dist/FeatureTrack/index.js +0 -19
- package/dist/LaunchLinearGenomeView/index.d.ts +0 -2
- package/dist/LaunchLinearGenomeView/index.js +0 -70
- package/dist/LinearBareDisplay/configSchema.d.ts +0 -32
- package/dist/LinearBareDisplay/configSchema.js +0 -13
- package/dist/LinearBareDisplay/index.d.ts +0 -4
- package/dist/LinearBareDisplay/index.js +0 -26
- package/dist/LinearBareDisplay/model.d.ts +0 -309
- package/dist/LinearBareDisplay/model.js +0 -38
- package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +0 -61
- package/dist/LinearBasicDisplay/components/SetMaxHeightDialog.js +0 -28
- package/dist/LinearBasicDisplay/configSchema.js +0 -13
- package/dist/LinearBasicDisplay/index.d.ts +0 -4
- package/dist/LinearBasicDisplay/index.js +0 -29
- package/dist/LinearBasicDisplay/model.d.ts +0 -346
- package/dist/LinearBasicDisplay/model.js +0 -192
- package/dist/LinearGenomeView/components/CenterLine.d.ts +0 -6
- package/dist/LinearGenomeView/components/CenterLine.js +0 -38
- package/dist/LinearGenomeView/components/Cytobands.d.ts +0 -9
- package/dist/LinearGenomeView/components/Cytobands.js +0 -89
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +0 -7
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +0 -57
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +0 -6
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +0 -109
- package/dist/LinearGenomeView/components/Gridlines.d.ts +0 -7
- package/dist/LinearGenomeView/components/Gridlines.js +0 -70
- package/dist/LinearGenomeView/components/Header.d.ts +0 -5
- package/dist/LinearGenomeView/components/Header.js +0 -38
- package/dist/LinearGenomeView/components/HeaderPanControls.d.ts +0 -6
- package/dist/LinearGenomeView/components/HeaderPanControls.js +0 -27
- package/dist/LinearGenomeView/components/HeaderRegionWidth.d.ts +0 -5
- package/dist/LinearGenomeView/components/HeaderRegionWidth.js +0 -21
- package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.d.ts +0 -5
- package/dist/LinearGenomeView/components/HeaderTrackSelectorButton.js +0 -19
- package/dist/LinearGenomeView/components/HeaderZoomControls.d.ts +0 -5
- package/dist/LinearGenomeView/components/HeaderZoomControls.js +0 -109
- package/dist/LinearGenomeView/components/Highlight.d.ts +0 -12
- package/dist/LinearGenomeView/components/Highlight.js +0 -95
- package/dist/LinearGenomeView/components/ImportForm.d.ts +0 -6
- package/dist/LinearGenomeView/components/ImportForm.js +0 -80
- package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.d.ts +0 -11
- package/dist/LinearGenomeView/components/ImportFormRefNameAutocomplete.js +0 -32
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +0 -5
- package/dist/LinearGenomeView/components/LinearGenomeView.js +0 -57
- package/dist/LinearGenomeView/components/LinearGenomeViewContainer.d.ts +0 -5
- package/dist/LinearGenomeView/components/LinearGenomeViewContainer.js +0 -98
- package/dist/LinearGenomeView/components/MiniControls.d.ts +0 -5
- package/dist/LinearGenomeView/components/MiniControls.js +0 -36
- package/dist/LinearGenomeView/components/NoTracksActiveButton.d.ts +0 -5
- package/dist/LinearGenomeView/components/NoTracksActiveButton.js +0 -23
- package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +0 -8
- package/dist/LinearGenomeView/components/OverviewHighlight.js +0 -50
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +0 -9
- package/dist/LinearGenomeView/components/OverviewRubberband.js +0 -113
- package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.d.ts +0 -10
- package/dist/LinearGenomeView/components/OverviewRubberbandHoverTooltip.js +0 -28
- package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +0 -7
- package/dist/LinearGenomeView/components/OverviewScalebar.js +0 -146
- package/dist/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +0 -8
- package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +0 -41
- package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.d.ts +0 -10
- package/dist/LinearGenomeView/components/OverviewScalebarTickLabels.js +0 -37
- package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +0 -8
- package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +0 -18
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +0 -3
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +0 -56
- package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.d.ts +0 -3
- package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js +0 -11
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +0 -16
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +0 -127
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +0 -10
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js +0 -53
- package/dist/LinearGenomeView/components/RegionWidthEditorDialog.d.ts +0 -6
- package/dist/LinearGenomeView/components/RegionWidthEditorDialog.js +0 -30
- package/dist/LinearGenomeView/components/Rubberband.d.ts +0 -7
- package/dist/LinearGenomeView/components/Rubberband.js +0 -35
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +0 -15
- package/dist/LinearGenomeView/components/RubberbandSpan.js +0 -39
- package/dist/LinearGenomeView/components/RubberbandTooltip.d.ts +0 -5
- package/dist/LinearGenomeView/components/RubberbandTooltip.js +0 -20
- package/dist/LinearGenomeView/components/Scalebar.d.ts +0 -10
- package/dist/LinearGenomeView/components/Scalebar.js +0 -40
- package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.d.ts +0 -6
- package/dist/LinearGenomeView/components/ScalebarCoordinateLabels.js +0 -29
- package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
- package/dist/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -38
- package/dist/LinearGenomeView/components/ScalebarRefNameLabels.d.ts +0 -6
- package/dist/LinearGenomeView/components/ScalebarRefNameLabels.js +0 -46
- package/dist/LinearGenomeView/components/SearchBox.d.ts +0 -6
- package/dist/LinearGenomeView/components/SearchBox.js +0 -88
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -9
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +0 -15
- package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +0 -8
- package/dist/LinearGenomeView/components/SearchResultsTable.js +0 -74
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +0 -8
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +0 -67
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +0 -8
- package/dist/LinearGenomeView/components/TrackContainer.js +0 -51
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +0 -7
- package/dist/LinearGenomeView/components/TrackLabel.js +0 -49
- package/dist/LinearGenomeView/components/TrackLabelContainer.d.ts +0 -8
- package/dist/LinearGenomeView/components/TrackLabelContainer.js +0 -31
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.d.ts +0 -8
- package/dist/LinearGenomeView/components/TrackLabelDragHandle.js +0 -32
- package/dist/LinearGenomeView/components/TrackLabelMenu.d.ts +0 -5
- package/dist/LinearGenomeView/components/TrackLabelMenu.js +0 -93
- package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +0 -9
- package/dist/LinearGenomeView/components/TrackRenderingContainer.js +0 -50
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +0 -7
- package/dist/LinearGenomeView/components/TracksContainer.js +0 -84
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +0 -7
- package/dist/LinearGenomeView/components/VerticalGuide.js +0 -31
- package/dist/LinearGenomeView/components/fetchSequence.d.ts +0 -4
- package/dist/LinearGenomeView/components/fetchSequence.js +0 -29
- package/dist/LinearGenomeView/components/useRangeSelect.d.ts +0 -59
- package/dist/LinearGenomeView/components/useRangeSelect.js +0 -131
- package/dist/LinearGenomeView/components/useSideScroll.d.ts +0 -6
- package/dist/LinearGenomeView/components/useSideScroll.js +0 -60
- package/dist/LinearGenomeView/components/useWheelScroll.d.ts +0 -7
- package/dist/LinearGenomeView/components/useWheelScroll.js +0 -62
- package/dist/LinearGenomeView/components/util.d.ts +0 -25
- package/dist/LinearGenomeView/components/util.js +0 -49
- package/dist/LinearGenomeView/consts.d.ts +0 -7
- package/dist/LinearGenomeView/consts.js +0 -10
- package/dist/LinearGenomeView/index.d.ts +0 -3
- package/dist/LinearGenomeView/index.js +0 -53
- package/dist/LinearGenomeView/model.d.ts +0 -268
- package/dist/LinearGenomeView/model.js +0 -1109
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +0 -5
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.js +0 -10
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +0 -7
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +0 -47
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.d.ts +0 -6
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +0 -42
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.js +0 -8
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +0 -7
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.js +0 -39
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +0 -7
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.js +0 -17
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +0 -7
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +0 -14
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +0 -21
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.js +0 -32
- package/dist/LinearGenomeView/svgcomponents/util.d.ts +0 -8
- package/dist/LinearGenomeView/svgcomponents/util.js +0 -8
- package/dist/LinearGenomeView/types.d.ts +0 -43
- package/dist/LinearGenomeView/types.js +0 -2
- package/dist/LinearGenomeView/util.d.ts +0 -26
- package/dist/LinearGenomeView/util.js +0 -138
- package/dist/index.d.ts +0 -353
- package/dist/index.js +0 -120
- package/dist/searchUtils.d.ts +0 -26
- package/dist/searchUtils.js +0 -80
- package/esm/BaseLinearDisplay/components/BlockLoadingMessage.d.ts +0 -6
- package/esm/BaseLinearDisplay/components/BlockLoadingMessage.js +0 -24
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +0 -311
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +0 -286
- package/esm/LinearBasicDisplay/components/AddFiltersDialog.d.ts +0 -9
- package/esm/LinearBasicDisplay/components/SetMaxHeightDialog.d.ts +0 -8
- package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.d.ts +0 -6
- package/esm/LinearGenomeView/components/ScalebarCoordinateTicks.js +0 -36
- /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/AddFiltersDialog.d.ts +0 -0
- /package/{dist/LinearBasicDisplay → esm/LinearFeatureDisplay}/components/SetMaxHeightDialog.d.ts +0 -0
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { useEffect, useState } from 'react';
|
|
2
|
-
import { getRelativeX } from
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { getRelativeX } from "./util.js";
|
|
3
3
|
export function useRangeSelect(ref, model, shiftOnly) {
|
|
4
4
|
const [startX, setStartX] = useState();
|
|
5
5
|
const [currentX, setCurrentX] = useState();
|
|
6
6
|
const [anchorPosition, setAnchorPosition] = useState();
|
|
7
7
|
const [guideX, setGuideX] = useState();
|
|
8
8
|
const mouseDragging = startX !== undefined && anchorPosition === undefined;
|
|
9
|
+
const handleClose = useCallback(() => {
|
|
10
|
+
setAnchorPosition(undefined);
|
|
11
|
+
setStartX(undefined);
|
|
12
|
+
setCurrentX(undefined);
|
|
13
|
+
}, []);
|
|
9
14
|
useEffect(() => {
|
|
10
15
|
function computeOffsets(offsetX) {
|
|
11
16
|
if (startX === undefined) {
|
|
@@ -28,14 +33,18 @@ export function useRangeSelect(ref, model, shiftOnly) {
|
|
|
28
33
|
if (startX !== undefined && ref.current) {
|
|
29
34
|
const { clientX, clientY } = event;
|
|
30
35
|
const offsetX = getRelativeX(event, ref.current);
|
|
36
|
+
const isClick = Math.abs(offsetX - startX) <= 3;
|
|
31
37
|
setAnchorPosition({
|
|
32
38
|
offsetX,
|
|
33
39
|
clientX,
|
|
34
40
|
clientY,
|
|
41
|
+
isClick,
|
|
35
42
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
43
|
+
if (!isClick) {
|
|
44
|
+
const args = computeOffsets(offsetX);
|
|
45
|
+
if (args) {
|
|
46
|
+
model.setOffsets(args.leftOffset, args.rightOffset);
|
|
47
|
+
}
|
|
39
48
|
}
|
|
40
49
|
setGuideX(undefined);
|
|
41
50
|
}
|
|
@@ -49,15 +58,7 @@ export function useRangeSelect(ref, model, shiftOnly) {
|
|
|
49
58
|
};
|
|
50
59
|
}
|
|
51
60
|
return () => { };
|
|
52
|
-
}, [startX, mouseDragging, model, ref]);
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (!mouseDragging &&
|
|
55
|
-
currentX !== undefined &&
|
|
56
|
-
startX !== undefined &&
|
|
57
|
-
Math.abs(currentX - startX) <= 3) {
|
|
58
|
-
handleClose();
|
|
59
|
-
}
|
|
60
|
-
}, [mouseDragging, currentX, startX]);
|
|
61
|
+
}, [startX, mouseDragging, model, ref, handleClose]);
|
|
61
62
|
function mouseDown(event) {
|
|
62
63
|
if (shiftOnly && !event.shiftKey) {
|
|
63
64
|
return;
|
|
@@ -84,24 +85,27 @@ export function useRangeSelect(ref, model, shiftOnly) {
|
|
|
84
85
|
function mouseOut() {
|
|
85
86
|
setGuideX(undefined);
|
|
86
87
|
}
|
|
87
|
-
function handleClose() {
|
|
88
|
-
setAnchorPosition(undefined);
|
|
89
|
-
setStartX(undefined);
|
|
90
|
-
setCurrentX(undefined);
|
|
91
|
-
}
|
|
92
88
|
function handleMenuItemClick(_, callback) {
|
|
93
89
|
callback();
|
|
94
90
|
handleClose();
|
|
95
91
|
}
|
|
96
92
|
const open = Boolean(anchorPosition);
|
|
93
|
+
const isClick = anchorPosition?.isClick;
|
|
94
|
+
const clickBpOffset = isClick
|
|
95
|
+
? model.pxToBp(anchorPosition.offsetX)
|
|
96
|
+
: undefined;
|
|
97
97
|
if (startX === undefined) {
|
|
98
98
|
return {
|
|
99
99
|
open,
|
|
100
|
+
isClick,
|
|
101
|
+
clickBpOffset,
|
|
100
102
|
guideX,
|
|
101
103
|
mouseDown,
|
|
102
104
|
mouseMove,
|
|
103
105
|
mouseOut,
|
|
106
|
+
handleClose,
|
|
104
107
|
handleMenuItemClick,
|
|
108
|
+
anchorPosition,
|
|
105
109
|
};
|
|
106
110
|
}
|
|
107
111
|
const right = anchorPosition ? anchorPosition.offsetX : currentX || 0;
|
|
@@ -112,7 +116,9 @@ export function useRangeSelect(ref, model, shiftOnly) {
|
|
|
112
116
|
const numOfBpSelected = Math.ceil(width * model.bpPerPx);
|
|
113
117
|
return {
|
|
114
118
|
open,
|
|
115
|
-
|
|
119
|
+
isClick,
|
|
120
|
+
clickBpOffset,
|
|
121
|
+
rubberbandOn: !isClick,
|
|
116
122
|
mouseDown,
|
|
117
123
|
mouseMove,
|
|
118
124
|
mouseOut,
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { sum } from '@jbrowse/core/util';
|
|
3
3
|
export function useWheelScroll(ref, model) {
|
|
4
|
-
const
|
|
4
|
+
const zoomDelta = useRef(0);
|
|
5
|
+
const scrollDelta = useRef(0);
|
|
5
6
|
const timeout = useRef(null);
|
|
7
|
+
const rafId = useRef(0);
|
|
6
8
|
const scheduled = useRef(false);
|
|
7
9
|
useEffect(() => {
|
|
8
10
|
let samples = [];
|
|
@@ -19,17 +21,19 @@ export function useWheelScroll(ref, model) {
|
|
|
19
21
|
? 500
|
|
20
22
|
: 150
|
|
21
23
|
: 75;
|
|
22
|
-
|
|
23
|
-
model.setScaleFactor(
|
|
24
|
+
zoomDelta.current += event.deltaY / normalizer;
|
|
25
|
+
model.setScaleFactor(zoomDelta.current < 0
|
|
26
|
+
? 1 - zoomDelta.current
|
|
27
|
+
: 1 / (1 + zoomDelta.current));
|
|
24
28
|
if (timeout.current) {
|
|
25
29
|
clearTimeout(timeout.current);
|
|
26
30
|
}
|
|
27
31
|
timeout.current = setTimeout(() => {
|
|
28
32
|
model.setScaleFactor(1);
|
|
29
|
-
model.zoomTo(
|
|
30
|
-
? model.bpPerPx * (1 +
|
|
31
|
-
: model.bpPerPx / (1 -
|
|
32
|
-
|
|
33
|
+
model.zoomTo(zoomDelta.current > 0
|
|
34
|
+
? model.bpPerPx * (1 + zoomDelta.current)
|
|
35
|
+
: model.bpPerPx / (1 - zoomDelta.current), event.clientX - (curr?.getBoundingClientRect().left || 0));
|
|
36
|
+
zoomDelta.current = 0;
|
|
33
37
|
samples = [];
|
|
34
38
|
}, 300);
|
|
35
39
|
}
|
|
@@ -37,21 +41,27 @@ export function useWheelScroll(ref, model) {
|
|
|
37
41
|
if (Math.abs(event.deltaX) > Math.abs(2 * event.deltaY)) {
|
|
38
42
|
event.preventDefault();
|
|
39
43
|
}
|
|
40
|
-
|
|
44
|
+
scrollDelta.current += event.deltaX;
|
|
41
45
|
if (!scheduled.current) {
|
|
42
46
|
scheduled.current = true;
|
|
43
|
-
window.requestAnimationFrame(() => {
|
|
44
|
-
model.horizontalScroll(
|
|
45
|
-
|
|
47
|
+
rafId.current = window.requestAnimationFrame(() => {
|
|
48
|
+
model.horizontalScroll(scrollDelta.current);
|
|
49
|
+
scrollDelta.current = 0;
|
|
46
50
|
scheduled.current = false;
|
|
47
51
|
});
|
|
48
52
|
}
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
55
|
if (curr) {
|
|
52
|
-
curr.addEventListener('wheel', onWheel);
|
|
56
|
+
curr.addEventListener('wheel', onWheel, { passive: false });
|
|
53
57
|
return () => {
|
|
54
58
|
curr.removeEventListener('wheel', onWheel);
|
|
59
|
+
if (timeout.current) {
|
|
60
|
+
clearTimeout(timeout.current);
|
|
61
|
+
}
|
|
62
|
+
if (rafId.current) {
|
|
63
|
+
cancelAnimationFrame(rafId.current);
|
|
64
|
+
}
|
|
55
65
|
};
|
|
56
66
|
}
|
|
57
67
|
return () => { };
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import BaseResult from '@jbrowse/core/TextSearch/BaseResults';
|
|
2
|
-
import type { SearchScope } from '@jbrowse/core/TextSearch/TextSearchManager';
|
|
3
1
|
import type { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
4
|
-
|
|
5
|
-
import type { TextSearchManager } from '@jbrowse/core/util';
|
|
6
|
-
export declare function fetchResults({ queryString, searchType, searchScope, rankSearchResults, textSearchManager, assembly, }: {
|
|
7
|
-
queryString: string;
|
|
8
|
-
searchScope: SearchScope;
|
|
9
|
-
rankSearchResults: (results: BaseResult[]) => BaseResult[];
|
|
10
|
-
searchType?: SearchType;
|
|
11
|
-
textSearchManager?: TextSearchManager;
|
|
12
|
-
assembly?: Assembly;
|
|
13
|
-
}): Promise<BaseResult[]>;
|
|
14
|
-
export declare function splitLast(str: string, split: string): [string, string];
|
|
2
|
+
export { fetchResults, splitLast } from '../../searchUtils.ts';
|
|
15
3
|
export declare function getRelativeX(event: {
|
|
16
4
|
clientX: number;
|
|
17
5
|
target: EventTarget | null;
|
|
@@ -23,3 +11,4 @@ export declare function getCytobands(assembly: Assembly | undefined, refName: st
|
|
|
23
11
|
type: string;
|
|
24
12
|
name: any;
|
|
25
13
|
}[];
|
|
14
|
+
export declare function shouldSwapTracks(lastSwapY: number | undefined, currentY: number, movingDown: boolean): boolean;
|
|
@@ -1,40 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import { dedupe } from '@jbrowse/core/util';
|
|
3
|
-
export async function fetchResults({ queryString, searchType, searchScope, rankSearchResults, textSearchManager, assembly, }) {
|
|
4
|
-
var _a;
|
|
5
|
-
if (!textSearchManager) {
|
|
6
|
-
console.warn('No text search manager');
|
|
7
|
-
}
|
|
8
|
-
const textSearchResults = (await (textSearchManager === null || textSearchManager === void 0 ? void 0 : textSearchManager.search({
|
|
9
|
-
queryString,
|
|
10
|
-
searchType,
|
|
11
|
-
}, searchScope, rankSearchResults))) || [];
|
|
12
|
-
const refNameResults = ((_a = assembly === null || assembly === void 0 ? void 0 : assembly.allRefNames) === null || _a === void 0 ? void 0 : _a.filter(ref => ref.toLowerCase().startsWith(queryString.toLowerCase())).slice(0, 10).map(r => new BaseResult({
|
|
13
|
-
label: r,
|
|
14
|
-
}))) || [];
|
|
15
|
-
return dedupe([...refNameResults, ...textSearchResults], elt => elt.getId());
|
|
16
|
-
}
|
|
17
|
-
export function splitLast(str, split) {
|
|
18
|
-
const lastIndex = str.lastIndexOf(split);
|
|
19
|
-
if (lastIndex === -1) {
|
|
20
|
-
return [str, ''];
|
|
21
|
-
}
|
|
22
|
-
else {
|
|
23
|
-
const before = str.slice(0, lastIndex);
|
|
24
|
-
const after = str.slice(lastIndex + 1);
|
|
25
|
-
return [before, after];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
1
|
+
export { fetchResults, splitLast } from "../../searchUtils.js";
|
|
28
2
|
export function getRelativeX(event, element) {
|
|
29
|
-
return event.clientX - (
|
|
3
|
+
return event.clientX - (element?.getBoundingClientRect().left || 0);
|
|
30
4
|
}
|
|
31
5
|
export function getCytobands(assembly, refName) {
|
|
32
|
-
|
|
33
|
-
|
|
6
|
+
return (assembly?.cytobands
|
|
7
|
+
?.map(f => ({
|
|
34
8
|
refName: assembly.getCanonicalRefName(f.get('refName')) || f.get('refName'),
|
|
35
9
|
start: f.get('start'),
|
|
36
10
|
end: f.get('end'),
|
|
37
11
|
type: f.get('gieStain'),
|
|
38
12
|
name: f.get('name'),
|
|
39
|
-
}))
|
|
13
|
+
}))
|
|
14
|
+
.filter(f => f.refName === refName) || []);
|
|
15
|
+
}
|
|
16
|
+
const MIN_DRAG_DISTANCE = 30;
|
|
17
|
+
export function shouldSwapTracks(lastSwapY, currentY, movingDown) {
|
|
18
|
+
return (lastSwapY === undefined ||
|
|
19
|
+
(movingDown && currentY > lastSwapY + MIN_DRAG_DISTANCE) ||
|
|
20
|
+
(!movingDown && currentY < lastSwapY - MIN_DRAG_DISTANCE));
|
|
40
21
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
2
|
import { ViewType } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
-
import { stateModelFactory } from
|
|
3
|
+
import { stateModelFactory } from "./model.js";
|
|
4
4
|
export default function LinearGenomeViewF(pluginManager) {
|
|
5
5
|
pluginManager.addViewType(() => {
|
|
6
6
|
return new ViewType({
|
|
7
7
|
name: 'LinearGenomeView',
|
|
8
8
|
displayName: 'Linear genome view',
|
|
9
9
|
stateModel: stateModelFactory(pluginManager),
|
|
10
|
-
ReactComponent: lazy(() => import(
|
|
10
|
+
ReactComponent: lazy(() => import("./components/LinearGenomeView.js")),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export * from
|
|
14
|
+
export * from "./model.js";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { getSession } from '@jbrowse/core/util';
|
|
2
|
+
import { addDisposer } from '@jbrowse/mobx-state-tree';
|
|
3
|
+
export function setupKeyboardHandler(self) {
|
|
4
|
+
function handler(e) {
|
|
5
|
+
const session = getSession(self);
|
|
6
|
+
if (session.focusedViewId === self.id && (e.ctrlKey || e.metaKey)) {
|
|
7
|
+
if (e.code === 'ArrowLeft') {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
self.slide(-0.9);
|
|
10
|
+
}
|
|
11
|
+
else if (e.code === 'ArrowRight') {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
self.slide(0.9);
|
|
14
|
+
}
|
|
15
|
+
else if (e.code === 'ArrowUp') {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
self.zoom(self.bpPerPx / 2);
|
|
18
|
+
}
|
|
19
|
+
else if (e.code === 'ArrowDown') {
|
|
20
|
+
e.preventDefault();
|
|
21
|
+
self.zoom(self.bpPerPx * 2);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
document.addEventListener('keydown', handler);
|
|
26
|
+
addDisposer(self, () => {
|
|
27
|
+
document.removeEventListener('keydown', handler);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LinearGenomeViewModel } from './model.ts';
|
|
2
|
+
import type { BpOffset } from './types.ts';
|
|
3
|
+
import type { MenuItem } from '@jbrowse/core/ui';
|
|
4
|
+
export declare function rewriteOnClicks(self: LinearGenomeViewModel, trackType: string, viewMenuActions: MenuItem[]): void;
|
|
5
|
+
export declare function buildMenuItems(self: LinearGenomeViewModel): MenuItem[];
|
|
6
|
+
export declare function buildRubberBandMenuItems(self: LinearGenomeViewModel): MenuItem[];
|
|
7
|
+
export declare function buildRubberbandClickMenuItems(self: LinearGenomeViewModel, clickOffset: BpOffset): MenuItem[];
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { lazy } from 'react';
|
|
2
|
+
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
|
|
3
|
+
import { getSession, isSessionWithAddTracks, toLocale, } from '@jbrowse/core/util';
|
|
4
|
+
import CenterFocusStrongIcon from '@mui/icons-material/CenterFocusStrong';
|
|
5
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
|
|
6
|
+
import FolderOpenIcon from '@mui/icons-material/FolderOpen';
|
|
7
|
+
import LabelIcon from '@mui/icons-material/Label';
|
|
8
|
+
import MenuOpenIcon from '@mui/icons-material/MenuOpen';
|
|
9
|
+
import PaletteIcon from '@mui/icons-material/Palette';
|
|
10
|
+
import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
|
|
11
|
+
import SearchIcon from '@mui/icons-material/Search';
|
|
12
|
+
import SyncAltIcon from '@mui/icons-material/SyncAlt';
|
|
13
|
+
import VisibilityIcon from '@mui/icons-material/Visibility';
|
|
14
|
+
import ZoomInIcon from '@mui/icons-material/ZoomIn';
|
|
15
|
+
const ReturnToImportFormDialog = lazy(() => import('@jbrowse/core/ui/ReturnToImportFormDialog'));
|
|
16
|
+
const SequenceSearchDialog = lazy(() => import("./components/SequenceSearchDialog.js"));
|
|
17
|
+
const ExportSvgDialog = lazy(() => import("./components/ExportSvgDialog.js"));
|
|
18
|
+
const GetSequenceDialog = lazy(() => import("./components/GetSequenceDialog.js"));
|
|
19
|
+
function toLocaleRounded(n) {
|
|
20
|
+
return toLocale(Math.round(n));
|
|
21
|
+
}
|
|
22
|
+
export function rewriteOnClicks(self, trackType, viewMenuActions) {
|
|
23
|
+
for (const action of viewMenuActions) {
|
|
24
|
+
if ('subMenu' in action) {
|
|
25
|
+
rewriteOnClicks(self, trackType, action.subMenu);
|
|
26
|
+
}
|
|
27
|
+
if ('onClick' in action) {
|
|
28
|
+
const holdOnClick = action.onClick;
|
|
29
|
+
action.onClick = (...args) => {
|
|
30
|
+
for (const track of self.tracks) {
|
|
31
|
+
if (track.type === trackType) {
|
|
32
|
+
holdOnClick.apply(track, [track, ...args]);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export function buildMenuItems(self) {
|
|
40
|
+
if (!self.hasDisplayedRegions) {
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
const { canShowCytobands, showCytobands } = self;
|
|
44
|
+
const session = getSession(self);
|
|
45
|
+
const menuItems = [
|
|
46
|
+
{
|
|
47
|
+
label: 'Return to import form',
|
|
48
|
+
onClick: () => {
|
|
49
|
+
session.queueDialog(handleClose => [
|
|
50
|
+
ReturnToImportFormDialog,
|
|
51
|
+
{
|
|
52
|
+
model: self,
|
|
53
|
+
handleClose,
|
|
54
|
+
},
|
|
55
|
+
]);
|
|
56
|
+
},
|
|
57
|
+
icon: FolderOpenIcon,
|
|
58
|
+
},
|
|
59
|
+
...(isSessionWithAddTracks(session)
|
|
60
|
+
? [
|
|
61
|
+
{
|
|
62
|
+
label: 'Sequence search',
|
|
63
|
+
icon: SearchIcon,
|
|
64
|
+
onClick: () => {
|
|
65
|
+
session.queueDialog(handleClose => [
|
|
66
|
+
SequenceSearchDialog,
|
|
67
|
+
{
|
|
68
|
+
model: self,
|
|
69
|
+
handleClose,
|
|
70
|
+
},
|
|
71
|
+
]);
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: []),
|
|
76
|
+
{
|
|
77
|
+
label: 'Export SVG',
|
|
78
|
+
icon: PhotoCameraIcon,
|
|
79
|
+
onClick: () => {
|
|
80
|
+
session.queueDialog(handleClose => [
|
|
81
|
+
ExportSvgDialog,
|
|
82
|
+
{
|
|
83
|
+
model: self,
|
|
84
|
+
handleClose,
|
|
85
|
+
},
|
|
86
|
+
]);
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
label: 'Open track selector',
|
|
91
|
+
onClick: self.activateTrackSelector,
|
|
92
|
+
icon: TrackSelectorIcon,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'Horizontally flip',
|
|
96
|
+
icon: SyncAltIcon,
|
|
97
|
+
onClick: self.horizontallyFlip,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
label: 'Color by CDS and draw amino acids',
|
|
101
|
+
type: 'checkbox',
|
|
102
|
+
checked: self.colorByCDS,
|
|
103
|
+
icon: PaletteIcon,
|
|
104
|
+
onClick: () => {
|
|
105
|
+
self.setColorByCDS(!self.colorByCDS);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
label: 'Show...',
|
|
110
|
+
icon: VisibilityIcon,
|
|
111
|
+
subMenu: [
|
|
112
|
+
{
|
|
113
|
+
label: 'Show all regions in assembly',
|
|
114
|
+
onClick: self.showAllRegionsInAssembly,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
label: 'Show center line',
|
|
118
|
+
type: 'checkbox',
|
|
119
|
+
checked: self.showCenterLine,
|
|
120
|
+
onClick: () => {
|
|
121
|
+
self.setShowCenterLine(!self.showCenterLine);
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: 'Show header',
|
|
126
|
+
type: 'checkbox',
|
|
127
|
+
checked: !self.hideHeader,
|
|
128
|
+
onClick: () => {
|
|
129
|
+
self.setHideHeader(!self.hideHeader);
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: 'Show track outlines',
|
|
134
|
+
type: 'checkbox',
|
|
135
|
+
checked: self.showTrackOutlines,
|
|
136
|
+
onClick: () => {
|
|
137
|
+
self.setShowTrackOutlines(!self.showTrackOutlines);
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
label: 'Show header overview',
|
|
142
|
+
type: 'checkbox',
|
|
143
|
+
checked: !self.hideHeaderOverview,
|
|
144
|
+
onClick: () => {
|
|
145
|
+
self.setHideHeaderOverview(!self.hideHeaderOverview);
|
|
146
|
+
},
|
|
147
|
+
disabled: self.hideHeader,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: 'Show no tracks active button',
|
|
151
|
+
type: 'checkbox',
|
|
152
|
+
checked: !self.hideNoTracksActive,
|
|
153
|
+
onClick: () => {
|
|
154
|
+
self.setHideNoTracksActive(!self.hideNoTracksActive);
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: 'Show guidelines',
|
|
159
|
+
type: 'checkbox',
|
|
160
|
+
checked: self.showGridlines,
|
|
161
|
+
onClick: () => {
|
|
162
|
+
self.setShowGridlines(!self.showGridlines);
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
...(canShowCytobands
|
|
166
|
+
? [
|
|
167
|
+
{
|
|
168
|
+
label: 'Show ideogram',
|
|
169
|
+
type: 'checkbox',
|
|
170
|
+
checked: self.showCytobands,
|
|
171
|
+
onClick: () => {
|
|
172
|
+
self.setShowCytobands(!showCytobands);
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
]
|
|
176
|
+
: []),
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
label: 'Track labels',
|
|
181
|
+
icon: LabelIcon,
|
|
182
|
+
subMenu: [
|
|
183
|
+
{
|
|
184
|
+
label: 'Overlapping',
|
|
185
|
+
icon: VisibilityIcon,
|
|
186
|
+
type: 'radio',
|
|
187
|
+
checked: self.trackLabelsSetting === 'overlapping',
|
|
188
|
+
onClick: () => {
|
|
189
|
+
self.setTrackLabels('overlapping');
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
label: 'Offset',
|
|
194
|
+
icon: VisibilityIcon,
|
|
195
|
+
type: 'radio',
|
|
196
|
+
checked: self.trackLabelsSetting === 'offset',
|
|
197
|
+
onClick: () => {
|
|
198
|
+
self.setTrackLabels('offset');
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
label: 'Hidden',
|
|
203
|
+
icon: VisibilityIcon,
|
|
204
|
+
type: 'radio',
|
|
205
|
+
checked: self.trackLabelsSetting === 'hidden',
|
|
206
|
+
onClick: () => {
|
|
207
|
+
self.setTrackLabels('hidden');
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
},
|
|
212
|
+
];
|
|
213
|
+
for (const [key, value] of self.trackTypeActions.entries()) {
|
|
214
|
+
if (value.length) {
|
|
215
|
+
menuItems.push({
|
|
216
|
+
type: 'divider',
|
|
217
|
+
}, {
|
|
218
|
+
type: 'subHeader',
|
|
219
|
+
label: key,
|
|
220
|
+
});
|
|
221
|
+
for (const action of value) {
|
|
222
|
+
menuItems.push(action);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return menuItems;
|
|
227
|
+
}
|
|
228
|
+
export function buildRubberBandMenuItems(self) {
|
|
229
|
+
const { leftOffset, rightOffset } = self;
|
|
230
|
+
const leftRef = leftOffset?.refName ?? '';
|
|
231
|
+
const rightRef = rightOffset?.refName ?? '';
|
|
232
|
+
const leftCoord = toLocaleRounded((leftOffset?.coord ?? 0) + 1);
|
|
233
|
+
const rightCoord = toLocaleRounded(rightOffset?.coord ?? 0);
|
|
234
|
+
const rangeString = leftRef === rightRef
|
|
235
|
+
? `${leftRef}:${leftCoord}-${rightCoord}`
|
|
236
|
+
: `${leftRef}:${leftCoord}..${rightRef}:${rightCoord}`;
|
|
237
|
+
return [
|
|
238
|
+
{
|
|
239
|
+
label: 'Zoom to region',
|
|
240
|
+
icon: ZoomInIcon,
|
|
241
|
+
onClick: () => {
|
|
242
|
+
self.moveTo(self.leftOffset, self.rightOffset);
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
label: 'Get sequence',
|
|
247
|
+
icon: MenuOpenIcon,
|
|
248
|
+
onClick: () => {
|
|
249
|
+
getSession(self).queueDialog(handleClose => [
|
|
250
|
+
GetSequenceDialog,
|
|
251
|
+
{
|
|
252
|
+
model: self,
|
|
253
|
+
handleClose,
|
|
254
|
+
},
|
|
255
|
+
]);
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: 'Copy range',
|
|
260
|
+
icon: ContentCopyIcon,
|
|
261
|
+
onClick: async () => {
|
|
262
|
+
const { default: copy } = await import('copy-to-clipboard');
|
|
263
|
+
copy(rangeString);
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
export function buildRubberbandClickMenuItems(self, clickOffset) {
|
|
269
|
+
const { coord, refName } = clickOffset;
|
|
270
|
+
if (coord === undefined || refName === undefined) {
|
|
271
|
+
return [];
|
|
272
|
+
}
|
|
273
|
+
const locString = `${refName}:${toLocaleRounded(coord + 1)}`;
|
|
274
|
+
return [
|
|
275
|
+
{
|
|
276
|
+
label: 'Center view here',
|
|
277
|
+
icon: CenterFocusStrongIcon,
|
|
278
|
+
onClick: () => {
|
|
279
|
+
self.centerAt(coord, refName);
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
label: 'Zoom to base level',
|
|
284
|
+
icon: ZoomInIcon,
|
|
285
|
+
onClick: () => {
|
|
286
|
+
self.centerAt(coord, refName);
|
|
287
|
+
self.zoomTo(self.minBpPerPx);
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
label: `Copy coordinate (${locString})`,
|
|
292
|
+
icon: ContentCopyIcon,
|
|
293
|
+
onClick: async () => {
|
|
294
|
+
const { default: copy } = await import('copy-to-clipboard');
|
|
295
|
+
copy(locString);
|
|
296
|
+
},
|
|
297
|
+
},
|
|
298
|
+
];
|
|
299
|
+
}
|