react-msaview 4.0.3 → 4.1.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/bundle/index.js +285 -103
- package/dist/colorSchemes.js +1 -1
- package/dist/colorSchemes.js.map +1 -1
- package/dist/components/Checkbox2.js.map +1 -1
- package/dist/components/Loading.js +4 -5
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/MSAView.js +3 -4
- package/dist/components/MSAView.js.map +1 -1
- package/dist/components/ResizeHandles.js.map +1 -1
- package/dist/components/SequenceTextArea.js +1 -2
- package/dist/components/SequenceTextArea.js.map +1 -1
- package/dist/components/TextTrack.d.ts +1 -1
- package/dist/components/TextTrack.js +1 -1
- package/dist/components/TextTrack.js.map +1 -1
- package/dist/components/Track.js +4 -5
- package/dist/components/Track.js.map +1 -1
- package/dist/components/VerticalScrollbar.js +1 -1
- package/dist/components/VerticalScrollbar.js.map +1 -1
- package/dist/components/dialogs/AboutDialog.js +4 -4
- package/dist/components/dialogs/AboutDialog.js.map +1 -1
- package/dist/components/dialogs/AddTrackDialog.js +1 -1
- package/dist/components/dialogs/AddTrackDialog.js.map +1 -1
- package/dist/components/dialogs/DomainDialog.js +1 -2
- package/dist/components/dialogs/DomainDialog.js.map +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js +1 -1
- package/dist/components/dialogs/ExportSVGDialog.js.map +1 -1
- package/dist/components/dialogs/FeatureDialog.js +1 -1
- package/dist/components/dialogs/FeatureDialog.js.map +1 -1
- package/dist/components/dialogs/InterProScanDialog.js +3 -3
- package/dist/components/dialogs/InterProScanDialog.js.map +1 -1
- package/dist/components/dialogs/MetadataDialog.js +3 -3
- package/dist/components/dialogs/MetadataDialog.js.map +1 -1
- package/dist/components/dialogs/SettingsDialog.js +3 -3
- package/dist/components/dialogs/SettingsDialog.js.map +1 -1
- package/dist/components/dialogs/TrackInfoDialog.js +2 -2
- package/dist/components/dialogs/TrackInfoDialog.js.map +1 -1
- package/dist/components/dialogs/TracklistDialog.js +1 -1
- package/dist/components/dialogs/TracklistDialog.js.map +1 -1
- package/dist/components/dialogs/UserProvidedDomainsDialog.js +3 -3
- package/dist/components/dialogs/UserProvidedDomainsDialog.js.map +1 -1
- package/dist/components/header/Header.js +5 -7
- package/dist/components/header/Header.js.map +1 -1
- package/dist/components/header/HeaderInfoArea.js.map +1 -1
- package/dist/components/header/HeaderMenu.js +3 -4
- package/dist/components/header/HeaderMenu.js.map +1 -1
- package/dist/components/header/HeaderMenuExtra.js +8 -9
- package/dist/components/header/HeaderMenuExtra.js.map +1 -1
- package/dist/components/header/HeaderStatusArea.js +1 -1
- package/dist/components/header/HeaderStatusArea.js.map +1 -1
- package/dist/components/header/MultiAlignmentSelector.js +1 -1
- package/dist/components/header/MultiAlignmentSelector.js.map +1 -1
- package/dist/components/header/ZoomControls.js +11 -5
- package/dist/components/header/ZoomControls.js.map +1 -1
- package/dist/components/import/ImportForm.js +19 -15
- package/dist/components/import/ImportForm.js.map +1 -1
- package/dist/components/import/ImportFormExamples.js +2 -2
- package/dist/components/import/ImportFormExamples.js.map +1 -1
- package/dist/components/import/util.d.ts +1 -1
- package/dist/components/minimap/Minimap.js.map +1 -1
- package/dist/components/minimap/MinimapSVG.js.map +1 -1
- package/dist/components/msa/Loading.js +1 -1
- package/dist/components/msa/Loading.js.map +1 -1
- package/dist/components/msa/MSACanvas.js +2 -2
- package/dist/components/msa/MSACanvas.js.map +1 -1
- package/dist/components/msa/MSACanvasBlock.js +12 -5
- package/dist/components/msa/MSACanvasBlock.js.map +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js +1 -1
- package/dist/components/msa/MSAMouseoverCanvas.js.map +1 -1
- package/dist/components/msa/MSAPanel.js +0 -1
- package/dist/components/msa/MSAPanel.js.map +1 -1
- package/dist/components/msa/renderBoxFeatureCanvasBlock.js.map +1 -1
- package/dist/components/msa/renderMSABlock.d.ts +1 -1
- package/dist/components/msa/renderMSABlock.js.map +1 -1
- package/dist/components/tree/TreeBranchMenu.js.map +1 -1
- package/dist/components/tree/TreeCanvas.js +1 -2
- package/dist/components/tree/TreeCanvas.js.map +1 -1
- package/dist/components/tree/TreeCanvasBlock.js +7 -6
- package/dist/components/tree/TreeCanvasBlock.js.map +1 -1
- package/dist/components/tree/TreeNodeMenu.js.map +1 -1
- package/dist/components/tree/TreePanel.js.map +1 -1
- package/dist/components/tree/TreeRuler.js.map +1 -1
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js +2 -2
- package/dist/components/tree/dialogs/TreeNodeInfoDialog.js.map +1 -1
- package/dist/components/tree/renderTreeCanvas.d.ts +2 -2
- package/dist/components/tree/renderTreeCanvas.js +6 -8
- package/dist/components/tree/renderTreeCanvas.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js.map +1 -1
- package/dist/launchInterProScan.js.map +1 -1
- package/dist/model/DialogQueue.js.map +1 -1
- package/dist/model.d.ts +20 -20
- package/dist/model.js +42 -30
- package/dist/model.js.map +1 -1
- package/dist/parsers/ClustalMSA.js.map +1 -1
- package/dist/parsers/EmfMSA.js.map +1 -1
- package/dist/parsers/StockholmMSA.js.map +1 -1
- package/dist/renderToSvg.d.ts +1 -1
- package/dist/renderToSvg.js +5 -6
- package/dist/renderToSvg.js.map +1 -1
- package/dist/rowCoordinateCalculations.test.js.map +1 -1
- package/dist/util.d.ts +1 -1
- package/dist/util.js +1 -1
- package/dist/util.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +4 -4
- package/src/colorSchemes.ts +2 -1
- package/src/components/Checkbox2.tsx +1 -0
- package/src/components/Loading.tsx +6 -5
- package/src/components/MSAView.tsx +6 -5
- package/src/components/ResizeHandles.tsx +1 -1
- package/src/components/SequenceTextArea.tsx +2 -2
- package/src/components/TextTrack.tsx +5 -3
- package/src/components/Track.tsx +5 -5
- package/src/components/VerticalScrollbar.tsx +5 -2
- package/src/components/dialogs/AboutDialog.tsx +6 -7
- package/src/components/dialogs/AddTrackDialog.tsx +7 -5
- package/src/components/dialogs/DomainDialog.tsx +3 -2
- package/src/components/dialogs/ExportSVGDialog.tsx +7 -5
- package/src/components/dialogs/FeatureDialog.tsx +4 -3
- package/src/components/dialogs/InterProScanDialog.tsx +6 -5
- package/src/components/dialogs/MetadataDialog.tsx +5 -5
- package/src/components/dialogs/SettingsDialog.tsx +10 -10
- package/src/components/dialogs/TrackInfoDialog.tsx +3 -2
- package/src/components/dialogs/TracklistDialog.tsx +4 -4
- package/src/components/dialogs/UserProvidedDomainsDialog.tsx +7 -6
- package/src/components/header/Header.tsx +8 -11
- package/src/components/header/HeaderInfoArea.tsx +1 -1
- package/src/components/header/HeaderMenu.tsx +4 -6
- package/src/components/header/HeaderMenuExtra.tsx +9 -11
- package/src/components/header/HeaderStatusArea.tsx +2 -2
- package/src/components/header/MultiAlignmentSelector.tsx +3 -3
- package/src/components/header/ZoomControls.tsx +13 -6
- package/src/components/import/ImportForm.tsx +31 -24
- package/src/components/import/ImportFormExamples.tsx +5 -4
- package/src/components/import/util.ts +1 -1
- package/src/components/minimap/Minimap.tsx +2 -0
- package/src/components/minimap/MinimapSVG.tsx +2 -0
- package/src/components/msa/Loading.tsx +2 -1
- package/src/components/msa/MSACanvas.tsx +5 -4
- package/src/components/msa/MSACanvasBlock.tsx +20 -6
- package/src/components/msa/MSAMouseoverCanvas.tsx +4 -3
- package/src/components/msa/MSAPanel.tsx +2 -1
- package/src/components/msa/renderBoxFeatureCanvasBlock.ts +1 -3
- package/src/components/msa/renderMSABlock.ts +3 -4
- package/src/components/tree/TreeBranchMenu.tsx +1 -1
- package/src/components/tree/TreeCanvas.tsx +4 -4
- package/src/components/tree/TreeCanvasBlock.tsx +15 -8
- package/src/components/tree/TreeNodeMenu.tsx +1 -1
- package/src/components/tree/TreePanel.tsx +3 -1
- package/src/components/tree/TreeRuler.tsx +1 -1
- package/src/components/tree/dialogs/TreeNodeInfoDialog.tsx +5 -4
- package/src/components/tree/renderTreeCanvas.ts +7 -13
- package/src/index.ts +1 -1
- package/src/launchInterProScan.ts +2 -0
- package/src/model/DialogQueue.ts +2 -1
- package/src/model.ts +60 -48
- package/src/parsers/ClustalMSA.ts +1 -0
- package/src/parsers/EmfMSA.ts +1 -0
- package/src/parsers/StockholmMSA.ts +1 -1
- package/src/renderToSvg.tsx +7 -9
- package/src/rowCoordinateCalculations.test.ts +1 -0
- package/src/util.ts +4 -3
- package/src/version.ts +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { Select } from '@mui/material'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
|
-
// locals
|
|
6
6
|
import type { MsaViewModel } from '../../model'
|
|
7
7
|
|
|
8
8
|
const MultiAlignmentSelector = observer(function ({
|
|
@@ -17,7 +17,7 @@ const MultiAlignmentSelector = observer(function ({
|
|
|
17
17
|
value={currentAlignment}
|
|
18
18
|
size="small"
|
|
19
19
|
onChange={event => {
|
|
20
|
-
model.setCurrentAlignment(+
|
|
20
|
+
model.setCurrentAlignment(+event.target.value)
|
|
21
21
|
model.setScrollX(0)
|
|
22
22
|
model.setScrollY(0)
|
|
23
23
|
}}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
4
|
+
import MoreVert from '@mui/icons-material/MoreVert'
|
|
5
|
+
import RestartAlt from '@mui/icons-material/RestartAlt'
|
|
6
|
+
import ZoomIn from '@mui/icons-material/ZoomIn'
|
|
7
|
+
import ZoomOut from '@mui/icons-material/ZoomOut'
|
|
2
8
|
import { IconButton } from '@mui/material'
|
|
3
9
|
import { observer } from 'mobx-react'
|
|
4
|
-
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton'
|
|
5
10
|
|
|
6
|
-
// locals
|
|
7
11
|
import { MsaViewModel } from '../../model'
|
|
8
12
|
|
|
9
13
|
// icons
|
|
10
|
-
import ZoomIn from '@mui/icons-material/ZoomIn'
|
|
11
|
-
import ZoomOut from '@mui/icons-material/ZoomOut'
|
|
12
|
-
import MoreVert from '@mui/icons-material/MoreVert'
|
|
13
|
-
import RestartAlt from '@mui/icons-material/RestartAlt'
|
|
14
14
|
|
|
15
15
|
const ZoomControls = observer(function ZoomControls({
|
|
16
16
|
model,
|
|
@@ -60,6 +60,13 @@ const ZoomControls = observer(function ZoomControls({
|
|
|
60
60
|
model.zoomOutVertical()
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
|
+
|
|
64
|
+
{
|
|
65
|
+
label: 'Show entire view',
|
|
66
|
+
onClick: () => {
|
|
67
|
+
model.showEntire()
|
|
68
|
+
},
|
|
69
|
+
},
|
|
63
70
|
{
|
|
64
71
|
label: 'Reset zoom to default',
|
|
65
72
|
icon: RestartAlt,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { ErrorMessage, FileSelector } from '@jbrowse/core/ui'
|
|
4
|
+
import { Button, Container, Typography } from '@mui/material'
|
|
2
5
|
import { observer } from 'mobx-react'
|
|
3
|
-
import { Button, Container, Grid, Typography } from '@mui/material'
|
|
4
|
-
import { FileSelector } from '@jbrowse/core/ui'
|
|
5
|
-
import type { FileLocation } from '@jbrowse/core/util/types'
|
|
6
6
|
|
|
7
|
-
// locals
|
|
8
|
-
import type { MsaViewModel } from '../../model'
|
|
9
|
-
import { load } from './util'
|
|
10
7
|
import ImportFormExamples from './ImportFormExamples'
|
|
8
|
+
import { load } from './util'
|
|
9
|
+
|
|
10
|
+
import type { MsaViewModel } from '../../model'
|
|
11
|
+
import type { FileLocation } from '@jbrowse/core/util/types'
|
|
11
12
|
|
|
12
13
|
const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
13
14
|
const [msaFile, setMsaFile] = useState<FileLocation>()
|
|
@@ -17,11 +18,7 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
17
18
|
return (
|
|
18
19
|
<Container>
|
|
19
20
|
<div style={{ width: '50%' }}>
|
|
20
|
-
{error ?
|
|
21
|
-
<div style={{ padding: 20 }}>
|
|
22
|
-
<Typography color="error">Error: {`${error}`}</Typography>
|
|
23
|
-
</div>
|
|
24
|
-
) : null}
|
|
21
|
+
{error ? <ErrorMessage error={error} /> : null}
|
|
25
22
|
<Typography>
|
|
26
23
|
Open an MSA file (stockholm or clustal format) and/or a tree file
|
|
27
24
|
(newick format).
|
|
@@ -34,15 +31,25 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
34
31
|
</Typography>
|
|
35
32
|
</div>
|
|
36
33
|
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<
|
|
34
|
+
<div
|
|
35
|
+
style={{
|
|
36
|
+
display: 'flex',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
gap: 40,
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<div>
|
|
43
|
+
<div>
|
|
44
|
+
<Typography>MSA file or URL</Typography>
|
|
45
|
+
<FileSelector location={msaFile} setLocation={setMsaFile} />
|
|
46
|
+
</div>
|
|
47
|
+
<div>
|
|
48
|
+
<Typography>Tree file or URL</Typography>
|
|
49
|
+
<FileSelector location={treeFile} setLocation={setTreeFile} />
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
46
53
|
<Button
|
|
47
54
|
onClick={() => {
|
|
48
55
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
@@ -61,13 +68,13 @@ const ImportForm = observer(function ({ model }: { model: MsaViewModel }) {
|
|
|
61
68
|
>
|
|
62
69
|
Open
|
|
63
70
|
</Button>
|
|
64
|
-
</
|
|
71
|
+
</div>
|
|
65
72
|
|
|
66
|
-
<
|
|
73
|
+
<div>
|
|
67
74
|
<Typography>Examples</Typography>
|
|
68
75
|
<ImportFormExamples model={model} />
|
|
69
|
-
</
|
|
70
|
-
</
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
71
78
|
</Container>
|
|
72
79
|
)
|
|
73
80
|
})
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
import { Link, Typography } from '@mui/material'
|
|
3
4
|
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
|
-
import { smallTree, smallMSA, smallMSAOnly } from './data/seq2'
|
|
6
|
+
import { smallMSA, smallMSAOnly, smallTree } from './data/seq2'
|
|
8
7
|
import { load } from './util'
|
|
9
8
|
|
|
9
|
+
import type { MsaViewModel } from '../../model'
|
|
10
|
+
|
|
10
11
|
function ListItem({
|
|
11
12
|
onClick,
|
|
12
13
|
model,
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
|
|
4
|
-
// locals
|
|
5
|
-
import type { MsaViewModel } from '../../model'
|
|
6
|
-
import MSACanvasBlock from './MSACanvasBlock'
|
|
7
5
|
import Loading from './Loading'
|
|
6
|
+
import MSACanvasBlock from './MSACanvasBlock'
|
|
7
|
+
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
8
9
|
|
|
9
10
|
const MSACanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
10
11
|
const {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import React, { useEffect,
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react'
|
|
2
|
+
|
|
2
3
|
import { useTheme } from '@mui/material'
|
|
3
4
|
import { autorun } from 'mobx'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
import { renderBoxFeatureCanvasBlock } from './renderBoxFeatureCanvasBlock'
|
|
7
8
|
import { renderMSABlock } from './renderMSABlock'
|
|
8
|
-
import type { MsaViewModel } from '../../model'
|
|
9
9
|
import { colorContrast } from '../../util'
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
import type { MsaViewModel } from '../../model'
|
|
11
12
|
|
|
12
13
|
const MSACanvasBlock = observer(function ({
|
|
13
14
|
model,
|
|
@@ -44,7 +45,12 @@ const MSACanvasBlock = observer(function ({
|
|
|
44
45
|
}
|
|
45
46
|
return autorun(() => {
|
|
46
47
|
ctx.resetTransform()
|
|
47
|
-
ctx.clearRect(
|
|
48
|
+
ctx.clearRect(
|
|
49
|
+
0,
|
|
50
|
+
0,
|
|
51
|
+
blockSize * highResScaleFactor,
|
|
52
|
+
blockSize * highResScaleFactor,
|
|
53
|
+
)
|
|
48
54
|
const { actuallyShowDomains } = model
|
|
49
55
|
if (actuallyShowDomains) {
|
|
50
56
|
renderBoxFeatureCanvasBlock({
|
|
@@ -63,7 +69,15 @@ const MSACanvasBlock = observer(function ({
|
|
|
63
69
|
model,
|
|
64
70
|
})
|
|
65
71
|
})
|
|
66
|
-
}, [
|
|
72
|
+
}, [
|
|
73
|
+
model,
|
|
74
|
+
offsetX,
|
|
75
|
+
offsetY,
|
|
76
|
+
theme,
|
|
77
|
+
blockSize,
|
|
78
|
+
highResScaleFactor,
|
|
79
|
+
contrastScheme,
|
|
80
|
+
])
|
|
67
81
|
|
|
68
82
|
return (
|
|
69
83
|
<canvas
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react'
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import { autorun } from 'mobx'
|
|
4
|
+
import { observer } from 'mobx-react'
|
|
4
5
|
|
|
5
|
-
// locals
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
6
|
import { renderMouseover } from './renderMSAMouseover'
|
|
8
7
|
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
9
|
+
|
|
9
10
|
const MSAMouseoverCanvas = observer(function ({
|
|
10
11
|
model,
|
|
11
12
|
}: {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { HierarchyNode } from 'd3-hierarchy'
|
|
2
|
-
|
|
3
|
-
// locals
|
|
4
1
|
import type { MsaViewModel } from '../../model'
|
|
5
2
|
import type { NodeWithIdsAndLength } from '../../util'
|
|
3
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
6
4
|
|
|
7
5
|
export function renderBoxFeatureCanvasBlock({
|
|
8
6
|
model,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Theme } from '@mui/material'
|
|
1
|
+
import { getClustalXColor, getPercentIdentityColor } from '../../colorSchemes'
|
|
3
2
|
|
|
4
|
-
// locals
|
|
5
3
|
import type { MsaViewModel } from '../../model'
|
|
6
|
-
import { getClustalXColor, getPercentIdentityColor } from '../../colorSchemes'
|
|
7
4
|
import type { NodeWithIdsAndLength } from '../../util'
|
|
5
|
+
import type { Theme } from '@mui/material'
|
|
6
|
+
import type { HierarchyNode } from 'd3-hierarchy'
|
|
8
7
|
|
|
9
8
|
export function renderMSABlock({
|
|
10
9
|
model,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
1
|
+
import React, { useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
3
|
import { observer } from 'mobx-react'
|
|
4
4
|
|
|
5
|
-
// locals
|
|
6
|
-
import type { MsaViewModel } from '../../model'
|
|
7
5
|
import TreeCanvasBlock from './TreeCanvasBlock'
|
|
8
6
|
import { padding } from './renderTreeCanvas'
|
|
9
7
|
|
|
8
|
+
import type { MsaViewModel } from '../../model'
|
|
9
|
+
|
|
10
10
|
const TreeCanvas = observer(function ({ model }: { model: MsaViewModel }) {
|
|
11
11
|
const ref = useRef<HTMLDivElement>(null)
|
|
12
12
|
const scheduled = useRef(false)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react'
|
|
2
|
+
|
|
3
|
+
import { useTheme } from '@mui/material'
|
|
3
4
|
import { autorun } from 'mobx'
|
|
4
5
|
import { observer } from 'mobx-react'
|
|
5
|
-
import { useTheme } from '@mui/material'
|
|
6
6
|
import RBush from 'rbush'
|
|
7
7
|
|
|
8
|
-
// locals
|
|
9
|
-
import type { MsaViewModel } from '../../model'
|
|
10
|
-
import TreeNodeMenu from './TreeNodeMenu'
|
|
11
8
|
import TreeBranchMenu from './TreeBranchMenu'
|
|
9
|
+
import TreeNodeMenu from './TreeNodeMenu'
|
|
12
10
|
import { padding, renderTreeCanvas } from './renderTreeCanvas'
|
|
13
11
|
|
|
12
|
+
import type { MsaViewModel } from '../../model'
|
|
13
|
+
|
|
14
14
|
interface TooltipData {
|
|
15
15
|
name: string
|
|
16
16
|
id: string
|
|
@@ -36,7 +36,7 @@ const TreeCanvasBlock = observer(function ({
|
|
|
36
36
|
offsetY: number
|
|
37
37
|
}) {
|
|
38
38
|
const theme = useTheme()
|
|
39
|
-
const ref = useRef<HTMLCanvasElement>()
|
|
39
|
+
const ref = useRef<HTMLCanvasElement>(null)
|
|
40
40
|
const clickMap = useRef(new RBush<ClickEntry>())
|
|
41
41
|
const mouseoverRef = useRef<HTMLCanvasElement>(null)
|
|
42
42
|
const [branchMenu, setBranchMenu] = useState<TooltipData>()
|
|
@@ -66,6 +66,13 @@ const TreeCanvasBlock = observer(function ({
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
return autorun(() => {
|
|
69
|
+
ctx.resetTransform()
|
|
70
|
+
ctx.clearRect(
|
|
71
|
+
0,
|
|
72
|
+
0,
|
|
73
|
+
(treeAreaWidth + padding) * highResScaleFactor,
|
|
74
|
+
blockSize * highResScaleFactor,
|
|
75
|
+
)
|
|
69
76
|
renderTreeCanvas({
|
|
70
77
|
ctx,
|
|
71
78
|
model,
|
|
@@ -74,7 +81,7 @@ const TreeCanvasBlock = observer(function ({
|
|
|
74
81
|
theme,
|
|
75
82
|
})
|
|
76
83
|
})
|
|
77
|
-
}, [model, offsetY, theme])
|
|
84
|
+
}, [model, blockSize, highResScaleFactor, treeAreaWidth, offsetY, theme])
|
|
78
85
|
|
|
79
86
|
useEffect(() => {
|
|
80
87
|
const ctx = mouseoverRef.current?.getContext('2d')
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
4
|
|
|
4
|
-
import type { MsaViewModel } from '../../model'
|
|
5
5
|
import TreeCanvas from './TreeCanvas'
|
|
6
6
|
|
|
7
|
+
import type { MsaViewModel } from '../../model'
|
|
8
|
+
|
|
7
9
|
const TreePanel = observer(function ({ model }: { model: MsaViewModel }) {
|
|
8
10
|
const { treeAreaWidth } = model
|
|
9
11
|
return (
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
|
|
3
|
+
import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes'
|
|
4
|
+
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard'
|
|
2
5
|
import { Dialog } from '@jbrowse/core/ui'
|
|
3
6
|
import { DialogContent } from '@mui/material'
|
|
4
7
|
import { observer } from 'mobx-react'
|
|
5
|
-
import Attributes from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/Attributes'
|
|
6
|
-
import BaseCard from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail/BaseCard'
|
|
7
8
|
|
|
8
|
-
// locals
|
|
9
|
-
import type { MsaViewModel } from '../../../model'
|
|
10
9
|
import SequenceTextArea from '../../SequenceTextArea'
|
|
11
10
|
|
|
11
|
+
import type { MsaViewModel } from '../../../model'
|
|
12
|
+
|
|
12
13
|
const TreeNodeInfoDialog = observer(function ({
|
|
13
14
|
info,
|
|
14
15
|
model,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type RBush from 'rbush'
|
|
2
|
-
import type { Theme } from '@mui/material'
|
|
3
|
-
|
|
4
|
-
// locals
|
|
5
1
|
import type { MsaViewModel } from '../../model'
|
|
2
|
+
import type { Theme } from '@mui/material'
|
|
3
|
+
import type RBush from 'rbush'
|
|
6
4
|
|
|
7
5
|
export const padding = 600
|
|
8
6
|
|
|
@@ -241,9 +239,7 @@ export function renderTreeCanvas({
|
|
|
241
239
|
noTree,
|
|
242
240
|
drawTree,
|
|
243
241
|
drawNodeBubbles,
|
|
244
|
-
treeWidth,
|
|
245
242
|
highResScaleFactor,
|
|
246
|
-
blockSize,
|
|
247
243
|
fontSize,
|
|
248
244
|
showTreeText,
|
|
249
245
|
marginLeft,
|
|
@@ -251,21 +247,19 @@ export function renderTreeCanvas({
|
|
|
251
247
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
252
248
|
rowHeight: _rowHeight, // this is needed for redrawing after zoom change
|
|
253
249
|
} = model
|
|
254
|
-
const by = blockSizeYOverride || blockSize
|
|
255
250
|
|
|
256
251
|
ctx.resetTransform()
|
|
257
252
|
|
|
258
|
-
// this is a bogus use of nref, it is never less than 0. we just are using
|
|
259
|
-
// in this statement because otherwise it would be an unused variable,
|
|
260
|
-
// just need to use nref to indicate a redraw in an autorun when canvas
|
|
261
|
-
// is updated and in order to convince bundlers like not to delete
|
|
262
|
-
// usage with propertyReadSideEffects
|
|
253
|
+
// this is a bogus use of nref, it is never less than 0. we just are using
|
|
254
|
+
// it in this statement because otherwise it would be an unused variable,
|
|
255
|
+
// we just need to use nref to indicate a redraw in an autorun when canvas
|
|
256
|
+
// ref is updated and in order to convince bundlers like not to delete
|
|
257
|
+
// unused usage with propertyReadSideEffects
|
|
263
258
|
const k =
|
|
264
259
|
nref < 0
|
|
265
260
|
? Number.NEGATIVE_INFINITY
|
|
266
261
|
: highResScaleFactorOverride || highResScaleFactor
|
|
267
262
|
ctx.scale(k, k)
|
|
268
|
-
ctx.clearRect(0, 0, treeWidth + padding, by)
|
|
269
263
|
ctx.translate(marginLeft, -offsetY)
|
|
270
264
|
|
|
271
265
|
const font = ctx.font
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as MSAView } from './components/Loading'
|
|
2
|
-
export { default as MSAModelF
|
|
2
|
+
export { type MsaViewModel, default as MSAModelF } from './model'
|