@jbrowse/plugin-linear-comparative-view 2.11.2 → 2.12.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/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +1 -1
- package/dist/LGVSyntenyDisplay/components/util.js +2 -3
- package/dist/LGVSyntenyDisplay/index.js +1 -1
- package/dist/LGVSyntenyDisplay/model.d.ts +35 -36
- package/dist/LaunchLinearSyntenyView.js +1 -1
- package/dist/LinearComparativeDisplay/index.js +1 -1
- package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +34 -49
- package/dist/LinearComparativeView/index.js +1 -1
- package/dist/LinearComparativeView/model.d.ts +23 -178
- package/dist/LinearComparativeView/model.js +0 -23
- package/dist/LinearReadVsRef/LinearReadVsRef.js +1 -1
- package/dist/LinearReadVsRef/index.js +1 -1
- package/dist/LinearSyntenyDisplay/afterAttach.js +1 -2
- package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +54 -101
- package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +1 -1
- package/dist/LinearSyntenyDisplay/components/util.d.ts +10 -0
- package/dist/LinearSyntenyDisplay/components/util.js +90 -5
- package/dist/LinearSyntenyDisplay/drawSynteny.js +4 -4
- package/dist/LinearSyntenyDisplay/index.js +1 -1
- package/dist/LinearSyntenyDisplay/model.d.ts +26 -36
- package/dist/LinearSyntenyView/components/ExportSvgDialog.js +1 -1
- package/dist/LinearSyntenyView/components/Icons.js +2 -3
- package/dist/LinearSyntenyView/components/ImportForm/index.js +1 -0
- package/dist/LinearSyntenyView/components/ImportForm/util.js +4 -5
- package/dist/LinearSyntenyView/index.js +1 -1
- package/dist/LinearSyntenyView/model.d.ts +26 -943
- package/dist/LinearSyntenyView/model.js +1 -9
- package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +1 -1
- package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +1 -2
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +5 -3
- package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +2 -4
- package/dist/SyntenyFeatureDetail/index.js +1 -1
- package/dist/SyntenyTrack/index.js +1 -1
- package/dist/util.js +5 -6
- package/esm/LGVSyntenyDisplay/components/util.js +1 -1
- package/esm/LGVSyntenyDisplay/model.d.ts +35 -36
- package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +34 -49
- package/esm/LinearComparativeView/model.d.ts +23 -178
- package/esm/LinearComparativeView/model.js +1 -24
- package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +54 -101
- package/esm/LinearSyntenyDisplay/components/util.d.ts +10 -0
- package/esm/LinearSyntenyDisplay/components/util.js +84 -1
- package/esm/LinearSyntenyDisplay/model.d.ts +26 -36
- package/esm/LinearSyntenyView/components/ImportForm/index.js +1 -0
- package/esm/LinearSyntenyView/model.d.ts +26 -943
- package/esm/LinearSyntenyView/model.js +0 -8
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +5 -3
- package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +2 -4
- package/package.json +2 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { Instance, SnapshotIn } from 'mobx-state-tree';
|
|
3
2
|
import { MenuItem } from '@jbrowse/core/ui';
|
|
4
3
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
@@ -17,7 +16,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
17
16
|
type: import("mobx-state-tree").ISimpleType<"LinearComparativeView">;
|
|
18
17
|
trackSelectorType: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
19
18
|
showIntraviewLinks: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
20
|
-
linkViews: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
21
19
|
interactToggled: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
22
20
|
middleComparativeHeight: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
23
21
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
@@ -30,16 +28,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
30
28
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
31
29
|
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
32
30
|
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
33
|
-
displayedRegions: import("mobx-state-tree").
|
|
34
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
35
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
36
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
37
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
38
|
-
} & {
|
|
39
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
40
|
-
}, {
|
|
41
|
-
setRefName(newRefName: string): void;
|
|
42
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
31
|
+
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
43
32
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
44
33
|
hideHeader: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
45
34
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -62,15 +51,15 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
62
51
|
} & {
|
|
63
52
|
volatileWidth: number | undefined;
|
|
64
53
|
minimumBlockWidth: number;
|
|
65
|
-
draggingTrackId:
|
|
54
|
+
draggingTrackId: undefined | string;
|
|
66
55
|
volatileError: unknown;
|
|
67
56
|
afterDisplayedRegionsSetCallbacks: Function[];
|
|
68
57
|
scaleFactor: number;
|
|
69
58
|
trackRefs: Record<string, HTMLDivElement>;
|
|
70
59
|
coarseDynamicBlocks: import("@jbrowse/core/util/blockTypes").BaseBlock[];
|
|
71
60
|
coarseTotalBp: number;
|
|
72
|
-
leftOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset
|
|
73
|
-
rightOffset: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset
|
|
61
|
+
leftOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
|
|
62
|
+
rightOffset: undefined | import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset;
|
|
74
63
|
} & {
|
|
75
64
|
readonly trackLabelsSetting: any;
|
|
76
65
|
readonly width: number;
|
|
@@ -119,8 +108,8 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
119
108
|
removeHighlight(highlight: Required<import("@jbrowse/core/util").ParsedLocString>): void;
|
|
120
109
|
scrollTo(offsetPx: number): number;
|
|
121
110
|
zoomTo(bpPerPx: number, offset?: number, centerAtOffset?: boolean): number;
|
|
122
|
-
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset
|
|
123
|
-
setSearchResults(searchResults: import("@jbrowse/core/TextSearch/BaseResults").default[], searchQuery: string, assemblyName?: string
|
|
111
|
+
setOffsets(left?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, right?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
112
|
+
setSearchResults(searchResults: import("@jbrowse/core/TextSearch/BaseResults").default[], searchQuery: string, assemblyName?: string): void;
|
|
124
113
|
setNewView(bpPerPx: number, offsetPx: number): void;
|
|
125
114
|
horizontallyFlip(): void;
|
|
126
115
|
showTrack(trackId: string, initialSnapshot?: {}, displayInitialSnapshot?: {}): any;
|
|
@@ -133,30 +122,30 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
133
122
|
moveTrack(movingId: string, targetId: string): void;
|
|
134
123
|
closeView(): void;
|
|
135
124
|
toggleTrack(trackId: string): boolean;
|
|
136
|
-
setTrackLabels(setting: "
|
|
125
|
+
setTrackLabels(setting: "overlapping" | "offset" | "hidden"): void;
|
|
137
126
|
setShowCenterLine(b: boolean): void;
|
|
138
127
|
setDisplayedRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
139
128
|
activateTrackSelector(): import("@jbrowse/core/util").Widget;
|
|
140
|
-
getSelectedRegions(leftOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset
|
|
129
|
+
getSelectedRegions(leftOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, rightOffset?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): {
|
|
141
130
|
start: number;
|
|
142
131
|
end: number;
|
|
143
132
|
type: string;
|
|
144
|
-
regionNumber?: number
|
|
145
|
-
reversed?: boolean
|
|
133
|
+
regionNumber?: number;
|
|
134
|
+
reversed?: boolean;
|
|
146
135
|
refName: string;
|
|
147
136
|
assemblyName: string;
|
|
148
137
|
key: string;
|
|
149
138
|
offsetPx: number;
|
|
150
139
|
widthPx: number;
|
|
151
|
-
variant?: string
|
|
152
|
-
isLeftEndOfDisplayedRegion?: boolean
|
|
140
|
+
variant?: string;
|
|
141
|
+
isLeftEndOfDisplayedRegion?: boolean;
|
|
153
142
|
}[];
|
|
154
143
|
afterDisplayedRegionsSet(cb: Function): void;
|
|
155
144
|
horizontalScroll(distance: number): number;
|
|
156
145
|
center(): void;
|
|
157
146
|
showAllRegions(): void;
|
|
158
|
-
showAllRegionsInAssembly(assemblyName?: string
|
|
159
|
-
setDraggingTrackId(idx?: string
|
|
147
|
+
showAllRegionsInAssembly(assemblyName?: string): void;
|
|
148
|
+
setDraggingTrackId(idx?: string): void;
|
|
160
149
|
setScaleFactor(factor: number): void;
|
|
161
150
|
clearView(): void;
|
|
162
151
|
exportSvg(opts?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").ExportSvgOptions): Promise<void>;
|
|
@@ -181,143 +170,13 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
181
170
|
setCoarseDynamicBlocks(blocks: import("@jbrowse/core/util/blockTypes").BlockSet): void;
|
|
182
171
|
afterAttach(): void;
|
|
183
172
|
} & {
|
|
184
|
-
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset
|
|
185
|
-
navToLocString(input: string, optAssemblyName?: string
|
|
173
|
+
moveTo(start?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset, end?: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").BpOffset): void;
|
|
174
|
+
navToLocString(input: string, optAssemblyName?: string): Promise<void>;
|
|
186
175
|
navToSearchString({ input, assembly, }: {
|
|
187
176
|
input: string;
|
|
188
|
-
assembly:
|
|
189
|
-
configuration: any;
|
|
190
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
191
|
-
error: unknown;
|
|
192
|
-
loaded: boolean;
|
|
193
|
-
loadingP: Promise<void> | undefined;
|
|
194
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
195
|
-
refNameAliases: {
|
|
196
|
-
[x: string]: string | undefined;
|
|
197
|
-
} | undefined;
|
|
198
|
-
lowerCaseRefNameAliases: {
|
|
199
|
-
[x: string]: string | undefined;
|
|
200
|
-
} | undefined;
|
|
201
|
-
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
202
|
-
} & {
|
|
203
|
-
getConf(arg: string): any;
|
|
204
|
-
} & {
|
|
205
|
-
readonly initialized: boolean;
|
|
206
|
-
/**
|
|
207
|
-
* #property
|
|
208
|
-
*/
|
|
209
|
-
readonly name: string;
|
|
210
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
211
|
-
readonly aliases: string[];
|
|
212
|
-
readonly displayName: string | undefined;
|
|
213
|
-
hasName(name: string): boolean;
|
|
214
|
-
readonly allAliases: string[];
|
|
215
|
-
readonly allRefNames: string[] | undefined;
|
|
216
|
-
readonly lowerCaseRefNames: string[] | undefined;
|
|
217
|
-
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
218
|
-
readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
219
|
-
readonly refNameColors: string[];
|
|
220
|
-
} & {
|
|
221
|
-
readonly refNames: string[] | undefined;
|
|
222
|
-
} & {
|
|
223
|
-
getCanonicalRefName(refName: string): string | undefined;
|
|
224
|
-
getRefNameColor(refName: string): string | undefined;
|
|
225
|
-
isValidRefName(refName: string): boolean;
|
|
226
|
-
} & {
|
|
227
|
-
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
|
|
228
|
-
setError(e: unknown): void;
|
|
229
|
-
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
230
|
-
setRefNameAliases(aliases: {
|
|
231
|
-
[x: string]: string | undefined;
|
|
232
|
-
}, lcAliases: {
|
|
233
|
-
[x: string]: string | undefined;
|
|
234
|
-
}): void;
|
|
235
|
-
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
236
|
-
setLoadingP(p?: Promise<void> | undefined): void;
|
|
237
|
-
load(): Promise<void>;
|
|
238
|
-
loadPre(): Promise<void>;
|
|
239
|
-
} & {
|
|
240
|
-
getAdapterMapEntry(adapterConf: {
|
|
241
|
-
[x: string]: unknown;
|
|
242
|
-
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
243
|
-
getRefNameMapForAdapter(adapterConf: {
|
|
244
|
-
[x: string]: unknown;
|
|
245
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
246
|
-
[x: string]: string | undefined;
|
|
247
|
-
}>;
|
|
248
|
-
getReverseRefNameMapForAdapter(adapterConf: {
|
|
249
|
-
[x: string]: unknown;
|
|
250
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
251
|
-
[x: string]: string | undefined;
|
|
252
|
-
}>;
|
|
253
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
254
|
-
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
255
|
-
}, {
|
|
256
|
-
error: unknown;
|
|
257
|
-
loaded: boolean;
|
|
258
|
-
loadingP: Promise<void> | undefined;
|
|
259
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
260
|
-
refNameAliases: {
|
|
261
|
-
[x: string]: string | undefined;
|
|
262
|
-
} | undefined;
|
|
263
|
-
lowerCaseRefNameAliases: {
|
|
264
|
-
[x: string]: string | undefined;
|
|
265
|
-
} | undefined;
|
|
266
|
-
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
267
|
-
} & {
|
|
268
|
-
getConf(arg: string): any;
|
|
269
|
-
} & {
|
|
270
|
-
readonly initialized: boolean;
|
|
271
|
-
/**
|
|
272
|
-
* #property
|
|
273
|
-
*/
|
|
274
|
-
readonly name: string;
|
|
275
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
276
|
-
readonly aliases: string[];
|
|
277
|
-
readonly displayName: string | undefined;
|
|
278
|
-
hasName(name: string): boolean;
|
|
279
|
-
readonly allAliases: string[];
|
|
280
|
-
readonly allRefNames: string[] | undefined;
|
|
281
|
-
readonly lowerCaseRefNames: string[] | undefined;
|
|
282
|
-
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
283
|
-
readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
284
|
-
readonly refNameColors: string[];
|
|
285
|
-
} & {
|
|
286
|
-
readonly refNames: string[] | undefined;
|
|
287
|
-
} & {
|
|
288
|
-
getCanonicalRefName(refName: string): string | undefined;
|
|
289
|
-
getRefNameColor(refName: string): string | undefined;
|
|
290
|
-
isValidRefName(refName: string): boolean;
|
|
291
|
-
} & {
|
|
292
|
-
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
|
|
293
|
-
setError(e: unknown): void;
|
|
294
|
-
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
295
|
-
setRefNameAliases(aliases: {
|
|
296
|
-
[x: string]: string | undefined;
|
|
297
|
-
}, lcAliases: {
|
|
298
|
-
[x: string]: string | undefined;
|
|
299
|
-
}): void;
|
|
300
|
-
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
301
|
-
setLoadingP(p?: Promise<void> | undefined): void;
|
|
302
|
-
load(): Promise<void>;
|
|
303
|
-
loadPre(): Promise<void>;
|
|
304
|
-
} & {
|
|
305
|
-
getAdapterMapEntry(adapterConf: {
|
|
306
|
-
[x: string]: unknown;
|
|
307
|
-
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
308
|
-
getRefNameMapForAdapter(adapterConf: {
|
|
309
|
-
[x: string]: unknown;
|
|
310
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
311
|
-
[x: string]: string | undefined;
|
|
312
|
-
}>;
|
|
313
|
-
getReverseRefNameMapForAdapter(adapterConf: {
|
|
314
|
-
[x: string]: unknown;
|
|
315
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
316
|
-
[x: string]: string | undefined;
|
|
317
|
-
}>;
|
|
318
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
177
|
+
assembly: import("@jbrowse/core/assemblyManager/assembly").Assembly;
|
|
319
178
|
}): Promise<void>;
|
|
320
|
-
navToLocations(parsedLocStrings: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string
|
|
179
|
+
navToLocations(parsedLocStrings: import("@jbrowse/core/util").ParsedLocString[], assemblyName?: string): Promise<void>;
|
|
321
180
|
navTo(query: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").NavLocation): void;
|
|
322
181
|
navToMultiple(locations: import("@jbrowse/plugin-linear-genome-view/src/LinearGenomeView").NavLocation[]): void;
|
|
323
182
|
} & {
|
|
@@ -325,12 +184,12 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
325
184
|
bpToPx({ refName, coord, regionNumber, }: {
|
|
326
185
|
refName: string;
|
|
327
186
|
coord: number;
|
|
328
|
-
regionNumber?: number
|
|
187
|
+
regionNumber?: number;
|
|
329
188
|
}): {
|
|
330
189
|
index: number;
|
|
331
190
|
offsetPx: number;
|
|
332
191
|
} | undefined;
|
|
333
|
-
centerAt(coord: number, refName: string, regionNumber?: number
|
|
192
|
+
centerAt(coord: number, refName: string, regionNumber?: number): void;
|
|
334
193
|
pxToBp(px: number): {
|
|
335
194
|
coord: number;
|
|
336
195
|
index: number;
|
|
@@ -340,7 +199,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
340
199
|
offset: number;
|
|
341
200
|
start: number;
|
|
342
201
|
end: number;
|
|
343
|
-
reversed
|
|
202
|
+
reversed?: boolean;
|
|
344
203
|
};
|
|
345
204
|
readonly centerLineInfo: {
|
|
346
205
|
coord: number;
|
|
@@ -351,7 +210,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
351
210
|
offset: number;
|
|
352
211
|
start: number;
|
|
353
212
|
end: number;
|
|
354
|
-
reversed
|
|
213
|
+
reversed?: boolean;
|
|
355
214
|
} | undefined;
|
|
356
215
|
} & {
|
|
357
216
|
afterCreate(): void;
|
|
@@ -364,16 +223,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
364
223
|
type: import("mobx-state-tree").IType<string | undefined, string, string>;
|
|
365
224
|
offsetPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
366
225
|
bpPerPx: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
367
|
-
displayedRegions: import("mobx-state-tree").
|
|
368
|
-
refName: import("mobx-state-tree").ISimpleType<string>;
|
|
369
|
-
start: import("mobx-state-tree").ISimpleType<number>;
|
|
370
|
-
end: import("mobx-state-tree").ISimpleType<number>;
|
|
371
|
-
reversed: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<boolean>, [undefined]>;
|
|
372
|
-
} & {
|
|
373
|
-
assemblyName: import("mobx-state-tree").ISimpleType<string>;
|
|
374
|
-
}, {
|
|
375
|
-
setRefName(newRefName: string): void;
|
|
376
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
226
|
+
displayedRegions: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IType<import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[], import("@jbrowse/core/util").Region[]>, [undefined]>;
|
|
377
227
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
378
228
|
hideHeader: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
379
229
|
hideHeaderOverview: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
@@ -415,7 +265,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
415
265
|
*/
|
|
416
266
|
readonly assemblyNames: string[];
|
|
417
267
|
} & {
|
|
418
|
-
afterAttach(): void;
|
|
419
268
|
beforeDestroy(): void;
|
|
420
269
|
onSubviewAction(actionName: string, path: string, args?: unknown[]): void;
|
|
421
270
|
/**
|
|
@@ -440,10 +289,6 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
|
|
|
440
289
|
* #action
|
|
441
290
|
*/
|
|
442
291
|
setMiddleComparativeHeight(n: number): number;
|
|
443
|
-
/**
|
|
444
|
-
* #action
|
|
445
|
-
*/
|
|
446
|
-
toggleLinkViews(): void;
|
|
447
292
|
/**
|
|
448
293
|
* #action
|
|
449
294
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { lazy } from 'react';
|
|
2
|
-
import { addDisposer, cast, getParent, getPath, getRoot,
|
|
2
|
+
import { addDisposer, cast, getParent, getPath, getRoot, resolveIdentifier, types, } from 'mobx-state-tree';
|
|
3
3
|
import { autorun, transaction } from 'mobx';
|
|
4
4
|
// jbrowse
|
|
5
5
|
import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
|
|
@@ -34,10 +34,6 @@ function stateModelFactory(pluginManager) {
|
|
|
34
34
|
* #property
|
|
35
35
|
*/
|
|
36
36
|
showIntraviewLinks: true,
|
|
37
|
-
/**
|
|
38
|
-
* #property
|
|
39
|
-
*/
|
|
40
|
-
linkViews: false,
|
|
41
37
|
/**
|
|
42
38
|
* #property
|
|
43
39
|
*/
|
|
@@ -98,19 +94,6 @@ function stateModelFactory(pluginManager) {
|
|
|
98
94
|
},
|
|
99
95
|
}))
|
|
100
96
|
.actions(self => ({
|
|
101
|
-
afterAttach() {
|
|
102
|
-
addDisposer(self, onAction(self, param => {
|
|
103
|
-
if (self.linkViews) {
|
|
104
|
-
const { name, path, args } = param;
|
|
105
|
-
// doesn't link showTrack/hideTrack, doesn't make sense in
|
|
106
|
-
// synteny views most time
|
|
107
|
-
const actions = ['horizontalScroll', 'zoomTo', 'setScaleFactor'];
|
|
108
|
-
if (actions.includes(name) && path) {
|
|
109
|
-
this.onSubviewAction(name, path, args);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}));
|
|
113
|
-
},
|
|
114
97
|
// automatically removes session assemblies associated with this view
|
|
115
98
|
// e.g. read vs ref
|
|
116
99
|
beforeDestroy() {
|
|
@@ -163,12 +146,6 @@ function stateModelFactory(pluginManager) {
|
|
|
163
146
|
self.middleComparativeHeight = n;
|
|
164
147
|
return self.middleComparativeHeight;
|
|
165
148
|
},
|
|
166
|
-
/**
|
|
167
|
-
* #action
|
|
168
|
-
*/
|
|
169
|
-
toggleLinkViews() {
|
|
170
|
-
self.linkViews = !self.linkViews;
|
|
171
|
-
},
|
|
172
149
|
/**
|
|
173
150
|
* #action
|
|
174
151
|
*/
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React, { useState, useCallback, useRef } from 'react';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
|
-
import {
|
|
3
|
+
import { getContainingView } from '@jbrowse/core/util';
|
|
4
4
|
import { transaction } from 'mobx';
|
|
5
5
|
import { makeStyles } from 'tss-react/mui';
|
|
6
6
|
// locals
|
|
7
7
|
import SyntenyTooltip from './SyntenyTooltip';
|
|
8
8
|
import { getId, MAX_COLOR_RANGE } from '../drawSynteny';
|
|
9
9
|
import SyntenyContextMenu from './SyntenyContextMenu';
|
|
10
|
+
import { getTooltip, onSynClick, onSynContextClick } from './util';
|
|
10
11
|
const useStyles = makeStyles()({
|
|
11
12
|
pix: {
|
|
12
13
|
imageRendering: 'pixelated',
|
|
@@ -31,30 +32,44 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
31
32
|
const view = getContainingView(model);
|
|
32
33
|
const height = view.middleComparativeHeight;
|
|
33
34
|
const width = view.width;
|
|
35
|
+
const delta = useRef(0);
|
|
36
|
+
const timeout = useRef();
|
|
34
37
|
const [anchorEl, setAnchorEl] = useState();
|
|
35
38
|
const [tooltip, setTooltip] = useState('');
|
|
36
39
|
const [currX, setCurrX] = useState();
|
|
37
40
|
const [mouseCurrDownX, setMouseCurrDownX] = useState();
|
|
38
41
|
const [mouseInitialDownX, setMouseInitialDownX] = useState();
|
|
39
42
|
const [currY, setCurrY] = useState();
|
|
43
|
+
const { mouseoverId } = model;
|
|
40
44
|
// these useCallbacks avoid new refs from being created on any mouseover, etc.
|
|
41
45
|
const k1 = useCallback((ref) => model.setMouseoverCanvasRef(ref),
|
|
42
46
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
43
47
|
[model, height, width]);
|
|
44
|
-
const k2 = useCallback((ref) =>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
const k2 = useCallback((ref) => {
|
|
49
|
+
model.setMainCanvasRef(ref);
|
|
50
|
+
function onWheel(event) {
|
|
51
|
+
event.preventDefault();
|
|
52
|
+
if (event.ctrlKey === true) {
|
|
53
|
+
delta.current += event.deltaY / 500;
|
|
54
|
+
for (const v of view.views) {
|
|
55
|
+
v.setScaleFactor(delta.current < 0 ? 1 - delta.current : 1 / (1 + delta.current));
|
|
56
|
+
}
|
|
57
|
+
if (timeout.current) {
|
|
58
|
+
clearTimeout(timeout.current);
|
|
59
|
+
}
|
|
60
|
+
timeout.current = setTimeout(() => {
|
|
61
|
+
for (const v of view.views) {
|
|
62
|
+
v.setScaleFactor(1);
|
|
63
|
+
v.zoomTo(delta.current > 0
|
|
64
|
+
? v.bpPerPx * (1 + delta.current)
|
|
65
|
+
: v.bpPerPx / (1 - delta.current), event.clientX - ((ref === null || ref === void 0 ? void 0 : ref.getBoundingClientRect().left) || 0));
|
|
66
|
+
}
|
|
67
|
+
delta.current = 0;
|
|
68
|
+
}, 300);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
56
71
|
if (Math.abs(event.deltaY) < Math.abs(event.deltaX)) {
|
|
57
|
-
xOffset.current += event.deltaX;
|
|
72
|
+
xOffset.current += event.deltaX / 2;
|
|
58
73
|
}
|
|
59
74
|
if (currScrollFrame.current === undefined) {
|
|
60
75
|
currScrollFrame.current = requestAnimationFrame(() => {
|
|
@@ -67,7 +82,28 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
67
82
|
});
|
|
68
83
|
});
|
|
69
84
|
}
|
|
70
|
-
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (ref) {
|
|
88
|
+
ref.addEventListener('wheel', onWheel);
|
|
89
|
+
// this is a react 19-ism to have a cleanup in the ref callback
|
|
90
|
+
// https://react.dev/blog/2024/04/25/react-19#cleanup-functions-for-refs
|
|
91
|
+
// note: it warns in earlier versions of react
|
|
92
|
+
return () => ref.removeEventListener('wheel', onWheel);
|
|
93
|
+
}
|
|
94
|
+
return () => { };
|
|
95
|
+
},
|
|
96
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
97
|
+
[model, height, width]);
|
|
98
|
+
const k3 = useCallback((ref) => model.setClickMapCanvasRef(ref),
|
|
99
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
100
|
+
[model, height, width]);
|
|
101
|
+
const k4 = useCallback((ref) => model.setCigarClickMapCanvasRef(ref),
|
|
102
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
103
|
+
[model, height, width]);
|
|
104
|
+
return (React.createElement("div", { className: classes.rel },
|
|
105
|
+
React.createElement("canvas", { ref: k1, width: width, height: height, className: cx(classes.abs, classes.none) }),
|
|
106
|
+
React.createElement("canvas", { ref: k2, onMouseMove: event => {
|
|
71
107
|
var _a;
|
|
72
108
|
if (mouseCurrDownX !== undefined) {
|
|
73
109
|
xOffset.current += mouseCurrDownX - event.clientX;
|
|
@@ -127,95 +163,12 @@ const LinearSyntenyRendering = observer(function ({ model, }) {
|
|
|
127
163
|
setMouseCurrDownX(undefined);
|
|
128
164
|
if (mouseInitialDownX !== undefined &&
|
|
129
165
|
Math.abs(evt.clientX - mouseInitialDownX) < 5) {
|
|
130
|
-
|
|
166
|
+
onSynClick(evt, model);
|
|
131
167
|
}
|
|
132
|
-
}, onContextMenu: evt =>
|
|
133
|
-
onSyntenyContextClick(evt, model, setAnchorEl);
|
|
134
|
-
}, "data-testid": "synteny_canvas", className: classes.abs, width: width, height: height }),
|
|
168
|
+
}, onContextMenu: evt => onSynContextClick(evt, model, setAnchorEl), "data-testid": "synteny_canvas", className: classes.abs, width: width, height: height }),
|
|
135
169
|
React.createElement("canvas", { ref: k3, className: classes.pix, width: width, height: height }),
|
|
136
170
|
React.createElement("canvas", { ref: k4, className: classes.pix, width: width, height: height }),
|
|
137
|
-
|
|
171
|
+
mouseoverId && tooltip && currX && currY ? (React.createElement(SyntenyTooltip, { title: tooltip })) : null,
|
|
138
172
|
anchorEl ? (React.createElement(SyntenyContextMenu, { model: model, anchorEl: anchorEl, onClose: () => setAnchorEl(undefined) })) : null));
|
|
139
173
|
});
|
|
140
|
-
function onSyntenyClick(event, model) {
|
|
141
|
-
const ref1 = model.clickMapCanvas;
|
|
142
|
-
const ref2 = model.cigarClickMapCanvas;
|
|
143
|
-
if (!ref1 || !ref2) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const rect = ref1.getBoundingClientRect();
|
|
147
|
-
const ctx1 = ref1.getContext('2d');
|
|
148
|
-
const ctx2 = ref2.getContext('2d');
|
|
149
|
-
if (!ctx1 || !ctx2) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const x = event.clientX - rect.left;
|
|
153
|
-
const y = event.clientY - rect.top;
|
|
154
|
-
const [r1, g1, b1] = ctx1.getImageData(x, y, 1, 1).data;
|
|
155
|
-
const unitMultiplier = Math.floor(MAX_COLOR_RANGE / model.numFeats);
|
|
156
|
-
const id = getId(r1, g1, b1, unitMultiplier);
|
|
157
|
-
const feat = model.featPositions[id];
|
|
158
|
-
if (feat) {
|
|
159
|
-
const { f } = feat;
|
|
160
|
-
model.setClickId(f.id());
|
|
161
|
-
const session = getSession(model);
|
|
162
|
-
if (isSessionModelWithWidgets(session)) {
|
|
163
|
-
session.showWidget(session.addWidget('SyntenyFeatureWidget', 'syntenyFeature', {
|
|
164
|
-
featureData: {
|
|
165
|
-
feature1: f.toJSON(),
|
|
166
|
-
feature2: f.get('mate'),
|
|
167
|
-
},
|
|
168
|
-
}));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return feat;
|
|
172
|
-
}
|
|
173
|
-
function onSyntenyContextClick(event, model, setAnchorEl) {
|
|
174
|
-
event.preventDefault();
|
|
175
|
-
const ref1 = model.clickMapCanvas;
|
|
176
|
-
const ref2 = model.cigarClickMapCanvas;
|
|
177
|
-
if (!ref1 || !ref2) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const rect = ref1.getBoundingClientRect();
|
|
181
|
-
const ctx1 = ref1.getContext('2d');
|
|
182
|
-
const ctx2 = ref2.getContext('2d');
|
|
183
|
-
if (!ctx1 || !ctx2) {
|
|
184
|
-
return;
|
|
185
|
-
}
|
|
186
|
-
const { clientX, clientY } = event;
|
|
187
|
-
const x = clientX - rect.left;
|
|
188
|
-
const y = clientY - rect.top;
|
|
189
|
-
const [r1, g1, b1] = ctx1.getImageData(x, y, 1, 1).data;
|
|
190
|
-
const unitMultiplier = Math.floor(MAX_COLOR_RANGE / model.numFeats);
|
|
191
|
-
const id = getId(r1, g1, b1, unitMultiplier);
|
|
192
|
-
const f = model.featPositions[id];
|
|
193
|
-
if (f) {
|
|
194
|
-
model.setClickId(f.f.id());
|
|
195
|
-
setAnchorEl({ clientX, clientY, feature: f });
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
function getTooltip(f, cigarOp, cigarOpLen) {
|
|
199
|
-
// @ts-expect-error
|
|
200
|
-
const f1 = f.toJSON();
|
|
201
|
-
const f2 = f1.mate;
|
|
202
|
-
const l1 = f1.end - f1.start;
|
|
203
|
-
const l2 = f2.end - f2.start;
|
|
204
|
-
const identity = f1.identity;
|
|
205
|
-
const n1 = f1.name;
|
|
206
|
-
const n2 = f2.name;
|
|
207
|
-
return [
|
|
208
|
-
`Loc1: ${assembleLocString(f1)}`,
|
|
209
|
-
`Loc2: ${assembleLocString(f2)}`,
|
|
210
|
-
`Inverted: ${f1.strand === -1}`,
|
|
211
|
-
`Query len: ${l1.toLocaleString('en-US')}`,
|
|
212
|
-
`Target len: ${l2.toLocaleString('en-US')}`,
|
|
213
|
-
identity ? `Identity: ${identity.toPrecision(2)}` : '',
|
|
214
|
-
cigarOp ? `CIGAR operator: ${cigarOp}${cigarOpLen}` : '',
|
|
215
|
-
n1 ? `Name 1: ${n1}` : '',
|
|
216
|
-
n2 ? `Name 1: ${n2}` : '',
|
|
217
|
-
]
|
|
218
|
-
.filter(f => !!f)
|
|
219
|
-
.join('<br/>');
|
|
220
|
-
}
|
|
221
174
|
export default LinearSyntenyRendering;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import { Feature } from '@jbrowse/core/util';
|
|
3
|
+
import { LinearSyntenyDisplayModel } from '../model';
|
|
2
4
|
interface Pos {
|
|
3
5
|
offsetPx: number;
|
|
4
6
|
}
|
|
7
|
+
export interface ClickCoord {
|
|
8
|
+
clientX: number;
|
|
9
|
+
clientY: number;
|
|
10
|
+
feature: any;
|
|
11
|
+
}
|
|
5
12
|
interface FeatPos {
|
|
6
13
|
p11: Pos;
|
|
7
14
|
p12: Pos;
|
|
@@ -24,4 +31,7 @@ export declare function drawMatchSimple({ feature, ctx, offsets, cb, height, dra
|
|
|
24
31
|
export declare function draw(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number, drawCurves?: boolean): void;
|
|
25
32
|
export declare function drawBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number): void;
|
|
26
33
|
export declare function drawBezierBox(ctx: CanvasRenderingContext2D, x1: number, x2: number, y1: number, x3: number, x4: number, y2: number, mid: number): void;
|
|
34
|
+
export declare function onSynClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel): import("../model").FeatPos | undefined;
|
|
35
|
+
export declare function onSynContextClick(event: React.MouseEvent, model: LinearSyntenyDisplayModel, setAnchorEl: (arg: ClickCoord) => void): void;
|
|
36
|
+
export declare function getTooltip(f: Feature, cigarOp?: string, cigarOpLen?: string): string;
|
|
27
37
|
export {};
|