@jbrowse/core 2.1.7 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BaseFeatureWidget/BaseFeatureDetail.d.ts +3 -2
- package/BaseFeatureWidget/BaseFeatureDetail.js +43 -28
- package/BaseFeatureWidget/SequenceBox.js +4 -8
- package/BaseFeatureWidget/SequenceFeatureDetails.js +2 -1
- package/Plugin.d.ts +1 -1
- package/PluginLoader.d.ts +2 -2
- package/PluginManager.d.ts +6 -6
- package/ReExports/modules.d.ts +3 -3
- package/assemblyManager/assembly.d.ts +23 -17
- package/assemblyManager/assembly.js +75 -76
- 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/configuration/configurationSchema.d.ts +2 -2
- package/data_adapters/BaseAdapter.d.ts +2 -2
- package/data_adapters/CytobandAdapter.js +7 -0
- package/data_adapters/dataAdapterCache.d.ts +1 -1
- package/package.json +2 -2
- package/pluggableElementTypes/AdapterType.d.ts +1 -1
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +2 -2
- package/pluggableElementTypes/RpcMethodType.d.ts +1 -1
- package/pluggableElementTypes/ViewType.d.ts +2 -2
- package/pluggableElementTypes/index.d.ts +2 -2
- package/pluggableElementTypes/models/BaseConnectionModelFactory.d.ts +23 -2
- package/pluggableElementTypes/models/BaseConnectionModelFactory.js +24 -2
- package/pluggableElementTypes/models/BaseDisplayModel.d.ts +62 -3
- package/pluggableElementTypes/models/BaseDisplayModel.js +138 -92
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +49 -4
- package/pluggableElementTypes/models/BaseTrackModel.js +77 -26
- package/pluggableElementTypes/models/BaseViewModel.d.ts +22 -0
- package/pluggableElementTypes/models/BaseViewModel.js +41 -2
- package/pluggableElementTypes/models/InternetAccountModel.d.ts +53 -6
- package/pluggableElementTypes/models/InternetAccountModel.js +57 -6
- package/pluggableElementTypes/models/baseConnectionConfig.js +17 -1
- package/pluggableElementTypes/models/baseInternetAccountConfig.d.ts +2 -2
- package/pluggableElementTypes/models/baseInternetAccountConfig.js +27 -1
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +5 -2
- package/pluggableElementTypes/models/baseTrackConfig.js +52 -1
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +2 -2
- package/pluggableElementTypes/renderers/BoxRendererType.js +2 -0
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +1 -1
- package/pluggableElementTypes/renderers/util/serializableFilterChain.d.ts +2 -2
- package/rpc/MainThreadRpcDriver.d.ts +1 -1
- package/rpc/MainThreadRpcDriver.js +2 -2
- package/rpc/RpcManager.d.ts +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/remoteAbortSignals.d.ts +1 -1
- 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.d.ts +2 -2
- package/ui/App.js +11 -10
- package/ui/AssemblySelector.d.ts +1 -1
- package/ui/AssemblySelector.js +12 -10
- package/ui/DrawerWidget.js +2 -1
- package/ui/EditableTypography.d.ts +4 -4
- package/ui/EditableTypography.js +7 -11
- package/ui/LoadingEllipses.d.ts +7 -0
- package/ui/LoadingEllipses.js +38 -0
- package/ui/Logo.d.ts +1 -1
- package/ui/Menu.d.ts +2 -2
- package/ui/Snackbar.d.ts +1 -1
- package/ui/ViewContainer.d.ts +2 -1
- package/ui/ViewContainer.js +34 -22
- package/ui/index.d.ts +1 -0
- package/ui/index.js +3 -1
- package/util/Base1DUtils.js +9 -3
- package/util/Base1DViewModel.d.ts +72 -2
- package/util/Base1DViewModel.js +94 -3
- package/util/blockTypes.d.ts +1 -1
- package/util/calculateDynamicBlocks.js +1 -1
- package/util/calculateStaticBlocks.js +1 -1
- package/util/index.d.ts +3 -1
- package/util/index.js +19 -9
- package/util/io/RemoteFileWithRangeCache.d.ts +1 -2
- package/util/io/RemoteFileWithRangeCache.js +2 -2
- package/util/io/index.js +3 -3
- package/util/jexl.d.ts +1 -1
- package/util/layouts/BaseLayout.d.ts +1 -1
- 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/offscreenCanvasPonyfill.d.ts +2 -2
- package/util/offscreenCanvasUtils.d.ts +1 -1
- package/util/simpleFeature.d.ts +3 -0
- package/util/stats.d.ts +26 -0
- package/util/stats.js +9 -9
- package/util/tracks.d.ts +2 -2
- package/util/types/index.d.ts +15 -8
- package/util/types/index.js +8 -1
- package/util/types/util.d.ts +5 -5
|
@@ -6,37 +6,67 @@ const configuration_1 = require("../../configuration");
|
|
|
6
6
|
const io_1 = require("../../util/io");
|
|
7
7
|
const mst_1 = require("../../util/types/mst");
|
|
8
8
|
const inWebWorker = typeof sessionStorage === 'undefined';
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel BaseInternetAccountModel
|
|
11
|
+
*/
|
|
12
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
13
|
exports.InternetAccount = mobx_state_tree_1.types
|
|
10
14
|
.model('InternetAccount', {
|
|
15
|
+
/**
|
|
16
|
+
* #property
|
|
17
|
+
*/
|
|
11
18
|
id: mst_1.ElementId,
|
|
19
|
+
/**
|
|
20
|
+
* #property
|
|
21
|
+
*/
|
|
12
22
|
type: mobx_state_tree_1.types.string,
|
|
13
23
|
})
|
|
14
24
|
.views(self => ({
|
|
25
|
+
/**
|
|
26
|
+
* #getter
|
|
27
|
+
*/
|
|
15
28
|
get name() {
|
|
16
29
|
return (0, configuration_1.getConf)(self, 'name');
|
|
17
30
|
},
|
|
31
|
+
/**
|
|
32
|
+
* #getter
|
|
33
|
+
*/
|
|
18
34
|
get description() {
|
|
19
35
|
return (0, configuration_1.getConf)(self, 'description');
|
|
20
36
|
},
|
|
37
|
+
/**
|
|
38
|
+
* #getter
|
|
39
|
+
*/
|
|
21
40
|
get internetAccountId() {
|
|
22
41
|
return (0, configuration_1.getConf)(self, 'internetAccountId');
|
|
23
42
|
},
|
|
43
|
+
/**
|
|
44
|
+
* #getter
|
|
45
|
+
*/
|
|
24
46
|
get authHeader() {
|
|
25
47
|
return (0, configuration_1.getConf)(self, 'authHeader');
|
|
26
48
|
},
|
|
49
|
+
/**
|
|
50
|
+
* #getter
|
|
51
|
+
*/
|
|
27
52
|
get tokenType() {
|
|
28
53
|
return (0, configuration_1.getConf)(self, 'tokenType');
|
|
29
54
|
},
|
|
55
|
+
/**
|
|
56
|
+
* #getter
|
|
57
|
+
*/
|
|
30
58
|
get domains() {
|
|
31
59
|
return (0, configuration_1.getConf)(self, 'domains');
|
|
32
60
|
},
|
|
33
61
|
/**
|
|
62
|
+
* #getter
|
|
34
63
|
* Can use this to customize what is displayed in fileSelector's toggle box
|
|
35
64
|
*/
|
|
36
65
|
get toggleContents() {
|
|
37
66
|
return null;
|
|
38
67
|
},
|
|
39
68
|
/**
|
|
69
|
+
* #getter
|
|
40
70
|
* Can use this to customize what the fileSelector. It takes a prop called
|
|
41
71
|
* `setLocation` that should be used to set a UriLocation
|
|
42
72
|
*/
|
|
@@ -44,6 +74,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
44
74
|
return undefined;
|
|
45
75
|
},
|
|
46
76
|
/**
|
|
77
|
+
* #getter
|
|
47
78
|
* Can use this to add a label to the UrlChooser. Has no effect if a custom
|
|
48
79
|
* SelectorComponent is supplied
|
|
49
80
|
*/
|
|
@@ -53,14 +84,16 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
53
84
|
}))
|
|
54
85
|
.views(self => ({
|
|
55
86
|
/**
|
|
87
|
+
* #method
|
|
56
88
|
* Determine whether this internetAccount provides credentials for a URL
|
|
57
89
|
* @param location - UriLocation of resource
|
|
58
90
|
* @returns true or false
|
|
59
91
|
*/
|
|
60
92
|
handlesLocation(location) {
|
|
61
|
-
return self.domains.some(
|
|
93
|
+
return self.domains.some(domain => location === null || location === void 0 ? void 0 : location.uri.includes(domain));
|
|
62
94
|
},
|
|
63
95
|
/**
|
|
96
|
+
* #getter
|
|
64
97
|
* The key used to store this internetAccount's token in sessionStorage
|
|
65
98
|
*/
|
|
66
99
|
get tokenKey() {
|
|
@@ -69,6 +102,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
69
102
|
}))
|
|
70
103
|
.actions(self => ({
|
|
71
104
|
/**
|
|
105
|
+
* #action
|
|
72
106
|
* Must be implemented by a model extending or composing this one. Pass the
|
|
73
107
|
* user's token to `resolve`.
|
|
74
108
|
* @param resolve - Pass the token to this function
|
|
@@ -77,16 +111,26 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
77
111
|
getTokenFromUser(resolve, reject) {
|
|
78
112
|
throw new Error('getTokenFromUser must be implemented by extending model');
|
|
79
113
|
},
|
|
114
|
+
/**
|
|
115
|
+
* #action
|
|
116
|
+
*/
|
|
80
117
|
storeToken(token) {
|
|
81
118
|
sessionStorage.setItem(self.tokenKey, token);
|
|
82
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* #action
|
|
122
|
+
*/
|
|
83
123
|
removeToken() {
|
|
84
124
|
sessionStorage.removeItem(self.tokenKey);
|
|
85
125
|
},
|
|
126
|
+
/**
|
|
127
|
+
* #action
|
|
128
|
+
*/
|
|
86
129
|
retrieveToken() {
|
|
87
130
|
return sessionStorage.getItem(self.tokenKey);
|
|
88
131
|
},
|
|
89
132
|
/**
|
|
133
|
+
* #action
|
|
90
134
|
* This can be used by an internetAccount to validate a token works before
|
|
91
135
|
* it is used. This is run when preAuthorizationInformation is requested, so
|
|
92
136
|
* it can be used to check that a token is valid before sending it to a
|
|
@@ -95,10 +139,10 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
95
139
|
* if the original one was invalid. Should throw an error if a token is
|
|
96
140
|
* invalid.
|
|
97
141
|
* @param token - Auth token
|
|
98
|
-
* @param
|
|
142
|
+
* @param loc - UriLocation of the resource
|
|
99
143
|
* @returns - Valid auth token
|
|
100
144
|
*/
|
|
101
|
-
async validateToken(token,
|
|
145
|
+
async validateToken(token, loc) {
|
|
102
146
|
return token;
|
|
103
147
|
},
|
|
104
148
|
}))
|
|
@@ -106,6 +150,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
106
150
|
let tokenPromise = undefined;
|
|
107
151
|
return {
|
|
108
152
|
/**
|
|
153
|
+
* #action
|
|
109
154
|
* Try to get the token from the location pre-auth, from local storage,
|
|
110
155
|
* or from a previously cached promise. If token is not available, uses
|
|
111
156
|
* `getTokenFromUser`.
|
|
@@ -146,6 +191,9 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
146
191
|
};
|
|
147
192
|
})
|
|
148
193
|
.actions(self => ({
|
|
194
|
+
/**
|
|
195
|
+
* #action
|
|
196
|
+
*/
|
|
149
197
|
addAuthHeaderToInit(init = {}, token) {
|
|
150
198
|
const tokenInfoString = self.tokenType
|
|
151
199
|
? `${self.tokenType} ${token}`
|
|
@@ -155,6 +203,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
155
203
|
return { ...init, headers: newHeaders };
|
|
156
204
|
},
|
|
157
205
|
/**
|
|
206
|
+
* #action
|
|
158
207
|
* Gets the token and returns it along with the information needed to
|
|
159
208
|
* create a new internetAccount.
|
|
160
209
|
* @param location - UriLocation of the resource
|
|
@@ -178,15 +227,16 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
178
227
|
}))
|
|
179
228
|
.actions(self => ({
|
|
180
229
|
/**
|
|
230
|
+
* #action
|
|
181
231
|
* Get a fetch method that will add any needed authentication headers to
|
|
182
232
|
* the request before sending it. If location is provided, it will be
|
|
183
233
|
* checked to see if it includes a token in it pre-auth information.
|
|
184
|
-
* @param
|
|
234
|
+
* @param loc - UriLocation of the resource
|
|
185
235
|
* @returns A function that can be used to fetch
|
|
186
236
|
*/
|
|
187
|
-
getFetcher(
|
|
237
|
+
getFetcher(loc) {
|
|
188
238
|
return async (input, init) => {
|
|
189
|
-
const authToken = await self.getToken(
|
|
239
|
+
const authToken = await self.getToken(loc);
|
|
190
240
|
const newInit = self.addAuthHeaderToInit(init, authToken);
|
|
191
241
|
return fetch(input, newInit);
|
|
192
242
|
};
|
|
@@ -194,6 +244,7 @@ exports.InternetAccount = mobx_state_tree_1.types
|
|
|
194
244
|
}))
|
|
195
245
|
.actions(self => ({
|
|
196
246
|
/**
|
|
247
|
+
* #action
|
|
197
248
|
* Gets a filehandle that uses a fetch that adds auth headers
|
|
198
249
|
* @param location - UriLocation of the resource
|
|
199
250
|
* @returns A filehandle
|
|
@@ -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
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Instance } from 'mobx-state-tree';
|
|
2
2
|
export declare const BaseInternetAccountConfig: import("../../configuration").AnyConfigurationSchemaType;
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type BaseInternetAccountConfigModel = typeof BaseInternetAccountConfig;
|
|
4
|
+
export type BaseInternetAccountConfig = Instance<BaseInternetAccountConfigModel>;
|
|
@@ -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
|
-
export
|
|
5
|
-
export
|
|
7
|
+
export type BaseTrackConfigModel = ReturnType<typeof createBaseTrackConfig>;
|
|
8
|
+
export type BaseTrackConfig = Instance<BaseTrackConfigModel>;
|
|
@@ -4,74 +4,122 @@ 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', {
|
|
111
|
+
/**
|
|
112
|
+
* #slot formatAbout.config
|
|
113
|
+
*/
|
|
69
114
|
config: {
|
|
70
115
|
type: 'frozen',
|
|
71
116
|
description: 'formats configuration object in about dialog',
|
|
72
117
|
defaultValue: {},
|
|
73
118
|
contextVariable: ['config'],
|
|
74
119
|
},
|
|
120
|
+
/**
|
|
121
|
+
* #slot formatAbout.hideUris
|
|
122
|
+
*/
|
|
75
123
|
hideUris: {
|
|
76
124
|
type: 'boolean',
|
|
77
125
|
defaultValue: false,
|
|
@@ -99,6 +147,9 @@ function createBaseTrackConfig(pluginManager) {
|
|
|
99
147
|
}
|
|
100
148
|
return { ...snap, displays };
|
|
101
149
|
},
|
|
150
|
+
/**
|
|
151
|
+
* #identifier
|
|
152
|
+
*/
|
|
102
153
|
explicitIdentifier: 'trackId',
|
|
103
154
|
explicitlyTyped: true,
|
|
104
155
|
actions: (self) => ({
|
|
@@ -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';
|
|
@@ -12,7 +12,7 @@ export interface LayoutSessionProps {
|
|
|
12
12
|
bpPerPx: number;
|
|
13
13
|
filters: SerializableFilterChain;
|
|
14
14
|
}
|
|
15
|
-
export
|
|
15
|
+
export type MyMultiLayout = MultiLayout<GranularRectLayout<unknown>, unknown>;
|
|
16
16
|
export interface CachedLayout {
|
|
17
17
|
layout: MyMultiLayout;
|
|
18
18
|
config: AnyConfigurationModel;
|
|
@@ -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");
|
|
@@ -14,7 +14,7 @@ export interface RenderArgsDeserialized extends ServerSideRenderArgsDeserialized
|
|
|
14
14
|
blockKey: string;
|
|
15
15
|
}
|
|
16
16
|
export type { RenderResults };
|
|
17
|
-
export
|
|
17
|
+
export type ResultsSerialized = ServerSideResultsSerialized;
|
|
18
18
|
export interface ResultsDeserialized extends ServerSideResultsDeserialized {
|
|
19
19
|
blockKey: string;
|
|
20
20
|
}
|
|
@@ -3,7 +3,7 @@ import PluggableElementBase from '../PluggableElementBase';
|
|
|
3
3
|
import { AnyConfigurationSchemaType } from '../../configuration/configurationSchema';
|
|
4
4
|
import { AnyReactComponentType } from '../../util';
|
|
5
5
|
import PluginManager from '../../PluginManager';
|
|
6
|
-
export
|
|
6
|
+
export type RenderProps = Record<string, unknown>;
|
|
7
7
|
export interface RenderResults {
|
|
8
8
|
reactElement?: ReactElement;
|
|
9
9
|
html?: string;
|
|
@@ -35,7 +35,7 @@ export interface ResultsSerializedSvgExport extends ResultsSerialized {
|
|
|
35
35
|
height: number;
|
|
36
36
|
reactElement: unknown;
|
|
37
37
|
}
|
|
38
|
-
export
|
|
38
|
+
export type ResultsDeserialized = RenderResults;
|
|
39
39
|
export default class ServerSideRenderer extends RendererType {
|
|
40
40
|
/**
|
|
41
41
|
* directly modifies the render arguments to prepare them to be serialized and
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
type FilterExpression = (...args: Record<string, any>[] | any[]) => boolean;
|
|
2
2
|
interface Filter {
|
|
3
3
|
string: string;
|
|
4
4
|
expr: FilterExpression;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type SerializedFilterChain = string[];
|
|
7
7
|
export default class SerializableFilterChain {
|
|
8
8
|
filterChain: Filter[];
|
|
9
9
|
constructor({ filters }: {
|
|
@@ -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);
|
package/rpc/RpcManager.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import PluginManager from '../PluginManager';
|
|
|
2
2
|
import { AnyConfigurationModel } from '../configuration';
|
|
3
3
|
import WebWorkerRpcDriver from './WebWorkerRpcDriver';
|
|
4
4
|
import MainThreadRpcDriver from './MainThreadRpcDriver';
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type DriverClass = WebWorkerRpcDriver | MainThreadRpcDriver;
|
|
6
|
+
type BackendConfigurations = {
|
|
7
7
|
WebWorkerRpcDriver?: Omit<ConstructorParameters<typeof WebWorkerRpcDriver>[0], 'config'>;
|
|
8
8
|
MainThreadRpcDriver?: Omit<ConstructorParameters<typeof MainThreadRpcDriver>[0], 'config'>;
|
|
9
9
|
};
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const configuration_1 = require("../configuration");
|
|
4
|
+
/**
|
|
5
|
+
* #config BaseRpcDriver
|
|
6
|
+
*/
|
|
7
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
8
|
+
const BaseRpcDriverConfigSchema = (0, configuration_1.ConfigurationSchema)('BaseRpcDriver', {
|
|
9
|
+
/**
|
|
10
|
+
* #slot
|
|
11
|
+
*/
|
|
12
|
+
workerCount: {
|
|
13
|
+
type: 'number',
|
|
14
|
+
description: 'The number of workers to use. If 0 (the default) JBrowse will decide how many workers to use.',
|
|
15
|
+
defaultValue: 0,
|
|
16
|
+
},
|
|
17
|
+
}, { explicitlyTyped: true });
|
|
18
|
+
exports.default = BaseRpcDriverConfigSchema;
|
package/rpc/configSchema.js
CHANGED
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
4
7
|
const configuration_1 = require("../configuration");
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}, { explicitlyTyped: true });
|
|
12
|
-
const MainThreadRpcDriverConfigSchema = (0, configuration_1.ConfigurationSchema)('MainThreadRpcDriver', {}, { explicitlyTyped: true, baseConfiguration: BaseRpcDriverConfigSchema });
|
|
13
|
-
const WebWorkerRpcDriverConfigSchema = (0, configuration_1.ConfigurationSchema)('WebWorkerRpcDriver', {}, { explicitlyTyped: true, baseConfiguration: BaseRpcDriverConfigSchema });
|
|
8
|
+
const webWorkerRpcConfig_1 = __importDefault(require("./webWorkerRpcConfig"));
|
|
9
|
+
const mainThreadRpcConfig_1 = __importDefault(require("./mainThreadRpcConfig"));
|
|
10
|
+
/**
|
|
11
|
+
* #config RpcOptions
|
|
12
|
+
*/
|
|
13
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
14
14
|
exports.default = (0, configuration_1.ConfigurationSchema)('RpcOptions', {
|
|
15
|
+
/**
|
|
16
|
+
* #slot
|
|
17
|
+
*/
|
|
15
18
|
defaultDriver: {
|
|
16
19
|
type: 'string',
|
|
17
20
|
description: 'the RPC driver to use for tracks and tasks that are not configured to use a specific RPC backend',
|
|
18
21
|
defaultValue: 'MainThreadRpcDriver',
|
|
19
22
|
},
|
|
20
|
-
|
|
23
|
+
/**
|
|
24
|
+
* #slot
|
|
25
|
+
*/
|
|
26
|
+
drivers: mobx_state_tree_1.types.optional(mobx_state_tree_1.types.map(mobx_state_tree_1.types.union(mainThreadRpcConfig_1.default, webWorkerRpcConfig_1.default)), {
|
|
21
27
|
MainThreadRpcDriver: { type: 'MainThreadRpcDriver' },
|
|
22
28
|
WebWorkerRpcDriver: { type: 'WebWorkerRpcDriver' },
|
|
23
29
|
}),
|