@jbrowse/plugin-linear-genome-view 2.2.2 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +4 -2
- package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/dist/BaseLinearDisplay/components/Block.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/Block.js +1 -1
- package/dist/BaseLinearDisplay/components/Block.js.map +1 -1
- package/dist/BaseLinearDisplay/components/BlockMsg.js +3 -2
- package/dist/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/dist/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
- package/dist/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
- package/dist/BaseLinearDisplay/index.d.ts +2 -2
- package/dist/BaseLinearDisplay/index.js +4 -3
- package/dist/BaseLinearDisplay/index.js.map +1 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +2 -0
- package/dist/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -5
- package/dist/BaseLinearDisplay/models/configSchema.js.map +1 -0
- package/dist/BaseLinearDisplay/models/util.d.ts +18 -0
- package/dist/BaseLinearDisplay/models/util.js +18 -0
- package/dist/BaseLinearDisplay/models/util.js.map +1 -0
- package/dist/FeatureTrack/index.d.ts +1 -1
- package/dist/FeatureTrack/index.js +5 -4
- package/dist/FeatureTrack/index.js.map +1 -1
- package/dist/LinearBareDisplay/index.js +2 -1
- package/dist/LinearBareDisplay/index.js.map +1 -1
- package/dist/LinearBareDisplay/model.d.ts +1 -1
- package/dist/LinearBasicDisplay/index.js +1 -0
- package/dist/LinearBasicDisplay/index.js.map +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +1 -4
- package/dist/LinearGenomeView/components/ImportForm.js +5 -1
- package/dist/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +1 -2
- package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/dist/LinearGenomeView/components/Ruler.d.ts +2 -18
- package/dist/LinearGenomeView/components/Ruler.js +9 -25
- package/dist/LinearGenomeView/components/Ruler.js.map +1 -1
- package/dist/LinearGenomeView/components/SearchBox.js +4 -0
- package/dist/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/dist/LinearGenomeView/index.js +1 -0
- package/dist/LinearGenomeView/index.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +2 -1
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js +3 -2
- package/esm/BaseLinearDisplay/components/BaseLinearDisplay.js.map +1 -1
- package/esm/BaseLinearDisplay/components/Block.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/Block.js +1 -1
- package/esm/BaseLinearDisplay/components/Block.js.map +1 -1
- package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -2
- package/esm/BaseLinearDisplay/components/BlockMsg.js.map +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.d.ts +1 -1
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/esm/BaseLinearDisplay/components/LinearBlocks.js.map +1 -1
- package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.d.ts +0 -0
- package/esm/BaseLinearDisplay/{models → components}/TooLargeMessage.js +0 -0
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js.map +1 -0
- package/esm/BaseLinearDisplay/index.d.ts +2 -2
- package/esm/BaseLinearDisplay/index.js +2 -2
- package/esm/BaseLinearDisplay/index.js.map +1 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +6 -14
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +3 -5
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js.map +1 -1
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +2 -0
- package/esm/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.js → configSchema.js} +5 -4
- package/esm/BaseLinearDisplay/models/configSchema.js.map +1 -0
- package/esm/BaseLinearDisplay/models/util.d.ts +18 -0
- package/esm/BaseLinearDisplay/models/util.js +14 -0
- package/esm/BaseLinearDisplay/models/util.js.map +1 -0
- package/esm/FeatureTrack/index.d.ts +1 -1
- package/esm/FeatureTrack/index.js +5 -4
- package/esm/FeatureTrack/index.js.map +1 -1
- package/esm/LinearBareDisplay/index.js +2 -1
- package/esm/LinearBareDisplay/index.js.map +1 -1
- package/esm/LinearBareDisplay/model.d.ts +1 -1
- package/esm/LinearBasicDisplay/index.js +1 -0
- package/esm/LinearBasicDisplay/index.js.map +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +1 -4
- package/esm/LinearGenomeView/components/ImportForm.js +5 -1
- package/esm/LinearGenomeView/components/ImportForm.js.map +1 -1
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js +1 -2
- package/esm/LinearGenomeView/components/LinearGenomeViewSvg.js.map +1 -1
- package/esm/LinearGenomeView/components/Ruler.d.ts +2 -18
- package/esm/LinearGenomeView/components/Ruler.js +6 -22
- package/esm/LinearGenomeView/components/Ruler.js.map +1 -1
- package/esm/LinearGenomeView/components/SearchBox.js +4 -0
- package/esm/LinearGenomeView/components/SearchBox.js.map +1 -1
- package/esm/LinearGenomeView/index.js +1 -0
- package/esm/LinearGenomeView/index.js.map +1 -1
- package/esm/index.d.ts +5 -5
- package/esm/index.js +3 -2
- package/esm/index.js.map +1 -1
- package/package.json +4 -5
- package/src/BaseLinearDisplay/components/BaseLinearDisplay.tsx +86 -84
- package/src/BaseLinearDisplay/components/Block.tsx +15 -11
- package/src/BaseLinearDisplay/components/BlockMsg.tsx +9 -9
- package/src/BaseLinearDisplay/components/LinearBlocks.tsx +62 -58
- package/src/BaseLinearDisplay/{models → components}/TooLargeMessage.tsx +0 -0
- package/src/BaseLinearDisplay/index.ts +2 -1
- package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +4 -3
- package/src/BaseLinearDisplay/models/{baseLinearDisplayConfigSchema.ts → configSchema.ts} +5 -3
- package/src/BaseLinearDisplay/models/util.ts +24 -0
- package/src/FeatureTrack/index.ts +5 -8
- package/src/LinearBareDisplay/index.ts +4 -2
- package/src/LinearBasicDisplay/index.ts +1 -0
- package/src/LinearGenomeView/README.md +2 -1
- package/src/LinearGenomeView/components/ImportForm.tsx +3 -0
- package/src/LinearGenomeView/components/LinearGenomeView.test.tsx +132 -134
- package/src/LinearGenomeView/components/LinearGenomeViewSvg.tsx +1 -2
- package/src/LinearGenomeView/components/Ruler.tsx +11 -28
- package/src/LinearGenomeView/components/SearchBox.tsx +2 -0
- package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.tsx.snap +2 -5
- package/src/LinearGenomeView/index.ts +1 -0
- package/src/index.ts +3 -0
- package/dist/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
- package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
- package/esm/BaseLinearDisplay/models/TooLargeMessage.js.map +0 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +0 -1
- package/esm/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js.map +0 -1
|
@@ -30,143 +30,141 @@ const assemblyConf = {
|
|
|
30
30
|
},
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, 15000)
|
|
49
|
-
|
|
50
|
-
it('renders one track, one region', async () => {
|
|
51
|
-
const session = createTestSession()
|
|
52
|
-
session.addAssemblyConf(assemblyConf)
|
|
53
|
-
session.addTrackConf({
|
|
54
|
-
trackId: 'testConfig',
|
|
55
|
-
assemblyNames: ['volMyt1'],
|
|
56
|
-
name: 'Foo Track',
|
|
57
|
-
type: 'BasicTrack',
|
|
58
|
-
adapter: { type: 'FromConfigAdapter', features: [] },
|
|
59
|
-
})
|
|
60
|
-
session.addView('LinearGenomeView', {
|
|
61
|
-
type: 'LinearGenomeView',
|
|
62
|
-
id: 'lgv',
|
|
63
|
-
offsetPx: 0,
|
|
64
|
-
bpPerPx: 1,
|
|
65
|
-
tracks: [
|
|
66
|
-
{
|
|
67
|
-
id: 'foo',
|
|
68
|
-
type: 'BasicTrack',
|
|
69
|
-
height: 20,
|
|
70
|
-
configuration: 'testConfig',
|
|
71
|
-
displays: [
|
|
72
|
-
{
|
|
73
|
-
type: 'LinearBareDisplay',
|
|
74
|
-
configuration: 'testConfig-LinearBareDisplay',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
],
|
|
79
|
-
displayedRegions: [
|
|
80
|
-
{ assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
|
|
81
|
-
],
|
|
82
|
-
})
|
|
83
|
-
const model = session.views[0]
|
|
84
|
-
model.setWidth(800)
|
|
85
|
-
const { container, queryByText, getByPlaceholderText, findByText } = render(
|
|
86
|
-
<LinearGenomeView model={model} />,
|
|
87
|
-
)
|
|
88
|
-
await findByText('Foo Track')
|
|
89
|
-
// test needs to wait until it's updated to display 100 bp in the header to
|
|
90
|
-
// make snapshot pass
|
|
91
|
-
await findByText('100bp')
|
|
33
|
+
test('renders setup wizard', async () => {
|
|
34
|
+
const session = createTestSession()
|
|
35
|
+
session.addAssemblyConf(assemblyConf)
|
|
36
|
+
session.addView('LinearGenomeView', { id: 'lgv' })
|
|
37
|
+
const model = session.views[0]
|
|
38
|
+
model.setWidth(800)
|
|
39
|
+
const { findByText } = render(<LinearGenomeView model={model} />)
|
|
40
|
+
expect(model.displayedRegions.length).toEqual(0)
|
|
41
|
+
const elt = await findByText('Open')
|
|
42
|
+
await waitFor(() => expect(elt.getAttribute('disabled')).toBe(null))
|
|
43
|
+
fireEvent.click(elt)
|
|
44
|
+
await waitFor(() => expect(model.displayedRegions.length).toEqual(1), {
|
|
45
|
+
timeout: 15000,
|
|
46
|
+
})
|
|
47
|
+
}, 15000)
|
|
92
48
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
49
|
+
test('renders one track, one region', async () => {
|
|
50
|
+
const session = createTestSession()
|
|
51
|
+
session.addAssemblyConf(assemblyConf)
|
|
52
|
+
session.addTrackConf({
|
|
53
|
+
trackId: 'testConfig',
|
|
54
|
+
assemblyNames: ['volMyt1'],
|
|
55
|
+
name: 'Foo Track',
|
|
56
|
+
type: 'BasicTrack',
|
|
57
|
+
adapter: { type: 'FromConfigAdapter', features: [] },
|
|
100
58
|
})
|
|
59
|
+
session.addView('LinearGenomeView', {
|
|
60
|
+
type: 'LinearGenomeView',
|
|
61
|
+
id: 'lgv',
|
|
62
|
+
offsetPx: 0,
|
|
63
|
+
bpPerPx: 1,
|
|
64
|
+
tracks: [
|
|
65
|
+
{
|
|
66
|
+
id: 'foo',
|
|
67
|
+
type: 'BasicTrack',
|
|
68
|
+
height: 20,
|
|
69
|
+
configuration: 'testConfig',
|
|
70
|
+
displays: [
|
|
71
|
+
{
|
|
72
|
+
type: 'LinearBareDisplay',
|
|
73
|
+
configuration: 'testConfig-LinearBareDisplay',
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
},
|
|
77
|
+
],
|
|
78
|
+
displayedRegions: [
|
|
79
|
+
{ assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
|
|
80
|
+
],
|
|
81
|
+
})
|
|
82
|
+
const model = session.views[0]
|
|
83
|
+
model.setWidth(800)
|
|
84
|
+
const { container, queryByText, getByPlaceholderText, findByText } = render(
|
|
85
|
+
<LinearGenomeView model={model} />,
|
|
86
|
+
)
|
|
87
|
+
await findByText('Foo Track')
|
|
88
|
+
// test needs to wait until it's updated to display 100 bp in the header to
|
|
89
|
+
// make snapshot pass
|
|
90
|
+
await findByText('100bp')
|
|
101
91
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
adapter: { type: 'FromConfigAdapter', features: [] },
|
|
111
|
-
})
|
|
92
|
+
await waitFor(() => {
|
|
93
|
+
expect(
|
|
94
|
+
(getByPlaceholderText('Search for location') as HTMLInputElement).value,
|
|
95
|
+
).toEqual('ctgA:1..100')
|
|
96
|
+
})
|
|
97
|
+
await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
|
|
98
|
+
expect(container.firstChild).toMatchSnapshot()
|
|
99
|
+
})
|
|
112
100
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
bpPerPx: 1,
|
|
124
|
-
displayedRegions: [
|
|
125
|
-
{ assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
|
|
126
|
-
{
|
|
127
|
-
assemblyName: 'volMyt1',
|
|
128
|
-
refName: 'ctgB',
|
|
129
|
-
start: 1000,
|
|
130
|
-
end: 2000,
|
|
131
|
-
},
|
|
132
|
-
],
|
|
133
|
-
tracks: [
|
|
134
|
-
{
|
|
135
|
-
id: 'foo',
|
|
136
|
-
type: 'BasicTrack',
|
|
137
|
-
height: 20,
|
|
138
|
-
configuration: 'testConfig',
|
|
139
|
-
displays: [
|
|
140
|
-
{
|
|
141
|
-
type: 'LinearBareDisplay',
|
|
142
|
-
configuration: 'testConfig-LinearBareDisplay',
|
|
143
|
-
},
|
|
144
|
-
],
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
id: 'bar',
|
|
148
|
-
type: 'BasicTrack',
|
|
149
|
-
height: 20,
|
|
150
|
-
configuration: 'testConfig2',
|
|
151
|
-
displays: [
|
|
152
|
-
{
|
|
153
|
-
type: 'LinearBareDisplay',
|
|
154
|
-
configuration: 'testConfig2-LinearBareDisplay',
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
})
|
|
160
|
-
const model = session.views[0]
|
|
161
|
-
model.setWidth(800)
|
|
162
|
-
const { container, findByText, queryByText, findAllByTestId } = render(
|
|
163
|
-
<LinearGenomeView model={model} />,
|
|
164
|
-
)
|
|
165
|
-
await findByText('Foo Track')
|
|
166
|
-
await findByText('798bp')
|
|
167
|
-
await findAllByTestId('svgfeatures')
|
|
168
|
-
await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
|
|
101
|
+
test('renders two tracks, two regions', async () => {
|
|
102
|
+
const session = createTestSession()
|
|
103
|
+
session.addAssemblyConf(assemblyConf)
|
|
104
|
+
session.addTrackConf({
|
|
105
|
+
trackId: 'testConfig',
|
|
106
|
+
name: 'Foo Track',
|
|
107
|
+
assemblyNames: ['volMyt1'],
|
|
108
|
+
type: 'BasicTrack',
|
|
109
|
+
adapter: { type: 'FromConfigAdapter', features: [] },
|
|
110
|
+
})
|
|
169
111
|
|
|
170
|
-
|
|
112
|
+
session.addTrackConf({
|
|
113
|
+
trackId: 'testConfig2',
|
|
114
|
+
name: 'Bar Track',
|
|
115
|
+
assemblyNames: ['volMyt1'],
|
|
116
|
+
type: 'BasicTrack',
|
|
117
|
+
adapter: { type: 'FromConfigAdapter', features: [] },
|
|
171
118
|
})
|
|
172
|
-
|
|
119
|
+
session.addView('LinearGenomeView', {
|
|
120
|
+
id: 'lgv',
|
|
121
|
+
offsetPx: 0,
|
|
122
|
+
bpPerPx: 1,
|
|
123
|
+
displayedRegions: [
|
|
124
|
+
{ assemblyName: 'volMyt1', refName: 'ctgA', start: 0, end: 100 },
|
|
125
|
+
{
|
|
126
|
+
assemblyName: 'volMyt1',
|
|
127
|
+
refName: 'ctgB',
|
|
128
|
+
start: 1000,
|
|
129
|
+
end: 2000,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
tracks: [
|
|
133
|
+
{
|
|
134
|
+
id: 'foo',
|
|
135
|
+
type: 'BasicTrack',
|
|
136
|
+
height: 20,
|
|
137
|
+
configuration: 'testConfig',
|
|
138
|
+
displays: [
|
|
139
|
+
{
|
|
140
|
+
type: 'LinearBareDisplay',
|
|
141
|
+
configuration: 'testConfig-LinearBareDisplay',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
id: 'bar',
|
|
147
|
+
type: 'BasicTrack',
|
|
148
|
+
height: 20,
|
|
149
|
+
configuration: 'testConfig2',
|
|
150
|
+
displays: [
|
|
151
|
+
{
|
|
152
|
+
type: 'LinearBareDisplay',
|
|
153
|
+
configuration: 'testConfig2-LinearBareDisplay',
|
|
154
|
+
},
|
|
155
|
+
],
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
})
|
|
159
|
+
const model = session.views[0]
|
|
160
|
+
model.setWidth(800)
|
|
161
|
+
const { container, findByText, queryByText, findAllByTestId } = render(
|
|
162
|
+
<LinearGenomeView model={model} />,
|
|
163
|
+
)
|
|
164
|
+
await findByText('Foo Track')
|
|
165
|
+
await findByText('798bp')
|
|
166
|
+
await findAllByTestId('svgfeatures', {}, { timeout: 10000 })
|
|
167
|
+
await waitFor(() => expect(queryByText('Loading')).not.toBeInTheDocument())
|
|
168
|
+
|
|
169
|
+
expect(container.firstChild).toMatchSnapshot()
|
|
170
|
+
}, 15000)
|
|
@@ -276,8 +276,7 @@ export async function renderToSvg(model: LGV, opts: ExportSvgOptions) {
|
|
|
276
276
|
tracks.map(async track => {
|
|
277
277
|
const display = track.displays[0]
|
|
278
278
|
await when(() => (display.ready !== undefined ? display.ready : true))
|
|
279
|
-
|
|
280
|
-
return { track, result }
|
|
279
|
+
return { track, result: await display.renderSvg(opts) }
|
|
281
280
|
}),
|
|
282
281
|
)
|
|
283
282
|
|
|
@@ -1,39 +1,37 @@
|
|
|
1
|
+
import React from 'react'
|
|
1
2
|
import { makeStyles } from 'tss-react/mui'
|
|
2
3
|
import { observer } from 'mobx-react'
|
|
3
|
-
import ReactPropTypes from 'prop-types'
|
|
4
|
-
import React from 'react'
|
|
5
|
-
import { makeTicks } from '../util'
|
|
6
4
|
import { getTickDisplayStr } from '@jbrowse/core/util'
|
|
7
5
|
|
|
8
|
-
|
|
6
|
+
// locals
|
|
7
|
+
import { makeTicks } from '../util'
|
|
8
|
+
|
|
9
|
+
const useStyles = makeStyles()({
|
|
9
10
|
majorTickLabel: {
|
|
10
11
|
fontSize: '11px',
|
|
11
|
-
// fill: theme.palette.text.primary,
|
|
12
12
|
},
|
|
13
13
|
majorTick: {
|
|
14
14
|
stroke: '#555',
|
|
15
|
-
// stroke: theme.palette.text.secondary,
|
|
16
15
|
},
|
|
17
16
|
minorTick: {
|
|
18
17
|
stroke: '#999',
|
|
19
|
-
// stroke: theme.palette.text.hint,
|
|
20
18
|
},
|
|
21
|
-
})
|
|
19
|
+
})
|
|
22
20
|
|
|
23
21
|
function Ruler({
|
|
24
22
|
start,
|
|
25
23
|
end,
|
|
26
24
|
bpPerPx,
|
|
27
|
-
reversed,
|
|
28
|
-
major,
|
|
29
|
-
minor,
|
|
25
|
+
reversed = false,
|
|
26
|
+
major = true,
|
|
27
|
+
minor = true,
|
|
30
28
|
}: {
|
|
31
29
|
start: number
|
|
32
30
|
end: number
|
|
33
31
|
bpPerPx: number
|
|
34
32
|
reversed?: boolean
|
|
35
|
-
major
|
|
36
|
-
minor
|
|
33
|
+
major?: boolean
|
|
34
|
+
minor?: boolean
|
|
37
35
|
}) {
|
|
38
36
|
const { classes } = useStyles()
|
|
39
37
|
const ticks = makeTicks(start, end, bpPerPx, major, minor)
|
|
@@ -77,19 +75,4 @@ function Ruler({
|
|
|
77
75
|
)
|
|
78
76
|
}
|
|
79
77
|
|
|
80
|
-
Ruler.propTypes = {
|
|
81
|
-
start: ReactPropTypes.number.isRequired,
|
|
82
|
-
end: ReactPropTypes.number.isRequired,
|
|
83
|
-
bpPerPx: ReactPropTypes.number.isRequired,
|
|
84
|
-
reversed: ReactPropTypes.bool,
|
|
85
|
-
major: ReactPropTypes.bool,
|
|
86
|
-
minor: ReactPropTypes.bool,
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
Ruler.defaultProps = {
|
|
90
|
-
reversed: false,
|
|
91
|
-
major: true,
|
|
92
|
-
minor: true,
|
|
93
|
-
}
|
|
94
|
-
|
|
95
78
|
export default observer(Ruler)
|
|
@@ -53,6 +53,8 @@ function SearchBox({
|
|
|
53
53
|
try {
|
|
54
54
|
if (option.hasLocation()) {
|
|
55
55
|
await navToOption(option)
|
|
56
|
+
} else if (option.results?.length) {
|
|
57
|
+
model.setSearchResults(option.results, option.getLabel())
|
|
56
58
|
} else {
|
|
57
59
|
const input = option.getLabel()
|
|
58
60
|
const [ref, rest] = splitLast(input, ':')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[
|
|
3
|
+
exports[`renders one track, one region 1`] = `
|
|
4
4
|
<div
|
|
5
5
|
style="position: relative;"
|
|
6
6
|
>
|
|
@@ -511,7 +511,6 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
511
511
|
>
|
|
512
512
|
<div
|
|
513
513
|
class="css-d6gpow-linearBlocks"
|
|
514
|
-
data-testid="Blockset"
|
|
515
514
|
style="left: -800px;"
|
|
516
515
|
>
|
|
517
516
|
<div
|
|
@@ -544,7 +543,7 @@ exports[`<LinearGenomeView /> renders one track, one region 1`] = `
|
|
|
544
543
|
</div>
|
|
545
544
|
`;
|
|
546
545
|
|
|
547
|
-
exports[
|
|
546
|
+
exports[`renders two tracks, two regions 1`] = `
|
|
548
547
|
<div
|
|
549
548
|
style="position: relative;"
|
|
550
549
|
>
|
|
@@ -1308,7 +1307,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
1308
1307
|
>
|
|
1309
1308
|
<div
|
|
1310
1309
|
class="css-d6gpow-linearBlocks"
|
|
1311
|
-
data-testid="Blockset"
|
|
1312
1310
|
style="left: -800px;"
|
|
1313
1311
|
>
|
|
1314
1312
|
<div
|
|
@@ -1440,7 +1438,6 @@ exports[`<LinearGenomeView /> renders two tracks, two regions 1`] = `
|
|
|
1440
1438
|
>
|
|
1441
1439
|
<div
|
|
1442
1440
|
class="css-d6gpow-linearBlocks"
|
|
1443
|
-
data-testid="Blockset"
|
|
1444
1441
|
style="left: -800px;"
|
|
1445
1442
|
>
|
|
1446
1443
|
<div
|
|
@@ -8,6 +8,7 @@ export default (pluginManager: PluginManager) => {
|
|
|
8
8
|
() =>
|
|
9
9
|
new ViewType({
|
|
10
10
|
name: 'LinearGenomeView',
|
|
11
|
+
displayName: 'Linear genome view',
|
|
11
12
|
stateModel: stateModelFactory(pluginManager),
|
|
12
13
|
ReactComponent: lazy(() => import('./components/LinearGenomeView')),
|
|
13
14
|
}),
|
package/src/index.ts
CHANGED
|
@@ -5,10 +5,12 @@ import { AbstractSessionModel, isAbstractMenuManager } from '@jbrowse/core/util'
|
|
|
5
5
|
// icons
|
|
6
6
|
import LineStyleIcon from '@mui/icons-material/LineStyle'
|
|
7
7
|
|
|
8
|
+
// locals
|
|
8
9
|
import {
|
|
9
10
|
BaseLinearDisplay,
|
|
10
11
|
BaseLinearDisplayComponent,
|
|
11
12
|
BlockModel,
|
|
13
|
+
BlockMsg,
|
|
12
14
|
baseLinearDisplayConfigSchema,
|
|
13
15
|
} from './BaseLinearDisplay'
|
|
14
16
|
import LinearBareDisplayF, {
|
|
@@ -76,6 +78,7 @@ export {
|
|
|
76
78
|
BaseLinearDisplay,
|
|
77
79
|
RefNameAutocomplete,
|
|
78
80
|
SearchBox,
|
|
81
|
+
BlockMsg,
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
export type { LinearGenomeViewModel, LinearGenomeViewStateModel, BlockModel }
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TooLargeMessage.js","sourceRoot":"","sources":["../../../src/BaseLinearDisplay/models/TooLargeMessage.tsx"],"names":[],"mappings":";;;;;AAAA,kDAAyB;AACzB,sEAA6C;AAG7C,SAAS,eAAe,CAAC,EACvB,KAAK,GAQN;IACC,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,8BAAC,kBAAQ,IACP,QAAQ,EAAC,SAAS,EAClB,MAAM,EAAE,GAAG,EAAE;YACX,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;gBAC/B,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;aAClC;iBAAM;gBACL,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;gBAClD,KAAK,CAAC,MAAM,EAAE,CAAA;aACf;QACH,CAAC,EACD,UAAU,EAAC,YAAY,EACvB,OAAO,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE;2DACd,GACrD,CACH,CAAA;AACH,CAAC;AAED,kBAAe,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const baseLinearDisplayConfigSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseLinearDisplayConfigSchema.js","sourceRoot":"","sources":["../../../src/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.ts"],"names":[],"mappings":";;;AAAA,+DAAiE;AAEjE;;;;;GAKG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAE3D,QAAA,6BAA6B,GAAG,IAAA,mCAAmB,EAC9D,mBAAmB,EACnB;IACE;;OAEG;IACH,uBAAuB,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qGAAqG;QACvG,YAAY,EAAE,GAAG;KAClB;IACD;;OAEG;IACH,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,OAAS;QACvB,WAAW,EACT,4FAA4F;KAC/F;CACF,EACD;IACE;;OAEG;IACH,kBAAkB,EAAE,WAAW;CAChC,CACF,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TooLargeMessage.js","sourceRoot":"","sources":["../../../src/BaseLinearDisplay/models/TooLargeMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,QAAQ,MAAM,wBAAwB,CAAA;AAG7C,SAAS,eAAe,CAAC,EACvB,KAAK,GAQN;IACC,MAAM,EAAE,oBAAoB,EAAE,GAAG,KAAK,CAAA;IACtC,OAAO,CACL,oBAAC,QAAQ,IACP,QAAQ,EAAC,SAAS,EAClB,MAAM,EAAE,GAAG,EAAE;YACX,IAAI,CAAC,KAAK,CAAC,oBAAoB,EAAE;gBAC/B,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAA;aAClC;iBAAM;gBACL,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,oBAAoB,CAAC,CAAA;gBAClD,KAAK,CAAC,MAAM,EAAE,CAAA;aACf;QACH,CAAC,EACD,UAAU,EAAC,YAAY,EACvB,OAAO,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE;2DACd,GACrD,CACH,CAAA;AACH,CAAC;AAED,eAAe,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const baseLinearDisplayConfigSchema: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseLinearDisplayConfigSchema.js","sourceRoot":"","sources":["../../../src/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;;;;GAKG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,CAAC,MAAM,6BAA6B,GAAG,mBAAmB,CAC9D,mBAAmB,EACnB;IACE;;OAEG;IACH,uBAAuB,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,qGAAqG;QACvG,YAAY,EAAE,GAAG;KAClB;IACD;;OAEG;IACH,cAAc,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,OAAS;QACvB,WAAW,EACT,4FAA4F;KAC/F;CACF,EACD;IACE;;OAEG;IACH,kBAAkB,EAAE,WAAW;CAChC,CACF,CAAA"}
|