@jbrowse/plugin-dotplot-view 3.1.0 → 3.3.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.
@@ -35,6 +35,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
35
35
  offsetY: number;
36
36
  bpPerPxX: number;
37
37
  bpPerPxY: number;
38
+ warnings: {
39
+ message: string;
40
+ effect: string;
41
+ }[];
38
42
  canvasRecordedData: any;
39
43
  reactElement?: React.ReactElement;
40
44
  html?: string;
@@ -45,6 +49,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
45
49
  offsetY: number;
46
50
  bpPerPxX: number;
47
51
  bpPerPxY: number;
52
+ warnings: {
53
+ message: string;
54
+ effect: string;
55
+ }[];
48
56
  reactElement: import("react/jsx-runtime").JSX.Element;
49
57
  html?: string;
50
58
  } | {
@@ -54,6 +62,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
54
62
  offsetY: number;
55
63
  bpPerPxX: number;
56
64
  bpPerPxY: number;
65
+ warnings: {
66
+ message: string;
67
+ effect: string;
68
+ }[];
57
69
  imageData: any;
58
70
  reactElement?: React.ReactElement;
59
71
  html?: string;
@@ -72,7 +72,7 @@ const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ mode
72
72
  };
73
73
  return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [error ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error }) : null, (0, jsx_runtime_1.jsx)(material_1.Typography, { style: { textAlign: 'center' }, children: "Add a .paf (minimap2), .delta (Mummer), .chain (UCSC liftover), .anchors or .anchors.simple (MCScan), or .pif.gz (jbrowse CLI make-pif) file to view. These file types can also be gzipped." }), (0, jsx_runtime_1.jsx)(material_1.RadioGroup, { value: radioOption, onChange: event => {
74
74
  setValue(event.target.value);
75
- }, children: (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "center", children: [
75
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "center", children: [
76
76
  '.paf',
77
77
  '.delta',
78
78
  '.out',
@@ -80,7 +80,7 @@ const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ mode
80
80
  '.anchors',
81
81
  '.anchors.simple',
82
82
  '.pif.gz',
83
- ].map(extension => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: extension, control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: extension }, extension))) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
83
+ ].map(extension => ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { value: extension, control: (0, jsx_runtime_1.jsx)(material_1.Radio, {}), label: extension }, extension))) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
84
84
  radioOption === '.out' ||
85
85
  radioOption === '.delta' ||
86
86
  radioOption === '.chain' ||
@@ -51,7 +51,7 @@ const DotplotImportForm = (0, mobx_react_1.observer)(function ({ model, }) {
51
51
  const [assembly1, setAssembly1] = (0, react_1.useState)(assemblyNames[0] || '');
52
52
  const [error, setError] = (0, react_1.useState)();
53
53
  const displayError = error || model.error;
54
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, { className: classes.importFormContainer, children: [displayError ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: displayError }) : null, (0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { style: { textAlign: 'center' }, children: "Select assemblies for dotplot view" }), (0, jsx_runtime_1.jsxs)(material_1.Grid2, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(ui_1.AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
54
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { className: classes.importFormContainer, children: [displayError ? (0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: displayError }) : null, (0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { style: { textAlign: 'center' }, children: "Select assemblies for dotplot view" }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(ui_1.AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
55
55
  setAssembly2(val);
56
56
  } }), (0, jsx_runtime_1.jsx)(ui_1.AssemblySelector, { helperText: "y-axis assembly", selected: assembly1, session: session, onChange: val => {
57
57
  setAssembly1(val);
@@ -15,8 +15,8 @@ const useStyles = (0, mui_1.makeStyles)()({
15
15
  });
16
16
  function getTrackWarnings({ trackWarnings, }) {
17
17
  const rows = [];
18
- for (let i = 0; i < trackWarnings.length; i++) {
19
- const track = trackWarnings[i];
18
+ for (const [i, trackWarning] of trackWarnings.entries()) {
19
+ const track = trackWarning;
20
20
  const name = (0, configuration_1.getConf)(track, 'name');
21
21
  const d = track.displays[0];
22
22
  for (let j = 0; j < d.warnings.length; j++) {
@@ -34,6 +34,6 @@ const WarningDialog = (0, mobx_react_1.observer)(function WarningDialog({ trackW
34
34
  { field: 'message', width: (0, util_1.measureGridWidth)(rows.map(r => r.message)) },
35
35
  { field: 'effect', width: (0, util_1.measureGridWidth)(rows.map(r => r.effect)) },
36
36
  ];
37
- return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.content, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), (0, jsx_runtime_1.jsx)("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true }) })] }) }));
37
+ return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.content, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), (0, jsx_runtime_1.jsx)("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: rows, columns: columns, rowHeight: 25, disableColumnMenu: true }) })] }) }));
38
38
  });
39
39
  exports.default = WarningDialog;
@@ -246,11 +246,13 @@ function stateModelFactory(pm) {
246
246
  hideTrack(trackId) {
247
247
  const schema = pm.pluggableConfigSchemaType('track');
248
248
  const conf = (0, mobx_state_tree_1.resolveIdentifier)(schema, (0, mobx_state_tree_1.getRoot)(self), trackId);
249
- const t = self.tracks.filter(t => t.configuration === conf);
249
+ const tracks = self.tracks.filter(t => t.configuration === conf);
250
250
  (0, mobx_1.transaction)(() => {
251
- t.forEach(t => self.tracks.remove(t));
251
+ for (const track of tracks) {
252
+ self.tracks.remove(track);
253
+ }
252
254
  });
253
- return t.length;
255
+ return tracks.length;
254
256
  },
255
257
  toggleTrack(trackId) {
256
258
  const hiddenCount = this.hideTrack(trackId);
@@ -387,11 +389,11 @@ function stateModelFactory(pm) {
387
389
  }
388
390
  const views = [self.hview, self.vview];
389
391
  (0, mobx_1.transaction)(() => {
390
- self.assemblyNames.forEach((name, index) => {
392
+ for (const [index, name] of self.assemblyNames.entries()) {
391
393
  const assembly = session.assemblyManager.get(name);
392
394
  const view = views[index];
393
395
  view.setDisplayedRegions((assembly === null || assembly === void 0 ? void 0 : assembly.regions) || []);
394
- });
396
+ }
395
397
  self.showAllRegions();
396
398
  });
397
399
  }, { delay: 1000 }));
@@ -15,9 +15,9 @@ function LaunchDotplotView(pluginManager) {
15
15
  model.setAssemblyNames(assemblyNames[0], assemblyNames[1]);
16
16
  });
17
17
  const idsNotFound = [];
18
- tracks.forEach(track => {
18
+ for (const track of tracks) {
19
19
  tryTrack(model, track, idsNotFound);
20
- });
20
+ }
21
21
  if (idsNotFound.length) {
22
22
  throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
23
23
  }
@@ -35,6 +35,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
35
35
  offsetY: number;
36
36
  bpPerPxX: number;
37
37
  bpPerPxY: number;
38
+ warnings: {
39
+ message: string;
40
+ effect: string;
41
+ }[];
38
42
  canvasRecordedData: any;
39
43
  reactElement?: React.ReactElement;
40
44
  html?: string;
@@ -45,6 +49,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
45
49
  offsetY: number;
46
50
  bpPerPxX: number;
47
51
  bpPerPxY: number;
52
+ warnings: {
53
+ message: string;
54
+ effect: string;
55
+ }[];
48
56
  reactElement: import("react/jsx-runtime").JSX.Element;
49
57
  html?: string;
50
58
  } | {
@@ -54,6 +62,10 @@ export default class DotplotRenderer extends ComparativeRenderer {
54
62
  offsetY: number;
55
63
  bpPerPxX: number;
56
64
  bpPerPxY: number;
65
+ warnings: {
66
+ message: string;
67
+ effect: string;
68
+ }[];
57
69
  imageData: any;
58
70
  reactElement?: React.ReactElement;
59
71
  html?: string;
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
3
  import { ErrorMessage, FileSelector } from '@jbrowse/core/ui';
4
4
  import HelpIcon from '@mui/icons-material/Help';
5
- import { Button, FormControlLabel, Grid2, Paper, Radio, RadioGroup, Tooltip, Typography, } from '@mui/material';
5
+ import { Button, FormControlLabel, Grid, Paper, Radio, RadioGroup, Tooltip, Typography, } from '@mui/material';
6
6
  import { observer } from 'mobx-react';
7
7
  import { getAdapter } from './getAdapter';
8
8
  import { basename, extName, getName, stripGz } from './util';
@@ -67,7 +67,7 @@ const ImportSyntenyOpenCustomTrack = observer(function ({ model, assembly1, asse
67
67
  };
68
68
  return (_jsxs(Paper, { style: { padding: 12 }, children: [error ? _jsx(ErrorMessage, { error: error }) : null, _jsx(Typography, { style: { textAlign: 'center' }, children: "Add a .paf (minimap2), .delta (Mummer), .chain (UCSC liftover), .anchors or .anchors.simple (MCScan), or .pif.gz (jbrowse CLI make-pif) file to view. These file types can also be gzipped." }), _jsx(RadioGroup, { value: radioOption, onChange: event => {
69
69
  setValue(event.target.value);
70
- }, children: _jsx(Grid2, { container: true, justifyContent: "center", children: [
70
+ }, children: _jsx(Grid, { container: true, justifyContent: "center", children: [
71
71
  '.paf',
72
72
  '.delta',
73
73
  '.out',
@@ -75,7 +75,7 @@ const ImportSyntenyOpenCustomTrack = observer(function ({ model, assembly1, asse
75
75
  '.anchors',
76
76
  '.anchors.simple',
77
77
  '.pif.gz',
78
- ].map(extension => (_jsx(FormControlLabel, { value: extension, control: _jsx(Radio, {}), label: extension }, extension))) }) }), _jsx(Grid2, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
78
+ ].map(extension => (_jsx(FormControlLabel, { value: extension, control: _jsx(Radio, {}), label: extension }, extension))) }) }), _jsx(Grid, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
79
79
  radioOption === '.out' ||
80
80
  radioOption === '.delta' ||
81
81
  radioOption === '.chain' ||
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
5
- import { Button, Container, FormControl, Grid2, Paper, Typography, } from '@mui/material';
5
+ import { Button, Container, FormControl, Grid, Paper, Typography, } from '@mui/material';
6
6
  import { toJS, transaction } from 'mobx';
7
7
  import { observer } from 'mobx-react';
8
8
  import { makeStyles } from 'tss-react/mui';
@@ -46,7 +46,7 @@ const DotplotImportForm = observer(function ({ model, }) {
46
46
  const [assembly1, setAssembly1] = useState(assemblyNames[0] || '');
47
47
  const [error, setError] = useState();
48
48
  const displayError = error || model.error;
49
- return (_jsxs(Container, { className: classes.importFormContainer, children: [displayError ? _jsx(ErrorMessage, { error: displayError }) : null, _jsxs(Paper, { style: { padding: 12 }, children: [_jsx(Typography, { style: { textAlign: 'center' }, children: "Select assemblies for dotplot view" }), _jsxs(Grid2, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [_jsx(AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
49
+ return (_jsxs(Container, { className: classes.importFormContainer, children: [displayError ? _jsx(ErrorMessage, { error: displayError }) : null, _jsxs(Paper, { style: { padding: 12 }, children: [_jsx(Typography, { style: { textAlign: 'center' }, children: "Select assemblies for dotplot view" }), _jsxs(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [_jsx(AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
50
50
  setAssembly2(val);
51
51
  } }), _jsx(AssemblySelector, { helperText: "y-axis assembly", selected: assembly1, session: session, onChange: val => {
52
52
  setAssembly1(val);
@@ -13,8 +13,8 @@ const useStyles = makeStyles()({
13
13
  });
14
14
  function getTrackWarnings({ trackWarnings, }) {
15
15
  const rows = [];
16
- for (let i = 0; i < trackWarnings.length; i++) {
17
- const track = trackWarnings[i];
16
+ for (const [i, trackWarning] of trackWarnings.entries()) {
17
+ const track = trackWarning;
18
18
  const name = getConf(track, 'name');
19
19
  const d = track.displays[0];
20
20
  for (let j = 0; j < d.warnings.length; j++) {
@@ -32,6 +32,6 @@ const WarningDialog = observer(function WarningDialog({ trackWarnings, handleClo
32
32
  { field: 'message', width: measureGridWidth(rows.map(r => r.message)) },
33
33
  { field: 'effect', width: measureGridWidth(rows.map(r => r.effect)) },
34
34
  ];
35
- return (_jsx(Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: _jsxs(DialogContent, { className: classes.content, children: [_jsx(DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), _jsx("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: _jsx(DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true }) })] }) }));
35
+ return (_jsx(Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: _jsxs(DialogContent, { className: classes.content, children: [_jsx(DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), _jsx("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: _jsx(DataGrid, { rows: rows, columns: columns, rowHeight: 25, disableColumnMenu: true }) })] }) }));
36
36
  });
37
37
  export default WarningDialog;
@@ -206,11 +206,13 @@ export default function stateModelFactory(pm) {
206
206
  hideTrack(trackId) {
207
207
  const schema = pm.pluggableConfigSchemaType('track');
208
208
  const conf = resolveIdentifier(schema, getRoot(self), trackId);
209
- const t = self.tracks.filter(t => t.configuration === conf);
209
+ const tracks = self.tracks.filter(t => t.configuration === conf);
210
210
  transaction(() => {
211
- t.forEach(t => self.tracks.remove(t));
211
+ for (const track of tracks) {
212
+ self.tracks.remove(track);
213
+ }
212
214
  });
213
- return t.length;
215
+ return tracks.length;
214
216
  },
215
217
  toggleTrack(trackId) {
216
218
  const hiddenCount = this.hideTrack(trackId);
@@ -347,11 +349,11 @@ export default function stateModelFactory(pm) {
347
349
  }
348
350
  const views = [self.hview, self.vview];
349
351
  transaction(() => {
350
- self.assemblyNames.forEach((name, index) => {
352
+ for (const [index, name] of self.assemblyNames.entries()) {
351
353
  const assembly = session.assemblyManager.get(name);
352
354
  const view = views[index];
353
355
  view.setDisplayedRegions((assembly === null || assembly === void 0 ? void 0 : assembly.regions) || []);
354
- });
356
+ }
355
357
  self.showAllRegions();
356
358
  });
357
359
  }, { delay: 1000 }));
@@ -12,9 +12,9 @@ export default function LaunchDotplotView(pluginManager) {
12
12
  model.setAssemblyNames(assemblyNames[0], assemblyNames[1]);
13
13
  });
14
14
  const idsNotFound = [];
15
- tracks.forEach(track => {
15
+ for (const track of tracks) {
16
16
  tryTrack(model, track, idsNotFound);
17
- });
17
+ }
18
18
  if (idsNotFound.length) {
19
19
  throw new Error(`Could not resolve identifiers: ${idsNotFound.join(',')}`);
20
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-dotplot-view",
3
- "version": "3.1.0",
3
+ "version": "3.3.0",
4
4
  "description": "JBrowse 2 dotplot view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -36,11 +36,11 @@
36
36
  "clean": "rimraf dist esm *.tsbuildinfo"
37
37
  },
38
38
  "dependencies": {
39
- "@jbrowse/core": "^3.1.0",
40
- "@jbrowse/plugin-alignments": "^3.1.0",
41
- "@mui/icons-material": "^6.0.0",
42
- "@mui/material": "^6.0.0",
43
- "@mui/x-data-grid": "^7.0.0",
39
+ "@jbrowse/core": "^3.3.0",
40
+ "@jbrowse/plugin-alignments": "^3.3.0",
41
+ "@mui/icons-material": "^7.0.0",
42
+ "@mui/material": "^7.0.0",
43
+ "@mui/x-data-grid": "^8.0.0",
44
44
  "@types/file-saver": "^2.0.1",
45
45
  "file-saver": "^2.0.0",
46
46
  "mobx": "^6.0.0",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "91492049ddea0aed90eb24d3c066c2d9f5a6b189"
62
+ "gitHead": "0bb64d8cc7ecdd167515308b31eec3d9acbc59e4"
63
63
  }