@jbrowse/plugin-variants 2.11.1 → 2.12.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/LinearVariantDisplay/configSchema.d.ts +5 -0
- package/dist/LinearVariantDisplay/model.d.ts +13 -9
- package/dist/VariantFeatureWidget/AnnotGrid.js +3 -11
- package/dist/VariantFeatureWidget/VariantSampleGrid.js +4 -12
- package/dist/VariantFeatureWidget/stateModelFactory.d.ts +26 -0
- package/esm/LinearVariantDisplay/configSchema.d.ts +5 -0
- package/esm/LinearVariantDisplay/model.d.ts +13 -9
- package/esm/VariantFeatureWidget/AnnotGrid.js +3 -8
- package/esm/VariantFeatureWidget/VariantSampleGrid.js +4 -9
- package/esm/VariantFeatureWidget/stateModelFactory.d.ts +26 -0
- package/package.json +2 -3
|
@@ -24,6 +24,11 @@ export default function configSchemaF(pluginManager: PluginManager): import("@jb
|
|
|
24
24
|
defaultValue: string;
|
|
25
25
|
contextVariable: string[];
|
|
26
26
|
};
|
|
27
|
+
jexlFilters: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultValue: never[];
|
|
31
|
+
};
|
|
27
32
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
|
|
28
33
|
export type LinearVariantDisplayConfigModel = ReturnType<typeof configSchemaF>;
|
|
29
34
|
export type LinearVariantDisplayConfig = Instance<LinearVariantDisplayConfigModel>;
|
|
@@ -82,32 +82,32 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
82
82
|
type: string;
|
|
83
83
|
defaultValue: number;
|
|
84
84
|
description: string;
|
|
85
|
-
};
|
|
86
|
-
* #property
|
|
87
|
-
*/
|
|
85
|
+
};
|
|
88
86
|
height: {
|
|
89
87
|
type: string;
|
|
90
88
|
defaultValue: number;
|
|
91
89
|
description: string;
|
|
92
|
-
};
|
|
93
|
-
* #action
|
|
94
|
-
*/
|
|
90
|
+
};
|
|
95
91
|
mouseover: {
|
|
96
92
|
type: string;
|
|
97
93
|
description: string;
|
|
98
94
|
defaultValue: string;
|
|
99
95
|
contextVariable: string[];
|
|
100
96
|
};
|
|
97
|
+
jexlFilters: {
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
defaultValue: never[];
|
|
101
|
+
};
|
|
101
102
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
102
103
|
} & {
|
|
103
|
-
type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
|
|
104
|
-
* #property
|
|
105
|
-
*/
|
|
104
|
+
type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
|
|
106
105
|
trackShowLabels: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
107
106
|
trackShowDescriptions: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
108
107
|
trackDisplayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
109
108
|
trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
110
109
|
configuration: AnyConfigurationSchemaType;
|
|
110
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
111
111
|
} & {
|
|
112
112
|
/**
|
|
113
113
|
* #property
|
|
@@ -229,6 +229,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
229
229
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
230
230
|
deleteBlock(key: string): void;
|
|
231
231
|
selectFeature(feature: Feature): void;
|
|
232
|
+
navToFeature(feature: Feature): void;
|
|
232
233
|
clearFeatureSelection(): void;
|
|
233
234
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
234
235
|
setContextMenuFeature(feature?: Feature | undefined): void;
|
|
@@ -242,6 +243,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
242
243
|
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
243
244
|
afterAttach(): void;
|
|
244
245
|
} & {
|
|
246
|
+
readonly activeFilters: any;
|
|
245
247
|
readonly rendererTypeName: any;
|
|
246
248
|
readonly showLabels: any;
|
|
247
249
|
readonly showDescriptions: any;
|
|
@@ -254,6 +256,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
254
256
|
setSubschema(slotName: string, data: unknown): any;
|
|
255
257
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
256
258
|
} & {
|
|
259
|
+
setJexlFilters(f?: string[] | undefined): void;
|
|
257
260
|
toggleShowLabels(): void;
|
|
258
261
|
toggleShowDescriptions(): void;
|
|
259
262
|
setDisplayMode(val: string): void;
|
|
@@ -265,6 +268,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
265
268
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
266
269
|
setSubschema(slotName: string, data: unknown): any;
|
|
267
270
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
271
|
+
filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
268
272
|
};
|
|
269
273
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
270
274
|
} & {
|
|
@@ -22,24 +22,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const react_1 = __importStar(require("react"));
|
|
30
27
|
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
31
28
|
const material_1 = require("@mui/material");
|
|
32
|
-
const ResizeBar_1 = __importDefault(require("@jbrowse/core/ui/ResizeBar"));
|
|
33
29
|
const util_1 = require("@jbrowse/core/util");
|
|
34
|
-
const useResizeBar_1 = require("@jbrowse/core/ui/useResizeBar");
|
|
35
30
|
function VariantAnnotPanel({ rows, columns, }) {
|
|
36
|
-
const { ref, scrollLeft } = (0, useResizeBar_1.useResizeBar)();
|
|
37
31
|
const [checked, setChecked] = (0, react_1.useState)(false);
|
|
38
|
-
const
|
|
39
|
-
return rows.length ? (react_1.default.createElement("div",
|
|
32
|
+
const widths = columns.map(e => (0, util_1.measureGridWidth)(rows.map(r => r[e.field])));
|
|
33
|
+
return rows.length ? (react_1.default.createElement("div", null,
|
|
40
34
|
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: checked, onChange: event => setChecked(event.target.checked) }), label: react_1.default.createElement(material_1.Typography, { variant: "body2" }, "Show options") }),
|
|
41
|
-
react_1.default.createElement(
|
|
42
|
-
react_1.default.createElement(ResizeBar_1.default, { widths: widths, setWidths: setWidths, scrollLeft: scrollLeft }),
|
|
43
|
-
react_1.default.createElement(x_data_grid_1.DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({ ...c, width: widths[i] })), slots: { toolbar: checked ? x_data_grid_1.GridToolbar : null } })))) : null;
|
|
35
|
+
react_1.default.createElement(x_data_grid_1.DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({ ...c, width: widths[i] })), slots: { toolbar: checked ? x_data_grid_1.GridToolbar : null } }))) : null;
|
|
44
36
|
}
|
|
45
37
|
exports.default = VariantAnnotPanel;
|
|
@@ -22,17 +22,12 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
22
22
|
__setModuleDefault(result, mod);
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
26
|
const react_1 = __importStar(require("react"));
|
|
30
27
|
const material_1 = require("@mui/material");
|
|
31
28
|
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
32
29
|
const BaseFeatureDetail_1 = require("@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail");
|
|
33
30
|
const util_1 = require("@jbrowse/core/util");
|
|
34
|
-
const ResizeBar_1 = __importDefault(require("@jbrowse/core/ui/ResizeBar"));
|
|
35
|
-
const useResizeBar_1 = require("@jbrowse/core/ui/useResizeBar");
|
|
36
31
|
function SampleFilters({ columns, filter, setFilter, }) {
|
|
37
32
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
38
33
|
react_1.default.createElement(material_1.Typography, null, "These filters can use a plain text search or regex style query, e.g. in the genotype field, entering 1 will query for all genotypes that include the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\\d* will find any non-zero allele e.g. 0|2 or 2/33"),
|
|
@@ -41,7 +36,6 @@ function SampleFilters({ columns, filter, setFilter, }) {
|
|
|
41
36
|
function VariantSamples(props) {
|
|
42
37
|
var _a;
|
|
43
38
|
const { feature, descriptions = {} } = props;
|
|
44
|
-
const { ref, scrollLeft } = (0, useResizeBar_1.useResizeBar)();
|
|
45
39
|
const [filter, setFilter] = (0, react_1.useState)({});
|
|
46
40
|
const samples = (feature.samples || {});
|
|
47
41
|
const preFilteredRows = Object.entries(samples);
|
|
@@ -74,7 +68,7 @@ function VariantSamples(props) {
|
|
|
74
68
|
}
|
|
75
69
|
const keys = ['sample', ...Object.keys(((_a = preFilteredRows[0]) === null || _a === void 0 ? void 0 : _a[1]) || {})];
|
|
76
70
|
const [checked, setChecked] = (0, react_1.useState)(false);
|
|
77
|
-
const
|
|
71
|
+
const widths = keys.map(e => (0, util_1.measureGridWidth)(rows.map(r => r[e])));
|
|
78
72
|
const columns = keys.map((field, index) => {
|
|
79
73
|
var _a, _b;
|
|
80
74
|
return ({
|
|
@@ -89,10 +83,8 @@ function VariantSamples(props) {
|
|
|
89
83
|
error ? react_1.default.createElement(material_1.Typography, { color: "error" }, `${error}`) : null,
|
|
90
84
|
react_1.default.createElement(material_1.FormControlLabel, { control: react_1.default.createElement(material_1.Checkbox, { checked: checked, onChange: event => setChecked(event.target.checked) }), label: react_1.default.createElement(material_1.Typography, { variant: "body2" }, "Show options") }),
|
|
91
85
|
checked ? (react_1.default.createElement(SampleFilters, { setFilter: setFilter, columns: columns, filter: filter })) : null,
|
|
92
|
-
react_1.default.createElement(
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
toolbar: { printOptions: { disableToolbarButton: true } },
|
|
96
|
-
} }))));
|
|
86
|
+
react_1.default.createElement(x_data_grid_1.DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, columnHeaderHeight: 35, disableColumnMenu: true, slots: { toolbar: checked ? x_data_grid_1.GridToolbar : null }, slotProps: {
|
|
87
|
+
toolbar: { printOptions: { disableToolbarButton: true } },
|
|
88
|
+
} })));
|
|
97
89
|
}
|
|
98
90
|
exports.default = VariantSamples;
|
|
@@ -12,13 +12,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
12
12
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
13
13
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
14
14
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
15
|
+
showCoordinatesSetting: string;
|
|
15
16
|
intronBp: number;
|
|
16
17
|
upDownBp: number;
|
|
17
18
|
upperCaseCDS: boolean;
|
|
19
|
+
charactersPerRow: number;
|
|
20
|
+
feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
|
|
21
|
+
mode: string;
|
|
18
22
|
} & {
|
|
23
|
+
setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
19
24
|
setUpDownBp(f: number): void;
|
|
20
25
|
setIntronBp(f: number): void;
|
|
21
26
|
setUpperCaseCDS(f: boolean): void;
|
|
27
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
28
|
+
setMode(mode: string): void;
|
|
29
|
+
} & {
|
|
30
|
+
readonly showCoordinates: boolean;
|
|
31
|
+
readonly showGenomicCoordsOption: boolean;
|
|
32
|
+
readonly hasCDS: boolean | undefined;
|
|
33
|
+
readonly hasExon: boolean | undefined;
|
|
34
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
22
35
|
} & {
|
|
23
36
|
afterAttach(): void;
|
|
24
37
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
@@ -49,13 +62,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
49
62
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
50
63
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
51
64
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
65
|
+
showCoordinatesSetting: string;
|
|
52
66
|
intronBp: number;
|
|
53
67
|
upDownBp: number;
|
|
54
68
|
upperCaseCDS: boolean;
|
|
69
|
+
charactersPerRow: number;
|
|
70
|
+
feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
|
|
71
|
+
mode: string;
|
|
55
72
|
} & {
|
|
73
|
+
setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
56
74
|
setUpDownBp(f: number): void;
|
|
57
75
|
setIntronBp(f: number): void;
|
|
58
76
|
setUpperCaseCDS(f: boolean): void;
|
|
77
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
78
|
+
setMode(mode: string): void;
|
|
79
|
+
} & {
|
|
80
|
+
readonly showCoordinates: boolean;
|
|
81
|
+
readonly showGenomicCoordsOption: boolean;
|
|
82
|
+
readonly hasCDS: boolean | undefined;
|
|
83
|
+
readonly hasExon: boolean | undefined;
|
|
84
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
59
85
|
} & {
|
|
60
86
|
afterAttach(): void;
|
|
61
87
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
@@ -24,6 +24,11 @@ export default function configSchemaF(pluginManager: PluginManager): import("@jb
|
|
|
24
24
|
defaultValue: string;
|
|
25
25
|
contextVariable: string[];
|
|
26
26
|
};
|
|
27
|
+
jexlFilters: {
|
|
28
|
+
type: string;
|
|
29
|
+
description: string;
|
|
30
|
+
defaultValue: never[];
|
|
31
|
+
};
|
|
27
32
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>, undefined>>, undefined>>;
|
|
28
33
|
export type LinearVariantDisplayConfigModel = ReturnType<typeof configSchemaF>;
|
|
29
34
|
export type LinearVariantDisplayConfig = Instance<LinearVariantDisplayConfigModel>;
|
|
@@ -82,32 +82,32 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
82
82
|
type: string;
|
|
83
83
|
defaultValue: number;
|
|
84
84
|
description: string;
|
|
85
|
-
};
|
|
86
|
-
* #property
|
|
87
|
-
*/
|
|
85
|
+
};
|
|
88
86
|
height: {
|
|
89
87
|
type: string;
|
|
90
88
|
defaultValue: number;
|
|
91
89
|
description: string;
|
|
92
|
-
};
|
|
93
|
-
* #action
|
|
94
|
-
*/
|
|
90
|
+
};
|
|
95
91
|
mouseover: {
|
|
96
92
|
type: string;
|
|
97
93
|
description: string;
|
|
98
94
|
defaultValue: string;
|
|
99
95
|
contextVariable: string[];
|
|
100
96
|
};
|
|
97
|
+
jexlFilters: {
|
|
98
|
+
type: string;
|
|
99
|
+
description: string;
|
|
100
|
+
defaultValue: never[];
|
|
101
|
+
};
|
|
101
102
|
}, import("@jbrowse/core/configuration/configurationSchema").ConfigurationSchemaOptions<undefined, "displayId">>;
|
|
102
103
|
} & {
|
|
103
|
-
type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
|
|
104
|
-
* #property
|
|
105
|
-
*/
|
|
104
|
+
type: import("mobx-state-tree").ISimpleType<"LinearBasicDisplay">;
|
|
106
105
|
trackShowLabels: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
107
106
|
trackShowDescriptions: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<boolean>>;
|
|
108
107
|
trackDisplayMode: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
109
108
|
trackMaxHeight: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
110
109
|
configuration: AnyConfigurationSchemaType;
|
|
110
|
+
jexlFilters: import("mobx-state-tree").IMaybe<import("mobx-state-tree").IArrayType<import("mobx-state-tree").ISimpleType<string>>>;
|
|
111
111
|
} & {
|
|
112
112
|
/**
|
|
113
113
|
* #property
|
|
@@ -229,6 +229,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
229
229
|
addBlock(key: string, block: import("@jbrowse/core/util/blockTypes").BaseBlock): void;
|
|
230
230
|
deleteBlock(key: string): void;
|
|
231
231
|
selectFeature(feature: Feature): void;
|
|
232
|
+
navToFeature(feature: Feature): void;
|
|
232
233
|
clearFeatureSelection(): void;
|
|
233
234
|
setFeatureIdUnderMouse(feature?: string | undefined): void;
|
|
234
235
|
setContextMenuFeature(feature?: Feature | undefined): void;
|
|
@@ -242,6 +243,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
242
243
|
renderSvg(opts: import("@jbrowse/plugin-linear-genome-view").ExportSvgDisplayOptions): Promise<import("react").JSX.Element>;
|
|
243
244
|
afterAttach(): void;
|
|
244
245
|
} & {
|
|
246
|
+
readonly activeFilters: any;
|
|
245
247
|
readonly rendererTypeName: any;
|
|
246
248
|
readonly showLabels: any;
|
|
247
249
|
readonly showDescriptions: any;
|
|
@@ -254,6 +256,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
254
256
|
setSubschema(slotName: string, data: unknown): any;
|
|
255
257
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
256
258
|
} & {
|
|
259
|
+
setJexlFilters(f?: string[] | undefined): void;
|
|
257
260
|
toggleShowLabels(): void;
|
|
258
261
|
toggleShowDescriptions(): void;
|
|
259
262
|
setDisplayMode(val: string): void;
|
|
@@ -265,6 +268,7 @@ export default function stateModelFactory(configSchema: AnyConfigurationSchemaTy
|
|
|
265
268
|
} & import("mobx-state-tree/dist/internal").NonEmptyObject & {
|
|
266
269
|
setSubschema(slotName: string, data: unknown): any;
|
|
267
270
|
} & import("mobx-state-tree").IStateTreeNode<AnyConfigurationSchemaType>;
|
|
271
|
+
filters: import("@jbrowse/core/pluggableElementTypes/renderers/util/serializableFilterChain").default;
|
|
268
272
|
};
|
|
269
273
|
trackMenuItems(): import("@jbrowse/core/ui").MenuItem[];
|
|
270
274
|
} & {
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
2
|
import { DataGrid, GridToolbar, } from '@mui/x-data-grid';
|
|
3
3
|
import { Checkbox, FormControlLabel, Typography } from '@mui/material';
|
|
4
|
-
import ResizeBar from '@jbrowse/core/ui/ResizeBar';
|
|
5
4
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
6
|
-
import { useResizeBar } from '@jbrowse/core/ui/useResizeBar';
|
|
7
5
|
export default function VariantAnnotPanel({ rows, columns, }) {
|
|
8
|
-
const { ref, scrollLeft } = useResizeBar();
|
|
9
6
|
const [checked, setChecked] = useState(false);
|
|
10
|
-
const
|
|
11
|
-
return rows.length ? (React.createElement("div",
|
|
7
|
+
const widths = columns.map(e => measureGridWidth(rows.map(r => r[e.field])));
|
|
8
|
+
return rows.length ? (React.createElement("div", null,
|
|
12
9
|
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: checked, onChange: event => setChecked(event.target.checked) }), label: React.createElement(Typography, { variant: "body2" }, "Show options") }),
|
|
13
|
-
React.createElement(
|
|
14
|
-
React.createElement(ResizeBar, { widths: widths, setWidths: setWidths, scrollLeft: scrollLeft }),
|
|
15
|
-
React.createElement(DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({ ...c, width: widths[i] })), slots: { toolbar: checked ? GridToolbar : null } })))) : null;
|
|
10
|
+
React.createElement(DataGrid, { rowHeight: 25, rows: rows, columns: columns.map((c, i) => ({ ...c, width: widths[i] })), slots: { toolbar: checked ? GridToolbar : null } }))) : null;
|
|
16
11
|
}
|
|
@@ -3,8 +3,6 @@ import { FormControlLabel, Checkbox, TextField, Typography, } from '@mui/materia
|
|
|
3
3
|
import { DataGrid, GridToolbar } from '@mui/x-data-grid';
|
|
4
4
|
import { BaseCard } from '@jbrowse/core/BaseFeatureWidget/BaseFeatureDetail';
|
|
5
5
|
import { measureGridWidth } from '@jbrowse/core/util';
|
|
6
|
-
import ResizeBar from '@jbrowse/core/ui/ResizeBar';
|
|
7
|
-
import { useResizeBar } from '@jbrowse/core/ui/useResizeBar';
|
|
8
6
|
function SampleFilters({ columns, filter, setFilter, }) {
|
|
9
7
|
return (React.createElement(React.Fragment, null,
|
|
10
8
|
React.createElement(Typography, null, "These filters can use a plain text search or regex style query, e.g. in the genotype field, entering 1 will query for all genotypes that include the first alternate allele e.g. 0|1 or 1|1, entering [1-9]\\d* will find any non-zero allele e.g. 0|2 or 2/33"),
|
|
@@ -13,7 +11,6 @@ function SampleFilters({ columns, filter, setFilter, }) {
|
|
|
13
11
|
export default function VariantSamples(props) {
|
|
14
12
|
var _a;
|
|
15
13
|
const { feature, descriptions = {} } = props;
|
|
16
|
-
const { ref, scrollLeft } = useResizeBar();
|
|
17
14
|
const [filter, setFilter] = useState({});
|
|
18
15
|
const samples = (feature.samples || {});
|
|
19
16
|
const preFilteredRows = Object.entries(samples);
|
|
@@ -46,7 +43,7 @@ export default function VariantSamples(props) {
|
|
|
46
43
|
}
|
|
47
44
|
const keys = ['sample', ...Object.keys(((_a = preFilteredRows[0]) === null || _a === void 0 ? void 0 : _a[1]) || {})];
|
|
48
45
|
const [checked, setChecked] = useState(false);
|
|
49
|
-
const
|
|
46
|
+
const widths = keys.map(e => measureGridWidth(rows.map(r => r[e])));
|
|
50
47
|
const columns = keys.map((field, index) => {
|
|
51
48
|
var _a, _b;
|
|
52
49
|
return ({
|
|
@@ -61,9 +58,7 @@ export default function VariantSamples(props) {
|
|
|
61
58
|
error ? React.createElement(Typography, { color: "error" }, `${error}`) : null,
|
|
62
59
|
React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: checked, onChange: event => setChecked(event.target.checked) }), label: React.createElement(Typography, { variant: "body2" }, "Show options") }),
|
|
63
60
|
checked ? (React.createElement(SampleFilters, { setFilter: setFilter, columns: columns, filter: filter })) : null,
|
|
64
|
-
React.createElement(
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
toolbar: { printOptions: { disableToolbarButton: true } },
|
|
68
|
-
} }))));
|
|
61
|
+
React.createElement(DataGrid, { rows: rows, hideFooter: rows.length < 100, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, columnHeaderHeight: 35, disableColumnMenu: true, slots: { toolbar: checked ? GridToolbar : null }, slotProps: {
|
|
62
|
+
toolbar: { printOptions: { disableToolbarButton: true } },
|
|
63
|
+
} })));
|
|
69
64
|
}
|
|
@@ -12,13 +12,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
12
12
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
13
13
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
14
14
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
15
|
+
showCoordinatesSetting: string;
|
|
15
16
|
intronBp: number;
|
|
16
17
|
upDownBp: number;
|
|
17
18
|
upperCaseCDS: boolean;
|
|
19
|
+
charactersPerRow: number;
|
|
20
|
+
feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
|
|
21
|
+
mode: string;
|
|
18
22
|
} & {
|
|
23
|
+
setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
19
24
|
setUpDownBp(f: number): void;
|
|
20
25
|
setIntronBp(f: number): void;
|
|
21
26
|
setUpperCaseCDS(f: boolean): void;
|
|
27
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
28
|
+
setMode(mode: string): void;
|
|
29
|
+
} & {
|
|
30
|
+
readonly showCoordinates: boolean;
|
|
31
|
+
readonly showGenomicCoordsOption: boolean;
|
|
32
|
+
readonly hasCDS: boolean | undefined;
|
|
33
|
+
readonly hasExon: boolean | undefined;
|
|
34
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
22
35
|
} & {
|
|
23
36
|
afterAttach(): void;
|
|
24
37
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
|
@@ -49,13 +62,26 @@ export declare function stateModelFactory(pluginManager: PluginManager): import(
|
|
|
49
62
|
trackType: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
|
|
50
63
|
maxDepth: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<number>>;
|
|
51
64
|
sequenceFeatureDetails: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").IModelType<{}, {
|
|
65
|
+
showCoordinatesSetting: string;
|
|
52
66
|
intronBp: number;
|
|
53
67
|
upDownBp: number;
|
|
54
68
|
upperCaseCDS: boolean;
|
|
69
|
+
charactersPerRow: number;
|
|
70
|
+
feature: import("@jbrowse/core/util").SimpleFeatureSerialized | undefined;
|
|
71
|
+
mode: string;
|
|
55
72
|
} & {
|
|
73
|
+
setFeature(f: import("@jbrowse/core/util").SimpleFeatureSerialized): void;
|
|
56
74
|
setUpDownBp(f: number): void;
|
|
57
75
|
setIntronBp(f: number): void;
|
|
58
76
|
setUpperCaseCDS(f: boolean): void;
|
|
77
|
+
setShowCoordinates(f: "none" | "relative" | "genomic"): void;
|
|
78
|
+
setMode(mode: string): void;
|
|
79
|
+
} & {
|
|
80
|
+
readonly showCoordinates: boolean;
|
|
81
|
+
readonly showGenomicCoordsOption: boolean;
|
|
82
|
+
readonly hasCDS: boolean | undefined;
|
|
83
|
+
readonly hasExon: boolean | undefined;
|
|
84
|
+
readonly hasExonOrCDS: boolean | undefined;
|
|
59
85
|
} & {
|
|
60
86
|
afterAttach(): void;
|
|
61
87
|
}, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>, [undefined]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jbrowse/plugin-variants",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "JBrowse 2 variant adapters, tracks, etc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jbrowse",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"@jbrowse/core": "^2.0.0",
|
|
49
|
-
"@jbrowse/plugin-alignments": "^2.0.0",
|
|
50
49
|
"@jbrowse/plugin-circular-view": "^2.0.0",
|
|
51
50
|
"@jbrowse/plugin-linear-genome-view": "^2.0.0",
|
|
52
51
|
"@mui/material": "^5.0.0",
|
|
@@ -63,5 +62,5 @@
|
|
|
63
62
|
"distModule": "esm/index.js",
|
|
64
63
|
"srcModule": "src/index.ts",
|
|
65
64
|
"module": "esm/index.js",
|
|
66
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "935f2602d29abc737bb1f493a922b6218d023ae2"
|
|
67
66
|
}
|