@jbrowse/plugin-circular-view 1.7.11 → 2.1.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/BaseChordDisplay/components/BaseChordDisplay.d.ts +2 -7
- package/dist/BaseChordDisplay/components/BaseChordDisplay.js +18 -48
- package/dist/BaseChordDisplay/components/BaseChordDisplay.js.map +1 -0
- package/dist/BaseChordDisplay/components/DisplayError.d.ts +9 -4
- package/dist/BaseChordDisplay/components/DisplayError.js +24 -67
- package/dist/BaseChordDisplay/components/DisplayError.js.map +1 -0
- package/dist/BaseChordDisplay/components/Loading.d.ts +2 -3
- package/dist/BaseChordDisplay/components/Loading.js +98 -112
- package/dist/BaseChordDisplay/components/Loading.js.map +1 -0
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.d.ts +3 -3
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.js +80 -91
- package/dist/BaseChordDisplay/components/RpcRenderedSvgGroup.js.map +1 -0
- package/dist/BaseChordDisplay/index.d.ts +1 -1
- package/dist/BaseChordDisplay/index.js +12 -30
- package/dist/BaseChordDisplay/index.js.map +1 -0
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +10 -10
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js +204 -232
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -0
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js +12 -18
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -0
- package/dist/BaseChordDisplay/models/renderReaction.js +115 -138
- package/dist/BaseChordDisplay/models/renderReaction.js.map +1 -0
- package/dist/CircularView/components/CircularView.js +111 -185
- package/dist/CircularView/components/CircularView.js.map +1 -0
- package/dist/CircularView/components/ImportForm.js +77 -92
- package/dist/CircularView/components/ImportForm.js.map +1 -0
- package/dist/CircularView/components/Ruler.js +148 -194
- package/dist/CircularView/components/Ruler.js.map +1 -0
- package/dist/CircularView/models/CircularView.d.ts +3 -3
- package/dist/CircularView/models/CircularView.js +346 -409
- package/dist/CircularView/models/CircularView.js.map +1 -0
- package/dist/CircularView/models/slices.js +90 -104
- package/dist/CircularView/models/slices.js.map +1 -0
- package/dist/CircularView/models/viewportVisibleRegion.js +229 -264
- package/dist/CircularView/models/viewportVisibleRegion.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +147 -176
- package/dist/index.js.map +1 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.d.ts +4 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.js +17 -0
- package/esm/BaseChordDisplay/components/BaseChordDisplay.js.map +1 -0
- package/esm/BaseChordDisplay/components/DisplayError.d.ts +9 -0
- package/esm/BaseChordDisplay/components/DisplayError.js +21 -0
- package/esm/BaseChordDisplay/components/DisplayError.js.map +1 -0
- package/esm/BaseChordDisplay/components/Loading.d.ts +9 -0
- package/esm/BaseChordDisplay/components/Loading.js +66 -0
- package/esm/BaseChordDisplay/components/Loading.js.map +1 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.d.ts +4 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.js +48 -0
- package/esm/BaseChordDisplay/components/RpcRenderedSvgGroup.js.map +1 -0
- package/esm/BaseChordDisplay/index.d.ts +3 -0
- package/esm/BaseChordDisplay/index.js +4 -0
- package/esm/BaseChordDisplay/index.js.map +1 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +99 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js +181 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.d.ts +2 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js +11 -0
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -0
- package/esm/BaseChordDisplay/models/renderReaction.d.ts +30 -0
- package/esm/BaseChordDisplay/models/renderReaction.js +52 -0
- package/esm/BaseChordDisplay/models/renderReaction.js.map +1 -0
- package/esm/CircularView/components/CircularView.d.ts +4 -0
- package/esm/CircularView/components/CircularView.js +121 -0
- package/esm/CircularView/components/CircularView.js.map +1 -0
- package/esm/CircularView/components/ImportForm.d.ts +5 -0
- package/esm/CircularView/components/ImportForm.js +40 -0
- package/esm/CircularView/components/ImportForm.js.map +1 -0
- package/esm/CircularView/components/Ruler.d.ts +5 -0
- package/esm/CircularView/components/Ruler.js +126 -0
- package/esm/CircularView/components/Ruler.js.map +1 -0
- package/esm/CircularView/models/CircularView.d.ts +97 -0
- package/esm/CircularView/models/CircularView.js +317 -0
- package/esm/CircularView/models/CircularView.js.map +1 -0
- package/esm/CircularView/models/slices.d.ts +27 -0
- package/esm/CircularView/models/slices.js +53 -0
- package/esm/CircularView/models/slices.js.map +1 -0
- package/esm/CircularView/models/viewportVisibleRegion.d.ts +6 -0
- package/esm/CircularView/models/viewportVisibleRegion.js +223 -0
- package/esm/CircularView/models/viewportVisibleRegion.js.map +1 -0
- package/esm/index.d.ts +10 -0
- package/esm/index.js +49 -0
- package/esm/index.js.map +1 -0
- package/package.json +20 -12
- package/src/BaseChordDisplay/components/BaseChordDisplay.tsx +13 -25
- package/src/BaseChordDisplay/components/DisplayError.js +64 -66
- package/src/BaseChordDisplay/components/Loading.tsx +104 -107
- package/src/BaseChordDisplay/components/RpcRenderedSvgGroup.js +44 -51
- package/src/BaseChordDisplay/index.ts +1 -1
- package/src/BaseChordDisplay/models/BaseChordDisplayModel.ts +2 -1
- package/src/CircularView/components/CircularView.js +17 -16
- package/src/CircularView/components/ImportForm.tsx +5 -5
- package/src/CircularView/components/Ruler.js +4 -3
- package/src/CircularView/models/CircularView.ts +29 -42
- package/src/CircularView/models/slices.ts +2 -7
- package/src/index.ts +5 -2
- package/dist/CircularView/models/slices.test.js +0 -83
- package/dist/CircularView/models/viewportVisibleRegion.test.js +0 -130
|
@@ -1,117 +1,114 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const { useState, useEffect } = React
|
|
7
|
-
const { makeStyles } = lib['@material-ui/core/styles']
|
|
8
|
-
const { observer } = lib['mobx-react']
|
|
5
|
+
const useStyles = makeStyles()(theme => {
|
|
6
|
+
const offset = 2
|
|
7
|
+
const duration = 1.4
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
const { primary, secondary, tertiary, quaternary } = theme.palette
|
|
11
|
+
return {
|
|
12
|
+
path: {
|
|
13
|
+
strokeDasharray: 187,
|
|
14
|
+
strokeDashoffset: 50,
|
|
15
|
+
animation: `$dash ${duration}s ease-in-out infinite, $colors ${
|
|
16
|
+
duration * 4
|
|
17
|
+
}s ease-in-out infinite`,
|
|
18
|
+
},
|
|
19
|
+
'@keyframes colors': {
|
|
20
|
+
'0%': {
|
|
21
|
+
stroke: primary.light,
|
|
20
22
|
},
|
|
21
|
-
'
|
|
22
|
-
|
|
23
|
-
stroke: theme.palette.primary.light,
|
|
24
|
-
},
|
|
25
|
-
'25%': {
|
|
26
|
-
stroke: theme.palette.secondary.light,
|
|
27
|
-
},
|
|
28
|
-
'50%': {
|
|
29
|
-
stroke: theme.palette.tertiary.light,
|
|
30
|
-
},
|
|
31
|
-
'75%': {
|
|
32
|
-
stroke: theme.palette.quaternary.light,
|
|
33
|
-
},
|
|
34
|
-
'100%': {
|
|
35
|
-
stroke: theme.palette.primary.light,
|
|
36
|
-
},
|
|
23
|
+
'25%': {
|
|
24
|
+
stroke: secondary.light,
|
|
37
25
|
},
|
|
38
|
-
'
|
|
39
|
-
|
|
40
|
-
strokeDashoffset: offset,
|
|
41
|
-
},
|
|
42
|
-
'50%': {
|
|
43
|
-
strokeDashoffset: offset / 4,
|
|
44
|
-
transform: 'rotate(135deg)',
|
|
45
|
-
},
|
|
46
|
-
'100%': {
|
|
47
|
-
strokeDashoffset: offset,
|
|
48
|
-
transform: 'rotate(720deg)',
|
|
49
|
-
},
|
|
26
|
+
'50%': {
|
|
27
|
+
stroke: tertiary.light,
|
|
50
28
|
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
29
|
+
'75%': {
|
|
30
|
+
stroke: quaternary.light,
|
|
31
|
+
},
|
|
32
|
+
'100%': {
|
|
33
|
+
stroke: primary.light,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
'@keyframes dash': {
|
|
37
|
+
'0%': {
|
|
38
|
+
strokeDashoffset: offset,
|
|
39
|
+
},
|
|
40
|
+
'50%': {
|
|
41
|
+
strokeDashoffset: offset / 4,
|
|
42
|
+
transform: 'rotate(135deg)',
|
|
59
43
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
44
|
+
'100%': {
|
|
45
|
+
strokeDashoffset: offset,
|
|
46
|
+
transform: 'rotate(720deg)',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
}
|
|
50
|
+
})
|
|
64
51
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
52
|
+
// 'repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(255,255,255,.5) 5px, rgba(255,255,255,.5) 10px)',
|
|
53
|
+
const Loading = observer(
|
|
54
|
+
({
|
|
55
|
+
model: {
|
|
56
|
+
renderProps: { radius },
|
|
57
|
+
},
|
|
58
|
+
}: {
|
|
59
|
+
model: { renderProps: { radius: number } }
|
|
60
|
+
}) => {
|
|
61
|
+
const { classes } = useStyles()
|
|
71
62
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
/>
|
|
89
|
-
</pattern>
|
|
90
|
-
</defs>
|
|
91
|
-
<circle cx="0" cy="0" r={radius} fill="#f1f1f1" />
|
|
92
|
-
<circle cx="0" cy="0" r={radius} fill="url(#diagonalHatch)" />
|
|
93
|
-
<text
|
|
94
|
-
x="0"
|
|
95
|
-
y="0"
|
|
96
|
-
transform="rotate(90 0 0)"
|
|
97
|
-
dominantBaseline="middle"
|
|
98
|
-
textAnchor="middle"
|
|
63
|
+
// only show the loading message after 400ms to prevent excessive flickering
|
|
64
|
+
const [shown, setShown] = useState(false)
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
const timeout = setTimeout(() => setShown(true), 400)
|
|
67
|
+
return () => clearTimeout(timeout)
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
return !shown ? null : (
|
|
71
|
+
<g>
|
|
72
|
+
<defs>
|
|
73
|
+
<pattern
|
|
74
|
+
id="diagonalHatch"
|
|
75
|
+
width="10"
|
|
76
|
+
height="10"
|
|
77
|
+
patternTransform="rotate(45 0 0)"
|
|
78
|
+
patternUnits="userSpaceOnUse"
|
|
99
79
|
>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
80
|
+
<line
|
|
81
|
+
x1="0"
|
|
82
|
+
y1="0"
|
|
83
|
+
x2="0"
|
|
84
|
+
y2="10"
|
|
85
|
+
style={{ stroke: 'rgba(255,255,255,0.5)', strokeWidth: 10 }}
|
|
86
|
+
/>
|
|
87
|
+
</pattern>
|
|
88
|
+
</defs>
|
|
89
|
+
<circle cx="0" cy="0" r={radius} fill="#f1f1f1" />
|
|
90
|
+
<circle cx="0" cy="0" r={radius} fill="url(#diagonalHatch)" />
|
|
91
|
+
<text
|
|
92
|
+
x="0"
|
|
93
|
+
y="0"
|
|
94
|
+
transform="rotate(90 0 0)"
|
|
95
|
+
dominantBaseline="middle"
|
|
96
|
+
textAnchor="middle"
|
|
97
|
+
>
|
|
98
|
+
Loading…
|
|
99
|
+
</text>
|
|
100
|
+
<circle
|
|
101
|
+
className={classes.path}
|
|
102
|
+
fill="none"
|
|
103
|
+
strokeWidth="4"
|
|
104
|
+
strokeLinecap="round"
|
|
105
|
+
cx="0"
|
|
106
|
+
cy="0"
|
|
107
|
+
r="60"
|
|
108
|
+
/>
|
|
109
|
+
</g>
|
|
110
|
+
)
|
|
111
|
+
},
|
|
112
|
+
)
|
|
115
113
|
|
|
116
|
-
|
|
117
|
-
}
|
|
114
|
+
export default Loading
|
|
@@ -1,64 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const { unmountComponentAtNode, hydrate } = jbrequire('react-dom')
|
|
7
|
-
const { rIC } = jbrequire('@jbrowse/core/util')
|
|
1
|
+
import React, { useEffect, useRef } from 'react'
|
|
2
|
+
import { isAlive } from 'mobx-state-tree'
|
|
3
|
+
import { observer } from 'mobx-react'
|
|
4
|
+
import { hydrate, unmountComponentAtNode } from 'react-dom'
|
|
5
|
+
import { rIC } from '@jbrowse/core/util'
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
function RpcRenderedSvgGroup({ model }) {
|
|
8
|
+
const { data, html, filled, renderingComponent } = model
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
const ssrContainerNode = useRef(null)
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
useEffect(() => {
|
|
13
|
+
const domNode = ssrContainerNode.current
|
|
14
|
+
function doHydrate() {
|
|
15
|
+
if (domNode && filled) {
|
|
16
|
+
if (domNode.innerHTML) {
|
|
17
|
+
domNode.style.display = 'none'
|
|
18
|
+
unmountComponentAtNode(domNode)
|
|
19
|
+
}
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
// setting outline:none fixes react "focusable" element issue. see
|
|
22
|
+
// https://github.com/GMOD/jbrowse-components/issues/2160
|
|
23
|
+
domNode.style.outline = 'none'
|
|
24
|
+
domNode.innerHTML = html
|
|
25
|
+
// use requestIdleCallback to defer main-thread rendering
|
|
26
|
+
// and hydration for when we have some free time. helps
|
|
27
|
+
// keep the framerate up.
|
|
28
|
+
rIC(() => {
|
|
29
|
+
if (!isAlive(model)) {
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
const mainThreadRendering = React.createElement(
|
|
33
|
+
renderingComponent,
|
|
34
|
+
{ ...data, ...model.renderProps() },
|
|
35
|
+
null,
|
|
36
|
+
)
|
|
30
37
|
rIC(() => {
|
|
31
38
|
if (!isAlive(model)) {
|
|
32
39
|
return
|
|
33
40
|
}
|
|
34
|
-
|
|
35
|
-
renderingComponent,
|
|
36
|
-
{ ...data, ...model.renderProps() },
|
|
37
|
-
null,
|
|
38
|
-
)
|
|
39
|
-
rIC(() => {
|
|
40
|
-
if (!isAlive(model)) {
|
|
41
|
-
return
|
|
42
|
-
}
|
|
43
|
-
hydrate(mainThreadRendering, domNode)
|
|
44
|
-
})
|
|
41
|
+
hydrate(mainThreadRendering, domNode)
|
|
45
42
|
})
|
|
46
|
-
}
|
|
43
|
+
})
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
45
|
+
}
|
|
46
|
+
doHydrate()
|
|
47
|
+
return () => {
|
|
48
|
+
if (domNode) {
|
|
49
|
+
unmountComponentAtNode(domNode)
|
|
53
50
|
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return <g ref={ssrContainerNode} />
|
|
57
|
-
}
|
|
51
|
+
}
|
|
52
|
+
})
|
|
58
53
|
|
|
59
|
-
|
|
60
|
-
model: MobxPropTypes.observableObject.isRequired,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
return observer(RpcRenderedSvgGroup)
|
|
54
|
+
return <g ref={ssrContainerNode} />
|
|
64
55
|
}
|
|
56
|
+
|
|
57
|
+
export default observer(RpcRenderedSvgGroup)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default as
|
|
1
|
+
export { default as BaseChordDisplayComponent } from './components/BaseChordDisplay'
|
|
2
2
|
export { BaseChordDisplayModel } from './models/BaseChordDisplayModel'
|
|
3
3
|
export { baseChordDisplayConfig } from './models/baseChordDisplayConfig'
|
|
@@ -208,7 +208,8 @@ export const BaseChordDisplayModel = types
|
|
|
208
208
|
self,
|
|
209
209
|
() => ({
|
|
210
210
|
assemblyNames: getTrackAssemblyNames(self.parentTrack) as string[],
|
|
211
|
-
|
|
211
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
212
|
+
adapter: getConf(getParent<any>(self, 2), 'adapter'),
|
|
212
213
|
assemblyManager: getSession(self).assemblyManager,
|
|
213
214
|
}),
|
|
214
215
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -2,16 +2,17 @@ import React from 'react'
|
|
|
2
2
|
import { observer } from 'mobx-react'
|
|
3
3
|
import { ResizeHandle, ErrorMessage } from '@jbrowse/core/ui'
|
|
4
4
|
import { assembleLocString } from '@jbrowse/core/util'
|
|
5
|
-
import { IconButton
|
|
6
|
-
import {
|
|
5
|
+
import { IconButton } from '@mui/material'
|
|
6
|
+
import { makeStyles } from 'tss-react/mui'
|
|
7
|
+
import { grey } from '@mui/material/colors'
|
|
7
8
|
|
|
8
9
|
// icons
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
10
|
+
import ZoomOutIcon from '@mui/icons-material/ZoomOut'
|
|
11
|
+
import ZoomInIcon from '@mui/icons-material/ZoomIn'
|
|
12
|
+
import RotateLeftIcon from '@mui/icons-material/RotateLeft'
|
|
13
|
+
import RotateRightIcon from '@mui/icons-material/RotateRight'
|
|
14
|
+
import LockOpenIcon from '@mui/icons-material/LockOpen'
|
|
15
|
+
import LockIcon from '@mui/icons-material/Lock'
|
|
15
16
|
import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons'
|
|
16
17
|
|
|
17
18
|
// locals
|
|
@@ -20,7 +21,7 @@ import ImportForm from './ImportForm'
|
|
|
20
21
|
|
|
21
22
|
const dragHandleHeight = 3
|
|
22
23
|
|
|
23
|
-
const useStyles = makeStyles(theme => ({
|
|
24
|
+
const useStyles = makeStyles()(theme => ({
|
|
24
25
|
root: {
|
|
25
26
|
position: 'relative',
|
|
26
27
|
marginBottom: theme.spacing(1),
|
|
@@ -83,7 +84,7 @@ const Slices = observer(({ model }) => {
|
|
|
83
84
|
})
|
|
84
85
|
|
|
85
86
|
const Controls = observer(({ model, showingFigure }) => {
|
|
86
|
-
const classes = useStyles()
|
|
87
|
+
const { classes } = useStyles()
|
|
87
88
|
return (
|
|
88
89
|
<div className={classes.controls}>
|
|
89
90
|
<IconButton
|
|
@@ -95,7 +96,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
95
96
|
}
|
|
96
97
|
color="secondary"
|
|
97
98
|
>
|
|
98
|
-
<
|
|
99
|
+
<ZoomOutIcon />
|
|
99
100
|
</IconButton>
|
|
100
101
|
|
|
101
102
|
<IconButton
|
|
@@ -105,7 +106,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
105
106
|
disabled={!showingFigure || model.atMinBpPerPx}
|
|
106
107
|
color="secondary"
|
|
107
108
|
>
|
|
108
|
-
<
|
|
109
|
+
<ZoomInIcon />
|
|
109
110
|
</IconButton>
|
|
110
111
|
|
|
111
112
|
<IconButton
|
|
@@ -115,7 +116,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
115
116
|
disabled={!showingFigure}
|
|
116
117
|
color="secondary"
|
|
117
118
|
>
|
|
118
|
-
<
|
|
119
|
+
<RotateLeftIcon />
|
|
119
120
|
</IconButton>
|
|
120
121
|
|
|
121
122
|
<IconButton
|
|
@@ -125,7 +126,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
125
126
|
disabled={!showingFigure}
|
|
126
127
|
color="secondary"
|
|
127
128
|
>
|
|
128
|
-
<
|
|
129
|
+
<RotateRightIcon />
|
|
129
130
|
</IconButton>
|
|
130
131
|
|
|
131
132
|
<IconButton
|
|
@@ -139,7 +140,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
139
140
|
disabled={model.tooSmallToLock}
|
|
140
141
|
color="secondary"
|
|
141
142
|
>
|
|
142
|
-
{model.lockedFitToWindow ? <
|
|
143
|
+
{model.lockedFitToWindow ? <LockIcon /> : <LockOpenIcon />}
|
|
143
144
|
</IconButton>
|
|
144
145
|
|
|
145
146
|
{model.hideTrackSelectorButton ? null : (
|
|
@@ -157,7 +158,7 @@ const Controls = observer(({ model, showingFigure }) => {
|
|
|
157
158
|
})
|
|
158
159
|
|
|
159
160
|
const CircularView = observer(({ model }) => {
|
|
160
|
-
const classes = useStyles()
|
|
161
|
+
const { classes } = useStyles()
|
|
161
162
|
const initialized =
|
|
162
163
|
!!model.displayedRegions.length && model.figureWidth && model.figureHeight
|
|
163
164
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
|
-
import { Button, Container, Grid
|
|
2
|
+
import { Button, Container, Grid } from '@mui/material'
|
|
3
|
+
import { makeStyles } from 'tss-react/mui'
|
|
3
4
|
import { observer } from 'mobx-react'
|
|
4
5
|
import { getSession } from '@jbrowse/core/util'
|
|
5
|
-
import ErrorMessage from '@jbrowse/core/ui
|
|
6
|
-
import AssemblySelector from '@jbrowse/core/ui/AssemblySelector'
|
|
6
|
+
import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui'
|
|
7
7
|
|
|
8
|
-
const useStyles = makeStyles(theme => ({
|
|
8
|
+
const useStyles = makeStyles()(theme => ({
|
|
9
9
|
importFormContainer: {
|
|
10
10
|
marginBottom: theme.spacing(4),
|
|
11
11
|
},
|
|
@@ -13,7 +13,7 @@ const useStyles = makeStyles(theme => ({
|
|
|
13
13
|
|
|
14
14
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
15
|
const ImportForm = observer(({ model }: { model: any }) => {
|
|
16
|
-
const classes = useStyles()
|
|
16
|
+
const { classes } = useStyles()
|
|
17
17
|
const session = getSession(model)
|
|
18
18
|
const { error: modelError } = model
|
|
19
19
|
const { assemblyNames, assemblyManager } = session
|
|
@@ -7,9 +7,10 @@ import {
|
|
|
7
7
|
assembleLocString,
|
|
8
8
|
} from '@jbrowse/core/util'
|
|
9
9
|
import { makeContrasting } from '@jbrowse/core/util/color'
|
|
10
|
-
import {
|
|
10
|
+
import { useTheme } from '@mui/material/styles'
|
|
11
|
+
import { makeStyles } from 'tss-react/mui'
|
|
11
12
|
|
|
12
|
-
const useStyles = makeStyles({
|
|
13
|
+
const useStyles = makeStyles()({
|
|
13
14
|
rulerLabel: {
|
|
14
15
|
fontSize: '0.8rem',
|
|
15
16
|
fontWeight: 500,
|
|
@@ -89,7 +90,7 @@ const ElisionRulerArc = observer(({ model, slice }) => {
|
|
|
89
90
|
|
|
90
91
|
const RulerLabel = observer(
|
|
91
92
|
({ view, text, maxWidthPx, radians, radiusPx, title, color }) => {
|
|
92
|
-
const classes = useStyles()
|
|
93
|
+
const { classes } = useStyles()
|
|
93
94
|
const textXY = polarToCartesian(radiusPx + 5, radians)
|
|
94
95
|
if (!text) {
|
|
95
96
|
return null
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import { AnyConfigurationModel } from '@jbrowse/core/configuration/configurationSchema'
|
|
2
1
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
2
|
import {
|
|
4
|
-
|
|
5
|
-
Instance,
|
|
6
|
-
types,
|
|
3
|
+
cast,
|
|
7
4
|
getParent,
|
|
8
|
-
resolveIdentifier,
|
|
9
5
|
getRoot,
|
|
10
|
-
|
|
6
|
+
resolveIdentifier,
|
|
7
|
+
types,
|
|
8
|
+
SnapshotOrInstance,
|
|
9
|
+
Instance,
|
|
11
10
|
} from 'mobx-state-tree'
|
|
12
11
|
import { Region } from '@jbrowse/core/util/types/mst'
|
|
13
12
|
import { transaction } from 'mobx'
|
|
14
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
AnyConfigurationModel,
|
|
15
|
+
readConfObject,
|
|
16
|
+
} from '@jbrowse/core/configuration'
|
|
17
|
+
|
|
15
18
|
import {
|
|
16
19
|
getSession,
|
|
17
20
|
clamp,
|
|
@@ -204,7 +207,7 @@ export default function CircularView(pluginManager: PluginManager) {
|
|
|
204
207
|
},
|
|
205
208
|
}))
|
|
206
209
|
.volatile(() => ({
|
|
207
|
-
error: undefined as
|
|
210
|
+
error: undefined as unknown,
|
|
208
211
|
}))
|
|
209
212
|
.actions(self => ({
|
|
210
213
|
// toggle action with a flag stating which mode it's in
|
|
@@ -263,7 +266,8 @@ export default function CircularView(pluginManager: PluginManager) {
|
|
|
263
266
|
},
|
|
264
267
|
|
|
265
268
|
closeView() {
|
|
266
|
-
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
270
|
+
getParent<any>(self, 2).removeView(self)
|
|
267
271
|
},
|
|
268
272
|
|
|
269
273
|
setDisplayedRegions(regions: SnapshotOrInstance<typeof Region>[]) {
|
|
@@ -304,34 +308,27 @@ export default function CircularView(pluginManager: PluginManager) {
|
|
|
304
308
|
}
|
|
305
309
|
},
|
|
306
310
|
|
|
307
|
-
setError(error:
|
|
311
|
+
setError(error: unknown) {
|
|
308
312
|
console.error(error)
|
|
309
313
|
self.error = error
|
|
310
314
|
},
|
|
311
315
|
|
|
312
316
|
showTrack(trackId: string, initialSnapshot = {}) {
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
const
|
|
316
|
-
trackConfigSchema,
|
|
317
|
-
getRoot(self),
|
|
318
|
-
trackId,
|
|
319
|
-
)
|
|
320
|
-
const trackType = pluginManager.getTrackType(configuration.type)
|
|
317
|
+
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
318
|
+
const conf = resolveIdentifier(schema, getRoot(self), trackId)
|
|
319
|
+
const trackType = pluginManager.getTrackType(conf.type)
|
|
321
320
|
if (!trackType) {
|
|
322
|
-
throw new Error(`unknown track type ${
|
|
321
|
+
throw new Error(`unknown track type ${conf.type}`)
|
|
323
322
|
}
|
|
324
323
|
const viewType = pluginManager.getViewType(self.type)
|
|
325
|
-
const supportedDisplays = viewType.displayTypes.map(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
const displayConf = configuration.displays.find(
|
|
329
|
-
(d: AnyConfigurationModel) => supportedDisplays.includes(d.type),
|
|
324
|
+
const supportedDisplays = viewType.displayTypes.map(d => d.name)
|
|
325
|
+
const displayConf = conf.displays.find((d: AnyConfigurationModel) =>
|
|
326
|
+
supportedDisplays.includes(d.type),
|
|
330
327
|
)
|
|
331
328
|
const track = trackType.stateModel.create({
|
|
332
329
|
...initialSnapshot,
|
|
333
|
-
type:
|
|
334
|
-
configuration,
|
|
330
|
+
type: conf.type,
|
|
331
|
+
configuration: conf,
|
|
335
332
|
displays: [{ type: displayConf.type, configuration: displayConf }],
|
|
336
333
|
})
|
|
337
334
|
self.tracks.push(track)
|
|
@@ -348,9 +345,7 @@ export default function CircularView(pluginManager: PluginManager) {
|
|
|
348
345
|
throw new Error(`unknown track type ${configuration.type}`)
|
|
349
346
|
}
|
|
350
347
|
const viewType = pluginManager.getViewType(self.type)
|
|
351
|
-
const supportedDisplays = viewType.displayTypes.map(
|
|
352
|
-
displayType => displayType.name,
|
|
353
|
-
)
|
|
348
|
+
const supportedDisplays = viewType.displayTypes.map(d => d.name)
|
|
354
349
|
const displayConf = configuration.displays.find(
|
|
355
350
|
(d: AnyConfigurationModel) => supportedDisplays.includes(d.type),
|
|
356
351
|
)
|
|
@@ -365,19 +360,11 @@ export default function CircularView(pluginManager: PluginManager) {
|
|
|
365
360
|
},
|
|
366
361
|
|
|
367
362
|
hideTrack(trackId: string) {
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
trackId,
|
|
374
|
-
)
|
|
375
|
-
// if we have any tracks with that configuration, turn them off
|
|
376
|
-
const shownTracks = self.tracks.filter(
|
|
377
|
-
t => t.configuration === configuration,
|
|
378
|
-
)
|
|
379
|
-
transaction(() => shownTracks.forEach(t => self.tracks.remove(t)))
|
|
380
|
-
return shownTracks.length
|
|
363
|
+
const schema = pluginManager.pluggableConfigSchemaType('track')
|
|
364
|
+
const conf = resolveIdentifier(schema, getRoot(self), trackId)
|
|
365
|
+
const t = self.tracks.filter(t => t.configuration === conf)
|
|
366
|
+
transaction(() => t.forEach(t => self.tracks.remove(t)))
|
|
367
|
+
return t.length
|
|
381
368
|
},
|
|
382
369
|
|
|
383
370
|
toggleFitToWindowLock() {
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
polarToCartesian,
|
|
3
|
-
assembleLocString,
|
|
4
|
-
objectFromEntries,
|
|
5
|
-
Region,
|
|
6
|
-
} from '@jbrowse/core/util'
|
|
1
|
+
import { polarToCartesian, assembleLocString, Region } from '@jbrowse/core/util'
|
|
7
2
|
import { thetaRangesOverlap } from './viewportVisibleRegion'
|
|
8
3
|
|
|
9
4
|
export class Slice {
|
|
@@ -50,7 +45,7 @@ export class Slice {
|
|
|
50
45
|
}
|
|
51
46
|
|
|
52
47
|
toJSON() {
|
|
53
|
-
return
|
|
48
|
+
return Object.fromEntries(Object.entries(this))
|
|
54
49
|
}
|
|
55
50
|
}
|
|
56
51
|
|
package/src/index.ts
CHANGED
|
@@ -4,9 +4,10 @@ import { AbstractSessionModel, isAbstractMenuManager } from '@jbrowse/core/util'
|
|
|
4
4
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
5
5
|
import Plugin from '@jbrowse/core/Plugin'
|
|
6
6
|
import ViewType from '@jbrowse/core/pluggableElementTypes/ViewType'
|
|
7
|
-
import DataUsageIcon from '@
|
|
7
|
+
import DataUsageIcon from '@mui/icons-material/DataUsage'
|
|
8
8
|
import stateModelFactory, {
|
|
9
9
|
CircularViewModel,
|
|
10
|
+
CircularViewStateModel,
|
|
10
11
|
} from './CircularView/models/CircularView'
|
|
11
12
|
|
|
12
13
|
type CGV = CircularViewModel
|
|
@@ -81,5 +82,7 @@ export default class CircularViewPlugin extends Plugin {
|
|
|
81
82
|
export {
|
|
82
83
|
BaseChordDisplayModel,
|
|
83
84
|
baseChordDisplayConfig,
|
|
84
|
-
|
|
85
|
+
BaseChordDisplayComponent,
|
|
85
86
|
} from './BaseChordDisplay'
|
|
87
|
+
|
|
88
|
+
export type { CircularViewModel, CircularViewStateModel }
|