@jbrowse/core 2.2.2 → 2.3.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/PluginManager.d.ts +4 -0
- package/PluginManager.js +12 -0
- package/README.md +6 -2
- package/package.json +3 -3
- package/pluggableElementTypes/AdapterType.d.ts +4 -4
- package/pluggableElementTypes/AdapterType.js +0 -1
- package/pluggableElementTypes/AddTrackWorkflowType.d.ts +3 -3
- package/pluggableElementTypes/ConnectionType.d.ts +0 -1
- package/pluggableElementTypes/ConnectionType.js +0 -1
- package/pluggableElementTypes/DisplayType.d.ts +9 -0
- package/pluggableElementTypes/DisplayType.js +1 -0
- package/pluggableElementTypes/PluggableElementBase.d.ts +3 -0
- package/pluggableElementTypes/PluggableElementBase.js +4 -0
- package/pluggableElementTypes/TextSearchAdapterType.d.ts +1 -0
- package/pluggableElementTypes/TrackType.d.ts +2 -1
- package/pluggableElementTypes/ViewType.d.ts +4 -3
- package/pluggableElementTypes/WidgetType.d.ts +10 -9
- package/pluggableElementTypes/models/BaseDisplayModel.js +1 -0
- package/pluggableElementTypes/models/BaseTrackModel.d.ts +19 -8
- package/pluggableElementTypes/models/BaseTrackModel.js +32 -26
- package/pluggableElementTypes/renderers/BoxRendererType.js +1 -14
- package/pluggableElementTypes/renderers/CircularChordRendererType.d.ts +9 -0
- package/pluggableElementTypes/renderers/CircularChordRendererType.js +23 -0
- package/pluggableElementTypes/renderers/ComparativeServerSideRendererType.js +4 -1
- package/pluggableElementTypes/renderers/FeatureRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/FeatureRendererType.js +11 -13
- package/pluggableElementTypes/renderers/RendererType.d.ts +1 -0
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.d.ts +8 -0
- package/pluggableElementTypes/renderers/RpcRenderedSvgGroup.js +60 -0
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.d.ts +2 -2
- package/pluggableElementTypes/renderers/ServerSideRenderedContent.js +6 -6
- package/pluggableElementTypes/renderers/ServerSideRendererType.d.ts +4 -4
- package/pluggableElementTypes/renderers/ServerSideRendererType.js +13 -12
- package/rpc/BaseRpcDriver.d.ts +1 -1
- package/rpc/BaseRpcDriver.js +7 -17
- package/rpc/coreRpcMethods.d.ts +11 -99
- package/rpc/coreRpcMethods.js +17 -241
- package/rpc/methods/CoreEstimateRegionStats.d.ts +18 -0
- package/rpc/methods/CoreEstimateRegionStats.js +37 -0
- package/rpc/methods/CoreFreeResources.d.ts +12 -0
- package/rpc/methods/CoreFreeResources.js +35 -0
- package/rpc/methods/CoreGetFeatureDetails.d.ts +16 -0
- package/rpc/methods/CoreGetFeatureDetails.js +44 -0
- package/rpc/methods/CoreGetFeatures.d.ts +17 -0
- package/rpc/methods/CoreGetFeatures.js +44 -0
- package/rpc/methods/CoreGetFileInfo.d.ts +10 -0
- package/rpc/methods/CoreGetFileInfo.js +24 -0
- package/rpc/methods/CoreGetMetadata.d.ts +10 -0
- package/rpc/methods/CoreGetMetadata.js +24 -0
- package/rpc/methods/CoreGetRefNames.d.ts +10 -0
- package/rpc/methods/CoreGetRefNames.js +25 -0
- package/rpc/methods/CoreRender.d.ts +14 -0
- package/rpc/methods/CoreRender.js +57 -0
- package/rpc/methods/util.d.ts +14 -0
- package/rpc/methods/util.js +21 -0
- package/rpc/remoteAbortSignals.d.ts +3 -1
- package/rpc/remoteAbortSignals.js +3 -1
- package/tsconfig.build.tsbuildinfo +1 -1
- package/ui/App.js +9 -77
- package/ui/AppLogo.d.ts +8 -0
- package/ui/AppLogo.js +22 -0
- package/ui/AppToolbar.d.ts +19 -0
- package/ui/AppToolbar.js +56 -0
- package/ui/AssemblySelector.d.ts +5 -3
- package/ui/AssemblySelector.js +4 -4
- package/ui/PrerenderedCanvas.d.ts +3 -20
- package/ui/PrerenderedCanvas.js +1 -19
- package/ui/Snackbar.js +7 -53
- package/ui/ViewLauncher.d.ts +18 -0
- package/ui/ViewLauncher.js +50 -0
- package/ui/index.d.ts +9 -9
- package/ui/index.js +19 -19
- package/util/Base1DUtils.js +1 -1
- package/util/dedupe.d.ts +3 -0
- package/util/dedupe.js +18 -0
- package/util/index.d.ts +1 -1
- package/util/index.js +2 -5
- package/util/offscreenCanvasUtils.js +1 -1
- package/util/stats.d.ts +7 -3
- package/util/stats.js +33 -24
package/PluginManager.d.ts
CHANGED
|
@@ -98,7 +98,11 @@ export default class PluginManager {
|
|
|
98
98
|
addElementType(groupName: PluggableElementTypeGroup, creationCallback: (pluginManager: PluginManager) => PluggableElementType): this;
|
|
99
99
|
getElementType(groupName: PluggableElementTypeGroup, typeName: string): PluggableElementBase;
|
|
100
100
|
getElementTypesInGroup(groupName: PluggableElementTypeGroup): PluggableElementBase[];
|
|
101
|
+
getTrackElements(): TrackType[];
|
|
102
|
+
getAddTrackWorkflowElements(): AddTrackWorkflowType[];
|
|
101
103
|
getRpcElements(): RpcMethodType[];
|
|
104
|
+
getDisplayElements(): DisplayType[];
|
|
105
|
+
getAdapterElements(): AdapterType[];
|
|
102
106
|
/** get a MST type for the union of all specified pluggable MST types */
|
|
103
107
|
pluggableMstType(groupName: PluggableElementTypeGroup, fieldName: PluggableElementMember, fallback?: IAnyType): IAnyType;
|
|
104
108
|
/** get a MST type for the union of all specified pluggable config schemas */
|
package/PluginManager.js
CHANGED
|
@@ -234,9 +234,21 @@ class PluginManager {
|
|
|
234
234
|
getElementTypesInGroup(groupName) {
|
|
235
235
|
return this.getElementTypeRecord(groupName).all();
|
|
236
236
|
}
|
|
237
|
+
getTrackElements() {
|
|
238
|
+
return this.getElementTypesInGroup('track');
|
|
239
|
+
}
|
|
240
|
+
getAddTrackWorkflowElements() {
|
|
241
|
+
return this.getElementTypesInGroup('add track workflow');
|
|
242
|
+
}
|
|
237
243
|
getRpcElements() {
|
|
238
244
|
return this.getElementTypesInGroup('rpc method');
|
|
239
245
|
}
|
|
246
|
+
getDisplayElements() {
|
|
247
|
+
return this.getElementTypesInGroup('display');
|
|
248
|
+
}
|
|
249
|
+
getAdapterElements() {
|
|
250
|
+
return this.getElementTypesInGroup('adapter');
|
|
251
|
+
}
|
|
240
252
|
/** get a MST type for the union of all specified pluggable MST types */
|
|
241
253
|
pluggableMstType(groupName, fieldName, fallback = mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.null)) {
|
|
242
254
|
const pluggableTypes = this.getElementTypeRecord(groupName)
|
package/README.md
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
# jbrowse-core
|
|
2
2
|
|
|
3
3
|
[](https://npmjs.org/package/@jbrowse/core)
|
|
4
|
-
[](https://travis-ci.org/GMOD/jbrowse-components)
|
|
4
|
+
[](https://travis-ci.org/GMOD/jbrowse-components)
|
|
5
|
+
[](https://codecov.io/gh/GMOD/jbrowse-components/branch/main)
|
|
5
6
|
|
|
6
7
|
Core JBrowse libraries used by most JBrowse plugins.
|
|
7
8
|
|
|
@@ -11,7 +12,10 @@ See [docs](docs/README.md)
|
|
|
11
12
|
|
|
12
13
|
## Academic Use
|
|
13
14
|
|
|
14
|
-
This package was written with funding from the [NHGRI](http://genome.gov) as
|
|
15
|
+
This package was written with funding from the [NHGRI](http://genome.gov) as
|
|
16
|
+
part of the [JBrowse](http://jbrowse.org) project. If you use it in an academic
|
|
17
|
+
project that you publish, please cite the most recent JBrowse paper, which will
|
|
18
|
+
be linked from [jbrowse.org](http://jbrowse.org).
|
|
15
19
|
|
|
16
20
|
## License
|
|
17
21
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"description": "JBrowse 2 core libraries used by plugins",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"react": ">=16.8.0",
|
|
68
68
|
"react-dom": ">=16.8.0",
|
|
69
69
|
"rxjs": "^6.0.0",
|
|
70
|
-
"tss-react": "^
|
|
70
|
+
"tss-react": "^4.0.0"
|
|
71
71
|
},
|
|
72
72
|
"publishConfig": {
|
|
73
73
|
"access": "public",
|
|
74
74
|
"directory": "dist"
|
|
75
75
|
},
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "a85b280a8af4d1a11e81ab42913f5f6049e6e580"
|
|
77
77
|
}
|
|
@@ -2,10 +2,9 @@ import PluggableElementBase from './PluggableElementBase';
|
|
|
2
2
|
import { AnyConfigurationSchemaType } from '../configuration/configurationSchema';
|
|
3
3
|
import { AnyAdapter } from '../data_adapters/BaseAdapter';
|
|
4
4
|
export type AdapterMetadata = {
|
|
5
|
-
category
|
|
6
|
-
hiddenFromGUI
|
|
7
|
-
|
|
8
|
-
description: string | null;
|
|
5
|
+
category?: string;
|
|
6
|
+
hiddenFromGUI?: boolean;
|
|
7
|
+
description?: string;
|
|
9
8
|
};
|
|
10
9
|
export default class AdapterType extends PluggableElementBase {
|
|
11
10
|
AdapterClass?: AnyAdapter;
|
|
@@ -16,6 +15,7 @@ export default class AdapterType extends PluggableElementBase {
|
|
|
16
15
|
constructor(stuff: {
|
|
17
16
|
name: string;
|
|
18
17
|
configSchema: AnyConfigurationSchemaType;
|
|
18
|
+
displayName?: string;
|
|
19
19
|
adapterCapabilities?: string[];
|
|
20
20
|
adapterMetadata?: AdapterMetadata;
|
|
21
21
|
} & ({
|
|
@@ -3,7 +3,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
/* eslint curly:error */
|
|
7
6
|
const PluggableElementBase_1 = __importDefault(require("./PluggableElementBase"));
|
|
8
7
|
class AdapterType extends PluggableElementBase_1.default {
|
|
9
8
|
constructor(stuff) {
|
|
@@ -4,13 +4,13 @@ import PluggableElementBase from './PluggableElementBase';
|
|
|
4
4
|
type BasicComponent = React.ComponentType<{
|
|
5
5
|
model: any;
|
|
6
6
|
}>;
|
|
7
|
-
type
|
|
7
|
+
type AddTrackWorkflowComponentType = React.LazyExoticComponent<BasicComponent> | BasicComponent;
|
|
8
8
|
export default class AddTrackWorkflow extends PluggableElementBase {
|
|
9
|
-
ReactComponent:
|
|
9
|
+
ReactComponent: AddTrackWorkflowComponentType;
|
|
10
10
|
stateModel: IAnyModelType;
|
|
11
11
|
constructor(stuff: {
|
|
12
12
|
name: string;
|
|
13
|
-
ReactComponent:
|
|
13
|
+
ReactComponent: AddTrackWorkflowComponentType;
|
|
14
14
|
stateModel: IAnyModelType;
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -5,7 +5,6 @@ import { AnyReactComponentType } from '../util';
|
|
|
5
5
|
export default class ConnectionType extends PluggableElementBase {
|
|
6
6
|
stateModel: IAnyModelType;
|
|
7
7
|
configSchema: AnyConfigurationSchemaType;
|
|
8
|
-
displayName: string;
|
|
9
8
|
description: string;
|
|
10
9
|
url: string;
|
|
11
10
|
configEditorComponent?: AnyReactComponentType;
|
|
@@ -9,7 +9,6 @@ class ConnectionType extends PluggableElementBase_1.default {
|
|
|
9
9
|
super(stuff);
|
|
10
10
|
this.stateModel = stuff.stateModel;
|
|
11
11
|
this.configSchema = stuff.configSchema;
|
|
12
|
-
this.displayName = stuff.displayName;
|
|
13
12
|
this.description = stuff.description;
|
|
14
13
|
this.url = stuff.url;
|
|
15
14
|
this.configEditorComponent = stuff.configEditorComponent;
|
|
@@ -6,13 +6,22 @@ export default class DisplayType extends PluggableElementBase {
|
|
|
6
6
|
stateModel: IAnyModelType;
|
|
7
7
|
configSchema: AnyConfigurationSchemaType;
|
|
8
8
|
ReactComponent: AnyReactComponentType;
|
|
9
|
+
/**
|
|
10
|
+
* The track type the display is associated with
|
|
11
|
+
*/
|
|
9
12
|
trackType: string;
|
|
13
|
+
subDisplay?: unknown;
|
|
14
|
+
/**
|
|
15
|
+
* The view type the display is associated with
|
|
16
|
+
*/
|
|
10
17
|
viewType: string;
|
|
11
18
|
constructor(stuff: {
|
|
12
19
|
name: string;
|
|
13
20
|
stateModel: IAnyModelType;
|
|
14
21
|
trackType: string;
|
|
15
22
|
viewType: string;
|
|
23
|
+
displayName?: string;
|
|
24
|
+
subDisplay?: unknown;
|
|
16
25
|
configSchema: AnyConfigurationSchemaType;
|
|
17
26
|
ReactComponent: AnyReactComponentType;
|
|
18
27
|
});
|
|
@@ -9,6 +9,7 @@ class DisplayType extends PluggableElementBase_1.default {
|
|
|
9
9
|
constructor(stuff) {
|
|
10
10
|
super(stuff);
|
|
11
11
|
this.stateModel = stuff.stateModel;
|
|
12
|
+
this.subDisplay = stuff.subDisplay;
|
|
12
13
|
this.configSchema = stuff.configSchema;
|
|
13
14
|
this.ReactComponent = stuff.ReactComponent;
|
|
14
15
|
this.trackType = stuff.trackType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IAnyModelType } from 'mobx-state-tree';
|
|
2
2
|
import PluggableElementBase from './PluggableElementBase';
|
|
3
|
-
import { AnyConfigurationSchemaType } from '../configuration
|
|
3
|
+
import { AnyConfigurationSchemaType } from '../configuration';
|
|
4
4
|
import DisplayType from './DisplayType';
|
|
5
5
|
export default class TrackType extends PluggableElementBase {
|
|
6
6
|
stateModel: IAnyModelType;
|
|
@@ -9,6 +9,7 @@ export default class TrackType extends PluggableElementBase {
|
|
|
9
9
|
constructor(stuff: {
|
|
10
10
|
name: string;
|
|
11
11
|
stateModel: IAnyModelType;
|
|
12
|
+
displayName?: string;
|
|
12
13
|
configSchema: AnyConfigurationSchemaType;
|
|
13
14
|
});
|
|
14
15
|
addDisplayType(display: DisplayType): void;
|
|
@@ -6,15 +6,16 @@ type BasicView = React.ComponentType<{
|
|
|
6
6
|
model: any;
|
|
7
7
|
session?: IAnyStateTreeNode;
|
|
8
8
|
}>;
|
|
9
|
-
type
|
|
9
|
+
type ViewComponentType = React.LazyExoticComponent<BasicView> | BasicView;
|
|
10
10
|
export default class ViewType extends PluggableElementBase {
|
|
11
|
-
ReactComponent:
|
|
11
|
+
ReactComponent: ViewComponentType;
|
|
12
12
|
stateModel: IAnyModelType;
|
|
13
13
|
displayTypes: DisplayType[];
|
|
14
14
|
extendedName?: string;
|
|
15
15
|
constructor(stuff: {
|
|
16
16
|
name: string;
|
|
17
|
-
|
|
17
|
+
displayName?: string;
|
|
18
|
+
ReactComponent: ViewComponentType;
|
|
18
19
|
stateModel: IAnyModelType;
|
|
19
20
|
extendedName?: string;
|
|
20
21
|
});
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React, { ComponentType, LazyExoticComponent } from 'react';
|
|
2
2
|
import { IAnyModelType, IAnyStateTreeNode } from 'mobx-state-tree';
|
|
3
3
|
import PluggableElementBase from './PluggableElementBase';
|
|
4
|
-
import { AnyConfigurationSchemaType } from '../configuration
|
|
4
|
+
import { AnyConfigurationSchemaType } from '../configuration';
|
|
5
|
+
type WidgetComponentType = LazyExoticComponent<React.FC<any>> | React.FC<any>;
|
|
6
|
+
type HeadingComponentType = ComponentType<{
|
|
7
|
+
model: IAnyStateTreeNode;
|
|
8
|
+
}>;
|
|
5
9
|
export default class WidgetType extends PluggableElementBase {
|
|
6
10
|
heading?: string;
|
|
7
11
|
configSchema: AnyConfigurationSchemaType;
|
|
8
|
-
HeadingComponent?:
|
|
9
|
-
|
|
10
|
-
}>;
|
|
11
|
-
ReactComponent: LazyExoticComponent<React.FC<any>> | React.FC<any>;
|
|
12
|
+
HeadingComponent?: HeadingComponentType;
|
|
13
|
+
ReactComponent: WidgetComponentType;
|
|
12
14
|
stateModel: IAnyModelType;
|
|
13
15
|
constructor(stuff: {
|
|
14
16
|
name: string;
|
|
15
17
|
heading?: string;
|
|
16
|
-
HeadingComponent?:
|
|
17
|
-
model: IAnyStateTreeNode;
|
|
18
|
-
}>;
|
|
18
|
+
HeadingComponent?: HeadingComponentType;
|
|
19
19
|
configSchema: AnyConfigurationSchemaType;
|
|
20
20
|
stateModel: IAnyModelType;
|
|
21
|
-
ReactComponent:
|
|
21
|
+
ReactComponent: WidgetComponentType;
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
+
export {};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { Instance } from 'mobx-state-tree';
|
|
1
|
+
import { Instance, IAnyStateTreeNode } from 'mobx-state-tree';
|
|
2
2
|
import { AnyConfigurationSchemaType } from '../../configuration';
|
|
3
3
|
import PluginManager from '../../PluginManager';
|
|
4
4
|
import { MenuItem } from '../../ui';
|
|
5
|
+
export declare function getCompatibleDisplays(self: IAnyStateTreeNode): ({
|
|
6
|
+
[x: string]: any;
|
|
7
|
+
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
8
|
+
setSubschema(slotName: string, data: unknown): any;
|
|
9
|
+
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>)[];
|
|
5
10
|
/**
|
|
6
11
|
* #stateModel BaseTrackModel
|
|
7
|
-
* these MST models only exist for tracks that are *shown*.
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* session.configuration.assemblies.get(assemblyName).tracks).
|
|
11
|
-
* note that multiple displayed tracks could use the same
|
|
12
|
-
* configuration.
|
|
12
|
+
* these MST models only exist for tracks that are *shown*. they should contain
|
|
13
|
+
* only UI state for the track, and have a reference to a track configuration.
|
|
14
|
+
* note that multiple displayed tracks could use the same configuration.
|
|
13
15
|
*/
|
|
14
16
|
export declare function createBaseTrackModel(pm: PluginManager, trackType: string, baseTrackConfig: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
15
17
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -68,7 +70,16 @@ export declare function createBaseTrackModel(pm: PluginManager, trackType: strin
|
|
|
68
70
|
/**
|
|
69
71
|
* #method
|
|
70
72
|
*/
|
|
71
|
-
trackMenuItems():
|
|
73
|
+
trackMenuItems(): (import("../../ui").MenuDivider | import("../../ui").MenuSubHeader | import("../../ui").NormalMenuItem | import("../../ui").CheckboxMenuItem | import("../../ui").RadioMenuItem | import("../../ui").SubMenuItem | {
|
|
74
|
+
type: string;
|
|
75
|
+
label: string;
|
|
76
|
+
subMenu: {
|
|
77
|
+
type: string;
|
|
78
|
+
label: string;
|
|
79
|
+
checked: boolean;
|
|
80
|
+
onClick: () => void;
|
|
81
|
+
}[];
|
|
82
|
+
})[];
|
|
72
83
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>;
|
|
73
84
|
export type BaseTrackStateModel = ReturnType<typeof createBaseTrackModel>;
|
|
74
85
|
export type BaseTrackModel = Instance<BaseTrackStateModel>;
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createBaseTrackModel = void 0;
|
|
3
|
+
exports.createBaseTrackModel = exports.getCompatibleDisplays = void 0;
|
|
4
4
|
const mobx_1 = require("mobx");
|
|
5
5
|
const mobx_state_tree_1 = require("mobx-state-tree");
|
|
6
|
+
// locals
|
|
6
7
|
const configuration_1 = require("../../configuration");
|
|
7
8
|
const util_1 = require("../../util");
|
|
8
9
|
const types_1 = require("../../util/types");
|
|
9
10
|
const mst_1 = require("../../util/types/mst");
|
|
11
|
+
function getCompatibleDisplays(self) {
|
|
12
|
+
const { pluginManager } = (0, util_1.getEnv)(self);
|
|
13
|
+
const view = (0, util_1.getContainingView)(self);
|
|
14
|
+
const viewType = pluginManager.getViewType(view.type);
|
|
15
|
+
const compatTypes = viewType.displayTypes.map(d => d.name);
|
|
16
|
+
const displays = self.configuration.displays;
|
|
17
|
+
return displays.filter(d => compatTypes.includes(d.type));
|
|
18
|
+
}
|
|
19
|
+
exports.getCompatibleDisplays = getCompatibleDisplays;
|
|
10
20
|
/**
|
|
11
21
|
* #stateModel BaseTrackModel
|
|
12
|
-
* these MST models only exist for tracks that are *shown*.
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* session.configuration.assemblies.get(assemblyName).tracks).
|
|
16
|
-
* note that multiple displayed tracks could use the same
|
|
17
|
-
* configuration.
|
|
22
|
+
* these MST models only exist for tracks that are *shown*. they should contain
|
|
23
|
+
* only UI state for the track, and have a reference to a track configuration.
|
|
24
|
+
* note that multiple displayed tracks could use the same configuration.
|
|
18
25
|
*/
|
|
19
26
|
function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
20
27
|
return mobx_state_tree_1.types
|
|
@@ -111,9 +118,7 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
111
118
|
// @ts-ignore
|
|
112
119
|
const trackConf = session.editTrackConfiguration(self.configuration);
|
|
113
120
|
if (trackConf && trackConf !== self.configuration) {
|
|
114
|
-
// @ts-ignore
|
|
115
121
|
view.hideTrack(self.configuration);
|
|
116
|
-
// @ts-ignore
|
|
117
122
|
view.showTrack(trackConf);
|
|
118
123
|
}
|
|
119
124
|
}
|
|
@@ -174,24 +179,25 @@ function createBaseTrackModel(pm, trackType, baseTrackConfig) {
|
|
|
174
179
|
const menuItems = self.displays
|
|
175
180
|
.map(d => d.trackMenuItems())
|
|
176
181
|
.flat();
|
|
177
|
-
const displayChoices = [];
|
|
178
|
-
const view = (0, util_1.getContainingView)(self);
|
|
179
|
-
const viewType = pm.getViewType(view.type);
|
|
180
|
-
const compatibleDisplayTypes = viewType.displayTypes.map(d => d.name);
|
|
181
|
-
const compatibleDisplays = self.configuration.displays.filter((d) => compatibleDisplayTypes.includes(d.type));
|
|
182
182
|
const shownId = self.displays[0].configuration.displayId;
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
183
|
+
const compatDisp = getCompatibleDisplays(self);
|
|
184
|
+
return [
|
|
185
|
+
...menuItems,
|
|
186
|
+
...(compatDisp.length > 1
|
|
187
|
+
? [
|
|
188
|
+
{
|
|
189
|
+
type: 'subMenu',
|
|
190
|
+
label: 'Display types',
|
|
191
|
+
subMenu: compatDisp.map(d => ({
|
|
192
|
+
type: 'radio',
|
|
193
|
+
label: pm.getDisplayType(d.type).displayName,
|
|
194
|
+
checked: d.displayId === shownId,
|
|
195
|
+
onClick: () => self.replaceDisplay(shownId, d.displayId),
|
|
196
|
+
})),
|
|
197
|
+
},
|
|
198
|
+
]
|
|
199
|
+
: []),
|
|
200
|
+
];
|
|
195
201
|
},
|
|
196
202
|
}));
|
|
197
203
|
}
|
|
@@ -108,20 +108,7 @@ class BoxRendererType extends FeatureRendererType_1.default {
|
|
|
108
108
|
}
|
|
109
109
|
deserializeResultsInClient(result, args) {
|
|
110
110
|
const layout = this.deserializeLayoutInClient(result.layout);
|
|
111
|
-
|
|
112
|
-
// // debugging aid: check if there are features in `features` that are not in the layout
|
|
113
|
-
// const featureIds1 = iterMap(deserialized.features.values(), f =>
|
|
114
|
-
// f.id(),
|
|
115
|
-
// ).sort()
|
|
116
|
-
// const featureIds2 = Object.keys(
|
|
117
|
-
// deserialized.layout.toJSON().rectangles,
|
|
118
|
-
// ).sort()
|
|
119
|
-
// if (
|
|
120
|
-
// featureIds1.length > featureIds2.length &&
|
|
121
|
-
// !deserialized.layout.maxHeightReached
|
|
122
|
-
// )
|
|
123
|
-
// debugger
|
|
124
|
-
return deserialized;
|
|
111
|
+
return super.deserializeResultsInClient({ ...result, layout }, args);
|
|
125
112
|
}
|
|
126
113
|
createLayoutInWorker(args) {
|
|
127
114
|
const { regions } = args;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import { SimpleFeatureSerialized } from '../../util/simpleFeature';
|
|
1
2
|
import FeatureRenderer from './FeatureRendererType';
|
|
2
3
|
export default class CircularChordRendererType extends FeatureRenderer {
|
|
4
|
+
deserializeResultsInClient(res: {
|
|
5
|
+
features: SimpleFeatureSerialized[];
|
|
6
|
+
html: string;
|
|
7
|
+
}, args: {
|
|
8
|
+
exportSVG?: {
|
|
9
|
+
rasterizeLayers?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}): any;
|
|
3
12
|
}
|
|
@@ -3,7 +3,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const react_1 = __importDefault(require("react"));
|
|
7
|
+
const simpleFeature_1 = __importDefault(require("../../util/simpleFeature"));
|
|
6
8
|
const FeatureRendererType_1 = __importDefault(require("./FeatureRendererType"));
|
|
9
|
+
const RpcRenderedSvgGroup_1 = __importDefault(require("./RpcRenderedSvgGroup"));
|
|
7
10
|
class CircularChordRendererType extends FeatureRendererType_1.default {
|
|
11
|
+
deserializeResultsInClient(res, args) {
|
|
12
|
+
const deserializedFeatures = new Map(res.features.map(f => simpleFeature_1.default.fromJSON(f)).map(f => [f.id(), f]));
|
|
13
|
+
// if we are rendering svg, we skip hydration
|
|
14
|
+
if (args.exportSVG) {
|
|
15
|
+
// only return the res if the renderer explicitly has
|
|
16
|
+
// this.supportsSVG support to avoid garbage being rendered in SVG
|
|
17
|
+
// document
|
|
18
|
+
return {
|
|
19
|
+
...res,
|
|
20
|
+
html: this.supportsSVG
|
|
21
|
+
? res.html
|
|
22
|
+
: '<text y="12" fill="black">SVG export not supported for this track</text>',
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
// hydrate res using ServerSideRenderedContent
|
|
26
|
+
return {
|
|
27
|
+
...res,
|
|
28
|
+
reactElement: (react_1.default.createElement(RpcRenderedSvgGroup_1.default, { ...args, ...res, features: deserializedFeatures, RenderingComponent: this.ReactComponent })),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
8
31
|
}
|
|
9
32
|
exports.default = CircularChordRendererType;
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const operators_1 = require("rxjs/operators");
|
|
8
8
|
const ServerSideRendererType_1 = __importDefault(require("./ServerSideRendererType"));
|
|
9
9
|
const dataAdapterCache_1 = require("../../data_adapters/dataAdapterCache");
|
|
10
|
+
const util_1 = require("../../util");
|
|
10
11
|
class ComparativeServerSideRenderer extends ServerSideRendererType_1.default {
|
|
11
12
|
/**
|
|
12
13
|
* directly modifies the render arguments to prepare
|
|
@@ -77,10 +78,12 @@ class ComparativeServerSideRenderer extends ServerSideRendererType_1.default {
|
|
|
77
78
|
return requestRegion;
|
|
78
79
|
});
|
|
79
80
|
// note that getFeaturesInMultipleRegions does not do glyph expansion
|
|
80
|
-
|
|
81
|
+
const res = await dataAdapter
|
|
81
82
|
.getFeaturesInMultipleRegions(requestRegions, renderArgs)
|
|
82
83
|
.pipe((0, operators_1.filter)(f => this.featurePassesFilters(renderArgs, f)), (0, operators_1.toArray)())
|
|
83
84
|
.toPromise();
|
|
85
|
+
// dedupe needed xref https://github.com/GMOD/jbrowse-components/pull/3404/
|
|
86
|
+
return (0, util_1.dedupe)(res, f => f.id());
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
exports.default = ComparativeServerSideRenderer;
|
|
@@ -39,10 +39,10 @@ export interface ResultsDeserialized extends ServerSideResultsDeserialized {
|
|
|
39
39
|
}
|
|
40
40
|
export default class FeatureRendererType extends ServerSideRendererType {
|
|
41
41
|
/**
|
|
42
|
-
* replaces the `displayModel` param (which on the client is a MST model)
|
|
43
|
-
* a stub that only contains the `selectedFeature`, since this is the only
|
|
44
|
-
* part of the track model that most renderers read. also serializes the
|
|
45
|
-
*
|
|
42
|
+
* replaces the `displayModel` param (which on the client is a MST model)
|
|
43
|
+
* with a stub that only contains the `selectedFeature`, since this is the only
|
|
44
|
+
* part of the track model that most renderers read. also serializes the config
|
|
45
|
+
* and regions to JSON from MST objects.
|
|
46
46
|
*
|
|
47
47
|
* @param args - the arguments passed to render
|
|
48
48
|
*/
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const operators_1 = require("rxjs/operators");
|
|
7
|
+
const clone_1 = __importDefault(require("clone"));
|
|
7
8
|
const util_1 = require("../../util");
|
|
8
9
|
const simpleFeature_1 = __importDefault(require("../../util/simpleFeature"));
|
|
9
10
|
const dataAdapterCache_1 = require("../../data_adapters/dataAdapterCache");
|
|
@@ -11,10 +12,10 @@ const ServerSideRendererType_1 = __importDefault(require("./ServerSideRendererTy
|
|
|
11
12
|
const BaseAdapter_1 = require("../../data_adapters/BaseAdapter");
|
|
12
13
|
class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
13
14
|
/**
|
|
14
|
-
* replaces the `displayModel` param (which on the client is a MST model)
|
|
15
|
-
* a stub that only contains the `selectedFeature`, since this is the only
|
|
16
|
-
* part of the track model that most renderers read. also serializes the
|
|
17
|
-
*
|
|
15
|
+
* replaces the `displayModel` param (which on the client is a MST model)
|
|
16
|
+
* with a stub that only contains the `selectedFeature`, since this is the only
|
|
17
|
+
* part of the track model that most renderers read. also serializes the config
|
|
18
|
+
* and regions to JSON from MST objects.
|
|
18
19
|
*
|
|
19
20
|
* @param args - the arguments passed to render
|
|
20
21
|
*/
|
|
@@ -26,7 +27,7 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
26
27
|
id: displayModel.id,
|
|
27
28
|
selectedFeatureId: displayModel.selectedFeatureId,
|
|
28
29
|
},
|
|
29
|
-
regions:
|
|
30
|
+
regions: (0, clone_1.default)(regions),
|
|
30
31
|
};
|
|
31
32
|
return super.serializeArgsInClient(serializedArgs);
|
|
32
33
|
}
|
|
@@ -37,11 +38,7 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
37
38
|
* @param args - the arguments passed to render
|
|
38
39
|
*/
|
|
39
40
|
deserializeResultsInClient(result, args) {
|
|
40
|
-
const deserializedFeatures = new Map();
|
|
41
|
-
result.features.forEach(j => {
|
|
42
|
-
const f = simpleFeature_1.default.fromJSON(j);
|
|
43
|
-
deserializedFeatures.set(String(f.id()), f);
|
|
44
|
-
});
|
|
41
|
+
const deserializedFeatures = new Map(result.features.map(f => simpleFeature_1.default.fromJSON(f)).map(f => [f.id(), f]));
|
|
45
42
|
const deserialized = super.deserializeResultsInClient({
|
|
46
43
|
...result,
|
|
47
44
|
features: deserializedFeatures,
|
|
@@ -83,8 +80,9 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
83
80
|
* @returns Map of features as `{ id => feature, ... }`
|
|
84
81
|
*/
|
|
85
82
|
async getFeatures(renderArgs) {
|
|
83
|
+
const pm = this.pluginManager;
|
|
86
84
|
const { signal, regions, sessionId, adapterConfig } = renderArgs;
|
|
87
|
-
const { dataAdapter } = await (0, dataAdapterCache_1.getAdapter)(
|
|
85
|
+
const { dataAdapter } = await (0, dataAdapterCache_1.getAdapter)(pm, sessionId, adapterConfig);
|
|
88
86
|
if (!(0, BaseAdapter_1.isFeatureAdapter)(dataAdapter)) {
|
|
89
87
|
throw new Error('Adapter does not support retrieving features');
|
|
90
88
|
}
|
|
@@ -92,9 +90,9 @@ class FeatureRendererType extends ServerSideRendererType_1.default {
|
|
|
92
90
|
if (!regions || regions.length === 0) {
|
|
93
91
|
return features;
|
|
94
92
|
}
|
|
93
|
+
// make sure the requested region's start and end are integers, if
|
|
94
|
+
// there is a region specification.
|
|
95
95
|
const requestRegions = regions.map((r) => {
|
|
96
|
-
// make sure the requested region's start and end are integers, if
|
|
97
|
-
// there is a region specification.
|
|
98
96
|
const requestRegion = { ...r };
|
|
99
97
|
if (requestRegion.start) {
|
|
100
98
|
requestRegion.start = Math.floor(requestRegion.start);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AnyReactComponentType, Feature } from '../../util';
|
|
3
|
+
declare const _default: (props: {
|
|
4
|
+
html: string;
|
|
5
|
+
features: Map<string, Feature>;
|
|
6
|
+
RenderingComponent: AnyReactComponentType;
|
|
7
|
+
}) => JSX.Element;
|
|
8
|
+
export default _default;
|