@jbrowse/plugin-circular-view 2.1.7 → 2.2.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/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +26 -0
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js +199 -159
- package/dist/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -1
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js +13 -1
- package/dist/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -1
- package/dist/CircularView/components/ImportForm.js +1 -1
- package/dist/CircularView/components/ImportForm.js.map +1 -1
- package/dist/CircularView/models/CircularView.d.ts +157 -10
- package/dist/CircularView/models/CircularView.js +176 -10
- package/dist/CircularView/models/CircularView.js.map +1 -1
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.d.ts +26 -0
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js +199 -159
- package/esm/BaseChordDisplay/models/BaseChordDisplayModel.js.map +1 -1
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js +13 -1
- package/esm/BaseChordDisplay/models/baseChordDisplayConfig.js.map +1 -1
- package/esm/CircularView/components/ImportForm.js +1 -1
- package/esm/CircularView/components/ImportForm.js.map +1 -1
- package/esm/CircularView/models/CircularView.d.ts +157 -10
- package/esm/CircularView/models/CircularView.js +176 -9
- package/esm/CircularView/models/CircularView.js.map +1 -1
- package/package.json +2 -2
- package/src/BaseChordDisplay/models/BaseChordDisplayModel.ts +236 -194
- package/src/BaseChordDisplay/models/baseChordDisplayConfig.ts +14 -1
- package/src/CircularView/components/ImportForm.tsx +1 -1
- package/src/CircularView/models/CircularView.ts +180 -11
- package/src/CircularView/models/__snapshots__/slices.test.js.snap +12 -12
|
@@ -2,9 +2,14 @@ import PluginManager from '@jbrowse/core/PluginManager';
|
|
|
2
2
|
import { SnapshotOrInstance, Instance } from 'mobx-state-tree';
|
|
3
3
|
import { Region } from '@jbrowse/core/util/types/mst';
|
|
4
4
|
import { AnyConfigurationModel } from '@jbrowse/core/configuration';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel CircularView
|
|
7
|
+
* extends `BaseViewModel`
|
|
8
|
+
*/
|
|
9
|
+
declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
6
10
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
7
11
|
displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
12
|
+
minimized: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
8
13
|
} & {
|
|
9
14
|
type: import("mobx-state-tree").ISimpleType<"CircularView">;
|
|
10
15
|
offsetRadians: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
@@ -15,12 +20,6 @@ export default function CircularView(pluginManager: PluginManager): import("mobx
|
|
|
15
20
|
lockedFitToWindow: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
16
21
|
disableImportForm: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
17
22
|
height: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<number>, [undefined]>;
|
|
18
|
-
minimumRadiusPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
19
|
-
spacingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
20
|
-
paddingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
21
|
-
lockedPaddingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
22
|
-
minVisibleWidth: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
23
|
-
minimumBlockWidth: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
24
23
|
displayedRegions: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IModelType<{
|
|
25
24
|
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
26
25
|
start: import("mobx-state-tree").ISimpleType<number>;
|
|
@@ -33,6 +32,12 @@ export default function CircularView(pluginManager: PluginManager): import("mobx
|
|
|
33
32
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
34
33
|
scrollX: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
35
34
|
scrollY: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
35
|
+
minimumRadiusPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
36
|
+
spacingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
37
|
+
paddingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
38
|
+
lockedPaddingPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
39
|
+
minVisibleWidth: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
40
|
+
minimumBlockWidth: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
36
41
|
trackSelectorType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
37
42
|
}, {
|
|
38
43
|
width: number;
|
|
@@ -40,59 +45,201 @@ export default function CircularView(pluginManager: PluginManager): import("mobx
|
|
|
40
45
|
menuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
41
46
|
} & {
|
|
42
47
|
setDisplayName(name: string): void;
|
|
43
|
-
setWidth(newWidth: number): void;
|
|
48
|
+
setWidth(newWidth: number): void; /**
|
|
49
|
+
* #property
|
|
50
|
+
*/
|
|
51
|
+
setMinimized(flag: boolean): void; /**
|
|
52
|
+
* #property
|
|
53
|
+
*/
|
|
44
54
|
} & {
|
|
45
55
|
width: number;
|
|
46
56
|
} & {
|
|
57
|
+
/**
|
|
58
|
+
* #getter
|
|
59
|
+
*/
|
|
47
60
|
readonly staticSlices: import("./slices").Slice[];
|
|
61
|
+
/**
|
|
62
|
+
* #getter
|
|
63
|
+
*/
|
|
48
64
|
readonly visibleSection: {
|
|
49
65
|
rho: [number, number];
|
|
50
66
|
theta: [number, number];
|
|
51
67
|
};
|
|
68
|
+
/**
|
|
69
|
+
* #getter
|
|
70
|
+
*/
|
|
52
71
|
readonly circumferencePx: number;
|
|
72
|
+
/**
|
|
73
|
+
* #getter
|
|
74
|
+
*/
|
|
53
75
|
readonly radiusPx: number;
|
|
76
|
+
/**
|
|
77
|
+
* #getter
|
|
78
|
+
*/
|
|
54
79
|
readonly bpPerRadian: number;
|
|
80
|
+
/**
|
|
81
|
+
* #getter
|
|
82
|
+
*/
|
|
55
83
|
readonly pxPerRadian: number;
|
|
84
|
+
/**
|
|
85
|
+
* #getter
|
|
86
|
+
*/
|
|
56
87
|
readonly centerXY: [number, number];
|
|
88
|
+
/**
|
|
89
|
+
* #getter
|
|
90
|
+
*/
|
|
57
91
|
readonly totalBp: number;
|
|
92
|
+
/**
|
|
93
|
+
* #getter
|
|
94
|
+
*/
|
|
58
95
|
readonly maximumRadiusPx: number;
|
|
96
|
+
/**
|
|
97
|
+
* #getter
|
|
98
|
+
*/
|
|
59
99
|
readonly maxBpPerPx: number;
|
|
100
|
+
/**
|
|
101
|
+
* #getter
|
|
102
|
+
*/
|
|
60
103
|
readonly minBpPerPx: number;
|
|
104
|
+
/**
|
|
105
|
+
* #getter
|
|
106
|
+
*/
|
|
61
107
|
readonly atMaxBpPerPx: boolean;
|
|
108
|
+
/**
|
|
109
|
+
* #getter
|
|
110
|
+
*/
|
|
62
111
|
readonly atMinBpPerPx: boolean;
|
|
112
|
+
/**
|
|
113
|
+
* #getter
|
|
114
|
+
*/
|
|
63
115
|
readonly tooSmallToLock: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* #getter
|
|
118
|
+
*/
|
|
64
119
|
readonly figureDimensions: [number, number];
|
|
120
|
+
/**
|
|
121
|
+
* #getter
|
|
122
|
+
*/
|
|
65
123
|
readonly figureWidth: number;
|
|
124
|
+
/**
|
|
125
|
+
* #getter
|
|
126
|
+
*/
|
|
66
127
|
readonly figureHeight: number;
|
|
128
|
+
/**
|
|
129
|
+
* #getter
|
|
130
|
+
* this is displayedRegions, post-processed to
|
|
131
|
+
* elide regions that are too small to see reasonably
|
|
132
|
+
*/
|
|
67
133
|
readonly elidedRegions: any[];
|
|
134
|
+
/**
|
|
135
|
+
* #getter
|
|
136
|
+
*/
|
|
68
137
|
readonly assemblyNames: string[];
|
|
138
|
+
/**
|
|
139
|
+
* #getter
|
|
140
|
+
*/
|
|
69
141
|
readonly initialized: boolean;
|
|
70
142
|
} & {
|
|
143
|
+
/**
|
|
144
|
+
* #getter
|
|
145
|
+
*/
|
|
71
146
|
readonly visibleStaticSlices: import("./slices").Slice[];
|
|
72
147
|
} & {
|
|
73
148
|
error: unknown;
|
|
74
149
|
} & {
|
|
150
|
+
/**
|
|
151
|
+
* #action
|
|
152
|
+
*/
|
|
75
153
|
setWidth(newWidth: number): number;
|
|
154
|
+
/**
|
|
155
|
+
* #action
|
|
156
|
+
*/
|
|
76
157
|
setHeight(newHeight: number): number;
|
|
158
|
+
/**
|
|
159
|
+
* #action
|
|
160
|
+
*/
|
|
77
161
|
resizeHeight(distance: number): number;
|
|
162
|
+
/**
|
|
163
|
+
* #action
|
|
164
|
+
*/
|
|
78
165
|
resizeWidth(distance: number): number;
|
|
166
|
+
/**
|
|
167
|
+
* #action
|
|
168
|
+
*/
|
|
79
169
|
rotateClockwiseButton(): void;
|
|
170
|
+
/**
|
|
171
|
+
* #action
|
|
172
|
+
*/
|
|
80
173
|
rotateCounterClockwiseButton(): void;
|
|
174
|
+
/**
|
|
175
|
+
* #action
|
|
176
|
+
*/
|
|
81
177
|
rotateClockwise(distance?: number): void;
|
|
178
|
+
/**
|
|
179
|
+
* #action
|
|
180
|
+
*/
|
|
82
181
|
rotateCounterClockwise(distance?: number): void;
|
|
182
|
+
/**
|
|
183
|
+
* #action
|
|
184
|
+
*/
|
|
83
185
|
zoomInButton(): void;
|
|
186
|
+
/**
|
|
187
|
+
* #action
|
|
188
|
+
*/
|
|
84
189
|
zoomOutButton(): void;
|
|
190
|
+
/**
|
|
191
|
+
* #action
|
|
192
|
+
*/
|
|
85
193
|
setBpPerPx(newVal: number): void;
|
|
194
|
+
/**
|
|
195
|
+
* #action
|
|
196
|
+
*/
|
|
86
197
|
setModelViewWhenAdjust(secondCondition: boolean): void;
|
|
198
|
+
/**
|
|
199
|
+
* #action
|
|
200
|
+
*/
|
|
87
201
|
closeView(): void;
|
|
202
|
+
/**
|
|
203
|
+
* #action
|
|
204
|
+
*/
|
|
88
205
|
setDisplayedRegions(regions: SnapshotOrInstance<typeof Region>[]): void;
|
|
206
|
+
/**
|
|
207
|
+
* #action
|
|
208
|
+
*/
|
|
89
209
|
activateTrackSelector(): import("@jbrowse/core/util").Widget;
|
|
210
|
+
/**
|
|
211
|
+
* #action
|
|
212
|
+
*/
|
|
90
213
|
toggleTrack(trackId: string): void;
|
|
214
|
+
/**
|
|
215
|
+
* #action
|
|
216
|
+
*/
|
|
91
217
|
setError(error: unknown): void;
|
|
218
|
+
/**
|
|
219
|
+
* #action
|
|
220
|
+
*/
|
|
92
221
|
showTrack(trackId: string, initialSnapshot?: {}): void;
|
|
222
|
+
/**
|
|
223
|
+
* #action
|
|
224
|
+
*/
|
|
93
225
|
addTrackConf(configuration: AnyConfigurationModel, initialSnapshot?: {}): void;
|
|
226
|
+
/**
|
|
227
|
+
* #action
|
|
228
|
+
*/
|
|
94
229
|
hideTrack(trackId: string): number;
|
|
230
|
+
/**
|
|
231
|
+
* #action
|
|
232
|
+
*/
|
|
95
233
|
toggleFitToWindowLock(): boolean;
|
|
96
234
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
97
|
-
export
|
|
98
|
-
export
|
|
235
|
+
export type CircularViewStateModel = ReturnType<typeof stateModelFactory>;
|
|
236
|
+
export type CircularViewModel = Instance<CircularViewStateModel>;
|
|
237
|
+
/**
|
|
238
|
+
PLANS
|
|
239
|
+
|
|
240
|
+
- tracks
|
|
241
|
+
- ruler tick marks
|
|
242
|
+
- set viewport scroll from state snapshot
|
|
243
|
+
|
|
244
|
+
*/
|
|
245
|
+
export default stateModelFactory;
|
|
@@ -6,39 +6,86 @@ import { getSession, clamp, isSessionModelWithWidgets, } from '@jbrowse/core/uti
|
|
|
6
6
|
import { BaseViewModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
7
7
|
import { calculateStaticSlices, sliceIsVisible } from './slices';
|
|
8
8
|
import { viewportVisibleSection } from './viewportVisibleRegion';
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel CircularView
|
|
11
|
+
* extends `BaseViewModel`
|
|
12
|
+
*/
|
|
13
|
+
function stateModelFactory(pluginManager) {
|
|
10
14
|
const minHeight = 40;
|
|
11
15
|
const minWidth = 100;
|
|
12
16
|
const defaultHeight = 400;
|
|
13
17
|
return types.compose(BaseViewModel, types
|
|
14
18
|
.model('CircularView', {
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
15
22
|
type: types.literal('CircularView'),
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
* similar to offsetPx in linear genome view
|
|
26
|
+
*/
|
|
16
27
|
offsetRadians: -Math.PI / 2,
|
|
28
|
+
/**
|
|
29
|
+
* #property
|
|
30
|
+
*/
|
|
17
31
|
bpPerPx: 2000000,
|
|
32
|
+
/**
|
|
33
|
+
* #property
|
|
34
|
+
*/
|
|
18
35
|
tracks: types.array(pluginManager.pluggableMstType('track', 'stateModel')),
|
|
36
|
+
/**
|
|
37
|
+
* #property
|
|
38
|
+
*/
|
|
19
39
|
hideVerticalResizeHandle: false,
|
|
40
|
+
/**
|
|
41
|
+
* #property
|
|
42
|
+
*/
|
|
20
43
|
hideTrackSelectorButton: false,
|
|
44
|
+
/**
|
|
45
|
+
* #property
|
|
46
|
+
*/
|
|
21
47
|
lockedFitToWindow: true,
|
|
48
|
+
/**
|
|
49
|
+
* #property
|
|
50
|
+
*/
|
|
22
51
|
disableImportForm: false,
|
|
52
|
+
/**
|
|
53
|
+
* #property
|
|
54
|
+
*/
|
|
23
55
|
height: types.optional(types.refinement('trackHeight', types.number, n => n >= minHeight), defaultHeight),
|
|
56
|
+
/**
|
|
57
|
+
* #property
|
|
58
|
+
*/
|
|
59
|
+
displayedRegions: types.array(Region),
|
|
60
|
+
/**
|
|
61
|
+
* #property
|
|
62
|
+
*/
|
|
63
|
+
scrollX: 0,
|
|
64
|
+
/**
|
|
65
|
+
* #property
|
|
66
|
+
*/
|
|
67
|
+
scrollY: 0,
|
|
24
68
|
minimumRadiusPx: 25,
|
|
25
69
|
spacingPx: 10,
|
|
26
70
|
paddingPx: 80,
|
|
27
71
|
lockedPaddingPx: 100,
|
|
28
72
|
minVisibleWidth: 6,
|
|
29
73
|
minimumBlockWidth: 20,
|
|
30
|
-
displayedRegions: types.array(Region),
|
|
31
|
-
scrollX: 0,
|
|
32
|
-
scrollY: 0,
|
|
33
74
|
trackSelectorType: 'hierarchical',
|
|
34
75
|
})
|
|
35
76
|
.volatile(() => ({
|
|
36
77
|
width: 0,
|
|
37
78
|
}))
|
|
38
79
|
.views(self => ({
|
|
80
|
+
/**
|
|
81
|
+
* #getter
|
|
82
|
+
*/
|
|
39
83
|
get staticSlices() {
|
|
40
84
|
return calculateStaticSlices(self);
|
|
41
85
|
},
|
|
86
|
+
/**
|
|
87
|
+
* #getter
|
|
88
|
+
*/
|
|
42
89
|
get visibleSection() {
|
|
43
90
|
return viewportVisibleSection([
|
|
44
91
|
self.scrollX,
|
|
@@ -47,6 +94,9 @@ export default function CircularView(pluginManager) {
|
|
|
47
94
|
self.scrollY + self.height,
|
|
48
95
|
], this.centerXY, this.radiusPx);
|
|
49
96
|
},
|
|
97
|
+
/**
|
|
98
|
+
* #getter
|
|
99
|
+
*/
|
|
50
100
|
get circumferencePx() {
|
|
51
101
|
let elidedBp = 0;
|
|
52
102
|
for (const r of this.elidedRegions) {
|
|
@@ -54,21 +104,36 @@ export default function CircularView(pluginManager) {
|
|
|
54
104
|
}
|
|
55
105
|
return (elidedBp / self.bpPerPx + self.spacingPx * this.elidedRegions.length);
|
|
56
106
|
},
|
|
107
|
+
/**
|
|
108
|
+
* #getter
|
|
109
|
+
*/
|
|
57
110
|
get radiusPx() {
|
|
58
111
|
return this.circumferencePx / (2 * Math.PI);
|
|
59
112
|
},
|
|
113
|
+
/**
|
|
114
|
+
* #getter
|
|
115
|
+
*/
|
|
60
116
|
get bpPerRadian() {
|
|
61
117
|
return self.bpPerPx * this.radiusPx;
|
|
62
118
|
},
|
|
119
|
+
/**
|
|
120
|
+
* #getter
|
|
121
|
+
*/
|
|
63
122
|
get pxPerRadian() {
|
|
64
123
|
return this.radiusPx;
|
|
65
124
|
},
|
|
125
|
+
/**
|
|
126
|
+
* #getter
|
|
127
|
+
*/
|
|
66
128
|
get centerXY() {
|
|
67
129
|
return [
|
|
68
130
|
this.radiusPx + self.paddingPx,
|
|
69
131
|
this.radiusPx + self.paddingPx,
|
|
70
132
|
];
|
|
71
133
|
},
|
|
134
|
+
/**
|
|
135
|
+
* #getter
|
|
136
|
+
*/
|
|
72
137
|
get totalBp() {
|
|
73
138
|
let total = 0;
|
|
74
139
|
for (const region of self.displayedRegions) {
|
|
@@ -76,43 +141,73 @@ export default function CircularView(pluginManager) {
|
|
|
76
141
|
}
|
|
77
142
|
return total;
|
|
78
143
|
},
|
|
144
|
+
/**
|
|
145
|
+
* #getter
|
|
146
|
+
*/
|
|
79
147
|
get maximumRadiusPx() {
|
|
80
148
|
return self.lockedFitToWindow
|
|
81
149
|
? Math.min(self.width, self.height) / 2 - self.lockedPaddingPx
|
|
82
150
|
: 1000000;
|
|
83
151
|
},
|
|
152
|
+
/**
|
|
153
|
+
* #getter
|
|
154
|
+
*/
|
|
84
155
|
get maxBpPerPx() {
|
|
85
156
|
const minCircumferencePx = 2 * Math.PI * self.minimumRadiusPx;
|
|
86
157
|
return this.totalBp / minCircumferencePx;
|
|
87
158
|
},
|
|
159
|
+
/**
|
|
160
|
+
* #getter
|
|
161
|
+
*/
|
|
88
162
|
get minBpPerPx() {
|
|
89
163
|
// min depends on window dimensions, clamp between old min(0.01) and max
|
|
90
164
|
const maxCircumferencePx = 2 * Math.PI * this.maximumRadiusPx;
|
|
91
165
|
return clamp(this.totalBp / maxCircumferencePx, 0.0000000001, this.maxBpPerPx);
|
|
92
166
|
},
|
|
167
|
+
/**
|
|
168
|
+
* #getter
|
|
169
|
+
*/
|
|
93
170
|
get atMaxBpPerPx() {
|
|
94
171
|
return self.bpPerPx >= this.maxBpPerPx;
|
|
95
172
|
},
|
|
173
|
+
/**
|
|
174
|
+
* #getter
|
|
175
|
+
*/
|
|
96
176
|
get atMinBpPerPx() {
|
|
97
177
|
return self.bpPerPx <= this.minBpPerPx;
|
|
98
178
|
},
|
|
179
|
+
/**
|
|
180
|
+
* #getter
|
|
181
|
+
*/
|
|
99
182
|
get tooSmallToLock() {
|
|
100
183
|
return this.minBpPerPx <= 0.0000000001;
|
|
101
184
|
},
|
|
185
|
+
/**
|
|
186
|
+
* #getter
|
|
187
|
+
*/
|
|
102
188
|
get figureDimensions() {
|
|
103
189
|
return [
|
|
104
190
|
this.radiusPx * 2 + 2 * self.paddingPx,
|
|
105
191
|
this.radiusPx * 2 + 2 * self.paddingPx,
|
|
106
192
|
];
|
|
107
193
|
},
|
|
194
|
+
/**
|
|
195
|
+
* #getter
|
|
196
|
+
*/
|
|
108
197
|
get figureWidth() {
|
|
109
198
|
return this.figureDimensions[0];
|
|
110
199
|
},
|
|
200
|
+
/**
|
|
201
|
+
* #getter
|
|
202
|
+
*/
|
|
111
203
|
get figureHeight() {
|
|
112
204
|
return this.figureDimensions[1];
|
|
113
205
|
},
|
|
114
|
-
|
|
115
|
-
|
|
206
|
+
/**
|
|
207
|
+
* #getter
|
|
208
|
+
* this is displayedRegions, post-processed to
|
|
209
|
+
* elide regions that are too small to see reasonably
|
|
210
|
+
*/
|
|
116
211
|
get elidedRegions() {
|
|
117
212
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
213
|
const visible = [];
|
|
@@ -149,6 +244,9 @@ export default function CircularView(pluginManager) {
|
|
|
149
244
|
}
|
|
150
245
|
return visible;
|
|
151
246
|
},
|
|
247
|
+
/**
|
|
248
|
+
* #getter
|
|
249
|
+
*/
|
|
152
250
|
get assemblyNames() {
|
|
153
251
|
const assemblyNames = [];
|
|
154
252
|
self.displayedRegions.forEach(displayedRegion => {
|
|
@@ -158,12 +256,18 @@ export default function CircularView(pluginManager) {
|
|
|
158
256
|
});
|
|
159
257
|
return assemblyNames;
|
|
160
258
|
},
|
|
259
|
+
/**
|
|
260
|
+
* #getter
|
|
261
|
+
*/
|
|
161
262
|
get initialized() {
|
|
162
263
|
const { assemblyManager } = getSession(self);
|
|
163
264
|
return this.assemblyNames.every(a => { var _a; return (_a = assemblyManager.get(a)) === null || _a === void 0 ? void 0 : _a.initialized; });
|
|
164
265
|
},
|
|
165
266
|
}))
|
|
166
267
|
.views(self => ({
|
|
268
|
+
/**
|
|
269
|
+
* #getter
|
|
270
|
+
*/
|
|
167
271
|
get visibleStaticSlices() {
|
|
168
272
|
return self.staticSlices.filter(s => sliceIsVisible(self, s));
|
|
169
273
|
},
|
|
@@ -172,57 +276,98 @@ export default function CircularView(pluginManager) {
|
|
|
172
276
|
error: undefined,
|
|
173
277
|
}))
|
|
174
278
|
.actions(self => ({
|
|
175
|
-
|
|
279
|
+
/**
|
|
280
|
+
* #action
|
|
281
|
+
*/
|
|
176
282
|
setWidth(newWidth) {
|
|
177
283
|
self.width = Math.max(newWidth, minWidth);
|
|
178
284
|
return self.width;
|
|
179
285
|
},
|
|
286
|
+
/**
|
|
287
|
+
* #action
|
|
288
|
+
*/
|
|
180
289
|
setHeight(newHeight) {
|
|
181
290
|
self.height = Math.max(newHeight, minHeight);
|
|
182
291
|
return self.height;
|
|
183
292
|
},
|
|
293
|
+
/**
|
|
294
|
+
* #action
|
|
295
|
+
*/
|
|
184
296
|
resizeHeight(distance) {
|
|
185
297
|
const oldHeight = self.height;
|
|
186
298
|
const newHeight = this.setHeight(self.height + distance);
|
|
187
299
|
this.setModelViewWhenAdjust(!self.tooSmallToLock);
|
|
188
300
|
return newHeight - oldHeight;
|
|
189
301
|
},
|
|
302
|
+
/**
|
|
303
|
+
* #action
|
|
304
|
+
*/
|
|
190
305
|
resizeWidth(distance) {
|
|
191
306
|
const oldWidth = self.width;
|
|
192
307
|
const newWidth = this.setWidth(self.width + distance);
|
|
193
308
|
this.setModelViewWhenAdjust(!self.tooSmallToLock);
|
|
194
309
|
return newWidth - oldWidth;
|
|
195
310
|
},
|
|
311
|
+
/**
|
|
312
|
+
* #action
|
|
313
|
+
*/
|
|
196
314
|
rotateClockwiseButton() {
|
|
197
315
|
this.rotateClockwise(Math.PI / 6);
|
|
198
316
|
},
|
|
317
|
+
/**
|
|
318
|
+
* #action
|
|
319
|
+
*/
|
|
199
320
|
rotateCounterClockwiseButton() {
|
|
200
321
|
this.rotateCounterClockwise(Math.PI / 6);
|
|
201
322
|
},
|
|
323
|
+
/**
|
|
324
|
+
* #action
|
|
325
|
+
*/
|
|
202
326
|
rotateClockwise(distance = 0.17) {
|
|
203
327
|
self.offsetRadians += distance;
|
|
204
328
|
},
|
|
329
|
+
/**
|
|
330
|
+
* #action
|
|
331
|
+
*/
|
|
205
332
|
rotateCounterClockwise(distance = 0.17) {
|
|
206
333
|
self.offsetRadians -= distance;
|
|
207
334
|
},
|
|
335
|
+
/**
|
|
336
|
+
* #action
|
|
337
|
+
*/
|
|
208
338
|
zoomInButton() {
|
|
209
339
|
this.setBpPerPx(self.bpPerPx / 1.4);
|
|
210
340
|
},
|
|
341
|
+
/**
|
|
342
|
+
* #action
|
|
343
|
+
*/
|
|
211
344
|
zoomOutButton() {
|
|
212
345
|
this.setBpPerPx(self.bpPerPx * 1.4);
|
|
213
346
|
},
|
|
347
|
+
/**
|
|
348
|
+
* #action
|
|
349
|
+
*/
|
|
214
350
|
setBpPerPx(newVal) {
|
|
215
351
|
self.bpPerPx = clamp(newVal, self.minBpPerPx, self.maxBpPerPx);
|
|
216
352
|
},
|
|
353
|
+
/**
|
|
354
|
+
* #action
|
|
355
|
+
*/
|
|
217
356
|
setModelViewWhenAdjust(secondCondition) {
|
|
218
357
|
if (self.lockedFitToWindow && secondCondition) {
|
|
219
358
|
this.setBpPerPx(self.minBpPerPx);
|
|
220
359
|
}
|
|
221
360
|
},
|
|
361
|
+
/**
|
|
362
|
+
* #action
|
|
363
|
+
*/
|
|
222
364
|
closeView() {
|
|
223
365
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
224
366
|
getParent(self, 2).removeView(self);
|
|
225
367
|
},
|
|
368
|
+
/**
|
|
369
|
+
* #action
|
|
370
|
+
*/
|
|
226
371
|
setDisplayedRegions(regions) {
|
|
227
372
|
const previouslyEmpty = self.displayedRegions.length === 0;
|
|
228
373
|
self.displayedRegions = cast(regions);
|
|
@@ -233,6 +378,9 @@ export default function CircularView(pluginManager) {
|
|
|
233
378
|
this.setBpPerPx(self.bpPerPx);
|
|
234
379
|
}
|
|
235
380
|
},
|
|
381
|
+
/**
|
|
382
|
+
* #action
|
|
383
|
+
*/
|
|
236
384
|
activateTrackSelector() {
|
|
237
385
|
if (self.trackSelectorType === 'hierarchical') {
|
|
238
386
|
const session = getSession(self);
|
|
@@ -244,6 +392,9 @@ export default function CircularView(pluginManager) {
|
|
|
244
392
|
}
|
|
245
393
|
throw new Error(`invalid track selector type ${self.trackSelectorType}`);
|
|
246
394
|
},
|
|
395
|
+
/**
|
|
396
|
+
* #action
|
|
397
|
+
*/
|
|
247
398
|
toggleTrack(trackId) {
|
|
248
399
|
// if we have any tracks with that configuration, turn them off
|
|
249
400
|
const hiddenCount = this.hideTrack(trackId);
|
|
@@ -252,10 +403,16 @@ export default function CircularView(pluginManager) {
|
|
|
252
403
|
this.showTrack(trackId);
|
|
253
404
|
}
|
|
254
405
|
},
|
|
406
|
+
/**
|
|
407
|
+
* #action
|
|
408
|
+
*/
|
|
255
409
|
setError(error) {
|
|
256
410
|
console.error(error);
|
|
257
411
|
self.error = error;
|
|
258
412
|
},
|
|
413
|
+
/**
|
|
414
|
+
* #action
|
|
415
|
+
*/
|
|
259
416
|
showTrack(trackId, initialSnapshot = {}) {
|
|
260
417
|
const schema = pluginManager.pluggableConfigSchemaType('track');
|
|
261
418
|
const conf = resolveIdentifier(schema, getRoot(self), trackId);
|
|
@@ -274,6 +431,9 @@ export default function CircularView(pluginManager) {
|
|
|
274
431
|
});
|
|
275
432
|
self.tracks.push(track);
|
|
276
433
|
},
|
|
434
|
+
/**
|
|
435
|
+
* #action
|
|
436
|
+
*/
|
|
277
437
|
addTrackConf(configuration, initialSnapshot = {}) {
|
|
278
438
|
const { type } = configuration;
|
|
279
439
|
const name = readConfObject(configuration, 'name');
|
|
@@ -293,6 +453,9 @@ export default function CircularView(pluginManager) {
|
|
|
293
453
|
});
|
|
294
454
|
self.tracks.push(track);
|
|
295
455
|
},
|
|
456
|
+
/**
|
|
457
|
+
* #action
|
|
458
|
+
*/
|
|
296
459
|
hideTrack(trackId) {
|
|
297
460
|
const schema = pluginManager.pluggableConfigSchemaType('track');
|
|
298
461
|
const conf = resolveIdentifier(schema, getRoot(self), trackId);
|
|
@@ -300,15 +463,18 @@ export default function CircularView(pluginManager) {
|
|
|
300
463
|
transaction(() => t.forEach(t => self.tracks.remove(t)));
|
|
301
464
|
return t.length;
|
|
302
465
|
},
|
|
466
|
+
/**
|
|
467
|
+
* #action
|
|
468
|
+
*/
|
|
303
469
|
toggleFitToWindowLock() {
|
|
304
|
-
self.lockedFitToWindow = !self.lockedFitToWindow;
|
|
305
470
|
// when going unlocked -> locked and circle is cut off, set to the locked minBpPerPx
|
|
471
|
+
self.lockedFitToWindow = !self.lockedFitToWindow;
|
|
306
472
|
this.setModelViewWhenAdjust(self.atMinBpPerPx);
|
|
307
473
|
return self.lockedFitToWindow;
|
|
308
474
|
},
|
|
309
475
|
})));
|
|
310
476
|
}
|
|
311
|
-
|
|
477
|
+
/**
|
|
312
478
|
PLANS
|
|
313
479
|
|
|
314
480
|
- tracks
|
|
@@ -316,4 +482,5 @@ PLANS
|
|
|
316
482
|
- set viewport scroll from state snapshot
|
|
317
483
|
|
|
318
484
|
*/
|
|
485
|
+
export default stateModelFactory;
|
|
319
486
|
//# sourceMappingURL=CircularView.js.map
|