@jbrowse/plugin-linear-genome-view 1.7.9 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +1 -5
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +118 -226
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Block.js +53 -74
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -0
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +11 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +64 -103
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +145 -175
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/dist/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js +118 -0
- package/dist/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/dist/BaseLinearDisplay/index.js +13 -40
- package/dist/BaseLinearDisplay/index.js.map +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +20 -15
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +605 -683
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +15 -22
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +7 -8
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +266 -312
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/dist/LinearBareDisplay/configSchema.js +11 -17
- package/dist/LinearBareDisplay/configSchema.js.map +1 -0
- package/dist/LinearBareDisplay/index.js +7 -20
- package/dist/LinearBareDisplay/index.js.map +1 -0
- package/dist/LinearBareDisplay/model.d.ts +16 -14
- package/dist/LinearBareDisplay/model.js +36 -42
- package/dist/LinearBareDisplay/model.js.map +1 -0
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js +76 -85
- package/dist/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/dist/LinearBasicDisplay/configSchema.js +15 -23
- package/dist/LinearBasicDisplay/configSchema.js.map +1 -0
- package/dist/LinearBasicDisplay/index.js +10 -22
- package/dist/LinearBasicDisplay/index.js.map +1 -0
- package/dist/LinearBasicDisplay/model.d.ts +20 -15
- package/dist/LinearBasicDisplay/model.js +180 -159
- package/dist/LinearBasicDisplay/model.js.map +1 -0
- package/dist/LinearGenomeView/components/CenterLine.d.ts +2 -8
- package/dist/LinearGenomeView/components/CenterLine.js +60 -74
- package/dist/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +141 -141
- package/dist/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/Header.js +70 -123
- package/dist/LinearGenomeView/components/Header.js.map +1 -0
- package/dist/LinearGenomeView/components/HelpDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/HelpDialog.js +62 -45
- package/dist/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/ImportForm.js +223 -320
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeView.js +64 -120
- package/dist/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +198 -337
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/dist/LinearGenomeView/components/MiniControls.js +64 -78
- package/dist/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewRubberBand.js +226 -293
- package/dist/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +24 -8
- package/dist/LinearGenomeView/components/OverviewScaleBar.js +277 -365
- package/dist/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js +237 -324
- package/dist/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/dist/LinearGenomeView/components/RubberBand.js +229 -296
- package/dist/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/dist/LinearGenomeView/components/Ruler.js +45 -90
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -0
- package/dist/LinearGenomeView/components/ScaleBar.d.ts +8 -399
- package/dist/LinearGenomeView/components/ScaleBar.js +121 -167
- package/dist/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchBox.js +158 -205
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +0 -1
- package/dist/LinearGenomeView/components/SearchResultsDialog.js +105 -150
- package/dist/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/SequenceDialog.js +219 -272
- package/dist/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackContainer.js +116 -156
- package/dist/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/TrackLabel.d.ts +6 -42
- package/dist/LinearGenomeView/components/TrackLabel.js +115 -150
- package/dist/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/dist/LinearGenomeView/components/TracksContainer.d.ts +1 -1
- package/dist/LinearGenomeView/components/TracksContainer.js +172 -199
- package/dist/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/dist/LinearGenomeView/components/VerticalGuides.d.ts +2 -3
- package/dist/LinearGenomeView/components/VerticalGuides.js +66 -104
- package/dist/LinearGenomeView/components/VerticalGuides.js.map +1 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +72 -87
- package/dist/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/dist/LinearGenomeView/components/util.d.ts +12 -0
- package/dist/LinearGenomeView/components/util.js +95 -13
- package/dist/LinearGenomeView/components/util.js.map +1 -0
- package/dist/LinearGenomeView/index.d.ts +6 -11
- package/dist/LinearGenomeView/index.js +1163 -1387
- package/dist/LinearGenomeView/index.js.map +1 -0
- package/dist/LinearGenomeView/util.js +76 -83
- package/dist/LinearGenomeView/util.js.map +1 -0
- package/dist/index.d.ts +101 -51
- package/dist/index.js +225 -284
- package/dist/index.js.map +1 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +9 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +68 -0
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Block.d.ts +15 -0
- package/esm/BaseLinearDisplay/components/Block.js +46 -0
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +22 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +62 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +113 -0
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js.map +1 -0
- package/esm/BaseLinearDisplay/components/Tooltip.d.ts +8 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js +64 -0
- package/esm/BaseLinearDisplay/components/Tooltip.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +5 -0
- package/esm/BaseLinearDisplay/index.js +4 -0
- package/esm/BaseLinearDisplay/index.js.map +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +232 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +541 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +14 -0
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +225 -0
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js.map +1 -0
- package/esm/LinearBareDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBareDisplay/configSchema.js +9 -0
- package/esm/LinearBareDisplay/configSchema.js.map +1 -0
- package/esm/LinearBareDisplay/index.d.ts +2 -0
- package/esm/LinearBareDisplay/index.js +3 -0
- package/esm/LinearBareDisplay/index.js.map +1 -0
- package/esm/LinearBareDisplay/model.d.ts +194 -0
- package/esm/LinearBareDisplay/model.js +28 -0
- package/esm/LinearBareDisplay/model.js.map +1 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js +40 -0
- package/esm/LinearBasicDisplay/components/SetMaxHeight.js.map +1 -0
- package/esm/LinearBasicDisplay/configSchema.d.ts +2 -0
- package/esm/LinearBasicDisplay/configSchema.js +14 -0
- package/esm/LinearBasicDisplay/configSchema.js.map +1 -0
- package/esm/LinearBasicDisplay/index.d.ts +2 -0
- package/esm/LinearBasicDisplay/index.js +3 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -0
- package/esm/LinearBasicDisplay/model.d.ts +218 -0
- package/esm/LinearBasicDisplay/model.js +127 -0
- package/esm/LinearBasicDisplay/model.js.map +1 -0
- package/esm/LinearGenomeView/components/CenterLine.d.ts +8 -0
- package/esm/LinearGenomeView/components/CenterLine.js +40 -0
- package/esm/LinearGenomeView/components/CenterLine.js.map +1 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +52 -0
- package/esm/LinearGenomeView/components/ExportSvgDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/Header.d.ts +7 -0
- package/esm/LinearGenomeView/components/Header.js +81 -0
- package/esm/LinearGenomeView/components/Header.js.map +1 -0
- package/esm/LinearGenomeView/components/HelpDialog.d.ts +4 -0
- package/esm/LinearGenomeView/components/HelpDialog.js +58 -0
- package/esm/LinearGenomeView/components/HelpDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/ImportForm.d.ts +7 -0
- package/esm/LinearGenomeView/components/ImportForm.js +141 -0
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.d.ts +7 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js +67 -0
- package/esm/LinearGenomeView/components/LinearGenomeView.js.map +1 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +132 -0
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -0
- package/esm/LinearGenomeView/components/MiniControls.d.ts +6 -0
- package/esm/LinearGenomeView/components/MiniControls.js +25 -0
- package/esm/LinearGenomeView/components/MiniControls.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js +194 -0
- package/esm/LinearGenomeView/components/OverviewRubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.d.ts +148 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js +287 -0
- package/esm/LinearGenomeView/components/OverviewScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.d.ts +22 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js +136 -0
- package/esm/LinearGenomeView/components/RefNameAutocomplete.js.map +1 -0
- package/esm/LinearGenomeView/components/RubberBand.d.ts +9 -0
- package/esm/LinearGenomeView/components/RubberBand.js +198 -0
- package/esm/LinearGenomeView/components/RubberBand.js.map +1 -0
- package/esm/LinearGenomeView/components/Ruler.d.ts +27 -0
- package/esm/LinearGenomeView/components/Ruler.js +50 -0
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -0
- package/esm/LinearGenomeView/components/ScaleBar.d.ts +10 -0
- package/esm/LinearGenomeView/components/ScaleBar.js +112 -0
- package/esm/LinearGenomeView/components/ScaleBar.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchBox.d.ts +8 -0
- package/esm/LinearGenomeView/components/SearchBox.js +94 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.d.ts +7 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js +107 -0
- package/esm/LinearGenomeView/components/SearchResultsDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/SequenceDialog.d.ts +8 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js +147 -0
- package/esm/LinearGenomeView/components/SequenceDialog.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackContainer.d.ts +9 -0
- package/esm/LinearGenomeView/components/TrackContainer.js +109 -0
- package/esm/LinearGenomeView/components/TrackContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/TrackLabel.d.ts +8 -0
- package/esm/LinearGenomeView/components/TrackLabel.js +89 -0
- package/esm/LinearGenomeView/components/TrackLabel.js.map +1 -0
- package/esm/LinearGenomeView/components/TracksContainer.d.ts +10 -0
- package/esm/LinearGenomeView/components/TracksContainer.js +142 -0
- package/esm/LinearGenomeView/components/TracksContainer.js.map +1 -0
- package/esm/LinearGenomeView/components/VerticalGuides.d.ts +8 -0
- package/esm/LinearGenomeView/components/VerticalGuides.js +71 -0
- package/esm/LinearGenomeView/components/VerticalGuides.js.map +1 -0
- package/esm/LinearGenomeView/components/ZoomControls.d.ts +7 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +32 -0
- package/esm/LinearGenomeView/components/ZoomControls.js.map +1 -0
- package/esm/LinearGenomeView/components/util.d.ts +14 -0
- package/esm/LinearGenomeView/components/util.js +17 -0
- package/esm/LinearGenomeView/components/util.js.map +1 -0
- package/esm/LinearGenomeView/index.d.ts +288 -0
- package/esm/LinearGenomeView/index.js +1124 -0
- package/esm/LinearGenomeView/index.js.map +1 -0
- package/esm/LinearGenomeView/util.d.ts +14 -0
- package/esm/LinearGenomeView/util.js +62 -0
- package/esm/LinearGenomeView/util.js.map +1 -0
- package/esm/index.d.ts +615 -0
- package/esm/index.js +127 -0
- package/esm/index.js.map +1 -0
- package/package.json +21 -13
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +6 -90
- package/src/BaseLinearDisplay/components/Block.tsx +5 -5
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +4 -4
- package/src/BaseLinearDisplay/components/ServerSideRenderedBlockContent.tsx +7 -8
- package/src/BaseLinearDisplay/components/Tooltip.tsx +107 -0
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +16 -8
- package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +1 -1
- package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +10 -7
- package/src/LinearBasicDisplay/model.ts +21 -15
- package/src/LinearGenomeView/components/CenterLine.tsx +6 -11
- package/src/LinearGenomeView/components/ExportSvgDialog.tsx +5 -5
- package/src/LinearGenomeView/components/Header.tsx +12 -16
- package/src/LinearGenomeView/components/HelpDialog.tsx +10 -9
- package/src/LinearGenomeView/components/ImportForm.tsx +24 -37
- package/src/LinearGenomeView/components/LinearGenomeView.test.js +18 -8
- package/src/LinearGenomeView/components/LinearGenomeView.tsx +20 -13
- package/src/LinearGenomeView/components/MiniControls.tsx +29 -40
- package/src/LinearGenomeView/components/OverviewRubberBand.tsx +6 -10
- package/src/LinearGenomeView/components/OverviewScaleBar.tsx +103 -93
- package/src/LinearGenomeView/components/RefNameAutocomplete.tsx +13 -44
- package/src/LinearGenomeView/components/RubberBand.tsx +12 -17
- package/src/LinearGenomeView/components/Ruler.tsx +5 -11
- package/src/LinearGenomeView/components/ScaleBar.tsx +27 -34
- package/src/LinearGenomeView/components/SearchBox.tsx +22 -32
- package/src/LinearGenomeView/components/SearchResultsDialog.tsx +7 -7
- package/src/LinearGenomeView/components/SequenceDialog.tsx +9 -9
- package/src/LinearGenomeView/components/TrackContainer.tsx +12 -12
- package/src/LinearGenomeView/components/TrackLabel.tsx +37 -50
- package/src/LinearGenomeView/components/TracksContainer.tsx +8 -13
- package/src/LinearGenomeView/components/VerticalGuides.tsx +9 -11
- package/src/LinearGenomeView/components/ZoomControls.tsx +12 -13
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +504 -568
- package/src/LinearGenomeView/components/util.ts +43 -0
- package/src/LinearGenomeView/index.test.ts +21 -5
- package/src/LinearGenomeView/index.tsx +101 -88
- package/src/index.ts +36 -31
- package/dist/LinearBareDisplay/index.test.js +0 -33
- package/dist/LinearGenomeView/components/LinearGenomeView.test.js +0 -234
- package/dist/LinearGenomeView/components/ScaleBar.test.js +0 -180
- package/dist/LinearGenomeView/index.test.js +0 -1170
- package/dist/LinearGenomeView/util.test.js +0 -78
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import {
|
|
3
|
+
import { useTheme, alpha } from '@mui/material'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
4
5
|
import BaseResult from '@jbrowse/core/TextSearch/BaseResults'
|
|
5
6
|
import { getSession } from '@jbrowse/core/util'
|
|
6
|
-
import { SearchType } from '@jbrowse/core/data_adapters/BaseAdapter'
|
|
7
7
|
|
|
8
8
|
// locals
|
|
9
9
|
import RefNameAutocomplete from './RefNameAutocomplete'
|
|
10
|
-
import {
|
|
10
|
+
import { fetchResults } from './util'
|
|
11
11
|
import { LinearGenomeViewModel, SPACING, WIDGET_HEIGHT } from '..'
|
|
12
12
|
|
|
13
|
-
const useStyles = makeStyles(() => ({
|
|
13
|
+
const useStyles = makeStyles()(() => ({
|
|
14
14
|
headerRefName: {
|
|
15
15
|
minWidth: 100,
|
|
16
16
|
},
|
|
@@ -23,7 +23,7 @@ function SearchBox({
|
|
|
23
23
|
showHelp?: boolean
|
|
24
24
|
model: LinearGenomeViewModel
|
|
25
25
|
}) {
|
|
26
|
-
const classes = useStyles()
|
|
26
|
+
const { classes } = useStyles()
|
|
27
27
|
const theme = useTheme()
|
|
28
28
|
const session = getSession(model)
|
|
29
29
|
|
|
@@ -33,31 +33,6 @@ function SearchBox({
|
|
|
33
33
|
const assembly = assemblyManager.get(assemblyName)
|
|
34
34
|
const searchScope = model.searchScope(assemblyName)
|
|
35
35
|
|
|
36
|
-
async function fetchResults(query: string, searchType?: SearchType) {
|
|
37
|
-
if (!textSearchManager) {
|
|
38
|
-
console.warn('No text search manager')
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const textSearchResults = await textSearchManager?.search(
|
|
42
|
-
{
|
|
43
|
-
queryString: query,
|
|
44
|
-
searchType,
|
|
45
|
-
},
|
|
46
|
-
searchScope,
|
|
47
|
-
rankSearchResults,
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
const refNameResults = assembly?.allRefNames
|
|
51
|
-
?.filter(refName => refName.startsWith(query))
|
|
52
|
-
.map(r => new BaseResult({ label: r }))
|
|
53
|
-
.slice(0, 10)
|
|
54
|
-
|
|
55
|
-
return dedupe(
|
|
56
|
-
[...(refNameResults || []), ...(textSearchResults || [])],
|
|
57
|
-
elt => elt.getId(),
|
|
58
|
-
)
|
|
59
|
-
}
|
|
60
|
-
|
|
61
36
|
// gets a string as input, or use stored option results from previous query,
|
|
62
37
|
// then re-query and
|
|
63
38
|
// 1) if it has multiple results: pop a dialog
|
|
@@ -82,7 +57,14 @@ function SearchBox({
|
|
|
82
57
|
) {
|
|
83
58
|
model.navToLocString(location, assemblyName)
|
|
84
59
|
} else {
|
|
85
|
-
const results = await fetchResults(
|
|
60
|
+
const results = await fetchResults({
|
|
61
|
+
queryString: label,
|
|
62
|
+
searchType: 'exact',
|
|
63
|
+
searchScope,
|
|
64
|
+
rankSearchResults,
|
|
65
|
+
textSearchManager,
|
|
66
|
+
assembly,
|
|
67
|
+
})
|
|
86
68
|
if (results.length > 1) {
|
|
87
69
|
model.setSearchResults(results, label.toLowerCase())
|
|
88
70
|
return
|
|
@@ -106,7 +88,15 @@ function SearchBox({
|
|
|
106
88
|
showHelp={showHelp}
|
|
107
89
|
onSelect={handleSelectedRegion}
|
|
108
90
|
assemblyName={assemblyName}
|
|
109
|
-
fetchResults={
|
|
91
|
+
fetchResults={queryString =>
|
|
92
|
+
fetchResults({
|
|
93
|
+
queryString,
|
|
94
|
+
searchScope,
|
|
95
|
+
rankSearchResults,
|
|
96
|
+
textSearchManager,
|
|
97
|
+
assembly,
|
|
98
|
+
})
|
|
99
|
+
}
|
|
110
100
|
model={model}
|
|
111
101
|
TextFieldProps={{
|
|
112
102
|
variant: 'outlined',
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import { getEnv, resolveIdentifier, getRoot } from 'mobx-state-tree'
|
|
3
4
|
import { getSession } from '@jbrowse/core/util'
|
|
4
5
|
import {
|
|
@@ -9,6 +10,7 @@ import {
|
|
|
9
10
|
DialogTitle,
|
|
10
11
|
Divider,
|
|
11
12
|
IconButton,
|
|
13
|
+
Paper,
|
|
12
14
|
Table,
|
|
13
15
|
TableBody,
|
|
14
16
|
TableCell,
|
|
@@ -16,13 +18,11 @@ import {
|
|
|
16
18
|
TableHead,
|
|
17
19
|
TableRow,
|
|
18
20
|
Typography,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} from '@material-ui/core'
|
|
22
|
-
import CloseIcon from '@material-ui/icons/Close'
|
|
21
|
+
} from '@mui/material'
|
|
22
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
23
23
|
import { LinearGenomeViewModel } from '../..'
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const useStyles = makeStyles()(theme => ({
|
|
26
26
|
dialogContent: {
|
|
27
27
|
width: '80em',
|
|
28
28
|
},
|
|
@@ -43,7 +43,7 @@ export default function SearchResultsDialog({
|
|
|
43
43
|
optAssemblyName?: string
|
|
44
44
|
handleClose: () => void
|
|
45
45
|
}) {
|
|
46
|
-
const classes = useStyles()
|
|
46
|
+
const { classes } = useStyles()
|
|
47
47
|
const session = getSession(model)
|
|
48
48
|
const { pluginManager } = getEnv(session)
|
|
49
49
|
const { assemblyManager } = session
|
|
@@ -108,6 +108,7 @@ export default function SearchResultsDialog({
|
|
|
108
108
|
onClick={() => {
|
|
109
109
|
handleClose()
|
|
110
110
|
}}
|
|
111
|
+
size="large"
|
|
111
112
|
>
|
|
112
113
|
<CloseIcon />
|
|
113
114
|
</IconButton>
|
|
@@ -156,7 +157,6 @@ export default function SearchResultsDialog({
|
|
|
156
157
|
}
|
|
157
158
|
handleClose()
|
|
158
159
|
}}
|
|
159
|
-
disabled={!getTrackName(result.getTrackId())}
|
|
160
160
|
color="primary"
|
|
161
161
|
variant="contained"
|
|
162
162
|
>
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react'
|
|
2
|
-
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
5
|
CircularProgress,
|
|
6
|
+
Container,
|
|
6
7
|
Dialog,
|
|
7
8
|
DialogActions,
|
|
8
9
|
DialogContent,
|
|
9
10
|
DialogTitle,
|
|
10
|
-
Container,
|
|
11
|
-
Typography,
|
|
12
11
|
Divider,
|
|
13
12
|
IconButton,
|
|
14
13
|
TextField,
|
|
15
|
-
|
|
16
|
-
} from '@material
|
|
14
|
+
Typography,
|
|
15
|
+
} from '@mui/material'
|
|
17
16
|
import { observer } from 'mobx-react'
|
|
18
17
|
import { saveAs } from 'file-saver'
|
|
19
18
|
import { Region } from '@jbrowse/core/util/types'
|
|
@@ -25,13 +24,13 @@ import { formatSeqFasta } from '@jbrowse/core/util/formatFastaStrings'
|
|
|
25
24
|
|
|
26
25
|
// icons
|
|
27
26
|
import { ContentCopy as ContentCopyIcon } from '@jbrowse/core/ui/Icons'
|
|
28
|
-
import CloseIcon from '@
|
|
29
|
-
import GetAppIcon from '@
|
|
27
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
28
|
+
import GetAppIcon from '@mui/icons-material/GetApp'
|
|
30
29
|
|
|
31
30
|
// locals
|
|
32
31
|
import { LinearGenomeViewModel } from '..'
|
|
33
32
|
|
|
34
|
-
const useStyles = makeStyles(theme => ({
|
|
33
|
+
const useStyles = makeStyles()(theme => ({
|
|
35
34
|
loadingMessage: {
|
|
36
35
|
padding: theme.spacing(5),
|
|
37
36
|
},
|
|
@@ -93,7 +92,7 @@ function SequenceDialog({
|
|
|
93
92
|
model: LinearGenomeViewModel
|
|
94
93
|
handleClose: () => void
|
|
95
94
|
}) {
|
|
96
|
-
const classes = useStyles()
|
|
95
|
+
const { classes } = useStyles()
|
|
97
96
|
const session = getSession(model)
|
|
98
97
|
const [error, setError] = useState<unknown>()
|
|
99
98
|
const [sequence, setSequence] = useState<string>()
|
|
@@ -181,6 +180,7 @@ function SequenceDialog({
|
|
|
181
180
|
handleClose()
|
|
182
181
|
model.setOffsets(undefined, undefined)
|
|
183
182
|
}}
|
|
183
|
+
size="large"
|
|
184
184
|
>
|
|
185
185
|
<CloseIcon />
|
|
186
186
|
</IconButton>
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react'
|
|
2
|
+
import { Paper } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
2
4
|
import { observer } from 'mobx-react'
|
|
3
5
|
import { isAlive } from 'mobx-state-tree'
|
|
4
6
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
5
7
|
import { getConf } from '@jbrowse/core/configuration'
|
|
6
8
|
import { ResizeHandle } from '@jbrowse/core/ui'
|
|
7
9
|
import { useDebouncedCallback } from '@jbrowse/core/util'
|
|
8
|
-
import clsx from 'clsx'
|
|
9
|
-
import Paper from '@material-ui/core/Paper'
|
|
10
|
-
import { makeStyles } from '@material-ui/core/styles'
|
|
11
10
|
|
|
12
|
-
import { LinearGenomeViewModel
|
|
11
|
+
import { LinearGenomeViewModel } from '..'
|
|
13
12
|
import TrackLabel from './TrackLabel'
|
|
14
13
|
|
|
15
|
-
const useStyles = makeStyles(
|
|
16
|
-
root: {
|
|
14
|
+
const useStyles = makeStyles()({
|
|
15
|
+
root: {
|
|
16
|
+
marginTop: 2,
|
|
17
|
+
},
|
|
17
18
|
resizeHandle: {
|
|
18
|
-
height:
|
|
19
|
+
height: 3,
|
|
19
20
|
boxSizing: 'border-box',
|
|
20
21
|
position: 'relative',
|
|
21
22
|
zIndex: 2,
|
|
@@ -27,7 +28,6 @@ const useStyles = makeStyles(theme => ({
|
|
|
27
28
|
left: 0,
|
|
28
29
|
width: '100%',
|
|
29
30
|
zIndex: 3,
|
|
30
|
-
borderRadius: theme.shape.borderRadius,
|
|
31
31
|
},
|
|
32
32
|
trackLabel: {
|
|
33
33
|
zIndex: 3,
|
|
@@ -57,13 +57,13 @@ const useStyles = makeStyles(theme => ({
|
|
|
57
57
|
background: 'none',
|
|
58
58
|
zIndex: 2,
|
|
59
59
|
},
|
|
60
|
-
})
|
|
60
|
+
})
|
|
61
61
|
|
|
62
62
|
type LGV = LinearGenomeViewModel
|
|
63
63
|
|
|
64
64
|
const TrackContainerLabel = observer(
|
|
65
65
|
({ model, view }: { model: BaseTrackModel; view: LGV }) => {
|
|
66
|
-
const classes = useStyles()
|
|
66
|
+
const { classes, cx } = useStyles()
|
|
67
67
|
const labelStyle =
|
|
68
68
|
view.trackLabels === 'overlapping'
|
|
69
69
|
? classes.trackLabelOverlap
|
|
@@ -71,7 +71,7 @@ const TrackContainerLabel = observer(
|
|
|
71
71
|
return view.trackLabels !== 'hidden' ? (
|
|
72
72
|
<TrackLabel
|
|
73
73
|
track={model}
|
|
74
|
-
className={
|
|
74
|
+
className={cx(classes.trackLabel, labelStyle)}
|
|
75
75
|
/>
|
|
76
76
|
) : null
|
|
77
77
|
},
|
|
@@ -84,7 +84,7 @@ function TrackContainer({
|
|
|
84
84
|
model: LinearGenomeViewModel
|
|
85
85
|
track: BaseTrackModel
|
|
86
86
|
}) {
|
|
87
|
-
const classes = useStyles()
|
|
87
|
+
const { classes } = useStyles()
|
|
88
88
|
const display = track.displays[0]
|
|
89
89
|
const { horizontalScroll, draggingTrackId, moveTrack } = model
|
|
90
90
|
const { height } = display
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
import { observer } from 'mobx-react'
|
|
3
|
+
import { Instance } from 'mobx-state-tree'
|
|
2
4
|
import { getConf, readConfObject } from '@jbrowse/core/configuration'
|
|
3
|
-
import
|
|
5
|
+
import CascadingMenu from '@jbrowse/core/ui/CascadingMenu'
|
|
4
6
|
import { getSession, getContainingView } from '@jbrowse/core/util'
|
|
5
7
|
import { BaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models'
|
|
8
|
+
import { IconButton, Paper, Typography, alpha } from '@mui/material'
|
|
9
|
+
import { makeStyles } from 'tss-react/mui'
|
|
10
|
+
|
|
6
11
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
makeStyles,
|
|
12
|
-
} from '@material-ui/core'
|
|
12
|
+
bindTrigger,
|
|
13
|
+
bindPopover,
|
|
14
|
+
usePopupState,
|
|
15
|
+
} from 'material-ui-popup-state/hooks'
|
|
13
16
|
|
|
14
17
|
// icons
|
|
15
|
-
import MoreVertIcon from '@
|
|
16
|
-
import DragIcon from '@
|
|
17
|
-
import CloseIcon from '@
|
|
18
|
+
import MoreVertIcon from '@mui/icons-material/MoreVert'
|
|
19
|
+
import DragIcon from '@mui/icons-material/DragIndicator'
|
|
20
|
+
import CloseIcon from '@mui/icons-material/Close'
|
|
18
21
|
|
|
19
|
-
import clsx from 'clsx'
|
|
20
|
-
import { observer } from 'mobx-react'
|
|
21
|
-
import { Instance } from 'mobx-state-tree'
|
|
22
22
|
import { LinearGenomeViewStateModel } from '..'
|
|
23
23
|
|
|
24
|
-
const useStyles = makeStyles(theme => ({
|
|
24
|
+
const useStyles = makeStyles()(theme => ({
|
|
25
25
|
root: {
|
|
26
26
|
background: alpha(theme.palette.background.paper, 0.8),
|
|
27
27
|
'&:hover': {
|
|
@@ -52,33 +52,28 @@ const useStyles = makeStyles(theme => ({
|
|
|
52
52
|
}))
|
|
53
53
|
|
|
54
54
|
type LGV = Instance<LinearGenomeViewStateModel>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
55
|
+
interface Props {
|
|
56
|
+
track: BaseTrackModel
|
|
57
|
+
className?: string
|
|
58
|
+
}
|
|
59
|
+
const TrackLabel = React.forwardRef<HTMLDivElement, Props>(
|
|
60
|
+
({ track, className }, ref) => {
|
|
61
|
+
const { classes, cx } = useStyles()
|
|
61
62
|
const view = getContainingView(track) as LGV
|
|
62
63
|
const session = getSession(track)
|
|
63
64
|
const trackConf = track.configuration
|
|
64
65
|
const trackId = getConf(track, 'trackId')
|
|
65
66
|
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const handleClose = () => {
|
|
71
|
-
setAnchorEl(null)
|
|
72
|
-
}
|
|
67
|
+
const popupState = usePopupState({
|
|
68
|
+
popupId: 'trackLabelMenu',
|
|
69
|
+
variant: 'popover',
|
|
70
|
+
})
|
|
73
71
|
|
|
74
72
|
const onDragStart = (event: React.DragEvent<HTMLSpanElement>) => {
|
|
75
73
|
const target = event.target as HTMLElement
|
|
76
74
|
if (target.parentNode) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
20,
|
|
80
|
-
20,
|
|
81
|
-
)
|
|
75
|
+
const parent = target.parentNode as HTMLElement
|
|
76
|
+
event.dataTransfer.setDragImage(parent, 20, 20)
|
|
82
77
|
view.setDraggingTrackId(track.id)
|
|
83
78
|
}
|
|
84
79
|
}
|
|
@@ -91,17 +86,12 @@ const TrackLabel = React.forwardRef(
|
|
|
91
86
|
if (getConf(track, 'type') === 'ReferenceSequenceTrack') {
|
|
92
87
|
const r = session.assemblies.find(a => a.sequence === trackConf)
|
|
93
88
|
trackName =
|
|
94
|
-
|
|
89
|
+
trackName ||
|
|
95
90
|
(r
|
|
96
91
|
? `Reference Sequence (${readConfObject(r, 'name')})`
|
|
97
92
|
: 'Reference Sequence')
|
|
98
93
|
}
|
|
99
94
|
|
|
100
|
-
function handleMenuItemClick(_: unknown, callback: Function) {
|
|
101
|
-
callback()
|
|
102
|
-
handleClose()
|
|
103
|
-
}
|
|
104
|
-
|
|
105
95
|
const items = [
|
|
106
96
|
...(session.getTrackActionMenuItems?.(trackConf) || []),
|
|
107
97
|
...track.trackMenuItems(),
|
|
@@ -109,7 +99,7 @@ const TrackLabel = React.forwardRef(
|
|
|
109
99
|
|
|
110
100
|
return (
|
|
111
101
|
<>
|
|
112
|
-
<Paper ref={ref} className={
|
|
102
|
+
<Paper ref={ref} className={cx(className, classes.root)}>
|
|
113
103
|
<span
|
|
114
104
|
draggable
|
|
115
105
|
className={classes.dragHandle}
|
|
@@ -117,7 +107,7 @@ const TrackLabel = React.forwardRef(
|
|
|
117
107
|
onDragEnd={onDragEnd}
|
|
118
108
|
data-testid={`dragHandle-${view.id}-${trackId}`}
|
|
119
109
|
>
|
|
120
|
-
<DragIcon className={classes.dragHandleIcon} />
|
|
110
|
+
<DragIcon className={classes.dragHandleIcon} fontSize="small" />
|
|
121
111
|
</span>
|
|
122
112
|
<IconButton
|
|
123
113
|
onClick={() => view.hideTrack(trackId)}
|
|
@@ -125,7 +115,7 @@ const TrackLabel = React.forwardRef(
|
|
|
125
115
|
title="close this track"
|
|
126
116
|
color="secondary"
|
|
127
117
|
>
|
|
128
|
-
<CloseIcon />
|
|
118
|
+
<CloseIcon fontSize="small" />
|
|
129
119
|
</IconButton>
|
|
130
120
|
<Typography
|
|
131
121
|
variant="body1"
|
|
@@ -135,23 +125,20 @@ const TrackLabel = React.forwardRef(
|
|
|
135
125
|
{trackName}
|
|
136
126
|
</Typography>
|
|
137
127
|
<IconButton
|
|
138
|
-
|
|
139
|
-
aria-haspopup="true"
|
|
140
|
-
onClick={handleClick}
|
|
128
|
+
{...bindTrigger(popupState)}
|
|
141
129
|
className={classes.iconButton}
|
|
142
130
|
color="secondary"
|
|
143
131
|
data-testid="track_menu_icon"
|
|
144
132
|
disabled={!items.length}
|
|
145
133
|
>
|
|
146
|
-
<MoreVertIcon />
|
|
134
|
+
<MoreVertIcon fontSize="small" />
|
|
147
135
|
</IconButton>
|
|
148
136
|
</Paper>
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
onMenuItemClick={
|
|
152
|
-
open={Boolean(anchorEl)}
|
|
153
|
-
onClose={handleClose}
|
|
137
|
+
<CascadingMenu
|
|
138
|
+
{...bindPopover(popupState)}
|
|
139
|
+
onMenuItemClick={(_: unknown, callback: Function) => callback()}
|
|
154
140
|
menuItems={items}
|
|
141
|
+
popupState={popupState}
|
|
155
142
|
/>
|
|
156
143
|
</>
|
|
157
144
|
)
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
import { Instance } from 'mobx-state-tree'
|
|
4
|
-
import React, { useEffect, useRef, useState } from 'react'
|
|
5
5
|
import normalizeWheel from 'normalize-wheel'
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
LinearGenomeViewStateModel,
|
|
9
|
-
RESIZE_HANDLE_HEIGHT,
|
|
10
|
-
SCALE_BAR_HEIGHT,
|
|
11
|
-
} from '..'
|
|
7
|
+
import { LinearGenomeViewStateModel, SCALE_BAR_HEIGHT } from '..'
|
|
12
8
|
import RubberBand from './RubberBand'
|
|
13
9
|
import ScaleBar from './ScaleBar'
|
|
14
10
|
import VerticalGuides from './VerticalGuides'
|
|
15
11
|
import CenterLine from './CenterLine'
|
|
16
12
|
|
|
17
|
-
const useStyles = makeStyles(
|
|
13
|
+
const useStyles = makeStyles()({
|
|
18
14
|
tracksContainer: {
|
|
19
15
|
position: 'relative',
|
|
20
|
-
borderRadius: theme.shape.borderRadius,
|
|
21
16
|
overflow: 'hidden',
|
|
22
17
|
},
|
|
23
18
|
spacer: {
|
|
24
19
|
position: 'relative',
|
|
25
|
-
height:
|
|
20
|
+
height: 3,
|
|
26
21
|
},
|
|
27
|
-
})
|
|
22
|
+
})
|
|
28
23
|
|
|
29
24
|
type LGV = Instance<LinearGenomeViewStateModel>
|
|
30
25
|
type Timer = ReturnType<typeof setTimeout>
|
|
@@ -36,7 +31,7 @@ function TracksContainer({
|
|
|
36
31
|
children: React.ReactNode
|
|
37
32
|
model: LGV
|
|
38
33
|
}) {
|
|
39
|
-
const classes = useStyles()
|
|
34
|
+
const { classes } = useStyles()
|
|
40
35
|
// refs are to store these variables to avoid repeated rerenders associated
|
|
41
36
|
// with useState/setState
|
|
42
37
|
const delta = useRef(0)
|
|
@@ -167,7 +162,7 @@ function TracksContainer({
|
|
|
167
162
|
return (
|
|
168
163
|
<div
|
|
169
164
|
ref={ref}
|
|
170
|
-
|
|
165
|
+
data-testid="trackContainer"
|
|
171
166
|
className={classes.tracksContainer}
|
|
172
167
|
onMouseDown={mouseDown}
|
|
173
168
|
onMouseUp={mouseUp}
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import {
|
|
2
3
|
ContentBlock,
|
|
3
4
|
ElidedBlock,
|
|
4
5
|
InterRegionPaddingBlock,
|
|
5
6
|
} from '@jbrowse/core/util/blockTypes'
|
|
6
|
-
import { makeStyles } from '
|
|
7
|
-
import clsx from 'clsx'
|
|
7
|
+
import { makeStyles } from 'tss-react/mui'
|
|
8
8
|
import { observer } from 'mobx-react'
|
|
9
|
-
import {
|
|
10
|
-
import React from 'react'
|
|
11
|
-
import { LinearGenomeViewStateModel } from '..'
|
|
9
|
+
import { LinearGenomeViewModel } from '..'
|
|
12
10
|
import {
|
|
13
11
|
ContentBlock as ContentBlockComponent,
|
|
14
12
|
ElidedBlock as ElidedBlockComponent,
|
|
@@ -17,9 +15,9 @@ import {
|
|
|
17
15
|
|
|
18
16
|
import { makeTicks } from '../util'
|
|
19
17
|
|
|
20
|
-
type LGV =
|
|
18
|
+
type LGV = LinearGenomeViewModel
|
|
21
19
|
|
|
22
|
-
const useStyles = makeStyles(theme => ({
|
|
20
|
+
const useStyles = makeStyles()(theme => ({
|
|
23
21
|
verticalGuidesZoomContainer: {
|
|
24
22
|
position: 'absolute',
|
|
25
23
|
height: '100%',
|
|
@@ -40,14 +38,14 @@ const useStyles = makeStyles(theme => ({
|
|
|
40
38
|
width: 1,
|
|
41
39
|
},
|
|
42
40
|
majorTick: {
|
|
43
|
-
background: theme.palette.text.
|
|
41
|
+
background: theme.palette.text.secondary,
|
|
44
42
|
},
|
|
45
43
|
minorTick: {
|
|
46
44
|
background: theme.palette.divider,
|
|
47
45
|
},
|
|
48
46
|
}))
|
|
49
47
|
const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
50
|
-
const classes = useStyles()
|
|
48
|
+
const { classes, cx } = useStyles()
|
|
51
49
|
return (
|
|
52
50
|
<>
|
|
53
51
|
{model.staticBlocks.map((block, index) => {
|
|
@@ -63,7 +61,7 @@ const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
|
63
61
|
return (
|
|
64
62
|
<div
|
|
65
63
|
key={tick.base}
|
|
66
|
-
className={
|
|
64
|
+
className={cx(
|
|
67
65
|
classes.tick,
|
|
68
66
|
tick.type === 'major' || tick.type === 'labeledMajor'
|
|
69
67
|
? classes.majorTick
|
|
@@ -94,7 +92,7 @@ const RenderedVerticalGuides = observer(({ model }: { model: LGV }) => {
|
|
|
94
92
|
)
|
|
95
93
|
})
|
|
96
94
|
function VerticalGuides({ model }: { model: LGV }) {
|
|
97
|
-
const classes = useStyles()
|
|
95
|
+
const { classes } = useStyles()
|
|
98
96
|
// find the block that needs pinning to the left side for context
|
|
99
97
|
const offsetLeft = model.staticBlocks.offsetPx - model.offsetPx
|
|
100
98
|
return (
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
|
-
import IconButton from '@material
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import ZoomOut from '@material-ui/icons/ZoomOut'
|
|
3
|
+
import { Slider, IconButton } from '@mui/material'
|
|
4
|
+
import { makeStyles } from 'tss-react/mui'
|
|
5
|
+
import ZoomIn from '@mui/icons-material/ZoomIn'
|
|
6
|
+
import ZoomOut from '@mui/icons-material/ZoomOut'
|
|
8
7
|
import { LinearGenomeViewModel } from '..'
|
|
9
8
|
|
|
10
|
-
const useStyles = makeStyles({
|
|
9
|
+
const useStyles = makeStyles()({
|
|
11
10
|
container: {
|
|
12
11
|
display: 'flex',
|
|
13
12
|
flexDirection: 'row',
|
|
@@ -19,26 +18,27 @@ const useStyles = makeStyles({
|
|
|
19
18
|
})
|
|
20
19
|
|
|
21
20
|
function ZoomControls({ model }: { model: LinearGenomeViewModel }) {
|
|
22
|
-
const classes = useStyles()
|
|
21
|
+
const { classes } = useStyles()
|
|
23
22
|
const { maxBpPerPx, minBpPerPx, bpPerPx, scaleFactor } = model
|
|
24
23
|
const [value, setValue] = useState(-Math.log2(bpPerPx) * 100)
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
setValue(-Math.log2(bpPerPx) * 100)
|
|
27
26
|
}, [setValue, bpPerPx])
|
|
27
|
+
|
|
28
28
|
return (
|
|
29
29
|
<div className={classes.container}>
|
|
30
30
|
<IconButton
|
|
31
31
|
data-testid="zoom_out"
|
|
32
|
-
onClick={() =>
|
|
33
|
-
model.zoom(bpPerPx * 2)
|
|
34
|
-
}}
|
|
32
|
+
onClick={() => model.zoom(bpPerPx * 2)}
|
|
35
33
|
disabled={bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1}
|
|
36
34
|
color="secondary"
|
|
35
|
+
size="large"
|
|
37
36
|
>
|
|
38
37
|
<ZoomOut />
|
|
39
38
|
</IconButton>
|
|
40
39
|
|
|
41
40
|
<Slider
|
|
41
|
+
size="small"
|
|
42
42
|
className={classes.slider}
|
|
43
43
|
value={value}
|
|
44
44
|
min={-Math.log2(maxBpPerPx) * 100}
|
|
@@ -49,11 +49,10 @@ function ZoomControls({ model }: { model: LinearGenomeViewModel }) {
|
|
|
49
49
|
/>
|
|
50
50
|
<IconButton
|
|
51
51
|
data-testid="zoom_in"
|
|
52
|
-
onClick={() =>
|
|
53
|
-
model.zoom(model.bpPerPx / 2)
|
|
54
|
-
}}
|
|
52
|
+
onClick={() => model.zoom(model.bpPerPx / 2)}
|
|
55
53
|
disabled={bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1}
|
|
56
54
|
color="secondary"
|
|
55
|
+
size="large"
|
|
57
56
|
>
|
|
58
57
|
<ZoomIn />
|
|
59
58
|
</IconButton>
|