@jbrowse/plugin-sequence 2.3.0 → 2.3.2
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/LinearReferenceSequenceDisplay/model.d.ts +42 -7
- package/dist/LinearReferenceSequenceDisplay/model.js +65 -23
- package/dist/LinearReferenceSequenceDisplay/model.js.map +1 -1
- package/esm/LinearReferenceSequenceDisplay/model.d.ts +42 -7
- package/esm/LinearReferenceSequenceDisplay/model.js +66 -24
- package/esm/LinearReferenceSequenceDisplay/model.js.map +1 -1
- package/package.json +2 -2
- package/src/LinearReferenceSequenceDisplay/model.ts +69 -25
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel LinearReferenceSequenceDisplay
|
|
5
|
+
* base model `BaseLinearDisplay`
|
|
6
|
+
*/
|
|
3
7
|
export declare function modelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
4
8
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
9
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -57,10 +61,9 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
57
61
|
} & {
|
|
58
62
|
type: import("mobx-state-tree").ISimpleType<"LinearReferenceSequenceDisplay">;
|
|
59
63
|
configuration: import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
60
|
-
showForward: import("mobx-state-tree").
|
|
61
|
-
showReverse: import("mobx-state-tree").
|
|
62
|
-
showTranslation: import("mobx-state-tree").
|
|
63
|
-
height: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
64
|
+
showForward: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
65
|
+
showReverse: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
66
|
+
showTranslation: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
64
67
|
}, {
|
|
65
68
|
rendererTypeName: string;
|
|
66
69
|
error: unknown;
|
|
@@ -68,10 +71,15 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
68
71
|
readonly RenderingComponent: import("react").FC<{
|
|
69
72
|
model: {
|
|
70
73
|
id: string;
|
|
74
|
+
/**
|
|
75
|
+
* #property
|
|
76
|
+
*/
|
|
71
77
|
type: string;
|
|
72
78
|
rpcDriverName: string | undefined;
|
|
73
79
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
74
|
-
rendererTypeName: string;
|
|
80
|
+
rendererTypeName: string; /**
|
|
81
|
+
* #property
|
|
82
|
+
*/
|
|
75
83
|
error: unknown;
|
|
76
84
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
77
85
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -91,14 +99,18 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
91
99
|
rpcDriverName: string | undefined;
|
|
92
100
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
93
101
|
rendererTypeName: string;
|
|
94
|
-
error: unknown;
|
|
102
|
+
error: unknown; /**
|
|
103
|
+
* #action
|
|
104
|
+
*/
|
|
95
105
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
96
106
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
97
107
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
98
108
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
99
109
|
}, {
|
|
100
110
|
rendererTypeName: string;
|
|
101
|
-
error: unknown;
|
|
111
|
+
error: unknown; /**
|
|
112
|
+
* #method
|
|
113
|
+
*/
|
|
102
114
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
103
115
|
}> | null;
|
|
104
116
|
readonly adapterConfig: any;
|
|
@@ -186,14 +198,37 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
186
198
|
overrideHeight: number;
|
|
187
199
|
}): Promise<JSX.Element>;
|
|
188
200
|
} & {
|
|
201
|
+
/**
|
|
202
|
+
* #method
|
|
203
|
+
*/
|
|
189
204
|
renderProps(): any;
|
|
205
|
+
} & {
|
|
206
|
+
/**
|
|
207
|
+
* #method
|
|
208
|
+
*/
|
|
190
209
|
regionCannotBeRendered(): "Zoom in to see sequence" | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* #getter
|
|
212
|
+
*/
|
|
191
213
|
readonly rendererTypeName: any;
|
|
192
214
|
} & {
|
|
215
|
+
/**
|
|
216
|
+
* #action
|
|
217
|
+
*/
|
|
193
218
|
toggleShowForward(): void;
|
|
219
|
+
/**
|
|
220
|
+
* #action
|
|
221
|
+
*/
|
|
194
222
|
toggleShowReverse(): void;
|
|
223
|
+
/**
|
|
224
|
+
* #action
|
|
225
|
+
*/
|
|
195
226
|
toggleShowTranslation(): void;
|
|
227
|
+
afterAttach(): void;
|
|
196
228
|
} & {
|
|
229
|
+
/**
|
|
230
|
+
* #method
|
|
231
|
+
*/
|
|
197
232
|
trackMenuItems(): {
|
|
198
233
|
label: string;
|
|
199
234
|
type: string;
|
|
@@ -5,19 +5,41 @@ const mobx_state_tree_1 = require("mobx-state-tree");
|
|
|
5
5
|
const plugin_linear_genome_view_1 = require("@jbrowse/plugin-linear-genome-view");
|
|
6
6
|
const configuration_1 = require("@jbrowse/core/configuration");
|
|
7
7
|
const util_1 = require("@jbrowse/core/util");
|
|
8
|
+
const mobx_1 = require("mobx");
|
|
9
|
+
/**
|
|
10
|
+
* #stateModel LinearReferenceSequenceDisplay
|
|
11
|
+
* base model `BaseLinearDisplay`
|
|
12
|
+
*/
|
|
8
13
|
function modelFactory(configSchema) {
|
|
9
14
|
return mobx_state_tree_1.types
|
|
10
15
|
.compose('LinearReferenceSequenceDisplay', plugin_linear_genome_view_1.BaseLinearDisplay, mobx_state_tree_1.types.model({
|
|
16
|
+
/**
|
|
17
|
+
* #property
|
|
18
|
+
*/
|
|
11
19
|
type: mobx_state_tree_1.types.literal('LinearReferenceSequenceDisplay'),
|
|
20
|
+
/**
|
|
21
|
+
* #property
|
|
22
|
+
*/
|
|
12
23
|
configuration: (0, configuration_1.ConfigurationReference)(configSchema),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
24
|
+
/**
|
|
25
|
+
* #property
|
|
26
|
+
*/
|
|
27
|
+
showForward: true,
|
|
28
|
+
/**
|
|
29
|
+
* #property
|
|
30
|
+
*/
|
|
31
|
+
showReverse: true,
|
|
32
|
+
/**
|
|
33
|
+
* #property
|
|
34
|
+
*/
|
|
35
|
+
showTranslation: true,
|
|
17
36
|
}))
|
|
18
37
|
.views(self => {
|
|
19
38
|
const { renderProps: superRenderProps } = self;
|
|
20
39
|
return {
|
|
40
|
+
/**
|
|
41
|
+
* #method
|
|
42
|
+
*/
|
|
21
43
|
renderProps() {
|
|
22
44
|
const { showForward, showReverse, showTranslation } = self;
|
|
23
45
|
return {
|
|
@@ -29,55 +51,75 @@ function modelFactory(configSchema) {
|
|
|
29
51
|
showTranslation,
|
|
30
52
|
};
|
|
31
53
|
},
|
|
32
|
-
regionCannotBeRendered( /* region */) {
|
|
33
|
-
const view = (0, util_1.getContainingView)(self);
|
|
34
|
-
if (view && view.bpPerPx >= 1) {
|
|
35
|
-
return 'Zoom in to see sequence';
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
},
|
|
39
|
-
get rendererTypeName() {
|
|
40
|
-
return self.configuration.renderer.type;
|
|
41
|
-
},
|
|
42
54
|
};
|
|
43
55
|
})
|
|
56
|
+
.views(self => ({
|
|
57
|
+
/**
|
|
58
|
+
* #method
|
|
59
|
+
*/
|
|
60
|
+
regionCannotBeRendered( /* region */) {
|
|
61
|
+
const view = (0, util_1.getContainingView)(self);
|
|
62
|
+
return (view === null || view === void 0 ? void 0 : view.bpPerPx) >= 1 ? 'Zoom in to see sequence' : undefined;
|
|
63
|
+
},
|
|
64
|
+
/**
|
|
65
|
+
* #getter
|
|
66
|
+
*/
|
|
67
|
+
get rendererTypeName() {
|
|
68
|
+
return self.configuration.renderer.type;
|
|
69
|
+
},
|
|
70
|
+
}))
|
|
44
71
|
.actions(self => ({
|
|
72
|
+
/**
|
|
73
|
+
* #action
|
|
74
|
+
*/
|
|
45
75
|
toggleShowForward() {
|
|
46
76
|
self.showForward = !self.showForward;
|
|
47
77
|
},
|
|
78
|
+
/**
|
|
79
|
+
* #action
|
|
80
|
+
*/
|
|
48
81
|
toggleShowReverse() {
|
|
49
82
|
self.showReverse = !self.showReverse;
|
|
50
83
|
},
|
|
84
|
+
/**
|
|
85
|
+
* #action
|
|
86
|
+
*/
|
|
51
87
|
toggleShowTranslation() {
|
|
52
88
|
self.showTranslation = !self.showTranslation;
|
|
53
89
|
},
|
|
90
|
+
afterAttach() {
|
|
91
|
+
// auto-adjust height depending on settings
|
|
92
|
+
(0, mobx_state_tree_1.addDisposer)(self, (0, mobx_1.autorun)(() => {
|
|
93
|
+
const t = self.showTranslation ? 100 : 0;
|
|
94
|
+
const r = self.showReverse ? 20 : 0;
|
|
95
|
+
const s = self.showForward ? 20 : 0;
|
|
96
|
+
self.setHeight(t + r + s);
|
|
97
|
+
}));
|
|
98
|
+
},
|
|
54
99
|
}))
|
|
55
100
|
.views(self => ({
|
|
101
|
+
/**
|
|
102
|
+
* #method
|
|
103
|
+
*/
|
|
56
104
|
trackMenuItems() {
|
|
57
105
|
return [
|
|
58
106
|
{
|
|
59
107
|
label: 'Show forward',
|
|
60
108
|
type: 'checkbox',
|
|
61
109
|
checked: self.showForward,
|
|
62
|
-
onClick: () =>
|
|
63
|
-
self.toggleShowForward();
|
|
64
|
-
},
|
|
110
|
+
onClick: () => self.toggleShowForward(),
|
|
65
111
|
},
|
|
66
112
|
{
|
|
67
113
|
label: 'Show reverse',
|
|
68
114
|
type: 'checkbox',
|
|
69
115
|
checked: self.showReverse,
|
|
70
|
-
onClick: () =>
|
|
71
|
-
self.toggleShowReverse();
|
|
72
|
-
},
|
|
116
|
+
onClick: () => self.toggleShowReverse(),
|
|
73
117
|
},
|
|
74
118
|
{
|
|
75
119
|
label: 'Show translation',
|
|
76
120
|
type: 'checkbox',
|
|
77
121
|
checked: self.showTranslation,
|
|
78
|
-
onClick: () =>
|
|
79
|
-
self.toggleShowTranslation();
|
|
80
|
-
},
|
|
122
|
+
onClick: () => self.toggleShowTranslation(),
|
|
81
123
|
},
|
|
82
124
|
];
|
|
83
125
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearReferenceSequenceDisplay/model.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearReferenceSequenceDisplay/model.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AACpD,kFAG2C;AAC3C,+DAGoC;AACpC,6CAAsD;AACtD,+BAA8B;AAE9B;;;GAGG;AACH,SAAgB,YAAY,CAAC,YAAwC;IACnE,OAAO,uBAAK;SACT,OAAO,CACN,gCAAgC,EAChC,6CAAiB,EACjB,uBAAK,CAAC,KAAK,CAAC;QACV;;WAEG;QACH,IAAI,EAAE,uBAAK,CAAC,OAAO,CAAC,gCAAgC,CAAC;QACrD;;WAEG;QACH,aAAa,EAAE,IAAA,sCAAsB,EAAC,YAAY,CAAC;QACnD;;WAEG;QACH,WAAW,EAAE,IAAI;QACjB;;WAEG;QACH,WAAW,EAAE,IAAI;QACjB;;WAEG;QACH,eAAe,EAAE,IAAI;KACtB,CAAC,CACH;SACA,KAAK,CAAC,IAAI,CAAC,EAAE;QACZ,MAAM,EAAE,WAAW,EAAE,gB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CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;gBACxC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;gBACnC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;gBACnC,IAAI,CAAC,SAAS,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;YAC3B,CAAC,CAAC,CACH,CAAA;QACH,CAAC;KACF,CAAC,CAAC;SACF,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACd;;WAEG;QACH,cAAc;YACZ,OAAO;gBACL;oBACE,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,WAAW;oBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;iBACxC;gBACD;oBACE,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,WAAW;oBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;iBACxC;gBACD;oBACE,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,eAAe;oBAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE;iBAC5C;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAC,CAAA;AACP,CAAC;AAzHD,oCAyHC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
|
+
/**
|
|
4
|
+
* #stateModel LinearReferenceSequenceDisplay
|
|
5
|
+
* base model `BaseLinearDisplay`
|
|
6
|
+
*/
|
|
3
7
|
export declare function modelFactory(configSchema: AnyConfigurationSchemaType): import("mobx-state-tree").IModelType<{
|
|
4
8
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
5
9
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
@@ -57,10 +61,9 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
57
61
|
} & {
|
|
58
62
|
type: import("mobx-state-tree").ISimpleType<"LinearReferenceSequenceDisplay">;
|
|
59
63
|
configuration: import("mobx-state-tree").ITypeUnion<any, any, any>;
|
|
60
|
-
showForward: import("mobx-state-tree").
|
|
61
|
-
showReverse: import("mobx-state-tree").
|
|
62
|
-
showTranslation: import("mobx-state-tree").
|
|
63
|
-
height: import("mobx-state-tree").IType<number | undefined, number, number>;
|
|
64
|
+
showForward: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
65
|
+
showReverse: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
66
|
+
showTranslation: import("mobx-state-tree").IType<boolean | undefined, boolean, boolean>;
|
|
64
67
|
}, {
|
|
65
68
|
rendererTypeName: string;
|
|
66
69
|
error: unknown;
|
|
@@ -68,10 +71,15 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
68
71
|
readonly RenderingComponent: import("react").FC<{
|
|
69
72
|
model: {
|
|
70
73
|
id: string;
|
|
74
|
+
/**
|
|
75
|
+
* #property
|
|
76
|
+
*/
|
|
71
77
|
type: string;
|
|
72
78
|
rpcDriverName: string | undefined;
|
|
73
79
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
74
|
-
rendererTypeName: string;
|
|
80
|
+
rendererTypeName: string; /**
|
|
81
|
+
* #property
|
|
82
|
+
*/
|
|
75
83
|
error: unknown;
|
|
76
84
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
77
85
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
@@ -91,14 +99,18 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
91
99
|
rpcDriverName: string | undefined;
|
|
92
100
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
93
101
|
rendererTypeName: string;
|
|
94
|
-
error: unknown;
|
|
102
|
+
error: unknown; /**
|
|
103
|
+
* #action
|
|
104
|
+
*/
|
|
95
105
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
96
106
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
97
107
|
type: import("mobx-state-tree").ISimpleType<string>;
|
|
98
108
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
99
109
|
}, {
|
|
100
110
|
rendererTypeName: string;
|
|
101
|
-
error: unknown;
|
|
111
|
+
error: unknown; /**
|
|
112
|
+
* #method
|
|
113
|
+
*/
|
|
102
114
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
103
115
|
}> | null;
|
|
104
116
|
readonly adapterConfig: any;
|
|
@@ -186,14 +198,37 @@ export declare function modelFactory(configSchema: AnyConfigurationSchemaType):
|
|
|
186
198
|
overrideHeight: number;
|
|
187
199
|
}): Promise<JSX.Element>;
|
|
188
200
|
} & {
|
|
201
|
+
/**
|
|
202
|
+
* #method
|
|
203
|
+
*/
|
|
189
204
|
renderProps(): any;
|
|
205
|
+
} & {
|
|
206
|
+
/**
|
|
207
|
+
* #method
|
|
208
|
+
*/
|
|
190
209
|
regionCannotBeRendered(): "Zoom in to see sequence" | undefined;
|
|
210
|
+
/**
|
|
211
|
+
* #getter
|
|
212
|
+
*/
|
|
191
213
|
readonly rendererTypeName: any;
|
|
192
214
|
} & {
|
|
215
|
+
/**
|
|
216
|
+
* #action
|
|
217
|
+
*/
|
|
193
218
|
toggleShowForward(): void;
|
|
219
|
+
/**
|
|
220
|
+
* #action
|
|
221
|
+
*/
|
|
194
222
|
toggleShowReverse(): void;
|
|
223
|
+
/**
|
|
224
|
+
* #action
|
|
225
|
+
*/
|
|
195
226
|
toggleShowTranslation(): void;
|
|
227
|
+
afterAttach(): void;
|
|
196
228
|
} & {
|
|
229
|
+
/**
|
|
230
|
+
* #method
|
|
231
|
+
*/
|
|
197
232
|
trackMenuItems(): {
|
|
198
233
|
label: string;
|
|
199
234
|
type: string;
|
|
@@ -1,20 +1,42 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree';
|
|
1
|
+
import { addDisposer, types } from 'mobx-state-tree';
|
|
2
2
|
import { BaseLinearDisplay, } from '@jbrowse/plugin-linear-genome-view';
|
|
3
3
|
import { ConfigurationReference, } from '@jbrowse/core/configuration';
|
|
4
4
|
import { getContainingView } from '@jbrowse/core/util';
|
|
5
|
+
import { autorun } from 'mobx';
|
|
6
|
+
/**
|
|
7
|
+
* #stateModel LinearReferenceSequenceDisplay
|
|
8
|
+
* base model `BaseLinearDisplay`
|
|
9
|
+
*/
|
|
5
10
|
export function modelFactory(configSchema) {
|
|
6
11
|
return types
|
|
7
12
|
.compose('LinearReferenceSequenceDisplay', BaseLinearDisplay, types.model({
|
|
13
|
+
/**
|
|
14
|
+
* #property
|
|
15
|
+
*/
|
|
8
16
|
type: types.literal('LinearReferenceSequenceDisplay'),
|
|
17
|
+
/**
|
|
18
|
+
* #property
|
|
19
|
+
*/
|
|
9
20
|
configuration: ConfigurationReference(configSchema),
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
/**
|
|
22
|
+
* #property
|
|
23
|
+
*/
|
|
24
|
+
showForward: true,
|
|
25
|
+
/**
|
|
26
|
+
* #property
|
|
27
|
+
*/
|
|
28
|
+
showReverse: true,
|
|
29
|
+
/**
|
|
30
|
+
* #property
|
|
31
|
+
*/
|
|
32
|
+
showTranslation: true,
|
|
14
33
|
}))
|
|
15
34
|
.views(self => {
|
|
16
35
|
const { renderProps: superRenderProps } = self;
|
|
17
36
|
return {
|
|
37
|
+
/**
|
|
38
|
+
* #method
|
|
39
|
+
*/
|
|
18
40
|
renderProps() {
|
|
19
41
|
const { showForward, showReverse, showTranslation } = self;
|
|
20
42
|
return {
|
|
@@ -26,55 +48,75 @@ export function modelFactory(configSchema) {
|
|
|
26
48
|
showTranslation,
|
|
27
49
|
};
|
|
28
50
|
},
|
|
29
|
-
regionCannotBeRendered( /* region */) {
|
|
30
|
-
const view = getContainingView(self);
|
|
31
|
-
if (view && view.bpPerPx >= 1) {
|
|
32
|
-
return 'Zoom in to see sequence';
|
|
33
|
-
}
|
|
34
|
-
return undefined;
|
|
35
|
-
},
|
|
36
|
-
get rendererTypeName() {
|
|
37
|
-
return self.configuration.renderer.type;
|
|
38
|
-
},
|
|
39
51
|
};
|
|
40
52
|
})
|
|
53
|
+
.views(self => ({
|
|
54
|
+
/**
|
|
55
|
+
* #method
|
|
56
|
+
*/
|
|
57
|
+
regionCannotBeRendered( /* region */) {
|
|
58
|
+
const view = getContainingView(self);
|
|
59
|
+
return (view === null || view === void 0 ? void 0 : view.bpPerPx) >= 1 ? 'Zoom in to see sequence' : undefined;
|
|
60
|
+
},
|
|
61
|
+
/**
|
|
62
|
+
* #getter
|
|
63
|
+
*/
|
|
64
|
+
get rendererTypeName() {
|
|
65
|
+
return self.configuration.renderer.type;
|
|
66
|
+
},
|
|
67
|
+
}))
|
|
41
68
|
.actions(self => ({
|
|
69
|
+
/**
|
|
70
|
+
* #action
|
|
71
|
+
*/
|
|
42
72
|
toggleShowForward() {
|
|
43
73
|
self.showForward = !self.showForward;
|
|
44
74
|
},
|
|
75
|
+
/**
|
|
76
|
+
* #action
|
|
77
|
+
*/
|
|
45
78
|
toggleShowReverse() {
|
|
46
79
|
self.showReverse = !self.showReverse;
|
|
47
80
|
},
|
|
81
|
+
/**
|
|
82
|
+
* #action
|
|
83
|
+
*/
|
|
48
84
|
toggleShowTranslation() {
|
|
49
85
|
self.showTranslation = !self.showTranslation;
|
|
50
86
|
},
|
|
87
|
+
afterAttach() {
|
|
88
|
+
// auto-adjust height depending on settings
|
|
89
|
+
addDisposer(self, autorun(() => {
|
|
90
|
+
const t = self.showTranslation ? 100 : 0;
|
|
91
|
+
const r = self.showReverse ? 20 : 0;
|
|
92
|
+
const s = self.showForward ? 20 : 0;
|
|
93
|
+
self.setHeight(t + r + s);
|
|
94
|
+
}));
|
|
95
|
+
},
|
|
51
96
|
}))
|
|
52
97
|
.views(self => ({
|
|
98
|
+
/**
|
|
99
|
+
* #method
|
|
100
|
+
*/
|
|
53
101
|
trackMenuItems() {
|
|
54
102
|
return [
|
|
55
103
|
{
|
|
56
104
|
label: 'Show forward',
|
|
57
105
|
type: 'checkbox',
|
|
58
106
|
checked: self.showForward,
|
|
59
|
-
onClick: () =>
|
|
60
|
-
self.toggleShowForward();
|
|
61
|
-
},
|
|
107
|
+
onClick: () => self.toggleShowForward(),
|
|
62
108
|
},
|
|
63
109
|
{
|
|
64
110
|
label: 'Show reverse',
|
|
65
111
|
type: 'checkbox',
|
|
66
112
|
checked: self.showReverse,
|
|
67
|
-
onClick: () =>
|
|
68
|
-
self.toggleShowReverse();
|
|
69
|
-
},
|
|
113
|
+
onClick: () => self.toggleShowReverse(),
|
|
70
114
|
},
|
|
71
115
|
{
|
|
72
116
|
label: 'Show translation',
|
|
73
117
|
type: 'checkbox',
|
|
74
118
|
checked: self.showTranslation,
|
|
75
|
-
onClick: () =>
|
|
76
|
-
self.toggleShowTranslation();
|
|
77
|
-
},
|
|
119
|
+
onClick: () => self.toggleShowTranslation(),
|
|
78
120
|
},
|
|
79
121
|
];
|
|
80
122
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearReferenceSequenceDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/LinearReferenceSequenceDisplay/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EACL,iBAAiB,GAElB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAEL,sBAAsB,GACvB,MAAM,6BAA6B,CAAA;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAE9B;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,YAAwC;IACnE,OAAO,KAAK;SACT,OAAO,CACN,gCAAgC,EAChC,iBAAiB,EACjB,KAAK,CAAC,KAAK,CAAC;QACV;;WAEG;QACH,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,gCAAgC,CAAC;QACrD;;WAEG;QACH,aAAa,EAAE,sBAAsB,CAAC,YAAY,CAAC;QACnD;;WAEG;QACH,WAAW,EAAE,IAAI;QACjB;;WAEG;QACH,WAAW,EAAE,IAAI;QACjB;;WAEG;QACH,eAAe,EAAE,IAAI;KACtB,CAAC,CACH;SACA,KAAK,CAAC,IAAI,CAAC,EAAE;QACZ,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,IAAI,CAAA;QAC9C,OAAO;YACL;;eAEG;YACH,WAAW;gBACT,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;gBAC1D,OAAO;oBACL,GAAG,gBAAgB,EAAE;oBACrB,aAAa,EAAE,IAAI,CAAC,aAAa;oBACjC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ;oBACnC,WAAW;oBACX,WAAW;oBACX,eAAe;iBAChB,CAAA;YACH,CAAC;SACF,CAAA;IACH,CAAC,CAAC;SACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACd;;WAEG;QACH,sBAAsB,EA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;QACH,cAAc;YACZ,OAAO;gBACL;oBACE,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,WAAW;oBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;iBACxC;gBACD;oBACE,KAAK,EAAE,cAAc;oBACrB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,WAAW;oBACzB,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,iBAAiB,EAAE;iBACxC;gBACD;oBACE,KAAK,EAAE,kBAAkB;oBACzB,IAAI,EAAE,UAAU;oBAChB,OAAO,EAAE,IAAI,CAAC,eAAe;oBAC7B,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,qBAAqB,EAAE;iBAC5C;aACF,CAAA;QACH,CAAC;KACF,CAAC,CAAC,CAAA;AACP,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-sequence",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "JBrowse 2 sequence adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"distModule": "esm/index.js",
|
|
59
59
|
"srcModule": "src/index.ts",
|
|
60
60
|
"module": "esm/index.js",
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "467d973535bb7b2664e9f66311fb0dc21c1ce5ba"
|
|
62
62
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { types } from 'mobx-state-tree'
|
|
1
|
+
import { addDisposer, types } from 'mobx-state-tree'
|
|
2
2
|
import {
|
|
3
3
|
BaseLinearDisplay,
|
|
4
4
|
LinearGenomeViewModel,
|
|
@@ -8,24 +8,46 @@ import {
|
|
|
8
8
|
ConfigurationReference,
|
|
9
9
|
} from '@jbrowse/core/configuration'
|
|
10
10
|
import { getContainingView } from '@jbrowse/core/util'
|
|
11
|
+
import { autorun } from 'mobx'
|
|
11
12
|
|
|
13
|
+
/**
|
|
14
|
+
* #stateModel LinearReferenceSequenceDisplay
|
|
15
|
+
* base model `BaseLinearDisplay`
|
|
16
|
+
*/
|
|
12
17
|
export function modelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
13
18
|
return types
|
|
14
19
|
.compose(
|
|
15
20
|
'LinearReferenceSequenceDisplay',
|
|
16
21
|
BaseLinearDisplay,
|
|
17
22
|
types.model({
|
|
23
|
+
/**
|
|
24
|
+
* #property
|
|
25
|
+
*/
|
|
18
26
|
type: types.literal('LinearReferenceSequenceDisplay'),
|
|
27
|
+
/**
|
|
28
|
+
* #property
|
|
29
|
+
*/
|
|
19
30
|
configuration: ConfigurationReference(configSchema),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
31
|
+
/**
|
|
32
|
+
* #property
|
|
33
|
+
*/
|
|
34
|
+
showForward: true,
|
|
35
|
+
/**
|
|
36
|
+
* #property
|
|
37
|
+
*/
|
|
38
|
+
showReverse: true,
|
|
39
|
+
/**
|
|
40
|
+
* #property
|
|
41
|
+
*/
|
|
42
|
+
showTranslation: true,
|
|
24
43
|
}),
|
|
25
44
|
)
|
|
26
45
|
.views(self => {
|
|
27
46
|
const { renderProps: superRenderProps } = self
|
|
28
47
|
return {
|
|
48
|
+
/**
|
|
49
|
+
* #method
|
|
50
|
+
*/
|
|
29
51
|
renderProps() {
|
|
30
52
|
const { showForward, showReverse, showTranslation } = self
|
|
31
53
|
return {
|
|
@@ -37,56 +59,78 @@ export function modelFactory(configSchema: AnyConfigurationSchemaType) {
|
|
|
37
59
|
showTranslation,
|
|
38
60
|
}
|
|
39
61
|
},
|
|
40
|
-
regionCannotBeRendered(/* region */) {
|
|
41
|
-
const view = getContainingView(self) as LinearGenomeViewModel
|
|
42
|
-
if (view && view.bpPerPx >= 1) {
|
|
43
|
-
return 'Zoom in to see sequence'
|
|
44
|
-
}
|
|
45
|
-
return undefined
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
get rendererTypeName() {
|
|
49
|
-
return self.configuration.renderer.type
|
|
50
|
-
},
|
|
51
62
|
}
|
|
52
63
|
})
|
|
64
|
+
.views(self => ({
|
|
65
|
+
/**
|
|
66
|
+
* #method
|
|
67
|
+
*/
|
|
68
|
+
regionCannotBeRendered(/* region */) {
|
|
69
|
+
const view = getContainingView(self) as LinearGenomeViewModel
|
|
70
|
+
return view?.bpPerPx >= 1 ? 'Zoom in to see sequence' : undefined
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* #getter
|
|
74
|
+
*/
|
|
75
|
+
get rendererTypeName() {
|
|
76
|
+
return self.configuration.renderer.type
|
|
77
|
+
},
|
|
78
|
+
}))
|
|
53
79
|
.actions(self => ({
|
|
80
|
+
/**
|
|
81
|
+
* #action
|
|
82
|
+
*/
|
|
54
83
|
toggleShowForward() {
|
|
55
84
|
self.showForward = !self.showForward
|
|
56
85
|
},
|
|
86
|
+
/**
|
|
87
|
+
* #action
|
|
88
|
+
*/
|
|
57
89
|
toggleShowReverse() {
|
|
58
90
|
self.showReverse = !self.showReverse
|
|
59
91
|
},
|
|
92
|
+
/**
|
|
93
|
+
* #action
|
|
94
|
+
*/
|
|
60
95
|
toggleShowTranslation() {
|
|
61
96
|
self.showTranslation = !self.showTranslation
|
|
62
97
|
},
|
|
98
|
+
afterAttach() {
|
|
99
|
+
// auto-adjust height depending on settings
|
|
100
|
+
addDisposer(
|
|
101
|
+
self,
|
|
102
|
+
autorun(() => {
|
|
103
|
+
const t = self.showTranslation ? 100 : 0
|
|
104
|
+
const r = self.showReverse ? 20 : 0
|
|
105
|
+
const s = self.showForward ? 20 : 0
|
|
106
|
+
self.setHeight(t + r + s)
|
|
107
|
+
}),
|
|
108
|
+
)
|
|
109
|
+
},
|
|
63
110
|
}))
|
|
64
111
|
.views(self => ({
|
|
112
|
+
/**
|
|
113
|
+
* #method
|
|
114
|
+
*/
|
|
65
115
|
trackMenuItems() {
|
|
66
116
|
return [
|
|
67
117
|
{
|
|
68
118
|
label: 'Show forward',
|
|
69
119
|
type: 'checkbox',
|
|
70
120
|
checked: self.showForward,
|
|
71
|
-
onClick: () =>
|
|
72
|
-
self.toggleShowForward()
|
|
73
|
-
},
|
|
121
|
+
onClick: () => self.toggleShowForward(),
|
|
74
122
|
},
|
|
75
123
|
{
|
|
76
124
|
label: 'Show reverse',
|
|
77
125
|
type: 'checkbox',
|
|
78
126
|
checked: self.showReverse,
|
|
79
|
-
onClick: () =>
|
|
80
|
-
self.toggleShowReverse()
|
|
81
|
-
},
|
|
127
|
+
onClick: () => self.toggleShowReverse(),
|
|
82
128
|
},
|
|
83
129
|
{
|
|
84
130
|
label: 'Show translation',
|
|
85
131
|
type: 'checkbox',
|
|
86
132
|
checked: self.showTranslation,
|
|
87
|
-
onClick: () =>
|
|
88
|
-
self.toggleShowTranslation()
|
|
89
|
-
},
|
|
133
|
+
onClick: () => self.toggleShowTranslation(),
|
|
90
134
|
},
|
|
91
135
|
]
|
|
92
136
|
},
|