@jbrowse/core 2.1.7 → 2.2.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/BaseFeatureWidget/BaseFeatureDetail.d.ts +2 -2
- package/BaseFeatureWidget/SequenceFeatureDetails.js +2 -1
- package/PluginManager.d.ts +3 -3
- package/ReExports/modules.d.ts +3 -3
- package/assemblyManager/assembly.d.ts +20 -14
- package/assemblyManager/assembly.js +74 -75
- package/assemblyManager/assemblyConfigSchema.d.ts +6 -2
- package/assemblyManager/assemblyConfigSchema.js +39 -2
- package/assemblyManager/assemblyManager.d.ts +76 -214
- package/assemblyManager/assemblyManager.js +17 -39
- package/data_adapters/CytobandAdapter.js +7 -0
- package/package.json +2 -2
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +60 -1
- package/pluggableElementTypes/models/BaseDisplayModel.js +138 -92
- package/pluggableElementTypes/models/baseConnectionConfig.js +17 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +27 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +3 -0
- package/pluggableElementTypes/models/baseTrackConfig.js +43 -1
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/BoxRendererType.js +2 -0
- package/rpc/MainThreadRpcDriver.d.ts +1 -1
- package/rpc/MainThreadRpcDriver.js +2 -2
- package/rpc/WebWorkerRpcDriver.d.ts +5 -4
- package/rpc/WebWorkerRpcDriver.js +2 -2
- package/rpc/baseRpcConfig.d.ts +2 -0
- package/rpc/baseRpcConfig.js +18 -0
- package/rpc/configSchema.js +16 -10
- package/rpc/coreRpcMethods.d.ts +14 -14
- package/rpc/coreRpcMethods.js +60 -63
- package/rpc/mainThreadRpcConfig.d.ts +2 -0
- package/rpc/mainThreadRpcConfig.js +19 -0
- package/rpc/webWorkerRpcConfig.d.ts +2 -0
- package/rpc/webWorkerRpcConfig.js +19 -0
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/AboutDialog.js +2 -1
- package/ui/App.js +8 -5
- package/ui/AssemblySelector.js +1 -1
- package/ui/DrawerWidget.js +2 -1
- package/ui/LoadingEllipses.d.ts +7 -0
- package/ui/LoadingEllipses.js +38 -0
- package/ui/index.d.ts +1 -0
- package/ui/index.js +3 -1
- package/util/Base1DUtils.js +9 -3
- package/util/calculateDynamicBlocks.js +1 -1
- package/util/calculateStaticBlocks.js +1 -1
- package/util/index.d.ts +1 -0
- package/util/index.js +13 -9
- package/util/io/RemoteFileWithRangeCache.d.ts +1 -2
- package/util/layouts/GranularRectLayout.d.ts +7 -2
- package/util/layouts/GranularRectLayout.js +29 -45
- package/util/layouts/MultiLayout.d.ts +2 -2
- package/util/layouts/MultiLayout.js +4 -6
- package/util/simpleFeature.d.ts +3 -0
- package/util/stats.d.ts +26 -0
- package/util/stats.js +9 -9
|
@@ -1,14 +1,26 @@
|
|
|
1
|
-
import { Instance } from 'mobx-state-tree';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import { Instance } from 'mobx-state-tree';
|
|
3
3
|
import { MenuItem } from '../../ui';
|
|
4
4
|
export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
5
|
+
/**
|
|
6
|
+
* #property
|
|
7
|
+
*/
|
|
5
8
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
9
|
+
/**
|
|
10
|
+
* #property
|
|
11
|
+
*/
|
|
6
12
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
13
|
+
/**
|
|
14
|
+
* #property
|
|
15
|
+
*/
|
|
7
16
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
8
17
|
}, {
|
|
9
18
|
rendererTypeName: string;
|
|
10
19
|
error: unknown;
|
|
11
20
|
} & {
|
|
21
|
+
/**
|
|
22
|
+
* #getter
|
|
23
|
+
*/
|
|
12
24
|
readonly RenderingComponent: React.FC<{
|
|
13
25
|
model: {
|
|
14
26
|
id: string;
|
|
@@ -18,8 +30,17 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
18
30
|
rendererTypeName: string;
|
|
19
31
|
error: unknown;
|
|
20
32
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
33
|
+
/**
|
|
34
|
+
* #property
|
|
35
|
+
*/
|
|
21
36
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
37
|
+
/**
|
|
38
|
+
* #property
|
|
39
|
+
*/
|
|
22
40
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
41
|
+
/**
|
|
42
|
+
* #property
|
|
43
|
+
*/
|
|
23
44
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
24
45
|
}, {
|
|
25
46
|
rendererTypeName: string;
|
|
@@ -28,6 +49,9 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
28
49
|
onHorizontalScroll?: Function | undefined;
|
|
29
50
|
blockState?: Record<string, any> | undefined;
|
|
30
51
|
}>;
|
|
52
|
+
/**
|
|
53
|
+
* #getter
|
|
54
|
+
*/
|
|
31
55
|
readonly DisplayBlurb: React.FC<{
|
|
32
56
|
model: {
|
|
33
57
|
id: string;
|
|
@@ -37,34 +61,59 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
37
61
|
rendererTypeName: string;
|
|
38
62
|
error: unknown;
|
|
39
63
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
64
|
+
/**
|
|
65
|
+
* #property
|
|
66
|
+
*/
|
|
40
67
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
68
|
+
/**
|
|
69
|
+
* #property
|
|
70
|
+
*/
|
|
41
71
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
72
|
+
/**
|
|
73
|
+
* #property
|
|
74
|
+
*/
|
|
42
75
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
43
76
|
}, {
|
|
44
77
|
rendererTypeName: string;
|
|
45
78
|
error: unknown;
|
|
46
79
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
47
80
|
}> | null;
|
|
81
|
+
/**
|
|
82
|
+
* #getter
|
|
83
|
+
*/
|
|
48
84
|
readonly adapterConfig: any;
|
|
85
|
+
/**
|
|
86
|
+
* #getter
|
|
87
|
+
*/
|
|
49
88
|
readonly parentTrack: any;
|
|
50
89
|
/**
|
|
90
|
+
* #method
|
|
51
91
|
* the react props that are passed to the Renderer when data
|
|
52
92
|
* is rendered in this display
|
|
53
93
|
*/
|
|
54
94
|
renderProps(): any;
|
|
55
95
|
/**
|
|
96
|
+
* #getter
|
|
56
97
|
* the pluggable element type object for this display's
|
|
57
98
|
* renderer
|
|
58
99
|
*/
|
|
59
100
|
readonly rendererType: import("..").RendererType;
|
|
60
101
|
/**
|
|
102
|
+
* #getter
|
|
61
103
|
* if a display-level message should be displayed instead,
|
|
62
104
|
* make this return a react component
|
|
63
105
|
*/
|
|
64
106
|
readonly DisplayMessageComponent: React.FC<any> | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* #method
|
|
109
|
+
*/
|
|
65
110
|
trackMenuItems(): MenuItem[];
|
|
111
|
+
/**
|
|
112
|
+
* #getter
|
|
113
|
+
*/
|
|
66
114
|
readonly viewMenuActions: MenuItem[];
|
|
67
115
|
/**
|
|
116
|
+
* #method
|
|
68
117
|
* @param region -
|
|
69
118
|
* @returns falsy if the region is fine to try rendering. Otherwise,
|
|
70
119
|
* return a react node + string of text.
|
|
@@ -73,8 +122,18 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
73
122
|
*/
|
|
74
123
|
regionCannotBeRendered(): undefined;
|
|
75
124
|
} & {
|
|
125
|
+
/**
|
|
126
|
+
* #action
|
|
127
|
+
*/
|
|
76
128
|
setError(error?: unknown): void;
|
|
129
|
+
/**
|
|
130
|
+
* #action
|
|
131
|
+
*/
|
|
77
132
|
setRpcDriverName(rpcDriverName: string): void;
|
|
133
|
+
/**
|
|
134
|
+
* #action
|
|
135
|
+
* base display reload does nothing, see specialized displays for details
|
|
136
|
+
*/
|
|
78
137
|
reload(): void;
|
|
79
138
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
80
139
|
export declare type BaseDisplayStateModel = typeof BaseDisplay;
|
|
@@ -1,101 +1,147 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseDisplay = void 0;
|
|
4
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
4
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
5
|
+
// locals
|
|
6
6
|
const configuration_1 = require("../../configuration");
|
|
7
7
|
const tracks_1 = require("../../util/tracks");
|
|
8
8
|
const util_1 = require("../../util");
|
|
9
9
|
const mst_1 = require("../../util/types/mst");
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
10
|
+
/**
|
|
11
|
+
* #stateModel BaseDisplay
|
|
12
|
+
*/
|
|
13
|
+
function stateModelFactory() {
|
|
14
|
+
return mobx_state_tree_1.types
|
|
15
|
+
.model('BaseDisplay', {
|
|
16
|
+
/**
|
|
17
|
+
* #property
|
|
18
|
+
*/
|
|
19
|
+
id: mst_1.ElementId,
|
|
20
|
+
/**
|
|
21
|
+
* #property
|
|
22
|
+
*/
|
|
23
|
+
type: mobx_state_tree_1.types.string,
|
|
24
|
+
/**
|
|
25
|
+
* #property
|
|
26
|
+
*/
|
|
27
|
+
rpcDriverName: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.string),
|
|
28
|
+
})
|
|
29
|
+
.volatile(() => ({
|
|
30
|
+
rendererTypeName: '',
|
|
31
|
+
error: undefined,
|
|
32
|
+
}))
|
|
33
|
+
.views(self => ({
|
|
34
|
+
/**
|
|
35
|
+
* #getter
|
|
36
|
+
*/
|
|
37
|
+
get RenderingComponent() {
|
|
38
|
+
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
39
|
+
const displayType = pluginManager.getDisplayType(self.type);
|
|
40
|
+
return displayType.ReactComponent;
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* #getter
|
|
44
|
+
*/
|
|
45
|
+
get DisplayBlurb() {
|
|
46
|
+
return null;
|
|
47
|
+
},
|
|
48
|
+
/**
|
|
49
|
+
* #getter
|
|
50
|
+
*/
|
|
51
|
+
get adapterConfig() {
|
|
52
|
+
return (0, configuration_1.getConf)(this.parentTrack, 'adapter');
|
|
53
|
+
},
|
|
54
|
+
/**
|
|
55
|
+
* #getter
|
|
56
|
+
*/
|
|
57
|
+
get parentTrack() {
|
|
58
|
+
let track = (0, mobx_state_tree_1.getParent)(self);
|
|
59
|
+
while (!(track.configuration && (0, configuration_1.getConf)(track, 'trackId'))) {
|
|
60
|
+
if ((0, mobx_state_tree_1.isRoot)(track)) {
|
|
61
|
+
throw new Error(`No parent track found for ${self.type} ${self.id}`);
|
|
62
|
+
}
|
|
63
|
+
track = (0, mobx_state_tree_1.getParent)(track);
|
|
37
64
|
}
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
65
|
+
return track;
|
|
66
|
+
},
|
|
67
|
+
/**
|
|
68
|
+
* #method
|
|
69
|
+
* the react props that are passed to the Renderer when data
|
|
70
|
+
* is rendered in this display
|
|
71
|
+
*/
|
|
72
|
+
renderProps() {
|
|
73
|
+
return {
|
|
74
|
+
...(0, tracks_1.getParentRenderProps)(self),
|
|
75
|
+
rpcDriverName: self.rpcDriverName,
|
|
76
|
+
displayModel: self,
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
/**
|
|
80
|
+
* #getter
|
|
81
|
+
* the pluggable element type object for this display's
|
|
82
|
+
* renderer
|
|
83
|
+
*/
|
|
84
|
+
get rendererType() {
|
|
85
|
+
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
86
|
+
const RendererType = pluginManager.getRendererType(self.rendererTypeName);
|
|
87
|
+
if (!RendererType) {
|
|
88
|
+
throw new Error(`renderer "${self.rendererTypeName}" not found`);
|
|
89
|
+
}
|
|
90
|
+
if (!RendererType.ReactComponent) {
|
|
91
|
+
throw new Error(`renderer ${self.rendererTypeName} has no ReactComponent, it may not be completely implemented yet`);
|
|
92
|
+
}
|
|
93
|
+
return RendererType;
|
|
94
|
+
},
|
|
95
|
+
/**
|
|
96
|
+
* #getter
|
|
97
|
+
* if a display-level message should be displayed instead,
|
|
98
|
+
* make this return a react component
|
|
99
|
+
*/
|
|
100
|
+
get DisplayMessageComponent() {
|
|
101
|
+
return undefined;
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* #method
|
|
105
|
+
*/
|
|
106
|
+
trackMenuItems() {
|
|
107
|
+
return [];
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* #getter
|
|
111
|
+
*/
|
|
112
|
+
get viewMenuActions() {
|
|
113
|
+
return [];
|
|
114
|
+
},
|
|
115
|
+
/**
|
|
116
|
+
* #method
|
|
117
|
+
* @param region -
|
|
118
|
+
* @returns falsy if the region is fine to try rendering. Otherwise,
|
|
119
|
+
* return a react node + string of text.
|
|
120
|
+
* string of text describes why it cannot be rendered
|
|
121
|
+
* react node allows user to force load at current setting
|
|
122
|
+
*/
|
|
123
|
+
regionCannotBeRendered( /* region */) {
|
|
124
|
+
return undefined;
|
|
125
|
+
},
|
|
126
|
+
}))
|
|
127
|
+
.actions(self => ({
|
|
128
|
+
/**
|
|
129
|
+
* #action
|
|
130
|
+
*/
|
|
131
|
+
setError(error) {
|
|
132
|
+
self.error = error;
|
|
133
|
+
},
|
|
134
|
+
/**
|
|
135
|
+
* #action
|
|
136
|
+
*/
|
|
137
|
+
setRpcDriverName(rpcDriverName) {
|
|
138
|
+
self.rpcDriverName = rpcDriverName;
|
|
139
|
+
},
|
|
140
|
+
/**
|
|
141
|
+
* #action
|
|
142
|
+
* base display reload does nothing, see specialized displays for details
|
|
143
|
+
*/
|
|
144
|
+
reload() { },
|
|
145
|
+
}));
|
|
146
|
+
}
|
|
147
|
+
exports.BaseDisplay = stateModelFactory();
|
|
@@ -1,15 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const configuration_1 = require("../../configuration");
|
|
4
|
+
/**
|
|
5
|
+
* #config BaseConnection
|
|
6
|
+
*/
|
|
7
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
4
8
|
exports.default = (0, configuration_1.ConfigurationSchema)('BaseConnection', {
|
|
9
|
+
/**
|
|
10
|
+
* #slot
|
|
11
|
+
*/
|
|
5
12
|
name: {
|
|
6
13
|
type: 'string',
|
|
7
14
|
defaultValue: 'nameOfConnection',
|
|
8
15
|
description: 'a unique name for this connection',
|
|
9
16
|
},
|
|
17
|
+
/**
|
|
18
|
+
* #slot
|
|
19
|
+
*/
|
|
10
20
|
assemblyNames: {
|
|
11
21
|
type: 'stringArray',
|
|
12
22
|
defaultValue: [],
|
|
13
23
|
description: 'optional list of names of assemblies in this connection',
|
|
14
24
|
},
|
|
15
|
-
}, {
|
|
25
|
+
}, {
|
|
26
|
+
explicitlyTyped: true,
|
|
27
|
+
/**
|
|
28
|
+
* #identifier
|
|
29
|
+
*/
|
|
30
|
+
explicitIdentifier: 'connectionId',
|
|
31
|
+
});
|
|
@@ -2,30 +2,56 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.BaseInternetAccountConfig = void 0;
|
|
4
4
|
const configuration_1 = require("../../configuration");
|
|
5
|
+
/**
|
|
6
|
+
* #config InternetAccount
|
|
7
|
+
* the "base" internet account type
|
|
8
|
+
*/
|
|
9
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
5
10
|
exports.BaseInternetAccountConfig = (0, configuration_1.ConfigurationSchema)('InternetAccount', {
|
|
11
|
+
/**
|
|
12
|
+
* #slot
|
|
13
|
+
*/
|
|
6
14
|
name: {
|
|
7
15
|
description: 'descriptive name of the internet account',
|
|
8
16
|
type: 'string',
|
|
9
17
|
defaultValue: '',
|
|
10
18
|
},
|
|
19
|
+
/**
|
|
20
|
+
* #slot
|
|
21
|
+
*/
|
|
11
22
|
description: {
|
|
12
23
|
description: 'a description of the internet account',
|
|
13
24
|
type: 'string',
|
|
14
25
|
defaultValue: '',
|
|
15
26
|
},
|
|
27
|
+
/**
|
|
28
|
+
* #slot
|
|
29
|
+
*/
|
|
16
30
|
authHeader: {
|
|
17
31
|
description: 'request header for credentials',
|
|
18
32
|
type: 'string',
|
|
19
33
|
defaultValue: 'Authorization',
|
|
20
34
|
},
|
|
35
|
+
/**
|
|
36
|
+
* #slot
|
|
37
|
+
*/
|
|
21
38
|
tokenType: {
|
|
22
39
|
description: 'a custom name for a token to include in the header',
|
|
23
40
|
type: 'string',
|
|
24
41
|
defaultValue: '',
|
|
25
42
|
},
|
|
43
|
+
/**
|
|
44
|
+
* #slot
|
|
45
|
+
*/
|
|
26
46
|
domains: {
|
|
27
47
|
description: 'array of valid domains the url can contain to use this account',
|
|
28
48
|
type: 'stringArray',
|
|
29
49
|
defaultValue: [],
|
|
30
50
|
},
|
|
31
|
-
}, {
|
|
51
|
+
}, {
|
|
52
|
+
/**
|
|
53
|
+
* #identifier
|
|
54
|
+
*/
|
|
55
|
+
explicitIdentifier: 'internetAccountId',
|
|
56
|
+
explicitlyTyped: true,
|
|
57
|
+
});
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Instance } from 'mobx-state-tree';
|
|
2
2
|
import PluginManager from '../../PluginManager';
|
|
3
|
+
/**
|
|
4
|
+
* #config BaseTrack
|
|
5
|
+
*/
|
|
3
6
|
export declare function createBaseTrackConfig(pluginManager: PluginManager): import("../../configuration").AnyConfigurationSchemaType;
|
|
4
7
|
export declare type BaseTrackConfigModel = ReturnType<typeof createBaseTrackConfig>;
|
|
5
8
|
export declare type BaseTrackConfig = Instance<BaseTrackConfigModel>;
|
|
@@ -4,65 +4,107 @@ exports.createBaseTrackConfig = void 0;
|
|
|
4
4
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
5
5
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
6
|
const configuration_1 = require("../../configuration");
|
|
7
|
+
/**
|
|
8
|
+
* #config BaseTrack
|
|
9
|
+
*/
|
|
7
10
|
function createBaseTrackConfig(pluginManager) {
|
|
8
11
|
return (0, configuration_1.ConfigurationSchema)('BaseTrack', {
|
|
12
|
+
/**
|
|
13
|
+
* #slot
|
|
14
|
+
*/
|
|
9
15
|
name: {
|
|
10
16
|
description: 'descriptive name of the track',
|
|
11
17
|
type: 'string',
|
|
12
18
|
defaultValue: 'Track',
|
|
13
19
|
},
|
|
20
|
+
/**
|
|
21
|
+
* #slot
|
|
22
|
+
*/
|
|
14
23
|
assemblyNames: {
|
|
15
24
|
description: 'name of the assembly (or assemblies) track belongs to',
|
|
16
25
|
type: 'stringArray',
|
|
17
26
|
defaultValue: ['assemblyName'],
|
|
18
27
|
},
|
|
28
|
+
/**
|
|
29
|
+
* #slot
|
|
30
|
+
*/
|
|
19
31
|
description: {
|
|
20
32
|
description: 'a description of the track',
|
|
21
33
|
type: 'string',
|
|
22
34
|
defaultValue: '',
|
|
23
35
|
},
|
|
36
|
+
/**
|
|
37
|
+
* #slot
|
|
38
|
+
*/
|
|
24
39
|
category: {
|
|
25
40
|
description: 'the category and sub-categories of a track',
|
|
26
41
|
type: 'stringArray',
|
|
27
42
|
defaultValue: [],
|
|
28
43
|
},
|
|
44
|
+
/**
|
|
45
|
+
* #slot
|
|
46
|
+
*/
|
|
29
47
|
metadata: {
|
|
30
48
|
type: 'frozen',
|
|
31
49
|
description: 'anything to add about this track',
|
|
32
50
|
defaultValue: {},
|
|
33
51
|
},
|
|
52
|
+
/**
|
|
53
|
+
* #slot
|
|
54
|
+
*/
|
|
34
55
|
adapter: pluginManager.pluggableConfigSchemaType('adapter'),
|
|
35
56
|
textSearching: (0, configuration_1.ConfigurationSchema)('textSearching', {
|
|
57
|
+
/**
|
|
58
|
+
* #slot textSearching.indexedAttributes
|
|
59
|
+
*/
|
|
36
60
|
indexingAttributes: {
|
|
37
61
|
type: 'stringArray',
|
|
38
62
|
description: 'list of which feature attributes to index for text searching',
|
|
39
63
|
defaultValue: ['Name', 'ID'],
|
|
40
64
|
},
|
|
65
|
+
/**
|
|
66
|
+
* #slot textSearching.indexingFeatureTypesToExclude
|
|
67
|
+
*/
|
|
41
68
|
indexingFeatureTypesToExclude: {
|
|
42
69
|
type: 'stringArray',
|
|
43
70
|
description: 'list of feature types to exclude in text search index',
|
|
44
71
|
defaultValue: ['CDS', 'exon'],
|
|
45
72
|
},
|
|
73
|
+
/**
|
|
74
|
+
* #slot textSearching.textSearchAdapter
|
|
75
|
+
*/
|
|
46
76
|
textSearchAdapter: pluginManager.pluggableConfigSchemaType('text search adapter'),
|
|
47
77
|
}),
|
|
78
|
+
/**
|
|
79
|
+
* #slot
|
|
80
|
+
*/
|
|
48
81
|
displays: mobx_state_tree_1.types.array(pluginManager.pluggableConfigSchemaType('display')),
|
|
49
82
|
formatDetails: (0, configuration_1.ConfigurationSchema)('FormatDetails', {
|
|
83
|
+
/**
|
|
84
|
+
* #slot formatDetails.feature
|
|
85
|
+
*/
|
|
50
86
|
feature: {
|
|
51
87
|
type: 'frozen',
|
|
52
88
|
description: 'adds extra fields to the feature details',
|
|
53
89
|
defaultValue: {},
|
|
54
90
|
contextVariable: ['feature'],
|
|
55
91
|
},
|
|
92
|
+
/**
|
|
93
|
+
* #slot formatDetails.subfeatures
|
|
94
|
+
*/
|
|
56
95
|
subfeatures: {
|
|
57
96
|
type: 'frozen',
|
|
58
97
|
description: 'adds extra fields to the subfeatures of a feature',
|
|
59
98
|
defaultValue: {},
|
|
60
99
|
contextVariable: ['feature'],
|
|
61
100
|
},
|
|
101
|
+
/**
|
|
102
|
+
* #slot formatDetails.depth
|
|
103
|
+
*/
|
|
62
104
|
depth: {
|
|
63
105
|
type: 'number',
|
|
64
106
|
defaultValue: 2,
|
|
65
|
-
description: 'depth to iterate on subfeatures',
|
|
107
|
+
description: 'depth of subfeatures to iterate the formatter on formatDetails.subfeatures (e.g. you may not want to format the exon/cds subfeatures, so limited to 2',
|
|
66
108
|
},
|
|
67
109
|
}),
|
|
68
110
|
formatAbout: (0, configuration_1.ConfigurationSchema)('FormatAbout', {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import GranularRectLayout from '../../util/layouts/GranularRectLayout';
|
|
2
2
|
import MultiLayout from '../../util/layouts/MultiLayout';
|
|
3
|
+
import { SerializedLayout, BaseLayout } from '../../util/layouts/BaseLayout';
|
|
3
4
|
import PrecomputedLayout from '../../util/layouts/PrecomputedLayout';
|
|
4
5
|
import FeatureRendererType, { RenderArgs as FeatureRenderArgs, RenderArgsSerialized as FeatureRenderArgsSerialized, RenderArgsDeserialized as FeatureRenderArgsDeserialized, RenderResults as FeatureRenderResults, ResultsSerialized as FeatureResultsSerialized, ResultsDeserialized as FeatureResultsDeserialized } from './FeatureRendererType';
|
|
5
6
|
import { Region, Feature } from '../../util';
|
|
6
|
-
import { SerializedLayout, BaseLayout } from '../../util/layouts/BaseLayout';
|
|
7
7
|
import { AnyConfigurationModel } from '../../configuration';
|
|
8
8
|
import SerializableFilterChain from './util/serializableFilterChain';
|
|
9
9
|
import RpcManager from '../../rpc/RpcManager';
|
|
@@ -5,9 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LayoutSession = void 0;
|
|
7
7
|
const fast_deep_equal_1 = __importDefault(require("fast-deep-equal"));
|
|
8
|
+
// layouts
|
|
8
9
|
const GranularRectLayout_1 = __importDefault(require("../../util/layouts/GranularRectLayout"));
|
|
9
10
|
const MultiLayout_1 = __importDefault(require("../../util/layouts/MultiLayout"));
|
|
10
11
|
const PrecomputedLayout_1 = __importDefault(require("../../util/layouts/PrecomputedLayout"));
|
|
12
|
+
// other
|
|
11
13
|
const FeatureRendererType_1 = __importDefault(require("./FeatureRendererType"));
|
|
12
14
|
const util_1 = require("../../util");
|
|
13
15
|
const configuration_1 = require("../../configuration");
|
|
@@ -13,6 +13,6 @@ export default class MainThreadRpcDriver extends BaseRpcDriver {
|
|
|
13
13
|
name: string;
|
|
14
14
|
makeWorker: () => Promise<DummyHandle>;
|
|
15
15
|
constructor(args: RpcDriverConstructorArgs);
|
|
16
|
-
call(
|
|
16
|
+
call(pm: PluginManager, sessionId: string, funcName: string, args: {}): Promise<unknown>;
|
|
17
17
|
}
|
|
18
18
|
export {};
|
|
@@ -21,11 +21,11 @@ class MainThreadRpcDriver extends BaseRpcDriver_1.default {
|
|
|
21
21
|
this.name = 'MainThreadRpcDriver';
|
|
22
22
|
this.makeWorker = async () => new DummyHandle();
|
|
23
23
|
}
|
|
24
|
-
async call(
|
|
24
|
+
async call(pm, sessionId, funcName, args) {
|
|
25
25
|
if (!sessionId) {
|
|
26
26
|
throw new TypeError('sessionId is required');
|
|
27
27
|
}
|
|
28
|
-
const rpcMethod =
|
|
28
|
+
const rpcMethod = pm.getRpcMethodType(funcName);
|
|
29
29
|
const serializedArgs = await rpcMethod.serializeArguments(args, this.name);
|
|
30
30
|
const result = await rpcMethod.execute(serializedArgs, this.name);
|
|
31
31
|
return rpcMethod.deserializeReturn(result, args, this.name);
|
|
@@ -4,12 +4,13 @@ import { PluginDefinition } from '../PluginLoader';
|
|
|
4
4
|
interface WebWorkerRpcDriverConstructorArgs extends RpcDriverConstructorArgs {
|
|
5
5
|
makeWorkerInstance: () => Worker;
|
|
6
6
|
}
|
|
7
|
+
interface Options {
|
|
8
|
+
statusCallback?: (arg0: string) => void;
|
|
9
|
+
rpcDriverClassName: string;
|
|
10
|
+
}
|
|
7
11
|
declare class WebWorkerHandle extends Rpc.Client {
|
|
8
12
|
destroy(): void;
|
|
9
|
-
call(
|
|
10
|
-
statusCallback?: (arg0: string) => void;
|
|
11
|
-
rpcDriverClassName: string;
|
|
12
|
-
}): Promise<any>;
|
|
13
|
+
call(funcName: string, args: Record<string, unknown>, opts: Options): Promise<any>;
|
|
13
14
|
}
|
|
14
15
|
export default class WebWorkerRpcDriver extends BaseRpcDriver {
|
|
15
16
|
workerBootConfiguration: {
|
|
@@ -12,14 +12,14 @@ class WebWorkerHandle extends librpc_web_mod_1.default.Client {
|
|
|
12
12
|
destroy() {
|
|
13
13
|
this.workers[0].terminate();
|
|
14
14
|
}
|
|
15
|
-
async call(
|
|
15
|
+
async call(funcName, args, opts) {
|
|
16
16
|
const { statusCallback, rpcDriverClassName } = opts;
|
|
17
17
|
const channel = `message-${shortid_1.default.generate()}`;
|
|
18
18
|
const listener = (message) => {
|
|
19
19
|
statusCallback === null || statusCallback === void 0 ? void 0 : statusCallback(message);
|
|
20
20
|
};
|
|
21
21
|
this.on(channel, listener);
|
|
22
|
-
const result = await super.call(
|
|
22
|
+
const result = await super.call(funcName, { ...args, channel, rpcDriverClassName }, opts);
|
|
23
23
|
this.off(channel, listener);
|
|
24
24
|
return result;
|
|
25
25
|
}
|