@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,16 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Suspense, lazy, useEffect, useRef, useState } from 'react';
3
- import { LoadingEllipses, Menu, ResizeHandle } from '@jbrowse/core/ui';
4
- import { transaction } from 'mobx';
2
+ import { LoadingEllipses, ResizeHandle } from '@jbrowse/core/ui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
4
  import { observer } from 'mobx-react';
6
- import { makeStyles } from 'tss-react/mui';
7
- import { HorizontalAxis, VerticalAxis } from './Axes';
8
- import Grid from './Grid';
9
- import Header from './Header';
10
- import ImportForm from './ImportForm';
11
- const TooltipWhereClicked = lazy(() => import('./DotplotTooltipClick'));
12
- const TooltipWhereMouseovered = lazy(() => import('./DotplotTooltipMouseover'));
13
- const blank = { left: 0, top: 0, width: 0, height: 0 };
5
+ import { HorizontalAxis, VerticalAxis } from "./Axes.js";
6
+ import DotplotTooltips from "./DotplotTooltips.js";
7
+ import Header from "./Header.js";
8
+ import ImportForm from "./ImportForm/index.js";
9
+ import MouseInteractionLayer from "./MouseInteractionLayer.js";
10
+ import SelectionContextMenu from "./SelectionContextMenu.js";
11
+ import { useCtrlKeyTracking } from "./hooks/useCtrlKeyTracking.js";
12
+ import { useCursorMode } from "./hooks/useCursorMode.js";
13
+ import { useMouseCoordinates } from "./hooks/useMouseCoordinates.js";
14
+ import { useMouseMoveHandler } from "./hooks/useMouseMoveHandler.js";
15
+ import { useMouseUpHandler } from "./hooks/useMouseUpHandler.js";
16
+ import { useWheelHandler } from "./hooks/useWheelHandler.js";
14
17
  const useStyles = makeStyles()(theme => ({
15
18
  spacer: {
16
19
  gridColumn: '1/2',
@@ -51,10 +54,7 @@ const useStyles = makeStyles()(theme => ({
51
54
  borderTop: '1px solid #fafafa',
52
55
  },
53
56
  }));
54
- function getOffset(coord, rect) {
55
- return coord && [coord[0] - rect.left, coord[1] - rect.top];
56
- }
57
- const RenderedComponent = observer(({ model }) => {
57
+ const RenderedComponent = observer(function RenderedComponent({ model, }) {
58
58
  const { classes } = useStyles();
59
59
  return (_jsx("div", { className: classes.overlay, children: model.tracks.map(track => {
60
60
  const [display] = track.displays;
@@ -62,119 +62,15 @@ const RenderedComponent = observer(({ model }) => {
62
62
  return RenderingComponent ? (_jsx(RenderingComponent, { model: display }, track.configuration.trackId)) : null;
63
63
  }) }));
64
64
  });
65
- const DotplotViewInternal = observer(function ({ model, }) {
66
- var _a, _b;
65
+ const DotplotViewInternal = observer(function DotplotViewInternal({ model, }) {
67
66
  const { classes } = useStyles();
68
- const [mousecurrClient, setMouseCurrClient] = useState();
69
- const [mousedownClient, setMouseDownClient] = useState();
70
- const [mouseOvered, setMouseOvered] = useState(false);
71
- const [mouseupClient, setMouseUpClient] = useState();
72
- const ref = useRef(null);
73
- const root = useRef(null);
74
- const distanceX = useRef(0);
75
- const distanceY = useRef(0);
76
- const scheduled = useRef(false);
77
- const [ctrlKeyWasUsed, setCtrlKeyWasUsed] = useState(false);
78
- const [ctrlKeyDown, setCtrlKeyDown] = useState(false);
79
- const svg = ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || blank;
80
- const rootRect = ((_b = ref.current) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) || blank;
81
- const mousedown = getOffset(mousedownClient, svg);
82
- const mousecurr = getOffset(mousecurrClient, svg);
83
- const mouseup = getOffset(mouseupClient, svg);
84
- const mouserect = mouseup || mousecurr;
85
- const mouserectClient = mouseupClient || mousecurrClient;
86
- const xdistance = mousedown && mouserect ? mouserect[0] - mousedown[0] : 0;
87
- const ydistance = mousedown && mouserect ? mouserect[1] - mousedown[1] : 0;
88
67
  const { hview, vview, wheelMode, cursorMode } = model;
89
- const validPan = (cursorMode === 'move' && !ctrlKeyWasUsed) ||
90
- (cursorMode === 'crosshair' && ctrlKeyWasUsed);
91
- const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
92
- (cursorMode === 'crosshair' && !ctrlKeyWasUsed);
93
- useEffect(() => {
94
- function onWheel(event) {
95
- event.preventDefault();
96
- distanceX.current += event.deltaX;
97
- distanceY.current -= event.deltaY;
98
- if (!scheduled.current) {
99
- scheduled.current = true;
100
- window.requestAnimationFrame(() => {
101
- transaction(() => {
102
- if (wheelMode === 'pan') {
103
- hview.scroll(distanceX.current / 3);
104
- vview.scroll(distanceY.current / 10);
105
- }
106
- else if (wheelMode === 'zoom') {
107
- if (Math.abs(distanceY.current) > Math.abs(distanceX.current) * 2 &&
108
- mousecurr) {
109
- const val = distanceY.current < 0 ? 1.1 : 0.9;
110
- hview.zoomTo(hview.bpPerPx * val, mousecurr[0]);
111
- vview.zoomTo(vview.bpPerPx * val, rootRect.height - mousecurr[1]);
112
- }
113
- }
114
- });
115
- scheduled.current = false;
116
- distanceX.current = 0;
117
- distanceY.current = 0;
118
- });
119
- }
120
- }
121
- if (ref.current) {
122
- const curr = ref.current;
123
- curr.addEventListener('wheel', onWheel);
124
- return () => {
125
- curr.removeEventListener('wheel', onWheel);
126
- };
127
- }
128
- return () => { };
129
- }, [hview, vview, wheelMode, mousecurr, rootRect.height]);
130
- useEffect(() => {
131
- function globalMouseMove(event) {
132
- setMouseCurrClient([event.clientX, event.clientY]);
133
- if (mousecurrClient && mousedownClient && validPan && !mouseupClient) {
134
- hview.scroll(-event.clientX + mousecurrClient[0]);
135
- vview.scroll(event.clientY - mousecurrClient[1]);
136
- }
137
- }
138
- window.addEventListener('mousemove', globalMouseMove);
139
- return () => {
140
- window.removeEventListener('mousemove', globalMouseMove);
141
- };
142
- }, [validPan, mousecurrClient, mousedownClient, mouseupClient, hview, vview]);
143
- useEffect(() => {
144
- function globalCtrlKeyDown(event) {
145
- if (event.metaKey || event.ctrlKey) {
146
- setCtrlKeyDown(true);
147
- }
148
- }
149
- function globalCtrlKeyUp(event) {
150
- if (!event.metaKey && !event.ctrlKey) {
151
- setCtrlKeyDown(false);
152
- }
153
- }
154
- window.addEventListener('keydown', globalCtrlKeyDown);
155
- window.addEventListener('keyup', globalCtrlKeyUp);
156
- return () => {
157
- window.removeEventListener('keydown', globalCtrlKeyDown);
158
- window.removeEventListener('keyup', globalCtrlKeyUp);
159
- };
160
- }, []);
161
- useEffect(() => {
162
- function globalMouseUp(event) {
163
- if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
164
- setMouseUpClient([event.clientX, event.clientY]);
165
- }
166
- else {
167
- setMouseDownClient(undefined);
168
- }
169
- }
170
- if (mousedown && !mouseup) {
171
- window.addEventListener('mouseup', globalMouseUp, true);
172
- return () => {
173
- window.removeEventListener('mouseup', globalMouseUp, true);
174
- };
175
- }
176
- return () => { };
177
- }, [validSelect, mousedown, mouseup, xdistance, ydistance]);
68
+ const { mousecurrClient, mousedownClient, mouseupClient, mouseOvered, setMouseCurrClient, setMouseDownClient, setMouseUpClient, setMouseOvered, ref, root, rootRect, mousedown, mousecurr, mouseup, mouserect, mouserectClient, xdistance, ydistance, } = useMouseCoordinates();
69
+ const { ctrlKeyDown, validPan, validSelect, setCtrlKeyWasUsed, setCtrlKeyDown, } = useCursorMode(cursorMode);
70
+ useWheelHandler(ref, wheelMode, hview, vview, mousecurr, rootRect.height);
71
+ useMouseMoveHandler(mousecurrClient, mousedownClient, mouseupClient, validPan, hview, vview, setMouseCurrClient);
72
+ useCtrlKeyTracking(setCtrlKeyDown);
73
+ useMouseUpHandler(mousedown, mouseup, xdistance, ydistance, validSelect, setMouseUpClient, setMouseDownClient);
178
74
  return (_jsxs("div", { children: [_jsx(Header, { model: model, selection: !validSelect || !(mousedown && mouserect)
179
75
  ? undefined
180
76
  : {
@@ -184,54 +80,18 @@ const DotplotViewInternal = observer(function ({ model, }) {
184
80
  setMouseOvered(false);
185
81
  }, onMouseEnter: () => {
186
82
  setMouseOvered(true);
187
- }, children: [_jsxs("div", { className: classes.container, children: [_jsx(VerticalAxis, { model: model }), _jsx(HorizontalAxis, { model: model }), _jsxs("div", { ref: ref, className: classes.content, children: [mouseOvered && validSelect ? (_jsx(Suspense, { fallback: null, children: _jsx(TooltipWhereMouseovered, { model: model, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance }) })) : null, validSelect ? (_jsx(Suspense, { fallback: null, children: _jsx(TooltipWhereClicked, { model: model, mousedown: mousedown, mousedownClient: mousedownClient, xdistance: xdistance, ydistance: ydistance }) })) : null, _jsx("div", { style: { cursor: ctrlKeyDown ? 'pointer' : cursorMode }, onMouseDown: event => {
188
- if (event.button === 0) {
189
- const { clientX, clientY } = event;
190
- setMouseDownClient([clientX, clientY]);
191
- setMouseCurrClient([clientX, clientY]);
192
- setCtrlKeyWasUsed(ctrlKeyDown);
193
- }
194
- }, children: _jsx(Grid, { model: model, children: validSelect && mousedown && mouserect ? (_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 }) }), _jsx("div", { className: classes.spacer })] }), _jsx(RenderedComponent, { model: model }), _jsx(Menu, { open: Boolean(mouseup), onMenuItemClick: (_, callback) => {
195
- callback();
196
- setMouseUpClient(undefined);
197
- setMouseDownClient(undefined);
198
- }, onClose: () => {
199
- setMouseUpClient(undefined);
200
- setMouseDownClient(undefined);
201
- }, anchorReference: "anchorPosition", anchorPosition: mouseupClient
202
- ? {
203
- top: mouseupClient[1] + 50,
204
- left: mouseupClient[0] + 50,
205
- }
206
- : undefined, style: { zIndex: 800 }, menuItems: [
207
- {
208
- label: 'Zoom in',
209
- onClick: () => {
210
- if (mousedown && mouseup) {
211
- model.zoomInToMouseCoords(mousedown, mouseup);
212
- }
213
- setMouseOvered(false);
214
- },
215
- },
216
- {
217
- label: 'Open linear synteny view',
218
- onClick: () => {
219
- if (mousedown && mouseup) {
220
- model.onDotplotView(mousedown, mouseup);
221
- }
222
- setMouseOvered(false);
223
- },
224
- },
225
- ] })] }), _jsx(ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle })] })] }));
83
+ }, children: [_jsxs("div", { className: classes.container, children: [_jsx(VerticalAxis, { model: model }), _jsx(HorizontalAxis, { model: model }), _jsxs("div", { ref: ref, className: classes.content, children: [_jsx(DotplotTooltips, { model: model, mouseOvered: mouseOvered, validSelect: validSelect, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance, mousedown: mousedown, mousedownClient: mousedownClient, ydistance: ydistance }), _jsx(MouseInteractionLayer, { model: model, ctrlKeyDown: ctrlKeyDown, cursorMode: cursorMode, validSelect: validSelect, mousedown: mousedown, mouserect: mouserect, xdistance: xdistance, ydistance: ydistance, setMouseDownClient: setMouseDownClient, setMouseCurrClient: setMouseCurrClient, setCtrlKeyWasUsed: setCtrlKeyWasUsed }), _jsx("div", { className: classes.spacer })] }), _jsx(RenderedComponent, { model: model }), _jsx(SelectionContextMenu, { model: model, mouseup: mouseup, mouseupClient: mouseupClient, mousedown: mousedown, setMouseUpClient: setMouseUpClient, setMouseDownClient: setMouseDownClient, setMouseOvered: setMouseOvered })] }), _jsx(ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle })] })] }));
226
84
  });
227
- const DotplotView = observer(function ({ model }) {
228
- const { initialized, loading, error } = model;
229
- if ((!initialized && !loading) || error) {
85
+ const DotplotView = observer(function DotplotView({ model, }) {
86
+ const { initialized, showLoading, error, loadingMessage } = model;
87
+ if (showLoading) {
88
+ return _jsx(LoadingEllipses, { variant: "h6", message: loadingMessage });
89
+ }
90
+ else if (!initialized || error) {
230
91
  return _jsx(ImportForm, { model: model });
231
92
  }
232
- if (loading) {
233
- return _jsx(LoadingEllipses, { variant: "h6" });
93
+ else {
94
+ return _jsx(DotplotViewInternal, { model: model });
234
95
  }
235
- return _jsx(DotplotViewInternal, { model: model });
236
96
  });
237
97
  export default DotplotView;
@@ -1,4 +1,4 @@
1
- import type { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model.ts';
2
2
  declare const DotplotWarnings: ({ model, }: {
3
3
  model: DotplotViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,17 +1,17 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { lazy, useState } from 'react';
2
+ import { Suspense, lazy, useState } from 'react';
3
3
  import { Alert, Button } from '@mui/material';
4
4
  import { observer } from 'mobx-react';
5
- const WarningDialog = lazy(() => import('./WarningDialog'));
6
- const DotplotWarnings = observer(function ({ model, }) {
7
- const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
5
+ const WarningDialog = lazy(() => import("./WarningDialog.js"));
6
+ const DotplotWarnings = observer(function DotplotWarnings({ model, }) {
7
+ const trackWarnings = model.tracks.filter(t => t.displays[0].warnings?.length);
8
8
  const [shown, setShown] = useState(false);
9
9
  const [hide, setHide] = useState(false);
10
10
  return trackWarnings.length && !hide ? (_jsxs(Alert, { severity: "warning", children: ["Warnings during render", ' ', _jsx(Button, { onClick: () => {
11
11
  setShown(true);
12
- }, children: "More info" }), shown ? (_jsx(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
13
- setShown(false);
14
- } })) : null, _jsx(Button, { variant: "contained", onClick: () => {
12
+ }, children: "More info" }), shown ? (_jsx(Suspense, { fallback: null, children: _jsx(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
13
+ setShown(false);
14
+ } }) })) : null, _jsx(Button, { variant: "contained", onClick: () => {
15
15
  setHide(true);
16
16
  }, children: "Dismiss" })] })) : null;
17
17
  });
@@ -1,4 +1,4 @@
1
- import type { ExportSvgOptions } from '../model';
1
+ import type { ExportSvgOptions } from '../model.ts';
2
2
  export default function ExportSvgDialog({ model, handleClose, }: {
3
3
  model: {
4
4
  exportSvg(opts: ExportSvgOptions): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model.ts';
2
2
  declare const DotplotHeader: ({ model, selection, }: {
3
3
  model: DotplotViewModel;
4
4
  selection?: {
@@ -1,11 +1,11 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { getBpDisplayStr } from '@jbrowse/core/util';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { Typography } from '@mui/material';
4
5
  import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- import DotplotControls from './DotplotControls';
7
- import DotplotWarnings from './DotplotWarnings';
8
- import PanButtons from './PanButtons';
6
+ import DotplotControls from "./DotplotControls.js";
7
+ import DotplotWarnings from "./DotplotWarnings.js";
8
+ import PanButtons from "./PanButtons.js";
9
9
  const useStyles = makeStyles()({
10
10
  bp: {
11
11
  display: 'flex',
@@ -20,7 +20,7 @@ const useStyles = makeStyles()({
20
20
  position: 'relative',
21
21
  },
22
22
  });
23
- const DotplotHeader = observer(function ({ model, selection, }) {
23
+ const DotplotHeader = observer(function DotplotHeader({ model, selection, }) {
24
24
  const { classes } = useStyles();
25
25
  const { hview, vview, showPanButtons } = model;
26
26
  return (_jsxs("div", { className: classes.headerBar, children: [_jsx(DotplotControls, { model: model }), _jsxs(Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: ["x: ", hview.assemblyNames.join(','), " ", getBpDisplayStr(hview.currBp), _jsx("br", {}), "y: ", vview.assemblyNames.join(','), " ", getBpDisplayStr(vview.currBp)] }), selection ? (_jsxs(Typography, { className: classes.bp, variant: "body2", color: "textSecondary", children: [`width:${getBpDisplayStr(hview.bpPerPx * selection.width)}`, " ", _jsx("br", {}), `height:${getBpDisplayStr(vview.bpPerPx * selection.height)}`] })) : null, _jsx("div", { className: classes.spacer }), _jsx(DotplotWarnings, { model: model }), showPanButtons ? _jsx(PanButtons, { model: model }) : null] }));
@@ -1,4 +1,4 @@
1
- import type { DotplotViewModel } from '../../model';
1
+ import type { DotplotViewModel } from '../../model.ts';
2
2
  declare const ImportSyntenyOpenCustomTrack: ({ model, assembly1, assembly2, }: {
3
3
  model: DotplotViewModel;
4
4
  assembly1: string;
@@ -3,10 +3,10 @@ import { useEffect, useState } from 'react';
3
3
  import { ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { FormControlLabel, Grid, Paper, Radio, RadioGroup, Typography, } from '@mui/material';
5
5
  import { observer } from 'mobx-react';
6
- import { getAdapter } from './getAdapter';
7
- import { AnchorsFileSelector, PifGzSelector, SyntenyFileSelector, } from './selectors';
8
- import { basename, extName, getName, stripGz } from './util';
9
- const ImportSyntenyOpenCustomTrack = observer(function ({ model, assembly1, assembly2, }) {
6
+ import { getAdapter } from "./getAdapter.js";
7
+ import { AnchorsFileSelector, PifGzSelector, SyntenyFileSelector, } from "./selectors/index.js";
8
+ import { basename, extName, getName, stripGz } from "./util.js";
9
+ const ImportSyntenyOpenCustomTrack = observer(function ImportSyntenyOpenCustomTrack({ model, assembly1, assembly2, }) {
10
10
  const [swap, setSwap] = useState(false);
11
11
  const [bed2Location, setBed2Location] = useState();
12
12
  const [bed1Location, setBed1Location] = useState();
@@ -71,6 +71,7 @@ const ImportSyntenyOpenCustomTrack = observer(function ({ model, assembly1, asse
71
71
  ].map(extension => (_jsx(FormControlLabel, { value: extension, control: _jsx(Radio, {}), label: extension }, extension))) }) }), _jsx(Grid, { container: true, justifyContent: "center", children: radioOption === '.paf' ||
72
72
  radioOption === '.out' ||
73
73
  radioOption === '.delta' ||
74
- radioOption === '.chain' ? (_jsx(SyntenyFileSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap })) : radioOption === '.anchors' || radioOption === '.anchors.simple' ? (_jsx(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' ? (_jsx(PifGzSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, indexFileLocation: indexFileLocation, setIndexFileLocation: setIndexFileLocation })) : null })] }));
74
+ radioOption === '.chain' ? (_jsx(SyntenyFileSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap })) : radioOption === '.anchors' ||
75
+ radioOption === '.anchors.simple' ? (_jsx(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' ? (_jsx(PifGzSelector, { radioOption: radioOption, fileLocation: fileLocation, setFileLocation: setFileLocation, assembly1: assembly1, assembly2: assembly2, swap: swap, setSwap: setSwap, indexFileLocation: indexFileLocation, setIndexFileLocation: setIndexFileLocation })) : null })] }));
75
76
  });
76
77
  export default ImportSyntenyOpenCustomTrack;
@@ -1,4 +1,4 @@
1
- import type { DotplotViewModel } from '../../model';
1
+ import type { DotplotViewModel } from '../../model.ts';
2
2
  declare const ImportSyntenyTrackSelector: ({ model, assembly1, assembly2, }: {
3
3
  model: DotplotViewModel;
4
4
  assembly1: string;
@@ -13,8 +13,7 @@ function isRelevantTrack(track, assembly1, assembly2) {
13
13
  assemblyNames.includes(assembly2) &&
14
14
  track.type.includes('Synteny'));
15
15
  }
16
- const ImportSyntenyTrackSelector = observer(function ({ model, assembly1, assembly2, }) {
17
- var _a;
16
+ const ImportSyntenyTrackSelector = observer(function ImportSyntenyTrackSelector({ model, assembly1, assembly2, }) {
18
17
  const session = getSession(model);
19
18
  const { tracks, sessionTracks } = session;
20
19
  const allTracks = [
@@ -22,7 +21,7 @@ const ImportSyntenyTrackSelector = observer(function ({ model, assembly1, assemb
22
21
  ...(sessionTracks || []),
23
22
  ];
24
23
  const filteredTracks = allTracks.filter(t => isRelevantTrack(t, assembly2, assembly1));
25
- const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
24
+ const resetTrack = filteredTracks[0]?.trackId || '';
26
25
  const [value, setValue] = useState(resetTrack);
27
26
  useEffect(() => {
28
27
  setValue(resetTrack);
@@ -1,4 +1,13 @@
1
- import type { DotplotViewModel } from '../../model';
1
+ import type { DotplotViewModel } from '../../model.ts';
2
+ export interface DotplotImportFormSyntenyOption {
3
+ value: string;
4
+ label: string;
5
+ ReactComponent: React.FC<{
6
+ model: DotplotViewModel;
7
+ assembly1: string;
8
+ assembly2: string;
9
+ }>;
10
+ }
2
11
  declare const TrackSelector: ({ assembly1, assembly2, model, }: {
3
12
  model: DotplotViewModel;
4
13
  assembly1: string;
@@ -1,11 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useState } from 'react';
3
+ import { getEnv } from '@jbrowse/core/util';
3
4
  import { FormControl, FormControlLabel, FormLabel, Radio, RadioGroup, } from '@mui/material';
4
5
  import { observer } from 'mobx-react';
5
- import ImportSyntenyOpenCustomTrack from './ImportSyntenyOpenCustomTrack';
6
- import ImportSyntenyTrackSelector from './ImportSyntenyTrackSelector';
7
- const TrackSelector = observer(function ({ assembly1, assembly2, model, }) {
6
+ import ImportSyntenyOpenCustomTrack from "./ImportSyntenyOpenCustomTrack.js";
7
+ import ImportSyntenyTrackSelector from "./ImportSyntenyTrackSelector.js";
8
+ const TrackSelector = observer(function TrackSelector({ assembly1, assembly2, model, }) {
9
+ const { pluginManager } = getEnv(model);
8
10
  const [choice, setChoice] = useState('tracklist');
11
+ const customOptions = pluginManager.evaluateExtensionPoint('DotplotView-ImportFormSyntenyOptions', [], { model, assembly1, assembly2 });
12
+ const selectedCustomOption = customOptions.find(opt => opt.value === choice);
9
13
  useEffect(() => {
10
14
  if (choice === 'none') {
11
15
  model.setImportFormSyntenyTrack(0, { type: 'none' });
@@ -13,6 +17,6 @@ const TrackSelector = observer(function ({ assembly1, assembly2, model, }) {
13
17
  }, [model, choice]);
14
18
  return (_jsxs(_Fragment, { children: [_jsxs(FormControl, { children: [_jsx(FormLabel, { id: "group-label", children: "(Optional) Select or add a synteny track" }), _jsxs(RadioGroup, { row: true, value: choice, onChange: event => {
15
19
  setChoice(event.target.value);
16
- }, "aria-labelledby": "group-label", children: [_jsx(FormControlLabel, { value: "none", control: _jsx(Radio, {}), label: "None" }), _jsx(FormControlLabel, { value: "tracklist", control: _jsx(Radio, {}), label: "Existing track" }), _jsx(FormControlLabel, { value: "custom", control: _jsx(Radio, {}), label: "New track" })] })] }), choice === 'custom' ? (_jsx(ImportSyntenyOpenCustomTrack, { model: model, assembly2: assembly2, assembly1: assembly1 })) : null, choice === 'tracklist' ? (_jsx(ImportSyntenyTrackSelector, { model: model, assembly1: assembly1, assembly2: assembly2 })) : null] }));
20
+ }, "aria-labelledby": "group-label", children: [_jsx(FormControlLabel, { value: "none", control: _jsx(Radio, {}), label: "None" }), _jsx(FormControlLabel, { value: "tracklist", control: _jsx(Radio, {}), label: "Existing track" }), _jsx(FormControlLabel, { value: "custom", control: _jsx(Radio, {}), label: "New track" }), customOptions.map(opt => (_jsx(FormControlLabel, { value: opt.value, control: _jsx(Radio, {}), label: opt.label }, opt.value)))] })] }), choice === 'custom' ? (_jsx(ImportSyntenyOpenCustomTrack, { model: model, assembly2: assembly2, assembly1: assembly1 })) : null, choice === 'tracklist' ? (_jsx(ImportSyntenyTrackSelector, { model: model, assembly1: assembly1, assembly2: assembly2 })) : null, selectedCustomOption ? (_jsx(selectedCustomOption.ReactComponent, { model: model, assembly1: assembly1, assembly2: assembly2 })) : null] }));
17
21
  });
18
22
  export default TrackSelector;
@@ -1,4 +1,4 @@
1
- import type { DotplotViewModel } from '../../model';
1
+ import type { DotplotViewModel } from '../../model.ts';
2
2
  declare const DotplotImportForm: ({ model, }: {
3
3
  model: DotplotViewModel;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -2,20 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useState } from 'react';
3
3
  import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
5
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
5
6
  import { Button, Container, FormControl, Grid, Paper, Typography, } from '@mui/material';
6
7
  import { toJS, transaction } from 'mobx';
7
8
  import { observer } from 'mobx-react';
8
- import { makeStyles } from 'tss-react/mui';
9
- import TrackSelector from './TrackSelector';
9
+ import TrackSelector from "./TrackSelector.js";
10
10
  const useStyles = makeStyles()(theme => ({
11
11
  importFormContainer: {
12
12
  padding: theme.spacing(4),
13
13
  margin: '0 auto',
14
14
  },
15
- assemblySelector: {
16
- width: '75%',
17
- margin: '0 auto',
18
- },
19
15
  }));
20
16
  function doSubmit({ model, assembly1, assembly2, }) {
21
17
  const session = getSession(model);
@@ -24,21 +20,19 @@ function doSubmit({ model, assembly1, assembly2, }) {
24
20
  transaction(() => {
25
21
  if (isSessionWithAddTracks(session)) {
26
22
  toJS(importFormSyntenyTrackSelections).map((f, idx) => {
27
- var _a;
28
23
  if (f.type === 'userOpened') {
29
24
  session.addTrackConf(f.value);
30
- model.toggleTrack((_a = f.value) === null || _a === void 0 ? void 0 : _a.trackId);
25
+ model.toggleTrack(f.value?.trackId);
31
26
  }
32
27
  else if (f.type === 'preConfigured') {
33
28
  model.showTrack(f.value, idx);
34
29
  }
35
30
  });
36
31
  }
37
- model.showAllRegions();
38
32
  model.setAssemblyNames(assembly2, assembly1);
39
33
  });
40
34
  }
41
- const DotplotImportForm = observer(function ({ model, }) {
35
+ const DotplotImportForm = observer(function DotplotImportForm({ model, }) {
42
36
  const { classes } = useStyles();
43
37
  const session = getSession(model);
44
38
  const { assemblyNames } = session;
@@ -1,3 +1,3 @@
1
- import type { SelectorProps } from './SelectorTypes';
1
+ import type { SelectorProps } from './SelectorTypes.ts';
2
2
  declare const AnchorsFileSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, bed1Location, setBed1Location, bed2Location, setBed2Location, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default AnchorsFileSelector;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FileSelector } from '@jbrowse/core/ui';
3
3
  import { observer } from 'mobx-react';
4
- import SwapAssemblies from './SwapAssemblies';
5
- const AnchorsFileSelector = observer(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, bed1Location, setBed1Location, bed2Location, setBed2Location, radioOption, }) {
4
+ import SwapAssemblies from "./SwapAssemblies.js";
5
+ const AnchorsFileSelector = observer(function AnchorsFileSelector({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, bed1Location, setBed1Location, bed2Location, setBed2Location, radioOption, }) {
6
6
  return (_jsxs("div", { children: [_jsxs("div", { style: { margin: 20 }, children: ["Open the ", radioOption, " and .bed files for both genome assemblies from the MCScan (Python version) pipeline", ' ', _jsx("a", { href: "https://github.com/tanghaibao/jcvi/wiki/MCscan-(Python-version)", children: "(more info)" })] }), _jsxs("div", { children: [_jsx(FileSelector, { inline: true, name: radioOption, location: fileLocation, setLocation: loc => {
7
7
  setFileLocation(loc);
8
8
  } }), _jsx(FileSelector, { inline: true, name: "genome 1 .bed (left column of anchors file)", description: "", location: bed1Location, setLocation: loc => {
@@ -1,3 +1,3 @@
1
- import type { SelectorProps } from './SelectorTypes';
1
+ import type { SelectorProps } from './SelectorTypes.ts';
2
2
  declare const PifGzSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, indexFileLocation, setIndexFileLocation, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default PifGzSelector;
@@ -1,8 +1,8 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
2
  import { FileSelector } from '@jbrowse/core/ui';
3
3
  import { observer } from 'mobx-react';
4
- import SwapAssemblies from './SwapAssemblies';
5
- const PifGzSelector = observer(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, indexFileLocation = undefined, setIndexFileLocation = () => { }, radioOption, }) {
4
+ import SwapAssemblies from "./SwapAssemblies.js";
5
+ const PifGzSelector = observer(function PifGzSelector({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, indexFileLocation, setIndexFileLocation = () => { }, radioOption, }) {
6
6
  return (_jsxs("div", { children: [_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`"] }), _jsxs("div", { style: { maxWidth: 400, margin: '0 auto' }, children: [_jsx(FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: setFileLocation }), _jsx(FileSelector, { name: `${radioOption} index location (.tbi or .csi)`, inline: true, description: "", location: indexFileLocation, setLocation: setIndexFileLocation }), _jsx(SwapAssemblies, { swap: swap, radioOption: radioOption, assembly1: assembly1, assembly2: assembly2, setSwap: setSwap, text1: "query assembly", text2: "target assembly" })] })] }));
7
7
  });
8
8
  export default PifGzSelector;
@@ -1,9 +1,9 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
2
3
  import HelpIcon from '@mui/icons-material/Help';
3
4
  import { Button, Tooltip } from '@mui/material';
4
5
  import { observer } from 'mobx-react';
5
- import { makeStyles } from 'tss-react/mui';
6
- import { helpStrings } from './SelectorTypes';
6
+ import { helpStrings } from "./SelectorTypes.js";
7
7
  const useStyles = makeStyles()({
8
8
  row: {
9
9
  display: 'flex',
@@ -16,7 +16,7 @@ const useStyles = makeStyles()({
16
16
  alignItems: 'center',
17
17
  },
18
18
  });
19
- const SwapAssemblies = observer(function ({ assembly1, assembly2, swap, setSwap, radioOption, helpContent, text1, text2, }) {
19
+ const SwapAssemblies = observer(function SwapAssemblies({ assembly1, assembly2, swap, setSwap, radioOption, helpContent, text1, text2, }) {
20
20
  const { classes } = useStyles();
21
21
  return (_jsxs("div", { children: [_jsxs("div", { children: ["Verify or click swap", _jsx(Tooltip, { title: helpContent || (_jsx("code", { children: helpStrings[radioOption] })), children: _jsx(HelpIcon, {}) })] }), _jsxs("div", { className: classes.row, children: [_jsxs("div", { className: classes.swap, children: [_jsx("div", { children: _jsx("i", { children: swap ? assembly2 : assembly1 }) }), _jsx("div", { children: text1 }), _jsx("div", { children: _jsx("i", { children: swap ? assembly1 : assembly2 }) }), _jsx("div", { children: text2 })] }), _jsx(Button, { variant: "contained", onClick: () => {
22
22
  if (setSwap) {
@@ -1,3 +1,3 @@
1
- import type { SelectorProps } from './SelectorTypes';
1
+ import type { SelectorProps } from './SelectorTypes.ts';
2
2
  declare const SyntenyFileSelector: ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, radioOption, }: SelectorProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default SyntenyFileSelector;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { FileSelector } from '@jbrowse/core/ui';
3
+ import { makeStyles } from '@jbrowse/core/util/tss-react';
3
4
  import { observer } from 'mobx-react';
4
- import { makeStyles } from 'tss-react/mui';
5
- import SwapAssemblies from './SwapAssemblies';
5
+ import SwapAssemblies from "./SwapAssemblies.js";
6
6
  const useStyles = makeStyles()({
7
7
  container: {
8
8
  display: 'flex',
@@ -10,7 +10,7 @@ const useStyles = makeStyles()({
10
10
  gap: 10,
11
11
  },
12
12
  });
13
- const SyntenyFileSelector = observer(function ({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, radioOption, }) {
13
+ const SyntenyFileSelector = observer(function SyntenyFileSelector({ assembly1, assembly2, swap, setSwap, fileLocation, setFileLocation, radioOption, }) {
14
14
  const { classes } = useStyles();
15
15
  return (_jsxs("div", { className: classes.container, children: [_jsx(FileSelector, { name: `${radioOption} location`, inline: true, description: "", location: fileLocation, setLocation: loc => {
16
16
  setFileLocation(loc);
@@ -1,3 +1,3 @@
1
- export { default as AnchorsFileSelector } from './AnchorsFileSelector';
2
- export { default as PifGzSelector } from './PifGzSelector';
3
- export { default as SyntenyFileSelector } from './SyntenyFileSelector';
1
+ export { default as AnchorsFileSelector } from './AnchorsFileSelector.tsx';
2
+ export { default as PifGzSelector } from './PifGzSelector.tsx';
3
+ export { default as SyntenyFileSelector } from './SyntenyFileSelector.tsx';
@@ -1,3 +1,3 @@
1
- export { default as AnchorsFileSelector } from './AnchorsFileSelector';
2
- export { default as PifGzSelector } from './PifGzSelector';
3
- export { default as SyntenyFileSelector } from './SyntenyFileSelector';
1
+ export { default as AnchorsFileSelector } from "./AnchorsFileSelector.js";
2
+ export { default as PifGzSelector } from "./PifGzSelector.js";
3
+ export { default as SyntenyFileSelector } from "./SyntenyFileSelector.js";
@@ -0,0 +1,5 @@
1
+ import type { DotplotViewModel } from '../model.ts';
2
+ declare const MinLengthSlider: ({ model, }: {
3
+ model: DotplotViewModel;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export default MinLengthSlider;