@jbrowse/plugin-dotplot-view 2.17.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/dist/ComparativeRenderer/index.d.ts +3 -8
  2. package/dist/ComparativeRenderer/index.js +3 -8
  3. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
  4. package/dist/DotplotDisplay/components/DotplotDisplay.js +7 -12
  5. package/dist/DotplotDisplay/index.d.ts +1 -7
  6. package/dist/DotplotDisplay/index.js +2 -12
  7. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  8. package/dist/DotplotDisplay/renderDotplotBlock.js +3 -9
  9. package/dist/DotplotDisplay/stateModelFactory.d.ts +8 -45
  10. package/dist/DotplotDisplay/stateModelFactory.js +57 -100
  11. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  12. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +13 -14
  13. package/dist/DotplotReadVsRef/index.d.ts +1 -1
  14. package/dist/DotplotReadVsRef/index.js +0 -2
  15. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  16. package/dist/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  17. package/dist/DotplotRenderer/DotplotRenderer.d.ts +8 -7
  18. package/dist/DotplotRenderer/DotplotRenderer.js +18 -9
  19. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  20. package/dist/DotplotRenderer/components/DotplotRendering.js +2 -5
  21. package/dist/DotplotRenderer/configSchema.d.ts +0 -21
  22. package/dist/DotplotRenderer/configSchema.js +2 -27
  23. package/dist/DotplotRenderer/drawDotplot.d.ts +3 -3
  24. package/dist/DotplotRenderer/drawDotplot.js +3 -6
  25. package/dist/DotplotRenderer/index.d.ts +1 -1
  26. package/dist/DotplotRenderer/index.js +1 -1
  27. package/dist/DotplotView/1dview.d.ts +2 -77
  28. package/dist/DotplotView/1dview.js +4 -33
  29. package/dist/DotplotView/components/Axes.d.ts +5 -6
  30. package/dist/DotplotView/components/Axes.js +26 -40
  31. package/dist/DotplotView/components/CursorIcon.d.ts +3 -4
  32. package/dist/DotplotView/components/CursorIcon.js +3 -5
  33. package/dist/DotplotView/components/DotplotControls.d.ts +2 -3
  34. package/dist/DotplotView/components/DotplotControls.js +94 -97
  35. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  36. package/dist/DotplotView/components/DotplotTooltipClick.js +3 -7
  37. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  38. package/dist/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  39. package/dist/DotplotView/components/DotplotView.d.ts +2 -3
  40. package/dist/DotplotView/components/DotplotView.js +80 -92
  41. package/dist/DotplotView/components/DotplotWarnings.d.ts +2 -3
  42. package/dist/DotplotView/components/DotplotWarnings.js +26 -21
  43. package/dist/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  44. package/dist/DotplotView/components/ExportSvgDialog.js +32 -67
  45. package/dist/DotplotView/components/Grid.d.ts +3 -4
  46. package/dist/DotplotView/components/Grid.js +19 -32
  47. package/dist/DotplotView/components/Header.d.ts +2 -3
  48. package/dist/DotplotView/components/Header.js +4 -23
  49. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  50. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +129 -0
  51. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  52. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -48
  53. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  54. package/dist/DotplotView/components/ImportForm/TrackSelector.js +23 -0
  55. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  56. package/dist/DotplotView/components/ImportForm/getAdapter.js +68 -0
  57. package/dist/DotplotView/components/ImportForm/index.d.ts +3 -4
  58. package/dist/DotplotView/components/ImportForm/index.js +47 -97
  59. package/dist/DotplotView/components/ImportForm/util.js +1 -3
  60. package/dist/DotplotView/components/PanButtons.d.ts +2 -3
  61. package/dist/DotplotView/components/PanButtons.js +17 -36
  62. package/dist/DotplotView/components/WarningDialog.d.ts +7 -7
  63. package/dist/DotplotView/components/WarningDialog.js +12 -15
  64. package/dist/DotplotView/components/util.d.ts +2 -7
  65. package/dist/DotplotView/components/util.js +0 -5
  66. package/dist/DotplotView/index.d.ts +1 -1
  67. package/dist/DotplotView/index.js +17 -8
  68. package/dist/DotplotView/model.d.ts +11 -133
  69. package/dist/DotplotView/model.js +46 -222
  70. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  71. package/dist/DotplotView/svgcomponents/SVGBackground.js +3 -6
  72. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  73. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  74. package/dist/DotplotView/types.d.ts +12 -0
  75. package/dist/DotplotView/types.js +2 -0
  76. package/dist/LaunchDotplotView.d.ts +1 -1
  77. package/dist/LaunchDotplotView.js +1 -4
  78. package/dist/ServerSideRenderedBlockContent.d.ts +2 -2
  79. package/dist/ServerSideRenderedBlockContent.js +11 -37
  80. package/dist/ServerSideSyntenyRendering.d.ts +1 -6
  81. package/dist/ServerSideSyntenyRendering.js +4 -26
  82. package/dist/index.d.ts +1 -1
  83. package/dist/index.js +3 -6
  84. package/dist/util.d.ts +1 -1
  85. package/esm/ComparativeRenderer/index.d.ts +3 -8
  86. package/esm/ComparativeRenderer/index.js +3 -8
  87. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +2 -3
  88. package/esm/DotplotDisplay/components/DotplotDisplay.js +7 -9
  89. package/esm/DotplotDisplay/index.d.ts +1 -7
  90. package/esm/DotplotDisplay/index.js +2 -12
  91. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +1 -1
  92. package/esm/DotplotDisplay/renderDotplotBlock.js +3 -6
  93. package/esm/DotplotDisplay/stateModelFactory.d.ts +8 -45
  94. package/esm/DotplotDisplay/stateModelFactory.js +58 -101
  95. package/esm/DotplotReadVsRef/DotplotReadVsRef.d.ts +2 -2
  96. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +15 -16
  97. package/esm/DotplotReadVsRef/index.d.ts +1 -1
  98. package/esm/DotplotReadVsRef/index.js +0 -2
  99. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +3 -8
  100. package/esm/DotplotRenderer/ComparativeRenderRpc.js +3 -8
  101. package/esm/DotplotRenderer/DotplotRenderer.d.ts +8 -7
  102. package/esm/DotplotRenderer/DotplotRenderer.js +1 -2
  103. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +2 -3
  104. package/esm/DotplotRenderer/components/DotplotRendering.js +2 -2
  105. package/esm/DotplotRenderer/configSchema.d.ts +0 -21
  106. package/esm/DotplotRenderer/configSchema.js +2 -27
  107. package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
  108. package/esm/DotplotRenderer/drawDotplot.js +4 -7
  109. package/esm/DotplotRenderer/index.d.ts +1 -1
  110. package/esm/DotplotRenderer/index.js +1 -1
  111. package/esm/DotplotView/1dview.d.ts +2 -77
  112. package/esm/DotplotView/1dview.js +4 -33
  113. package/esm/DotplotView/components/Axes.d.ts +5 -6
  114. package/esm/DotplotView/components/Axes.js +26 -37
  115. package/esm/DotplotView/components/CursorIcon.d.ts +3 -4
  116. package/esm/DotplotView/components/CursorIcon.js +3 -5
  117. package/esm/DotplotView/components/DotplotControls.d.ts +2 -3
  118. package/esm/DotplotView/components/DotplotControls.js +94 -97
  119. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -3
  120. package/esm/DotplotView/components/DotplotTooltipClick.js +3 -7
  121. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +2 -3
  122. package/esm/DotplotView/components/DotplotTooltipMouseover.js +4 -8
  123. package/esm/DotplotView/components/DotplotView.d.ts +2 -3
  124. package/esm/DotplotView/components/DotplotView.js +63 -85
  125. package/esm/DotplotView/components/DotplotWarnings.d.ts +2 -3
  126. package/esm/DotplotView/components/DotplotWarnings.js +9 -14
  127. package/esm/DotplotView/components/ExportSvgDialog.d.ts +2 -3
  128. package/esm/DotplotView/components/ExportSvgDialog.js +32 -44
  129. package/esm/DotplotView/components/Grid.d.ts +3 -4
  130. package/esm/DotplotView/components/Grid.js +19 -29
  131. package/esm/DotplotView/components/Header.d.ts +2 -3
  132. package/esm/DotplotView/components/Header.js +4 -23
  133. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +7 -0
  134. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +124 -0
  135. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +4 -6
  136. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +17 -25
  137. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +7 -0
  138. package/esm/DotplotView/components/ImportForm/TrackSelector.js +18 -0
  139. package/esm/DotplotView/components/ImportForm/getAdapter.d.ts +117 -0
  140. package/esm/DotplotView/components/ImportForm/getAdapter.js +65 -0
  141. package/esm/DotplotView/components/ImportForm/index.d.ts +3 -4
  142. package/esm/DotplotView/components/ImportForm/index.js +48 -75
  143. package/esm/DotplotView/components/ImportForm/util.js +1 -3
  144. package/esm/DotplotView/components/PanButtons.d.ts +2 -3
  145. package/esm/DotplotView/components/PanButtons.js +17 -36
  146. package/esm/DotplotView/components/WarningDialog.d.ts +7 -7
  147. package/esm/DotplotView/components/WarningDialog.js +12 -12
  148. package/esm/DotplotView/components/util.d.ts +2 -7
  149. package/esm/DotplotView/components/util.js +0 -5
  150. package/esm/DotplotView/index.d.ts +1 -1
  151. package/esm/DotplotView/index.js +0 -1
  152. package/esm/DotplotView/model.d.ts +11 -133
  153. package/esm/DotplotView/model.js +30 -216
  154. package/esm/DotplotView/svgcomponents/SVGBackground.d.ts +1 -2
  155. package/esm/DotplotView/svgcomponents/SVGBackground.js +3 -3
  156. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  157. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +6 -24
  158. package/esm/DotplotView/types.d.ts +12 -0
  159. package/esm/DotplotView/types.js +1 -0
  160. package/esm/LaunchDotplotView.d.ts +1 -1
  161. package/esm/LaunchDotplotView.js +1 -4
  162. package/esm/ServerSideRenderedBlockContent.d.ts +2 -2
  163. package/esm/ServerSideRenderedBlockContent.js +11 -14
  164. package/esm/ServerSideSyntenyRendering.d.ts +1 -6
  165. package/esm/ServerSideSyntenyRendering.js +4 -3
  166. package/esm/index.d.ts +1 -1
  167. package/esm/index.js +3 -6
  168. package/esm/util.d.ts +1 -1
  169. package/package.json +2 -4
  170. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  171. package/dist/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -194
  172. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.d.ts +0 -11
  173. package/esm/DotplotView/components/ImportForm/ImportCustomTrack.js +0 -169
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model';
3
2
  declare const DotplotView: ({ model }: {
4
3
  model: DotplotViewModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default DotplotView;
@@ -1,12 +1,13 @@
1
- import React, { useState, useEffect, useRef, lazy, Suspense } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Suspense, lazy, useEffect, useRef, useState } from 'react';
2
3
  import { LoadingEllipses, Menu, ResizeHandle } from '@jbrowse/core/ui';
3
- import { observer } from 'mobx-react';
4
4
  import { transaction } from 'mobx';
5
+ import { observer } from 'mobx-react';
5
6
  import { makeStyles } from 'tss-react/mui';
6
- import ImportForm from './ImportForm';
7
- import Header from './Header';
7
+ import { HorizontalAxis, VerticalAxis } from './Axes';
8
8
  import Grid from './Grid';
9
- import { VerticalAxis, HorizontalAxis } from './Axes';
9
+ import Header from './Header';
10
+ import ImportForm from './ImportForm';
10
11
  const TooltipWhereClicked = lazy(() => import('./DotplotTooltipClick'));
11
12
  const TooltipWhereMouseovered = lazy(() => import('./DotplotTooltipMouseover'));
12
13
  const blank = { left: 0, top: 0, width: 0, height: 0 };
@@ -32,7 +33,7 @@ const useStyles = makeStyles()(theme => ({
32
33
  width: '100%',
33
34
  gridRow: '1/2',
34
35
  gridColumn: '2/2',
35
- zIndex: 100, // needs to be below controls
36
+ zIndex: 100,
36
37
  '& path': {
37
38
  cursor: 'crosshair',
38
39
  fill: 'none',
@@ -50,18 +51,16 @@ const useStyles = makeStyles()(theme => ({
50
51
  borderTop: '1px solid #fafafa',
51
52
  },
52
53
  }));
53
- // produces offsetX/offsetY coordinates from a clientX and an element's
54
- // getBoundingClientRect
55
54
  function getOffset(coord, rect) {
56
55
  return coord && [coord[0] - rect.left, coord[1] - rect.top];
57
56
  }
58
57
  const RenderedComponent = observer(({ model }) => {
59
58
  const { classes } = useStyles();
60
- return (React.createElement("div", { className: classes.overlay }, model.tracks.map(track => {
61
- const [display] = track.displays;
62
- const { RenderingComponent } = display;
63
- return RenderingComponent ? (React.createElement(RenderingComponent, { key: track.configuration.trackId, model: display })) : null;
64
- })));
59
+ return (_jsx("div", { className: classes.overlay, children: model.tracks.map(track => {
60
+ const [display] = track.displays;
61
+ const { RenderingComponent } = display;
62
+ return RenderingComponent ? (_jsx(RenderingComponent, { model: display }, track.configuration.trackId)) : null;
63
+ }) }));
65
64
  });
66
65
  const DotplotViewInternal = observer(function ({ model, }) {
67
66
  var _a, _b;
@@ -91,7 +90,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
91
90
  (cursorMode === 'crosshair' && ctrlKeyWasUsed);
92
91
  const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
93
92
  (cursorMode === 'crosshair' && !ctrlKeyWasUsed);
94
- // use non-React wheel handler to properly prevent body scrolling
95
93
  useEffect(() => {
96
94
  function onWheel(event) {
97
95
  event.preventDefault();
@@ -160,8 +158,6 @@ const DotplotViewInternal = observer(function ({ model, }) {
160
158
  window.addEventListener('keyup', globalCtrlKeyUp);
161
159
  };
162
160
  }, []);
163
- // detect a mouseup after a mousedown was submitted, autoremoves mouseup once
164
- // that single mouseup is set
165
161
  useEffect(() => {
166
162
  function globalMouseUp(event) {
167
163
  if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
@@ -179,81 +175,63 @@ const DotplotViewInternal = observer(function ({ model, }) {
179
175
  }
180
176
  return () => { };
181
177
  }, [validSelect, mousedown, mouseup, xdistance, ydistance]);
182
- return (React.createElement("div", null,
183
- React.createElement(Header, { model: model, selection: !validSelect || !(mousedown && mouserect)
184
- ? undefined
185
- : {
186
- width: Math.abs(xdistance),
187
- height: Math.abs(ydistance),
188
- } }),
189
- React.createElement("div", { ref: root, className: classes.root, onMouseLeave: () => {
190
- setMouseOvered(false);
191
- }, onMouseEnter: () => {
192
- setMouseOvered(true);
193
- } },
194
- React.createElement("div", { className: classes.container },
195
- React.createElement(VerticalAxis, { model: model }),
196
- React.createElement(HorizontalAxis, { model: model }),
197
- React.createElement("div", { ref: ref, className: classes.content },
198
- mouseOvered && validSelect ? (React.createElement(Suspense, { fallback: null },
199
- React.createElement(TooltipWhereMouseovered, { model: model, mouserect: mouserect, mouserectClient: mouserectClient, xdistance: xdistance }))) : null,
200
- validSelect ? (React.createElement(Suspense, { fallback: null },
201
- React.createElement(TooltipWhereClicked, { model: model, mousedown: mousedown, mousedownClient: mousedownClient, xdistance: xdistance, ydistance: ydistance }))) : null,
202
- React.createElement("div", { style: { cursor: ctrlKeyDown ? 'pointer' : cursorMode }, onMouseDown: event => {
203
- if (event.button === 0) {
204
- const { clientX, clientY } = event;
205
- setMouseDownClient([clientX, clientY]);
206
- setMouseCurrClient([clientX, clientY]);
207
- setCtrlKeyWasUsed(ctrlKeyDown);
208
- }
209
- } },
210
- React.createElement(Grid, { model: model }, validSelect && mousedown && mouserect ? (React.createElement("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)),
211
- React.createElement("div", { className: classes.spacer })),
212
- React.createElement(RenderedComponent, { model: model }),
213
- React.createElement(Menu, { open: Boolean(mouseup), onMenuItemClick: (_, callback) => {
214
- callback();
215
- setMouseUpClient(undefined);
216
- setMouseDownClient(undefined);
217
- }, onClose: () => {
218
- setMouseUpClient(undefined);
219
- setMouseDownClient(undefined);
220
- }, anchorReference: "anchorPosition", anchorPosition: mouseupClient
221
- ? {
222
- top: mouseupClient[1] + 50,
223
- left: mouseupClient[0] + 50,
224
- }
225
- : undefined, style: { zIndex: 10000 }, menuItems: [
226
- {
227
- label: 'Zoom in',
228
- onClick: () => {
229
- if (mousedown && mouseup) {
230
- model.zoomInToMouseCoords(mousedown, mouseup);
231
- }
232
- // below line is needed to prevent tooltip from sticking
233
- setMouseOvered(false);
234
- },
235
- },
236
- {
237
- label: 'Open linear synteny view',
238
- onClick: () => {
239
- if (mousedown && mouseup) {
240
- model.onDotplotView(mousedown, mouseup);
241
- }
242
- // below line is needed to prevent tooltip from sticking
243
- setMouseOvered(false);
244
- },
245
- },
246
- ] })),
247
- React.createElement(ResizeHandle, { onDrag: n => model.setHeight(model.height + n), className: classes.resizeHandle }))));
178
+ return (_jsxs("div", { children: [_jsx(Header, { model: model, selection: !validSelect || !(mousedown && mouserect)
179
+ ? undefined
180
+ : {
181
+ width: Math.abs(xdistance),
182
+ height: Math.abs(ydistance),
183
+ } }), _jsxs("div", { ref: root, className: classes.root, onMouseLeave: () => {
184
+ setMouseOvered(false);
185
+ }, onMouseEnter: () => {
186
+ 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: 10000 }, 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 })] })] }));
248
226
  });
249
227
  const DotplotView = observer(function ({ model }) {
250
228
  const { initialized, loading, error } = model;
251
229
  if ((!initialized && !loading) || error) {
252
- return React.createElement(ImportForm, { model: model });
230
+ return _jsx(ImportForm, { model: model });
253
231
  }
254
232
  if (loading) {
255
- return React.createElement(LoadingEllipses, { variant: "h6" });
233
+ return _jsx(LoadingEllipses, { variant: "h6" });
256
234
  }
257
- return React.createElement(DotplotViewInternal, { model: model });
235
+ return _jsx(DotplotViewInternal, { model: model });
258
236
  });
259
237
  export default DotplotView;
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model';
3
2
  declare const DotplotWarnings: ({ model, }: {
4
3
  model: DotplotViewModel;
5
- }) => React.JSX.Element | null;
4
+ }) => import("react/jsx-runtime").JSX.Element | null;
6
5
  export default DotplotWarnings;
@@ -1,23 +1,18 @@
1
- import React, { lazy, useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { lazy, useState } from 'react';
2
3
  import { Alert, Button } from '@mui/material';
3
4
  import { observer } from 'mobx-react';
4
- // lazy components
5
5
  const WarningDialog = lazy(() => import('./WarningDialog'));
6
6
  const DotplotWarnings = observer(function ({ model, }) {
7
7
  const trackWarnings = model.tracks.filter(t => { var _a; return (_a = t.displays[0].warnings) === null || _a === void 0 ? void 0 : _a.length; });
8
8
  const [shown, setShown] = useState(false);
9
9
  const [hide, setHide] = useState(false);
10
- return trackWarnings.length && !hide ? (React.createElement(Alert, { severity: "warning" },
11
- "Warnings during render",
12
- ' ',
13
- React.createElement(Button, { onClick: () => {
14
- setShown(true);
15
- } }, "More info"),
16
- shown ? (React.createElement(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
17
- setShown(false);
18
- } })) : null,
19
- React.createElement(Button, { variant: "contained", onClick: () => {
20
- setHide(true);
21
- } }, "Dismiss"))) : null;
10
+ return trackWarnings.length && !hide ? (_jsxs(Alert, { severity: "warning", children: ["Warnings during render", ' ', _jsx(Button, { onClick: () => {
11
+ setShown(true);
12
+ }, children: "More info" }), shown ? (_jsx(WarningDialog, { trackWarnings: trackWarnings, handleClose: () => {
13
+ setShown(false);
14
+ } })) : null, _jsx(Button, { variant: "contained", onClick: () => {
15
+ setHide(true);
16
+ }, children: "Dismiss" })] })) : null;
22
17
  });
23
18
  export default DotplotWarnings;
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
- import { ExportSvgOptions } from '../model';
1
+ import type { ExportSvgOptions } from '../model';
3
2
  export default function ExportSvgDialog({ model, handleClose, }: {
4
3
  model: {
5
4
  exportSvg(opts: ExportSvgOptions): Promise<void>;
6
5
  };
7
6
  handleClose: () => void;
8
- }): React.JSX.Element;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,13 @@
1
- import React, { useState } from 'react';
2
- import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
3
  import { Dialog, ErrorMessage } from '@jbrowse/core/ui';
4
4
  import { getSession, useLocalStorage } from '@jbrowse/core/util';
5
+ import { Button, Checkbox, CircularProgress, DialogActions, DialogContent, FormControlLabel, MenuItem, TextField, Typography, } from '@mui/material';
5
6
  function LoadingMessage() {
6
- return (React.createElement("div", null,
7
- React.createElement(CircularProgress, { size: 20, style: { marginRight: 20 } }),
8
- React.createElement(Typography, { display: "inline" }, "Creating SVG")));
7
+ return (_jsxs("div", { children: [_jsx(CircularProgress, { size: 20, style: { marginRight: 20 } }), _jsx(Typography, { display: "inline", children: "Creating SVG" })] }));
9
8
  }
10
9
  function TextField2({ children, ...rest }) {
11
- return (React.createElement("div", null,
12
- React.createElement(TextField, { ...rest }, children)));
10
+ return (_jsx("div", { children: _jsx(TextField, { ...rest, children: children }) }));
13
11
  }
14
12
  function useSvgLocal(key, val) {
15
13
  return useLocalStorage(`svg-${key}`, val);
@@ -22,41 +20,31 @@ export default function ExportSvgDialog({ model, handleClose, }) {
22
20
  const [error, setError] = useState();
23
21
  const [filename, setFilename] = useSvgLocal('file', 'jbrowse.svg');
24
22
  const [themeName, setThemeName] = useSvgLocal('theme', session.themeName || 'default');
25
- return (React.createElement(Dialog, { open: true, onClose: handleClose, title: "Export SVG" },
26
- React.createElement(DialogContent, null,
27
- error ? (React.createElement(ErrorMessage, { error: error })) : loading ? (React.createElement(LoadingMessage, null)) : null,
28
- React.createElement(TextField2, { helperText: "filename", value: filename, onChange: event => {
29
- setFilename(event.target.value);
30
- } }),
31
- session.allThemes ? (React.createElement(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
32
- setThemeName(event.target.value);
33
- } }, Object.entries(session.allThemes()).map(([key, val]) => (React.createElement(MenuItem, { key: key, value: key },
34
- // @ts-expect-error
35
- val.name || '(Unknown name)'))))) : null,
36
- offscreenCanvas ? (React.createElement(FormControlLabel, { control: React.createElement(Checkbox, { checked: rasterizeLayers, onChange: () => {
37
- setRasterizeLayers(val => !val);
38
- } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (React.createElement(Typography, null, "Note: rasterizing layers not yet supported in this browser, so SVG size may be large"))),
39
- React.createElement(DialogActions, null,
40
- React.createElement(Button, { variant: "contained", color: "secondary", onClick: () => {
41
- handleClose();
42
- } }, "Cancel"),
43
- React.createElement(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
44
- setLoading(true);
45
- setError(undefined);
46
- try {
47
- await model.exportSvg({
48
- rasterizeLayers,
49
- filename,
50
- themeName,
51
- });
52
- handleClose();
53
- }
54
- catch (e) {
55
- console.error(e);
56
- setError(e);
57
- }
58
- finally {
59
- setLoading(false);
60
- }
61
- } }, "Submit"))));
23
+ return (_jsxs(Dialog, { open: true, onClose: handleClose, title: "Export SVG", children: [_jsxs(DialogContent, { children: [error ? (_jsx(ErrorMessage, { error: error })) : loading ? (_jsx(LoadingMessage, {})) : null, _jsx(TextField2, { helperText: "filename", value: filename, onChange: event => {
24
+ setFilename(event.target.value);
25
+ } }), session.allThemes ? (_jsx(TextField2, { select: true, label: "Theme", value: themeName, onChange: event => {
26
+ setThemeName(event.target.value);
27
+ }, children: Object.entries(session.allThemes()).map(([key, val]) => (_jsx(MenuItem, { value: key, children: val.name || '(Unknown name)' }, key))) })) : null, offscreenCanvas ? (_jsx(FormControlLabel, { control: _jsx(Checkbox, { checked: rasterizeLayers, onChange: () => {
28
+ setRasterizeLayers(val => !val);
29
+ } }), label: "Rasterize canvas based tracks? File may be much larger if this is turned off" })) : (_jsx(Typography, { children: "Note: rasterizing layers not yet supported in this browser, so SVG size may be large" }))] }), _jsxs(DialogActions, { children: [_jsx(Button, { variant: "contained", color: "secondary", onClick: () => {
30
+ handleClose();
31
+ }, children: "Cancel" }), _jsx(Button, { variant: "contained", color: "primary", type: "submit", onClick: async () => {
32
+ setLoading(true);
33
+ setError(undefined);
34
+ try {
35
+ await model.exportSvg({
36
+ rasterizeLayers,
37
+ filename,
38
+ themeName,
39
+ });
40
+ handleClose();
41
+ }
42
+ catch (e) {
43
+ console.error(e);
44
+ setError(e);
45
+ }
46
+ finally {
47
+ setLoading(false);
48
+ }
49
+ }, children: "Submit" })] })] }));
62
50
  }
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model';
3
2
  export declare const GridRaw: ({ model, children, }: {
4
3
  model: DotplotViewModel;
5
4
  children?: React.ReactNode;
6
- }) => React.JSX.Element | null;
5
+ }) => import("react/jsx-runtime").JSX.Element | null;
7
6
  export default function Grid({ model, children, }: {
8
7
  model: DotplotViewModel;
9
8
  children?: React.ReactNode;
10
- }): React.JSX.Element;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,7 +1,7 @@
1
- import React from 'react';
2
- import { observer } from 'mobx-react';
3
- import { useTheme } from '@mui/material';
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
2
  import { getFillProps, getStrokeProps } from '@jbrowse/core/util';
3
+ import { useTheme } from '@mui/material';
4
+ import { observer } from 'mobx-react';
5
5
  export const GridRaw = observer(function ({ model, children, }) {
6
6
  const { viewWidth, viewHeight, hview, vview } = model;
7
7
  const hblocks = hview.dynamicBlocks.contentBlocks;
@@ -15,39 +15,29 @@ export const GridRaw = observer(function ({ model, children, }) {
15
15
  const vbottom = vblocks[0].offsetPx - vview.offsetPx;
16
16
  const theme = useTheme();
17
17
  const stroke = theme.palette.divider;
18
- // Uses math.max/min avoid making very large SVG rect offscreen element,
19
- // which can sometimes fail to draw
20
18
  const rx = Math.max(hbottom, 0);
21
19
  const ry = Math.max(viewHeight - vtop, 0);
22
20
  const w = Math.min(htop - hbottom, viewWidth);
23
21
  const h = Math.min(viewHeight - vbottom - ry, viewHeight);
24
22
  let lastx = Number.POSITIVE_INFINITY;
25
23
  let lasty = Number.POSITIVE_INFINITY;
26
- return (React.createElement(React.Fragment, null,
27
- React.createElement("rect", { x: rx, y: ry, width: w, height: h, ...getFillProps(theme.palette.background.default) }),
28
- React.createElement("g", null,
29
- hblocks.map(region => {
30
- const x = region.offsetPx - hview.offsetPx;
31
- const render = Math.floor(x) !== Math.floor(lastx);
32
- if (render) {
33
- lastx = x;
34
- }
35
- return render ? (React.createElement("line", { key: JSON.stringify(region), x1: x, y1: 0, x2: x, y2: viewHeight, ...getStrokeProps(stroke) })) : null;
36
- }),
37
- vblocks.map(region => {
38
- const y = viewHeight - (region.offsetPx - vview.offsetPx);
39
- const render = Math.floor(y) !== Math.floor(lasty);
40
- if (render) {
41
- lasty = y;
42
- }
43
- return render ? (React.createElement("line", { key: JSON.stringify(region), x1: 0, y1: y, x2: viewWidth, y2: y, ...getStrokeProps(stroke) })) : null;
44
- }),
45
- React.createElement("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...getStrokeProps(stroke) }),
46
- React.createElement("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...getStrokeProps(stroke) })),
47
- children));
24
+ return (_jsxs(_Fragment, { children: [_jsx("rect", { x: rx, y: ry, width: w, height: h, ...getFillProps(theme.palette.background.default) }), _jsxs("g", { children: [hblocks.map(region => {
25
+ const x = region.offsetPx - hview.offsetPx;
26
+ const render = Math.floor(x) !== Math.floor(lastx);
27
+ if (render) {
28
+ lastx = x;
29
+ }
30
+ return render ? (_jsx("line", { x1: x, y1: 0, x2: x, y2: viewHeight, ...getStrokeProps(stroke) }, JSON.stringify(region))) : null;
31
+ }), vblocks.map(region => {
32
+ const y = viewHeight - (region.offsetPx - vview.offsetPx);
33
+ const render = Math.floor(y) !== Math.floor(lasty);
34
+ if (render) {
35
+ lasty = y;
36
+ }
37
+ return render ? (_jsx("line", { x1: 0, y1: y, x2: viewWidth, y2: y, ...getStrokeProps(stroke) }, JSON.stringify(region))) : null;
38
+ }), _jsx("line", { x1: htop, y1: 0, x2: htop, y2: viewHeight, ...getStrokeProps(stroke) }), _jsx("line", { x1: 0, y1: viewHeight - vtop, x2: viewWidth, y2: viewHeight - vtop, ...getStrokeProps(stroke) })] }), children] }));
48
39
  });
49
40
  export default function Grid({ model, children, }) {
50
41
  const { viewWidth, viewHeight } = model;
51
- return (React.createElement("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' } },
52
- React.createElement(GridRaw, { model: model }, children)));
42
+ return (_jsx("svg", { width: viewWidth, height: viewHeight, style: { background: 'rgba(0,0,0,0.12)' }, children: _jsx(GridRaw, { model: model, children: children }) }));
53
43
  }
@@ -1,10 +1,9 @@
1
- import React from 'react';
2
- import { DotplotViewModel } from '../model';
1
+ import type { DotplotViewModel } from '../model';
3
2
  declare const DotplotHeader: ({ model, selection, }: {
4
3
  model: DotplotViewModel;
5
4
  selection?: {
6
5
  width: number;
7
6
  height: number;
8
7
  };
9
- }) => React.JSX.Element;
8
+ }) => import("react/jsx-runtime").JSX.Element;
10
9
  export default DotplotHeader;
@@ -1,11 +1,11 @@
1
- import React from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { getBpDisplayStr } from '@jbrowse/core/util';
2
3
  import { Typography } from '@mui/material';
3
4
  import { observer } from 'mobx-react';
4
5
  import { makeStyles } from 'tss-react/mui';
5
- import { getBpDisplayStr } from '@jbrowse/core/util';
6
+ import DotplotControls from './DotplotControls';
6
7
  import DotplotWarnings from './DotplotWarnings';
7
8
  import PanButtons from './PanButtons';
8
- import DotplotControls from './DotplotControls';
9
9
  const useStyles = makeStyles()({
10
10
  bp: {
11
11
  display: 'flex',
@@ -23,25 +23,6 @@ const useStyles = makeStyles()({
23
23
  const DotplotHeader = observer(function ({ model, selection, }) {
24
24
  const { classes } = useStyles();
25
25
  const { hview, vview, showPanButtons } = model;
26
- return (React.createElement("div", { className: classes.headerBar },
27
- React.createElement(DotplotControls, { model: model }),
28
- React.createElement(Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
29
- "x: ",
30
- hview.assemblyNames.join(','),
31
- " ",
32
- getBpDisplayStr(hview.currBp),
33
- React.createElement("br", null),
34
- "y: ",
35
- vview.assemblyNames.join(','),
36
- " ",
37
- getBpDisplayStr(vview.currBp)),
38
- selection ? (React.createElement(Typography, { className: classes.bp, variant: "body2", color: "textSecondary" },
39
- `width:${getBpDisplayStr(hview.bpPerPx * selection.width)}`,
40
- " ",
41
- React.createElement("br", null),
42
- `height:${getBpDisplayStr(vview.bpPerPx * selection.height)}`)) : null,
43
- React.createElement("div", { className: classes.spacer }),
44
- React.createElement(DotplotWarnings, { model: model }),
45
- showPanButtons ? React.createElement(PanButtons, { model: model }) : null));
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] }));
46
27
  });
47
28
  export default DotplotHeader;
@@ -0,0 +1,7 @@
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;