@jbrowse/plugin-linear-comparative-view 3.5.1 → 3.6.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 (69) hide show
  1. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +4 -0
  2. package/dist/LinearComparativeDisplay/stateModelFactory.js +14 -7
  3. package/dist/LinearComparativeView/components/Rubberband.d.ts +2 -2
  4. package/dist/LinearComparativeView/components/Rubberband.js +16 -154
  5. package/dist/LinearComparativeView/components/RubberbandSpan.d.ts +15 -0
  6. package/dist/LinearComparativeView/components/RubberbandSpan.js +38 -0
  7. package/dist/LinearComparativeView/components/RubberbandTooltip.d.ts +5 -0
  8. package/dist/LinearComparativeView/components/RubberbandTooltip.js +20 -0
  9. package/dist/LinearComparativeView/components/useRangeSelect.d.ts +59 -0
  10. package/dist/LinearComparativeView/components/useRangeSelect.js +128 -0
  11. package/dist/LinearComparativeView/components/util.d.ts +4 -0
  12. package/dist/LinearComparativeView/components/util.js +6 -0
  13. package/dist/LinearSyntenyDisplay/components/BlockError.d.ts +3 -0
  14. package/dist/LinearSyntenyDisplay/components/BlockError.js +16 -0
  15. package/dist/LinearSyntenyDisplay/components/BlockMessage.d.ts +3 -0
  16. package/dist/LinearSyntenyDisplay/components/BlockMessage.js +24 -0
  17. package/dist/LinearSyntenyDisplay/components/Component.js +11 -50
  18. package/dist/LinearSyntenyDisplay/components/LoadingMessage.d.ts +3 -0
  19. package/dist/LinearSyntenyDisplay/components/LoadingMessage.js +21 -0
  20. package/dist/LinearSyntenyDisplay/model.d.ts +4 -0
  21. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +2 -51
  22. package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +3 -0
  23. package/dist/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +13 -0
  24. package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +3 -0
  25. package/dist/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +13 -0
  26. package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.d.ts +19 -0
  27. package/dist/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.js +10 -0
  28. package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +3 -0
  29. package/dist/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +20 -0
  30. package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.d.ts +13 -0
  31. package/dist/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +32 -0
  32. package/dist/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +4 -0
  33. package/dist/LinearSyntenyView/components/ImportForm/selectors/index.js +27 -0
  34. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +1 -1
  35. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +4 -0
  36. package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -7
  37. package/esm/LinearComparativeView/components/Rubberband.d.ts +2 -2
  38. package/esm/LinearComparativeView/components/Rubberband.js +17 -155
  39. package/esm/LinearComparativeView/components/RubberbandSpan.d.ts +15 -0
  40. package/esm/LinearComparativeView/components/RubberbandSpan.js +32 -0
  41. package/esm/LinearComparativeView/components/RubberbandTooltip.d.ts +5 -0
  42. package/esm/LinearComparativeView/components/RubberbandTooltip.js +17 -0
  43. package/esm/LinearComparativeView/components/useRangeSelect.d.ts +59 -0
  44. package/esm/LinearComparativeView/components/useRangeSelect.js +125 -0
  45. package/esm/LinearComparativeView/components/util.d.ts +4 -0
  46. package/esm/LinearComparativeView/components/util.js +3 -0
  47. package/esm/LinearSyntenyDisplay/components/BlockError.d.ts +3 -0
  48. package/esm/LinearSyntenyDisplay/components/BlockError.js +13 -0
  49. package/esm/LinearSyntenyDisplay/components/BlockMessage.d.ts +3 -0
  50. package/esm/LinearSyntenyDisplay/components/BlockMessage.js +21 -0
  51. package/esm/LinearSyntenyDisplay/components/Component.js +9 -48
  52. package/esm/LinearSyntenyDisplay/components/LoadingMessage.d.ts +3 -0
  53. package/esm/LinearSyntenyDisplay/components/LoadingMessage.js +18 -0
  54. package/esm/LinearSyntenyDisplay/model.d.ts +4 -0
  55. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +3 -49
  56. package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.d.ts +3 -0
  57. package/esm/LinearSyntenyView/components/ImportForm/selectors/AnchorsSelector.js +8 -0
  58. package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.d.ts +3 -0
  59. package/esm/LinearSyntenyView/components/ImportForm/selectors/PifGzSelector.js +8 -0
  60. package/esm/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.d.ts +19 -0
  61. package/esm/LinearSyntenyView/components/ImportForm/selectors/SelectorTypes.js +7 -0
  62. package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.d.ts +3 -0
  63. package/esm/LinearSyntenyView/components/ImportForm/selectors/StandardFormatSelector.js +15 -0
  64. package/esm/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.d.ts +13 -0
  65. package/esm/LinearSyntenyView/components/ImportForm/selectors/SwapAssemblies.js +27 -0
  66. package/esm/LinearSyntenyView/components/ImportForm/selectors/index.d.ts +4 -0
  67. package/esm/LinearSyntenyView/components/ImportForm/selectors/index.js +4 -0
  68. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +1 -1
  69. package/package.json +5 -5
@@ -4,62 +4,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = require("react");
8
- const ui_1 = require("@jbrowse/core/ui");
9
7
  const mobx_react_1 = require("mobx-react");
10
- const mui_1 = require("tss-react/mui");
8
+ const BlockError_1 = __importDefault(require("./BlockError"));
9
+ const BlockMessage_1 = __importDefault(require("./BlockMessage"));
11
10
  const LinearSyntenyRendering_1 = __importDefault(require("./LinearSyntenyRendering"));
12
- const useStyles = (0, mui_1.makeStyles)()(theme => {
13
- const bg = theme.palette.action.disabledBackground;
14
- return {
15
- loading: {
16
- paddingLeft: '0.6em',
17
- backgroundColor: theme.palette.background.default,
18
- backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
19
- textAlign: 'center',
20
- },
21
- blockMessage: {
22
- background: '#f1f1f1',
23
- padding: 10,
24
- },
25
- blockError: {
26
- background: '#f1f1f1',
27
- padding: 10,
28
- color: 'red',
29
- },
30
- };
31
- });
32
- function LoadingMessage() {
33
- const [shown, setShown] = (0, react_1.useState)(false);
34
- const { classes } = useStyles();
35
- (0, react_1.useEffect)(() => {
36
- const timeout = setTimeout(() => {
37
- setShown(true);
38
- }, 300);
39
- return () => {
40
- clearTimeout(timeout);
41
- };
42
- });
43
- return shown ? ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, {}) })) : null;
44
- }
45
- function BlockMessage({ messageText }) {
46
- const { classes } = useStyles();
47
- return (0, jsx_runtime_1.jsx)("div", { className: classes.blockMessage, children: messageText });
48
- }
49
- function BlockError({ error }) {
50
- const { classes } = useStyles();
51
- return (0, jsx_runtime_1.jsx)("div", { className: classes.blockError, children: `${error}` });
52
- }
11
+ const LoadingMessage_1 = __importDefault(require("./LoadingMessage"));
53
12
  const ServerSideRenderedBlockContent = (0, mobx_react_1.observer)(function ({ model, }) {
54
13
  if (model.error) {
55
- return (0, jsx_runtime_1.jsx)(BlockError, { error: model.error });
14
+ return (0, jsx_runtime_1.jsx)(BlockError_1.default, { error: model.error });
15
+ }
16
+ else if (model.message) {
17
+ return (0, jsx_runtime_1.jsx)(BlockMessage_1.default, { messageText: model.message });
56
18
  }
57
- if (model.message) {
58
- return (0, jsx_runtime_1.jsx)(BlockMessage, { messageText: model.message });
19
+ else if (!model.features) {
20
+ return (0, jsx_runtime_1.jsx)(LoadingMessage_1.default, { message: model.loadingStatus });
59
21
  }
60
- if (!model.features) {
61
- return (0, jsx_runtime_1.jsx)(LoadingMessage, {});
22
+ else {
23
+ return (0, jsx_runtime_1.jsx)(LinearSyntenyRendering_1.default, { model: model });
62
24
  }
63
- return (0, jsx_runtime_1.jsx)(LinearSyntenyRendering_1.default, { model: model });
64
25
  });
65
26
  exports.default = ServerSideRenderedBlockContent;
@@ -0,0 +1,3 @@
1
+ export default function LoadingMessage({ message }: {
2
+ message?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = LoadingMessage;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const ui_1 = require("@jbrowse/core/ui");
6
+ const mui_1 = require("tss-react/mui");
7
+ const useStyles = (0, mui_1.makeStyles)()(theme => {
8
+ const bg = theme.palette.action.disabledBackground;
9
+ return {
10
+ loading: {
11
+ paddingLeft: '0.6em',
12
+ backgroundColor: theme.palette.background.default,
13
+ backgroundImage: `repeating-linear-gradient(45deg, transparent, transparent 5px, ${bg} 5px, ${bg} 10px)`,
14
+ textAlign: 'center',
15
+ },
16
+ };
17
+ });
18
+ function LoadingMessage({ message }) {
19
+ const { classes } = useStyles();
20
+ return ((0, jsx_runtime_1.jsx)("div", { className: classes.loading, children: (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { message: message }) }));
21
+ }
@@ -84,6 +84,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
84
84
  renderInProgress: string | undefined;
85
85
  features: Feature[] | undefined;
86
86
  message: string | undefined;
87
+ loadingStatus: string | undefined;
87
88
  } & {
88
89
  readonly level: number;
89
90
  readonly height: number;
@@ -166,6 +167,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
166
167
  renderInProgress: string | undefined;
167
168
  features: Feature[] | undefined;
168
169
  message: string | undefined;
170
+ loadingStatus: string | undefined;
169
171
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
170
172
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
171
173
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -235,12 +237,14 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
235
237
  renderInProgress: string | undefined;
236
238
  features: Feature[] | undefined;
237
239
  message: string | undefined;
240
+ loadingStatus: string | undefined;
238
241
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
239
242
  highResolutionScaling: number;
240
243
  };
241
244
  } & {
242
245
  setLoading(newStopToken: string): void;
243
246
  setMessage(messageText: string): void;
247
+ setLoadingStatus(messageText: string): void;
244
248
  setRendered(args?: {
245
249
  features: Feature[];
246
250
  }): void;
@@ -1,15 +1,12 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  const jsx_runtime_1 = require("react/jsx-runtime");
7
4
  const react_1 = require("react");
8
5
  const ui_1 = require("@jbrowse/core/ui");
9
- const Help_1 = __importDefault(require("@mui/icons-material/Help"));
10
6
  const material_1 = require("@mui/material");
11
7
  const mobx_react_1 = require("mobx-react");
12
8
  const getAdapter_1 = require("./getAdapter");
9
+ const selectors_1 = require("./selectors");
13
10
  const util_1 = require("./util");
14
11
  const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ model, assembly1, assembly2, selectedRow, }) {
15
12
  const [swap, setSwap] = (0, react_1.useState)(false);
@@ -64,13 +61,6 @@ const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ mode
64
61
  indexFileLocation,
65
62
  radioOption,
66
63
  ]);
67
- const helpStrings = {
68
- '.paf': 'minimap2 target.fa query.fa',
69
- '.pif.gz': 'minimap2 target.fa query.fa',
70
- '.out': 'mashmap target.fa query.fa',
71
- '.delta': 'mummer target.fa query.fa',
72
- '.chain': 'e.g. queryToTarget.chain',
73
- };
74
64
  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 => {
75
65
  setValue(event.target.value);
76
66
  }, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "center", children: [
@@ -84,46 +74,7 @@ const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ mode
84
74
  ].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' ||
85
75
  radioOption === '.out' ||
86
76
  radioOption === '.delta' ||
87
- radioOption === '.chain' ||
88
- radioOption === '.pif.gz' ? ((0, jsx_runtime_1.jsxs)("div", { style: {
89
- display: 'flex',
90
- flexDirection: 'column',
91
- gap: 10,
92
- }, children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: loc => {
93
- setFileLocation(loc);
94
- } }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["Verify or click swap", (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsx)("code", { children: helpStrings[radioOption] }), children: (0, jsx_runtime_1.jsx)(Help_1.default, {}) })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
95
- display: 'flex',
96
- gap: 20,
97
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
98
- display: 'grid',
99
- gridTemplateColumns: '1fr 1fr',
100
- gap: 4,
101
- alignItems: 'center',
102
- }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly2 : assembly1 }) }), (0, jsx_runtime_1.jsx)("div", { children: "query assembly" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly1 : assembly2 }) }), (0, jsx_runtime_1.jsx)("div", { children: "target assembly" })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
103
- setSwap(!swap);
104
- }, children: "Swap?" })] })] })] })) : value === '.anchors' || value === '.anchors.simple' ? ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: { margin: 20 }, children: ["Open the ", value, " and .bed files for both genome assemblies from the MCScan (Python version) pipeline", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)", children: "(more info)" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: value, location: fileLocation, setLocation: loc => {
105
- setFileLocation(loc);
106
- } }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
107
- setBed1Location(loc);
108
- } }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: loc => {
109
- setBed2Location(loc);
110
- } })] }), (0, jsx_runtime_1.jsxs)("div", { style: {
111
- margin: 'auto',
112
- display: 'flex',
113
- justifyContent: 'center',
114
- gap: 20,
115
- }, children: [(0, jsx_runtime_1.jsxs)("div", { style: {
116
- display: 'grid',
117
- gridTemplateColumns: '1fr 1fr',
118
- gap: 4,
119
- alignItems: 'center',
120
- }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly2 : assembly1 }) }), (0, jsx_runtime_1.jsx)("div", { children: "bed1 assembly" }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly1 : assembly2 }) }), (0, jsx_runtime_1.jsx)("div", { children: "bed2 assembly" })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
121
- setSwap(!swap);
122
- }, children: "Swap?" })] })] })) : value === '.pif.gz' ? ((0, jsx_runtime_1.jsxs)("div", { style: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${value} location`, description: "", location: fileLocation, setLocation: loc => {
123
- setFileLocation(loc);
124
- } }) }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${value} index location`, description: "", location: indexFileLocation, setLocation: loc => {
125
- setIndexFileLocation(loc);
126
- } }) })] })) : ((0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
77
+ radioOption === '.chain' ? ((0, jsx_runtime_1.jsx)(selectors_1.StandardFormatSelector, { assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, fileLocation: fileLocation, setFileLocation: setFileLocation, radioOption: radioOption })) : radioOption === '.pif.gz' ? ((0, jsx_runtime_1.jsx)(selectors_1.PifGzSelector, { assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, fileLocation: fileLocation, setFileLocation: setFileLocation, indexFileLocation: indexFileLocation, setIndexFileLocation: setIndexFileLocation, radioOption: radioOption })) : value === '.anchors' || value === '.anchors.simple' ? ((0, jsx_runtime_1.jsx)(selectors_1.AnchorsSelector, { assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, fileLocation: fileLocation, setFileLocation: setFileLocation, bed1Location: bed1Location, setBed1Location: setBed1Location, bed2Location: bed2Location, setBed2Location: setBed2Location, radioOption: value })) : ((0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: value ? `${value} location` : '', description: "", location: fileLocation, setLocation: loc => {
127
78
  setFileLocation(loc);
128
79
  } })) })] }));
129
80
  });
@@ -0,0 +1,3 @@
1
+ import type { SelectorProps } from './SelectorTypes';
2
+ declare const AnchorsSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, bed1Location, setBed1Location, bed2Location, setBed2Location, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default AnchorsSelector;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const ui_1 = require("@jbrowse/core/ui");
8
+ const mobx_react_1 = require("mobx-react");
9
+ const SwapAssemblies_1 = __importDefault(require("./SwapAssemblies"));
10
+ const AnchorsSelector = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, bed1Location = undefined, setBed1Location = () => { }, bed2Location = undefined, setBed2Location = () => { }, radioOption, }) {
11
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: { margin: 20 }, children: ["Open the ", radioOption, " and .bed files for both genome assemblies from the MCScan (Python version) pipeline", ' ', (0, jsx_runtime_1.jsx)("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)", children: "(more info)" })] }), (0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: 400, margin: '0 auto' }, children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: radioOption, location: fileLocation, setLocation: setFileLocation }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: setBed1Location }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { inline: true, name: "genome 2 .bed (right column of anchors file)", description: "", location: bed2Location, setLocation: setBed2Location }), (0, jsx_runtime_1.jsx)(SwapAssemblies_1.default, { swap: swap, radioOption: radioOption, assembly1: assembly1, assembly2: assembly2, setSwap: setSwap, text1: "bed 1 assembly", text2: "bed 2 assembly" })] })] }));
12
+ });
13
+ exports.default = AnchorsSelector;
@@ -0,0 +1,3 @@
1
+ import type { SelectorProps } from './SelectorTypes';
2
+ declare const PifGzSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, indexFileLocation, setIndexFileLocation, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default PifGzSelector;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const ui_1 = require("@jbrowse/core/ui");
8
+ const mobx_react_1 = require("mobx-react");
9
+ const SwapAssemblies_1 = __importDefault(require("./SwapAssemblies"));
10
+ const PifGzSelector = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, indexFileLocation = undefined, setIndexFileLocation = () => { }, radioOption, }) {
11
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { style: { margin: 20 }, children: ["Open the ", radioOption, " and .pif.gz and index file (.pif.gz.tbi or .pif.gz.csi) files for created by `jbrowse make-pif`"] }), (0, jsx_runtime_1.jsxs)("div", { style: { maxWidth: 400, margin: '0 auto' }, children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: setFileLocation }), (0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${radioOption} index location`, inline: true, description: "", location: indexFileLocation, setLocation: setIndexFileLocation }), (0, jsx_runtime_1.jsx)(SwapAssemblies_1.default, { swap: swap, radioOption: radioOption, assembly1: assembly1, assembly2: assembly2, setSwap: setSwap, text1: "query assembly", text2: "target assembly" })] })] }));
12
+ });
13
+ exports.default = PifGzSelector;
@@ -0,0 +1,19 @@
1
+ import type { FileLocation } from '@jbrowse/core/util/types';
2
+ export interface SelectorProps {
3
+ assembly1: string;
4
+ assembly2: string;
5
+ swap: boolean;
6
+ setSwap?: (swap: boolean) => void;
7
+ fileLocation: FileLocation | undefined;
8
+ setFileLocation: (location: FileLocation | undefined) => void;
9
+ indexFileLocation?: FileLocation | undefined;
10
+ setIndexFileLocation?: (location: FileLocation | undefined) => void;
11
+ bed1Location?: FileLocation | undefined;
12
+ setBed1Location?: (location: FileLocation | undefined) => void;
13
+ bed2Location?: FileLocation | undefined;
14
+ setBed2Location?: (location: FileLocation | undefined) => void;
15
+ radioOption: string;
16
+ }
17
+ export type SetLocationFunction = (location: FileLocation | undefined) => void;
18
+ export type HelpStrings = Record<string, string>;
19
+ export declare const helpStrings: HelpStrings;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.helpStrings = void 0;
4
+ exports.helpStrings = {
5
+ '.paf': 'minimap2 target.fa query.fa',
6
+ '.pif.gz': 'minimap2 target.fa query.fa',
7
+ '.out': 'mashmap target.fa query.fa',
8
+ '.delta': 'mummer target.fa query.fa',
9
+ '.chain': 'e.g. queryToTarget.chain',
10
+ };
@@ -0,0 +1,3 @@
1
+ import type { SelectorProps } from './SelectorTypes';
2
+ declare const StandardFormatSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default StandardFormatSelector;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const ui_1 = require("@jbrowse/core/ui");
8
+ const Help_1 = __importDefault(require("@mui/icons-material/Help"));
9
+ const material_1 = require("@mui/material");
10
+ const mobx_react_1 = require("mobx-react");
11
+ const SelectorTypes_1 = require("./SelectorTypes");
12
+ const SwapAssemblies_1 = __importDefault(require("./SwapAssemblies"));
13
+ const StandardFormatSelector = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, radioOption, }) {
14
+ return ((0, jsx_runtime_1.jsxs)("div", { style: {
15
+ display: 'flex',
16
+ flexDirection: 'column',
17
+ gap: 10,
18
+ }, children: [(0, jsx_runtime_1.jsx)(ui_1.FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: setFileLocation }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["Verify or click swap", (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsx)("code", { children: SelectorTypes_1.helpStrings[radioOption] }), children: (0, jsx_runtime_1.jsx)(Help_1.default, {}) })] }), (0, jsx_runtime_1.jsx)(SwapAssemblies_1.default, { swap: swap, radioOption: radioOption, assembly1: assembly1, assembly2: assembly2, setSwap: setSwap, text1: "query assembly", text2: "target assembly" })] })] }));
19
+ });
20
+ exports.default = StandardFormatSelector;
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface SwapAssembliesProps {
3
+ assembly1?: string;
4
+ assembly2?: string;
5
+ swap?: boolean;
6
+ setSwap?: (arg: boolean) => void;
7
+ radioOption: string;
8
+ helpContent?: ReactNode;
9
+ text1: string;
10
+ text2: string;
11
+ }
12
+ declare const SwapAssemblies: ({ assembly1, assembly2, swap, setSwap, radioOption, helpContent, text1, text2, }: SwapAssembliesProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default SwapAssemblies;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const Help_1 = __importDefault(require("@mui/icons-material/Help"));
8
+ const material_1 = require("@mui/material");
9
+ const mobx_react_1 = require("mobx-react");
10
+ const mui_1 = require("tss-react/mui");
11
+ const SelectorTypes_1 = require("./SelectorTypes");
12
+ const useStyles = (0, mui_1.makeStyles)()({
13
+ row: {
14
+ display: 'flex',
15
+ gap: 20,
16
+ },
17
+ swap: {
18
+ display: 'grid',
19
+ gridTemplateColumns: '1fr 1fr',
20
+ gap: 4,
21
+ alignItems: 'center',
22
+ },
23
+ });
24
+ const SwapAssemblies = (0, mobx_react_1.observer)(function ({ assembly1, assembly2, swap, setSwap, radioOption, helpContent, text1, text2, }) {
25
+ const { classes } = useStyles();
26
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { children: ["Verify or click swap", (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: helpContent || (0, jsx_runtime_1.jsx)("code", { children: SelectorTypes_1.helpStrings[radioOption] }), children: (0, jsx_runtime_1.jsx)(Help_1.default, {}) })] }), (0, jsx_runtime_1.jsxs)("div", { className: classes.row, children: [(0, jsx_runtime_1.jsxs)("div", { className: classes.swap, children: [(0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly2 : assembly1 }) }), (0, jsx_runtime_1.jsx)("div", { children: text1 }), (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)("i", { children: swap ? assembly1 : assembly2 }) }), (0, jsx_runtime_1.jsx)("div", { children: text2 })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
27
+ if (setSwap) {
28
+ setSwap(!swap);
29
+ }
30
+ }, children: "Swap?" })] })] }));
31
+ });
32
+ exports.default = SwapAssemblies;
@@ -0,0 +1,4 @@
1
+ export { default as StandardFormatSelector } from './StandardFormatSelector';
2
+ export { default as PifGzSelector } from './PifGzSelector';
3
+ export { default as AnchorsSelector } from './AnchorsSelector';
4
+ export * from './SelectorTypes';
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ var __importDefault = (this && this.__importDefault) || function (mod) {
17
+ return (mod && mod.__esModule) ? mod : { "default": mod };
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.AnchorsSelector = exports.PifGzSelector = exports.StandardFormatSelector = void 0;
21
+ var StandardFormatSelector_1 = require("./StandardFormatSelector");
22
+ Object.defineProperty(exports, "StandardFormatSelector", { enumerable: true, get: function () { return __importDefault(StandardFormatSelector_1).default; } });
23
+ var PifGzSelector_1 = require("./PifGzSelector");
24
+ Object.defineProperty(exports, "PifGzSelector", { enumerable: true, get: function () { return __importDefault(PifGzSelector_1).default; } });
25
+ var AnchorsSelector_1 = require("./AnchorsSelector");
26
+ Object.defineProperty(exports, "AnchorsSelector", { enumerable: true, get: function () { return __importDefault(AnchorsSelector_1).default; } });
27
+ __exportStar(require("./SelectorTypes"), exports);
@@ -73,7 +73,7 @@ async function renderToSvg(model, opts) {
73
73
  const rendering = renderings[i - 1];
74
74
  const height = heights[i];
75
75
  const levelHeight = level.height || 0;
76
- RenderList.push((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? ((0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `synclip-${i}`, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, (0, jsx_runtime_1.jsx)("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) => (0, jsx_runtime_1.jsx)(util_1.ReactRendering, { rendering: r }, i)) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(0 ${levelHeight})`, children: (0, jsx_runtime_1.jsx)(SVGLinearGenomeView_1.default, { rulerHeight: rulerHeight, shift: shift, trackLabelOffset: trackLabelOffset, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[i], view: view, fontSize: fontSize }, view.id) })] }, view.id));
76
+ RenderList.push((0, jsx_runtime_1.jsxs)("g", { transform: `translate(0 ${currOffset})`, children: [levelHeight ? ((0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsx)("clipPath", { id: `synclip-${i}`, children: (0, jsx_runtime_1.jsx)("rect", { x: 0, y: 0, width: width, height: levelHeight }) }) })) : null, (0, jsx_runtime_1.jsx)("g", { transform: `translate(${shift + trackLabelOffset} ${fontSize})`, clipPath: `url(#synclip-${i})`, children: rendering === null || rendering === void 0 ? void 0 : rendering.map((r, i) => ((0, jsx_runtime_1.jsx)(util_1.ReactRendering, { rendering: r }, i))) }), (0, jsx_runtime_1.jsx)("g", { transform: `translate(0 ${levelHeight})`, children: (0, jsx_runtime_1.jsx)(SVGLinearGenomeView_1.default, { rulerHeight: rulerHeight, shift: shift, trackLabelOffset: trackLabelOffset, textHeight: textHeight, trackLabels: trackLabels, displayResults: displayResults[i], view: view, fontSize: fontSize }, view.id) })] }, view.id));
77
77
  currOffset += height + fontSize + rulerHeight + levelHeight;
78
78
  }
79
79
  return (0, util_1.renderToStaticMarkup)((0, jsx_runtime_1.jsx)(material_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(Wrapper, { children: (0, jsx_runtime_1.jsxs)("svg", { width: width, height: totalHeightSvg, xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", viewBox: [0, 0, w + shift * 2, totalHeightSvg].toString(), children: [(0, jsx_runtime_1.jsx)(SVGBackground_1.default, { width: w, height: totalHeightSvg, shift: shift }), RenderList] }) }) }));
@@ -70,6 +70,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
70
70
  renderInProgress: string | undefined;
71
71
  features: Feature[] | undefined;
72
72
  message: string | undefined;
73
+ loadingStatus: string | undefined;
73
74
  } & {
74
75
  readonly level: number;
75
76
  readonly height: number;
@@ -152,6 +153,7 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
152
153
  renderInProgress: string | undefined;
153
154
  features: Feature[] | undefined;
154
155
  message: string | undefined;
156
+ loadingStatus: string | undefined;
155
157
  } & import("mobx-state-tree").IStateTreeNode<import("mobx-state-tree").IModelType<{
156
158
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
157
159
  type: import("mobx-state-tree").ISimpleType<string>;
@@ -221,12 +223,14 @@ declare function stateModelFactory(configSchema: AnyConfigurationSchemaType): im
221
223
  renderInProgress: string | undefined;
222
224
  features: Feature[] | undefined;
223
225
  message: string | undefined;
226
+ loadingStatus: string | undefined;
224
227
  }, import("mobx-state-tree")._NotCustomized, import("mobx-state-tree")._NotCustomized>>;
225
228
  highResolutionScaling: number;
226
229
  };
227
230
  } & {
228
231
  setLoading(newStopToken: string): void;
229
232
  setMessage(messageText: string): void;
233
+ setLoadingStatus(messageText: string): void;
230
234
  setRendered(args?: {
231
235
  features: Feature[];
232
236
  }): void;
@@ -14,6 +14,7 @@ function stateModelFactory(configSchema) {
14
14
  renderInProgress: undefined,
15
15
  features: undefined,
16
16
  message: undefined,
17
+ loadingStatus: undefined,
17
18
  }))
18
19
  .views(self => ({
19
20
  get level() {
@@ -43,6 +44,9 @@ function stateModelFactory(configSchema) {
43
44
  self.error = undefined;
44
45
  stopToken = undefined;
45
46
  },
47
+ setLoadingStatus(messageText) {
48
+ self.loadingStatus = messageText;
49
+ },
46
50
  setRendered(args) {
47
51
  if (!args) {
48
52
  return;
@@ -108,6 +112,7 @@ function renderBlockData(self) {
108
112
  rpcManager,
109
113
  renderProps: {
110
114
  ...display.renderProps(),
115
+ model: display,
111
116
  level,
112
117
  view: parent,
113
118
  adapterConfig,
@@ -123,15 +128,17 @@ async function renderBlockEffect(props) {
123
128
  return;
124
129
  }
125
130
  const { rpcManager, renderProps } = props;
126
- const { sessionId, adapterConfig, level } = renderProps;
131
+ const { model, sessionId, adapterConfig, level } = renderProps;
127
132
  const view = renderProps.view.views[level];
128
- const features = (await rpcManager.call('getFeats', 'CoreGetFeatures', {
129
- regions: view.staticBlocks.contentBlocks,
130
- sessionId,
131
- adapterConfig,
132
- }));
133
133
  return {
134
- features: dedupe(features, f => f.id()),
134
+ features: dedupe((await rpcManager.call('getFeats', 'CoreGetFeatures', {
135
+ regions: view.staticBlocks.contentBlocks,
136
+ sessionId,
137
+ adapterConfig,
138
+ statusCallback: (arg) => {
139
+ model.setLoadingStatus(arg);
140
+ },
141
+ })), f => f.id()),
135
142
  };
136
143
  }
137
144
  export default stateModelFactory;
@@ -1,7 +1,7 @@
1
1
  import type { LinearComparativeViewModel } from '../model';
2
2
  type LCV = LinearComparativeViewModel;
3
- declare const LinearComparativeRubberband: ({ model, ControlComponent, }: {
3
+ declare const Rubberband: ({ model, ControlComponent, }: {
4
4
  model: LCV;
5
5
  ControlComponent?: React.ReactElement;
6
6
  }) => import("react/jsx-runtime").JSX.Element;
7
- export default LinearComparativeRubberband;
7
+ export default Rubberband;