@jbrowse/plugin-dotplot-view 3.6.5 → 4.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 (210) hide show
  1. package/esm/ComparativeRenderer/index.d.ts +10 -10
  2. package/esm/ComparativeRenderer/index.js +4 -17
  3. package/esm/DiagonalizeDotplotRpc.d.ts +30 -0
  4. package/esm/DiagonalizeDotplotRpc.js +147 -0
  5. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
  6. package/esm/DotplotDisplay/index.d.ts +3 -3
  7. package/esm/DotplotDisplay/index.js +4 -4
  8. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +2 -1
  9. package/esm/DotplotDisplay/renderDotplotBlock.js +9 -4
  10. package/esm/DotplotDisplay/stateModelFactory.d.ts +148 -29
  11. package/esm/DotplotDisplay/stateModelFactory.js +17 -11
  12. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +5 -6
  13. package/esm/DotplotReadVsRef/index.js +1 -1
  14. package/esm/DotplotRenderer/DotplotRenderer.d.ts +30 -48
  15. package/esm/DotplotRenderer/DotplotRenderer.js +55 -22
  16. package/esm/DotplotRenderer/clamp.d.ts +7 -0
  17. package/esm/DotplotRenderer/clamp.js +58 -0
  18. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
  19. package/esm/DotplotRenderer/components/DotplotRendering.js +1 -1
  20. package/esm/DotplotRenderer/configSchema.d.ts +3 -3
  21. package/esm/DotplotRenderer/configSchema.js +1 -1
  22. package/esm/DotplotRenderer/drawDotplot.d.ts +7 -6
  23. package/esm/DotplotRenderer/drawDotplot.js +95 -100
  24. package/esm/DotplotRenderer/index.js +4 -4
  25. package/esm/DotplotView/1dview.d.ts +25 -25
  26. package/esm/DotplotView/1dview.js +16 -4
  27. package/esm/DotplotView/components/Axes.d.ts +1 -1
  28. package/esm/DotplotView/components/Axes.js +31 -41
  29. package/esm/DotplotView/components/ColorBySelector.d.ts +5 -0
  30. package/esm/DotplotView/components/ColorBySelector.js +73 -0
  31. package/esm/DotplotView/components/DiagonalizationProgressDialog.d.ts +6 -0
  32. package/esm/DotplotView/components/DiagonalizationProgressDialog.js +123 -0
  33. package/esm/DotplotView/components/DotplotControls.d.ts +1 -1
  34. package/esm/DotplotView/components/DotplotControls.js +53 -15
  35. package/esm/DotplotView/components/DotplotGrid.d.ts +6 -0
  36. package/esm/DotplotView/components/{Grid.js → DotplotGrid.js} +19 -20
  37. package/esm/DotplotView/components/DotplotGridWrapper.d.ts +6 -0
  38. package/esm/DotplotView/components/DotplotGridWrapper.js +8 -0
  39. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -2
  40. package/esm/DotplotView/components/DotplotTooltipClick.js +4 -4
  41. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
  42. package/esm/DotplotView/components/DotplotTooltipMouseover.js +2 -2
  43. package/esm/DotplotView/components/DotplotTooltips.d.ts +15 -0
  44. package/esm/DotplotView/components/DotplotTooltips.js +7 -0
  45. package/esm/DotplotView/components/DotplotView.d.ts +2 -2
  46. package/esm/DotplotView/components/DotplotView.js +31 -171
  47. package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -1
  48. package/esm/DotplotView/components/DotplotWarnings.js +7 -7
  49. package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -1
  50. package/esm/DotplotView/components/Header.d.ts +1 -1
  51. package/esm/DotplotView/components/Header.js +5 -5
  52. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
  53. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +6 -5
  54. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
  55. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +2 -3
  56. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +10 -1
  57. package/esm/DotplotView/components/ImportForm/TrackSelector.js +8 -4
  58. package/esm/DotplotView/components/ImportForm/index.d.ts +1 -1
  59. package/esm/DotplotView/components/ImportForm/index.js +4 -10
  60. package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +1 -1
  61. package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +2 -2
  62. package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
  63. package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.js +2 -2
  64. package/esm/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
  65. package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +1 -1
  66. package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +3 -3
  67. package/esm/DotplotView/components/ImportForm/selectors/index.d.ts +3 -3
  68. package/esm/DotplotView/components/ImportForm/selectors/index.js +3 -3
  69. package/esm/DotplotView/components/MinLengthSlider.d.ts +5 -0
  70. package/esm/DotplotView/components/MinLengthSlider.js +39 -0
  71. package/esm/DotplotView/components/MouseInteractionLayer.d.ts +17 -0
  72. package/esm/DotplotView/components/MouseInteractionLayer.js +14 -0
  73. package/esm/DotplotView/components/OpacitySlider.d.ts +5 -0
  74. package/esm/DotplotView/components/OpacitySlider.js +37 -0
  75. package/esm/DotplotView/components/PanButtons.d.ts +1 -1
  76. package/esm/DotplotView/components/PanButtons.js +1 -1
  77. package/esm/DotplotView/components/SelectionContextMenu.d.ts +13 -0
  78. package/esm/DotplotView/components/SelectionContextMenu.js +39 -0
  79. package/esm/DotplotView/components/SliderTooltip.d.ts +2 -0
  80. package/esm/DotplotView/components/SliderTooltip.js +6 -0
  81. package/esm/DotplotView/components/WarningDialog.js +1 -1
  82. package/esm/DotplotView/components/hooks/useCtrlKeyTracking.d.ts +1 -0
  83. package/esm/DotplotView/components/hooks/useCtrlKeyTracking.js +21 -0
  84. package/esm/DotplotView/components/hooks/useCursorMode.d.ts +7 -0
  85. package/esm/DotplotView/components/hooks/useCursorMode.js +16 -0
  86. package/esm/DotplotView/components/hooks/useMouseCoordinates.d.ts +29 -0
  87. package/esm/DotplotView/components/hooks/useMouseCoordinates.js +49 -0
  88. package/esm/DotplotView/components/hooks/useMouseMoveHandler.d.ts +6 -0
  89. package/esm/DotplotView/components/hooks/useMouseMoveHandler.js +24 -0
  90. package/esm/DotplotView/components/hooks/useMouseUpHandler.d.ts +3 -0
  91. package/esm/DotplotView/components/hooks/useMouseUpHandler.js +28 -0
  92. package/esm/DotplotView/components/hooks/useWheelHandler.d.ts +8 -0
  93. package/esm/DotplotView/components/hooks/useWheelHandler.js +44 -0
  94. package/esm/DotplotView/components/util.d.ts +1 -1
  95. package/esm/DotplotView/components/util.js +18 -8
  96. package/esm/DotplotView/index.js +2 -2
  97. package/esm/DotplotView/model.d.ts +213 -90
  98. package/esm/DotplotView/model.js +147 -93
  99. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  100. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +5 -6
  101. package/esm/DotplotView/types.d.ts +7 -1
  102. package/esm/LaunchDotplotView.js +6 -36
  103. package/esm/ServerSideRenderedBlockContent.js +6 -27
  104. package/esm/ServerSideSyntenyRendering.d.ts +1 -1
  105. package/esm/ServerSideSyntenyRendering.js +1 -1
  106. package/esm/index.d.ts +1 -0
  107. package/esm/index.js +9 -10
  108. package/esm/util.d.ts +1 -1
  109. package/package.json +28 -35
  110. package/dist/ComparativeRenderer/index.d.ts +0 -22
  111. package/dist/ComparativeRenderer/index.js +0 -53
  112. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +0 -6
  113. package/dist/DotplotDisplay/components/DotplotDisplay.js +0 -18
  114. package/dist/DotplotDisplay/index.d.ts +0 -5
  115. package/dist/DotplotDisplay/index.js +0 -36
  116. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +0 -11
  117. package/dist/DotplotDisplay/renderDotplotBlock.js +0 -49
  118. package/dist/DotplotDisplay/stateModelFactory.d.ts +0 -102
  119. package/dist/DotplotDisplay/stateModelFactory.js +0 -119
  120. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +0 -3
  121. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +0 -100
  122. package/dist/DotplotReadVsRef/index.d.ts +0 -2
  123. package/dist/DotplotReadVsRef/index.js +0 -41
  124. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
  125. package/dist/DotplotRenderer/ComparativeRenderRpc.js +0 -53
  126. package/dist/DotplotRenderer/DotplotRenderer.d.ts +0 -74
  127. package/dist/DotplotRenderer/DotplotRenderer.js +0 -102
  128. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +0 -3
  129. package/dist/DotplotRenderer/components/DotplotRendering.js +0 -9
  130. package/dist/DotplotRenderer/configSchema.d.ts +0 -40
  131. package/dist/DotplotRenderer/configSchema.js +0 -57
  132. package/dist/DotplotRenderer/drawDotplot.d.ts +0 -21
  133. package/dist/DotplotRenderer/drawDotplot.js +0 -213
  134. package/dist/DotplotRenderer/index.d.ts +0 -2
  135. package/dist/DotplotRenderer/index.js +0 -17
  136. package/dist/DotplotView/1dview.d.ts +0 -199
  137. package/dist/DotplotView/1dview.js +0 -63
  138. package/dist/DotplotView/components/Axes.d.ts +0 -13
  139. package/dist/DotplotView/components/Axes.js +0 -107
  140. package/dist/DotplotView/components/CursorIcon.d.ts +0 -3
  141. package/dist/DotplotView/components/CursorIcon.js +0 -15
  142. package/dist/DotplotView/components/DotplotControls.d.ts +0 -5
  143. package/dist/DotplotView/components/DotplotControls.js +0 -115
  144. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +0 -10
  145. package/dist/DotplotView/components/DotplotTooltipClick.js +0 -17
  146. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +0 -9
  147. package/dist/DotplotView/components/DotplotTooltipMouseover.js +0 -16
  148. package/dist/DotplotView/components/DotplotView.d.ts +0 -5
  149. package/dist/DotplotView/components/DotplotView.js +0 -275
  150. package/dist/DotplotView/components/DotplotWarnings.d.ts +0 -5
  151. package/dist/DotplotView/components/DotplotWarnings.js +0 -53
  152. package/dist/DotplotView/components/ExportSvgDialog.d.ts +0 -7
  153. package/dist/DotplotView/components/ExportSvgDialog.js +0 -53
  154. package/dist/DotplotView/components/Grid.d.ts +0 -9
  155. package/dist/DotplotView/components/Grid.js +0 -47
  156. package/dist/DotplotView/components/Header.d.ts +0 -9
  157. package/dist/DotplotView/components/Header.js +0 -33
  158. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -7
  159. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -78
  160. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -7
  161. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +0 -42
  162. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +0 -7
  163. package/dist/DotplotView/components/ImportForm/TrackSelector.js +0 -23
  164. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +0 -117
  165. package/dist/DotplotView/components/ImportForm/getAdapter.js +0 -68
  166. package/dist/DotplotView/components/ImportForm/index.d.ts +0 -5
  167. package/dist/DotplotView/components/ImportForm/index.js +0 -76
  168. package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +0 -3
  169. package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +0 -23
  170. package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
  171. package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.js +0 -13
  172. package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -23
  173. package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.js +0 -10
  174. package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
  175. package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
  176. package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +0 -3
  177. package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +0 -24
  178. package/dist/DotplotView/components/ImportForm/selectors/index.d.ts +0 -3
  179. package/dist/DotplotView/components/ImportForm/selectors/index.js +0 -12
  180. package/dist/DotplotView/components/ImportForm/util.d.ts +0 -10
  181. package/dist/DotplotView/components/ImportForm/util.js +0 -24
  182. package/dist/DotplotView/components/PanButtons.d.ts +0 -5
  183. package/dist/DotplotView/components/PanButtons.js +0 -47
  184. package/dist/DotplotView/components/WarningDialog.d.ts +0 -16
  185. package/dist/DotplotView/components/WarningDialog.js +0 -39
  186. package/dist/DotplotView/components/util.d.ts +0 -14
  187. package/dist/DotplotView/components/util.js +0 -82
  188. package/dist/DotplotView/index.d.ts +0 -2
  189. package/dist/DotplotView/index.js +0 -52
  190. package/dist/DotplotView/model.d.ts +0 -435
  191. package/dist/DotplotView/model.js +0 -487
  192. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +0 -4
  193. package/dist/DotplotView/svgcomponents/SVGBackground.js +0 -10
  194. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +0 -2
  195. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +0 -30
  196. package/dist/DotplotView/types.d.ts +0 -12
  197. package/dist/DotplotView/types.js +0 -2
  198. package/dist/LaunchDotplotView.d.ts +0 -2
  199. package/dist/LaunchDotplotView.js +0 -43
  200. package/dist/ServerSideRenderedBlockContent.d.ts +0 -12
  201. package/dist/ServerSideRenderedBlockContent.js +0 -65
  202. package/dist/ServerSideSyntenyRendering.d.ts +0 -13
  203. package/dist/ServerSideSyntenyRendering.js +0 -23
  204. package/dist/index.d.ts +0 -7
  205. package/dist/index.js +0 -40
  206. package/dist/util.d.ts +0 -9
  207. package/dist/util.js +0 -7
  208. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
  209. package/esm/DotplotRenderer/ComparativeRenderRpc.js +0 -47
  210. package/esm/DotplotView/components/Grid.d.ts +0 -9
@@ -1,275 +0,0 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __importDefault = (this && this.__importDefault) || function (mod) {
36
- return (mod && mod.__esModule) ? mod : { "default": mod };
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- const jsx_runtime_1 = require("react/jsx-runtime");
40
- const react_1 = require("react");
41
- const ui_1 = require("@jbrowse/core/ui");
42
- const mobx_1 = require("mobx");
43
- const mobx_react_1 = require("mobx-react");
44
- const mui_1 = require("tss-react/mui");
45
- const Axes_1 = require("./Axes");
46
- const Grid_1 = __importDefault(require("./Grid"));
47
- const Header_1 = __importDefault(require("./Header"));
48
- const ImportForm_1 = __importDefault(require("./ImportForm"));
49
- const TooltipWhereClicked = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./DotplotTooltipClick'))));
50
- const TooltipWhereMouseovered = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./DotplotTooltipMouseover'))));
51
- const blank = { left: 0, top: 0, width: 0, height: 0 };
52
- const useStyles = (0, mui_1.makeStyles)()(theme => ({
53
- spacer: {
54
- gridColumn: '1/2',
55
- gridRow: '2/2',
56
- },
57
- root: {
58
- position: 'relative',
59
- marginBottom: theme.spacing(1),
60
- overflow: 'hidden',
61
- },
62
- container: {
63
- display: 'grid',
64
- padding: 5,
65
- position: 'relative',
66
- },
67
- overlay: {
68
- pointerEvents: 'none',
69
- overflow: 'hidden',
70
- display: 'flex',
71
- width: '100%',
72
- gridRow: '1/2',
73
- gridColumn: '2/2',
74
- zIndex: 100,
75
- '& path': {
76
- cursor: 'crosshair',
77
- fill: 'none',
78
- },
79
- },
80
- content: {
81
- position: 'relative',
82
- gridColumn: '2/2',
83
- gridRow: '1/2',
84
- },
85
- resizeHandle: {
86
- height: 4,
87
- background: '#ccc',
88
- boxSizing: 'border-box',
89
- borderTop: '1px solid #fafafa',
90
- },
91
- }));
92
- function getOffset(coord, rect) {
93
- return coord && [coord[0] - rect.left, coord[1] - rect.top];
94
- }
95
- const RenderedComponent = (0, mobx_react_1.observer)(({ model }) => {
96
- const { classes } = useStyles();
97
- return ((0, jsx_runtime_1.jsx)("div", { className: classes.overlay, children: model.tracks.map(track => {
98
- const [display] = track.displays;
99
- const { RenderingComponent } = display;
100
- return RenderingComponent ? ((0, jsx_runtime_1.jsx)(RenderingComponent, { model: display }, track.configuration.trackId)) : null;
101
- }) }));
102
- });
103
- const DotplotViewInternal = (0, mobx_react_1.observer)(function ({ model, }) {
104
- var _a, _b;
105
- const { classes } = useStyles();
106
- const [mousecurrClient, setMouseCurrClient] = (0, react_1.useState)();
107
- const [mousedownClient, setMouseDownClient] = (0, react_1.useState)();
108
- const [mouseOvered, setMouseOvered] = (0, react_1.useState)(false);
109
- const [mouseupClient, setMouseUpClient] = (0, react_1.useState)();
110
- const ref = (0, react_1.useRef)(null);
111
- const root = (0, react_1.useRef)(null);
112
- const distanceX = (0, react_1.useRef)(0);
113
- const distanceY = (0, react_1.useRef)(0);
114
- const scheduled = (0, react_1.useRef)(false);
115
- const [ctrlKeyWasUsed, setCtrlKeyWasUsed] = (0, react_1.useState)(false);
116
- const [ctrlKeyDown, setCtrlKeyDown] = (0, react_1.useState)(false);
117
- const svg = ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || blank;
118
- const rootRect = ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) || blank;
119
- const mousedown = getOffset(mousedownClient, svg);
120
- const mousecurr = getOffset(mousecurrClient, svg);
121
- const mouseup = getOffset(mouseupClient, svg);
122
- const mouserect = mouseup || mousecurr;
123
- const mouserectClient = mouseupClient || mousecurrClient;
124
- const xdistance = mousedown && mouserect ? mouserect[0] - mousedown[0] : 0;
125
- const ydistance = mousedown && mouserect ? mouserect[1] - mousedown[1] : 0;
126
- const { hview, vview, wheelMode, cursorMode } = model;
127
- const validPan = (cursorMode === 'move' && !ctrlKeyWasUsed) ||
128
- (cursorMode === 'crosshair' && ctrlKeyWasUsed);
129
- const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
130
- (cursorMode === 'crosshair' && !ctrlKeyWasUsed);
131
- (0, react_1.useEffect)(() => {
132
- function onWheel(event) {
133
- event.preventDefault();
134
- distanceX.current += event.deltaX;
135
- distanceY.current -= event.deltaY;
136
- if (!scheduled.current) {
137
- scheduled.current = true;
138
- window.requestAnimationFrame(() => {
139
- (0, mobx_1.transaction)(() => {
140
- if (wheelMode === 'pan') {
141
- hview.scroll(distanceX.current / 3);
142
- vview.scroll(distanceY.current / 10);
143
- }
144
- else if (wheelMode === 'zoom') {
145
- if (Math.abs(distanceY.current) > Math.abs(distanceX.current) * 2 &&
146
- mousecurr) {
147
- const val = distanceY.current < 0 ? 1.1 : 0.9;
148
- hview.zoomTo(hview.bpPerPx * val, mousecurr[0]);
149
- vview.zoomTo(vview.bpPerPx * val, rootRect.height - mousecurr[1]);
150
- }
151
- }
152
- });
153
- scheduled.current = false;
154
- distanceX.current = 0;
155
- distanceY.current = 0;
156
- });
157
- }
158
- }
159
- if (ref.current) {
160
- const curr = ref.current;
161
- curr.addEventListener('wheel', onWheel);
162
- return () => {
163
- curr.removeEventListener('wheel', onWheel);
164
- };
165
- }
166
- return () => { };
167
- }, [hview, vview, wheelMode, mousecurr, rootRect.height]);
168
- (0, react_1.useEffect)(() => {
169
- function globalMouseMove(event) {
170
- setMouseCurrClient([event.clientX, event.clientY]);
171
- if (mousecurrClient && mousedownClient && validPan && !mouseupClient) {
172
- hview.scroll(-event.clientX + mousecurrClient[0]);
173
- vview.scroll(event.clientY - mousecurrClient[1]);
174
- }
175
- }
176
- window.addEventListener('mousemove', globalMouseMove);
177
- return () => {
178
- window.removeEventListener('mousemove', globalMouseMove);
179
- };
180
- }, [validPan, mousecurrClient, mousedownClient, mouseupClient, hview, vview]);
181
- (0, react_1.useEffect)(() => {
182
- function globalCtrlKeyDown(event) {
183
- if (event.metaKey || event.ctrlKey) {
184
- setCtrlKeyDown(true);
185
- }
186
- }
187
- function globalCtrlKeyUp(event) {
188
- if (!event.metaKey && !event.ctrlKey) {
189
- setCtrlKeyDown(false);
190
- }
191
- }
192
- window.addEventListener('keydown', globalCtrlKeyDown);
193
- window.addEventListener('keyup', globalCtrlKeyUp);
194
- return () => {
195
- window.removeEventListener('keydown', globalCtrlKeyDown);
196
- window.removeEventListener('keyup', globalCtrlKeyUp);
197
- };
198
- }, []);
199
- (0, react_1.useEffect)(() => {
200
- function globalMouseUp(event) {
201
- if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
202
- setMouseUpClient([event.clientX, event.clientY]);
203
- }
204
- else {
205
- setMouseDownClient(undefined);
206
- }
207
- }
208
- if (mousedown && !mouseup) {
209
- window.addEventListener('mouseup', globalMouseUp, true);
210
- return () => {
211
- window.removeEventListener('mouseup', globalMouseUp, true);
212
- };
213
- }
214
- return () => { };
215
- }, [validSelect, mousedown, mouseup, xdistance, ydistance]);
216
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(Header_1.default, { model: model, selection: !validSelect || !(mousedown && mouserect)
217
- ? undefined
218
- : {
219
- width: Math.abs(xdistance),
220
- height: Math.abs(ydistance),
221
- } }), (0, jsx_runtime_1.jsxs)("div", { ref: root, className: classes.root, onMouseLeave: () => {
222
- setMouseOvered(false);
223
- }, onMouseEnter: () => {
224
- setMouseOvered(true);
225
- }, children: [(0, jsx_runtime_1.jsxs)("div", { className: classes.container, children: [(0, jsx_runtime_1.jsx)(Axes_1.VerticalAxis, { model: model }), (0, jsx_runtime_1.jsx)(Axes_1.HorizontalAxis, { model: model }), (0, jsx_runtime_1.jsxs)("div", { ref: ref, className: classes.content, children: [mouseOvered && validSelect ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipWhereMouseovered, { model: model, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance }) })) : null, validSelect ? ((0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: null, children: (0, jsx_runtime_1.jsx)(TooltipWhereClicked, { model: model, mousedown: mousedown, mousedownClient: mousedownClient, xdistance: xdistance, ydistance: ydistance }) })) : null, (0, jsx_runtime_1.jsx)("div", { style: { cursor: ctrlKeyDown ? 'pointer' : cursorMode }, onMouseDown: event => {
226
- if (event.button === 0) {
227
- const { clientX, clientY } = event;
228
- setMouseDownClient([clientX, clientY]);
229
- setMouseCurrClient([clientX, clientY]);
230
- setCtrlKeyWasUsed(ctrlKeyDown);
231
- }
232
- }, children: (0, jsx_runtime_1.jsx)(Grid_1.default, { model: model, children: validSelect && mousedown && mouserect ? ((0, jsx_runtime_1.jsx)("rect", { fill: "rgba(255,0,0,0.3)", x: Math.min(mouserect[0], mousedown[0]), y: Math.min(mouserect[1], mousedown[1]), width: Math.abs(xdistance), height: Math.abs(ydistance) })) : null }) }), (0, jsx_runtime_1.jsx)("div", { className: classes.spacer })] }), (0, jsx_runtime_1.jsx)(RenderedComponent, { model: model }), (0, jsx_runtime_1.jsx)(ui_1.Menu, { open: Boolean(mouseup), onMenuItemClick: (_, callback) => {
233
- callback();
234
- setMouseUpClient(undefined);
235
- setMouseDownClient(undefined);
236
- }, onClose: () => {
237
- setMouseUpClient(undefined);
238
- setMouseDownClient(undefined);
239
- }, anchorReference: "anchorPosition", anchorPosition: mouseupClient
240
- ? {
241
- top: mouseupClient[1] + 50,
242
- left: mouseupClient[0] + 50,
243
- }
244
- : undefined, style: { zIndex: 800 }, menuItems: [
245
- {
246
- label: 'Zoom in',
247
- onClick: () => {
248
- if (mousedown && mouseup) {
249
- model.zoomInToMouseCoords(mousedown, mouseup);
250
- }
251
- setMouseOvered(false);
252
- },
253
- },
254
- {
255
- label: 'Open linear synteny view',
256
- onClick: () => {
257
- if (mousedown && mouseup) {
258
- model.onDotplotView(mousedown, mouseup);
259
- }
260
- setMouseOvered(false);
261
- },
262
- },
263
- ] })] }), (0, jsx_runtime_1.jsx)(ui_1.ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle })] })] }));
264
- });
265
- const DotplotView = (0, mobx_react_1.observer)(function ({ model }) {
266
- const { initialized, loading, error } = model;
267
- if ((!initialized && !loading) || error) {
268
- return (0, jsx_runtime_1.jsx)(ImportForm_1.default, { model: model });
269
- }
270
- if (loading) {
271
- return (0, jsx_runtime_1.jsx)(ui_1.LoadingEllipses, { variant: "h6" });
272
- }
273
- return (0, jsx_runtime_1.jsx)(DotplotViewInternal, { model: model });
274
- });
275
- exports.default = DotplotView;
@@ -1,5 +0,0 @@
1
- import type { DotplotViewModel } from '../model';
2
- declare const DotplotWarnings: ({ model, }: {
3
- model: DotplotViewModel;
4
- }) => import("react/jsx-runtime").JSX.Element | null;
5
- export default DotplotWarnings;
@@ -1,53 +0,0 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- const jsx_runtime_1 = require("react/jsx-runtime");
37
- const react_1 = require("react");
38
- const material_1 = require("@mui/material");
39
- const mobx_react_1 = require("mobx-react");
40
- const WarningDialog = (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./WarningDialog'))));
41
- const DotplotWarnings = (0, mobx_react_1.observer)(function ({ model, }) {
42
- const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
43
- const [shown, setShown] = (0, react_1.useState)(false);
44
- const [hide, setHide] = (0, react_1.useState)(false);
45
- return trackWarnings.length && !hide ? ((0, jsx_runtime_1.jsxs)(material_1.Alert, { severity: "warning", children: ["Warnings during render", ' ', (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: () => {
46
- setShown(true);
47
- }, children: "More info" }), shown ? ((0, jsx_runtime_1.jsx)(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
48
- setShown(false);
49
- } })) : null, (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => {
50
- setHide(true);
51
- }, children: "Dismiss" })] })) : null;
52
- });
53
- exports.default = DotplotWarnings;
@@ -1,7 +0,0 @@
1
- import type { ExportSvgOptions } from '../model';
2
- export default function ExportSvgDialog({ model, handleClose, }: {
3
- model: {
4
- exportSvg(opts: ExportSvgOptions): Promise<void>;
5
- };
6
- handleClose: () => void;
7
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = ExportSvgDialog;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const ui_1 = require("@jbrowse/core/ui");
7
- const util_1 = require("@jbrowse/core/util");
8
- const material_1 = require("@mui/material");
9
- function LoadingMessage() {
10
- return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.CircularProgress, { size: 20, style: { marginRight: 20 } }), (0, jsx_runtime_1.jsx)(material_1.Typography, { display: "inline", children: "Creating SVG" })] }));
11
- }
12
- function TextField2({ children, ...rest }) {
13
- return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(material_1.TextField, { ...rest, children: children }) }));
14
- }
15
- function useSvgLocal(key, val) {
16
- return (0, util_1.useLocalStorage)(`svg-${key}`, val);
17
- }
18
- function ExportSvgDialog({ model, handleClose, }) {
19
- const session = (0, util_1.getSession)(model);
20
- const offscreenCanvas = typeof OffscreenCanvas !== 'undefined';
21
- const [rasterizeLayers, setRasterizeLayers] = (0, react_1.useState)(offscreenCanvas);
22
- const [loading, setLoading] = (0, react_1.useState)(false);
23
- const [error, setError] = (0, react_1.useState)();
24
- const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
25
- const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
26
- return ((0, jsx_runtime_1.jsxs)(ui_1.Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [(0, jsx_runtime_1.jsxs)(material_1.DialogContent, { children: [error ? ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: error })) : loading ? ((0, jsx_runtime_1.jsx)(LoadingMessage, {})) : null, (0, jsx_runtime_1.jsx)(TextField2, { helperText: "filename", value: filename, onChange: event => {
27
- setFilename(event.target.value);
28
- } }), session.allThemes ? ((0, jsx_runtime_1.jsx)(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
29
- setThemeName(event.target.value);
30
- }, children: Object.entries(session.allThemes()).map(([key, val]) => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? ((0, jsx_runtime_1.jsx)(material_1.FormControlLabel, { control: (0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: rasterizeLayers, onChange: () => {
31
- setRasterizeLayers(val => !val);
32
- } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : ((0, jsx_runtime_1.jsx)(material_1.Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "secondary", onClick: () => {
33
- handleClose();
34
- }, children: "Cancel" }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
35
- setLoading(true);
36
- setError(undefined);
37
- try {
38
- await model.exportSvg({
39
- rasterizeLayers,
40
- filename,
41
- themeName,
42
- });
43
- handleClose();
44
- }
45
- catch (e) {
46
- console.error(e);
47
- setError(e);
48
- }
49
- finally {
50
- setLoading(false);
51
- }
52
- }, children: "Submit" })] })] }));
53
- }
@@ -1,9 +0,0 @@
1
- import type { DotplotViewModel } from '../model';
2
- export declare const GridRaw: ({ model, children, }: {
3
- model: DotplotViewModel;
4
- children?: React.ReactNode;
5
- }) => import("react/jsx-runtime").JSX.Element | null;
6
- export default function Grid({ model, children, }: {
7
- model: DotplotViewModel;
8
- children?: React.ReactNode;
9
- }): import("react/jsx-runtime").JSX.Element;
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GridRaw = void 0;
4
- exports.default = Grid;
5
- const jsx_runtime_1 = require("react/jsx-runtime");
6
- const util_1 = require("@jbrowse/core/util");
7
- const material_1 = require("@mui/material");
8
- const mobx_react_1 = require("mobx-react");
9
- exports.GridRaw = (0, mobx_react_1.observer)(function ({ model, children, }) {
10
- const { viewWidth, viewHeight, hview, vview } = model;
11
- const hblocks = hview.dynamicBlocks.contentBlocks;
12
- const vblocks = vview.dynamicBlocks.contentBlocks;
13
- if (!hblocks.length || !vblocks.length) {
14
- return null;
15
- }
16
- const htop = hview.displayedRegionsTotalPx - hview.offsetPx;
17
- const vtop = vview.displayedRegionsTotalPx - vview.offsetPx;
18
- const hbottom = hblocks[0].offsetPx - hview.offsetPx;
19
- const vbottom = vblocks[0].offsetPx - vview.offsetPx;
20
- const theme = (0, material_1.useTheme)();
21
- const stroke = theme.palette.divider;
22
- const rx = Math.max(hbottom, 0);
23
- const ry = Math.max(viewHeight - vtop, 0);
24
- const w = Math.min(htop - hbottom, viewWidth);
25
- const h = Math.min(viewHeight - vbottom - ry, viewHeight);
26
- let lastx = Number.POSITIVE_INFINITY;
27
- let lasty = Number.POSITIVE_INFINITY;
28
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("rect", { x: rx, y: ry, width: w, height: h, ...(0, util_1.getFillProps)(theme.palette.background.default) }), (0, jsx_runtime_1.jsxs)("g", { children: [hblocks.map(region => {
29
- const x = region.offsetPx - hview.offsetPx;
30
- const render = Math.floor(x) !== Math.floor(lastx);
31
- if (render) {
32
- lastx = x;
33
- }
34
- return render ? ((0, jsx_runtime_1.jsx)("line", { x1: x, y1: 0, x2: x, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
35
- }), vblocks.map(region => {
36
- const y = viewHeight - (region.offsetPx - vview.offsetPx);
37
- const render = Math.floor(y) !== Math.floor(lasty);
38
- if (render) {
39
- lasty = y;
40
- }
41
- return render ? ((0, jsx_runtime_1.jsx)("line", { x1: 0, y1: y, x2: viewWidth, y2: y, ...(0, util_1.getStrokeProps)(stroke) }, JSON.stringify(region))) : null;
42
- }), (0, jsx_runtime_1.jsx)("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...(0, util_1.getStrokeProps)(stroke) }), (0, jsx_runtime_1.jsx)("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...(0, util_1.getStrokeProps)(stroke) })] }), children] }));
43
- });
44
- function Grid({ model, children, }) {
45
- const { viewWidth, viewHeight } = model;
46
- return ((0, jsx_runtime_1.jsx)("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' }, children: (0, jsx_runtime_1.jsx)(exports.GridRaw, { model: model, children: children }) }));
47
- }
@@ -1,9 +0,0 @@
1
- import type { DotplotViewModel } from '../model';
2
- declare const DotplotHeader: ({ model, selection, }: {
3
- model: DotplotViewModel;
4
- selection?: {
5
- width: number;
6
- height: number;
7
- };
8
- }) => import("react/jsx-runtime").JSX.Element;
9
- export default DotplotHeader;
@@ -1,33 +0,0 @@
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 util_1 = require("@jbrowse/core/util");
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 DotplotControls_1 = __importDefault(require("./DotplotControls"));
12
- const DotplotWarnings_1 = __importDefault(require("./DotplotWarnings"));
13
- const PanButtons_1 = __importDefault(require("./PanButtons"));
14
- const useStyles = (0, mui_1.makeStyles)()({
15
- bp: {
16
- display: 'flex',
17
- alignItems: 'center',
18
- marginLeft: 10,
19
- },
20
- spacer: {
21
- flexGrow: 1,
22
- },
23
- headerBar: {
24
- display: 'flex',
25
- position: 'relative',
26
- },
27
- });
28
- const DotplotHeader = (0, mobx_react_1.observer)(function ({ model, selection, }) {
29
- const { classes } = useStyles();
30
- const { hview, vview, showPanButtons } = model;
31
- return ((0, jsx_runtime_1.jsxs)("div", { className: classes.headerBar, children: [(0, jsx_runtime_1.jsx)(DotplotControls_1.default, { model: model }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: ["x: ", hview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(hview.currBp), (0, jsx_runtime_1.jsx)("br", {}), "y: ", vview.assemblyNames.join(','), " ", (0, util_1.getBpDisplayStr)(vview.currBp)] }), selection ? ((0, jsx_runtime_1.jsxs)(material_1.Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: [`width:${(0, util_1.getBpDisplayStr)(hview.bpPerPx * selection.width)}`, " ", (0, jsx_runtime_1.jsx)("br", {}), `height:${(0, util_1.getBpDisplayStr)(vview.bpPerPx * selection.height)}`] })) : null, (0, jsx_runtime_1.jsx)("div", { className: classes.spacer }), (0, jsx_runtime_1.jsx)(DotplotWarnings_1.default, { model: model }), showPanButtons ? (0, jsx_runtime_1.jsx)(PanButtons_1.default, { model: model }) : null] }));
32
- });
33
- exports.default = DotplotHeader;
@@ -1,7 +0,0 @@
1
- import type { DotplotViewModel } from '../../model';
2
- declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, }: {
3
- model: DotplotViewModel;
4
- assembly1: string;
5
- assembly2: string;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default ImportSyntenyOpenCustomTrack;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const ui_1 = require("@jbrowse/core/ui");
6
- const material_1 = require("@mui/material");
7
- const mobx_react_1 = require("mobx-react");
8
- const getAdapter_1 = require("./getAdapter");
9
- const selectors_1 = require("./selectors");
10
- const util_1 = require("./util");
11
- const ImportSyntenyOpenCustomTrack = (0, mobx_react_1.observer)(function ({ model, assembly1, assembly2, }) {
12
- const [swap, setSwap] = (0, react_1.useState)(false);
13
- const [bed2Location, setBed2Location] = (0, react_1.useState)();
14
- const [bed1Location, setBed1Location] = (0, react_1.useState)();
15
- const [fileLocation, setFileLocation] = (0, react_1.useState)();
16
- const [indexFileLocation, setIndexFileLocation] = (0, react_1.useState)();
17
- const [value, setValue] = (0, react_1.useState)('');
18
- const [error, setError] = (0, react_1.useState)();
19
- const fileName = (0, util_1.getName)(fileLocation);
20
- const radioOption = value || (fileName ? (0, util_1.extName)((0, util_1.stripGz)(fileName)) : '');
21
- (0, react_1.useEffect)(() => {
22
- try {
23
- if (fileLocation) {
24
- const fn = fileName ? (0, util_1.basename)(fileName) : 'MyTrack';
25
- const trackId = `${fn}-${Date.now()}-sessionTrack`;
26
- setError(undefined);
27
- model.setImportFormSyntenyTrack(0, {
28
- type: 'userOpened',
29
- value: {
30
- trackId,
31
- name: fn,
32
- assemblyNames: [assembly2, assembly1],
33
- type: 'SyntenyTrack',
34
- adapter: (0, getAdapter_1.getAdapter)({
35
- radioOption,
36
- assembly1: swap ? assembly2 : assembly1,
37
- assembly2: swap ? assembly1 : assembly2,
38
- fileLocation,
39
- indexFileLocation,
40
- bed1Location,
41
- bed2Location,
42
- }),
43
- },
44
- });
45
- }
46
- }
47
- catch (e) {
48
- console.error(e);
49
- setError(e);
50
- }
51
- }, [
52
- swap,
53
- model,
54
- fileName,
55
- assembly1,
56
- assembly2,
57
- bed1Location,
58
- bed2Location,
59
- fileLocation,
60
- indexFileLocation,
61
- radioOption,
62
- ]);
63
- 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 => {
64
- setValue(event.target.value);
65
- }, children: (0, jsx_runtime_1.jsx)(material_1.Grid, { container: true, justifyContent: "center", children: [
66
- '.paf',
67
- '.delta',
68
- '.out',
69
- '.chain',
70
- '.anchors',
71
- '.anchors.simple',
72
- '.pif.gz',
73
- ].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' ||
74
- radioOption === '.out' ||
75
- radioOption === '.delta' ||
76
- radioOption === '.chain' ? ((0, jsx_runtime_1.jsx)(selectors_1.SyntenyFileSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap })) : radioOption === '.anchors' || radioOption === '.anchors.simple' ? ((0, jsx_runtime_1.jsx)(selectors_1.AnchorsFileSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, bed1Location: bed1Location, setBed1Location: setBed1Location, bed2Location: bed2Location, setBed2Location: setBed2Location })) : radioOption === '.pif.gz' ? ((0, jsx_runtime_1.jsx)(selectors_1.PifGzSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, indexFileLocation: indexFileLocation, setIndexFileLocation: setIndexFileLocation })) : null })] }));
77
- });
78
- exports.default = ImportSyntenyOpenCustomTrack;
@@ -1,7 +0,0 @@
1
- import type { DotplotViewModel } from '../../model';
2
- declare const ImportSyntenyTrackSelector: ({ model, assembly1, assembly2, }: {
3
- model: DotplotViewModel;
4
- assembly1: string;
5
- assembly2: string;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default ImportSyntenyTrackSelector;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const react_1 = require("react");
5
- const configuration_1 = require("@jbrowse/core/configuration");
6
- const ui_1 = require("@jbrowse/core/ui");
7
- const Icons_1 = require("@jbrowse/core/ui/Icons");
8
- const util_1 = require("@jbrowse/core/util");
9
- const tracks_1 = require("@jbrowse/core/util/tracks");
10
- const material_1 = require("@mui/material");
11
- const mobx_react_1 = require("mobx-react");
12
- function isRelevantTrack(track, assembly1, assembly2) {
13
- const assemblyNames = (0, configuration_1.readConfObject)(track, 'assemblyNames');
14
- return (assemblyNames.includes(assembly1) &&
15
- assemblyNames.includes(assembly2) &&
16
- track.type.includes('Synteny'));
17
- }
18
- const ImportSyntenyTrackSelector = (0, mobx_react_1.observer)(function ({ model, assembly1, assembly2, }) {
19
- var _a;
20
- const session = (0, util_1.getSession)(model);
21
- const { tracks, sessionTracks } = session;
22
- const allTracks = [
23
- ...tracks,
24
- ...(sessionTracks || []),
25
- ];
26
- const filteredTracks = allTracks.filter(t => isRelevantTrack(t, assembly2, assembly1));
27
- const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
28
- const [value, setValue] = (0, react_1.useState)(resetTrack);
29
- (0, react_1.useEffect)(() => {
30
- setValue(resetTrack);
31
- }, [resetTrack]);
32
- (0, react_1.useEffect)(() => {
33
- model.setImportFormSyntenyTrack(0, {
34
- type: 'preConfigured',
35
- value,
36
- });
37
- }, [model, value]);
38
- return ((0, jsx_runtime_1.jsxs)(material_1.Paper, { style: { padding: 12 }, children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["Select a track from the select box below, the track will be shown when you hit \"Launch\". Note: there is a track selector ", (0, jsx_runtime_1.jsx)("i", { children: "inside" }), " the DotplotView, which can turn on one or more SyntenyTracks (more than one can be displayed at once). Look for the track selector icon", ' ', (0, jsx_runtime_1.jsx)(Icons_1.TrackSelector, {})] }), filteredTracks.length ? ((0, jsx_runtime_1.jsx)(material_1.Select, { value: value, onChange: event => {
39
- setValue(event.target.value);
40
- }, children: filteredTracks.map(track => ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: track.trackId, children: (0, tracks_1.getTrackName)(track, session) }, track.trackId))) })) : ((0, jsx_runtime_1.jsx)(ui_1.ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))] }));
41
- });
42
- exports.default = ImportSyntenyTrackSelector;
@@ -1,7 +0,0 @@
1
- import type { DotplotViewModel } from '../../model';
2
- declare const TrackSelector: ({ assembly1, assembly2, model, }: {
3
- model: DotplotViewModel;
4
- assembly1: string;
5
- assembly2: string;
6
- }) => import("react/jsx-runtime").JSX.Element;
7
- export default TrackSelector;