@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,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { makeStyles } from 'tss-react/mui';
|
|
3
3
|
import { getContainingView } from '@jbrowse/core/util';
|
|
4
4
|
import { observer } from 'mobx-react';
|
|
5
|
-
import { ContentBlock, ElidedBlock, InterRegionPaddingBlock, } from '@jbrowse/core/util/blockTypes';
|
|
6
5
|
import { ContentBlock as ContentBlockComponent, ElidedBlock as ElidedBlockComponent, InterRegionPaddingBlock as InterRegionPaddingBlockComponent, } from './Block';
|
|
7
6
|
const useStyles = makeStyles()({
|
|
8
7
|
linearBlocks: {
|
|
@@ -29,9 +28,10 @@ const RenderedBlocks = observer(function ({ model, }) {
|
|
|
29
28
|
const { classes } = useStyles();
|
|
30
29
|
const { blockDefinitions, blockState } = model;
|
|
31
30
|
return (React.createElement(React.Fragment, null, blockDefinitions.map(block => {
|
|
32
|
-
|
|
31
|
+
const key = `${model.id}-${block.key}`;
|
|
32
|
+
if (block.type === 'ContentBlock') {
|
|
33
33
|
const state = blockState.get(block.key);
|
|
34
|
-
return (React.createElement(ContentBlockComponent, { block: block, key:
|
|
34
|
+
return (React.createElement(ContentBlockComponent, { block: block, key: key },
|
|
35
35
|
(state === null || state === void 0 ? void 0 : state.ReactComponent) ? (React.createElement(state.ReactComponent, { model: state })) : null,
|
|
36
36
|
(state === null || state === void 0 ? void 0 : state.maxHeightReached) ? (React.createElement("div", { className: classes.heightOverflowed, style: {
|
|
37
37
|
top: state.layout.getTotalHeight() - 16,
|
|
@@ -39,11 +39,11 @@ const RenderedBlocks = observer(function ({ model, }) {
|
|
|
39
39
|
height: 16,
|
|
40
40
|
} }, "Max height reached")) : null));
|
|
41
41
|
}
|
|
42
|
-
if (block
|
|
43
|
-
return
|
|
42
|
+
else if (block.type === 'ElidedBlock') {
|
|
43
|
+
return React.createElement(ElidedBlockComponent, { key: key, width: block.widthPx });
|
|
44
44
|
}
|
|
45
|
-
if (block
|
|
46
|
-
return (React.createElement(InterRegionPaddingBlockComponent, { key:
|
|
45
|
+
else if (block.type === 'InterRegionPaddingBlock') {
|
|
46
|
+
return (React.createElement(InterRegionPaddingBlockComponent, { key: key, width: block.widthPx, style: { background: 'none' }, boundary: block.variant === 'boundary' }));
|
|
47
47
|
}
|
|
48
48
|
throw new Error(`invalid block type ${JSON.stringify(block)}`);
|
|
49
49
|
})));
|
|
@@ -35,6 +35,7 @@ const Tooltip = observer(function ({ model, clientMouseCoord, }) {
|
|
|
35
35
|
const y = clientMouseCoord[1];
|
|
36
36
|
const { refs, floatingStyles, context } = useFloating({
|
|
37
37
|
placement: 'right',
|
|
38
|
+
strategy: 'fixed',
|
|
38
39
|
});
|
|
39
40
|
const clientPoint = useClientPoint(context, { x, y });
|
|
40
41
|
const { getFloatingProps } = useInteractions([clientPoint]);
|
|
@@ -110,6 +110,11 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
110
110
|
defaultValue: string;
|
|
111
111
|
contextVariable: string[];
|
|
112
112
|
};
|
|
113
|
+
jexlFilters: {
|
|
114
|
+
type: string;
|
|
115
|
+
description: string;
|
|
116
|
+
defaultValue: never[];
|
|
117
|
+
};
|
|
113
118
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
114
119
|
}, {
|
|
115
120
|
rendererTypeName: string;
|
|
@@ -200,7 +205,9 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
200
205
|
readonly regionTooLarge: boolean;
|
|
201
206
|
readonly regionTooLargeReason: string;
|
|
202
207
|
} & {
|
|
203
|
-
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features";
|
|
208
|
+
regionCannotBeRenderedText(_region: import("@jbrowse/core/util").Region): "" | "Force load to see features"; /**
|
|
209
|
+
* #action
|
|
210
|
+
*/
|
|
204
211
|
regionCannotBeRendered(_region: import("@jbrowse/core/util").Region): React.JSX.Element | null;
|
|
205
212
|
} & {
|
|
206
213
|
featureIdUnderMouse: string | undefined;
|
|
@@ -273,6 +280,10 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
273
280
|
* #action
|
|
274
281
|
*/
|
|
275
282
|
selectFeature(feature: Feature): void;
|
|
283
|
+
/**
|
|
284
|
+
* #action
|
|
285
|
+
*/
|
|
286
|
+
navToFeature(feature: Feature): void;
|
|
276
287
|
/**
|
|
277
288
|
* #action
|
|
278
289
|
*/
|
|
@@ -401,6 +412,11 @@ export declare const BaseLinearDisplay: import("mobx-state-tree").IModelType<{
|
|
|
401
412
|
defaultValue: string;
|
|
402
413
|
contextVariable: string[];
|
|
403
414
|
};
|
|
415
|
+
jexlFilters: {
|
|
416
|
+
type: string;
|
|
417
|
+
description: string;
|
|
418
|
+
defaultValue: never[];
|
|
419
|
+
};
|
|
404
420
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
405
421
|
}>>, {
|
|
406
422
|
type: string;
|
|
@@ -7,6 +7,7 @@ import { autorun } from 'mobx';
|
|
|
7
7
|
import { addDisposer, isAlive, types } from 'mobx-state-tree';
|
|
8
8
|
// icons
|
|
9
9
|
import MenuOpenIcon from '@mui/icons-material/MenuOpen';
|
|
10
|
+
import CenterFocusStrongIcon from '@mui/icons-material/CenterFocusStrong';
|
|
10
11
|
import { Tooltip } from '../components/BaseLinearDisplay';
|
|
11
12
|
import BlockState from './serverSideRenderedBlock';
|
|
12
13
|
import configSchema from './configSchema';
|
|
@@ -182,6 +183,17 @@ function stateModelFactory() {
|
|
|
182
183
|
session.setSelection(feature);
|
|
183
184
|
}
|
|
184
185
|
},
|
|
186
|
+
/**
|
|
187
|
+
* #action
|
|
188
|
+
*/
|
|
189
|
+
navToFeature(feature) {
|
|
190
|
+
const view = getContainingView(self);
|
|
191
|
+
view.navTo({
|
|
192
|
+
refName: feature.get('refName'),
|
|
193
|
+
start: feature.get('start'),
|
|
194
|
+
end: feature.get('end'),
|
|
195
|
+
});
|
|
196
|
+
},
|
|
185
197
|
/**
|
|
186
198
|
* #action
|
|
187
199
|
*/
|
|
@@ -239,6 +251,15 @@ function stateModelFactory() {
|
|
|
239
251
|
}
|
|
240
252
|
},
|
|
241
253
|
},
|
|
254
|
+
{
|
|
255
|
+
label: 'Zoom to feature',
|
|
256
|
+
icon: CenterFocusStrongIcon,
|
|
257
|
+
onClick: () => {
|
|
258
|
+
if (self.contextMenuFeature) {
|
|
259
|
+
self.navToFeature(self.contextMenuFeature);
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
},
|
|
242
263
|
]
|
|
243
264
|
: []),
|
|
244
265
|
];
|
|
@@ -32,5 +32,15 @@ declare const baseLinearDisplayConfigSchema: import("@jbrowse/core/configuration
|
|
|
32
32
|
defaultValue: string;
|
|
33
33
|
contextVariable: string[];
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* #slot
|
|
37
|
+
* config jexlFilters are deferred evaluated so they are prepended with
|
|
38
|
+
* jexl at runtime rather than being stored with jexl in the config
|
|
39
|
+
*/
|
|
40
|
+
jexlFilters: {
|
|
41
|
+
type: string;
|
|
42
|
+
description: string;
|
|
43
|
+
defaultValue: never[];
|
|
44
|
+
};
|
|
35
45
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
36
46
|
export default baseLinearDisplayConfigSchema;
|
|
@@ -2,9 +2,11 @@ import { ConfigurationSchema } from '@jbrowse/core/configuration';
|
|
|
2
2
|
/**
|
|
3
3
|
* #config BaseLinearDisplay
|
|
4
4
|
* #category display
|
|
5
|
-
*
|
|
6
|
-
* `
|
|
7
|
-
*
|
|
5
|
+
*
|
|
6
|
+
* `BaseLinearDisplay` is a "base" config that is extended by other configs including
|
|
7
|
+
* - `LinearBasicDisplay` (used for feature tracks, etc)
|
|
8
|
+
* - `LinearBareDisplay` (more stripped down than even the basic display, not
|
|
9
|
+
* commonly used)
|
|
8
10
|
*/
|
|
9
11
|
function x() { } // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
10
12
|
const baseLinearDisplayConfigSchema = ConfigurationSchema('BaseLinearDisplay', {
|
|
@@ -41,6 +43,16 @@ const baseLinearDisplayConfigSchema = ConfigurationSchema('BaseLinearDisplay', {
|
|
|
41
43
|
defaultValue: `jexl:get(feature,'name')`,
|
|
42
44
|
contextVariable: ['feature'],
|
|
43
45
|
},
|
|
46
|
+
/**
|
|
47
|
+
* #slot
|
|
48
|
+
* config jexlFilters are deferred evaluated so they are prepended with
|
|
49
|
+
* jexl at runtime rather than being stored with jexl in the config
|
|
50
|
+
*/
|
|
51
|
+
jexlFilters: {
|
|
52
|
+
type: 'stringArray',
|
|
53
|
+
description: 'default set of jexl filters to apply to a track. note: these do not use the jexl prefix because they have a deferred evaluation system',
|
|
54
|
+
defaultValue: [],
|
|
55
|
+
},
|
|
44
56
|
}, {
|
|
45
57
|
/**
|
|
46
58
|
* #identifier
|
package/esm/BasicTrack/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBaseTrackModel, TrackType, } from '@jbrowse/core/pluggableElementTypes';
|
|
2
2
|
import configSchemaF from './configSchema';
|
|
3
|
-
export default (pm)
|
|
3
|
+
export default function BasicTrackF(pm) {
|
|
4
4
|
pm.addTrackType(() => {
|
|
5
5
|
const configSchema = configSchemaF(pm);
|
|
6
6
|
return new TrackType({
|
|
@@ -9,4 +9,4 @@ export default (pm) => {
|
|
|
9
9
|
stateModel: createBaseTrackModel(pm, 'BasicTrack', configSchema),
|
|
10
10
|
});
|
|
11
11
|
});
|
|
12
|
-
}
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createBaseTrackModel, TrackType, } from '@jbrowse/core/pluggableElementTypes';
|
|
2
2
|
import configSchemaF from './configSchema';
|
|
3
|
-
export default (pm)
|
|
3
|
+
export default function FeatureTrackF(pm) {
|
|
4
4
|
pm.addTrackType(() => {
|
|
5
5
|
const configSchema = configSchemaF(pm);
|
|
6
6
|
return new TrackType({
|
|
@@ -10,4 +10,4 @@ export default (pm) => {
|
|
|
10
10
|
stateModel: createBaseTrackModel(pm, 'FeatureTrack', configSchema),
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
|
-
}
|
|
13
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { when, parseLocString, } from '@jbrowse/core/util';
|
|
2
2
|
import { handleSelectedRegion } from '../searchUtils';
|
|
3
|
-
export default (pluginManager)
|
|
3
|
+
export default function LaunchLinearGenomeViewF(pluginManager) {
|
|
4
4
|
pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
|
|
5
5
|
// @ts-expect-error
|
|
6
6
|
async ({ session, assembly, loc, tracks = [], tracklist, nav, highlight, }) => {
|
|
@@ -49,7 +49,7 @@ export default (pluginManager) => {
|
|
|
49
49
|
throw e;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
}
|
|
52
|
+
}
|
|
53
53
|
function tryTrack(model, trackId, idsNotFound) {
|
|
54
54
|
try {
|
|
55
55
|
model.showTrack(trackId);
|
|
@@ -30,5 +30,10 @@ declare function configSchemaFactory(pluginManager: PluginManager): import("@jbr
|
|
|
30
30
|
defaultValue: string;
|
|
31
31
|
contextVariable: string[];
|
|
32
32
|
};
|
|
33
|
+
jexlFilters: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
defaultValue: never[];
|
|
37
|
+
};
|
|
33
38
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
34
39
|
export { configSchemaFactory };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
|
|
3
|
-
export default _default;
|
|
2
|
+
export default function LinearBareDisplayF(pluginManager: PluginManager): void;
|
|
4
3
|
export { configSchemaFactory } from './configSchema';
|
|
5
4
|
export { stateModelFactory } from './model';
|
|
@@ -3,7 +3,7 @@ import { DisplayType } from '@jbrowse/core/pluggableElementTypes';
|
|
|
3
3
|
import { configSchemaFactory } from './configSchema';
|
|
4
4
|
import { stateModelFactory } from './model';
|
|
5
5
|
import { BaseLinearDisplayComponent } from '../BaseLinearDisplay/';
|
|
6
|
-
export default (pluginManager)
|
|
6
|
+
export default function LinearBareDisplayF(pluginManager) {
|
|
7
7
|
pluginManager.addDisplayType(() => {
|
|
8
8
|
const configSchema = configSchemaFactory(pluginManager);
|
|
9
9
|
return new DisplayType({
|
|
@@ -16,6 +16,6 @@ export default (pluginManager) => {
|
|
|
16
16
|
ReactComponent: BaseLinearDisplayComponent,
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
export { configSchemaFactory } from './configSchema';
|
|
21
21
|
export { stateModelFactory } from './model';
|
|
@@ -77,7 +77,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
77
77
|
};
|
|
78
78
|
fetchSizeLimit: {
|
|
79
79
|
type: string;
|
|
80
|
-
defaultValue: number;
|
|
80
|
+
defaultValue: number; /**
|
|
81
|
+
* #method
|
|
82
|
+
*/
|
|
81
83
|
description: string;
|
|
82
84
|
};
|
|
83
85
|
height: {
|
|
@@ -91,6 +93,11 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
91
93
|
defaultValue: string;
|
|
92
94
|
contextVariable: string[];
|
|
93
95
|
};
|
|
96
|
+
jexlFilters: {
|
|
97
|
+
type: string;
|
|
98
|
+
description: string;
|
|
99
|
+
defaultValue: never[];
|
|
100
|
+
};
|
|
94
101
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
95
102
|
} & {
|
|
96
103
|
/**
|
|
@@ -215,6 +222,7 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
215
222
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
216
223
|
deleteBlock(key: string): void;
|
|
217
224
|
selectFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
225
|
+
navToFeature(feature: import("@jbrowse/core/util").Feature): void;
|
|
218
226
|
clearFeatureSelection(): void;
|
|
219
227
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
220
228
|
setContextMenuFeature(feature?: import("@jbrowse/core/util").Feature | undefined): void;
|
|
@@ -309,7 +317,9 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
309
317
|
};
|
|
310
318
|
fetchSizeLimit: {
|
|
311
319
|
type: string;
|
|
312
|
-
defaultValue: number;
|
|
320
|
+
defaultValue: number; /**
|
|
321
|
+
* #method
|
|
322
|
+
*/
|
|
313
323
|
description: string;
|
|
314
324
|
};
|
|
315
325
|
height: {
|
|
@@ -323,6 +333,11 @@ export declare function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
323
333
|
defaultValue: string;
|
|
324
334
|
contextVariable: string[];
|
|
325
335
|
};
|
|
336
|
+
jexlFilters: {
|
|
337
|
+
type: string;
|
|
338
|
+
description: string;
|
|
339
|
+
defaultValue: never[];
|
|
340
|
+
};
|
|
326
341
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
327
342
|
}>> & import("mobx-state-tree/dist/internal").NonEmptyObject & import("mobx-state-tree")._NotCustomized, {
|
|
328
343
|
type: string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const AddFiltersDialog: ({ model, handleClose, }: {
|
|
3
|
+
model: {
|
|
4
|
+
jexlFilters?: string[];
|
|
5
|
+
activeFilters: string[];
|
|
6
|
+
setJexlFilters: (arg?: string[]) => void;
|
|
7
|
+
};
|
|
8
|
+
handleClose: () => void;
|
|
9
|
+
}) => React.JSX.Element;
|
|
10
|
+
export default AddFiltersDialog;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { observer } from 'mobx-react';
|
|
3
|
+
import { Dialog } from '@jbrowse/core/ui';
|
|
4
|
+
import { Button, DialogActions, DialogContent, TextField } from '@mui/material';
|
|
5
|
+
import { makeStyles } from 'tss-react/mui';
|
|
6
|
+
import { stringToJexlExpression } from '@jbrowse/core/util/jexlStrings';
|
|
7
|
+
const useStyles = makeStyles()({
|
|
8
|
+
dialogContent: {
|
|
9
|
+
width: '80em',
|
|
10
|
+
},
|
|
11
|
+
textAreaFont: {
|
|
12
|
+
fontFamily: 'Courier New',
|
|
13
|
+
},
|
|
14
|
+
error: {
|
|
15
|
+
color: 'red',
|
|
16
|
+
fontSize: '0.8em',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
function checkJexl(code) {
|
|
20
|
+
stringToJexlExpression(code);
|
|
21
|
+
}
|
|
22
|
+
const AddFiltersDialog = observer(function ({ model, handleClose, }) {
|
|
23
|
+
const { classes } = useStyles();
|
|
24
|
+
const { activeFilters } = model;
|
|
25
|
+
const [data, setData] = useState(activeFilters.join('\n'));
|
|
26
|
+
const [error, setError] = useState();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
try {
|
|
29
|
+
data
|
|
30
|
+
.split('\n')
|
|
31
|
+
.map(line => line.trim())
|
|
32
|
+
.filter(line => !!line)
|
|
33
|
+
.map(line => checkJexl(line.trim()));
|
|
34
|
+
setError(undefined);
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(e);
|
|
38
|
+
setError(e);
|
|
39
|
+
}
|
|
40
|
+
}, [data]);
|
|
41
|
+
return (React.createElement(Dialog, { maxWidth: "xl", open: true, onClose: handleClose, title: "Add track filters" },
|
|
42
|
+
React.createElement(DialogContent, null,
|
|
43
|
+
React.createElement("div", null,
|
|
44
|
+
"Add filters, in jexl format, one per line, starting with the string jexl:. Examples:",
|
|
45
|
+
' ',
|
|
46
|
+
React.createElement("ul", null,
|
|
47
|
+
React.createElement("li", null,
|
|
48
|
+
React.createElement("code", null, "jexl:get(feature,'name')=='BRCA1'"),
|
|
49
|
+
" - show only feature where the name attribute is BRCA1"),
|
|
50
|
+
React.createElement("li", null,
|
|
51
|
+
React.createElement("code", null, "jexl:get(feature,'type')=='gene'"),
|
|
52
|
+
" - show only gene type features in a GFF that has many other feature types"),
|
|
53
|
+
React.createElement("li", null,
|
|
54
|
+
React.createElement("code", null, "jexl:get(feature,'score') > 400"),
|
|
55
|
+
" - show only features that have a score greater than 400"))),
|
|
56
|
+
error ? React.createElement("p", { className: classes.error }, `${error}`) : null,
|
|
57
|
+
React.createElement(TextField, { variant: "outlined", multiline: true, minRows: 5, maxRows: 10, className: classes.dialogContent, fullWidth: true, value: data, onChange: event => setData(event.target.value), InputProps: {
|
|
58
|
+
classes: {
|
|
59
|
+
input: classes.textAreaFont,
|
|
60
|
+
},
|
|
61
|
+
} })),
|
|
62
|
+
React.createElement(DialogActions, null,
|
|
63
|
+
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, disabled: !!error, onClick: () => {
|
|
64
|
+
model.setJexlFilters(data.split('\n'));
|
|
65
|
+
handleClose();
|
|
66
|
+
} }, "Submit"),
|
|
67
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"))));
|
|
68
|
+
});
|
|
69
|
+
export default AddFiltersDialog;
|
|
@@ -15,12 +15,12 @@ const SetMaxHeightDialog = observer(function ({ model, handleClose, }) {
|
|
|
15
15
|
return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Set max height" },
|
|
16
16
|
React.createElement(DialogContent, { className: classes.root },
|
|
17
17
|
React.createElement(Typography, null, "Set max height for the track. For example, you can increase this if the layout says \"Max height reached\""),
|
|
18
|
-
React.createElement(TextField, { value: max, onChange: event => setMax(event.target.value), placeholder: "Enter max score" }),
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
React.createElement(TextField, { value: max, onChange: event => setMax(event.target.value), placeholder: "Enter max score" })),
|
|
19
|
+
React.createElement(DialogActions, null,
|
|
20
|
+
React.createElement(Button, { variant: "contained", color: "primary", type: "submit", autoFocus: true, onClick: () => {
|
|
21
|
+
model.setMaxHeight(max !== '' && !Number.isNaN(+max) ? +max : undefined);
|
|
22
|
+
handleClose();
|
|
23
|
+
} }, "Submit"),
|
|
24
|
+
React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => handleClose() }, "Cancel"))));
|
|
25
25
|
});
|
|
26
26
|
export default SetMaxHeightDialog;
|
|
@@ -30,5 +30,10 @@ declare function configSchemaFactory(pluginManager: PluginManager): import("@jbr
|
|
|
30
30
|
defaultValue: string;
|
|
31
31
|
contextVariable: string[];
|
|
32
32
|
};
|
|
33
|
+
jexlFilters: {
|
|
34
|
+
type: string;
|
|
35
|
+
description: string;
|
|
36
|
+
defaultValue: never[];
|
|
37
|
+
};
|
|
33
38
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>;
|
|
34
39
|
export default configSchemaFactory;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import PluginManager from '@jbrowse/core/PluginManager';
|
|
2
|
-
|
|
3
|
-
export default _default;
|
|
2
|
+
export default function LinearBasicDisplay(pluginManager: PluginManager): void;
|
|
4
3
|
export { default as modelFactory } from './model';
|
|
5
4
|
export { default as configSchema } from './configSchema';
|
|
@@ -3,7 +3,7 @@ import { BaseLinearDisplayComponent } from '../BaseLinearDisplay';
|
|
|
3
3
|
// locals
|
|
4
4
|
import configSchema from './configSchema';
|
|
5
5
|
import modelFactory from './model';
|
|
6
|
-
export default (pluginManager)
|
|
6
|
+
export default function LinearBasicDisplay(pluginManager) {
|
|
7
7
|
pluginManager.addDisplayType(() => {
|
|
8
8
|
const config = configSchema(pluginManager);
|
|
9
9
|
return new DisplayType({
|
|
@@ -16,6 +16,6 @@ export default (pluginManager) => {
|
|
|
16
16
|
ReactComponent: BaseLinearDisplayComponent,
|
|
17
17
|
});
|
|
18
18
|
});
|
|
19
|
-
}
|
|
19
|
+
}
|
|
20
20
|
export { default as modelFactory } from './model';
|
|
21
21
|
export { default as configSchema } from './configSchema';
|