@jbrowse/plugin-linear-genome-view 2.4.2 → 2.6.1
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/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/Block.d.ts +3 -3
- package/dist/BaseLinearDisplay/components/BlockMsg.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +3 -3
- package/dist/BaseLinearDisplay/components/TooLargeMessage.d.ts +5 -5
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +2 -2
- package/dist/BaseLinearDisplay/index.d.ts +5 -2
- package/dist/BaseLinearDisplay/index.js +7 -1
- package/dist/BaseLinearDisplay/index.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +107 -126
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +37 -352
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +99 -0
- package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js +190 -0
- package/dist/BaseLinearDisplay/models/FeatureDensityMixin.js.map +1 -0
- package/dist/BaseLinearDisplay/models/TrackHeightMixin.d.ts +30 -0
- package/dist/BaseLinearDisplay/models/TrackHeightMixin.js +56 -0
- package/dist/BaseLinearDisplay/models/TrackHeightMixin.js.map +1 -0
- package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +2 -0
- package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js +42 -0
- package/dist/BaseLinearDisplay/models/autorunFeatureDensityStats.js.map +1 -0
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +35 -1
- package/dist/BaseLinearDisplay/models/configSchema.js +10 -0
- package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/dist/BaseLinearDisplay/models/renderSvg.d.ts +8 -0
- package/dist/BaseLinearDisplay/models/renderSvg.js +83 -0
- package/dist/BaseLinearDisplay/models/renderSvg.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +30 -22
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/BaseLinearDisplay/models/util.d.ts +6 -2
- package/dist/BaseLinearDisplay/models/util.js +4 -4
- package/dist/BaseLinearDisplay/models/util.js.map +1 -1
- package/dist/BasicTrack/configSchema.d.ts +73 -1
- package/dist/BasicTrack/configSchema.js +1 -0
- package/dist/BasicTrack/configSchema.js.map +1 -1
- package/dist/FeatureTrack/configSchema.d.ts +73 -1
- package/dist/FeatureTrack/configSchema.js +1 -0
- package/dist/FeatureTrack/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/configSchema.d.ts +29 -1
- package/dist/LinearBareDisplay/configSchema.js +1 -0
- package/dist/LinearBareDisplay/configSchema.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +106 -42
- package/dist/LinearBareDisplay/model.js +3 -2
- package/dist/LinearBareDisplay/model.js.map +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +2 -2
- package/dist/LinearBasicDisplay/configSchema.d.ts +29 -1
- package/dist/LinearBasicDisplay/configSchema.js +1 -9
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +124 -62
- package/dist/LinearBasicDisplay/model.js +1 -0
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -2
- package/dist/LinearGenomeView/components/Cytobands.d.ts +24 -24
- package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +2 -2
- package/dist/LinearGenomeView/components/GetSequenceDialog.d.ts +2 -2
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +14 -16
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/Gridlines.d.ts +2 -2
- package/dist/LinearGenomeView/components/Header.d.ts +2 -2
- package/dist/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/dist/LinearGenomeView/components/ImportForm.js +4 -7
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +2 -2
- package/dist/LinearGenomeView/components/LinearGenomeView.js +28 -8
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/components/MiniControls.d.ts +3 -3
- package/dist/LinearGenomeView/components/MiniControls.js +20 -40
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/dist/LinearGenomeView/components/OverviewScalebar.js +12 -5
- package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +10 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +22 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +5 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +52 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js.map +1 -0
- package/dist/LinearGenomeView/components/{HelpDialog.d.ts → RefNameAutocomplete/HelpDialog.d.ts} +2 -2
- package/dist/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +18 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +111 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +12 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js +59 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete/util.js.map +1 -0
- package/dist/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
- package/dist/LinearGenomeView/components/SearchBox.d.ts +2 -2
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -4
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +6 -82
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsTable.d.ts +9 -0
- package/dist/LinearGenomeView/components/SearchResultsTable.js +83 -0
- package/dist/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/dist/LinearGenomeView/components/TrackContainer.d.ts +3 -4
- package/dist/LinearGenomeView/components/TrackContainer.js +17 -67
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabel.js +6 -10
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackLabelContainer.d.ts +9 -0
- package/dist/LinearGenomeView/components/TrackLabelContainer.js +32 -0
- package/dist/LinearGenomeView/components/TrackLabelContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackRenderingContainer.d.ts +10 -0
- package/dist/LinearGenomeView/components/TrackRenderingContainer.js +74 -0
- package/dist/LinearGenomeView/components/TrackRenderingContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +5 -7
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +2 -2
- package/dist/LinearGenomeView/components/ZoomControls.d.ts +2 -2
- package/dist/LinearGenomeView/components/util.js +1 -1
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/model.d.ts +51 -37
- package/dist/LinearGenomeView/model.js +132 -209
- package/dist/LinearGenomeView/model.js.map +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGBackground.d.ts +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.d.ts +3 -5
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +7 -2
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGRuler.d.ts +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +2 -2
- package/dist/LinearGenomeView/svgcomponents/SVGTracks.d.ts +2 -2
- package/dist/LinearGenomeView/util.d.ts +29 -0
- package/dist/LinearGenomeView/util.js +79 -1
- package/dist/LinearGenomeView/util.js.map +1 -1
- package/dist/index.d.ts +325 -180
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/Block.d.ts +3 -3
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +3 -3
- package/esm/BaseLinearDisplay/components/TooLargeMessage.d.ts +5 -5
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +7 -3
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +2 -2
- package/esm/BaseLinearDisplay/index.d.ts +5 -2
- package/esm/BaseLinearDisplay/index.js +3 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +107 -126
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +39 -331
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.d.ts +99 -0
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js +184 -0
- package/esm/BaseLinearDisplay/models/FeatureDensityMixin.js.map +1 -0
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.d.ts +30 -0
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js +53 -0
- package/esm/BaseLinearDisplay/models/TrackHeightMixin.js.map +1 -0
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.d.ts +2 -0
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js +39 -0
- package/esm/BaseLinearDisplay/models/autorunFeatureDensityStats.js.map +1 -0
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +35 -1
- package/esm/BaseLinearDisplay/models/configSchema.js +10 -0
- package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -1
- package/esm/BaseLinearDisplay/models/renderSvg.d.ts +8 -0
- package/esm/BaseLinearDisplay/models/renderSvg.js +54 -0
- package/esm/BaseLinearDisplay/models/renderSvg.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +30 -22
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/BaseLinearDisplay/models/util.d.ts +6 -2
- package/esm/BaseLinearDisplay/models/util.js +2 -2
- package/esm/BaseLinearDisplay/models/util.js.map +1 -1
- package/esm/BasicTrack/configSchema.d.ts +73 -1
- package/esm/BasicTrack/configSchema.js +1 -0
- package/esm/BasicTrack/configSchema.js.map +1 -1
- package/esm/FeatureTrack/configSchema.d.ts +73 -1
- package/esm/FeatureTrack/configSchema.js +1 -0
- package/esm/FeatureTrack/configSchema.js.map +1 -1
- package/esm/LinearBareDisplay/configSchema.d.ts +29 -1
- package/esm/LinearBareDisplay/configSchema.js +1 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +106 -42
- package/esm/LinearBareDisplay/model.js +2 -1
- package/esm/LinearBareDisplay/model.js.map +1 -1
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +2 -2
- package/esm/LinearBasicDisplay/configSchema.d.ts +29 -1
- package/esm/LinearBasicDisplay/configSchema.js +1 -9
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +124 -62
- package/esm/LinearBasicDisplay/model.js +1 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/CenterLine.d.ts +2 -2
- package/esm/LinearGenomeView/components/Cytobands.d.ts +24 -24
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/GetSequenceDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +15 -17
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/Gridlines.d.ts +2 -2
- package/esm/LinearGenomeView/components/Header.d.ts +2 -2
- package/esm/LinearGenomeView/components/ImportForm.d.ts +2 -2
- package/esm/LinearGenomeView/components/ImportForm.js +5 -8
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +2 -2
- package/esm/LinearGenomeView/components/LinearGenomeView.js +4 -7
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/components/MiniControls.d.ts +3 -3
- package/esm/LinearGenomeView/components/MiniControls.js +20 -17
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -1
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.d.ts +2 -2
- package/esm/LinearGenomeView/components/OverviewScalebar.js +12 -5
- package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.d.ts +10 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js +16 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.d.ts +5 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js +23 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.js.map +1 -0
- package/esm/LinearGenomeView/components/{HelpDialog.d.ts → RefNameAutocomplete/HelpDialog.d.ts} +2 -2
- package/esm/LinearGenomeView/components/RefNameAutocomplete/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +18 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +83 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.d.ts +12 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js +50 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete/util.js.map +1 -0
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +2 -2
- package/esm/LinearGenomeView/components/SearchBox.d.ts +2 -2
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -4
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +7 -83
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsTable.d.ts +9 -0
- package/esm/LinearGenomeView/components/SearchResultsTable.js +77 -0
- package/esm/LinearGenomeView/components/SearchResultsTable.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceSearchDialog.d.ts +2 -2
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +3 -4
- package/esm/LinearGenomeView/components/TrackContainer.js +18 -68
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabel.js +6 -10
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackLabelContainer.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackLabelContainer.js +27 -0
- package/esm/LinearGenomeView/components/TrackLabelContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.d.ts +10 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js +49 -0
- package/esm/LinearGenomeView/components/TrackRenderingContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +5 -7
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +2 -2
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +2 -2
- package/esm/LinearGenomeView/components/util.js +1 -1
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/model.d.ts +51 -37
- package/esm/LinearGenomeView/model.js +129 -206
- package/esm/LinearGenomeView/model.js.map +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGBackground.d.ts +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.d.ts +3 -5
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +7 -2
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js.map +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js.map +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGRegionSeparators.d.ts +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGRuler.d.ts +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGScalebar.d.ts +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.d.ts +2 -2
- package/esm/LinearGenomeView/svgcomponents/SVGTracks.d.ts +2 -2
- package/esm/LinearGenomeView/util.d.ts +29 -0
- package/esm/LinearGenomeView/util.js +76 -0
- package/esm/LinearGenomeView/util.js.map +1 -1
- package/esm/index.d.ts +325 -180
- package/esm/index.js +1 -1
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/BaseLinearDisplay/components/TooLargeMessage.tsx +10 -6
- package/src/BaseLinearDisplay/index.ts +5 -1
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +50 -401
- package/src/BaseLinearDisplay/models/FeatureDensityMixin.tsx +213 -0
- package/src/BaseLinearDisplay/models/TrackHeightMixin.tsx +59 -0
- package/src/BaseLinearDisplay/models/autorunFeatureDensityStats.ts +46 -0
- package/src/BaseLinearDisplay/models/configSchema.ts +11 -0
- package/src/BaseLinearDisplay/models/renderSvg.tsx +101 -0
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +40 -32
- package/src/BaseLinearDisplay/models/util.ts +10 -4
- package/src/BasicTrack/configSchema.ts +1 -0
- package/src/FeatureTrack/configSchema.ts +1 -0
- package/src/LinearBareDisplay/configSchema.ts +1 -0
- package/src/LinearBareDisplay/model.ts +2 -1
- package/src/LinearBasicDisplay/configSchema.ts +1 -10
- package/src/LinearBasicDisplay/model.ts +1 -0
- package/src/LinearGenomeView/components/GetSequenceDialog.tsx +15 -25
- package/src/LinearGenomeView/components/ImportForm.tsx +4 -14
- package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +3 -3
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +6 -17
- package/src/LinearGenomeView/components/MiniControls.tsx +37 -38
- package/src/LinearGenomeView/components/OverviewScalebar.tsx +13 -6
- package/src/LinearGenomeView/components/RefNameAutocomplete/AutocompleteTextField.tsx +53 -0
- package/src/LinearGenomeView/components/RefNameAutocomplete/EndAdornment.tsx +44 -0
- package/src/LinearGenomeView/components/RefNameAutocomplete/index.tsx +160 -0
- package/src/LinearGenomeView/components/RefNameAutocomplete/util.ts +65 -0
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -112
- package/src/LinearGenomeView/components/SearchResultsTable.tsx +121 -0
- package/src/LinearGenomeView/components/TrackContainer.tsx +25 -104
- package/src/LinearGenomeView/components/TrackLabel.tsx +7 -27
- package/src/LinearGenomeView/components/TrackLabelContainer.tsx +48 -0
- package/src/LinearGenomeView/components/TrackRenderingContainer.tsx +96 -0
- package/src/LinearGenomeView/components/TracksContainer.tsx +9 -6
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +14 -14
- package/src/LinearGenomeView/components/util.ts +2 -1
- package/src/LinearGenomeView/index.test.ts +10 -12
- package/src/LinearGenomeView/model.ts +175 -247
- package/src/LinearGenomeView/svgcomponents/SVGHeader.tsx +8 -6
- package/src/LinearGenomeView/svgcomponents/SVGLinearGenomeView.tsx +1 -1
- package/src/LinearGenomeView/util.ts +98 -0
- package/src/index.ts +11 -5
- package/dist/LinearGenomeView/components/HelpDialog.js.map +0 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +0 -23
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +0 -182
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +0 -1
- package/esm/LinearGenomeView/components/HelpDialog.js.map +0 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +0 -23
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +0 -154
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +0 -1
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +0 -279
- /package/dist/LinearGenomeView/components/{HelpDialog.js → RefNameAutocomplete/HelpDialog.js} +0 -0
- /package/esm/LinearGenomeView/components/{HelpDialog.js → RefNameAutocomplete/HelpDialog.js} +0 -0
- /package/src/LinearGenomeView/components/{HelpDialog.tsx → RefNameAutocomplete/HelpDialog.tsx} +0 -0
|
@@ -3,11 +3,11 @@ import { getConf, AnyConfigurationModel } from '@jbrowse/core/configuration'
|
|
|
3
3
|
import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
4
4
|
import { Region } from '@jbrowse/core/util/types'
|
|
5
5
|
import { ElementId, Region as MUIRegion } from '@jbrowse/core/util/types/mst'
|
|
6
|
-
import { MenuItem
|
|
6
|
+
import { MenuItem } from '@jbrowse/core/ui'
|
|
7
7
|
import {
|
|
8
8
|
assembleLocString,
|
|
9
9
|
clamp,
|
|
10
|
-
|
|
10
|
+
findLast,
|
|
11
11
|
getContainingView,
|
|
12
12
|
getSession,
|
|
13
13
|
isViewContainer,
|
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
isSessionWithAddTracks,
|
|
16
16
|
localStorageGetItem,
|
|
17
17
|
measureText,
|
|
18
|
-
parseLocString,
|
|
19
18
|
springAnimate,
|
|
20
19
|
sum,
|
|
20
|
+
ParsedLocString,
|
|
21
21
|
} from '@jbrowse/core/util'
|
|
22
22
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
23
23
|
import { BlockSet, BaseBlock } from '@jbrowse/core/util/blockTypes'
|
|
@@ -51,17 +51,22 @@ import PhotoCameraIcon from '@mui/icons-material/PhotoCamera'
|
|
|
51
51
|
import ZoomInIcon from '@mui/icons-material/ZoomIn'
|
|
52
52
|
import MenuOpenIcon from '@mui/icons-material/MenuOpen'
|
|
53
53
|
|
|
54
|
-
// locals
|
|
55
|
-
import { renderToSvg } from './svgcomponents/SVGLinearGenomeView'
|
|
56
|
-
|
|
57
|
-
import ExportSvgDlg from './components/ExportSvgDialog'
|
|
58
54
|
import MiniControls from './components/MiniControls'
|
|
59
55
|
import Header from './components/Header'
|
|
56
|
+
import { generateLocations, parseLocStrings } from './util'
|
|
60
57
|
|
|
61
58
|
// lazies
|
|
59
|
+
const ReturnToImportFormDialog = lazy(
|
|
60
|
+
() => import('@jbrowse/core/ui/ReturnToImportFormDialog'),
|
|
61
|
+
)
|
|
62
62
|
const SequenceSearchDialog = lazy(
|
|
63
63
|
() => import('./components/SequenceSearchDialog'),
|
|
64
64
|
)
|
|
65
|
+
const ExportSvgDialog = lazy(() => import('./components/ExportSvgDialog'))
|
|
66
|
+
const GetSequenceDialog = lazy(() => import('./components/GetSequenceDialog'))
|
|
67
|
+
const SearchResultsDialog = lazy(
|
|
68
|
+
() => import('./components/SearchResultsDialog'),
|
|
69
|
+
)
|
|
65
70
|
|
|
66
71
|
export interface BpOffset {
|
|
67
72
|
refName?: string
|
|
@@ -124,6 +129,7 @@ export const WIDGET_HEIGHT = 32
|
|
|
124
129
|
|
|
125
130
|
/**
|
|
126
131
|
* #stateModel LinearGenomeView
|
|
132
|
+
* #category view
|
|
127
133
|
*/
|
|
128
134
|
export function stateModelFactory(pluginManager: PluginManager) {
|
|
129
135
|
return types
|
|
@@ -198,7 +204,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
198
204
|
|
|
199
205
|
/**
|
|
200
206
|
* #property
|
|
201
|
-
* how to display the track labels, can be "overlapping", "offset", or
|
|
207
|
+
* how to display the track labels, can be "overlapping", "offset", or
|
|
208
|
+
* "hidden"
|
|
202
209
|
*/
|
|
203
210
|
trackLabels: types.optional(
|
|
204
211
|
types.string,
|
|
@@ -242,15 +249,11 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
242
249
|
// which is basically like an onLoad
|
|
243
250
|
afterDisplayedRegionsSetCallbacks: [] as Function[],
|
|
244
251
|
scaleFactor: 1,
|
|
245
|
-
|
|
246
|
-
trackRefs: {} as { [key: string]: any },
|
|
252
|
+
trackRefs: {} as { [key: string]: HTMLDivElement },
|
|
247
253
|
coarseDynamicBlocks: [] as BaseBlock[],
|
|
248
254
|
coarseTotalBp: 0,
|
|
249
255
|
leftOffset: undefined as undefined | BpOffset,
|
|
250
256
|
rightOffset: undefined as undefined | BpOffset,
|
|
251
|
-
searchResults: undefined as undefined | BaseResult[],
|
|
252
|
-
searchQuery: undefined as undefined | string,
|
|
253
|
-
seqDialogDisplayed: false,
|
|
254
257
|
}))
|
|
255
258
|
.views(self => ({
|
|
256
259
|
/**
|
|
@@ -332,13 +335,6 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
332
335
|
return self.displayedRegions.length > 0
|
|
333
336
|
},
|
|
334
337
|
|
|
335
|
-
/**
|
|
336
|
-
* #getter
|
|
337
|
-
*/
|
|
338
|
-
get isSearchDialogDisplayed() {
|
|
339
|
-
return self.searchResults !== undefined
|
|
340
|
-
},
|
|
341
|
-
|
|
342
338
|
/**
|
|
343
339
|
* #getter
|
|
344
340
|
*/
|
|
@@ -605,7 +601,9 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
605
601
|
|
|
606
602
|
/**
|
|
607
603
|
* #action
|
|
608
|
-
* sets offsets used in the get sequence dialog
|
|
604
|
+
* sets offsets of rubberband, used in the get sequence dialog can call
|
|
605
|
+
* view.getSelectedRegions(view.leftOffset,view.rightOffset) to compute
|
|
606
|
+
* the selected regions from the offsets
|
|
609
607
|
*/
|
|
610
608
|
setOffsets(left?: BpOffset, right?: BpOffset) {
|
|
611
609
|
self.leftOffset = left
|
|
@@ -615,16 +613,21 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
615
613
|
/**
|
|
616
614
|
* #action
|
|
617
615
|
*/
|
|
618
|
-
setSearchResults(
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
616
|
+
setSearchResults(
|
|
617
|
+
searchResults: BaseResult[],
|
|
618
|
+
searchQuery: string,
|
|
619
|
+
assemblyName?: string,
|
|
620
|
+
) {
|
|
621
|
+
getSession(self).queueDialog(handleClose => [
|
|
622
|
+
SearchResultsDialog,
|
|
623
|
+
{
|
|
624
|
+
model: self as LinearGenomeViewModel,
|
|
625
|
+
searchResults,
|
|
626
|
+
searchQuery,
|
|
627
|
+
handleClose,
|
|
628
|
+
assemblyName,
|
|
629
|
+
},
|
|
630
|
+
])
|
|
628
631
|
},
|
|
629
632
|
|
|
630
633
|
/**
|
|
@@ -797,10 +800,13 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
797
800
|
/**
|
|
798
801
|
* #method
|
|
799
802
|
* Helper method for the fetchSequence.
|
|
800
|
-
* Retrieves the corresponding regions that were selected by the
|
|
803
|
+
* Retrieves the corresponding regions that were selected by the
|
|
804
|
+
* rubberband
|
|
801
805
|
*
|
|
802
|
-
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
803
|
-
*
|
|
806
|
+
* @param leftOffset - `object as {start, end, index, offset}`, offset = start
|
|
807
|
+
* of user drag
|
|
808
|
+
* @param rightOffset - `object as {start, end, index, offset}`,
|
|
809
|
+
* offset = end of user drag
|
|
804
810
|
* @returns array of Region[]
|
|
805
811
|
*/
|
|
806
812
|
getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset) {
|
|
@@ -822,7 +828,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
822
828
|
|
|
823
829
|
/**
|
|
824
830
|
* #action
|
|
825
|
-
* schedule something to be run after the next time displayedRegions is
|
|
831
|
+
* schedule something to be run after the next time displayedRegions is
|
|
832
|
+
* set
|
|
826
833
|
*/
|
|
827
834
|
afterDisplayedRegionsSet(cb: Function) {
|
|
828
835
|
self.afterDisplayedRegionsSetCallbacks.push(cb)
|
|
@@ -915,8 +922,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
915
922
|
* creates an svg export and save using FileSaver
|
|
916
923
|
*/
|
|
917
924
|
async exportSvg(opts: ExportSvgOptions = {}) {
|
|
918
|
-
|
|
919
|
-
|
|
925
|
+
const { renderToSvg } = await import(
|
|
926
|
+
'./svgcomponents/SVGLinearGenomeView'
|
|
927
|
+
)
|
|
928
|
+
const html = await renderToSvg(self as LinearGenomeViewModel, opts)
|
|
920
929
|
const blob = new Blob([html], { type: 'image/svg+xml' })
|
|
921
930
|
saveAs(blob, opts.filename || 'image.svg')
|
|
922
931
|
},
|
|
@@ -999,8 +1008,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
999
1008
|
},
|
|
1000
1009
|
/**
|
|
1001
1010
|
* #getter
|
|
1002
|
-
* the cytoband is displayed to the right of the chromosome name,
|
|
1003
|
-
*
|
|
1011
|
+
* the cytoband is displayed to the right of the chromosome name, and
|
|
1012
|
+
* that offset is calculated manually with this method
|
|
1004
1013
|
*/
|
|
1005
1014
|
get cytobandOffset() {
|
|
1006
1015
|
return this.showCytobands
|
|
@@ -1045,7 +1054,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1045
1054
|
icon: PhotoCameraIcon,
|
|
1046
1055
|
onClick: () => {
|
|
1047
1056
|
getSession(self).queueDialog(handleClose => [
|
|
1048
|
-
|
|
1057
|
+
ExportSvgDialog,
|
|
1049
1058
|
{ model: self, handleClose },
|
|
1050
1059
|
])
|
|
1051
1060
|
},
|
|
@@ -1162,10 +1171,9 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1162
1171
|
* #getter
|
|
1163
1172
|
* static blocks are an important concept jbrowse uses to avoid
|
|
1164
1173
|
* re-rendering when you scroll to the side. when you horizontally
|
|
1165
|
-
* scroll to the right, old blocks to the left may be removed, and
|
|
1166
|
-
*
|
|
1167
|
-
*
|
|
1168
|
-
* the block
|
|
1174
|
+
* scroll to the right, old blocks to the left may be removed, and new
|
|
1175
|
+
* blocks may be instantiated on the right. tracks may use the static
|
|
1176
|
+
* blocks to render their data for the region represented by the block
|
|
1169
1177
|
*/
|
|
1170
1178
|
get staticBlocks() {
|
|
1171
1179
|
const ret = calculateStaticBlocks(self)
|
|
@@ -1180,7 +1188,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1180
1188
|
* #getter
|
|
1181
1189
|
* dynamic blocks represent the exact coordinates of the currently
|
|
1182
1190
|
* visible genome regions on the screen. they are similar to static
|
|
1183
|
-
* blocks, but
|
|
1191
|
+
* blocks, but static blocks can go offscreen while dynamic blocks
|
|
1184
1192
|
* represent exactly what is on screen
|
|
1185
1193
|
*/
|
|
1186
1194
|
get dynamicBlocks() {
|
|
@@ -1203,8 +1211,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1203
1211
|
|
|
1204
1212
|
/**
|
|
1205
1213
|
* #getter
|
|
1206
|
-
* a single "combo-locstring" representing all the regions visible
|
|
1207
|
-
*
|
|
1214
|
+
* a single "combo-locstring" representing all the regions visible on
|
|
1215
|
+
* the screen
|
|
1208
1216
|
*/
|
|
1209
1217
|
get visibleLocStrings() {
|
|
1210
1218
|
return calculateVisibleLocStrings(this.dynamicBlocks.contentBlocks)
|
|
@@ -1258,8 +1266,8 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1258
1266
|
.actions(self => ({
|
|
1259
1267
|
/**
|
|
1260
1268
|
* #action
|
|
1261
|
-
* offset is the base-pair-offset in the displayed region, index is the
|
|
1262
|
-
* displayed region in the linear genome view
|
|
1269
|
+
* offset is the base-pair-offset in the displayed region, index is the
|
|
1270
|
+
* index of the displayed region in the linear genome view
|
|
1263
1271
|
*
|
|
1264
1272
|
* @param start - object as `{start, end, offset, index}`
|
|
1265
1273
|
* @param end - object as `{start, end, offset, index}`
|
|
@@ -1270,91 +1278,52 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1270
1278
|
|
|
1271
1279
|
/**
|
|
1272
1280
|
* #action
|
|
1273
|
-
*
|
|
1281
|
+
* Navigate to the given locstring, will change displayed regions if
|
|
1282
|
+
* needed, and wait for assemblies to be initialized
|
|
1274
1283
|
*
|
|
1275
|
-
* @param
|
|
1276
|
-
* @param optAssemblyName - (optional) the assembly name to use when
|
|
1284
|
+
* @param input - e.g. "chr1:1-100", "chr1:1-100 chr2:1-100", "chr 1 100"
|
|
1285
|
+
* @param optAssemblyName - (optional) the assembly name to use when
|
|
1286
|
+
* navigating to the locstring
|
|
1277
1287
|
*/
|
|
1278
|
-
async navToLocString(
|
|
1288
|
+
async navToLocString(input: string, optAssemblyName?: string) {
|
|
1279
1289
|
const { assemblyNames } = self
|
|
1280
1290
|
const { assemblyManager } = getSession(self)
|
|
1281
1291
|
const { isValidRefName } = assemblyManager
|
|
1282
|
-
await when(() => self.volatileWidth !== undefined)
|
|
1283
1292
|
const assemblyName = optAssemblyName || assemblyNames[0]
|
|
1284
|
-
let parsedLocStrings
|
|
1285
|
-
const inputs = locString
|
|
1286
|
-
.split(/(\s+)/)
|
|
1287
|
-
.map(f => f.trim())
|
|
1288
|
-
.filter(f => !!f)
|
|
1289
|
-
|
|
1290
1293
|
if (assemblyName) {
|
|
1294
|
+
// wait before isValidRefName can be called
|
|
1291
1295
|
await assemblyManager.waitForAssembly(assemblyName)
|
|
1292
1296
|
}
|
|
1293
1297
|
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
)
|
|
1300
|
-
} catch (e) {
|
|
1301
|
-
// if this fails, try interpreting as a whitespace-separated refname,
|
|
1302
|
-
// start, end if start and end are integer inputs
|
|
1303
|
-
const [refName, start, end] = inputs
|
|
1304
|
-
if (
|
|
1305
|
-
`${e}`.match(/Unknown reference sequence/) &&
|
|
1306
|
-
Number.isInteger(+start) &&
|
|
1307
|
-
Number.isInteger(+end)
|
|
1308
|
-
) {
|
|
1309
|
-
parsedLocStrings = [
|
|
1310
|
-
parseLocString(refName + ':' + start + '..' + end, ref =>
|
|
1311
|
-
isValidRefName(ref, assemblyName),
|
|
1312
|
-
),
|
|
1313
|
-
]
|
|
1314
|
-
} else {
|
|
1315
|
-
throw e
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1298
|
+
return this.navToLocations(
|
|
1299
|
+
parseLocStrings(input, assemblyName, isValidRefName),
|
|
1300
|
+
assemblyName,
|
|
1301
|
+
)
|
|
1302
|
+
},
|
|
1318
1303
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
const canonicalRefName = asm.getCanonicalRefName(region.refName)
|
|
1332
|
-
if (!canonicalRefName) {
|
|
1333
|
-
throw new Error(
|
|
1334
|
-
`Could not find refName ${refName} in ${asm.name}`,
|
|
1335
|
-
)
|
|
1336
|
-
}
|
|
1337
|
-
const parentRegion = regions.find(
|
|
1338
|
-
r => r.refName === canonicalRefName,
|
|
1339
|
-
)
|
|
1340
|
-
if (!parentRegion) {
|
|
1341
|
-
throw new Error(`Could not find refName ${refName} in ${asmName}`)
|
|
1342
|
-
}
|
|
1304
|
+
/**
|
|
1305
|
+
* #action
|
|
1306
|
+
* Similar to `navToLocString`, but accepts parsed location objects
|
|
1307
|
+
* instead of strings. Will try to perform `setDisplayedRegions` if
|
|
1308
|
+
* changing regions
|
|
1309
|
+
*/
|
|
1310
|
+
async navToLocations(
|
|
1311
|
+
parsedLocStrings: ParsedLocString[],
|
|
1312
|
+
assemblyName?: string,
|
|
1313
|
+
) {
|
|
1314
|
+
const { assemblyManager } = getSession(self)
|
|
1315
|
+
await when(() => self.volatileWidth !== undefined)
|
|
1343
1316
|
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
}
|
|
1349
|
-
}),
|
|
1317
|
+
const locations = await generateLocations(
|
|
1318
|
+
parsedLocStrings,
|
|
1319
|
+
assemblyManager,
|
|
1320
|
+
assemblyName,
|
|
1350
1321
|
)
|
|
1351
1322
|
|
|
1352
1323
|
if (locations.length === 1) {
|
|
1353
1324
|
const loc = locations[0]
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
])
|
|
1357
|
-
const { start, end, parentRegion } = loc
|
|
1325
|
+
const { reversed, parentRegion, start, end } = loc
|
|
1326
|
+
self.setDisplayedRegions([{ reversed, ...parentRegion }])
|
|
1358
1327
|
|
|
1359
1328
|
this.navTo({
|
|
1360
1329
|
...loc,
|
|
@@ -1373,10 +1342,10 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1373
1342
|
/**
|
|
1374
1343
|
* #action
|
|
1375
1344
|
* Navigate to a location based on its refName and optionally start, end,
|
|
1376
|
-
* and assemblyName.
|
|
1377
|
-
*
|
|
1378
|
-
* within a displayedRegion. Navigates to the first matching
|
|
1379
|
-
* encountered.
|
|
1345
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
1346
|
+
* `navToLocations` instead. Only navigates to a location if it is
|
|
1347
|
+
* entirely within a displayedRegion. Navigates to the first matching
|
|
1348
|
+
* location encountered.
|
|
1380
1349
|
*
|
|
1381
1350
|
* Throws an error if navigation was unsuccessful
|
|
1382
1351
|
*
|
|
@@ -1388,132 +1357,89 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1388
1357
|
|
|
1389
1358
|
/**
|
|
1390
1359
|
* #action
|
|
1360
|
+
* Navigate to a location based on its refName and optionally start, end,
|
|
1361
|
+
* and assemblyName. Will not try to change displayed regions, use
|
|
1362
|
+
* navToLocations instead. Only navigates to a location if it is entirely
|
|
1363
|
+
* within a displayedRegion. Navigates to the first matching location
|
|
1364
|
+
* encountered.
|
|
1365
|
+
*
|
|
1366
|
+
* Throws an error if navigation was unsuccessful
|
|
1367
|
+
*
|
|
1368
|
+
* @param locations - proposed location to navigate to
|
|
1391
1369
|
*/
|
|
1392
1370
|
navToMultiple(locations: NavLocation[]) {
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
if (start !== undefined && end !== undefined && start > end) {
|
|
1402
|
-
throw new Error(`start "${start + 1}" is greater than end "${end}"`)
|
|
1371
|
+
if (
|
|
1372
|
+
locations.some(
|
|
1373
|
+
l =>
|
|
1374
|
+
l.start !== undefined && l.end !== undefined && l.start > l.end,
|
|
1375
|
+
)
|
|
1376
|
+
) {
|
|
1377
|
+
throw new Error('found start greater than end')
|
|
1403
1378
|
}
|
|
1404
|
-
const
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
const canonicalRefName = assembly.getCanonicalRefName(refName)
|
|
1409
|
-
if (canonicalRefName) {
|
|
1410
|
-
refName = canonicalRefName
|
|
1411
|
-
}
|
|
1379
|
+
const f1 = locations.at(0)
|
|
1380
|
+
const f2 = locations.at(-1)
|
|
1381
|
+
if (!f1 || !f2) {
|
|
1382
|
+
return
|
|
1412
1383
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
const
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
return true
|
|
1427
|
-
}
|
|
1428
|
-
s = start
|
|
1429
|
-
e = end
|
|
1430
|
-
}
|
|
1431
|
-
return false
|
|
1384
|
+
const a = self.assemblyNames[0]
|
|
1385
|
+
const { assemblyManager } = getSession(self)
|
|
1386
|
+
const assembly1 = assemblyManager.get(f1.assemblyName || a)
|
|
1387
|
+
const assembly2 = assemblyManager.get(f2.assemblyName || a)
|
|
1388
|
+
const ref1 = assembly1?.getCanonicalRefName(f1.refName) || f1.refName
|
|
1389
|
+
const ref2 = assembly2?.getCanonicalRefName(f2.refName) || f2.refName
|
|
1390
|
+
const r1 = self.displayedRegions.find(r => r.refName === ref1)
|
|
1391
|
+
const r2 = findLast(self.displayedRegions, r => r.refName === ref2)
|
|
1392
|
+
if (!r1) {
|
|
1393
|
+
throw new Error(`could not find a region with refName "${ref1}"`)
|
|
1394
|
+
}
|
|
1395
|
+
if (!r2) {
|
|
1396
|
+
throw new Error(`could not find a region with refName "${ref2}"`)
|
|
1432
1397
|
}
|
|
1433
1398
|
|
|
1434
|
-
const
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
)
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
throw new Error(
|
|
1464
|
-
`could not find a region that completely contained "${assembleLocString(
|
|
1465
|
-
firstLocation,
|
|
1466
|
-
)}"`,
|
|
1467
|
-
)
|
|
1468
|
-
}
|
|
1469
|
-
if (locations.length === 1) {
|
|
1470
|
-
const f = self.displayedRegions[index]
|
|
1471
|
-
this.moveTo(
|
|
1472
|
-
{ index, offset: f.reversed ? f.end - e : s - f.start },
|
|
1473
|
-
{ index, offset: f.reversed ? f.end - s : e - f.start },
|
|
1474
|
-
)
|
|
1475
|
-
return
|
|
1476
|
-
}
|
|
1477
|
-
let idx = 0
|
|
1478
|
-
let start = 0
|
|
1479
|
-
let end = 0
|
|
1480
|
-
for (idx; idx < locations.length; idx++) {
|
|
1481
|
-
const location = locations[idx]
|
|
1482
|
-
const region = self.displayedRegions[index + idx]
|
|
1483
|
-
start = location.start || region.start
|
|
1484
|
-
end = location.end || region.end
|
|
1485
|
-
if (location.refName !== region.refName) {
|
|
1486
|
-
throw new Error(
|
|
1487
|
-
`Entered location ${assembleLocString(
|
|
1488
|
-
location,
|
|
1489
|
-
)} does not match with displayed regions`,
|
|
1490
|
-
)
|
|
1491
|
-
}
|
|
1492
|
-
}
|
|
1493
|
-
idx -= 1
|
|
1494
|
-
const startDisplayedRegion = self.displayedRegions[index]
|
|
1495
|
-
const endDisplayedRegion = self.displayedRegions[index + idx]
|
|
1496
|
-
this.moveTo(
|
|
1497
|
-
{
|
|
1498
|
-
index,
|
|
1499
|
-
offset: startDisplayedRegion.reversed
|
|
1500
|
-
? startDisplayedRegion.end - e
|
|
1501
|
-
: s - startDisplayedRegion.start,
|
|
1502
|
-
},
|
|
1503
|
-
{
|
|
1504
|
-
index: index + idx,
|
|
1505
|
-
offset: endDisplayedRegion.reversed
|
|
1506
|
-
? endDisplayedRegion.end - start
|
|
1507
|
-
: end - endDisplayedRegion.start,
|
|
1508
|
-
},
|
|
1509
|
-
)
|
|
1510
|
-
return
|
|
1511
|
-
} catch (error) {
|
|
1512
|
-
if (index === lastIndex) {
|
|
1513
|
-
throw error
|
|
1514
|
-
}
|
|
1515
|
-
}
|
|
1399
|
+
const s1 = f1.start === undefined ? r1.start : f1.start
|
|
1400
|
+
const e1 = f1.end === undefined ? r1.end : f1.end
|
|
1401
|
+
const s2 = f2.start === undefined ? r2.start : f2.start
|
|
1402
|
+
const e2 = f2.end === undefined ? r2.end : f2.end
|
|
1403
|
+
|
|
1404
|
+
const index = self.displayedRegions.findIndex(
|
|
1405
|
+
r =>
|
|
1406
|
+
ref1 === r.refName &&
|
|
1407
|
+
s1 >= r.start &&
|
|
1408
|
+
s1 <= r.end &&
|
|
1409
|
+
e1 <= r.end &&
|
|
1410
|
+
e1 >= r.start,
|
|
1411
|
+
)
|
|
1412
|
+
|
|
1413
|
+
const index2 = self.displayedRegions.findIndex(
|
|
1414
|
+
r =>
|
|
1415
|
+
ref2 === r.refName &&
|
|
1416
|
+
s2 >= r.start &&
|
|
1417
|
+
s2 <= r.end &&
|
|
1418
|
+
e2 <= r.end &&
|
|
1419
|
+
e2 >= r.start,
|
|
1420
|
+
)
|
|
1421
|
+
|
|
1422
|
+
if (index === -1 || index2 === -1) {
|
|
1423
|
+
throw new Error(
|
|
1424
|
+
`could not find a region that contained "${locations.map(l =>
|
|
1425
|
+
assembleLocString(l),
|
|
1426
|
+
)}"`,
|
|
1427
|
+
)
|
|
1516
1428
|
}
|
|
1429
|
+
|
|
1430
|
+
const sd = self.displayedRegions[index]
|
|
1431
|
+
const ed = self.displayedRegions[index2]
|
|
1432
|
+
|
|
1433
|
+
this.moveTo(
|
|
1434
|
+
{
|
|
1435
|
+
index,
|
|
1436
|
+
offset: sd.reversed ? sd.end - e1 : s1 - sd.start,
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
index: index2,
|
|
1440
|
+
offset: ed.reversed ? ed.end - s2 : e2 - ed.start,
|
|
1441
|
+
},
|
|
1442
|
+
)
|
|
1517
1443
|
},
|
|
1518
1444
|
}))
|
|
1519
1445
|
.views(self => ({
|
|
@@ -1525,15 +1451,17 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1525
1451
|
{
|
|
1526
1452
|
label: 'Zoom to region',
|
|
1527
1453
|
icon: ZoomInIcon,
|
|
1528
|
-
onClick: () =>
|
|
1529
|
-
const { leftOffset, rightOffset } = self
|
|
1530
|
-
self.moveTo(leftOffset, rightOffset)
|
|
1531
|
-
},
|
|
1454
|
+
onClick: () => self.moveTo(self.leftOffset, self.rightOffset),
|
|
1532
1455
|
},
|
|
1533
1456
|
{
|
|
1534
1457
|
label: 'Get sequence',
|
|
1535
1458
|
icon: MenuOpenIcon,
|
|
1536
|
-
onClick: () =>
|
|
1459
|
+
onClick: () =>
|
|
1460
|
+
getSession(self).queueDialog(handleClose => [
|
|
1461
|
+
GetSequenceDialog,
|
|
1462
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1463
|
+
{ model: self as any, handleClose },
|
|
1464
|
+
]),
|
|
1537
1465
|
},
|
|
1538
1466
|
]
|
|
1539
1467
|
},
|
|
@@ -1567,7 +1495,7 @@ export function stateModelFactory(pluginManager: PluginManager) {
|
|
|
1567
1495
|
coord,
|
|
1568
1496
|
regionNumber,
|
|
1569
1497
|
})
|
|
1570
|
-
if (centerPx) {
|
|
1498
|
+
if (centerPx !== undefined) {
|
|
1571
1499
|
self.scrollTo(Math.round(centerPx.offsetPx - self.width / 2))
|
|
1572
1500
|
}
|
|
1573
1501
|
},
|
|
@@ -10,15 +10,13 @@ import { Polygon } from '../components/OverviewScalebar'
|
|
|
10
10
|
import SVGRuler from './SVGRuler'
|
|
11
11
|
import SVGScalebar from './SVGScalebar'
|
|
12
12
|
|
|
13
|
-
type LGV = LinearGenomeViewModel
|
|
14
|
-
|
|
15
13
|
export default function SVGHeader({
|
|
16
14
|
model,
|
|
17
15
|
fontSize,
|
|
18
16
|
cytobandHeight,
|
|
19
17
|
rulerHeight,
|
|
20
18
|
}: {
|
|
21
|
-
model:
|
|
19
|
+
model: LinearGenomeViewModel
|
|
22
20
|
rulerHeight: number
|
|
23
21
|
fontSize: number
|
|
24
22
|
cytobandHeight: number
|
|
@@ -35,19 +33,23 @@ export default function SVGHeader({
|
|
|
35
33
|
minimumBlockWidth: model.minimumBlockWidth,
|
|
36
34
|
})
|
|
37
35
|
const visibleRegions = model.dynamicBlocks.contentBlocks
|
|
36
|
+
if (!visibleRegions.length) {
|
|
37
|
+
return null
|
|
38
|
+
}
|
|
38
39
|
|
|
39
40
|
overview.setVolatileWidth(width)
|
|
40
41
|
overview.showAllRegions()
|
|
41
42
|
const block = overview.dynamicBlocks.contentBlocks[0]
|
|
42
|
-
|
|
43
|
-
const first = visibleRegions
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
+
const first = visibleRegions.at(0)!
|
|
45
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
46
|
+
const last = visibleRegions.at(-1)!
|
|
44
47
|
const firstOverviewPx =
|
|
45
48
|
overview.bpToPx({
|
|
46
49
|
...first,
|
|
47
50
|
coord: first.reversed ? first.end : first.start,
|
|
48
51
|
}) || 0
|
|
49
52
|
|
|
50
|
-
const last = visibleRegions[visibleRegions.length - 1]
|
|
51
53
|
const lastOverviewPx =
|
|
52
54
|
overview.bpToPx({
|
|
53
55
|
...last,
|
|
@@ -59,7 +59,7 @@ export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
|
|
|
59
59
|
const displayResults = await Promise.all(
|
|
60
60
|
tracks.map(async track => {
|
|
61
61
|
const display = track.displays[0]
|
|
62
|
-
await when(() =>
|
|
62
|
+
await when(() => !display.renderProps().notReady)
|
|
63
63
|
return { track, result: await display.renderSvg({ ...opts, theme }) }
|
|
64
64
|
}),
|
|
65
65
|
)
|