@jbrowse/core 2.2.0 → 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 +1 -0
- package/BaseFeatureWidget/BaseFeatureDetail.js +43 -28
- package/BaseFeatureWidget/SequenceBox.js +4 -8
- package/Plugin.d.ts +1 -1
- package/PluginLoader.d.ts +2 -2
- package/PluginManager.d.ts +3 -3
- package/assemblyManager/assembly.d.ts +3 -3
- package/assemblyManager/assembly.js +1 -1
- package/configuration/configurationSchema.d.ts +2 -2
- package/data_adapters/BaseAdapter.d.ts +2 -2
- 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 +2 -2
- 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/baseInternetAccountConfig.d.ts +2 -2
- package/pluggableElementTypes/models/baseTrackConfig.d.ts +2 -2
- package/pluggableElementTypes/models/baseTrackConfig.js +9 -0
- package/pluggableElementTypes/renderers/BoxRendererType.d.ts +1 -1
- 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/RpcManager.d.ts +2 -2
- package/rpc/remoteAbortSignals.d.ts +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/App.d.ts +2 -2
- package/ui/App.js +6 -8
- package/ui/AssemblySelector.d.ts +1 -1
- package/ui/AssemblySelector.js +12 -10
- package/ui/EditableTypography.d.ts +4 -4
- package/ui/EditableTypography.js +7 -11
- 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/util/Base1DViewModel.d.ts +72 -2
- package/util/Base1DViewModel.js +94 -3
- package/util/blockTypes.d.ts +1 -1
- package/util/index.d.ts +2 -1
- package/util/index.js +9 -3
- 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/offscreenCanvasPonyfill.d.ts +2 -2
- package/util/offscreenCanvasUtils.d.ts +1 -1
- 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
|
@@ -34,6 +34,7 @@ export declare const BaseCoreDetails: (props: BaseProps) => JSX.Element;
|
|
|
34
34
|
interface AttributeProps {
|
|
35
35
|
attributes: Record<string, any>;
|
|
36
36
|
omit?: string[];
|
|
37
|
+
omitSingleLevel?: string[];
|
|
37
38
|
formatter?: (val: unknown, key: string) => React.ReactNode;
|
|
38
39
|
descriptions?: Record<string, React.ReactNode>;
|
|
39
40
|
prefix?: string[];
|
|
@@ -156,35 +156,41 @@ const ArrayValue = ({ name, value, description, prefix = [], }) => {
|
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
158
|
const toLocale = (n) => n.toLocaleString('en-US');
|
|
159
|
-
function
|
|
159
|
+
function Position(props) {
|
|
160
160
|
const { feature } = props;
|
|
161
|
-
const
|
|
162
|
-
// eslint-disable-next-line no-underscore-dangle
|
|
163
|
-
const formattedFeat = { ...obj, ...obj.__jbrowsefmt };
|
|
164
|
-
const { start, strand, end, refName } = formattedFeat;
|
|
161
|
+
const strand = feature.strand;
|
|
165
162
|
const strandMap = {
|
|
166
163
|
'-1': '-',
|
|
167
164
|
'0': '',
|
|
168
165
|
'1': '+',
|
|
169
166
|
};
|
|
170
167
|
const str = strandMap[strand] ? `(${strandMap[strand]})` : '';
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
const loc = (0, util_1.assembleLocString)(feature);
|
|
170
|
+
return react_1.default.createElement(react_1.default.Fragment, null, `${loc} ${str}`);
|
|
171
|
+
}
|
|
172
|
+
function CoreDetails(props) {
|
|
173
|
+
const { feature } = props;
|
|
174
|
+
const obj = feature;
|
|
175
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
176
|
+
const formattedFeat = { ...obj, ...obj.__jbrowsefmt };
|
|
177
|
+
const { start, end } = formattedFeat;
|
|
171
178
|
const displayedDetails = {
|
|
172
179
|
...formattedFeat,
|
|
173
180
|
length: toLocale(end - start),
|
|
174
|
-
position: `${refName}:${toLocale(start + 1)}..${toLocale(end)} ${str}`,
|
|
175
181
|
};
|
|
176
182
|
const coreRenderedDetails = {
|
|
177
|
-
position: 'Position',
|
|
178
183
|
description: 'Description',
|
|
179
184
|
name: 'Name',
|
|
180
185
|
length: 'Length',
|
|
181
186
|
type: 'Type',
|
|
182
|
-
assemblyName: 'Assembly name',
|
|
183
187
|
};
|
|
184
|
-
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
185
|
-
.
|
|
186
|
-
.
|
|
187
|
-
|
|
188
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
189
|
+
react_1.default.createElement(exports.SimpleValue, { name: "Position", value: react_1.default.createElement(Position, { ...props, feature: formattedFeat }) }),
|
|
190
|
+
Object.entries(coreRenderedDetails)
|
|
191
|
+
.map(([key, name]) => [name, displayedDetails[key]])
|
|
192
|
+
.filter(([, value]) => value != null)
|
|
193
|
+
.map(([name, value]) => (react_1.default.createElement(exports.SimpleValue, { key: name, name: name, value: value })))));
|
|
188
194
|
}
|
|
189
195
|
const BaseCoreDetails = (props) => {
|
|
190
196
|
return (react_1.default.createElement(BaseCard, { ...props, title: "Primary data" },
|
|
@@ -229,23 +235,25 @@ const DataGridDetails = ({ value, prefix, name, }) => {
|
|
|
229
235
|
width: (0, util_1.measureGridWidth)(rows.map(r => r[val])),
|
|
230
236
|
}));
|
|
231
237
|
const rowHeight = 25;
|
|
232
|
-
const
|
|
233
|
-
const
|
|
238
|
+
const hideFoot = rows.length < 100;
|
|
239
|
+
const headHeight = 80;
|
|
240
|
+
const height = Math.min(rows.length, 100) * rowHeight + headHeight + (hideFoot ? 0 : 50);
|
|
234
241
|
// disableSelection on click helps avoid
|
|
235
242
|
// https://github.com/mui-org/material-ui-x/issues/1197
|
|
236
243
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
237
244
|
react_1.default.createElement(exports.FieldName, { prefix: prefix, name: name }),
|
|
238
245
|
react_1.default.createElement("div", { style: {
|
|
239
|
-
height
|
|
240
|
-
headerHeight +
|
|
241
|
-
(hideFooter ? 0 : 50),
|
|
246
|
+
height,
|
|
242
247
|
width: '100%',
|
|
243
248
|
} },
|
|
244
|
-
react_1.default.createElement(x_data_grid_1.DataGrid, { disableSelectionOnClick: true, rowHeight: rowHeight, rows: rows,
|
|
249
|
+
react_1.default.createElement(x_data_grid_1.DataGrid, { disableSelectionOnClick: true, rowHeight: rowHeight, rows: rows, hideFooterSelectedRowCount: true, columns: columns, hideFooter: hideFoot }))));
|
|
245
250
|
}
|
|
246
251
|
return null;
|
|
247
252
|
};
|
|
248
|
-
//
|
|
253
|
+
// pick using a path from an object, similar to _.get from lodash with special logic
|
|
254
|
+
// for Descriptions from e.g. VCF headers
|
|
255
|
+
// @param arr example ['a','b'], obj = {a:{b:'hello}}
|
|
256
|
+
// @returns hello (with special addition to grab description also)
|
|
249
257
|
function accessNested(arr, obj = {}) {
|
|
250
258
|
arr.forEach(elt => {
|
|
251
259
|
if (obj) {
|
|
@@ -259,13 +267,11 @@ function accessNested(arr, obj = {}) {
|
|
|
259
267
|
: undefined;
|
|
260
268
|
}
|
|
261
269
|
function generateMaxWidth(array, prefix) {
|
|
262
|
-
// @ts-ignore
|
|
263
270
|
const arr = [];
|
|
264
|
-
array.forEach(
|
|
271
|
+
array.forEach(key => {
|
|
265
272
|
const val = [...prefix, key[0]].join('.');
|
|
266
273
|
arr.push((0, util_1.measureText)(val, 12));
|
|
267
274
|
});
|
|
268
|
-
// @ts-ignore
|
|
269
275
|
return Math.ceil(Math.max(...arr)) + 10;
|
|
270
276
|
}
|
|
271
277
|
function UriAttribute({ value, prefix, name, }) {
|
|
@@ -283,8 +289,8 @@ function UriAttribute({ value, prefix, name, }) {
|
|
|
283
289
|
react_1.default.createElement(exports.BasicValue, { value: href })));
|
|
284
290
|
}
|
|
285
291
|
function Attributes(props) {
|
|
286
|
-
const { attributes, omit = [], descriptions, formatter = val => val, hideUris, prefix = [], } = props;
|
|
287
|
-
const omits = [...omit, ...globalOmit];
|
|
292
|
+
const { attributes, omit = [], omitSingleLevel = [], descriptions, formatter = val => val, hideUris, prefix = [], } = props;
|
|
293
|
+
const omits = [...omit, ...globalOmit, ...omitSingleLevel];
|
|
288
294
|
const { __jbrowsefmt, ...rest } = attributes;
|
|
289
295
|
const formattedAttributes = { ...rest, ...__jbrowsefmt };
|
|
290
296
|
const maxLabelWidth = generateMaxWidth(Object.entries(formattedAttributes).filter(([k, v]) => v !== undefined && !omits.includes(k)), prefix);
|
|
@@ -298,7 +304,8 @@ function Attributes(props) {
|
|
|
298
304
|
return value.length > 1 && value.every(val => (0, is_object_1.default)(val)) ? (react_1.default.createElement(DataGridDetails, { key: key, name: key, prefix: prefix, value: value })) : (react_1.default.createElement(ArrayValue, { key: key, name: key, value: value, description: description, prefix: prefix }));
|
|
299
305
|
}
|
|
300
306
|
else if ((0, is_object_1.default)(value)) {
|
|
301
|
-
|
|
307
|
+
const { omitSingleLevel, ...rest } = props;
|
|
308
|
+
return (0, util_1.isUriLocation)(value) ? (hideUris ? null : (react_1.default.createElement(UriAttribute, { key: key, name: key, prefix: prefix, value: value }))) : (react_1.default.createElement(Attributes, { ...rest, key: key, attributes: value, descriptions: descriptions, prefix: [...prefix, key] }));
|
|
302
309
|
}
|
|
303
310
|
else {
|
|
304
311
|
return (react_1.default.createElement(exports.SimpleValue, { key: key, name: key, value: formatter(value, key), description: description, prefix: prefix, width: Math.min(maxLabelWidth, MAX_FIELD_NAME_WIDTH) }));
|
|
@@ -323,15 +330,23 @@ function generateTitle(name, id, type) {
|
|
|
323
330
|
const FeatureDetails = (props) => {
|
|
324
331
|
const { omit = [], model, feature, depth = 0 } = props;
|
|
325
332
|
const { name = '', id = '', type = '', subfeatures } = feature;
|
|
326
|
-
const
|
|
333
|
+
const pm = (0, util_1.getEnv)(model).pluginManager;
|
|
327
334
|
const session = (0, util_1.getSession)(model);
|
|
328
|
-
const ExtraPanel =
|
|
335
|
+
const ExtraPanel = pm.evaluateExtensionPoint('Core-extraFeaturePanel', null, {
|
|
336
|
+
session,
|
|
337
|
+
feature,
|
|
338
|
+
model,
|
|
339
|
+
});
|
|
329
340
|
return (react_1.default.createElement(BaseCard, { title: generateTitle(name, id, type) },
|
|
330
341
|
react_1.default.createElement(material_1.Typography, null, "Core details"),
|
|
331
342
|
react_1.default.createElement(CoreDetails, { ...props }),
|
|
343
|
+
feature.mate ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
344
|
+
react_1.default.createElement(material_1.Divider, null),
|
|
345
|
+
react_1.default.createElement(material_1.Typography, null, "Mate details"),
|
|
346
|
+
react_1.default.createElement(CoreDetails, { ...props, feature: feature.mate }))) : null,
|
|
332
347
|
react_1.default.createElement(material_1.Divider, null),
|
|
333
348
|
react_1.default.createElement(material_1.Typography, null, "Attributes"),
|
|
334
|
-
react_1.default.createElement(Attributes, { attributes: feature, ...props, omit:
|
|
349
|
+
react_1.default.createElement(Attributes, { attributes: feature, ...props, omit: omit, omitSingleLevel: coreDetails }),
|
|
335
350
|
react_1.default.createElement(react_error_boundary_1.ErrorBoundary, { FallbackComponent: ({ error }) => react_1.default.createElement(ui_1.ErrorMessage, { error: error }) },
|
|
336
351
|
react_1.default.createElement(SequenceFeatureDetails_1.default, { ...props })),
|
|
337
352
|
ExtraPanel ? (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -29,21 +29,17 @@ function GeneProtein({ cds, sequence, codonTable, }) {
|
|
|
29
29
|
}
|
|
30
30
|
exports.GeneProtein = GeneProtein;
|
|
31
31
|
function GenecDNA({ utr, cds, exons, sequence, upstream, downstream, includeIntrons, collapseIntron, intronBp, }) {
|
|
32
|
-
const chunks = cds.length
|
|
33
|
-
? [...cds, ...utr].sort((a, b) => a.start - b.start)
|
|
34
|
-
: exons;
|
|
32
|
+
const chunks = (cds.length ? [...cds, ...utr].sort((a, b) => a.start - b.start) : exons).filter(f => f.start !== f.end);
|
|
35
33
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
36
34
|
upstream ? (react_1.default.createElement("span", { style: { background: updownstreamColor } }, upstream)) : null,
|
|
37
|
-
chunks
|
|
38
|
-
.filter(f => f.start !== f.end)
|
|
39
|
-
.map((chunk, index) => {
|
|
35
|
+
chunks.map((chunk, idx) => {
|
|
40
36
|
var _a;
|
|
41
|
-
const intron = sequence.slice(chunk.end, (_a = chunks[
|
|
37
|
+
const intron = sequence.slice(chunk.end, (_a = chunks[idx + 1]) === null || _a === void 0 ? void 0 : _a.start);
|
|
42
38
|
return (react_1.default.createElement(react_1.default.Fragment, { key: JSON.stringify(chunk) },
|
|
43
39
|
react_1.default.createElement("span", { style: {
|
|
44
40
|
background: chunk.type === 'CDS' ? cdsColor : utrColor,
|
|
45
41
|
} }, sequence.slice(chunk.start, chunk.end)),
|
|
46
|
-
includeIntrons &&
|
|
42
|
+
includeIntrons && idx < chunks.length - 1 ? (react_1.default.createElement("span", { style: { background: intronColor } }, collapseIntron && intron.length > intronBp * 2
|
|
47
43
|
? `${intron.slice(0, intronBp)}...${intron.slice(-intronBp)}`
|
|
48
44
|
: intron)) : null));
|
|
49
45
|
}),
|
package/Plugin.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export default abstract class Plugin {
|
|
|
11
11
|
configure(_pluginManager: PluginManager): void;
|
|
12
12
|
configurationSchema: AnyConfigurationSchemaType | undefined;
|
|
13
13
|
}
|
|
14
|
-
export
|
|
14
|
+
export type PluginConstructor = new (...args: unknown[]) => Plugin;
|
package/PluginLoader.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export interface LegacyUMDPluginDefinition {
|
|
|
14
14
|
url: string;
|
|
15
15
|
name: string;
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
type UMDPluginDefinition = UMDLocPluginDefinition | UMDUrlPluginDefinition;
|
|
18
18
|
export declare function isUMDPluginDefinition(def: PluginDefinition): def is UMDPluginDefinition | LegacyUMDPluginDefinition;
|
|
19
19
|
export interface ESMLocPluginDefinition {
|
|
20
20
|
esmLoc: {
|
|
@@ -25,7 +25,7 @@ export interface ESMLocPluginDefinition {
|
|
|
25
25
|
export interface ESMUrlPluginDefinition {
|
|
26
26
|
esmUrl: string;
|
|
27
27
|
}
|
|
28
|
-
export
|
|
28
|
+
export type ESMPluginDefinition = ESMLocPluginDefinition | ESMUrlPluginDefinition;
|
|
29
29
|
export declare function isESMPluginDefinition(def: PluginDefinition): def is ESMPluginDefinition;
|
|
30
30
|
export interface CJSPluginDefinition {
|
|
31
31
|
cjsUrl: string;
|
package/PluginManager.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ declare class PhasedScheduler<PhaseName extends string> {
|
|
|
26
26
|
add(phase: PhaseName, callback: Function): void;
|
|
27
27
|
run(): void;
|
|
28
28
|
}
|
|
29
|
-
|
|
29
|
+
type PluggableElementTypeGroup = 'renderer' | 'adapter' | 'display' | 'track' | 'connection' | 'view' | 'widget' | 'rpc method' | 'internet account' | 'text search adapter' | 'add track workflow';
|
|
30
30
|
/** internal class that holds the info for a certain element type */
|
|
31
31
|
declare class TypeRecord<ElementClass extends PluggableElementBase> {
|
|
32
32
|
typeName: string;
|
|
@@ -48,7 +48,7 @@ declare class TypeRecord<ElementClass extends PluggableElementBase> {
|
|
|
48
48
|
get(name: string): ElementClass;
|
|
49
49
|
all(): ElementClass[];
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
type AnyFunction = (...args: any) => any;
|
|
52
52
|
/**
|
|
53
53
|
* free-form string-to-unknown mapping of metadata related to the instance
|
|
54
54
|
* of this plugin. `isCore` is typically set to `Boolean(true)` if the plugin was
|
|
@@ -56,7 +56,7 @@ declare type AnyFunction = (...args: any) => any;
|
|
|
56
56
|
* Can also use this metadata to stash other things about why the plugin is
|
|
57
57
|
* loaded, such as where it came from, what plugin depends on it, etc.
|
|
58
58
|
*/
|
|
59
|
-
export
|
|
59
|
+
export type PluginMetadata = Record<string, unknown>;
|
|
60
60
|
export interface PluginLoadRecord {
|
|
61
61
|
metadata?: PluginMetadata;
|
|
62
62
|
plugin: Plugin;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Instance, IAnyType } from 'mobx-state-tree';
|
|
2
2
|
import PluginManager from '../PluginManager';
|
|
3
3
|
import { Region, Feature } from '../util';
|
|
4
|
-
|
|
4
|
+
type RefNameAliases = Record<string, string>;
|
|
5
5
|
export interface BaseOptions {
|
|
6
6
|
signal?: AbortSignal;
|
|
7
7
|
sessionId: string;
|
|
@@ -72,6 +72,6 @@ export default function assemblyFactory(assemblyConfigType: IAnyType, pm: Plugin
|
|
|
72
72
|
*/
|
|
73
73
|
getReverseRefNameMapForAdapter(adapterConf: unknown, opts: BaseOptions): Promise<RefNameAliases>;
|
|
74
74
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
75
|
-
export
|
|
76
|
-
export
|
|
75
|
+
export type AssemblyModel = ReturnType<typeof assemblyFactory>;
|
|
76
|
+
export type Assembly = Instance<AssemblyModel>;
|
|
77
77
|
export {};
|
|
@@ -45,7 +45,7 @@ const refNameColors = [
|
|
|
45
45
|
];
|
|
46
46
|
async function loadRefNameMap(assembly, adapterConfig, options, signal) {
|
|
47
47
|
const { sessionId } = options;
|
|
48
|
-
await (0, util_1.when)(() =>
|
|
48
|
+
await (0, util_1.when)(() => !!(assembly.regions && assembly.refNameAliases), {
|
|
49
49
|
signal,
|
|
50
50
|
name: 'when assembly ready',
|
|
51
51
|
});
|
|
@@ -22,8 +22,8 @@ export interface AnyConfigurationSchemaType extends ReturnType<typeof makeConfig
|
|
|
22
22
|
jbrowseSchemaOptions: ConfigurationSchemaOptions;
|
|
23
23
|
type: string;
|
|
24
24
|
}
|
|
25
|
-
export
|
|
26
|
-
export
|
|
25
|
+
export type AnyConfigurationModel = Instance<AnyConfigurationSchemaType>;
|
|
26
|
+
export type ConfigurationModel<SCHEMA extends AnyConfigurationSchemaType> = Instance<SCHEMA>;
|
|
27
27
|
export declare function ConfigurationSchema<DEFINITION extends ConfigurationSchemaDefinition, OPTIONS extends ConfigurationSchemaOptions>(modelName: string, inputSchemaDefinition: DEFINITION, inputOptions?: OPTIONS): AnyConfigurationSchemaType;
|
|
28
28
|
export declare function ConfigurationReference(schemaType: IAnyType): import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
29
29
|
export {};
|
|
@@ -13,7 +13,7 @@ export interface BaseOptions {
|
|
|
13
13
|
headers?: Record<string, string>;
|
|
14
14
|
[key: string]: unknown;
|
|
15
15
|
}
|
|
16
|
-
export
|
|
16
|
+
export type SearchType = 'full' | 'prefix' | 'exact';
|
|
17
17
|
export interface BaseArgs {
|
|
18
18
|
searchType?: SearchType;
|
|
19
19
|
queryString: string;
|
|
@@ -24,7 +24,7 @@ export interface BaseArgs {
|
|
|
24
24
|
export interface AnyAdapter {
|
|
25
25
|
new (config: AnyConfigurationModel, getSubAdapter?: getSubAdapterType, pluginManager?: PluginManager | undefined): AnyDataAdapter;
|
|
26
26
|
}
|
|
27
|
-
export
|
|
27
|
+
export type AnyDataAdapter = BaseAdapter | BaseFeatureDataAdapter | BaseRefNameAliasAdapter | BaseTextSearchAdapter | RegionsAdapter | BaseSequenceAdapter;
|
|
28
28
|
export interface SequenceAdapter extends BaseFeatureDataAdapter, RegionsAdapter {
|
|
29
29
|
}
|
|
30
30
|
export declare abstract class BaseAdapter {
|
|
@@ -21,7 +21,7 @@ export declare function getAdapter(pluginManager: PluginManager, sessionId: stri
|
|
|
21
21
|
* allows them to get any sub-adapters that they need
|
|
22
22
|
* internally, staying with the same worker session ID
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type getSubAdapterType = (adapterConfigSnapshot: SnapshotIn<AnyConfigurationSchemaType>) => ReturnType<typeof getAdapter>;
|
|
25
25
|
export declare function freeAdapterResources(specification: Record<string, any>): number;
|
|
26
26
|
export declare function clearAdapterCache(): void;
|
|
27
27
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"access": "public",
|
|
74
74
|
"directory": "dist"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "896d175c5d9345049faea8e1155f243c912aac42"
|
|
77
77
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import PluggableElementBase from './PluggableElementBase';
|
|
2
2
|
import { AnyConfigurationSchemaType } from '../configuration/configurationSchema';
|
|
3
3
|
import { AnyAdapter } from '../data_adapters/BaseAdapter';
|
|
4
|
-
export
|
|
4
|
+
export type AdapterMetadata = {
|
|
5
5
|
category: string | null;
|
|
6
6
|
hiddenFromGUI: boolean | null;
|
|
7
7
|
displayName: string | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { IAnyModelType } from 'mobx-state-tree';
|
|
3
3
|
import PluggableElementBase from './PluggableElementBase';
|
|
4
|
-
|
|
4
|
+
type BasicComponent = React.ComponentType<{
|
|
5
5
|
model: any;
|
|
6
6
|
}>;
|
|
7
|
-
|
|
7
|
+
type AddTrackWorkflowComponent = React.LazyExoticComponent<BasicComponent> | BasicComponent;
|
|
8
8
|
export default class AddTrackWorkflow extends PluggableElementBase {
|
|
9
9
|
ReactComponent: AddTrackWorkflowComponent;
|
|
10
10
|
stateModel: IAnyModelType;
|
|
@@ -2,7 +2,7 @@ import PluginManager from '../PluginManager';
|
|
|
2
2
|
import PluggableElementBase from './PluggableElementBase';
|
|
3
3
|
import { UriLocation } from '../util/types';
|
|
4
4
|
import { RemoteAbortSignal } from '../rpc/remoteAbortSignals';
|
|
5
|
-
export
|
|
5
|
+
export type RpcMethodConstructor = new (pm: PluginManager) => RpcMethodType;
|
|
6
6
|
export default abstract class RpcMethodType extends PluggableElementBase {
|
|
7
7
|
pluginManager: PluginManager;
|
|
8
8
|
name: string;
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import { IAnyModelType, IAnyStateTreeNode } from 'mobx-state-tree';
|
|
3
3
|
import PluggableElementBase from './PluggableElementBase';
|
|
4
4
|
import DisplayType from './DisplayType';
|
|
5
|
-
|
|
5
|
+
type BasicView = React.ComponentType<{
|
|
6
6
|
model: any;
|
|
7
7
|
session?: IAnyStateTreeNode;
|
|
8
8
|
}>;
|
|
9
|
-
|
|
9
|
+
type ViewReactComponent = React.LazyExoticComponent<BasicView> | BasicView;
|
|
10
10
|
export default class ViewType extends PluggableElementBase {
|
|
11
11
|
ReactComponent: ViewReactComponent;
|
|
12
12
|
stateModel: IAnyModelType;
|
|
@@ -12,5 +12,5 @@ import AddTrackWorkflowType from './AddTrackWorkflowType';
|
|
|
12
12
|
export * from './renderers';
|
|
13
13
|
export * from './models';
|
|
14
14
|
export { AdapterType, ConnectionType, RendererType, WidgetType, TrackType, DisplayType, ViewType, RpcMethodType, InternetAccountType, TextSearchAdapterType, AddTrackWorkflowType, };
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type PluggableElementType = AdapterType | ConnectionType | RendererType | WidgetType | TrackType | DisplayType | ViewType | RpcMethodType | InternetAccountType | TextSearchAdapterType | AddTrackWorkflowType;
|
|
16
|
+
export type PluggableElementMember = keyof AdapterType | keyof ConnectionType | keyof RendererType | keyof WidgetType | keyof TrackType | keyof DisplayType | keyof ViewType | keyof RpcMethodType | keyof InternetAccountType | keyof TextSearchAdapterType | keyof AddTrackWorkflowType;
|
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
import { AnyConfigurationModel } from '../../configuration';
|
|
2
2
|
import PluginManager from '../../PluginManager';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel BaseConnectionModel
|
|
5
|
+
*/
|
|
6
|
+
declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
|
|
7
|
+
/**
|
|
8
|
+
* #property
|
|
9
|
+
*/
|
|
4
10
|
name: import("mobx-state-tree").ISimpleType<string>;
|
|
11
|
+
/**
|
|
12
|
+
* #property
|
|
13
|
+
*/
|
|
5
14
|
tracks: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>;
|
|
6
15
|
}, {
|
|
7
16
|
afterAttach(): void;
|
|
17
|
+
/**
|
|
18
|
+
* #action
|
|
19
|
+
*/
|
|
8
20
|
addTrackConf(trackConf: AnyConfigurationModel): any;
|
|
21
|
+
/**
|
|
22
|
+
* #action
|
|
23
|
+
*/
|
|
9
24
|
addTrackConfs(trackConfs: AnyConfigurationModel[]): any[];
|
|
25
|
+
/**
|
|
26
|
+
* #action
|
|
27
|
+
*/
|
|
10
28
|
setTrackConfs(trackConfs: AnyConfigurationModel[]): import("mobx-state-tree").IMSTArray<import("mobx-state-tree").IAnyModelType> & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyModelType>>;
|
|
29
|
+
/**
|
|
30
|
+
* #action
|
|
31
|
+
*/
|
|
11
32
|
clear(): void;
|
|
12
33
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
13
|
-
export default
|
|
34
|
+
export default stateModelFactory;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* #stateModel BaseConnectionModel
|
|
6
|
+
*/
|
|
7
|
+
function stateModelFactory(pluginManager) {
|
|
5
8
|
return mobx_state_tree_1.types
|
|
6
9
|
.model('Connection', {
|
|
10
|
+
/**
|
|
11
|
+
* #property
|
|
12
|
+
*/
|
|
7
13
|
name: mobx_state_tree_1.types.identifier,
|
|
14
|
+
/**
|
|
15
|
+
* #property
|
|
16
|
+
*/
|
|
8
17
|
tracks: mobx_state_tree_1.types.array(pluginManager.pluggableConfigSchemaType('track')),
|
|
9
18
|
})
|
|
10
19
|
.actions(self => ({
|
|
@@ -14,18 +23,31 @@ exports.default = (pluginManager) => {
|
|
|
14
23
|
self.connect(self.configuration);
|
|
15
24
|
}
|
|
16
25
|
},
|
|
26
|
+
/**
|
|
27
|
+
* #action
|
|
28
|
+
*/
|
|
17
29
|
addTrackConf(trackConf) {
|
|
18
30
|
const length = self.tracks.push(trackConf);
|
|
19
31
|
return self.tracks[length - 1];
|
|
20
32
|
},
|
|
33
|
+
/**
|
|
34
|
+
* #action
|
|
35
|
+
*/
|
|
21
36
|
addTrackConfs(trackConfs) {
|
|
22
37
|
const length = self.tracks.push(...trackConfs);
|
|
23
38
|
return self.tracks.slice(length - 1 - trackConfs.length, length - 1);
|
|
24
39
|
},
|
|
40
|
+
/**
|
|
41
|
+
* #action
|
|
42
|
+
*/
|
|
25
43
|
setTrackConfs(trackConfs) {
|
|
26
44
|
self.tracks = (0, mobx_state_tree_1.cast)(trackConfs);
|
|
27
45
|
return self.tracks;
|
|
28
46
|
},
|
|
47
|
+
/**
|
|
48
|
+
* #action
|
|
49
|
+
*/
|
|
29
50
|
clear() { },
|
|
30
51
|
}));
|
|
31
|
-
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = stateModelFactory;
|
|
@@ -136,5 +136,5 @@ export declare const BaseDisplay: import("mobx-state-tree").IModelType<{
|
|
|
136
136
|
*/
|
|
137
137
|
reload(): void;
|
|
138
138
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
139
|
-
export
|
|
140
|
-
export
|
|
139
|
+
export type BaseDisplayStateModel = typeof BaseDisplay;
|
|
140
|
+
export type BaseDisplayModel = Instance<BaseDisplayStateModel>;
|
|
@@ -2,28 +2,73 @@ import { Instance } from 'mobx-state-tree';
|
|
|
2
2
|
import { AnyConfigurationSchemaType } from '../../configuration';
|
|
3
3
|
import PluginManager from '../../PluginManager';
|
|
4
4
|
import { MenuItem } from '../../ui';
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* #stateModel BaseTrackModel
|
|
7
|
+
* these MST models only exist for tracks that are *shown*.
|
|
8
|
+
* they should contain only UI state for the track, and have
|
|
9
|
+
* a reference to a track configuration (stored under
|
|
10
|
+
* session.configuration.assemblies.get(assemblyName).tracks).
|
|
11
|
+
* note that multiple displayed tracks could use the same
|
|
12
|
+
* configuration.
|
|
13
|
+
*/
|
|
14
|
+
export declare function createBaseTrackModel(pm: PluginManager, trackType: string, baseTrackConfig: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
6
15
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
7
16
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
8
17
|
configuration: import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
18
|
+
minimized: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
9
19
|
displays: import("mobx-state-tree").IArrayType<import("mobx-state-tree").IAnyType>;
|
|
10
20
|
}, {
|
|
21
|
+
/**
|
|
22
|
+
* #getter
|
|
23
|
+
* determines which webworker to send the track to, currently based on trackId
|
|
24
|
+
*/
|
|
11
25
|
readonly rpcSessionId: any;
|
|
26
|
+
/**
|
|
27
|
+
* #getter
|
|
28
|
+
*/
|
|
12
29
|
readonly name: any;
|
|
30
|
+
/**
|
|
31
|
+
* #getter
|
|
32
|
+
*/
|
|
13
33
|
readonly textSearchAdapter: any;
|
|
14
34
|
/**
|
|
15
|
-
*
|
|
35
|
+
* #getter
|
|
16
36
|
*/
|
|
17
37
|
readonly adapterType: import("..").AdapterType;
|
|
38
|
+
/**
|
|
39
|
+
* #getter
|
|
40
|
+
*/
|
|
18
41
|
readonly viewMenuActions: MenuItem[];
|
|
42
|
+
/**
|
|
43
|
+
* #getter
|
|
44
|
+
*/
|
|
19
45
|
readonly canConfigure: any;
|
|
20
46
|
} & {
|
|
47
|
+
/**
|
|
48
|
+
* #action
|
|
49
|
+
*/
|
|
50
|
+
setMinimized(flag: boolean): void;
|
|
51
|
+
/**
|
|
52
|
+
* #action
|
|
53
|
+
*/
|
|
21
54
|
activateConfigurationUI(): void;
|
|
55
|
+
/**
|
|
56
|
+
* #action
|
|
57
|
+
*/
|
|
22
58
|
showDisplay(displayId: string, initialSnapshot?: {}): void;
|
|
59
|
+
/**
|
|
60
|
+
* #action
|
|
61
|
+
*/
|
|
23
62
|
hideDisplay(displayId: string): number;
|
|
63
|
+
/**
|
|
64
|
+
* #action
|
|
65
|
+
*/
|
|
24
66
|
replaceDisplay(oldId: string, newId: string, initialSnapshot?: {}): void;
|
|
25
67
|
} & {
|
|
68
|
+
/**
|
|
69
|
+
* #method
|
|
70
|
+
*/
|
|
26
71
|
trackMenuItems(): MenuItem[];
|
|
27
72
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
28
|
-
export
|
|
29
|
-
export
|
|
73
|
+
export type BaseTrackStateModel = ReturnType<typeof createBaseTrackModel>;
|
|
74
|
+
export type BaseTrackModel = Instance<BaseTrackStateModel>;
|