@jbrowse/plugin-linear-genome-view 2.2.1 → 2.3.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/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -2
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Block.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/Block.js +1 -1
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
- package/dist/BaseLinearDisplay/components/BlockMsg.js +3 -2
- package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
- package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
- package/dist/BaseLinearDisplay/index.d.ts +2 -2
- package/dist/BaseLinearDisplay/index.js +4 -3
- package/dist/BaseLinearDisplay/index.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +2 -0
- package/dist/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -5
- package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/dist/BaseLinearDisplay/models/util.d.ts +18 -0
- package/dist/BaseLinearDisplay/models/util.js +18 -0
- package/dist/BaseLinearDisplay/models/util.js.map +1 -0
- package/dist/FeatureTrack/index.d.ts +1 -1
- package/dist/FeatureTrack/index.js +5 -4
- package/dist/FeatureTrack/index.js.map +1 -1
- package/dist/LaunchLinearGenomeView/index.d.ts +3 -0
- package/dist/LaunchLinearGenomeView/index.js +44 -0
- package/dist/LaunchLinearGenomeView/index.js.map +1 -0
- package/dist/LinearBareDisplay/index.d.ts +6 -2
- package/dist/LinearBareDisplay/index.js +18 -2
- package/dist/LinearBareDisplay/index.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +2 -15
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/dist/LinearBasicDisplay/index.d.ts +6 -2
- package/dist/LinearBasicDisplay/index.js +21 -4
- package/dist/LinearBasicDisplay/index.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +17 -13
- package/dist/LinearBasicDisplay/model.js +2 -1
- package/dist/LinearBasicDisplay/model.js.map +1 -1
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +1 -19
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/GetSequenceDialog.js +7 -18
- package/dist/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/Header.js +2 -2
- package/dist/LinearGenomeView/components/HelpDialog.js +2 -17
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/ImportForm.js +15 -10
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +6 -7
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/{esm/LinearGenomeView/components/OverviewRubberBand.d.ts → dist/LinearGenomeView/components/OverviewRubberband.d.ts} +2 -2
- package/dist/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +27 -79
- package/dist/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
- package/dist/LinearGenomeView/components/{OverviewScaleBar.d.ts → OverviewScalebar.d.ts} +2 -2
- package/dist/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
- package/dist/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/dist/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +2 -2
- package/dist/LinearGenomeView/components/Rubberband.js +57 -0
- package/dist/LinearGenomeView/components/Rubberband.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.js +90 -0
- package/dist/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.d.ts +2 -18
- package/dist/LinearGenomeView/components/Ruler.js +9 -25
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
- package/dist/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +2 -2
- package/dist/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
- package/dist/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +10 -6
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +17 -31
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js +4 -19
- package/dist/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +2 -2
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +21 -118
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/dist/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
- package/dist/LinearGenomeView/components/VerticalGuide.js +29 -0
- package/dist/LinearGenomeView/components/VerticalGuide.js.map +1 -0
- package/dist/LinearGenomeView/components/hooks.d.ts +65 -0
- package/dist/LinearGenomeView/components/hooks.js +264 -0
- package/dist/LinearGenomeView/components/hooks.js.map +1 -0
- package/dist/LinearGenomeView/components/util.d.ts +5 -2
- package/dist/LinearGenomeView/components/util.js +7 -6
- package/dist/LinearGenomeView/components/util.js.map +1 -1
- package/dist/LinearGenomeView/index.d.ts +3 -534
- package/dist/LinearGenomeView/index.js +12 -1327
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/LinearGenomeView/model.d.ts +535 -0
- package/dist/LinearGenomeView/model.js +1357 -0
- package/dist/LinearGenomeView/model.js.map +1 -0
- package/dist/index.d.ts +6 -6
- package/dist/index.js +12 -73
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -2
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Block.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/Block.js +1 -1
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -2
- package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
- package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +2 -2
- package/esm/BaseLinearDisplay/index.js +2 -2
- package/esm/BaseLinearDisplay/index.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -0
- package/esm/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -4
- package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -1
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -1
- package/esm/BaseLinearDisplay/models/util.d.ts +18 -0
- package/esm/BaseLinearDisplay/models/util.js +14 -0
- package/esm/BaseLinearDisplay/models/util.js.map +1 -0
- package/esm/FeatureTrack/index.d.ts +1 -1
- package/esm/FeatureTrack/index.js +5 -4
- package/esm/FeatureTrack/index.js.map +1 -1
- package/esm/LaunchLinearGenomeView/index.d.ts +3 -0
- package/esm/LaunchLinearGenomeView/index.js +42 -0
- package/esm/LaunchLinearGenomeView/index.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +6 -2
- package/esm/LinearBareDisplay/index.js +19 -2
- package/esm/LinearBareDisplay/index.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +1 -1
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +3 -13
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -1
- package/esm/LinearBasicDisplay/index.d.ts +6 -2
- package/esm/LinearBasicDisplay/index.js +20 -2
- package/esm/LinearBasicDisplay/index.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +17 -13
- package/esm/LinearBasicDisplay/model.js +2 -1
- package/esm/LinearBasicDisplay/model.js.map +1 -1
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +3 -18
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/GetSequenceDialog.js +8 -19
- package/esm/LinearGenomeView/components/GetSequenceDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/Header.js +2 -2
- package/esm/LinearGenomeView/components/HelpDialog.js +3 -18
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/ImportForm.js +15 -10
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +4 -5
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/{dist/LinearGenomeView/components/OverviewRubberBand.d.ts → esm/LinearGenomeView/components/OverviewRubberband.d.ts} +2 -2
- package/esm/LinearGenomeView/components/{OverviewRubberBand.js → OverviewRubberband.js} +25 -80
- package/esm/LinearGenomeView/components/OverviewRubberband.js.map +1 -0
- package/esm/LinearGenomeView/components/{OverviewScaleBar.d.ts → OverviewScalebar.d.ts} +2 -2
- package/esm/LinearGenomeView/components/{OverviewScaleBar.js → OverviewScalebar.js} +25 -24
- package/esm/LinearGenomeView/components/OverviewScalebar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -1
- package/esm/LinearGenomeView/components/{RubberBand.d.ts → Rubberband.d.ts} +2 -2
- package/esm/LinearGenomeView/components/Rubberband.js +29 -0
- package/esm/LinearGenomeView/components/Rubberband.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.d.ts +14 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.js +65 -0
- package/esm/LinearGenomeView/components/RubberbandSpan.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +2 -18
- package/esm/LinearGenomeView/components/Ruler.js +6 -22
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -1
- package/esm/LinearGenomeView/components/{ScaleBar.d.ts → Scalebar.d.ts} +2 -2
- package/esm/LinearGenomeView/components/{ScaleBar.js → Scalebar.js} +11 -11
- package/esm/LinearGenomeView/components/{ScaleBar.js.map → Scalebar.js.map} +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +10 -6
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +18 -32
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js +5 -17
- package/esm/LinearGenomeView/components/SequenceSearchDialog.js.map +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +2 -2
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/TracksContainer.js +22 -119
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -1
- package/esm/LinearGenomeView/components/VerticalGuide.d.ts +9 -0
- package/esm/LinearGenomeView/components/VerticalGuide.js +24 -0
- package/esm/LinearGenomeView/components/VerticalGuide.js.map +1 -0
- package/esm/LinearGenomeView/components/hooks.d.ts +65 -0
- package/esm/LinearGenomeView/components/hooks.js +255 -0
- package/esm/LinearGenomeView/components/hooks.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +5 -2
- package/esm/LinearGenomeView/components/util.js +4 -3
- package/esm/LinearGenomeView/components/util.js.map +1 -1
- package/esm/LinearGenomeView/index.d.ts +3 -534
- package/esm/LinearGenomeView/index.js +10 -1318
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/LinearGenomeView/model.d.ts +535 -0
- package/esm/LinearGenomeView/model.js +1322 -0
- package/esm/LinearGenomeView/model.js.map +1 -0
- package/esm/index.d.ts +6 -6
- package/esm/index.js +12 -74
- package/esm/index.js.map +1 -1
- package/package.json +5 -6
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +86 -84
- package/src/BaseLinearDisplay/components/Block.tsx +15 -11
- package/src/BaseLinearDisplay/components/BlockMsg.tsx +9 -9
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +62 -58
- package/src/BaseLinearDisplay/{models → components}/TooLargeMessage.tsx +0 -0
- package/src/BaseLinearDisplay/index.ts +2 -1
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +4 -3
- package/src/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.ts → configSchema.ts} +5 -3
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/BaseLinearDisplay/models/util.ts +24 -0
- package/src/FeatureTrack/index.ts +5 -8
- package/src/LaunchLinearGenomeView/index.ts +66 -0
- package/src/LinearBareDisplay/index.ts +23 -2
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +3 -28
- package/src/LinearBasicDisplay/index.ts +24 -2
- package/src/LinearBasicDisplay/model.ts +2 -1
- package/src/LinearGenomeView/README.md +2 -1
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +2 -23
- package/src/LinearGenomeView/components/GetSequenceDialog.tsx +13 -31
- package/src/LinearGenomeView/components/Header.tsx +3 -3
- package/src/LinearGenomeView/components/HelpDialog.tsx +8 -34
- package/src/LinearGenomeView/components/ImportForm.tsx +13 -9
- package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +132 -134
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +4 -5
- package/src/LinearGenomeView/components/{OverviewRubberBand.tsx → OverviewRubberband.tsx} +32 -114
- package/src/LinearGenomeView/components/{OverviewScaleBar.tsx → OverviewScalebar.tsx} +26 -25
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +2 -1
- package/src/LinearGenomeView/components/Rubberband.tsx +89 -0
- package/src/LinearGenomeView/components/RubberbandSpan.tsx +116 -0
- package/src/LinearGenomeView/components/Ruler.tsx +11 -28
- package/src/LinearGenomeView/components/{ScaleBar.test.tsx → Scalebar.test.tsx} +5 -5
- package/src/LinearGenomeView/components/{ScaleBar.tsx → Scalebar.tsx} +11 -11
- package/src/LinearGenomeView/components/SearchBox.tsx +8 -6
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +17 -44
- package/src/LinearGenomeView/components/SequenceSearchDialog.tsx +4 -30
- package/src/LinearGenomeView/components/TrackContainer.tsx +4 -2
- package/src/LinearGenomeView/components/TracksContainer.tsx +59 -136
- package/src/LinearGenomeView/components/VerticalGuide.tsx +37 -0
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +39 -44
- package/src/LinearGenomeView/components/hooks.ts +300 -0
- package/src/LinearGenomeView/components/util.ts +8 -11
- package/src/LinearGenomeView/index.test.ts +6 -7
- package/src/LinearGenomeView/index.ts +18 -0
- package/src/LinearGenomeView/{index.tsx → model.ts} +7 -4
- package/src/index.ts +16 -108
- package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
- package/dist/LinearGenomeView/components/RubberBand.js +0 -221
- package/dist/LinearGenomeView/components/RubberBand.js.map +0 -1
- package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +0 -1
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +0 -1
- package/esm/LinearGenomeView/components/RubberBand.js +0 -196
- package/esm/LinearGenomeView/components/RubberBand.js.map +0 -1
- package/src/LinearGenomeView/components/RubberBand.tsx +0 -308
|
@@ -3,6 +3,7 @@ import { Typography, useTheme, alpha } from '@mui/material'
|
|
|
3
3
|
import { makeStyles } from 'tss-react/mui'
|
|
4
4
|
import { observer } from 'mobx-react'
|
|
5
5
|
|
|
6
|
+
// core
|
|
6
7
|
import Base1DView, { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel'
|
|
7
8
|
import { getSession, getTickDisplayStr } from '@jbrowse/core/util'
|
|
8
9
|
import { ContentBlock } from '@jbrowse/core/util/blockTypes'
|
|
@@ -15,46 +16,46 @@ import {
|
|
|
15
16
|
HEADER_OVERVIEW_HEIGHT,
|
|
16
17
|
} from '..'
|
|
17
18
|
import { chooseGridPitch } from '../util'
|
|
18
|
-
import
|
|
19
|
+
import OverviewRubberband from './OverviewRubberband'
|
|
19
20
|
|
|
20
21
|
const wholeSeqSpacer = 2
|
|
21
22
|
|
|
22
23
|
const useStyles = makeStyles()(theme => ({
|
|
23
|
-
|
|
24
|
+
scalebar: {
|
|
24
25
|
height: HEADER_OVERVIEW_HEIGHT,
|
|
25
26
|
},
|
|
26
|
-
|
|
27
|
+
scalebarBorder: {
|
|
27
28
|
border: '1px solid',
|
|
28
29
|
},
|
|
29
|
-
|
|
30
|
+
scalebarContig: {
|
|
30
31
|
backgroundColor: theme.palette.background.default,
|
|
31
32
|
position: 'absolute',
|
|
32
33
|
top: 0,
|
|
33
34
|
height: HEADER_OVERVIEW_HEIGHT,
|
|
34
35
|
},
|
|
35
|
-
|
|
36
|
+
scalebarContigForward: {
|
|
36
37
|
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M-.1 0L6 4.5L-.1 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
|
|
37
38
|
backgroundRepeat: 'repeat',
|
|
38
39
|
},
|
|
39
|
-
|
|
40
|
+
scalebarContigReverse: {
|
|
40
41
|
backgroundImage: `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 9'%3E%3Cpath d='M6 0L0 4.5L6 9' fill='none' stroke='%23ddd'/%3E%3C/svg%3E")`,
|
|
41
42
|
backgroundRepeat: 'repeat',
|
|
42
43
|
},
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
scalebarRefName: {
|
|
45
46
|
position: 'absolute',
|
|
46
47
|
fontWeight: 'bold',
|
|
47
48
|
pointerEvents: 'none',
|
|
48
49
|
zIndex: 100,
|
|
49
50
|
},
|
|
50
|
-
|
|
51
|
+
scalebarLabel: {
|
|
51
52
|
height: HEADER_OVERVIEW_HEIGHT,
|
|
52
53
|
position: 'absolute',
|
|
53
54
|
display: 'flex',
|
|
54
55
|
justifyContent: 'center',
|
|
55
56
|
pointerEvents: 'none',
|
|
56
57
|
},
|
|
57
|
-
|
|
58
|
+
scalebarVisibleRegion: {
|
|
58
59
|
position: 'absolute',
|
|
59
60
|
height: HEADER_OVERVIEW_HEIGHT,
|
|
60
61
|
pointerEvents: 'none',
|
|
@@ -328,19 +329,19 @@ const OverviewBox = observer(
|
|
|
328
329
|
left: block.offsetPx + 3,
|
|
329
330
|
color: canDisplayCytobands ? 'black' : refNameColor,
|
|
330
331
|
}}
|
|
331
|
-
className={classes.
|
|
332
|
+
className={classes.scalebarRefName}
|
|
332
333
|
>
|
|
333
334
|
{refName}
|
|
334
335
|
</Typography>
|
|
335
336
|
<div
|
|
336
337
|
className={cx(
|
|
337
|
-
classes.
|
|
338
|
+
classes.scalebarContig,
|
|
338
339
|
canDisplayCytobands
|
|
339
340
|
? undefined
|
|
340
341
|
: reversed
|
|
341
|
-
? classes.
|
|
342
|
-
: classes.
|
|
343
|
-
!canDisplayCytobands ? classes.
|
|
342
|
+
? classes.scalebarContigReverse
|
|
343
|
+
: classes.scalebarContigForward,
|
|
344
|
+
!canDisplayCytobands ? classes.scalebarBorder : undefined,
|
|
344
345
|
)}
|
|
345
346
|
style={{
|
|
346
347
|
left: block.offsetPx + cytobandOffset,
|
|
@@ -352,7 +353,7 @@ const OverviewBox = observer(
|
|
|
352
353
|
? tickLabels.map((tickLabel, labelIdx) => (
|
|
353
354
|
<Typography
|
|
354
355
|
key={`${JSON.stringify(block)}-${tickLabel}-${labelIdx}`}
|
|
355
|
-
className={classes.
|
|
356
|
+
className={classes.scalebarLabel}
|
|
356
357
|
variant="body2"
|
|
357
358
|
style={{
|
|
358
359
|
left: ((labelIdx + 1) * majorPitch) / scale,
|
|
@@ -380,7 +381,7 @@ const OverviewBox = observer(
|
|
|
380
381
|
},
|
|
381
382
|
)
|
|
382
383
|
|
|
383
|
-
const
|
|
384
|
+
const Scalebar = observer(
|
|
384
385
|
({
|
|
385
386
|
model,
|
|
386
387
|
scale,
|
|
@@ -397,7 +398,7 @@ const ScaleBar = observer(
|
|
|
397
398
|
const overviewVisibleRegions = overview.dynamicBlocks
|
|
398
399
|
|
|
399
400
|
const { tertiary, primary } = theme.palette
|
|
400
|
-
const
|
|
401
|
+
const scalebarColor = tertiary ? tertiary.light : primary.light
|
|
401
402
|
|
|
402
403
|
if (!visibleRegions.length) {
|
|
403
404
|
return null
|
|
@@ -416,13 +417,13 @@ const ScaleBar = observer(
|
|
|
416
417
|
coord: last.reversed ? last.start : last.end,
|
|
417
418
|
}) || 0
|
|
418
419
|
|
|
419
|
-
const color = showCytobands ? '#f00' :
|
|
420
|
+
const color = showCytobands ? '#f00' : scalebarColor
|
|
420
421
|
const transparency = showCytobands ? 0.1 : 0.3
|
|
421
422
|
|
|
422
423
|
return (
|
|
423
|
-
<div className={classes.
|
|
424
|
+
<div className={classes.scalebar}>
|
|
424
425
|
<div
|
|
425
|
-
className={classes.
|
|
426
|
+
className={classes.scalebarVisibleRegion}
|
|
426
427
|
style={{
|
|
427
428
|
width: lastOverviewPx - firstOverviewPx,
|
|
428
429
|
left: firstOverviewPx + cytobandOffset,
|
|
@@ -435,7 +436,7 @@ const ScaleBar = observer(
|
|
|
435
436
|
return !(block instanceof ContentBlock) ? (
|
|
436
437
|
<div
|
|
437
438
|
key={`${JSON.stringify(block)}-${idx}`}
|
|
438
|
-
className={classes.
|
|
439
|
+
className={classes.scalebarContig}
|
|
439
440
|
style={{
|
|
440
441
|
width: block.widthPx,
|
|
441
442
|
left: block.offsetPx,
|
|
@@ -459,7 +460,7 @@ const ScaleBar = observer(
|
|
|
459
460
|
},
|
|
460
461
|
)
|
|
461
462
|
|
|
462
|
-
function
|
|
463
|
+
function OverviewScalebar({
|
|
463
464
|
model,
|
|
464
465
|
children,
|
|
465
466
|
}: {
|
|
@@ -484,11 +485,11 @@ function OverviewScaleBar({
|
|
|
484
485
|
|
|
485
486
|
return (
|
|
486
487
|
<div>
|
|
487
|
-
<
|
|
488
|
+
<OverviewRubberband
|
|
488
489
|
model={model}
|
|
489
490
|
overview={overview}
|
|
490
491
|
ControlComponent={
|
|
491
|
-
<
|
|
492
|
+
<Scalebar model={model} overview={overview} scale={scale} />
|
|
492
493
|
}
|
|
493
494
|
/>
|
|
494
495
|
<div className={classes.overview}>
|
|
@@ -501,6 +502,6 @@ function OverviewScaleBar({
|
|
|
501
502
|
)
|
|
502
503
|
}
|
|
503
504
|
|
|
504
|
-
export default observer(
|
|
505
|
+
export default observer(OverviewScalebar)
|
|
505
506
|
|
|
506
507
|
export { Cytobands, Polygon }
|
|
@@ -94,6 +94,7 @@ function RefNameAutocomplete({
|
|
|
94
94
|
useEffect(() => {
|
|
95
95
|
let active = true
|
|
96
96
|
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
97
98
|
;(async () => {
|
|
98
99
|
try {
|
|
99
100
|
if (debouncedSearch === '' || !assemblyName) {
|
|
@@ -146,7 +147,7 @@ function RefNameAutocomplete({
|
|
|
146
147
|
const inputBoxVal = coarseVisibleLocStrings || value || ''
|
|
147
148
|
|
|
148
149
|
// heuristic, text width + icon width
|
|
149
|
-
// + 45
|
|
150
|
+
// + 45 accommodates help icon and search icon
|
|
150
151
|
const width = Math.min(
|
|
151
152
|
Math.max(measureText(inputBoxVal, 16) + 45, minWidth),
|
|
152
153
|
550,
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
import { observer } from 'mobx-react'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
|
+
import { Menu } from '@jbrowse/core/ui'
|
|
5
|
+
|
|
6
|
+
// locals
|
|
7
|
+
import VerticalGuide from './VerticalGuide'
|
|
8
|
+
import RubberbandSpan from './RubberbandSpan'
|
|
9
|
+
import { useRangeSelect } from './hooks'
|
|
10
|
+
import { LinearGenomeViewModel } from '..'
|
|
11
|
+
|
|
12
|
+
type LGV = LinearGenomeViewModel
|
|
13
|
+
|
|
14
|
+
const useStyles = makeStyles()({
|
|
15
|
+
rubberbandControl: {
|
|
16
|
+
cursor: 'crosshair',
|
|
17
|
+
width: '100%',
|
|
18
|
+
minHeight: 8,
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
function Rubberband({
|
|
23
|
+
model,
|
|
24
|
+
ControlComponent = <div />,
|
|
25
|
+
}: {
|
|
26
|
+
model: LGV
|
|
27
|
+
ControlComponent?: React.ReactElement
|
|
28
|
+
}) {
|
|
29
|
+
const ref = useRef<HTMLDivElement>(null)
|
|
30
|
+
const { classes } = useStyles()
|
|
31
|
+
|
|
32
|
+
const {
|
|
33
|
+
guideX,
|
|
34
|
+
rubberbandOn,
|
|
35
|
+
leftBpOffset,
|
|
36
|
+
rightBpOffset,
|
|
37
|
+
numOfBpSelected,
|
|
38
|
+
width,
|
|
39
|
+
left,
|
|
40
|
+
anchorPosition,
|
|
41
|
+
handleMenuItemClick,
|
|
42
|
+
open,
|
|
43
|
+
handleClose,
|
|
44
|
+
mouseMove,
|
|
45
|
+
mouseDown,
|
|
46
|
+
mouseOut,
|
|
47
|
+
} = useRangeSelect(ref, model)
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<>
|
|
51
|
+
{guideX !== undefined ? (
|
|
52
|
+
<VerticalGuide model={model} coordX={guideX} />
|
|
53
|
+
) : rubberbandOn ? (
|
|
54
|
+
<RubberbandSpan
|
|
55
|
+
leftBpOffset={leftBpOffset}
|
|
56
|
+
rightBpOffset={rightBpOffset}
|
|
57
|
+
numOfBpSelected={numOfBpSelected}
|
|
58
|
+
width={width}
|
|
59
|
+
left={left}
|
|
60
|
+
/>
|
|
61
|
+
) : null}
|
|
62
|
+
{anchorPosition ? (
|
|
63
|
+
<Menu
|
|
64
|
+
anchorReference="anchorPosition"
|
|
65
|
+
anchorPosition={{
|
|
66
|
+
left: anchorPosition.clientX,
|
|
67
|
+
top: anchorPosition.clientY,
|
|
68
|
+
}}
|
|
69
|
+
onMenuItemClick={handleMenuItemClick}
|
|
70
|
+
open={open}
|
|
71
|
+
onClose={handleClose}
|
|
72
|
+
menuItems={model.rubberBandMenuItems()}
|
|
73
|
+
/>
|
|
74
|
+
) : null}
|
|
75
|
+
<div
|
|
76
|
+
data-testid="rubberband_controls"
|
|
77
|
+
className={classes.rubberbandControl}
|
|
78
|
+
ref={ref}
|
|
79
|
+
onMouseDown={mouseDown}
|
|
80
|
+
onMouseMove={mouseMove}
|
|
81
|
+
onMouseOut={mouseOut}
|
|
82
|
+
>
|
|
83
|
+
{ControlComponent}
|
|
84
|
+
</div>
|
|
85
|
+
</>
|
|
86
|
+
)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default observer(Rubberband)
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import React, { useRef } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
|
+
|
|
4
|
+
import { Popover, Typography, alpha } from '@mui/material'
|
|
5
|
+
import { stringify, toLocale } from '@jbrowse/core/util'
|
|
6
|
+
|
|
7
|
+
const useStyles = makeStyles()(theme => {
|
|
8
|
+
const { primary, tertiary } = theme.palette
|
|
9
|
+
const background = tertiary
|
|
10
|
+
? alpha(tertiary.main, 0.7)
|
|
11
|
+
: alpha(primary.main, 0.7)
|
|
12
|
+
return {
|
|
13
|
+
rubberband: {
|
|
14
|
+
height: '100%',
|
|
15
|
+
background,
|
|
16
|
+
position: 'absolute',
|
|
17
|
+
zIndex: 10,
|
|
18
|
+
textAlign: 'center',
|
|
19
|
+
overflow: 'hidden',
|
|
20
|
+
},
|
|
21
|
+
rubberbandControl: {
|
|
22
|
+
cursor: 'crosshair',
|
|
23
|
+
width: '100%',
|
|
24
|
+
minHeight: 8,
|
|
25
|
+
},
|
|
26
|
+
rubberbandText: {
|
|
27
|
+
color: tertiary ? tertiary.contrastText : primary.contrastText,
|
|
28
|
+
},
|
|
29
|
+
popover: {
|
|
30
|
+
mouseEvents: 'none',
|
|
31
|
+
cursor: 'crosshair',
|
|
32
|
+
},
|
|
33
|
+
paper: {
|
|
34
|
+
paddingLeft: theme.spacing(1),
|
|
35
|
+
paddingRight: theme.spacing(1),
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
interface Offset {
|
|
41
|
+
coord: number
|
|
42
|
+
refName?: string
|
|
43
|
+
oob?: boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function RubberbandSpan({
|
|
47
|
+
leftBpOffset,
|
|
48
|
+
rightBpOffset,
|
|
49
|
+
numOfBpSelected,
|
|
50
|
+
left,
|
|
51
|
+
width,
|
|
52
|
+
}: {
|
|
53
|
+
leftBpOffset: Offset
|
|
54
|
+
rightBpOffset: Offset
|
|
55
|
+
numOfBpSelected?: number
|
|
56
|
+
left: number
|
|
57
|
+
width: number
|
|
58
|
+
}) {
|
|
59
|
+
const ref = useRef(null)
|
|
60
|
+
const { classes } = useStyles()
|
|
61
|
+
return (
|
|
62
|
+
<>
|
|
63
|
+
{ref.current ? (
|
|
64
|
+
<>
|
|
65
|
+
<Popover
|
|
66
|
+
className={classes.popover}
|
|
67
|
+
classes={{ paper: classes.paper }}
|
|
68
|
+
open
|
|
69
|
+
anchorEl={ref.current}
|
|
70
|
+
anchorOrigin={{
|
|
71
|
+
vertical: 'top',
|
|
72
|
+
horizontal: 'left',
|
|
73
|
+
}}
|
|
74
|
+
transformOrigin={{
|
|
75
|
+
vertical: 'bottom',
|
|
76
|
+
horizontal: 'right',
|
|
77
|
+
}}
|
|
78
|
+
keepMounted
|
|
79
|
+
disableRestoreFocus
|
|
80
|
+
>
|
|
81
|
+
<Typography>{stringify(leftBpOffset)}</Typography>
|
|
82
|
+
</Popover>
|
|
83
|
+
<Popover
|
|
84
|
+
className={classes.popover}
|
|
85
|
+
classes={{
|
|
86
|
+
paper: classes.paper,
|
|
87
|
+
}}
|
|
88
|
+
open
|
|
89
|
+
anchorEl={ref.current}
|
|
90
|
+
anchorOrigin={{
|
|
91
|
+
vertical: 'top',
|
|
92
|
+
horizontal: 'right',
|
|
93
|
+
}}
|
|
94
|
+
transformOrigin={{
|
|
95
|
+
vertical: 'bottom',
|
|
96
|
+
horizontal: 'left',
|
|
97
|
+
}}
|
|
98
|
+
keepMounted
|
|
99
|
+
disableRestoreFocus
|
|
100
|
+
>
|
|
101
|
+
<Typography>{stringify(rightBpOffset)}</Typography>
|
|
102
|
+
</Popover>
|
|
103
|
+
</>
|
|
104
|
+
) : null}
|
|
105
|
+
<div ref={ref} className={classes.rubberband} style={{ left, width }}>
|
|
106
|
+
{numOfBpSelected ? (
|
|
107
|
+
<Typography variant="h6" className={classes.rubberbandText}>
|
|
108
|
+
{toLocale(numOfBpSelected)} bp
|
|
109
|
+
</Typography>
|
|
110
|
+
) : null}
|
|
111
|
+
</div>
|
|
112
|
+
</>
|
|
113
|
+
)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default RubberbandSpan
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
|
-
import ReactPropTypes from 'prop-types'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
import { makeTicks } from '../util'
|
|
6
4
|
import { getTickDisplayStr } from '@jbrowse/core/util'
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
// locals
|
|
7
|
+
import { makeTicks } from '../util'
|
|
8
|
+
|
|
9
|
+
const useStyles = makeStyles()({
|
|
9
10
|
majorTickLabel: {
|
|
10
11
|
fontSize: '11px',
|
|
11
|
-
// fill: theme.palette.text.primary,
|
|
12
12
|
},
|
|
13
13
|
majorTick: {
|
|
14
14
|
stroke: '#555',
|
|
15
|
-
// stroke: theme.palette.text.secondary,
|
|
16
15
|
},
|
|
17
16
|
minorTick: {
|
|
18
17
|
stroke: '#999',
|
|
19
|
-
// stroke: theme.palette.text.hint,
|
|
20
18
|
},
|
|
21
|
-
})
|
|
19
|
+
})
|
|
22
20
|
|
|
23
21
|
function Ruler({
|
|
24
22
|
start,
|
|
25
23
|
end,
|
|
26
24
|
bpPerPx,
|
|
27
|
-
reversed,
|
|
28
|
-
major,
|
|
29
|
-
minor,
|
|
25
|
+
reversed = false,
|
|
26
|
+
major = true,
|
|
27
|
+
minor = true,
|
|
30
28
|
}: {
|
|
31
29
|
start: number
|
|
32
30
|
end: number
|
|
33
31
|
bpPerPx: number
|
|
34
32
|
reversed?: boolean
|
|
35
|
-
major
|
|
36
|
-
minor
|
|
33
|
+
major?: boolean
|
|
34
|
+
minor?: boolean
|
|
37
35
|
}) {
|
|
38
36
|
const { classes } = useStyles()
|
|
39
37
|
const ticks = makeTicks(start, end, bpPerPx, major, minor)
|
|
@@ -77,19 +75,4 @@ function Ruler({
|
|
|
77
75
|
)
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
Ruler.propTypes = {
|
|
81
|
-
start: ReactPropTypes.number.isRequired,
|
|
82
|
-
end: ReactPropTypes.number.isRequired,
|
|
83
|
-
bpPerPx: ReactPropTypes.number.isRequired,
|
|
84
|
-
reversed: ReactPropTypes.bool,
|
|
85
|
-
major: ReactPropTypes.bool,
|
|
86
|
-
minor: ReactPropTypes.bool,
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
Ruler.defaultProps = {
|
|
90
|
-
reversed: false,
|
|
91
|
-
major: true,
|
|
92
|
-
minor: true,
|
|
93
|
-
}
|
|
94
|
-
|
|
95
78
|
export default observer(Ruler)
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import { render } from '@testing-library/react'
|
|
4
4
|
import { createTestSession } from '@jbrowse/web/src/rootModel'
|
|
5
|
-
import
|
|
5
|
+
import Scalebar from './Scalebar'
|
|
6
6
|
jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
|
|
7
7
|
|
|
8
|
-
describe('
|
|
8
|
+
describe('Scalebar genome view component', () => {
|
|
9
9
|
it('renders two regions', () => {
|
|
10
10
|
const session = createTestSession({
|
|
11
11
|
views: [
|
|
@@ -47,7 +47,7 @@ describe('ScaleBar genome view component', () => {
|
|
|
47
47
|
},
|
|
48
48
|
})
|
|
49
49
|
const model = session.views[0]
|
|
50
|
-
const { getByTestId } = render(<
|
|
50
|
+
const { getByTestId } = render(<Scalebar model={model} />)
|
|
51
51
|
const ret1 = getByTestId('refLabel-ctgA')
|
|
52
52
|
const ret2 = getByTestId('refLabel-ctgB')
|
|
53
53
|
expect(ret1.style.left).toBe('-1px')
|
|
@@ -89,7 +89,7 @@ describe('ScaleBar genome view component', () => {
|
|
|
89
89
|
},
|
|
90
90
|
})
|
|
91
91
|
const model = session.views[0]
|
|
92
|
-
const { getByTestId } = render(<
|
|
92
|
+
const { getByTestId } = render(<Scalebar model={model} />)
|
|
93
93
|
const ret1 = getByTestId('refLabel-ctgA')
|
|
94
94
|
const ret2 = getByTestId('refLabel-ctgB')
|
|
95
95
|
expect(ret1.style.left).toBe('99px')
|
|
@@ -134,7 +134,7 @@ describe('ScaleBar genome view component', () => {
|
|
|
134
134
|
},
|
|
135
135
|
})
|
|
136
136
|
const model = session.views[0]
|
|
137
|
-
const { queryByTestId } = render(<
|
|
137
|
+
const { queryByTestId } = render(<Scalebar model={model} />)
|
|
138
138
|
const ret2 = queryByTestId('refLabel-ctgB')
|
|
139
139
|
const ret3 = queryByTestId('refLabel-ctgC')
|
|
140
140
|
const ret4 = queryByTestId('refLabel-ctgD')
|
|
@@ -19,15 +19,15 @@ import { getTickDisplayStr } from '@jbrowse/core/util'
|
|
|
19
19
|
type LGV = LinearGenomeViewModel
|
|
20
20
|
|
|
21
21
|
const useStyles = makeStyles()(theme => ({
|
|
22
|
-
|
|
22
|
+
scalebarContainer: {
|
|
23
23
|
overflow: 'hidden',
|
|
24
24
|
position: 'relative',
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
scalebarZoomContainer: {
|
|
27
27
|
position: 'relative',
|
|
28
28
|
zIndex: 1,
|
|
29
29
|
},
|
|
30
|
-
|
|
30
|
+
scalebar: {
|
|
31
31
|
position: 'absolute',
|
|
32
32
|
display: 'flex',
|
|
33
33
|
pointerEvents: 'none',
|
|
@@ -94,7 +94,7 @@ const RenderedRefNameLabels = observer(({ model }: { model: LGV }) => {
|
|
|
94
94
|
)
|
|
95
95
|
})
|
|
96
96
|
|
|
97
|
-
const
|
|
97
|
+
const RenderedScalebarLabels = observer(({ model }: { model: LGV }) => {
|
|
98
98
|
const { classes } = useStyles()
|
|
99
99
|
const { bpPerPx, staticBlocks } = model
|
|
100
100
|
|
|
@@ -150,13 +150,13 @@ const RenderedScaleBarLabels = observer(({ model }: { model: LGV }) => {
|
|
|
150
150
|
)
|
|
151
151
|
})
|
|
152
152
|
|
|
153
|
-
interface
|
|
153
|
+
interface ScalebarProps {
|
|
154
154
|
model: LGV
|
|
155
155
|
style?: React.CSSProperties
|
|
156
156
|
className?: string
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
const
|
|
159
|
+
const Scalebar = React.forwardRef<HTMLDivElement, ScalebarProps>(
|
|
160
160
|
({ model, style, className, ...other }, ref) => {
|
|
161
161
|
const { classes, cx } = useStyles()
|
|
162
162
|
|
|
@@ -164,14 +164,14 @@ const ScaleBar = React.forwardRef<HTMLDivElement, ScaleBarProps>(
|
|
|
164
164
|
return (
|
|
165
165
|
<Paper
|
|
166
166
|
data-resizer="true" // used to avoid click-and-drag scrolls on trackscontainer
|
|
167
|
-
className={cx(classes.
|
|
167
|
+
className={cx(classes.scalebarContainer, className)}
|
|
168
168
|
variant="outlined"
|
|
169
169
|
ref={ref}
|
|
170
170
|
style={style}
|
|
171
171
|
{...other}
|
|
172
172
|
>
|
|
173
173
|
<div
|
|
174
|
-
className={classes.
|
|
174
|
+
className={classes.scalebarZoomContainer}
|
|
175
175
|
style={{
|
|
176
176
|
transform:
|
|
177
177
|
model.scaleFactor !== 1
|
|
@@ -180,14 +180,14 @@ const ScaleBar = React.forwardRef<HTMLDivElement, ScaleBarProps>(
|
|
|
180
180
|
}}
|
|
181
181
|
>
|
|
182
182
|
<div
|
|
183
|
-
className={classes.
|
|
183
|
+
className={classes.scalebar}
|
|
184
184
|
style={{
|
|
185
185
|
left: offsetLeft - 1,
|
|
186
186
|
width: model.staticBlocks.totalWidthPx,
|
|
187
187
|
...style,
|
|
188
188
|
}}
|
|
189
189
|
>
|
|
190
|
-
<
|
|
190
|
+
<RenderedScalebarLabels model={model} />
|
|
191
191
|
</div>
|
|
192
192
|
</div>
|
|
193
193
|
<RenderedRefNameLabels model={model} />
|
|
@@ -196,4 +196,4 @@ const ScaleBar = React.forwardRef<HTMLDivElement, ScaleBarProps>(
|
|
|
196
196
|
},
|
|
197
197
|
)
|
|
198
198
|
|
|
199
|
-
export default observer(
|
|
199
|
+
export default observer(Scalebar)
|
|
@@ -33,11 +33,11 @@ function SearchBox({
|
|
|
33
33
|
const assembly = assemblyManager.get(assemblyName)
|
|
34
34
|
const searchScope = model.searchScope(assemblyName)
|
|
35
35
|
|
|
36
|
-
function navToOption(option: BaseResult) {
|
|
36
|
+
async function navToOption(option: BaseResult) {
|
|
37
37
|
const location = option.getLocation()
|
|
38
38
|
const trackId = option.getTrackId()
|
|
39
39
|
if (location) {
|
|
40
|
-
model.navToLocString(location, assemblyName)
|
|
40
|
+
await model.navToLocString(location, assemblyName)
|
|
41
41
|
if (trackId) {
|
|
42
42
|
model.showTrack(trackId)
|
|
43
43
|
}
|
|
@@ -52,7 +52,9 @@ function SearchBox({
|
|
|
52
52
|
async function handleSelectedRegion(option: BaseResult) {
|
|
53
53
|
try {
|
|
54
54
|
if (option.hasLocation()) {
|
|
55
|
-
navToOption(option)
|
|
55
|
+
await navToOption(option)
|
|
56
|
+
} else if (option.results?.length) {
|
|
57
|
+
model.setSearchResults(option.results, option.getLabel())
|
|
56
58
|
} else {
|
|
57
59
|
const input = option.getLabel()
|
|
58
60
|
const [ref, rest] = splitLast(input, ':')
|
|
@@ -61,7 +63,7 @@ function SearchBox({
|
|
|
61
63
|
allRefs.includes(input) ||
|
|
62
64
|
(allRefs.includes(ref) && !Number.isNaN(parseInt(rest, 10)))
|
|
63
65
|
) {
|
|
64
|
-
model.navToLocString(input, assemblyName)
|
|
66
|
+
await model.navToLocString(input, assemblyName)
|
|
65
67
|
} else {
|
|
66
68
|
const results = await fetchResults({
|
|
67
69
|
queryString: input,
|
|
@@ -75,9 +77,9 @@ function SearchBox({
|
|
|
75
77
|
if (results.length > 1) {
|
|
76
78
|
model.setSearchResults(results, input.toLowerCase())
|
|
77
79
|
} else if (results.length === 1) {
|
|
78
|
-
navToOption(results[0])
|
|
80
|
+
await navToOption(results[0])
|
|
79
81
|
} else {
|
|
80
|
-
model.navToLocString(input, assemblyName)
|
|
82
|
+
await model.navToLocString(input, assemblyName)
|
|
81
83
|
}
|
|
82
84
|
}
|
|
83
85
|
}
|