@jbrowse/plugin-dotplot-view 2.18.0 → 3.0.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.
Files changed (111) hide show
  1. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +1 -2
  2. package/dist/DotplotDisplay/components/DotplotDisplay.js +6 -11
  3. package/dist/DotplotDisplay/stateModelFactory.d.ts +1 -2
  4. package/dist/DotplotDisplay/stateModelFactory.js +2 -3
  5. package/dist/DotplotRenderer/DotplotRenderer.d.ts +3 -3
  6. package/dist/DotplotRenderer/DotplotRenderer.js +17 -7
  7. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +1 -2
  8. package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
  9. package/dist/DotplotView/components/Axes.d.ts +4 -5
  10. package/dist/DotplotView/components/Axes.js +23 -36
  11. package/dist/DotplotView/components/CursorIcon.d.ts +2 -3
  12. package/dist/DotplotView/components/CursorIcon.js +3 -5
  13. package/dist/DotplotView/components/DotplotControls.d.ts +1 -2
  14. package/dist/DotplotView/components/DotplotControls.js +89 -91
  15. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +1 -2
  16. package/dist/DotplotView/components/DotplotTooltipClick.js +2 -6
  17. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -2
  18. package/dist/DotplotView/components/DotplotTooltipMouseover.js +3 -7
  19. package/dist/DotplotView/components/DotplotView.d.ts +1 -2
  20. package/dist/DotplotView/components/DotplotView.js +75 -80
  21. package/dist/DotplotView/components/DotplotWarnings.d.ts +1 -2
  22. package/dist/DotplotView/components/DotplotWarnings.js +26 -20
  23. package/dist/DotplotView/components/ExportSvgDialog.d.ts +1 -2
  24. package/dist/DotplotView/components/ExportSvgDialog.js +31 -64
  25. package/dist/DotplotView/components/Grid.d.ts +2 -3
  26. package/dist/DotplotView/components/Grid.js +17 -28
  27. package/dist/DotplotView/components/Header.d.ts +1 -2
  28. package/dist/DotplotView/components/Header.js +2 -21
  29. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  30. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
  31. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +3 -5
  32. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +12 -38
  33. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  34. package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
  35. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  36. package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
  37. package/dist/DotplotView/components/ImportForm/index.d.ts +2 -3
  38. package/dist/DotplotView/components/ImportForm/index.js +43 -92
  39. package/dist/DotplotView/components/PanButtons.d.ts +1 -2
  40. package/dist/DotplotView/components/PanButtons.js +14 -32
  41. package/dist/DotplotView/components/WarningDialog.d.ts +1 -2
  42. package/dist/DotplotView/components/WarningDialog.js +2 -9
  43. package/dist/DotplotView/index.js +17 -7
  44. package/dist/DotplotView/model.d.ts +6 -4
  45. package/dist/DotplotView/model.js +40 -30
  46. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  47. package/dist/DotplotView/svgcomponents/SVGBackground.js +2 -5
  48. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +2 -16
  49. package/dist/DotplotView/types.d.ts +12 -0
  50. package/dist/DotplotView/types.js +2 -0
  51. package/dist/ServerSideRenderedBlockContent.d.ts +1 -2
  52. package/dist/ServerSideRenderedBlockContent.js +9 -34
  53. package/dist/ServerSideSyntenyRendering.d.ts +1 -2
  54. package/dist/ServerSideSyntenyRendering.js +3 -25
  55. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -2
  56. package/esm/DotplotDisplay/components/DotplotDisplay.js +6 -8
  57. package/esm/DotplotDisplay/stateModelFactory.d.ts +1 -2
  58. package/esm/DotplotDisplay/stateModelFactory.js +2 -3
  59. package/esm/DotplotRenderer/DotplotRenderer.d.ts +3 -3
  60. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -2
  61. package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
  62. package/esm/DotplotView/components/Axes.d.ts +4 -5
  63. package/esm/DotplotView/components/Axes.js +23 -33
  64. package/esm/DotplotView/components/CursorIcon.d.ts +2 -3
  65. package/esm/DotplotView/components/CursorIcon.js +3 -5
  66. package/esm/DotplotView/components/DotplotControls.d.ts +1 -2
  67. package/esm/DotplotView/components/DotplotControls.js +89 -91
  68. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +1 -2
  69. package/esm/DotplotView/components/DotplotTooltipClick.js +2 -6
  70. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -2
  71. package/esm/DotplotView/components/DotplotTooltipMouseover.js +3 -7
  72. package/esm/DotplotView/components/DotplotView.d.ts +1 -2
  73. package/esm/DotplotView/components/DotplotView.js +58 -73
  74. package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -2
  75. package/esm/DotplotView/components/DotplotWarnings.js +9 -13
  76. package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -2
  77. package/esm/DotplotView/components/ExportSvgDialog.js +31 -41
  78. package/esm/DotplotView/components/Grid.d.ts +2 -3
  79. package/esm/DotplotView/components/Grid.js +17 -25
  80. package/esm/DotplotView/components/Header.d.ts +1 -2
  81. package/esm/DotplotView/components/Header.js +2 -21
  82. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  83. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
  84. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +3 -5
  85. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +12 -15
  86. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  87. package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
  88. package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  89. package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
  90. package/esm/DotplotView/components/ImportForm/index.d.ts +2 -3
  91. package/esm/DotplotView/components/ImportForm/index.js +45 -71
  92. package/esm/DotplotView/components/PanButtons.d.ts +1 -2
  93. package/esm/DotplotView/components/PanButtons.js +14 -32
  94. package/esm/DotplotView/components/WarningDialog.d.ts +1 -2
  95. package/esm/DotplotView/components/WarningDialog.js +2 -6
  96. package/esm/DotplotView/model.d.ts +6 -4
  97. package/esm/DotplotView/model.js +25 -25
  98. package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  99. package/esm/DotplotView/svgcomponents/SVGBackground.js +2 -2
  100. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +2 -16
  101. package/esm/DotplotView/types.d.ts +12 -0
  102. package/esm/DotplotView/types.js +1 -0
  103. package/esm/ServerSideRenderedBlockContent.d.ts +1 -2
  104. package/esm/ServerSideRenderedBlockContent.js +9 -11
  105. package/esm/ServerSideSyntenyRendering.d.ts +1 -2
  106. package/esm/ServerSideSyntenyRendering.js +3 -2
  107. package/package.json +2 -2
  108. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  109. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
  110. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  111. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
@@ -1,12 +1,12 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
2
3
  import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
3
4
  import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
4
- import { Button, Container, FormControl, FormControlLabel, FormLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
5
- import { transaction } from 'mobx';
5
+ import { Button, Container, FormControl, Grid2, Paper, Typography, } from '@mui/material';
6
+ import { toJS, transaction } from 'mobx';
6
7
  import { observer } from 'mobx-react';
7
8
  import { makeStyles } from 'tss-react/mui';
8
- import ImportCustomTrack from './ImportCustomTrack';
9
- import ImportSyntenyTrackSelector from './ImportSyntenyTrackSelector';
9
+ import TrackSelector from './TrackSelector';
10
10
  const useStyles = makeStyles()(theme => ({
11
11
  importFormContainer: {
12
12
  padding: theme.spacing(4),
@@ -17,81 +17,55 @@ const useStyles = makeStyles()(theme => ({
17
17
  margin: '0 auto',
18
18
  },
19
19
  }));
20
- function TrackSelector({ setSessionTrackData, setShowTrackId, sessionTrackData, assembly1, assembly2, model, }) {
21
- const [choice, setChoice] = useState('tracklist');
22
- useEffect(() => {
23
- if (choice === 'none') {
24
- setSessionTrackData(undefined);
25
- setShowTrackId(undefined);
20
+ function doSubmit({ model, assembly1, assembly2, }) {
21
+ const session = getSession(model);
22
+ const { importFormSyntenyTrackSelections } = model;
23
+ model.setError(undefined);
24
+ transaction(() => {
25
+ if (isSessionWithAddTracks(session)) {
26
+ toJS(importFormSyntenyTrackSelections).map((f, idx) => {
27
+ var _a;
28
+ if (f.type === 'userOpened') {
29
+ session.addTrackConf(f.value);
30
+ model.toggleTrack((_a = f.value) === null || _a === void 0 ? void 0 : _a.trackId);
31
+ }
32
+ else if (f.type === 'preConfigured') {
33
+ model.showTrack(f.value, idx);
34
+ }
35
+ });
26
36
  }
27
- }, [choice, setSessionTrackData, setShowTrackId]);
28
- return (React.createElement(React.Fragment, null,
29
- React.createElement(FormControl, null,
30
- React.createElement(FormLabel, { id: "group-label" }, "(Optional) Select or add a synteny track"),
31
- React.createElement(RadioGroup, { row: true, value: choice, onChange: event => {
32
- setChoice(event.target.value);
33
- }, "aria-labelledby": "group-label" },
34
- React.createElement(FormControlLabel, { value: "none", control: React.createElement(Radio, null), label: "None" }),
35
- React.createElement(FormControlLabel, { value: "tracklist", control: React.createElement(Radio, null), label: "Existing track" }),
36
- React.createElement(FormControlLabel, { value: "custom", control: React.createElement(Radio, null), label: "New track" }))),
37
- choice === 'custom' ? (React.createElement(ImportCustomTrack, { setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, assembly2: assembly2, assembly1: assembly1 })) : null,
38
- choice === 'tracklist' ? (React.createElement(ImportSyntenyTrackSelector, { model: model, assembly1: assembly1, assembly2: assembly2, setShowTrackId: setShowTrackId })) : null));
37
+ model.showAllRegions();
38
+ model.setAssemblyNames(assembly2, assembly1);
39
+ });
39
40
  }
40
- const DotplotImportForm = observer(({ model }) => {
41
+ const DotplotImportForm = observer(function ({ model, }) {
41
42
  const { classes } = useStyles();
42
43
  const session = getSession(model);
43
44
  const { assemblyNames } = session;
44
45
  const [assembly2, setAssembly2] = useState(assemblyNames[0] || '');
45
46
  const [assembly1, setAssembly1] = useState(assemblyNames[0] || '');
46
47
  const [error, setError] = useState();
47
- const [sessionTrackData, setSessionTrackData] = useState();
48
- const [showTrackId, setShowTrackId] = useState();
49
- function onOpenClick() {
50
- try {
51
- if (!isSessionWithAddTracks(session)) {
52
- return;
53
- }
54
- setError(undefined);
55
- model.setError(undefined);
56
- transaction(() => {
57
- if (sessionTrackData) {
58
- session.addTrackConf(sessionTrackData);
59
- model.toggleTrack(sessionTrackData.trackId);
60
- }
61
- else if (showTrackId) {
62
- model.showTrack(showTrackId);
63
- }
64
- model.setViews([
65
- { bpPerPx: 0.1, offsetPx: 0 },
66
- { bpPerPx: 0.1, offsetPx: 0 },
67
- ]);
68
- model.setAssemblyNames(assembly2, assembly1);
69
- });
70
- }
71
- catch (e) {
72
- console.error(e);
73
- setError(e);
74
- }
75
- }
76
48
  const displayError = error || model.error;
77
- return (React.createElement(Container, { className: classes.importFormContainer },
78
- displayError ? React.createElement(ErrorMessage, { error: displayError }) : null,
79
- React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", className: classes.assemblySelector },
80
- React.createElement(Grid, { item: true },
81
- React.createElement(Paper, { style: { padding: 12 } },
82
- React.createElement(Typography, { style: { textAlign: 'center' } }, "Select assemblies for dotplot view"),
83
- React.createElement(Grid, { container: true, spacing: 1, justifyContent: "center", alignItems: "center" },
84
- React.createElement(Grid, { item: true },
85
- React.createElement(AssemblySelector, { selected: assembly1, onChange: val => {
86
- setAssembly1(val);
87
- }, session: session })),
88
- React.createElement(Grid, { item: true },
89
- React.createElement(AssemblySelector, { selected: assembly2, 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(Grid2, { container: true, spacing: 1, justifyContent: "center", alignItems: "center", children: [_jsx(AssemblySelector, { helperText: "x-axis assembly", selected: assembly2, session: session, onChange: val => {
90
50
  setAssembly2(val);
91
- }, session: session })),
92
- React.createElement(Grid, { item: true },
93
- React.createElement(FormControl, null,
94
- React.createElement(Button, { onClick: onOpenClick, variant: "contained", color: "primary" }, "Launch"))))),
95
- React.createElement(TrackSelector, { setShowTrackId: setShowTrackId, assembly2: assembly2, assembly1: assembly1, setSessionTrackData: setSessionTrackData, sessionTrackData: sessionTrackData, model: model })))));
51
+ } }), _jsx(AssemblySelector, { helperText: "y-axis assembly", selected: assembly1, session: session, onChange: val => {
52
+ setAssembly1(val);
53
+ } }), _jsx(FormControl, { children: _jsx(Button, { onClick: () => {
54
+ ;
55
+ (async () => {
56
+ try {
57
+ setError(undefined);
58
+ doSubmit({
59
+ assembly1,
60
+ assembly2,
61
+ model,
62
+ });
63
+ }
64
+ catch (e) {
65
+ console.error(e);
66
+ setError(e);
67
+ }
68
+ })();
69
+ }, variant: "contained", color: "primary", children: "Launch" }) })] }), _jsx(TrackSelector, { assembly2: assembly2, assembly1: assembly1, model: model })] })] }));
96
70
  });
97
71
  export default DotplotImportForm;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
1
  import type { DotplotViewModel } from '../model';
3
2
  declare const PanButtons: ({ model, }: {
4
3
  model: DotplotViewModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default PanButtons;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import ArrowDropDown from '@mui/icons-material/ArrowDropDown';
3
3
  import ArrowDropUp from '@mui/icons-material/ArrowDropUp';
4
4
  import ArrowLeft from '@mui/icons-material/ArrowLeft';
@@ -25,36 +25,18 @@ const useStyles = makeStyles()({
25
25
  });
26
26
  const PanButtons = observer(function PanButtons({ model, }) {
27
27
  const { classes } = useStyles();
28
- return (React.createElement(Paper, { className: classes.dpad, elevation: 6 },
29
- React.createElement("div", null),
30
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
31
- model.vview.scroll(100);
32
- } },
33
- React.createElement(ArrowDropUp, null)),
34
- React.createElement("div", null),
35
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
36
- model.hview.scroll(-100);
37
- } },
38
- React.createElement(ArrowLeft, null)),
39
- React.createElement("div", null),
40
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
41
- model.hview.scroll(100);
42
- } },
43
- React.createElement(ArrowRight, null)),
44
- React.createElement("div", null),
45
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
46
- model.vview.scroll(-100);
47
- } },
48
- React.createElement(ArrowDropDown, null)),
49
- React.createElement("div", null),
50
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
51
- model.zoomIn();
52
- } },
53
- React.createElement(ZoomIn, null)),
54
- React.createElement("div", null),
55
- React.createElement(IconButton, { className: classes.icon, onClick: () => {
56
- model.zoomOut();
57
- } },
58
- React.createElement(ZoomOut, null))));
28
+ return (_jsxs(Paper, { className: classes.dpad, elevation: 6, children: [_jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
29
+ model.vview.scroll(100);
30
+ }, children: _jsx(ArrowDropUp, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
31
+ model.hview.scroll(-100);
32
+ }, children: _jsx(ArrowLeft, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
33
+ model.hview.scroll(100);
34
+ }, children: _jsx(ArrowRight, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
35
+ model.vview.scroll(-100);
36
+ }, children: _jsx(ArrowDropDown, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
37
+ model.zoomIn();
38
+ }, children: _jsx(ZoomIn, {}) }), _jsx("div", {}), _jsx(IconButton, { className: classes.icon, onClick: () => {
39
+ model.zoomOut();
40
+ }, children: _jsx(ZoomOut, {}) })] }));
59
41
  });
60
42
  export default PanButtons;
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
2
  interface Warning {
4
3
  message: string;
@@ -13,5 +12,5 @@ interface TrackWarning {
13
12
  declare const WarningDialog: ({ trackWarnings, handleClose, }: {
14
13
  handleClose: () => void;
15
14
  trackWarnings: TrackWarning[];
16
- }) => React.JSX.Element;
15
+ }) => import("react/jsx-runtime").JSX.Element;
17
16
  export default WarningDialog;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import { Dialog } from '@jbrowse/core/ui';
4
4
  import { measureGridWidth } from '@jbrowse/core/util';
@@ -32,10 +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 (React.createElement(Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings" },
36
- React.createElement(DialogContent, { className: classes.content },
37
- React.createElement(DialogContentText, null, "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."),
38
- React.createElement("div", { style: { height: 600, width: '100%', overflow: 'auto' } },
39
- React.createElement(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, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true }) })] }) }));
40
36
  });
41
37
  export default WarningDialog;
@@ -1,5 +1,6 @@
1
1
  import type React from 'react';
2
2
  import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
3
+ import type { ImportFormSyntenyTrack } from './types';
3
4
  import type PluginManager from '@jbrowse/core/PluginManager';
4
5
  import type { Base1DViewModel } from '@jbrowse/core/util/Base1DViewModel';
5
6
  import type { Instance, SnapshotIn } from 'mobx-state-tree';
@@ -214,6 +215,11 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
214
215
  wheelMode: string;
215
216
  borderX: number;
216
217
  borderY: number;
218
+ importFormSyntenyTrackSelections: import("mobx").IObservableArray<ImportFormSyntenyTrack>;
219
+ } & {
220
+ importFormRemoveRow(idx: number): void;
221
+ clearImportFormSyntenyTracks(): void;
222
+ setImportFormSyntenyTrack(arg: number, val: ImportFormSyntenyTrack): void;
217
223
  } & {
218
224
  readonly width: number;
219
225
  } & {
@@ -410,14 +416,10 @@ export default function stateModelFactory(pm: PluginManager): import("mobx-state
410
416
  } & {
411
417
  menuItems(): ({
412
418
  label: string;
413
- onClick: () => void;
414
419
  icon: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
415
420
  muiName: string;
416
421
  };
417
- } | {
418
- label: string;
419
422
  onClick: () => void;
420
- icon?: undefined;
421
423
  } | {
422
424
  label: string;
423
425
  onClick: () => import("@jbrowse/core/util").Widget;
@@ -2,13 +2,13 @@ import { lazy } from 'react';
2
2
  import { getConf } from '@jbrowse/core/configuration';
3
3
  import BaseViewModel from '@jbrowse/core/pluggableElementTypes/models/BaseViewModel';
4
4
  import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
5
- import { getSession, getTickDisplayStr, isSessionModelWithWidgets, localStorageGetItem, max, measureText, minmax, } from '@jbrowse/core/util';
5
+ import { getSession, getTickDisplayStr, isSessionModelWithWidgets, localStorageGetBoolean, localStorageGetItem, max, measureText, minmax, } from '@jbrowse/core/util';
6
6
  import { getParentRenderProps } from '@jbrowse/core/util/tracks';
7
7
  import { ElementId } from '@jbrowse/core/util/types/mst';
8
8
  import FolderOpenIcon from '@mui/icons-material/FolderOpen';
9
9
  import PhotoCameraIcon from '@mui/icons-material/PhotoCamera';
10
10
  import { saveAs } from 'file-saver';
11
- import { autorun, transaction } from 'mobx';
11
+ import { autorun, observable, transaction } from 'mobx';
12
12
  import { addDisposer, cast, getParent, getRoot, getSnapshot, resolveIdentifier, types, } from 'mobx-state-tree';
13
13
  import { Dotplot1DView, DotplotHView, DotplotVView } from './1dview';
14
14
  import { getBlockLabelKeysToHide, makeTicks } from './components/util';
@@ -48,10 +48,22 @@ export default function stateModelFactory(pm) {
48
48
  volatileWidth: undefined,
49
49
  volatileError: undefined,
50
50
  cursorMode: localStorageGetItem('dotplot-cursorMode') || 'crosshair',
51
- showPanButtons: Boolean(JSON.parse(localStorageGetItem('dotplot-showPanbuttons') || 'true')),
51
+ showPanButtons: localStorageGetBoolean('dotplot-showPanbuttons', true),
52
52
  wheelMode: localStorageGetItem('dotplot-wheelMode') || 'zoom',
53
53
  borderX: 100,
54
54
  borderY: 100,
55
+ importFormSyntenyTrackSelections: observable.array(),
56
+ }))
57
+ .actions(self => ({
58
+ importFormRemoveRow(idx) {
59
+ self.importFormSyntenyTrackSelections.splice(idx, 1);
60
+ },
61
+ clearImportFormSyntenyTracks() {
62
+ self.importFormSyntenyTrackSelections.clear();
63
+ },
64
+ setImportFormSyntenyTrack(arg, val) {
65
+ self.importFormSyntenyTrackSelections[arg] = val;
66
+ },
55
67
  }))
56
68
  .views(self => ({
57
69
  get width() {
@@ -309,7 +321,7 @@ export default function stateModelFactory(pm) {
309
321
  beforeDestroy() {
310
322
  var _a;
311
323
  const session = getSession(self);
312
- for (const name in self.assemblyNames) {
324
+ for (const name of self.assemblyNames) {
313
325
  (_a = session.removeTemporaryAssembly) === null || _a === void 0 ? void 0 : _a.call(session, name);
314
326
  }
315
327
  },
@@ -389,31 +401,16 @@ export default function stateModelFactory(pm) {
389
401
  return [
390
402
  {
391
403
  label: 'Return to import form',
404
+ icon: FolderOpenIcon,
392
405
  onClick: () => {
393
406
  getSession(self).queueDialog(handleClose => [
394
407
  ReturnToImportFormDialog,
395
- { model: self, handleClose },
408
+ {
409
+ model: self,
410
+ handleClose,
411
+ },
396
412
  ]);
397
413
  },
398
- icon: FolderOpenIcon,
399
- },
400
- {
401
- label: 'Square view - same bp per pixel',
402
- onClick: () => {
403
- self.squareView();
404
- },
405
- },
406
- {
407
- label: 'Rectangular view - same total bp',
408
- onClick: () => {
409
- self.squareView();
410
- },
411
- },
412
- {
413
- label: 'Show all regions',
414
- onClick: () => {
415
- self.showAllRegions();
416
- },
417
414
  },
418
415
  {
419
416
  label: 'Export SVG',
@@ -421,7 +418,10 @@ export default function stateModelFactory(pm) {
421
418
  onClick: () => {
422
419
  getSession(self).queueDialog(handleClose => [
423
420
  ExportSvgDialog,
424
- { model: self, handleClose },
421
+ {
422
+ model: self,
423
+ handleClose,
424
+ },
425
425
  ]);
426
426
  },
427
427
  },
@@ -1,5 +1,4 @@
1
- import React from 'react';
2
1
  export default function SVGBackground({ width, height, }: {
3
2
  width: number;
4
3
  height: number;
5
- }): React.JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import React from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { stripAlpha } from '@jbrowse/core/util';
3
3
  import { useTheme } from '@mui/material';
4
4
  export default function SVGBackground({ width, height, }) {
5
5
  const theme = useTheme();
6
- return (React.createElement("rect", { x: 0, y: 0, width: width, height: height, fill: stripAlpha(theme.palette.background.default) }));
6
+ return (_jsx("rect", { x: 0, y: 0, width: width, height: height, fill: stripAlpha(theme.palette.background.default) }));
7
7
  }
@@ -1,9 +1,8 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { createJBrowseTheme } from '@jbrowse/core/ui';
3
3
  import { getSession, renderToStaticMarkup } from '@jbrowse/core/util';
4
4
  import { ThemeProvider } from '@mui/material';
5
5
  import { when } from 'mobx';
6
- import { getRoot } from 'mobx-state-tree';
7
6
  import SVGBackground from './SVGBackground';
8
7
  import { HorizontalAxisRaw, VerticalAxisRaw } from '../components/Axes';
9
8
  import { GridRaw } from '../components/Grid';
@@ -11,7 +10,6 @@ export async function renderToSvg(model, opts) {
11
10
  var _a;
12
11
  await when(() => model.initialized);
13
12
  const { themeName = 'default', Wrapper = ({ children }) => children } = opts;
14
- const { createRootFn } = getRoot(model);
15
13
  const session = getSession(model);
16
14
  const theme = (_a = session.allThemes) === null || _a === void 0 ? void 0 : _a.call(session)[themeName];
17
15
  const { width, borderX, viewWidth, viewHeight, tracks, height } = model;
@@ -22,17 +20,5 @@ export async function renderToSvg(model, opts) {
22
20
  return { track, result: await display.renderSvg({ ...opts, theme }) };
23
21
  }));
24
22
  const w = width + shift * 2;
25
- return renderToStaticMarkup(React.createElement(ThemeProvider, { theme: createJBrowseTheme(theme) },
26
- React.createElement(Wrapper, null,
27
- React.createElement("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString() },
28
- React.createElement(SVGBackground, { width: w, height: height }),
29
- React.createElement(VerticalAxisRaw, { model: model }),
30
- React.createElement("g", { transform: `translate(${borderX} 0)` },
31
- React.createElement(GridRaw, { model: model }),
32
- React.createElement("defs", null,
33
- React.createElement("clipPath", { id: "clip-ruler" },
34
- React.createElement("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }))),
35
- React.createElement("g", { clipPath: "url(#clip-ruler)" }, displayResults.map(({ result }, i) => (React.createElement("g", { key: i }, result))))),
36
- React.createElement("g", { transform: `translate(${borderX} ${viewHeight})` },
37
- React.createElement(HorizontalAxisRaw, { model: model }))))), createRootFn);
23
+ return renderToStaticMarkup(_jsx(ThemeProvider, { theme: createJBrowseTheme(theme), children: _jsx(Wrapper, { children: _jsxs("svg", { width: width, height: height, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w, height].toString(), children: [_jsx(SVGBackground, { width: w, height: height }), _jsx(VerticalAxisRaw, { model: model }), _jsxs("g", { transform: `translate(${borderX} 0)`, children: [_jsx(GridRaw, { model: model }), _jsx("defs", { children: _jsx("clipPath", { id: "clip-ruler", children: _jsx("rect", { x: 0, y: 0, width: viewWidth, height: viewHeight }) }) }), _jsx("g", { clipPath: "url(#clip-ruler)", children: displayResults.map(({ result }, i) => (_jsx("g", { children: result }, i))) })] }), _jsx("g", { transform: `translate(${borderX} ${viewHeight})`, children: _jsx(HorizontalAxisRaw, { model: model }) })] }) }) }));
38
24
  }
@@ -0,0 +1,12 @@
1
+ import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
+ import type { SnapshotIn } from 'mobx-state-tree';
3
+ export type Conf = SnapshotIn<AnyConfigurationModel>;
4
+ export type ImportFormSyntenyTrack = {
5
+ type: 'preConfigured';
6
+ value: string;
7
+ } | {
8
+ type: 'userOpened';
9
+ value: Conf;
10
+ } | {
11
+ type: 'none';
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,5 +1,4 @@
1
1
  import type { CSSProperties } from 'react';
2
- import React from 'react';
3
2
  declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
4
3
  model: {
5
4
  error?: unknown;
@@ -9,5 +8,5 @@ declare const ServerSideRenderedDotplotContent: ({ model, style, }: {
9
8
  reactElement?: React.ReactElement;
10
9
  };
11
10
  style: CSSProperties;
12
- }) => React.JSX.Element | null;
11
+ }) => import("react/jsx-runtime").JSX.Element | null;
13
12
  export default ServerSideRenderedDotplotContent;
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
2
3
  import { LoadingEllipses } from '@jbrowse/core/ui';
3
4
  import { Typography } from '@mui/material';
4
5
  import { observer } from 'mobx-react';
@@ -34,31 +35,28 @@ function LoadingMessage() {
34
35
  clearTimeout(timeout);
35
36
  };
36
37
  }, []);
37
- return shown ? (React.createElement("div", { className: classes.loading },
38
- React.createElement(LoadingEllipses, null))) : null;
38
+ return shown ? (_jsx("div", { className: classes.loading, children: _jsx(LoadingEllipses, {}) })) : null;
39
39
  }
40
40
  function BlockMessage({ messageText }) {
41
41
  const { classes } = useStyles();
42
- return (React.createElement("div", { className: classes.blockMessage },
43
- React.createElement(Typography, null, messageText)));
42
+ return (_jsx("div", { className: classes.blockMessage, children: _jsx(Typography, { children: messageText }) }));
44
43
  }
45
44
  function BlockError({ error }) {
46
45
  const { classes } = useStyles();
47
- return (React.createElement("div", { className: classes.blockError },
48
- React.createElement(Typography, null, `${error}`)));
46
+ return (_jsx("div", { className: classes.blockError, children: _jsx(Typography, { children: `${error}` }) }));
49
47
  }
50
48
  const ServerSideRenderedDotplotContent = observer(function ({ model, style, }) {
51
49
  if (model.error) {
52
- return React.createElement(BlockError, { error: model.error, "data-testid": "reload_button" });
50
+ return _jsx(BlockError, { error: model.error, "data-testid": "reload_button" });
53
51
  }
54
52
  else if (model.message) {
55
- return React.createElement(BlockMessage, { messageText: model.message });
53
+ return _jsx(BlockMessage, { messageText: model.message });
56
54
  }
57
55
  else if (!model.filled) {
58
- return React.createElement(LoadingMessage, null);
56
+ return _jsx(LoadingMessage, {});
59
57
  }
60
58
  else if (model.shouldDisplay) {
61
- return React.createElement("div", { style: style }, model.reactElement);
59
+ return _jsx("div", { style: style, children: model.reactElement });
62
60
  }
63
61
  return null;
64
62
  });
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  interface ModelType {
3
2
  imageData: string;
4
3
  style: Record<string, string>;
@@ -10,5 +9,5 @@ interface ModelType {
10
9
  }
11
10
  declare const ServerSideSyntenyRendering: ({ model, }: {
12
11
  model: ModelType;
13
- }) => React.JSX.Element;
12
+ }) => import("react/jsx-runtime").JSX.Element;
14
13
  export default ServerSideSyntenyRendering;
@@ -1,4 +1,5 @@
1
- import React, { useEffect, useRef, useState } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
2
3
  import { drawImageOntoCanvasContext } from '@jbrowse/core/util/offscreenCanvasPonyfill';
3
4
  import { observer } from 'mobx-react';
4
5
  const ServerSideSyntenyRendering = observer(function ({ model, }) {
@@ -15,6 +16,6 @@ const ServerSideSyntenyRendering = observer(function ({ model, }) {
15
16
  drawImageOntoCanvasContext(imageData, context);
16
17
  setDone(true);
17
18
  }, [imageData]);
18
- return (React.createElement("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
19
+ return (_jsx("canvas", { "data-testid": `prerendered_canvas${done ? '_done' : ''}`, ref: featureCanvas, width: width * highResolutionScaling, height: height * highResolutionScaling, style: { width, height, ...style } }));
19
20
  });
20
21
  export default ServerSideSyntenyRendering;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-dotplot-view",
3
- "version": "2.18.0",
3
+ "version": "3.0.0",
4
4
  "description": "JBrowse 2 dotplot view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "c344ea60099cb7e460b77f15808946b24a7eee74"
62
+ "gitHead": "2c6897f1fa732b1db5b094d1dca197e333e95319"
63
63
  }
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
3
- import type { SnapshotIn } from 'mobx-state-tree';
4
- type Conf = SnapshotIn<AnyConfigurationModel>;
5
- declare const ImportCustomTrack: ({ assembly1, assembly2, setSessionTrackData, }: {
6
- sessionTrackData: Conf;
7
- assembly1: string;
8
- assembly2: string;
9
- setSessionTrackData: (arg: Conf) => void;
10
- }) => React.JSX.Element;
11
- export default ImportCustomTrack;