@jbrowse/plugin-linear-genome-view 2.11.0 → 2.11.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/BaseLinearDisplay/components/LinearBlocks.js +7 -7
- package/dist/BaseLinearDisplay/components/Tooltip.js +1 -0
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +17 -1
- package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +21 -0
- package/dist/BaseLinearDisplay/models/configSchema.d.ts +10 -0
- package/dist/BaseLinearDisplay/models/configSchema.js +15 -3
- package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -0
- package/dist/BasicTrack/index.d.ts +1 -2
- package/dist/BasicTrack/index.js +3 -2
- package/dist/FeatureTrack/index.d.ts +1 -2
- package/dist/FeatureTrack/index.js +3 -2
- package/dist/LaunchLinearGenomeView/index.d.ts +1 -2
- package/dist/LaunchLinearGenomeView/index.js +3 -2
- package/dist/LinearBareDisplay/configSchema.d.ts +5 -0
- package/dist/LinearBareDisplay/index.d.ts +1 -2
- package/dist/LinearBareDisplay/index.js +3 -2
- package/dist/LinearBareDisplay/model.d.ts +17 -2
- package/dist/LinearBasicDisplay/components/AddFiltersDialog.d.ts +10 -0
- package/dist/LinearBasicDisplay/components/AddFiltersDialog.js +94 -0
- package/dist/LinearBasicDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -7
- package/dist/LinearBasicDisplay/configSchema.d.ts +5 -0
- package/dist/LinearBasicDisplay/index.d.ts +1 -2
- package/dist/LinearBasicDisplay/index.js +3 -2
- package/dist/LinearBasicDisplay/model.d.ts +56 -21
- package/dist/LinearBasicDisplay/model.js +36 -5
- package/dist/LinearGenomeView/components/Cytobands.js +11 -12
- package/dist/LinearGenomeView/components/Gridlines.js +3 -4
- package/dist/LinearGenomeView/components/Highlight.js +20 -21
- package/dist/LinearGenomeView/components/OverviewScalebar.js +1 -2
- package/dist/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
- package/dist/LinearGenomeView/components/Scalebar.js +4 -5
- package/dist/LinearGenomeView/model.d.ts +1 -0
- package/dist/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
- package/dist/LinearGenomeView/svgcomponents/SVGTrackLabel.js +1 -1
- package/dist/index.d.ts +39 -0
- package/esm/BaseLinearDisplay/components/LinearBlocks.js +7 -7
- package/esm/BaseLinearDisplay/components/Tooltip.js +1 -0
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +17 -1
- package/esm/BaseLinearDisplay/models/BaseLinearDisplayModel.js +21 -0
- package/esm/BaseLinearDisplay/models/configSchema.d.ts +10 -0
- package/esm/BaseLinearDisplay/models/configSchema.js +15 -3
- package/esm/BaseLinearDisplay/models/serverSideRenderedBlock.js +1 -0
- package/esm/BasicTrack/index.d.ts +1 -2
- package/esm/BasicTrack/index.js +2 -2
- package/esm/FeatureTrack/index.d.ts +1 -2
- package/esm/FeatureTrack/index.js +2 -2
- package/esm/LaunchLinearGenomeView/index.d.ts +1 -2
- package/esm/LaunchLinearGenomeView/index.js +2 -2
- package/esm/LinearBareDisplay/configSchema.d.ts +5 -0
- package/esm/LinearBareDisplay/index.d.ts +1 -2
- package/esm/LinearBareDisplay/index.js +2 -2
- package/esm/LinearBareDisplay/model.d.ts +17 -2
- package/esm/LinearBasicDisplay/components/AddFiltersDialog.d.ts +10 -0
- package/esm/LinearBasicDisplay/components/AddFiltersDialog.js +69 -0
- package/esm/LinearBasicDisplay/components/{SetMaxHeight.js → SetMaxHeightDialog.js} +7 -7
- package/esm/LinearBasicDisplay/configSchema.d.ts +5 -0
- package/esm/LinearBasicDisplay/index.d.ts +1 -2
- package/esm/LinearBasicDisplay/index.js +2 -2
- package/esm/LinearBasicDisplay/model.d.ts +56 -21
- package/esm/LinearBasicDisplay/model.js +37 -6
- package/esm/LinearGenomeView/components/Cytobands.js +11 -12
- package/esm/LinearGenomeView/components/Gridlines.js +3 -4
- package/esm/LinearGenomeView/components/Highlight.js +20 -21
- package/esm/LinearGenomeView/components/OverviewScalebar.js +1 -2
- package/esm/LinearGenomeView/components/OverviewScalebarPolygon.js +2 -1
- package/esm/LinearGenomeView/components/Scalebar.js +4 -5
- package/esm/LinearGenomeView/model.d.ts +1 -0
- package/esm/LinearGenomeView/svgcomponents/SVGHeader.js +1 -1
- package/esm/LinearGenomeView/svgcomponents/SVGTrackLabel.js +2 -2
- package/esm/index.d.ts +39 -0
- package/package.json +2 -2
- /package/dist/LinearBasicDisplay/components/{SetMaxHeight.d.ts → SetMaxHeightDialog.d.ts} +0 -0
- /package/esm/LinearBasicDisplay/components/{SetMaxHeight.d.ts → SetMaxHeightDialog.d.ts} +0 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration';
|
|
3
3
|
import { MenuItem } from '@jbrowse/core/ui';
|
|
4
4
|
import { Instance } from 'mobx-state-tree';
|
|
5
|
+
import SerializableFilterChain from '@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain';
|
|
5
6
|
/**
|
|
6
7
|
* #stateModel LinearBasicDisplay
|
|
7
8
|
* #category display
|
|
@@ -50,11 +51,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
50
51
|
model: {
|
|
51
52
|
error?: unknown;
|
|
52
53
|
reload: () => void;
|
|
53
|
-
message: import("react").ReactNode;
|
|
54
|
-
|
|
55
|
-
status?: string | undefined; /**
|
|
56
|
-
* #getter
|
|
54
|
+
message: import("react").ReactNode; /**
|
|
55
|
+
* #property
|
|
57
56
|
*/
|
|
57
|
+
filled?: boolean | undefined;
|
|
58
|
+
status?: string | undefined;
|
|
58
59
|
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
59
60
|
};
|
|
60
61
|
}) => import("react").JSX.Element | undefined;
|
|
@@ -63,7 +64,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
63
64
|
doReload(): void;
|
|
64
65
|
afterAttach(): void;
|
|
65
66
|
setStatus(message: string): void;
|
|
66
|
-
setLoading(abortController: AbortController): void;
|
|
67
|
+
setLoading(abortController: AbortController): void; /**
|
|
68
|
+
* #getter
|
|
69
|
+
*/
|
|
67
70
|
setMessage(messageText: string): void;
|
|
68
71
|
setRendered(props: {
|
|
69
72
|
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -94,10 +97,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
94
97
|
};
|
|
95
98
|
mouseover: {
|
|
96
99
|
type: string;
|
|
97
|
-
description: string;
|
|
100
|
+
description: string; /**
|
|
101
|
+
* #property
|
|
102
|
+
*/
|
|
98
103
|
defaultValue: string;
|
|
99
104
|
contextVariable: string[];
|
|
100
105
|
};
|
|
106
|
+
jexlFilters: {
|
|
107
|
+
type: string;
|
|
108
|
+
description: string;
|
|
109
|
+
defaultValue: never[];
|
|
110
|
+
};
|
|
101
111
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
102
112
|
} & {
|
|
103
113
|
/**
|
|
@@ -124,6 +134,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
124
134
|
* #property
|
|
125
135
|
*/
|
|
126
136
|
configuration: AnyConfigurationSchemaType;
|
|
137
|
+
/**
|
|
138
|
+
* #property
|
|
139
|
+
*/
|
|
140
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
127
141
|
}, {
|
|
128
142
|
rendererTypeName: string;
|
|
129
143
|
error: unknown;
|
|
@@ -140,7 +154,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
140
154
|
message: string | undefined;
|
|
141
155
|
} & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
|
|
142
156
|
id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
|
|
143
|
-
type: import("mobx-state-tree").ISimpleType<string>;
|
|
157
|
+
type: import("mobx-state-tree").ISimpleType<string>; /**
|
|
158
|
+
* #property
|
|
159
|
+
*/
|
|
144
160
|
rpcDriverName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
145
161
|
}, {
|
|
146
162
|
rendererTypeName: string;
|
|
@@ -166,11 +182,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
166
182
|
}, {
|
|
167
183
|
rendererTypeName: string;
|
|
168
184
|
error: unknown;
|
|
169
|
-
message: string | undefined;
|
|
170
|
-
* #action
|
|
171
|
-
*/
|
|
185
|
+
message: string | undefined;
|
|
172
186
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
|
|
173
|
-
}> | null;
|
|
187
|
+
}> | null; /**
|
|
188
|
+
* #getter
|
|
189
|
+
*/
|
|
174
190
|
readonly adapterConfig: any;
|
|
175
191
|
readonly parentTrack: any;
|
|
176
192
|
renderProps(): any;
|
|
@@ -208,13 +224,13 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
208
224
|
setCurrStatsBpPerPx(n: number): void;
|
|
209
225
|
setFeatureDensityStatsLimit(stats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
210
226
|
getFeatureDensityStats(): Promise<import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats>;
|
|
211
|
-
setFeatureDensityStatsP(arg: any): void;
|
|
212
|
-
* #method
|
|
213
|
-
*/
|
|
227
|
+
setFeatureDensityStatsP(arg: any): void;
|
|
214
228
|
setFeatureDensityStats(featureDensityStats?: import("@jbrowse/core/data_adapters/BaseAdapter").FeatureDensityStats | undefined): void;
|
|
215
229
|
clearFeatureDensityStats(): void;
|
|
216
230
|
} & {
|
|
217
|
-
readonly regionTooLarge: boolean;
|
|
231
|
+
readonly regionTooLarge: boolean; /**
|
|
232
|
+
* #method
|
|
233
|
+
*/
|
|
218
234
|
readonly regionTooLargeReason: string;
|
|
219
235
|
} & {
|
|
220
236
|
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
@@ -240,6 +256,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
240
256
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
241
257
|
deleteBlock(key: string): void;
|
|
242
258
|
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
259
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
243
260
|
clearFeatureSelection(): void;
|
|
244
261
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
245
262
|
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
@@ -253,6 +270,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
253
270
|
renderSvg(opts: import("../BaseLinearDisplay").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
254
271
|
afterAttach(): void;
|
|
255
272
|
} & {
|
|
273
|
+
/**
|
|
274
|
+
* #getter
|
|
275
|
+
*/
|
|
276
|
+
readonly activeFilters: any;
|
|
256
277
|
/**
|
|
257
278
|
* #getter
|
|
258
279
|
*/
|
|
@@ -283,6 +304,10 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
283
304
|
setSubschema(slotName: string, data: unknown): any;
|
|
284
305
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
285
306
|
} & {
|
|
307
|
+
/**
|
|
308
|
+
* #action
|
|
309
|
+
*/
|
|
310
|
+
setJexlFilters(f?: string[]): void;
|
|
286
311
|
/**
|
|
287
312
|
* #action
|
|
288
313
|
*/
|
|
@@ -309,6 +334,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
309
334
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
310
335
|
setSubschema(slotName: string, data: unknown): any;
|
|
311
336
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
337
|
+
filters: SerializableFilterChain;
|
|
312
338
|
};
|
|
313
339
|
/**
|
|
314
340
|
* #method
|
|
@@ -355,11 +381,11 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
355
381
|
model: {
|
|
356
382
|
error?: unknown;
|
|
357
383
|
reload: () => void;
|
|
358
|
-
message: import("react").ReactNode;
|
|
359
|
-
|
|
360
|
-
status?: string | undefined; /**
|
|
361
|
-
* #getter
|
|
384
|
+
message: import("react").ReactNode; /**
|
|
385
|
+
* #property
|
|
362
386
|
*/
|
|
387
|
+
filled?: boolean | undefined;
|
|
388
|
+
status?: string | undefined;
|
|
363
389
|
reactElement?: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | undefined;
|
|
364
390
|
};
|
|
365
391
|
}) => import("react").JSX.Element | undefined;
|
|
@@ -368,7 +394,9 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
368
394
|
doReload(): void;
|
|
369
395
|
afterAttach(): void;
|
|
370
396
|
setStatus(message: string): void;
|
|
371
|
-
setLoading(abortController: AbortController): void;
|
|
397
|
+
setLoading(abortController: AbortController): void; /**
|
|
398
|
+
* #getter
|
|
399
|
+
*/
|
|
372
400
|
setMessage(messageText: string): void;
|
|
373
401
|
setRendered(props: {
|
|
374
402
|
reactElement: import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
|
|
@@ -399,10 +427,17 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
|
|
|
399
427
|
};
|
|
400
428
|
mouseover: {
|
|
401
429
|
type: string;
|
|
402
|
-
description: string;
|
|
430
|
+
description: string; /**
|
|
431
|
+
* #property
|
|
432
|
+
*/
|
|
403
433
|
defaultValue: string;
|
|
404
434
|
contextVariable: string[];
|
|
405
435
|
};
|
|
436
|
+
jexlFilters: {
|
|
437
|
+
type: string;
|
|
438
|
+
description: string;
|
|
439
|
+
defaultValue: never[];
|
|
440
|
+
};
|
|
406
441
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
407
442
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
|
|
408
443
|
type: string;
|
|
@@ -34,7 +34,9 @@ const mobx_state_tree_1 = require("mobx-state-tree");
|
|
|
34
34
|
const Visibility_1 = __importDefault(require("@mui/icons-material/Visibility"));
|
|
35
35
|
// locals
|
|
36
36
|
const BaseLinearDisplay_1 = require("../BaseLinearDisplay");
|
|
37
|
-
const
|
|
37
|
+
const serializableFilterChain_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain"));
|
|
38
|
+
const SetMaxHeightDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/SetMaxHeightDialog'))));
|
|
39
|
+
const AddFiltersDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/AddFiltersDialog'))));
|
|
38
40
|
/**
|
|
39
41
|
* #stateModel LinearBasicDisplay
|
|
40
42
|
* #category display
|
|
@@ -71,8 +73,21 @@ function stateModelFactory(configSchema) {
|
|
|
71
73
|
* #property
|
|
72
74
|
*/
|
|
73
75
|
configuration: (0, configuration_1.ConfigurationReference)(configSchema),
|
|
76
|
+
/**
|
|
77
|
+
* #property
|
|
78
|
+
*/
|
|
79
|
+
jexlFilters: mobx_state_tree_1.types.maybe(mobx_state_tree_1.types.array(mobx_state_tree_1.types.string)),
|
|
74
80
|
}))
|
|
75
81
|
.views(self => ({
|
|
82
|
+
/**
|
|
83
|
+
* #getter
|
|
84
|
+
*/
|
|
85
|
+
get activeFilters() {
|
|
86
|
+
var _a;
|
|
87
|
+
// config jexlFilters are deferred evaluated so they are prepended with
|
|
88
|
+
// jexl at runtime rather than being stored with jexl in the config
|
|
89
|
+
return ((_a = self.jexlFilters) !== null && _a !== void 0 ? _a : (0, configuration_1.getConf)(self, 'jexlFilters').map((r) => `jexl:${r}`));
|
|
90
|
+
},
|
|
76
91
|
/**
|
|
77
92
|
* #getter
|
|
78
93
|
*/
|
|
@@ -125,6 +140,12 @@ function stateModelFactory(configSchema) {
|
|
|
125
140
|
},
|
|
126
141
|
}))
|
|
127
142
|
.actions(self => ({
|
|
143
|
+
/**
|
|
144
|
+
* #action
|
|
145
|
+
*/
|
|
146
|
+
setJexlFilters(f) {
|
|
147
|
+
self.jexlFilters = (0, mobx_state_tree_1.cast)(f);
|
|
148
|
+
},
|
|
128
149
|
/**
|
|
129
150
|
* #action
|
|
130
151
|
*/
|
|
@@ -157,12 +178,13 @@ function stateModelFactory(configSchema) {
|
|
|
157
178
|
* #method
|
|
158
179
|
*/
|
|
159
180
|
renderProps() {
|
|
160
|
-
const config = self.rendererConfig;
|
|
161
181
|
const superProps = superRenderProps();
|
|
162
|
-
const superPropsOmit = superProps;
|
|
163
182
|
return {
|
|
164
|
-
...
|
|
165
|
-
config,
|
|
183
|
+
...superProps,
|
|
184
|
+
config: self.rendererConfig,
|
|
185
|
+
filters: new serializableFilterChain_1.default({
|
|
186
|
+
filters: self.activeFilters,
|
|
187
|
+
}),
|
|
166
188
|
};
|
|
167
189
|
},
|
|
168
190
|
/**
|
|
@@ -207,6 +229,15 @@ function stateModelFactory(configSchema) {
|
|
|
207
229
|
]);
|
|
208
230
|
},
|
|
209
231
|
},
|
|
232
|
+
{
|
|
233
|
+
label: 'Edit filters',
|
|
234
|
+
onClick: () => {
|
|
235
|
+
(0, util_1.getSession)(self).queueDialog(handleClose => [
|
|
236
|
+
AddFiltersDialog,
|
|
237
|
+
{ model: self, handleClose },
|
|
238
|
+
]);
|
|
239
|
+
},
|
|
240
|
+
},
|
|
210
241
|
];
|
|
211
242
|
},
|
|
212
243
|
};
|
|
@@ -8,6 +8,7 @@ const mobx_react_1 = require("mobx-react");
|
|
|
8
8
|
// locals
|
|
9
9
|
const __1 = require("..");
|
|
10
10
|
const util_1 = require("./util");
|
|
11
|
+
const util_2 = require("@jbrowse/core/util");
|
|
11
12
|
// rounded rect from https://stackoverflow.com/a/45889603/2129219
|
|
12
13
|
// prettier-ignore
|
|
13
14
|
function rightRoundedRect(x, y, width, height, radius) {
|
|
@@ -68,28 +69,26 @@ const Cytobands = (0, mobx_react_1.observer)(function ({ overview, block, assemb
|
|
|
68
69
|
const e = overview.bpToPx({ refName, coord: end }) || 0;
|
|
69
70
|
const l = Math.min(s, e);
|
|
70
71
|
const w = Math.abs(e - s);
|
|
71
|
-
const c = colorMap[type];
|
|
72
|
+
const c = colorMap[type] || 'black';
|
|
72
73
|
if (type === 'acen' && !centromereSeen) {
|
|
73
74
|
centromereSeen = true; // the next acen entry is drawn with different right triangle
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return react_1.default.createElement("polygon", { key: k, points: tri, fill: c });
|
|
75
|
+
return (react_1.default.createElement("polygon", { key: k, points: reversed
|
|
76
|
+
? rightTriangle(s - w, 0, w, h)
|
|
77
|
+
: leftTriangle(s, 0, w, h), ...(0, util_2.getFillProps)(c) }));
|
|
78
78
|
}
|
|
79
79
|
else if (type === 'acen' && centromereSeen) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return react_1.default.createElement("polygon", { key: k, points: tri, fill: c });
|
|
80
|
+
return (react_1.default.createElement("polygon", { key: k, points: reversed
|
|
81
|
+
? leftTriangle(s - w, 0, w, h)
|
|
82
|
+
: rightTriangle(s, 0, w, h), ...(0, util_2.getFillProps)(c) }));
|
|
84
83
|
}
|
|
85
84
|
else if (lcap === index) {
|
|
86
|
-
return react_1.default.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8),
|
|
85
|
+
return (react_1.default.createElement("path", { key: k, d: leftRoundedRect(l, 0, w, h, 8), ...(0, util_2.getFillProps)(c) }));
|
|
87
86
|
}
|
|
88
87
|
else if (rcap === index) {
|
|
89
|
-
return react_1.default.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8),
|
|
88
|
+
return (react_1.default.createElement("path", { key: k, d: rightRoundedRect(l, 0, w, h, 8), ...(0, util_2.getFillProps)(c) }));
|
|
90
89
|
}
|
|
91
90
|
else {
|
|
92
|
-
return react_1.default.createElement("rect", { key: k, x: l, y: 0, width: w, height: h,
|
|
91
|
+
return (react_1.default.createElement("rect", { key: k, x: l, y: 0, width: w, height: h, ...(0, util_2.getFillProps)(c) }));
|
|
93
92
|
}
|
|
94
93
|
})));
|
|
95
94
|
});
|
|
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const react_1 = __importDefault(require("react"));
|
|
7
|
-
const blockTypes_1 = require("@jbrowse/core/util/blockTypes");
|
|
8
7
|
const mui_1 = require("tss-react/mui");
|
|
9
8
|
const mobx_react_1 = require("mobx-react");
|
|
10
9
|
const Block_1 = require("../../BaseLinearDisplay/components/Block");
|
|
@@ -50,13 +49,13 @@ const RenderedVerticalGuides = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
50
49
|
const { staticBlocks, bpPerPx } = model;
|
|
51
50
|
return (react_1.default.createElement(react_1.default.Fragment, null, staticBlocks.map((block, index) => {
|
|
52
51
|
const k = `${block.key}-${index}`;
|
|
53
|
-
if (block
|
|
52
|
+
if (block.type === 'ContentBlock') {
|
|
54
53
|
return react_1.default.createElement(RenderedBlockLines, { key: k, block: block, bpPerPx: bpPerPx });
|
|
55
54
|
}
|
|
56
|
-
else if (block
|
|
55
|
+
else if (block.type === 'ElidedBlock') {
|
|
57
56
|
return react_1.default.createElement(Block_1.ElidedBlock, { key: k, width: block.widthPx });
|
|
58
57
|
}
|
|
59
|
-
else if (block
|
|
58
|
+
else if (block.type === 'InterRegionPaddingBlock') {
|
|
60
59
|
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key: k, width: block.widthPx, boundary: block.variant === 'boundary' }));
|
|
61
60
|
}
|
|
62
61
|
return null;
|
|
@@ -61,26 +61,6 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model, highlig
|
|
|
61
61
|
const dismissHighlight = () => {
|
|
62
62
|
model.removeHighlight(highlight);
|
|
63
63
|
};
|
|
64
|
-
const menuItems = [
|
|
65
|
-
{
|
|
66
|
-
label: 'Dismiss highlight',
|
|
67
|
-
icon: Close_1.default,
|
|
68
|
-
onClick: () => dismissHighlight(),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
label: 'Bookmark highlighted region',
|
|
72
|
-
icon: Bookmark_1.default,
|
|
73
|
-
onClick: () => {
|
|
74
|
-
let bookmarkWidget = session.widgets.get('GridBookmark');
|
|
75
|
-
if (!bookmarkWidget) {
|
|
76
|
-
bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
|
|
77
|
-
}
|
|
78
|
-
// @ts-ignore
|
|
79
|
-
bookmarkWidget.addBookmark(highlight);
|
|
80
|
-
dismissHighlight();
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
];
|
|
84
64
|
function handleClose() {
|
|
85
65
|
setOpen(false);
|
|
86
66
|
}
|
|
@@ -118,7 +98,26 @@ const Highlight = (0, mobx_react_1.observer)(function Highlight({ model, highlig
|
|
|
118
98
|
react_1.default.createElement(ui_1.Menu, { anchorEl: anchorEl.current, onMenuItemClick: (_event, callback) => {
|
|
119
99
|
callback(session);
|
|
120
100
|
handleClose();
|
|
121
|
-
}, open: open, onClose: handleClose, menuItems:
|
|
101
|
+
}, open: open, onClose: handleClose, menuItems: [
|
|
102
|
+
{
|
|
103
|
+
label: 'Dismiss highlight',
|
|
104
|
+
icon: Close_1.default,
|
|
105
|
+
onClick: () => dismissHighlight(),
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
label: 'Bookmark highlighted region',
|
|
109
|
+
icon: Bookmark_1.default,
|
|
110
|
+
onClick: () => {
|
|
111
|
+
let bookmarkWidget = session.widgets.get('GridBookmark');
|
|
112
|
+
if (!bookmarkWidget) {
|
|
113
|
+
bookmarkWidget = session.addWidget('GridBookmarkWidget', 'GridBookmark');
|
|
114
|
+
}
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
bookmarkWidget.addBookmark(highlight);
|
|
117
|
+
dismissHighlight();
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
] }))) : null;
|
|
122
121
|
});
|
|
123
122
|
const HighlightGroup = (0, mobx_react_1.observer)(function HighlightGroup({ model, }) {
|
|
124
123
|
return model.highlight.map((highlight, idx) => (react_1.default.createElement(Highlight, { key: JSON.stringify(highlight) + '-' + idx, model: model, highlight: highlight })));
|
|
@@ -33,7 +33,6 @@ const mobx_react_1 = require("mobx-react");
|
|
|
33
33
|
// core
|
|
34
34
|
const Base1DViewModel_1 = __importDefault(require("@jbrowse/core/util/Base1DViewModel"));
|
|
35
35
|
const util_1 = require("@jbrowse/core/util");
|
|
36
|
-
const blockTypes_1 = require("@jbrowse/core/util/blockTypes");
|
|
37
36
|
// locals
|
|
38
37
|
const __1 = require("..");
|
|
39
38
|
const util_2 = require("../util");
|
|
@@ -176,7 +175,7 @@ const Scalebar = (0, mobx_react_1.observer)(function ({ model, scale, overview,
|
|
|
176
175
|
borderColor: color,
|
|
177
176
|
} }),
|
|
178
177
|
overviewVisibleRegions.map((block, idx) => {
|
|
179
|
-
return !(block
|
|
178
|
+
return !(block.type === 'ContentBlock') ? (react_1.default.createElement("div", { key: `${JSON.stringify(block)}-${idx}`, className: classes.scalebarContig, style: {
|
|
180
179
|
width: block.widthPx,
|
|
181
180
|
left: block.offsetPx,
|
|
182
181
|
backgroundColor: '#999',
|
|
@@ -8,6 +8,7 @@ const material_1 = require("@mui/material");
|
|
|
8
8
|
const mobx_react_1 = require("mobx-react");
|
|
9
9
|
// locals
|
|
10
10
|
const __1 = require("..");
|
|
11
|
+
const util_1 = require("@jbrowse/core/util");
|
|
11
12
|
const OverviewScalebarPolygon = (0, mobx_react_1.observer)(function ({ model, overview, useOffset = true, }) {
|
|
12
13
|
const theme = (0, material_1.useTheme)();
|
|
13
14
|
const multiplier = Number(useOffset);
|
|
@@ -41,6 +42,6 @@ const OverviewScalebarPolygon = (0, mobx_react_1.observer)(function ({ model, ov
|
|
|
41
42
|
[topRight, 0],
|
|
42
43
|
[topLeft, 0],
|
|
43
44
|
];
|
|
44
|
-
return (react_1.default.createElement("polygon", { points: points.toString(),
|
|
45
|
+
return (react_1.default.createElement("polygon", { points: points.toString(), ...(0, util_1.getFillProps)((0, material_1.alpha)(polygonColor, 0.3)), ...(0, util_1.getStrokeProps)((0, material_1.alpha)(polygonColor, 0.8)) }));
|
|
45
46
|
});
|
|
46
47
|
exports.default = OverviewScalebarPolygon;
|
|
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const mui_1 = require("tss-react/mui");
|
|
8
|
-
const blockTypes_1 = require("@jbrowse/core/util/blockTypes");
|
|
9
8
|
const mobx_react_1 = require("mobx-react");
|
|
10
9
|
const react_1 = __importDefault(require("react"));
|
|
11
10
|
const Block_1 = require("../../BaseLinearDisplay/components/Block");
|
|
@@ -61,7 +60,7 @@ const RenderedRefNameLabels = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
61
60
|
}
|
|
62
61
|
});
|
|
63
62
|
return (react_1.default.createElement(react_1.default.Fragment, null, model.staticBlocks.map((block, index) => {
|
|
64
|
-
return block
|
|
63
|
+
return block.type === 'ContentBlock' &&
|
|
65
64
|
(block.isLeftEndOfDisplayedRegion || index === lastLeftBlock) ? (react_1.default.createElement(material_1.Typography, { key: `refLabel-${block.key}-${index}`, style: {
|
|
66
65
|
left: index === lastLeftBlock
|
|
67
66
|
? Math.max(0, -model.offsetPx)
|
|
@@ -88,13 +87,13 @@ const RenderedScalebarLabels = (0, mobx_react_1.observer)(({ model }) => {
|
|
|
88
87
|
return (react_1.default.createElement(react_1.default.Fragment, null, staticBlocks.map((block, idx) => {
|
|
89
88
|
const { key, widthPx } = block;
|
|
90
89
|
const k = `${key}-${idx}`;
|
|
91
|
-
if (block
|
|
90
|
+
if (block.type === 'ContentBlock') {
|
|
92
91
|
return react_1.default.createElement(RenderedBlockTicks, { key: k, block: block, bpPerPx: bpPerPx });
|
|
93
92
|
}
|
|
94
|
-
else if (block
|
|
93
|
+
else if (block.type === 'ElidedBlock') {
|
|
95
94
|
return react_1.default.createElement(Block_1.ElidedBlock, { key: k, width: widthPx });
|
|
96
95
|
}
|
|
97
|
-
else if (block
|
|
96
|
+
else if (block.type === 'InterRegionPaddingBlock') {
|
|
98
97
|
return (react_1.default.createElement(Block_1.InterRegionPaddingBlock, { key: k, width: widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
|
|
99
98
|
}
|
|
100
99
|
return null;
|
|
@@ -364,6 +364,7 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
364
364
|
getSelectedRegions(leftOffset?: BpOffset, rightOffset?: BpOffset): {
|
|
365
365
|
start: number;
|
|
366
366
|
end: number;
|
|
367
|
+
type: string;
|
|
367
368
|
regionNumber?: number | undefined;
|
|
368
369
|
reversed?: boolean | undefined;
|
|
369
370
|
refName: string;
|
|
@@ -47,7 +47,7 @@ function SVGHeader({ model, fontSize, cytobandHeight, rulerHeight, }) {
|
|
|
47
47
|
react_1.default.createElement("text", { x: 0, y: 0, dominantBaseline: "hanging", fontSize: fontSize, fill: c }, assemblyName),
|
|
48
48
|
showCytobands ? (react_1.default.createElement("g", { transform: `translate(0 ${rulerHeight})` },
|
|
49
49
|
react_1.default.createElement(Cytobands_1.default, { overview: overview, assembly: assembly, block: block }),
|
|
50
|
-
react_1.default.createElement("rect", { stroke: "red", fill: "rgb(255,0,0,0.1
|
|
50
|
+
react_1.default.createElement("rect", { stroke: "red", fill: "rgb(255,0,0)", fillOpacity: 0.1, width: Math.max(lastOverviewPx - firstOverviewPx, 0.5), height: __1.HEADER_OVERVIEW_HEIGHT - 1, x: firstOverviewPx, y: 0.5 }),
|
|
51
51
|
react_1.default.createElement("g", { transform: `translate(0,${__1.HEADER_OVERVIEW_HEIGHT})` },
|
|
52
52
|
react_1.default.createElement(OverviewScalebarPolygon_1.default, { overview: overview, model: model, useOffset: false })))) : null,
|
|
53
53
|
react_1.default.createElement("g", { transform: `translate(0 ${fontSize + y})` },
|
|
@@ -8,7 +8,7 @@ const material_1 = require("@mui/material");
|
|
|
8
8
|
const util_1 = require("@jbrowse/core/util");
|
|
9
9
|
function SVGTrackLabel({ trackLabels, trackName, fontSize, trackLabelOffset, x, }) {
|
|
10
10
|
const theme = (0, material_1.useTheme)();
|
|
11
|
-
const fill = theme.palette.text.primary;
|
|
11
|
+
const fill = (0, util_1.stripAlpha)(theme.palette.text.primary);
|
|
12
12
|
const xoff = trackLabels === 'overlay' ? 5 : 0;
|
|
13
13
|
const yoff = trackLabels === 'offset' ? 5 : 0;
|
|
14
14
|
const name = (0, util_1.coarseStripHTML)(trackName);
|
package/dist/index.d.ts
CHANGED
|
@@ -143,6 +143,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
143
143
|
defaultValue: string;
|
|
144
144
|
contextVariable: string[];
|
|
145
145
|
};
|
|
146
|
+
jexlFilters: {
|
|
147
|
+
type: string;
|
|
148
|
+
description: string;
|
|
149
|
+
defaultValue: never[];
|
|
150
|
+
};
|
|
146
151
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>>;
|
|
147
152
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
148
153
|
rendererTypeName: string;
|
|
@@ -258,6 +263,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
258
263
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
259
264
|
deleteBlock(key: string): void;
|
|
260
265
|
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
266
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
261
267
|
clearFeatureSelection(): void;
|
|
262
268
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
263
269
|
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
@@ -355,6 +361,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
355
361
|
defaultValue: string;
|
|
356
362
|
contextVariable: string[];
|
|
357
363
|
};
|
|
364
|
+
jexlFilters: {
|
|
365
|
+
type: string;
|
|
366
|
+
description: string;
|
|
367
|
+
defaultValue: never[];
|
|
368
|
+
};
|
|
358
369
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
359
370
|
}, {
|
|
360
371
|
rendererTypeName: string;
|
|
@@ -470,6 +481,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
470
481
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
471
482
|
deleteBlock(key: string): void;
|
|
472
483
|
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
484
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
473
485
|
clearFeatureSelection(): void;
|
|
474
486
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
475
487
|
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
@@ -567,6 +579,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
567
579
|
defaultValue: string;
|
|
568
580
|
contextVariable: string[];
|
|
569
581
|
};
|
|
582
|
+
jexlFilters: {
|
|
583
|
+
type: string;
|
|
584
|
+
description: string;
|
|
585
|
+
defaultValue: never[];
|
|
586
|
+
};
|
|
570
587
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
571
588
|
}>>, {
|
|
572
589
|
type: string;
|
|
@@ -664,6 +681,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
664
681
|
defaultValue: string;
|
|
665
682
|
contextVariable: string[];
|
|
666
683
|
};
|
|
684
|
+
jexlFilters: {
|
|
685
|
+
type: string;
|
|
686
|
+
description: string;
|
|
687
|
+
defaultValue: never[];
|
|
688
|
+
};
|
|
667
689
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
668
690
|
}, {
|
|
669
691
|
rendererTypeName: string;
|
|
@@ -779,6 +801,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
779
801
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
780
802
|
deleteBlock(key: string): void;
|
|
781
803
|
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
804
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
782
805
|
clearFeatureSelection(): void;
|
|
783
806
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
784
807
|
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
@@ -876,6 +899,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
876
899
|
defaultValue: string;
|
|
877
900
|
contextVariable: string[];
|
|
878
901
|
};
|
|
902
|
+
jexlFilters: {
|
|
903
|
+
type: string;
|
|
904
|
+
description: string;
|
|
905
|
+
defaultValue: never[];
|
|
906
|
+
};
|
|
879
907
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
880
908
|
}>>, {
|
|
881
909
|
type: string;
|
|
@@ -908,6 +936,11 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
908
936
|
defaultValue: string;
|
|
909
937
|
contextVariable: string[];
|
|
910
938
|
};
|
|
939
|
+
jexlFilters: {
|
|
940
|
+
type: string;
|
|
941
|
+
description: string;
|
|
942
|
+
defaultValue: never[];
|
|
943
|
+
};
|
|
911
944
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
912
945
|
SearchBox: ({ model, showHelp, }: {
|
|
913
946
|
showHelp?: boolean | undefined;
|
|
@@ -1039,6 +1072,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1039
1072
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
1040
1073
|
start: number;
|
|
1041
1074
|
end: number;
|
|
1075
|
+
type: string;
|
|
1042
1076
|
regionNumber?: number | undefined;
|
|
1043
1077
|
reversed?: boolean | undefined;
|
|
1044
1078
|
refName: string;
|
|
@@ -1368,6 +1402,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1368
1402
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
1369
1403
|
start: number;
|
|
1370
1404
|
end: number;
|
|
1405
|
+
type: string;
|
|
1371
1406
|
regionNumber?: number | undefined;
|
|
1372
1407
|
reversed?: boolean | undefined;
|
|
1373
1408
|
refName: string;
|
|
@@ -1737,6 +1772,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
1737
1772
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
1738
1773
|
start: number;
|
|
1739
1774
|
end: number;
|
|
1775
|
+
type: string;
|
|
1740
1776
|
regionNumber?: number | undefined;
|
|
1741
1777
|
reversed?: boolean | undefined;
|
|
1742
1778
|
refName: string;
|
|
@@ -2066,6 +2102,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2066
2102
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
2067
2103
|
start: number;
|
|
2068
2104
|
end: number;
|
|
2105
|
+
type: string;
|
|
2069
2106
|
regionNumber?: number | undefined;
|
|
2070
2107
|
reversed?: boolean | undefined;
|
|
2071
2108
|
refName: string;
|
|
@@ -2435,6 +2472,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2435
2472
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
2436
2473
|
start: number;
|
|
2437
2474
|
end: number;
|
|
2475
|
+
type: string;
|
|
2438
2476
|
regionNumber?: number | undefined;
|
|
2439
2477
|
reversed?: boolean | undefined;
|
|
2440
2478
|
refName: string;
|
|
@@ -2764,6 +2802,7 @@ export default class LinearGenomeViewPlugin extends Plugin {
|
|
|
2764
2802
|
getSelectedRegions(leftOffset?: import("./LinearGenomeView").BpOffset | undefined, rightOffset?: import("./LinearGenomeView").BpOffset | undefined): {
|
|
2765
2803
|
start: number;
|
|
2766
2804
|
end: number;
|
|
2805
|
+
type: string;
|
|
2767
2806
|
regionNumber?: number | undefined;
|
|
2768
2807
|
reversed?: boolean | undefined;
|
|
2769
2808
|
refName: string;
|