@jbrowse/plugin-variants 2.1.7 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ChordVariantDisplay/index.d.ts +1 -2
- package/dist/ChordVariantDisplay/index.js +13 -10
- package/dist/ChordVariantDisplay/index.js.map +1 -1
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +19 -1
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js +22 -3
- package/dist/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -1
- package/dist/ChordVariantDisplay/models/configSchema.d.ts +3 -0
- package/dist/ChordVariantDisplay/models/configSchema.js +25 -0
- package/dist/ChordVariantDisplay/models/configSchema.js.map +1 -0
- package/dist/ChordVariantDisplay/models/stateModelFactory.d.ts +112 -0
- package/dist/ChordVariantDisplay/models/stateModelFactory.js +55 -0
- package/dist/ChordVariantDisplay/models/stateModelFactory.js.map +1 -0
- package/dist/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/dist/LinearVariantDisplay/configSchema.js +16 -5
- package/dist/LinearVariantDisplay/configSchema.js.map +1 -1
- package/dist/LinearVariantDisplay/index.js +2 -2
- package/dist/LinearVariantDisplay/index.js.map +1 -1
- package/dist/LinearVariantDisplay/model.d.ts +21 -3
- package/dist/LinearVariantDisplay/model.js +16 -2
- package/dist/LinearVariantDisplay/model.js.map +1 -1
- package/dist/StructuralVariantChordRenderer/configSchema.d.ts +2 -0
- package/dist/StructuralVariantChordRenderer/configSchema.js +38 -0
- package/dist/StructuralVariantChordRenderer/configSchema.js.map +1 -0
- package/dist/StructuralVariantChordRenderer/index.d.ts +1 -2
- package/dist/StructuralVariantChordRenderer/index.js +4 -24
- package/dist/StructuralVariantChordRenderer/index.js.map +1 -1
- package/dist/VariantTrack/configSchema.d.ts +3 -0
- package/dist/VariantTrack/configSchema.js +18 -0
- package/dist/VariantTrack/configSchema.js.map +1 -0
- package/dist/VariantTrack/index.d.ts +1 -1
- package/dist/VariantTrack/index.js +5 -5
- package/dist/VariantTrack/index.js.map +1 -1
- package/dist/VcfAdapter/configSchema.d.ts +2 -2
- package/dist/VcfAdapter/configSchema.js +9 -1
- package/dist/VcfAdapter/configSchema.js.map +1 -1
- package/dist/VcfTabixAdapter/configSchema.d.ts +2 -2
- package/dist/VcfTabixAdapter/configSchema.js +15 -1
- package/dist/VcfTabixAdapter/configSchema.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/esm/ChordVariantDisplay/index.d.ts +1 -2
- package/esm/ChordVariantDisplay/index.js +13 -10
- package/esm/ChordVariantDisplay/index.js.map +1 -1
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.d.ts +19 -1
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js +21 -5
- package/esm/ChordVariantDisplay/models/ChordVariantDisplay.js.map +1 -1
- package/esm/ChordVariantDisplay/models/configSchema.d.ts +3 -0
- package/esm/ChordVariantDisplay/models/configSchema.js +23 -0
- package/esm/ChordVariantDisplay/models/configSchema.js.map +1 -0
- package/esm/ChordVariantDisplay/models/stateModelFactory.d.ts +112 -0
- package/esm/ChordVariantDisplay/models/stateModelFactory.js +53 -0
- package/esm/ChordVariantDisplay/models/stateModelFactory.js.map +1 -0
- package/esm/LinearVariantDisplay/configSchema.d.ts +2 -2
- package/esm/LinearVariantDisplay/configSchema.js +15 -3
- package/esm/LinearVariantDisplay/configSchema.js.map +1 -1
- package/esm/LinearVariantDisplay/index.js +2 -2
- package/esm/LinearVariantDisplay/index.js.map +1 -1
- package/esm/LinearVariantDisplay/model.d.ts +21 -3
- package/esm/LinearVariantDisplay/model.js +15 -1
- package/esm/LinearVariantDisplay/model.js.map +1 -1
- package/esm/StructuralVariantChordRenderer/configSchema.d.ts +2 -0
- package/esm/StructuralVariantChordRenderer/configSchema.js +36 -0
- package/esm/StructuralVariantChordRenderer/configSchema.js.map +1 -0
- package/esm/StructuralVariantChordRenderer/index.d.ts +1 -2
- package/esm/StructuralVariantChordRenderer/index.js +3 -23
- package/esm/StructuralVariantChordRenderer/index.js.map +1 -1
- package/esm/VariantTrack/configSchema.d.ts +3 -0
- package/esm/VariantTrack/configSchema.js +16 -0
- package/esm/VariantTrack/configSchema.js.map +1 -0
- package/esm/VariantTrack/index.d.ts +1 -1
- package/esm/VariantTrack/index.js +6 -6
- package/esm/VariantTrack/index.js.map +1 -1
- package/esm/VcfAdapter/configSchema.d.ts +2 -2
- package/esm/VcfAdapter/configSchema.js +9 -1
- package/esm/VcfAdapter/configSchema.js.map +1 -1
- package/esm/VcfTabixAdapter/configSchema.d.ts +2 -2
- package/esm/VcfTabixAdapter/configSchema.js +15 -1
- package/esm/VcfTabixAdapter/configSchema.js.map +1 -1
- package/esm/index.js +4 -4
- package/esm/index.js.map +1 -1
- package/package.json +2 -2
- package/src/ChordVariantDisplay/index.ts +13 -12
- package/src/ChordVariantDisplay/models/ChordVariantDisplay.ts +22 -19
- package/src/ChordVariantDisplay/models/configSchema.ts +33 -0
- package/src/ChordVariantDisplay/models/stateModelFactory.ts +65 -0
- package/src/LinearVariantDisplay/configSchema.test.js +1 -1
- package/src/LinearVariantDisplay/configSchema.ts +16 -8
- package/src/LinearVariantDisplay/index.ts +2 -2
- package/src/LinearVariantDisplay/model.ts +17 -1
- package/src/StructuralVariantChordRenderer/configSchema.ts +42 -0
- package/src/StructuralVariantChordRenderer/index.ts +9 -32
- package/src/VariantFeatureWidget/__snapshots__/VariantFeatureWidget.test.js.snap +25 -25
- package/src/VariantTrack/configSchema.ts +24 -0
- package/src/VariantTrack/index.ts +6 -17
- package/src/VcfAdapter/configSchema.ts +11 -1
- package/src/VcfTabixAdapter/configSchema.ts +17 -1
- package/src/index.ts +4 -10
|
@@ -3,13 +3,27 @@ import { getRpcSessionId } from '@jbrowse/core/util/tracks';
|
|
|
3
3
|
import { getContainingTrack, getSession, getContainingView, isSessionModelWithWidgets, } from '@jbrowse/core/util';
|
|
4
4
|
import { linearBasicDisplayModelFactory } from '@jbrowse/plugin-linear-genome-view';
|
|
5
5
|
import { types } from 'mobx-state-tree';
|
|
6
|
-
|
|
6
|
+
/**
|
|
7
|
+
* #stateModel LinearVariantDisplay
|
|
8
|
+
* extends `LinearBasicDisplay`
|
|
9
|
+
* very similar to basic display, but provides custom widget on feature click
|
|
10
|
+
*/
|
|
11
|
+
export default function stateModelFactory(configSchema) {
|
|
7
12
|
return types
|
|
8
13
|
.compose('LinearVariantDisplay', linearBasicDisplayModelFactory(configSchema), types.model({
|
|
14
|
+
/**
|
|
15
|
+
* #property
|
|
16
|
+
*/
|
|
9
17
|
type: types.literal('LinearVariantDisplay'),
|
|
18
|
+
/**
|
|
19
|
+
* #property
|
|
20
|
+
*/
|
|
10
21
|
configuration: ConfigurationReference(configSchema),
|
|
11
22
|
}))
|
|
12
23
|
.actions(self => ({
|
|
24
|
+
/**
|
|
25
|
+
* #action
|
|
26
|
+
*/
|
|
13
27
|
async selectFeature(feature) {
|
|
14
28
|
const session = getSession(self);
|
|
15
29
|
if (isSessionModelWithWidgets(session)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearVariantDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAGvC,MAAM,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearVariantDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EAAE,8BAA8B,EAAE,MAAM,oCAAoC,CAAA;AACnF,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAGvC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,YAA6C;IAE7C,OAAO,KAAK;SACT,OAAO,CACN,sBAAsB,EACtB,8BAA8B,CAAC,YAAY,CAAC,EAC5C,KAAK,CAAC,KAAK,CAAC;QACV;;WAEG;QACH,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,sBAAsB,CAAC;QAC3C;;WAEG;QACH,aAAa,EAAE,sBAAsB,CAAC,YAAY,CAAC;KACpD,CAAC,CACH;SACA,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChB;;WAEG;QACH,KAAK,CAAC,aAAa,CAAC,OAAgB;YAClC,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;YAChC,IAAI,yBAAyB,CAAC,OAAO,CAAC,EAAE;gBACtC,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAA;gBAC9B,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAA;gBACvC,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;gBACtC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAA;gBACpC,MAAM,aAAa,GAAG,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;gBAC/C,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,IAAI,CACxC,SAAS,EACT,iBAAiB,EACjB;oBACE,aAAa;iBACd,CACF,CAAA;gBACD,OAAO,CAAC,UAAU,CAChB,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,gBAAgB,EAAE;oBAC1D,WAAW,EAAE,OAAO,CAAC,MAAM,EAAE;oBAC7B,IAAI;oBACJ,KAAK;oBACL,YAAY;iBACb,CAAC,CACH,CAAA;aACF;YAED,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAA;QAC/B,CAAC;KACF,CAAC,CAAC,CAAA;AACP,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
/**
|
|
3
|
+
* #config StructuralVariantChordRenderer
|
|
4
|
+
*/
|
|
5
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
|
+
const configSchema = ConfigurationSchema('StructuralVariantChordRenderer', {
|
|
7
|
+
/**
|
|
8
|
+
* #slot
|
|
9
|
+
*/
|
|
10
|
+
strokeColor: {
|
|
11
|
+
type: 'color',
|
|
12
|
+
description: 'the line color of each arc',
|
|
13
|
+
defaultValue: 'rgba(255,133,0,0.32)',
|
|
14
|
+
contextVariable: ['feature'],
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* #slot
|
|
18
|
+
*/
|
|
19
|
+
strokeColorSelected: {
|
|
20
|
+
type: 'color',
|
|
21
|
+
description: 'the line color of an arc that has been selected',
|
|
22
|
+
defaultValue: 'black',
|
|
23
|
+
contextVariable: ['feature'],
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* #slot
|
|
27
|
+
*/
|
|
28
|
+
strokeColorHover: {
|
|
29
|
+
type: 'color',
|
|
30
|
+
description: 'the line color of an arc that is being hovered over with the mouse',
|
|
31
|
+
defaultValue: '#555',
|
|
32
|
+
contextVariable: ['feature'],
|
|
33
|
+
},
|
|
34
|
+
}, { explicitlyTyped: true });
|
|
35
|
+
export default configSchema;
|
|
36
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/StructuralVariantChordRenderer/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,mBAAmB,CACtC,gCAAgC,EAChC;IACE;;OAEG;IACH,WAAW,EAAE;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,4BAA4B;QACzC,YAAY,EAAE,sBAAsB;QACpC,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD;;OAEG;IACH,mBAAmB,EAAE;QACnB,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,iDAAiD;QAC9D,YAAY,EAAE,OAAO;QACrB,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;IACD;;OAEG;IACH,gBAAgB,EAAE;QAChB,IAAI,EAAE,OAAO;QACb,WAAW,EACT,oEAAoE;QACtE,YAAY,EAAE,MAAM;QACpB,eAAe,EAAE,CAAC,SAAS,CAAC;KAC7B;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA;AAED,eAAe,YAAY,CAAA"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ChordRendererType from '@jbrowse/core/pluggableElementTypes/renderers/CircularChordRendererType';
|
|
2
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
3
|
-
declare const ChordRendererConfigF: (pluginManager: PluginManager) =>
|
|
2
|
+
declare const ChordRendererConfigF: (pluginManager: PluginManager) => void;
|
|
4
3
|
export default ChordRendererConfigF;
|
|
@@ -1,33 +1,13 @@
|
|
|
1
1
|
import ChordRendererType from '@jbrowse/core/pluggableElementTypes/renderers/CircularChordRendererType';
|
|
2
|
-
import
|
|
2
|
+
import configSchema from './configSchema';
|
|
3
3
|
import ReactComponent from './ReactComponent';
|
|
4
4
|
const ChordRendererConfigF = (pluginManager) => {
|
|
5
|
-
|
|
6
|
-
strokeColor: {
|
|
7
|
-
type: 'color',
|
|
8
|
-
description: 'the line color of each arc',
|
|
9
|
-
defaultValue: 'rgba(255,133,0,0.32)',
|
|
10
|
-
contextVariable: ['feature'],
|
|
11
|
-
},
|
|
12
|
-
strokeColorSelected: {
|
|
13
|
-
type: 'color',
|
|
14
|
-
description: 'the line color of an arc that has been selected',
|
|
15
|
-
defaultValue: 'black',
|
|
16
|
-
contextVariable: ['feature'],
|
|
17
|
-
},
|
|
18
|
-
strokeColorHover: {
|
|
19
|
-
type: 'color',
|
|
20
|
-
description: 'the line color of an arc that is being hovered over with the mouse',
|
|
21
|
-
defaultValue: '#555',
|
|
22
|
-
contextVariable: ['feature'],
|
|
23
|
-
},
|
|
24
|
-
}, { explicitlyTyped: true });
|
|
25
|
-
return new ChordRendererType({
|
|
5
|
+
pluginManager.addRendererType(() => new ChordRendererType({
|
|
26
6
|
name: 'StructuralVariantChordRenderer',
|
|
27
7
|
ReactComponent,
|
|
28
8
|
configSchema,
|
|
29
9
|
pluginManager,
|
|
30
|
-
});
|
|
10
|
+
}));
|
|
31
11
|
};
|
|
32
12
|
export default ChordRendererConfigF;
|
|
33
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/StructuralVariantChordRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yEAAyE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/StructuralVariantChordRenderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,yEAAyE,CAAA;AAEvG,OAAO,YAAY,MAAM,gBAAgB,CAAA;AACzC,OAAO,cAAc,MAAM,kBAAkB,CAAA;AAE7C,MAAM,oBAAoB,GAAG,CAAC,aAA4B,EAAE,EAAE;IAC5D,aAAa,CAAC,eAAe,CAC3B,GAAG,EAAE,CACH,IAAI,iBAAiB,CAAC;QACpB,IAAI,EAAE,gCAAgC;QACtC,cAAc;QACd,YAAY;QACZ,aAAa;KACd,CAAC,CACL,CAAA;AACH,CAAC,CAAA;AAED,eAAe,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
+
import { createBaseTrackConfig } from '@jbrowse/core/pluggableElementTypes';
|
|
3
|
+
/**
|
|
4
|
+
* #config VariantTrack
|
|
5
|
+
* Mostly similar to feature track, but has `ChordDisplayType` registered to it,
|
|
6
|
+
* and custom feature details in `LinearVariantDisplay`
|
|
7
|
+
*/
|
|
8
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
|
+
const configSchema = (pluginManager) => ConfigurationSchema('VariantTrack', {}, {
|
|
10
|
+
/**
|
|
11
|
+
* #baseConfiguration
|
|
12
|
+
*/
|
|
13
|
+
baseConfiguration: createBaseTrackConfig(pluginManager),
|
|
14
|
+
});
|
|
15
|
+
export default configSchema;
|
|
16
|
+
//# sourceMappingURL=configSchema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/VariantTrack/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAA;AAG3E;;;;GAIG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,YAAY,GAAG,CAAC,aAA4B,EAAE,EAAE,CACpD,mBAAmB,CACjB,cAAc,EACd,EAAE,EACF;IACE;;OAEG;IACH,iBAAiB,EAAE,qBAAqB,CAAC,aAAa,CAAC;CACxD,CACF,CAAA;AAEH,eAAe,YAAY,CAAA"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
1
|
import TrackType from '@jbrowse/core/pluggableElementTypes/TrackType';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { createBaseTrackModel } from '@jbrowse/core/pluggableElementTypes/models';
|
|
3
|
+
import configSchemaF from './configSchema';
|
|
4
|
+
export default (pm) => {
|
|
5
|
+
pm.addTrackType(() => {
|
|
6
|
+
const configSchema = configSchemaF(pm);
|
|
7
7
|
return new TrackType({
|
|
8
8
|
name: 'VariantTrack',
|
|
9
9
|
configSchema,
|
|
10
|
-
stateModel: createBaseTrackModel(
|
|
10
|
+
stateModel: createBaseTrackModel(pm, 'VariantTrack', configSchema),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/VariantTrack/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/VariantTrack/index.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,+CAA+C,CAAA;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAA;AACjF,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAE1C,eAAe,CAAC,EAAiB,EAAE,EAAE;IACnC,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE;QACnB,MAAM,YAAY,GAAG,aAAa,CAAC,EAAE,CAAC,CAAA;QACtC,OAAO,IAAI,SAAS,CAAC;YACnB,IAAI,EAAE,cAAc;YACpB,YAAY;YACZ,UAAU,EAAE,oBAAoB,CAAC,EAAE,EAAE,cAAc,EAAE,YAAY,CAAC;SACnE,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const VcfAdapter: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
+
export default VcfAdapter;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* #config VcfAdapter
|
|
4
|
+
*/
|
|
5
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
6
|
+
const VcfAdapter = ConfigurationSchema('VcfAdapter', {
|
|
7
|
+
/**
|
|
8
|
+
* #slot
|
|
9
|
+
*/
|
|
3
10
|
vcfLocation: {
|
|
4
11
|
type: 'fileLocation',
|
|
5
12
|
defaultValue: { uri: '/path/to/my.vcf', locationType: 'UriLocation' },
|
|
6
13
|
},
|
|
7
14
|
}, { explicitlyTyped: true });
|
|
15
|
+
export default VcfAdapter;
|
|
8
16
|
//# sourceMappingURL=configSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/VcfAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/VcfAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,UAAU,GAAG,mBAAmB,CACpC,YAAY,EACZ;IACE;;OAEG;IACH,WAAW,EAAE;QACX,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,EAAE,GAAG,EAAE,iBAAiB,EAAE,YAAY,EAAE,aAAa,EAAE;KACtE;CACF,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const
|
|
2
|
-
export default
|
|
1
|
+
declare const VcfTabixAdapter: import("@jbrowse/core/configuration").AnyConfigurationSchemaType;
|
|
2
|
+
export default VcfTabixAdapter;
|
|
@@ -1,16 +1,29 @@
|
|
|
1
1
|
import { types } from 'mobx-state-tree';
|
|
2
2
|
import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* #config VcfTabixAdapter
|
|
5
|
+
*/
|
|
6
|
+
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
7
|
+
const VcfTabixAdapter = ConfigurationSchema('VcfTabixAdapter', {
|
|
8
|
+
/**
|
|
9
|
+
* #slot
|
|
10
|
+
*/
|
|
4
11
|
vcfGzLocation: {
|
|
5
12
|
type: 'fileLocation',
|
|
6
13
|
defaultValue: { uri: '/path/to/my.vcf.gz', locationType: 'UriLocation' },
|
|
7
14
|
},
|
|
8
15
|
index: ConfigurationSchema('VcfIndex', {
|
|
16
|
+
/**
|
|
17
|
+
* #slot index.indexType
|
|
18
|
+
*/
|
|
9
19
|
indexType: {
|
|
10
20
|
model: types.enumeration('IndexType', ['TBI', 'CSI']),
|
|
11
21
|
type: 'stringEnum',
|
|
12
22
|
defaultValue: 'TBI',
|
|
13
23
|
},
|
|
24
|
+
/**
|
|
25
|
+
* #slot index.location
|
|
26
|
+
*/
|
|
14
27
|
location: {
|
|
15
28
|
type: 'fileLocation',
|
|
16
29
|
defaultValue: {
|
|
@@ -20,4 +33,5 @@ export default ConfigurationSchema('VcfTabixAdapter', {
|
|
|
20
33
|
},
|
|
21
34
|
}),
|
|
22
35
|
}, { explicitlyTyped: true });
|
|
36
|
+
export default VcfTabixAdapter;
|
|
23
37
|
//# sourceMappingURL=configSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/VcfTabixAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE,eAAe,mBAAmB,
|
|
1
|
+
{"version":3,"file":"configSchema.js","sourceRoot":"","sources":["../../src/VcfTabixAdapter/configSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEjE;;GAEG;AACH,SAAS,CAAC,KAAI,CAAC,CAAC,wDAAwD;AAExE,MAAM,eAAe,GAAG,mBAAmB,CACzC,iBAAiB,EACjB;IACE;;OAEG;IACH,aAAa,EAAE;QACb,IAAI,EAAE,cAAc;QACpB,YAAY,EAAE,EAAE,GAAG,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,EAAE;KACzE;IACD,KAAK,EAAE,mBAAmB,CAAC,UAAU,EAAE;QACrC;;WAEG;QACH,SAAS,EAAE;YACT,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACrD,IAAI,EAAE,YAAY;YAClB,YAAY,EAAE,KAAK;SACpB;QACD;;WAEG;QACH,QAAQ,EAAE;YACR,IAAI,EAAE,cAAc;YACpB,YAAY,EAAE;gBACZ,GAAG,EAAE,wBAAwB;gBAC7B,YAAY,EAAE,aAAa;aAC5B;SACF;KACF,CAAC;CACH,EACD,EAAE,eAAe,EAAE,IAAI,EAAE,CAC1B,CAAA;AAED,eAAe,eAAe,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import VcfTabixAdapterF from './VcfTabixAdapter';
|
|
|
3
3
|
import ExtensionPointsF from './extensionPoints';
|
|
4
4
|
import VariantTrackF from './VariantTrack';
|
|
5
5
|
import Plugin from '@jbrowse/core/Plugin';
|
|
6
|
-
import
|
|
6
|
+
import ChordVariantDisplayF from './ChordVariantDisplay';
|
|
7
7
|
import LinearVariantDisplayF from './LinearVariantDisplay';
|
|
8
|
-
import
|
|
8
|
+
import StructuralVariantChordRendererF from './StructuralVariantChordRenderer';
|
|
9
9
|
import VariantFeatureWidgetF from './VariantFeatureWidget';
|
|
10
10
|
export default class VariantsPlugin extends Plugin {
|
|
11
11
|
constructor() {
|
|
@@ -19,8 +19,8 @@ export default class VariantsPlugin extends Plugin {
|
|
|
19
19
|
VariantTrackF(pluginManager);
|
|
20
20
|
ExtensionPointsF(pluginManager);
|
|
21
21
|
LinearVariantDisplayF(pluginManager);
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
StructuralVariantChordRendererF(pluginManager);
|
|
23
|
+
ChordVariantDisplayF(pluginManager);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
export { default as VcfFeature } from './VcfTabixAdapter/VcfFeature';
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,gBAAgB,MAAM,mBAAmB,CAAA;AAChD,OAAO,gBAAgB,MAAM,mBAAmB,CAAA;AAChD,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,cAAc,CAAA;AACtC,OAAO,gBAAgB,MAAM,mBAAmB,CAAA;AAChD,OAAO,gBAAgB,MAAM,mBAAmB,CAAA;AAChD,OAAO,aAAa,MAAM,gBAAgB,CAAA;AAC1C,OAAO,MAAM,MAAM,sBAAsB,CAAA;AAEzC,OAAO,oBAAoB,MAAM,uBAAuB,CAAA;AACxD,OAAO,qBAAqB,MAAM,wBAAwB,CAAA;AAC1D,OAAO,+BAA+B,MAAM,kCAAkC,CAAA;AAC9E,OAAO,qBAAqB,MAAM,wBAAwB,CAAA;AAE1D,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,MAAM;IAAlD;;QACE,SAAI,GAAG,gBAAgB,CAAA;IAYzB,CAAC;IAVC,OAAO,CAAC,aAA4B;QAClC,WAAW,CAAC,aAAa,CAAC,CAAA;QAC1B,gBAAgB,CAAC,aAAa,CAAC,CAAA;QAC/B,qBAAqB,CAAC,aAAa,CAAC,CAAA;QACpC,aAAa,CAAC,aAAa,CAAC,CAAA;QAC5B,gBAAgB,CAAC,aAAa,CAAC,CAAA;QAC/B,qBAAqB,CAAC,aAAa,CAAC,CAAA;QACpC,+BAA+B,CAAC,aAAa,CAAC,CAAA;QAC9C,oBAAoB,CAAC,aAAa,CAAC,CAAA;IACrC,CAAC;CACF;AAED,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-variants",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0",
|
|
4
4
|
"description": "JBrowse 2 variant adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"distModule": "esm/index.js",
|
|
66
66
|
"srcModule": "src/index.ts",
|
|
67
67
|
"module": "esm/index.js",
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "cf31db8d833117f8822510340664fb3f045975cb"
|
|
69
69
|
}
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
2
|
import { BaseChordDisplayComponent } from '@jbrowse/plugin-circular-view'
|
|
3
|
-
import ChordVariantDisplay from './models/ChordVariantDisplay'
|
|
4
3
|
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
4
|
+
import configSchemaF from './models/configSchema'
|
|
5
|
+
import stateModelF from './models/stateModelFactory'
|
|
5
6
|
|
|
6
7
|
export default (pluginManager: PluginManager) => {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
pluginManager.addDisplayType(() => {
|
|
9
|
+
const configSchema = configSchemaF(pluginManager)
|
|
10
|
+
const stateModel = stateModelF(configSchema)
|
|
11
|
+
return new DisplayType({
|
|
12
|
+
name: 'ChordVariantDisplay',
|
|
13
|
+
configSchema,
|
|
14
|
+
stateModel,
|
|
15
|
+
trackType: 'VariantTrack',
|
|
16
|
+
viewType: 'CircularView',
|
|
17
|
+
ReactComponent: BaseChordDisplayComponent,
|
|
18
|
+
})
|
|
18
19
|
})
|
|
19
20
|
}
|
|
@@ -1,42 +1,45 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
BaseChordDisplayModel,
|
|
4
|
-
} from '@jbrowse/plugin-circular-view'
|
|
5
|
-
import {
|
|
6
|
-
ConfigurationSchema,
|
|
7
|
-
ConfigurationReference,
|
|
8
|
-
} from '@jbrowse/core/configuration'
|
|
1
|
+
import { BaseChordDisplayModel } from '@jbrowse/plugin-circular-view'
|
|
2
|
+
import { ConfigurationReference } from '@jbrowse/core/configuration'
|
|
9
3
|
import { types } from 'mobx-state-tree'
|
|
10
4
|
import { getContainingView } from '@jbrowse/core/util'
|
|
11
5
|
import { getParentRenderProps } from '@jbrowse/core/util/tracks'
|
|
12
6
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
'ChordVariantDisplay',
|
|
17
|
-
{
|
|
18
|
-
renderer: types.optional(
|
|
19
|
-
pluginManager.pluggableConfigSchemaType('renderer'),
|
|
20
|
-
{ type: 'StructuralVariantChordRenderer' },
|
|
21
|
-
),
|
|
22
|
-
},
|
|
23
|
-
{ baseConfiguration: baseChordDisplayConfig, explicitlyTyped: true },
|
|
24
|
-
)
|
|
8
|
+
// locals
|
|
9
|
+
import configSchemaF from './configSchema'
|
|
25
10
|
|
|
11
|
+
/**
|
|
12
|
+
* #stateModel ChordVariantDisplay
|
|
13
|
+
* extends `BaseChordDisplay`
|
|
14
|
+
*/
|
|
15
|
+
const ChordVariantDisplayF = (pluginManager: PluginManager) => {
|
|
16
|
+
const configSchema = configSchemaF(pluginManager)
|
|
26
17
|
const stateModel = types
|
|
27
18
|
.compose(
|
|
28
19
|
'ChordVariantDisplay',
|
|
29
20
|
BaseChordDisplayModel,
|
|
30
21
|
types.model({
|
|
22
|
+
/**
|
|
23
|
+
* #property
|
|
24
|
+
*/
|
|
31
25
|
type: types.literal('ChordVariantDisplay'),
|
|
26
|
+
/**
|
|
27
|
+
* #property
|
|
28
|
+
*/
|
|
32
29
|
configuration: ConfigurationReference(configSchema),
|
|
33
30
|
}),
|
|
34
31
|
)
|
|
35
32
|
.views(self => ({
|
|
33
|
+
/**
|
|
34
|
+
* #getter
|
|
35
|
+
*/
|
|
36
36
|
get rendererTypeName() {
|
|
37
37
|
return self.configuration.renderer.type
|
|
38
38
|
},
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* #method
|
|
42
|
+
*/
|
|
40
43
|
renderProps(): Record<string, unknown> {
|
|
41
44
|
const view = getContainingView(self)
|
|
42
45
|
return {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ConfigurationSchema } from '@jbrowse/core/configuration'
|
|
2
|
+
import PluginManager from '@jbrowse/core/PluginManager'
|
|
3
|
+
import { baseChordDisplayConfig } from '@jbrowse/plugin-circular-view'
|
|
4
|
+
import { types } from 'mobx-state-tree'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* #config ChordVariantDisplay
|
|
8
|
+
*/
|
|
9
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
|
+
|
|
11
|
+
function stateModelFactory(pluginManager: PluginManager) {
|
|
12
|
+
return ConfigurationSchema(
|
|
13
|
+
'ChordVariantDisplay',
|
|
14
|
+
{
|
|
15
|
+
/**
|
|
16
|
+
* #slot
|
|
17
|
+
*/
|
|
18
|
+
renderer: types.optional(
|
|
19
|
+
pluginManager.pluggableConfigSchemaType('renderer'),
|
|
20
|
+
{ type: 'StructuralVariantChordRenderer' },
|
|
21
|
+
),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
/**
|
|
25
|
+
* #baseConfiguration
|
|
26
|
+
*/
|
|
27
|
+
baseConfiguration: baseChordDisplayConfig,
|
|
28
|
+
explicitlyTyped: true,
|
|
29
|
+
},
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default stateModelFactory
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BaseChordDisplayModel } from '@jbrowse/plugin-circular-view'
|
|
2
|
+
import {
|
|
3
|
+
AnyConfigurationSchemaType,
|
|
4
|
+
ConfigurationReference,
|
|
5
|
+
} from '@jbrowse/core/configuration'
|
|
6
|
+
import { types } from 'mobx-state-tree'
|
|
7
|
+
import { getContainingView } from '@jbrowse/core/util'
|
|
8
|
+
import { getParentRenderProps } from '@jbrowse/core/util/tracks'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* #stateModel ChordVariantDisplay
|
|
12
|
+
* extends `BaseChordDisplay`
|
|
13
|
+
*/
|
|
14
|
+
const stateModelFactory = (configSchema: AnyConfigurationSchemaType) => {
|
|
15
|
+
return types
|
|
16
|
+
.compose(
|
|
17
|
+
'ChordVariantDisplay',
|
|
18
|
+
BaseChordDisplayModel,
|
|
19
|
+
types.model({
|
|
20
|
+
/**
|
|
21
|
+
* #property
|
|
22
|
+
*/
|
|
23
|
+
type: types.literal('ChordVariantDisplay'),
|
|
24
|
+
/**
|
|
25
|
+
* #property
|
|
26
|
+
*/
|
|
27
|
+
configuration: ConfigurationReference(configSchema),
|
|
28
|
+
}),
|
|
29
|
+
)
|
|
30
|
+
.views(self => ({
|
|
31
|
+
/**
|
|
32
|
+
* #getter
|
|
33
|
+
*/
|
|
34
|
+
get rendererTypeName() {
|
|
35
|
+
return self.configuration.renderer.type
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* #method
|
|
40
|
+
*/
|
|
41
|
+
renderProps(): Record<string, unknown> {
|
|
42
|
+
const view = getContainingView(self)
|
|
43
|
+
return {
|
|
44
|
+
...getParentRenderProps(self),
|
|
45
|
+
rpcDriverName: self.rpcDriverName,
|
|
46
|
+
displayModel: self,
|
|
47
|
+
bezierRadius: view.radiusPx * self.bezierRadiusRatio,
|
|
48
|
+
radius: view.radiusPx,
|
|
49
|
+
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
blockDefinitions: this.blockDefinitions,
|
|
52
|
+
config: self.configuration.renderer,
|
|
53
|
+
onChordClick: self.onChordClick,
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
}))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// http://localhost:3000/test_data/hs37d5.HG002-SequelII-CCS.sv.vcf.gz.tbi
|
|
60
|
+
|
|
61
|
+
// render request is for 1.5x the current viewing window
|
|
62
|
+
|
|
63
|
+
// tracks all have a height
|
|
64
|
+
//
|
|
65
|
+
export default stateModelFactory
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
configSchema as svgFeatureRendererConfigSchema,
|
|
7
7
|
ReactComponent as SvgFeatureRendererReactComponent,
|
|
8
8
|
} from '@jbrowse/plugin-svg/src/SvgFeatureRenderer'
|
|
9
|
-
import
|
|
9
|
+
import configSchemaFactory from './configSchema'
|
|
10
10
|
|
|
11
11
|
// mock warnings to avoid unnecessary outputs
|
|
12
12
|
beforeEach(() => {
|
|
@@ -3,20 +3,28 @@ import { Instance } from 'mobx-state-tree'
|
|
|
3
3
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
4
4
|
import { linearBasicDisplayConfigSchemaFactory } from '@jbrowse/plugin-linear-genome-view'
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* #config LinearVariantDisplay
|
|
8
|
+
* mostly empty, this display type is very much
|
|
9
|
+
* like a `FeatureTrack` with a `LinearBasicDisplay` except it has a custom
|
|
10
|
+
* feature details widget
|
|
11
|
+
*/
|
|
12
|
+
function x() {} // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
13
|
|
|
14
|
+
export default function configSchemaF(pluginManager: PluginManager) {
|
|
11
15
|
return ConfigurationSchema(
|
|
12
16
|
'LinearVariantDisplay',
|
|
13
17
|
{},
|
|
14
|
-
{
|
|
18
|
+
{
|
|
19
|
+
/**
|
|
20
|
+
* #baseConfiguration
|
|
21
|
+
*/
|
|
22
|
+
baseConfiguration: linearBasicDisplayConfigSchemaFactory(pluginManager),
|
|
23
|
+
explicitlyTyped: true,
|
|
24
|
+
},
|
|
15
25
|
)
|
|
16
26
|
}
|
|
17
27
|
|
|
18
|
-
export type LinearVariantDisplayConfigModel = ReturnType<
|
|
19
|
-
typeof LinearVariantDisplayConfigFactory
|
|
20
|
-
>
|
|
28
|
+
export type LinearVariantDisplayConfigModel = ReturnType<typeof configSchemaF>
|
|
21
29
|
export type LinearVariantDisplayConfig =
|
|
22
30
|
Instance<LinearVariantDisplayConfigModel>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager'
|
|
2
|
-
import { LinearVariantDisplayConfigFactory } from './configSchema'
|
|
3
2
|
import { BaseLinearDisplayComponent } from '@jbrowse/plugin-linear-genome-view'
|
|
4
3
|
import DisplayType from '@jbrowse/core/pluggableElementTypes/DisplayType'
|
|
5
4
|
import stateModelFactory from './model'
|
|
5
|
+
import configSchemaF from './configSchema'
|
|
6
6
|
|
|
7
7
|
export default (pluginManager: PluginManager) => {
|
|
8
8
|
pluginManager.addDisplayType(() => {
|
|
9
|
-
const configSchema =
|
|
9
|
+
const configSchema = configSchemaF(pluginManager)
|
|
10
10
|
return new DisplayType({
|
|
11
11
|
name: 'LinearVariantDisplay',
|
|
12
12
|
configSchema,
|
|
@@ -12,17 +12,33 @@ import { linearBasicDisplayModelFactory } from '@jbrowse/plugin-linear-genome-vi
|
|
|
12
12
|
import { types } from 'mobx-state-tree'
|
|
13
13
|
import { LinearVariantDisplayConfigModel } from './configSchema'
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
/**
|
|
16
|
+
* #stateModel LinearVariantDisplay
|
|
17
|
+
* extends `LinearBasicDisplay`
|
|
18
|
+
* very similar to basic display, but provides custom widget on feature click
|
|
19
|
+
*/
|
|
20
|
+
export default function stateModelFactory(
|
|
21
|
+
configSchema: LinearVariantDisplayConfigModel,
|
|
22
|
+
) {
|
|
16
23
|
return types
|
|
17
24
|
.compose(
|
|
18
25
|
'LinearVariantDisplay',
|
|
19
26
|
linearBasicDisplayModelFactory(configSchema),
|
|
20
27
|
types.model({
|
|
28
|
+
/**
|
|
29
|
+
* #property
|
|
30
|
+
*/
|
|
21
31
|
type: types.literal('LinearVariantDisplay'),
|
|
32
|
+
/**
|
|
33
|
+
* #property
|
|
34
|
+
*/
|
|
22
35
|
configuration: ConfigurationReference(configSchema),
|
|
23
36
|
}),
|
|
24
37
|
)
|
|
25
38
|
.actions(self => ({
|
|
39
|
+
/**
|
|
40
|
+
* #action
|
|
41
|
+
*/
|
|
26
42
|
async selectFeature(feature: Feature) {
|
|
27
43
|
const session = getSession(self)
|
|
28
44
|
if (isSessionModelWithWidgets(session)) {
|