@jbrowse/plugin-linear-genome-view 2.10.2 → 2.11.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/BaseLinearDisplay/components/BlockMsg.d.ts +2 -4
- package/dist/BaseLinearDisplay/components/BlockMsg.js +2 -3
- package/dist/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +10 -2
- package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +40 -4
- package/dist/BaseLinearDisplay/components/TooLargeMessage.js +5 -4
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -4
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +9 -2
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -1
- package/dist/LaunchLinearGenomeView/index.js +24 -8
- package/dist/LinearBareDisplay/model.d.ts +18 -4
- package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/dist/LinearBasicDisplay/model.d.ts +22 -4
- package/dist/LinearGenomeView/components/Cytobands.d.ts +1 -125
- package/dist/LinearGenomeView/components/ExportSvgDialog.js +9 -5
- package/dist/LinearGenomeView/components/Highlight.d.ts +7 -0
- package/dist/LinearGenomeView/components/Highlight.js +126 -0
- package/dist/LinearGenomeView/components/MiniControls.js +13 -15
- package/dist/LinearGenomeView/components/OverviewHighlight.d.ts +9 -0
- package/dist/LinearGenomeView/components/OverviewHighlight.js +62 -0
- package/dist/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
- package/dist/LinearGenomeView/components/OverviewScalebar.js +6 -1
- package/dist/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +1 -1
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +9 -9
- package/dist/LinearGenomeView/components/RefNameAutocomplete/index.js +28 -35
- package/dist/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/dist/LinearGenomeView/components/SearchBox.d.ts +1 -1
- package/dist/LinearGenomeView/components/SearchResultsTable.js +1 -1
- package/dist/LinearGenomeView/components/TrackContainer.js +10 -23
- package/dist/LinearGenomeView/components/TrackLabel.js +33 -6
- package/dist/LinearGenomeView/components/TracksContainer.js +2 -0
- package/dist/LinearGenomeView/components/ZoomControls.js +4 -4
- package/dist/LinearGenomeView/model.d.ts +70 -5
- package/dist/LinearGenomeView/model.js +111 -14
- package/dist/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
- package/dist/LinearGenomeView/util.d.ts +1 -1
- package/dist/index.d.ts +213 -21
- package/esm/BaseLinearDisplay/components/BlockMsg.d.ts +2 -4
- package/esm/BaseLinearDisplay/components/BlockMsg.js +3 -4
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +2 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +10 -2
- package/esm/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +17 -4
- package/esm/BaseLinearDisplay/components/TooLargeMessage.js +5 -4
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +18 -4
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +9 -2
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +0 -1
- package/esm/LaunchLinearGenomeView/index.js +25 -9
- package/esm/LinearBareDisplay/model.d.ts +18 -4
- package/esm/LinearBasicDisplay/components/SetMaxHeight.d.ts +1 -1
- package/esm/LinearBasicDisplay/model.d.ts +22 -4
- package/esm/LinearGenomeView/components/Cytobands.d.ts +1 -125
- package/esm/LinearGenomeView/components/ExportSvgDialog.js +9 -5
- package/esm/LinearGenomeView/components/Highlight.d.ts +7 -0
- package/esm/LinearGenomeView/components/Highlight.js +98 -0
- package/esm/LinearGenomeView/components/MiniControls.js +14 -16
- package/esm/LinearGenomeView/components/OverviewHighlight.d.ts +9 -0
- package/esm/LinearGenomeView/components/OverviewHighlight.js +57 -0
- package/esm/LinearGenomeView/components/OverviewRubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/OverviewScalebar.js +7 -2
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.d.ts +1 -1
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.d.ts +9 -9
- package/esm/LinearGenomeView/components/RefNameAutocomplete/index.js +28 -35
- package/esm/LinearGenomeView/components/Rubberband.d.ts +1 -1
- package/esm/LinearGenomeView/components/SearchBox.d.ts +1 -1
- package/esm/LinearGenomeView/components/SearchResultsTable.js +1 -1
- package/esm/LinearGenomeView/components/TrackContainer.js +10 -23
- package/esm/LinearGenomeView/components/TrackLabel.js +33 -6
- package/esm/LinearGenomeView/components/TracksContainer.js +2 -0
- package/esm/LinearGenomeView/components/ZoomControls.js +4 -4
- package/esm/LinearGenomeView/model.d.ts +70 -5
- package/esm/LinearGenomeView/model.js +112 -15
- package/esm/LinearGenomeView/svgcomponents/SVGLinearGenomeView.js +1 -1
- package/esm/LinearGenomeView/util.d.ts +1 -1
- package/esm/index.d.ts +213 -21
- package/package.json +2 -2
|
@@ -58,8 +58,15 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
58
58
|
message: string | undefined;
|
|
59
59
|
maxHeightReached: boolean;
|
|
60
60
|
ReactComponent: ({ model, }: {
|
|
61
|
-
model:
|
|
62
|
-
|
|
61
|
+
model: {
|
|
62
|
+
error?: unknown;
|
|
63
|
+
reload: () => void;
|
|
64
|
+
message: React.ReactNode;
|
|
65
|
+
filled?: boolean | undefined;
|
|
66
|
+
status?: string | undefined;
|
|
67
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
68
|
+
};
|
|
69
|
+
}) => React.JSX.Element | undefined;
|
|
63
70
|
renderProps: any;
|
|
64
71
|
} & {
|
|
65
72
|
doReload(): void;
|
|
@@ -342,8 +349,15 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
342
349
|
message: string | undefined;
|
|
343
350
|
maxHeightReached: boolean;
|
|
344
351
|
ReactComponent: ({ model, }: {
|
|
345
|
-
model:
|
|
346
|
-
|
|
352
|
+
model: {
|
|
353
|
+
error?: unknown;
|
|
354
|
+
reload: () => void;
|
|
355
|
+
message: React.ReactNode;
|
|
356
|
+
filled?: boolean | undefined;
|
|
357
|
+
status?: string | undefined;
|
|
358
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
359
|
+
};
|
|
360
|
+
}) => React.JSX.Element | undefined;
|
|
347
361
|
renderProps: any;
|
|
348
362
|
} & {
|
|
349
363
|
doReload(): void;
|
|
@@ -28,8 +28,15 @@ declare const blockState: import("mobx-state-tree").IModelType<{
|
|
|
28
28
|
message: string | undefined;
|
|
29
29
|
maxHeightReached: boolean;
|
|
30
30
|
ReactComponent: ({ model, }: {
|
|
31
|
-
model:
|
|
32
|
-
|
|
31
|
+
model: {
|
|
32
|
+
error?: unknown;
|
|
33
|
+
reload: () => void;
|
|
34
|
+
message: React.ReactNode;
|
|
35
|
+
filled?: boolean | undefined;
|
|
36
|
+
status?: string | undefined;
|
|
37
|
+
reactElement?: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
|
|
38
|
+
};
|
|
39
|
+
}) => React.JSX.Element | undefined;
|
|
33
40
|
renderProps: any;
|
|
34
41
|
} & {
|
|
35
42
|
doReload(): void;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { when } from '@jbrowse/core/util';
|
|
1
|
+
import { when, parseLocString, } from '@jbrowse/core/util';
|
|
2
2
|
import { handleSelectedRegion } from '../searchUtils';
|
|
3
3
|
export default (pluginManager) => {
|
|
4
4
|
pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
|
|
5
5
|
// @ts-expect-error
|
|
6
|
-
async ({ session, assembly, loc, tracks = [], tracklist, nav, }) => {
|
|
6
|
+
async ({ session, assembly, loc, tracks = [], tracklist, nav, highlight, }) => {
|
|
7
7
|
try {
|
|
8
8
|
const { assemblyManager } = session;
|
|
9
|
+
const { isValidRefName } = assemblyManager;
|
|
9
10
|
const view = session.addView('LinearGenomeView', {});
|
|
10
11
|
await when(() => !!view.volatileWidth);
|
|
11
12
|
if (!assembly) {
|
|
@@ -15,21 +16,36 @@ export default (pluginManager) => {
|
|
|
15
16
|
if (!asm) {
|
|
16
17
|
throw new Error(`Assembly "${assembly}" not found when launching linear genome view`);
|
|
17
18
|
}
|
|
18
|
-
await handleSelectedRegion({ input: loc, model: view, assembly: asm });
|
|
19
|
-
const idsNotFound = [];
|
|
20
|
-
tracks.forEach(track => tryTrack(view, track, idsNotFound));
|
|
21
|
-
if (idsNotFound.length) {
|
|
22
|
-
throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
|
|
23
|
-
}
|
|
24
19
|
if (tracklist) {
|
|
25
20
|
view.activateTrackSelector();
|
|
26
21
|
}
|
|
27
22
|
if (nav !== undefined) {
|
|
28
23
|
view.setHideHeader(!nav);
|
|
29
24
|
}
|
|
25
|
+
if (highlight !== undefined) {
|
|
26
|
+
highlight.forEach(async (h) => {
|
|
27
|
+
if (h) {
|
|
28
|
+
const parsedLocString = parseLocString(h, refName => isValidRefName(refName, assembly));
|
|
29
|
+
const location = {
|
|
30
|
+
...parsedLocString,
|
|
31
|
+
assemblyName: assembly,
|
|
32
|
+
};
|
|
33
|
+
if ((location === null || location === void 0 ? void 0 : location.start) !== undefined &&
|
|
34
|
+
(location === null || location === void 0 ? void 0 : location.end) !== undefined) {
|
|
35
|
+
view.addToHighlights(location);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
await handleSelectedRegion({ input: loc, model: view, assembly: asm });
|
|
41
|
+
const idsNotFound = [];
|
|
42
|
+
tracks.forEach(track => tryTrack(view, track, idsNotFound));
|
|
43
|
+
if (idsNotFound.length) {
|
|
44
|
+
throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
|
|
45
|
+
}
|
|
30
46
|
}
|
|
31
47
|
catch (e) {
|
|
32
|
-
session.
|
|
48
|
+
session.notifyError(`${e}`, e);
|
|
33
49
|
throw e;
|
|
34
50
|
}
|
|
35
51
|
});
|
|
@@ -42,8 +42,15 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
42
42
|
message: string | undefined;
|
|
43
43
|
maxHeightReached: boolean;
|
|
44
44
|
ReactComponent: ({ model, }: {
|
|
45
|
-
model:
|
|
46
|
-
|
|
45
|
+
model: {
|
|
46
|
+
error?: unknown;
|
|
47
|
+
reload: () => void;
|
|
48
|
+
message: import("react").ReactNode;
|
|
49
|
+
filled?: boolean | undefined;
|
|
50
|
+
status?: string | undefined;
|
|
51
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
52
|
+
};
|
|
53
|
+
}) => import("react").JSX.Element | undefined;
|
|
47
54
|
renderProps: any;
|
|
48
55
|
} & {
|
|
49
56
|
doReload(): void;
|
|
@@ -267,8 +274,15 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
267
274
|
message: string | undefined;
|
|
268
275
|
maxHeightReached: boolean;
|
|
269
276
|
ReactComponent: ({ model, }: {
|
|
270
|
-
model:
|
|
271
|
-
|
|
277
|
+
model: {
|
|
278
|
+
error?: unknown;
|
|
279
|
+
reload: () => void;
|
|
280
|
+
message: import("react").ReactNode;
|
|
281
|
+
filled?: boolean | undefined;
|
|
282
|
+
status?: string | undefined;
|
|
283
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
284
|
+
};
|
|
285
|
+
}) => import("react").JSX.Element | undefined;
|
|
272
286
|
renderProps: any;
|
|
273
287
|
} & {
|
|
274
288
|
doReload(): void;
|
|
@@ -47,8 +47,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
47
47
|
message: string | undefined;
|
|
48
48
|
maxHeightReached: boolean;
|
|
49
49
|
ReactComponent: ({ model, }: {
|
|
50
|
-
model:
|
|
51
|
-
|
|
50
|
+
model: {
|
|
51
|
+
error?: unknown;
|
|
52
|
+
reload: () => void;
|
|
53
|
+
message: import("react").ReactNode;
|
|
54
|
+
filled?: boolean | undefined;
|
|
55
|
+
status?: string | undefined; /**
|
|
56
|
+
* #getter
|
|
57
|
+
*/
|
|
58
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
59
|
+
};
|
|
60
|
+
}) => import("react").JSX.Element | undefined;
|
|
52
61
|
renderProps: any;
|
|
53
62
|
} & {
|
|
54
63
|
doReload(): void;
|
|
@@ -343,8 +352,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
343
352
|
message: string | undefined;
|
|
344
353
|
maxHeightReached: boolean;
|
|
345
354
|
ReactComponent: ({ model, }: {
|
|
346
|
-
model:
|
|
347
|
-
|
|
355
|
+
model: {
|
|
356
|
+
error?: unknown;
|
|
357
|
+
reload: () => void;
|
|
358
|
+
message: import("react").ReactNode;
|
|
359
|
+
filled?: boolean | undefined;
|
|
360
|
+
status?: string | undefined; /**
|
|
361
|
+
* #getter
|
|
362
|
+
*/
|
|
363
|
+
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
364
|
+
};
|
|
365
|
+
}) => import("react").JSX.Element | undefined;
|
|
348
366
|
renderProps: any;
|
|
349
367
|
} & {
|
|
350
368
|
doReload(): void;
|
|
@@ -4,131 +4,7 @@ import { ContentBlock } from '@jbrowse/core/util/blockTypes';
|
|
|
4
4
|
import { Assembly } from '@jbrowse/core/assemblyManager/assembly';
|
|
5
5
|
declare const Cytobands: ({ overview, block, assembly, }: {
|
|
6
6
|
overview: Base1DViewModel;
|
|
7
|
-
assembly?:
|
|
8
|
-
configuration: any;
|
|
9
|
-
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
10
|
-
error: unknown;
|
|
11
|
-
loaded: boolean;
|
|
12
|
-
loadingP: Promise<void> | undefined;
|
|
13
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
14
|
-
refNameAliases: {
|
|
15
|
-
[x: string]: string | undefined;
|
|
16
|
-
} | undefined;
|
|
17
|
-
lowerCaseRefNameAliases: {
|
|
18
|
-
[x: string]: string | undefined;
|
|
19
|
-
} | undefined;
|
|
20
|
-
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
getConf(arg: string): any;
|
|
23
|
-
} & {
|
|
24
|
-
readonly initialized: boolean;
|
|
25
|
-
readonly name: string;
|
|
26
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
27
|
-
readonly aliases: string[];
|
|
28
|
-
readonly displayName: string | undefined;
|
|
29
|
-
hasName(name: string): boolean;
|
|
30
|
-
readonly allAliases: string[];
|
|
31
|
-
readonly allRefNames: string[] | undefined;
|
|
32
|
-
readonly lowerCaseRefNames: string[] | undefined;
|
|
33
|
-
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
34
|
-
readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
35
|
-
readonly refNameColors: string[];
|
|
36
|
-
} & {
|
|
37
|
-
readonly refNames: string[] | undefined;
|
|
38
|
-
} & {
|
|
39
|
-
getCanonicalRefName(refName: string): string | undefined;
|
|
40
|
-
getRefNameColor(refName: string): string | undefined;
|
|
41
|
-
isValidRefName(refName: string): boolean;
|
|
42
|
-
} & {
|
|
43
|
-
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
|
|
44
|
-
setError(e: unknown): void;
|
|
45
|
-
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
46
|
-
setRefNameAliases(aliases: {
|
|
47
|
-
[x: string]: string | undefined;
|
|
48
|
-
}, lcAliases: {
|
|
49
|
-
[x: string]: string | undefined;
|
|
50
|
-
}): void;
|
|
51
|
-
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
52
|
-
setLoadingP(p?: Promise<void> | undefined): void;
|
|
53
|
-
load(): Promise<void>;
|
|
54
|
-
loadPre(): Promise<void>;
|
|
55
|
-
} & {
|
|
56
|
-
getAdapterMapEntry(adapterConf: {
|
|
57
|
-
[x: string]: unknown;
|
|
58
|
-
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
59
|
-
getRefNameMapForAdapter(adapterConf: {
|
|
60
|
-
[x: string]: unknown;
|
|
61
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
62
|
-
[x: string]: string | undefined;
|
|
63
|
-
}>;
|
|
64
|
-
getReverseRefNameMapForAdapter(adapterConf: {
|
|
65
|
-
[x: string]: unknown;
|
|
66
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
67
|
-
[x: string]: string | undefined;
|
|
68
|
-
}>;
|
|
69
|
-
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
70
|
-
configuration: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IReferenceType<import("mobx-state-tree").IAnyType>>;
|
|
71
|
-
}, {
|
|
72
|
-
error: unknown;
|
|
73
|
-
loaded: boolean;
|
|
74
|
-
loadingP: Promise<void> | undefined;
|
|
75
|
-
volatileRegions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
76
|
-
refNameAliases: {
|
|
77
|
-
[x: string]: string | undefined;
|
|
78
|
-
} | undefined;
|
|
79
|
-
lowerCaseRefNameAliases: {
|
|
80
|
-
[x: string]: string | undefined;
|
|
81
|
-
} | undefined;
|
|
82
|
-
cytobands: import("@jbrowse/core/util").Feature[] | undefined;
|
|
83
|
-
} & {
|
|
84
|
-
getConf(arg: string): any;
|
|
85
|
-
} & {
|
|
86
|
-
readonly initialized: boolean;
|
|
87
|
-
readonly name: string;
|
|
88
|
-
readonly regions: import("@jbrowse/core/assemblyManager/assembly").BasicRegion[] | undefined;
|
|
89
|
-
readonly aliases: string[];
|
|
90
|
-
readonly displayName: string | undefined;
|
|
91
|
-
hasName(name: string): boolean;
|
|
92
|
-
readonly allAliases: string[];
|
|
93
|
-
readonly allRefNames: string[] | undefined;
|
|
94
|
-
readonly lowerCaseRefNames: string[] | undefined;
|
|
95
|
-
readonly allRefNamesWithLowerCase: string[] | undefined;
|
|
96
|
-
readonly rpcManager: import("@jbrowse/core/rpc/RpcManager").default;
|
|
97
|
-
readonly refNameColors: string[];
|
|
98
|
-
} & {
|
|
99
|
-
readonly refNames: string[] | undefined;
|
|
100
|
-
} & {
|
|
101
|
-
getCanonicalRefName(refName: string): string | undefined;
|
|
102
|
-
getRefNameColor(refName: string): string | undefined;
|
|
103
|
-
isValidRefName(refName: string): boolean;
|
|
104
|
-
} & {
|
|
105
|
-
setLoaded({ adapterRegionsWithAssembly, refNameAliases, lowerCaseRefNameAliases, cytobands, }: import("@jbrowse/core/assemblyManager/assembly").Loading): void;
|
|
106
|
-
setError(e: unknown): void;
|
|
107
|
-
setRegions(regions: import("@jbrowse/core/util").Region[]): void;
|
|
108
|
-
setRefNameAliases(aliases: {
|
|
109
|
-
[x: string]: string | undefined;
|
|
110
|
-
}, lcAliases: {
|
|
111
|
-
[x: string]: string | undefined;
|
|
112
|
-
}): void;
|
|
113
|
-
setCytobands(cytobands: import("@jbrowse/core/util").Feature[]): void;
|
|
114
|
-
setLoadingP(p?: Promise<void> | undefined): void;
|
|
115
|
-
load(): Promise<void>;
|
|
116
|
-
loadPre(): Promise<void>;
|
|
117
|
-
} & {
|
|
118
|
-
getAdapterMapEntry(adapterConf: {
|
|
119
|
-
[x: string]: unknown;
|
|
120
|
-
}, options: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<import("@jbrowse/core/assemblyManager/assembly").RefNameMap>;
|
|
121
|
-
getRefNameMapForAdapter(adapterConf: {
|
|
122
|
-
[x: string]: unknown;
|
|
123
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
124
|
-
[x: string]: string | undefined;
|
|
125
|
-
}>;
|
|
126
|
-
getReverseRefNameMapForAdapter(adapterConf: {
|
|
127
|
-
[x: string]: unknown;
|
|
128
|
-
}, opts: import("@jbrowse/core/data_adapters/BaseAdapter").BaseOptions): Promise<{
|
|
129
|
-
[x: string]: string | undefined;
|
|
130
|
-
}>;
|
|
131
|
-
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>) | undefined;
|
|
7
|
+
assembly?: Assembly;
|
|
132
8
|
block: ContentBlock;
|
|
133
9
|
}) => React.JSX.Element;
|
|
134
10
|
export default Cytobands;
|
|
@@ -10,6 +10,10 @@ function LoadingMessage() {
|
|
|
10
10
|
function useSvgLocal(key, val) {
|
|
11
11
|
return useLocalStorage('svg-' + key, val);
|
|
12
12
|
}
|
|
13
|
+
function TextField2({ children, ...rest }) {
|
|
14
|
+
return (React.createElement("div", null,
|
|
15
|
+
React.createElement(TextField, { ...rest }, children)));
|
|
16
|
+
}
|
|
13
17
|
export default function ExportSvgDialog({ model, handleClose, }) {
|
|
14
18
|
const session = getSession(model);
|
|
15
19
|
const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
|
|
@@ -22,15 +26,13 @@ export default function ExportSvgDialog({ model, handleClose, }) {
|
|
|
22
26
|
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Export SVG" },
|
|
23
27
|
React.createElement(DialogContent, null,
|
|
24
28
|
error ? (React.createElement(ErrorMessage, { error: error })) : loading ? (React.createElement(LoadingMessage, null)) : null,
|
|
25
|
-
React.createElement(
|
|
26
|
-
React.createElement("
|
|
27
|
-
React.createElement(TextField, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => setTrackLabels(event.target.value) },
|
|
29
|
+
React.createElement(TextField2, { helperText: "filename", value: filename, onChange: event => setFilename(event.target.value) }),
|
|
30
|
+
React.createElement(TextField2, { select: true, label: "Track label positioning", variant: "outlined", style: { width: 150 }, value: trackLabels, onChange: event => setTrackLabels(event.target.value) },
|
|
28
31
|
React.createElement(MenuItem, { value: "offset" }, "Offset"),
|
|
29
32
|
React.createElement(MenuItem, { value: "overlay" }, "Overlay"),
|
|
30
33
|
React.createElement(MenuItem, { value: "left" }, "Left"),
|
|
31
34
|
React.createElement(MenuItem, { value: "none" }, "None")),
|
|
32
|
-
React.createElement("
|
|
33
|
-
session.allThemes ? (React.createElement(TextField, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => setThemeName(event.target.value) }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
|
|
35
|
+
session.allThemes ? (React.createElement(TextField2, { select: true, label: "Theme", variant: "outlined", value: themeName, onChange: event => setThemeName(event.target.value) }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
|
|
34
36
|
// @ts-expect-error
|
|
35
37
|
val.name || '(Unknown name)'))))) : null,
|
|
36
38
|
offscreenCanvas ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: rasterizeLayers, onChange: () => setRasterizeLayers(val => !val) }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (React.createElement(Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
|
|
@@ -51,6 +53,8 @@ export default function ExportSvgDialog({ model, handleClose, }) {
|
|
|
51
53
|
catch (e) {
|
|
52
54
|
console.error(e);
|
|
53
55
|
setError(e);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
54
58
|
setLoading(false);
|
|
55
59
|
}
|
|
56
60
|
} }, "Submit"))));
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, { useRef, useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { makeStyles } from 'tss-react/mui';
|
|
4
|
+
import { colord } from '@jbrowse/core/util/colord';
|
|
5
|
+
import { getSession, } from '@jbrowse/core/util';
|
|
6
|
+
import { Menu } from '@jbrowse/core/ui';
|
|
7
|
+
import { IconButton, Tooltip, useTheme } from '@mui/material';
|
|
8
|
+
// icons
|
|
9
|
+
import LinkIcon from '@mui/icons-material/Link';
|
|
10
|
+
import CloseIcon from '@mui/icons-material/Close';
|
|
11
|
+
import BookmarkIcon from '@mui/icons-material/Bookmark';
|
|
12
|
+
const useStyles = makeStyles()(theme => {
|
|
13
|
+
var _a, _b;
|
|
14
|
+
return ({
|
|
15
|
+
highlight: {
|
|
16
|
+
height: '100%',
|
|
17
|
+
position: 'absolute',
|
|
18
|
+
overflow: 'hidden',
|
|
19
|
+
background: `${colord((_b = (_a = theme.palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
|
|
20
|
+
.alpha(0.35)
|
|
21
|
+
.toRgbString()}`,
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
const Highlight = observer(function Highlight({ model, highlight, }) {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
const { classes } = useStyles();
|
|
28
|
+
const [open, setOpen] = useState(false);
|
|
29
|
+
const anchorEl = useRef(null);
|
|
30
|
+
const color = (_b = (_a = useTheme().palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod';
|
|
31
|
+
const session = getSession(model);
|
|
32
|
+
const { assemblyManager } = session;
|
|
33
|
+
const dismissHighlight = () => {
|
|
34
|
+
model.removeHighlight(highlight);
|
|
35
|
+
};
|
|
36
|
+
const menuItems = [
|
|
37
|
+
{
|
|
38
|
+
label: 'Dismiss highlight',
|
|
39
|
+
icon: CloseIcon,
|
|
40
|
+
onClick: () => dismissHighlight(),
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'Bookmark highlighted region',
|
|
44
|
+
icon: BookmarkIcon,
|
|
45
|
+
onClick: () => {
|
|
46
|
+
let bookmarkWidget = session.widgets.get('GridBookmark');
|
|
47
|
+
if (!bookmarkWidget) {
|
|
48
|
+
bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
|
|
49
|
+
}
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
bookmarkWidget.addBookmark(highlight);
|
|
52
|
+
dismissHighlight();
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
];
|
|
56
|
+
function handleClose() {
|
|
57
|
+
setOpen(false);
|
|
58
|
+
}
|
|
59
|
+
// coords
|
|
60
|
+
const mapCoords = (r) => {
|
|
61
|
+
const s = model.bpToPx({
|
|
62
|
+
refName: r.refName,
|
|
63
|
+
coord: r.start,
|
|
64
|
+
});
|
|
65
|
+
const e = model.bpToPx({
|
|
66
|
+
refName: r.refName,
|
|
67
|
+
coord: r.end,
|
|
68
|
+
});
|
|
69
|
+
return s && e
|
|
70
|
+
? {
|
|
71
|
+
width: Math.max(Math.abs(e.offsetPx - s.offsetPx), 3),
|
|
72
|
+
left: Math.min(s.offsetPx, e.offsetPx) - model.offsetPx,
|
|
73
|
+
}
|
|
74
|
+
: undefined;
|
|
75
|
+
};
|
|
76
|
+
const asm = assemblyManager.get(highlight === null || highlight === void 0 ? void 0 : highlight.assemblyName);
|
|
77
|
+
const h = mapCoords({
|
|
78
|
+
...highlight,
|
|
79
|
+
refName: (_c = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(highlight.refName)) !== null && _c !== void 0 ? _c : highlight.refName,
|
|
80
|
+
});
|
|
81
|
+
return h ? (React.createElement("div", { className: classes.highlight, style: {
|
|
82
|
+
left: h.left,
|
|
83
|
+
width: h.width,
|
|
84
|
+
} },
|
|
85
|
+
React.createElement(Tooltip, { title: 'Highlighted from URL parameter', arrow: true },
|
|
86
|
+
React.createElement(IconButton, { ref: anchorEl, onClick: () => setOpen(true), style: { zIndex: 3 } },
|
|
87
|
+
React.createElement(LinkIcon, { fontSize: "small", sx: {
|
|
88
|
+
color: `${colord(color).darken(0.2).toRgbString()}`,
|
|
89
|
+
} }))),
|
|
90
|
+
React.createElement(Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
|
|
91
|
+
callback(session);
|
|
92
|
+
handleClose();
|
|
93
|
+
}, open: open, onClose: handleClose, menuItems: menuItems }))) : null;
|
|
94
|
+
});
|
|
95
|
+
const HighlightGroup = observer(function HighlightGroup({ model, }) {
|
|
96
|
+
return model.highlight.map((highlight, idx) => (React.createElement(Highlight, { key: JSON.stringify(highlight) + '-' + idx, model: model, highlight: highlight })));
|
|
97
|
+
});
|
|
98
|
+
export default HighlightGroup;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { observer } from 'mobx-react';
|
|
3
|
-
import { IconButton, Paper } from '@mui/material';
|
|
3
|
+
import { IconButton, Paper, alpha } from '@mui/material';
|
|
4
|
+
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
import { getSession } from '@jbrowse/core/util';
|
|
4
7
|
// icons
|
|
5
8
|
import ZoomIn from '@mui/icons-material/ZoomIn';
|
|
6
9
|
import ZoomOut from '@mui/icons-material/ZoomOut';
|
|
7
10
|
import ArrowDown from '@mui/icons-material/KeyboardArrowDown';
|
|
8
|
-
import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
|
|
9
|
-
import { makeStyles } from 'tss-react/mui';
|
|
10
|
-
import { getSession } from '@jbrowse/core/util';
|
|
11
11
|
const useStyles = makeStyles()(theme => ({
|
|
12
12
|
background: {
|
|
13
13
|
position: 'absolute',
|
|
@@ -16,22 +16,20 @@ const useStyles = makeStyles()(theme => ({
|
|
|
16
16
|
background: theme.palette.background.paper,
|
|
17
17
|
},
|
|
18
18
|
focusedBackground: {
|
|
19
|
-
background: theme.palette.secondary.light,
|
|
20
|
-
svg: {
|
|
21
|
-
fill: theme.palette.secondary.contrastText,
|
|
22
|
-
},
|
|
19
|
+
background: alpha(theme.palette.secondary.light, 0.2),
|
|
23
20
|
},
|
|
24
21
|
}));
|
|
25
22
|
const MiniControls = observer(function ({ model, }) {
|
|
26
|
-
const { classes
|
|
23
|
+
const { classes } = useStyles();
|
|
27
24
|
const { id, bpPerPx, maxBpPerPx, minBpPerPx, scaleFactor, hideHeader } = model;
|
|
28
25
|
const { focusedViewId } = getSession(model);
|
|
29
|
-
return hideHeader ? (React.createElement(Paper, { className:
|
|
30
|
-
React.createElement(
|
|
31
|
-
React.createElement(
|
|
32
|
-
|
|
33
|
-
React.createElement(
|
|
34
|
-
|
|
35
|
-
React.createElement(
|
|
26
|
+
return hideHeader ? (React.createElement(Paper, { className: classes.background },
|
|
27
|
+
React.createElement(Paper, { className: focusedViewId === id ? classes.focusedBackground : undefined },
|
|
28
|
+
React.createElement(CascadingMenuButton, { menuItems: model.menuItems() },
|
|
29
|
+
React.createElement(ArrowDown, { fontSize: "small" })),
|
|
30
|
+
React.createElement(IconButton, { "data-testid": "zoom_out", onClick: () => model.zoom(bpPerPx * 2), disabled: bpPerPx >= maxBpPerPx - 0.0001 || scaleFactor !== 1 },
|
|
31
|
+
React.createElement(ZoomOut, { fontSize: "small" })),
|
|
32
|
+
React.createElement(IconButton, { "data-testid": "zoom_in", onClick: () => model.zoom(bpPerPx / 2), disabled: bpPerPx <= minBpPerPx + 0.0001 || scaleFactor !== 1 },
|
|
33
|
+
React.createElement(ZoomIn, { fontSize: "small" }))))) : null;
|
|
36
34
|
});
|
|
37
35
|
export default MiniControls;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
|
|
3
|
+
import { LinearGenomeViewModel } from '../model';
|
|
4
|
+
type LGV = LinearGenomeViewModel;
|
|
5
|
+
declare const OverviewHighlight: ({ model, overview, }: {
|
|
6
|
+
model: LGV;
|
|
7
|
+
overview: Base1DViewModel;
|
|
8
|
+
}) => React.JSX.Element[];
|
|
9
|
+
export default OverviewHighlight;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { makeStyles } from 'tss-react/mui';
|
|
4
|
+
import { colord } from '@jbrowse/core/util/colord';
|
|
5
|
+
import { getSession, notEmpty, } from '@jbrowse/core/util';
|
|
6
|
+
const useStyles = makeStyles()(theme => {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8
|
+
return ({
|
|
9
|
+
highlight: {
|
|
10
|
+
height: '100%',
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
background: `${colord((_b = (_a = theme.palette.highlight) === null || _a === void 0 ? void 0 : _a.main) !== null && _b !== void 0 ? _b : 'goldenrod')
|
|
13
|
+
.alpha(0.35)
|
|
14
|
+
.toRgbString()}`,
|
|
15
|
+
borderLeft: `1px solid ${(_d = (_c = theme.palette.highlight) === null || _c === void 0 ? void 0 : _c.main) !== null && _d !== void 0 ? _d : 'goldenrod'}`,
|
|
16
|
+
borderRight: `1px solid ${(_f = (_e = theme.palette.highlight) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : 'goldenrod'}`,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
const OverviewHighlight = observer(function OverviewHighlight({ model, overview, }) {
|
|
21
|
+
const { classes } = useStyles();
|
|
22
|
+
const { cytobandOffset } = model;
|
|
23
|
+
const session = getSession(model);
|
|
24
|
+
const { assemblyManager } = session;
|
|
25
|
+
// coords
|
|
26
|
+
const mapCoords = (r) => {
|
|
27
|
+
const s = overview.bpToPx({
|
|
28
|
+
...r,
|
|
29
|
+
coord: r.reversed ? r.end : r.start,
|
|
30
|
+
});
|
|
31
|
+
const e = overview.bpToPx({
|
|
32
|
+
...r,
|
|
33
|
+
coord: r.reversed ? r.start : r.end,
|
|
34
|
+
});
|
|
35
|
+
return s !== undefined && e != undefined
|
|
36
|
+
? {
|
|
37
|
+
width: Math.abs(e - s),
|
|
38
|
+
left: s + cytobandOffset,
|
|
39
|
+
}
|
|
40
|
+
: undefined;
|
|
41
|
+
};
|
|
42
|
+
return model.highlight
|
|
43
|
+
.map(h => {
|
|
44
|
+
var _a;
|
|
45
|
+
const asm = assemblyManager.get(h === null || h === void 0 ? void 0 : h.assemblyName);
|
|
46
|
+
return mapCoords({
|
|
47
|
+
...h,
|
|
48
|
+
refName: (_a = asm === null || asm === void 0 ? void 0 : asm.getCanonicalRefName(h.refName)) !== null && _a !== void 0 ? _a : h.refName,
|
|
49
|
+
});
|
|
50
|
+
})
|
|
51
|
+
.filter(notEmpty)
|
|
52
|
+
.map(({ left, width }, idx) => (React.createElement("div", { key: `${left}_${width}_${idx}`, className: classes.highlight, style: {
|
|
53
|
+
width: width,
|
|
54
|
+
left: left,
|
|
55
|
+
} })));
|
|
56
|
+
});
|
|
57
|
+
export default OverviewHighlight;
|
|
@@ -5,6 +5,6 @@ type LGV = LinearGenomeViewModel;
|
|
|
5
5
|
declare const OverviewRubberband: ({ model, overview, ControlComponent, }: {
|
|
6
6
|
model: LGV;
|
|
7
7
|
overview: Base1DViewModel;
|
|
8
|
-
ControlComponent?: React.ReactElement
|
|
8
|
+
ControlComponent?: React.ReactElement;
|
|
9
9
|
}) => React.JSX.Element;
|
|
10
10
|
export default OverviewRubberband;
|