@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
|
@@ -1,143 +1,48 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { resolveIdentifier, getRoot } from 'mobx-state-tree'
|
|
3
|
-
import { getSession, getEnv } from '@jbrowse/core/util'
|
|
4
2
|
import { Dialog } from '@jbrowse/core/ui'
|
|
5
3
|
import {
|
|
6
4
|
Button,
|
|
7
5
|
DialogActions,
|
|
8
6
|
DialogContent,
|
|
9
7
|
Divider,
|
|
10
|
-
Paper,
|
|
11
|
-
Table,
|
|
12
|
-
TableBody,
|
|
13
|
-
TableCell,
|
|
14
|
-
TableContainer,
|
|
15
|
-
TableHead,
|
|
16
|
-
TableRow,
|
|
17
8
|
Typography,
|
|
18
9
|
} from '@mui/material'
|
|
19
10
|
|
|
20
11
|
import { LinearGenomeViewModel } from '../..'
|
|
12
|
+
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
13
|
+
import SearchResultsTable from './SearchResultsTable'
|
|
21
14
|
|
|
22
15
|
export default function SearchResultsDialog({
|
|
23
16
|
model,
|
|
24
|
-
|
|
17
|
+
assemblyName,
|
|
18
|
+
searchQuery,
|
|
19
|
+
searchResults,
|
|
25
20
|
handleClose,
|
|
26
21
|
}: {
|
|
27
22
|
model: LinearGenomeViewModel
|
|
28
|
-
|
|
23
|
+
assemblyName?: string
|
|
24
|
+
searchQuery: string
|
|
25
|
+
searchResults?: BaseResult[]
|
|
29
26
|
handleClose: () => void
|
|
30
27
|
}) {
|
|
31
|
-
const session = getSession(model)
|
|
32
|
-
const { pluginManager } = getEnv(session)
|
|
33
|
-
const { assemblyManager } = session
|
|
34
|
-
let assemblyName = optAssemblyName
|
|
35
|
-
if (model.displayedRegions.length > 0) {
|
|
36
|
-
assemblyName = model.displayedRegions[0]?.assemblyName
|
|
37
|
-
}
|
|
38
|
-
if (!assemblyName) {
|
|
39
|
-
throw new Error(`Assembly name not found`)
|
|
40
|
-
}
|
|
41
|
-
const assembly = assemblyManager.get(assemblyName)
|
|
42
|
-
if (!assembly) {
|
|
43
|
-
throw new Error(`assembly ${assemblyName} not found`)
|
|
44
|
-
}
|
|
45
|
-
if (!assembly.regions) {
|
|
46
|
-
throw new Error(`assembly ${assemblyName} regions not loaded`)
|
|
47
|
-
}
|
|
48
|
-
const assemblyRegions = assembly.regions
|
|
49
|
-
|
|
50
|
-
async function handleClick(location: string) {
|
|
51
|
-
try {
|
|
52
|
-
const newRegion = assemblyRegions.find(
|
|
53
|
-
region => location === region.refName,
|
|
54
|
-
)
|
|
55
|
-
if (newRegion) {
|
|
56
|
-
model.setDisplayedRegions([newRegion])
|
|
57
|
-
// we use showAllRegions after setDisplayedRegions to make the entire
|
|
58
|
-
// region visible, xref #1703
|
|
59
|
-
model.showAllRegions()
|
|
60
|
-
} else {
|
|
61
|
-
await model.navToLocString(location, assemblyName)
|
|
62
|
-
}
|
|
63
|
-
} catch (e) {
|
|
64
|
-
console.warn(e)
|
|
65
|
-
session.notify(`${e}`, 'warning')
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
function getTrackName(trackId: string | undefined) {
|
|
70
|
-
if (trackId) {
|
|
71
|
-
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
72
|
-
const configuration = resolveIdentifier(schema, getRoot(model), trackId)
|
|
73
|
-
return configuration?.name?.value || ''
|
|
74
|
-
}
|
|
75
|
-
return ''
|
|
76
|
-
}
|
|
77
|
-
|
|
78
28
|
return (
|
|
79
29
|
<Dialog open maxWidth="xl" onClose={handleClose} title="Search results">
|
|
80
30
|
<DialogContent>
|
|
81
|
-
{!
|
|
31
|
+
{!searchResults?.length ? (
|
|
82
32
|
<Typography>
|
|
83
|
-
No results found for <b>{
|
|
33
|
+
No results found for <b>{searchQuery}</b>
|
|
84
34
|
</Typography>
|
|
85
35
|
) : (
|
|
86
36
|
<>
|
|
87
37
|
<Typography>
|
|
88
|
-
Showing results for <b>{
|
|
38
|
+
Showing results for <b>{searchQuery}</b>
|
|
89
39
|
</Typography>
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
<TableCell align="right">Track</TableCell>
|
|
97
|
-
<TableCell align="right" />
|
|
98
|
-
</TableRow>
|
|
99
|
-
</TableHead>
|
|
100
|
-
<TableBody>
|
|
101
|
-
{model.searchResults.map(result => (
|
|
102
|
-
<TableRow key={`${result.getId()}`}>
|
|
103
|
-
<TableCell component="th" scope="row">
|
|
104
|
-
{result.getLabel()}
|
|
105
|
-
</TableCell>
|
|
106
|
-
<TableCell align="right">
|
|
107
|
-
{result.getLocation()}
|
|
108
|
-
</TableCell>
|
|
109
|
-
<TableCell align="right">
|
|
110
|
-
{getTrackName(result.getTrackId()) || 'N/A'}
|
|
111
|
-
</TableCell>
|
|
112
|
-
<TableCell align="right">
|
|
113
|
-
<Button
|
|
114
|
-
onClick={async () => {
|
|
115
|
-
try {
|
|
116
|
-
const location = result.getLocation()
|
|
117
|
-
if (location) {
|
|
118
|
-
await handleClick(location)
|
|
119
|
-
const resultTrackId = result.getTrackId()
|
|
120
|
-
if (resultTrackId) {
|
|
121
|
-
model.showTrack(resultTrackId)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
} catch (e) {
|
|
125
|
-
console.error(e)
|
|
126
|
-
session.notify(`${e}`, 'error')
|
|
127
|
-
}
|
|
128
|
-
handleClose()
|
|
129
|
-
}}
|
|
130
|
-
color="primary"
|
|
131
|
-
variant="contained"
|
|
132
|
-
>
|
|
133
|
-
Go
|
|
134
|
-
</Button>
|
|
135
|
-
</TableCell>
|
|
136
|
-
</TableRow>
|
|
137
|
-
))}
|
|
138
|
-
</TableBody>
|
|
139
|
-
</Table>
|
|
140
|
-
</TableContainer>
|
|
40
|
+
<SearchResultsTable
|
|
41
|
+
model={model}
|
|
42
|
+
handleClose={handleClose}
|
|
43
|
+
assemblyName={assemblyName}
|
|
44
|
+
searchResults={searchResults}
|
|
45
|
+
/>
|
|
141
46
|
</>
|
|
142
47
|
)}
|
|
143
48
|
</DialogContent>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import {
|
|
3
|
+
Button,
|
|
4
|
+
Paper,
|
|
5
|
+
Table,
|
|
6
|
+
TableBody,
|
|
7
|
+
TableCell,
|
|
8
|
+
TableContainer,
|
|
9
|
+
TableHead,
|
|
10
|
+
TableRow,
|
|
11
|
+
} from '@mui/material'
|
|
12
|
+
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
13
|
+
import { getRoot, resolveIdentifier } from 'mobx-state-tree'
|
|
14
|
+
import { getEnv, getSession } from '@jbrowse/core/util'
|
|
15
|
+
|
|
16
|
+
// locals
|
|
17
|
+
import { LinearGenomeViewModel } from '../..'
|
|
18
|
+
|
|
19
|
+
export default function SearchResultsTable({
|
|
20
|
+
searchResults,
|
|
21
|
+
assemblyName: optAssemblyName,
|
|
22
|
+
model,
|
|
23
|
+
handleClose,
|
|
24
|
+
}: {
|
|
25
|
+
searchResults: BaseResult[]
|
|
26
|
+
assemblyName?: string
|
|
27
|
+
model: LinearGenomeViewModel
|
|
28
|
+
handleClose: () => void
|
|
29
|
+
}) {
|
|
30
|
+
const session = getSession(model)
|
|
31
|
+
const { pluginManager } = getEnv(session)
|
|
32
|
+
const { assemblyManager } = session
|
|
33
|
+
const assemblyName =
|
|
34
|
+
optAssemblyName || model.displayedRegions[0]?.assemblyName
|
|
35
|
+
|
|
36
|
+
const assembly = assemblyManager.get(assemblyName)
|
|
37
|
+
if (!assembly) {
|
|
38
|
+
throw new Error(`assembly ${assemblyName} not found`)
|
|
39
|
+
}
|
|
40
|
+
if (!assembly.regions) {
|
|
41
|
+
throw new Error(`assembly ${assemblyName} regions not loaded`)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getTrackName(trackId: string | undefined) {
|
|
45
|
+
if (trackId) {
|
|
46
|
+
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
47
|
+
const configuration = resolveIdentifier(schema, getRoot(model), trackId)
|
|
48
|
+
return configuration?.name?.value || ''
|
|
49
|
+
}
|
|
50
|
+
return ''
|
|
51
|
+
}
|
|
52
|
+
async function handleClick(location: string) {
|
|
53
|
+
try {
|
|
54
|
+
const newRegion = assembly?.regions?.find(
|
|
55
|
+
region => location === region.refName,
|
|
56
|
+
)
|
|
57
|
+
if (newRegion) {
|
|
58
|
+
model.setDisplayedRegions([newRegion])
|
|
59
|
+
// we use showAllRegions after setDisplayedRegions to make the entire
|
|
60
|
+
// region visible, xref #1703
|
|
61
|
+
model.showAllRegions()
|
|
62
|
+
} else {
|
|
63
|
+
await model.navToLocString(location, assemblyName)
|
|
64
|
+
}
|
|
65
|
+
} catch (e) {
|
|
66
|
+
console.warn(e)
|
|
67
|
+
session.notify(`${e}`, 'warning')
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return (
|
|
71
|
+
<TableContainer component={Paper}>
|
|
72
|
+
<Table>
|
|
73
|
+
<TableHead>
|
|
74
|
+
<TableRow>
|
|
75
|
+
<TableCell>Name</TableCell>
|
|
76
|
+
<TableCell align="right">Location</TableCell>
|
|
77
|
+
<TableCell align="right">Track</TableCell>
|
|
78
|
+
<TableCell align="right" />
|
|
79
|
+
</TableRow>
|
|
80
|
+
</TableHead>
|
|
81
|
+
<TableBody>
|
|
82
|
+
{searchResults.map(result => (
|
|
83
|
+
<TableRow key={`${result.getId()}`}>
|
|
84
|
+
<TableCell component="th" scope="row">
|
|
85
|
+
{result.getLabel()}
|
|
86
|
+
</TableCell>
|
|
87
|
+
<TableCell align="right">{result.getLocation()}</TableCell>
|
|
88
|
+
<TableCell align="right">
|
|
89
|
+
{getTrackName(result.getTrackId()) || 'N/A'}
|
|
90
|
+
</TableCell>
|
|
91
|
+
<TableCell align="right">
|
|
92
|
+
<Button
|
|
93
|
+
onClick={async () => {
|
|
94
|
+
try {
|
|
95
|
+
const location = result.getLocation()
|
|
96
|
+
if (location) {
|
|
97
|
+
await handleClick(location)
|
|
98
|
+
const resultTrackId = result.getTrackId()
|
|
99
|
+
if (resultTrackId) {
|
|
100
|
+
model.showTrack(resultTrackId)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
} catch (e) {
|
|
104
|
+
console.error(e)
|
|
105
|
+
session.notify(`${e}`, 'error')
|
|
106
|
+
}
|
|
107
|
+
handleClose()
|
|
108
|
+
}}
|
|
109
|
+
color="primary"
|
|
110
|
+
variant="contained"
|
|
111
|
+
>
|
|
112
|
+
Go
|
|
113
|
+
</Button>
|
|
114
|
+
</TableCell>
|
|
115
|
+
</TableRow>
|
|
116
|
+
))}
|
|
117
|
+
</TableBody>
|
|
118
|
+
</Table>
|
|
119
|
+
</TableContainer>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
2
|
import { Paper } from '@mui/material'
|
|
3
3
|
import { makeStyles } from 'tss-react/mui'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
@@ -7,13 +7,13 @@ import { ErrorBoundary } from 'react-error-boundary'
|
|
|
7
7
|
|
|
8
8
|
// jbrowse core
|
|
9
9
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
10
|
-
import { getConf } from '@jbrowse/core/configuration'
|
|
11
10
|
import { ResizeHandle, ErrorMessage } from '@jbrowse/core/ui'
|
|
12
11
|
import { useDebouncedCallback } from '@jbrowse/core/util'
|
|
13
12
|
|
|
14
13
|
// locals
|
|
15
14
|
import { LinearGenomeViewModel } from '..'
|
|
16
|
-
import
|
|
15
|
+
import TrackLabelContainer from './TrackLabelContainer'
|
|
16
|
+
import TrackRenderingContainer from './TrackRenderingContainer'
|
|
17
17
|
|
|
18
18
|
const useStyles = makeStyles()({
|
|
19
19
|
root: {
|
|
@@ -33,55 +33,11 @@ const useStyles = makeStyles()({
|
|
|
33
33
|
width: '100%',
|
|
34
34
|
zIndex: 3,
|
|
35
35
|
},
|
|
36
|
-
trackLabel: {
|
|
37
|
-
zIndex: 3,
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
// aligns with block boundaries. check for example the breakpoint split view
|
|
41
|
-
// demo to see if features align if wanting to change things
|
|
42
|
-
renderingComponentContainer: {
|
|
43
|
-
position: 'absolute',
|
|
44
|
-
// -1 offset because of the 1px border of the Paper
|
|
45
|
-
left: -1,
|
|
46
|
-
height: '100%',
|
|
47
|
-
width: '100%',
|
|
48
|
-
},
|
|
49
|
-
trackLabelOffset: {
|
|
50
|
-
position: 'relative',
|
|
51
|
-
display: 'inline-block',
|
|
52
|
-
},
|
|
53
|
-
trackLabelOverlap: {
|
|
54
|
-
position: 'absolute',
|
|
55
|
-
},
|
|
56
|
-
trackRenderingContainer: {
|
|
57
|
-
overflowY: 'auto',
|
|
58
|
-
overflowX: 'hidden',
|
|
59
|
-
whiteSpace: 'nowrap',
|
|
60
|
-
position: 'relative',
|
|
61
|
-
background: 'none',
|
|
62
|
-
zIndex: 2,
|
|
63
|
-
},
|
|
64
36
|
})
|
|
65
37
|
|
|
66
38
|
type LGV = LinearGenomeViewModel
|
|
67
39
|
|
|
68
|
-
|
|
69
|
-
({ model, view }: { model: BaseTrackModel; view: LGV }) => {
|
|
70
|
-
const { classes, cx } = useStyles()
|
|
71
|
-
const display = model.displays[0]
|
|
72
|
-
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes
|
|
73
|
-
const labelStyle =
|
|
74
|
-
view.trackLabels !== 'overlapping' || display.prefersOffset
|
|
75
|
-
? trackLabelOffset
|
|
76
|
-
: trackLabelOverlap
|
|
77
|
-
|
|
78
|
-
return view.trackLabels !== 'hidden' ? (
|
|
79
|
-
<TrackLabel track={model} className={cx(trackLabel, labelStyle)} />
|
|
80
|
-
) : null
|
|
81
|
-
},
|
|
82
|
-
)
|
|
83
|
-
|
|
84
|
-
function TrackContainer({
|
|
40
|
+
export default observer(function TrackContainer({
|
|
85
41
|
model,
|
|
86
42
|
track,
|
|
87
43
|
}: {
|
|
@@ -90,67 +46,34 @@ function TrackContainer({
|
|
|
90
46
|
}) {
|
|
91
47
|
const { classes } = useStyles()
|
|
92
48
|
const display = track.displays[0]
|
|
93
|
-
const {
|
|
94
|
-
const
|
|
95
|
-
const trackId = getConf(track, 'trackId')
|
|
96
|
-
const ref = useRef(null)
|
|
49
|
+
const { draggingTrackId } = model
|
|
50
|
+
const ref2 = useRef<HTMLDivElement>(null)
|
|
97
51
|
const dimmed = draggingTrackId !== undefined && draggingTrackId !== display.id
|
|
98
|
-
const minimized = track.minimized
|
|
99
52
|
const debouncedOnDragEnter = useDebouncedCallback(() => {
|
|
100
53
|
if (isAlive(display) && dimmed) {
|
|
101
|
-
moveTrack(draggingTrackId, track.id)
|
|
54
|
+
model.moveTrack(draggingTrackId, track.id)
|
|
102
55
|
}
|
|
103
56
|
}, 100)
|
|
104
|
-
useEffect(() => {
|
|
105
|
-
if (ref.current) {
|
|
106
|
-
model.trackRefs[trackId] = ref.current
|
|
107
|
-
}
|
|
108
|
-
return () => {
|
|
109
|
-
delete model.trackRefs[trackId]
|
|
110
|
-
}
|
|
111
|
-
}, [model.trackRefs, trackId])
|
|
112
57
|
|
|
113
58
|
return (
|
|
114
|
-
<Paper
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
59
|
+
<Paper
|
|
60
|
+
ref={ref2}
|
|
61
|
+
className={classes.root}
|
|
62
|
+
variant="outlined"
|
|
63
|
+
onClick={event => {
|
|
64
|
+
if (event.detail === 2 && !track.displays[0].featureIdUnderMouse) {
|
|
65
|
+
const left = ref2.current?.getBoundingClientRect().left || 0
|
|
66
|
+
model.zoomTo(model.bpPerPx / 2, event.clientX - left, true)
|
|
67
|
+
}
|
|
68
|
+
}}
|
|
69
|
+
>
|
|
70
|
+
<TrackLabelContainer track={track} view={model} />
|
|
71
|
+
<ErrorBoundary FallbackComponent={e => <ErrorMessage error={e.error} />}>
|
|
72
|
+
<TrackRenderingContainer
|
|
73
|
+
model={model}
|
|
74
|
+
track={track}
|
|
124
75
|
onDragEnter={debouncedOnDragEnter}
|
|
125
|
-
|
|
126
|
-
>
|
|
127
|
-
{!minimized ? (
|
|
128
|
-
<>
|
|
129
|
-
<div
|
|
130
|
-
ref={ref}
|
|
131
|
-
className={classes.renderingComponentContainer}
|
|
132
|
-
style={{ transform: `scaleX(${model.scaleFactor})` }}
|
|
133
|
-
>
|
|
134
|
-
<RenderingComponent
|
|
135
|
-
model={display}
|
|
136
|
-
onHorizontalScroll={horizontalScroll}
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
139
|
-
|
|
140
|
-
{DisplayBlurb ? (
|
|
141
|
-
<div
|
|
142
|
-
style={{
|
|
143
|
-
position: 'absolute',
|
|
144
|
-
left: 0,
|
|
145
|
-
top: display.height - 20,
|
|
146
|
-
}}
|
|
147
|
-
>
|
|
148
|
-
<DisplayBlurb model={display} />
|
|
149
|
-
</div>
|
|
150
|
-
) : null}
|
|
151
|
-
</>
|
|
152
|
-
) : null}
|
|
153
|
-
</div>
|
|
76
|
+
/>
|
|
154
77
|
</ErrorBoundary>
|
|
155
78
|
<div
|
|
156
79
|
className={classes.overlay}
|
|
@@ -166,6 +89,4 @@ function TrackContainer({
|
|
|
166
89
|
/>
|
|
167
90
|
</Paper>
|
|
168
91
|
)
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
export default observer(TrackContainer)
|
|
92
|
+
})
|
|
@@ -7,13 +7,7 @@ import { getSession, getContainingView } from '@jbrowse/core/util'
|
|
|
7
7
|
import { getTrackName } from '@jbrowse/core/util/tracks'
|
|
8
8
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
9
9
|
import { SanitizedHTML } from '@jbrowse/core/ui'
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import {
|
|
13
|
-
bindTrigger,
|
|
14
|
-
bindPopover,
|
|
15
|
-
usePopupState,
|
|
16
|
-
} from 'material-ui-popup-state/hooks'
|
|
10
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
17
11
|
|
|
18
12
|
// icons
|
|
19
13
|
import MoreVertIcon from '@mui/icons-material/MoreVert'
|
|
@@ -71,12 +65,6 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(function (
|
|
|
71
65
|
const minimized = track.minimized
|
|
72
66
|
const trackId = getConf(track, 'trackId')
|
|
73
67
|
const trackName = getTrackName(trackConf, session)
|
|
74
|
-
|
|
75
|
-
const popupState = usePopupState({
|
|
76
|
-
popupId: 'trackLabelMenu',
|
|
77
|
-
variant: 'popover',
|
|
78
|
-
})
|
|
79
|
-
|
|
80
68
|
const items = [
|
|
81
69
|
{
|
|
82
70
|
label: minimized ? 'Restore track' : 'Minimize track',
|
|
@@ -119,23 +107,15 @@ const TrackLabel = React.forwardRef<HTMLDivElement, Props>(function (
|
|
|
119
107
|
className={classes.trackName}
|
|
120
108
|
>
|
|
121
109
|
<SanitizedHTML
|
|
122
|
-
html={
|
|
110
|
+
html={[trackName, minimized ? '(minimized)' : '']
|
|
111
|
+
.filter(f => !!f)
|
|
112
|
+
.join(' ')}
|
|
123
113
|
/>
|
|
124
114
|
</Typography>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
className={classes.iconButton}
|
|
128
|
-
data-testid="track_menu_icon"
|
|
129
|
-
disabled={items.length === 0}
|
|
130
|
-
>
|
|
115
|
+
|
|
116
|
+
<CascadingMenuButton menuItems={items} data-testid="track_menu_icon">
|
|
131
117
|
<MoreVertIcon fontSize="small" />
|
|
132
|
-
</
|
|
133
|
-
<CascadingMenu
|
|
134
|
-
{...bindPopover(popupState)}
|
|
135
|
-
onMenuItemClick={(_: unknown, callback: Function) => callback()}
|
|
136
|
-
menuItems={items}
|
|
137
|
-
popupState={popupState}
|
|
138
|
-
/>
|
|
118
|
+
</CascadingMenuButton>
|
|
139
119
|
</Paper>
|
|
140
120
|
)
|
|
141
121
|
})
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
|
|
5
|
+
// jbrowse core
|
|
6
|
+
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
7
|
+
|
|
8
|
+
// locals
|
|
9
|
+
import { LinearGenomeViewModel } from '..'
|
|
10
|
+
import TrackLabel from './TrackLabel'
|
|
11
|
+
|
|
12
|
+
const useStyles = makeStyles()({
|
|
13
|
+
trackLabel: {
|
|
14
|
+
zIndex: 3,
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
trackLabelOffset: {
|
|
18
|
+
position: 'relative',
|
|
19
|
+
display: 'inline-block',
|
|
20
|
+
},
|
|
21
|
+
trackLabelOverlap: {
|
|
22
|
+
position: 'absolute',
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
type LGV = LinearGenomeViewModel
|
|
27
|
+
|
|
28
|
+
const TrackLabelContainer = observer(function ({
|
|
29
|
+
track,
|
|
30
|
+
view,
|
|
31
|
+
}: {
|
|
32
|
+
track: BaseTrackModel
|
|
33
|
+
view: LGV
|
|
34
|
+
}) {
|
|
35
|
+
const { classes, cx } = useStyles()
|
|
36
|
+
const display = track.displays[0]
|
|
37
|
+
const { trackLabel, trackLabelOverlap, trackLabelOffset } = classes
|
|
38
|
+
const labelStyle =
|
|
39
|
+
view.trackLabels !== 'overlapping' || display.prefersOffset
|
|
40
|
+
? trackLabelOffset
|
|
41
|
+
: trackLabelOverlap
|
|
42
|
+
|
|
43
|
+
return view.trackLabels !== 'hidden' ? (
|
|
44
|
+
<TrackLabel track={track} className={cx(trackLabel, labelStyle)} />
|
|
45
|
+
) : null
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
export default TrackLabelContainer
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
|
|
5
|
+
// jbrowse core
|
|
6
|
+
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
7
|
+
import { getConf } from '@jbrowse/core/configuration'
|
|
8
|
+
|
|
9
|
+
// locals
|
|
10
|
+
import { LinearGenomeViewModel } from '..'
|
|
11
|
+
|
|
12
|
+
const useStyles = makeStyles()({
|
|
13
|
+
// aligns with block boundaries. check for example the breakpoint split view
|
|
14
|
+
// demo to see if features align if wanting to change things
|
|
15
|
+
renderingComponentContainer: {
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
// -1 offset because of the 1px border of the Paper
|
|
18
|
+
left: -1,
|
|
19
|
+
height: '100%',
|
|
20
|
+
width: '100%',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
trackRenderingContainer: {
|
|
24
|
+
overflowY: 'auto',
|
|
25
|
+
overflowX: 'hidden',
|
|
26
|
+
whiteSpace: 'nowrap',
|
|
27
|
+
position: 'relative',
|
|
28
|
+
background: 'none',
|
|
29
|
+
zIndex: 2,
|
|
30
|
+
},
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
type LGV = LinearGenomeViewModel
|
|
34
|
+
|
|
35
|
+
export default observer(function TrackRenderingContainer({
|
|
36
|
+
model,
|
|
37
|
+
track,
|
|
38
|
+
onDragEnter,
|
|
39
|
+
}: {
|
|
40
|
+
model: LGV
|
|
41
|
+
track: BaseTrackModel
|
|
42
|
+
onDragEnter: () => void
|
|
43
|
+
}) {
|
|
44
|
+
const { classes } = useStyles()
|
|
45
|
+
const display = track.displays[0]
|
|
46
|
+
const { height, RenderingComponent, DisplayBlurb } = display
|
|
47
|
+
const trackId = getConf(track, 'trackId')
|
|
48
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
49
|
+
const minimized = track.minimized
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (ref.current) {
|
|
53
|
+
model.trackRefs[trackId] = ref.current
|
|
54
|
+
}
|
|
55
|
+
return () => {
|
|
56
|
+
delete model.trackRefs[trackId]
|
|
57
|
+
}
|
|
58
|
+
}, [model.trackRefs, trackId])
|
|
59
|
+
|
|
60
|
+
return (
|
|
61
|
+
<div
|
|
62
|
+
className={classes.trackRenderingContainer}
|
|
63
|
+
style={{ height: minimized ? 20 : height }}
|
|
64
|
+
onScroll={evt => display.setScrollTop(evt.currentTarget.scrollTop)}
|
|
65
|
+
onDragEnter={onDragEnter}
|
|
66
|
+
data-testid={`trackRenderingContainer-${model.id}-${trackId}`}
|
|
67
|
+
>
|
|
68
|
+
{!minimized ? (
|
|
69
|
+
<>
|
|
70
|
+
<div
|
|
71
|
+
ref={ref}
|
|
72
|
+
className={classes.renderingComponentContainer}
|
|
73
|
+
style={{ transform: `scaleX(${model.scaleFactor})` }}
|
|
74
|
+
>
|
|
75
|
+
<RenderingComponent
|
|
76
|
+
model={display}
|
|
77
|
+
onHorizontalScroll={model.horizontalScroll}
|
|
78
|
+
/>
|
|
79
|
+
</div>
|
|
80
|
+
|
|
81
|
+
{DisplayBlurb ? (
|
|
82
|
+
<div
|
|
83
|
+
style={{
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
left: 0,
|
|
86
|
+
top: display.height - 20,
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<DisplayBlurb model={display} />
|
|
90
|
+
</div>
|
|
91
|
+
) : null}
|
|
92
|
+
</>
|
|
93
|
+
) : null}
|
|
94
|
+
</div>
|
|
95
|
+
)
|
|
96
|
+
})
|