@jbrowse/plugin-variants 2.11.1 → 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.
@@ -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 [widths, setWidths] = (0, react_1.useState)(columns.map(e => (0, util_1.measureGridWidth)(rows.map(r => r[e.field]))));
39
- return rows.length ? (react_1.default.createElement("div", { ref: ref },
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("div", { ref: ref },
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 [widths, setWidths] = (0, react_1.useState)(keys.map(e => (0, util_1.measureGridWidth)(rows.map(r => r[e]))));
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("div", { ref: ref },
93
- react_1.default.createElement(ResizeBar_1.default, { widths: widths, setWidths: setWidths, scrollLeft: scrollLeft }),
94
- 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: {
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;
@@ -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 [widths, setWidths] = useState(columns.map(e => measureGridWidth(rows.map(r => r[e.field]))));
11
- return rows.length ? (React.createElement("div", { ref: ref },
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("div", { ref: ref },
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 [widths, setWidths] = useState(keys.map(e => measureGridWidth(rows.map(r => r[e]))));
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("div", { ref: ref },
65
- React.createElement(ResizeBar, { widths: widths, setWidths: setWidths, scrollLeft: scrollLeft }),
66
- 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: {
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-variants",
3
- "version": "2.11.1",
3
+ "version": "2.11.2",
4
4
  "description": "JBrowse 2 variant adapters, tracks, etc.",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -63,5 +63,5 @@
63
63
  "distModule": "esm/index.js",
64
64
  "srcModule": "src/index.ts",
65
65
  "module": "esm/index.js",
66
- "gitHead": "11b28d66d782eb06f92ccb993108bb6c3c82819e"
66
+ "gitHead": "511048cb6965f0bf624c96de244e7fd47fce17d6"
67
67
  }