@jbrowse/plugin-dotplot-view 3.7.0 → 4.0.1

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 (224) hide show
  1. package/esm/ComparativeRenderer/index.d.ts +10 -10
  2. package/esm/ComparativeRenderer/index.js +4 -17
  3. package/esm/DiagonalizeDotplotRpc.js +9 -12
  4. package/esm/DotplotDisplay/components/DotplotDisplay.d.ts +1 -1
  5. package/esm/DotplotDisplay/index.d.ts +3 -3
  6. package/esm/DotplotDisplay/index.js +4 -4
  7. package/esm/DotplotDisplay/renderDotplotBlock.d.ts +2 -1
  8. package/esm/DotplotDisplay/renderDotplotBlock.js +6 -4
  9. package/esm/DotplotDisplay/stateModelFactory.d.ts +143 -30
  10. package/esm/DotplotDisplay/stateModelFactory.js +5 -14
  11. package/esm/DotplotReadVsRef/DotplotReadVsRef.js +5 -6
  12. package/esm/DotplotReadVsRef/index.js +1 -1
  13. package/esm/DotplotRenderer/DotplotRenderer.d.ts +30 -39
  14. package/esm/DotplotRenderer/DotplotRenderer.js +55 -22
  15. package/esm/DotplotRenderer/components/DotplotRendering.d.ts +1 -1
  16. package/esm/DotplotRenderer/components/DotplotRendering.js +1 -1
  17. package/esm/DotplotRenderer/configSchema.d.ts +3 -3
  18. package/esm/DotplotRenderer/configSchema.js +1 -1
  19. package/esm/DotplotRenderer/drawDotplot.d.ts +3 -3
  20. package/esm/DotplotRenderer/drawDotplot.js +5 -6
  21. package/esm/DotplotRenderer/index.js +4 -4
  22. package/esm/DotplotView/1dview.d.ts +25 -25
  23. package/esm/DotplotView/1dview.js +13 -3
  24. package/esm/DotplotView/components/Axes.d.ts +1 -1
  25. package/esm/DotplotView/components/Axes.js +31 -41
  26. package/esm/DotplotView/components/ColorBySelector.d.ts +1 -1
  27. package/esm/DotplotView/components/ColorBySelector.js +3 -4
  28. package/esm/DotplotView/components/DiagonalizationProgressDialog.d.ts +1 -1
  29. package/esm/DotplotView/components/DiagonalizationProgressDialog.js +1 -1
  30. package/esm/DotplotView/components/DotplotControls.d.ts +1 -1
  31. package/esm/DotplotView/components/DotplotControls.js +7 -8
  32. package/esm/DotplotView/components/DotplotGrid.d.ts +6 -0
  33. package/esm/DotplotView/components/{Grid.js → DotplotGrid.js} +19 -20
  34. package/esm/DotplotView/components/DotplotGridWrapper.d.ts +6 -0
  35. package/esm/DotplotView/components/DotplotGridWrapper.js +8 -0
  36. package/esm/DotplotView/components/DotplotTooltipClick.d.ts +2 -2
  37. package/esm/DotplotView/components/DotplotTooltipClick.js +4 -4
  38. package/esm/DotplotView/components/DotplotTooltipMouseover.d.ts +1 -1
  39. package/esm/DotplotView/components/DotplotTooltipMouseover.js +2 -2
  40. package/esm/DotplotView/components/DotplotTooltips.d.ts +1 -1
  41. package/esm/DotplotView/components/DotplotTooltips.js +2 -2
  42. package/esm/DotplotView/components/DotplotView.d.ts +2 -2
  43. package/esm/DotplotView/components/DotplotView.js +23 -21
  44. package/esm/DotplotView/components/DotplotWarnings.d.ts +1 -1
  45. package/esm/DotplotView/components/DotplotWarnings.js +3 -3
  46. package/esm/DotplotView/components/ExportSvgDialog.d.ts +1 -1
  47. package/esm/DotplotView/components/Header.d.ts +1 -1
  48. package/esm/DotplotView/components/Header.js +5 -5
  49. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +1 -1
  50. package/esm/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +6 -5
  51. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +1 -1
  52. package/esm/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +2 -3
  53. package/esm/DotplotView/components/ImportForm/TrackSelector.d.ts +10 -1
  54. package/esm/DotplotView/components/ImportForm/TrackSelector.js +8 -4
  55. package/esm/DotplotView/components/ImportForm/index.d.ts +1 -1
  56. package/esm/DotplotView/components/ImportForm/index.js +4 -9
  57. package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +1 -1
  58. package/esm/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +2 -2
  59. package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +1 -1
  60. package/esm/DotplotView/components/ImportForm/selectors/PifGzSelector.js +2 -2
  61. package/esm/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +3 -3
  62. package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +1 -1
  63. package/esm/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +3 -3
  64. package/esm/DotplotView/components/ImportForm/selectors/index.d.ts +3 -3
  65. package/esm/DotplotView/components/ImportForm/selectors/index.js +3 -3
  66. package/esm/DotplotView/components/MinLengthSlider.d.ts +1 -1
  67. package/esm/DotplotView/components/MinLengthSlider.js +7 -7
  68. package/esm/DotplotView/components/MouseInteractionLayer.d.ts +3 -3
  69. package/esm/DotplotView/components/MouseInteractionLayer.js +6 -4
  70. package/esm/DotplotView/components/OpacitySlider.d.ts +1 -1
  71. package/esm/DotplotView/components/OpacitySlider.js +5 -6
  72. package/esm/DotplotView/components/PanButtons.d.ts +1 -1
  73. package/esm/DotplotView/components/PanButtons.js +1 -1
  74. package/esm/DotplotView/components/SelectionContextMenu.d.ts +1 -1
  75. package/esm/DotplotView/components/WarningDialog.js +1 -1
  76. package/esm/DotplotView/components/util.d.ts +1 -1
  77. package/esm/DotplotView/components/util.js +17 -5
  78. package/esm/DotplotView/index.js +2 -2
  79. package/esm/DotplotView/model.d.ts +208 -90
  80. package/esm/DotplotView/model.js +118 -79
  81. package/esm/DotplotView/svgcomponents/SVGDotplotView.d.ts +1 -1
  82. package/esm/DotplotView/svgcomponents/SVGDotplotView.js +5 -6
  83. package/esm/DotplotView/types.d.ts +7 -1
  84. package/esm/LaunchDotplotView.js +6 -36
  85. package/esm/ServerSideRenderedBlockContent.js +2 -6
  86. package/esm/ServerSideSyntenyRendering.d.ts +1 -1
  87. package/esm/ServerSideSyntenyRendering.js +1 -1
  88. package/esm/index.d.ts +1 -0
  89. package/esm/index.js +8 -11
  90. package/esm/util.d.ts +1 -1
  91. package/package.json +28 -35
  92. package/dist/ComparativeRenderer/index.d.ts +0 -22
  93. package/dist/ComparativeRenderer/index.js +0 -53
  94. package/dist/DiagonalizeDotplotRpc.d.ts +0 -30
  95. package/dist/DiagonalizeDotplotRpc.js +0 -156
  96. package/dist/DotplotDisplay/components/DotplotDisplay.d.ts +0 -6
  97. package/dist/DotplotDisplay/components/DotplotDisplay.js +0 -18
  98. package/dist/DotplotDisplay/index.d.ts +0 -5
  99. package/dist/DotplotDisplay/index.js +0 -36
  100. package/dist/DotplotDisplay/renderDotplotBlock.d.ts +0 -11
  101. package/dist/DotplotDisplay/renderDotplotBlock.js +0 -52
  102. package/dist/DotplotDisplay/stateModelFactory.d.ts +0 -108
  103. package/dist/DotplotDisplay/stateModelFactory.js +0 -134
  104. package/dist/DotplotReadVsRef/DotplotReadVsRef.d.ts +0 -3
  105. package/dist/DotplotReadVsRef/DotplotReadVsRef.js +0 -100
  106. package/dist/DotplotReadVsRef/index.d.ts +0 -2
  107. package/dist/DotplotReadVsRef/index.js +0 -41
  108. package/dist/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
  109. package/dist/DotplotRenderer/ComparativeRenderRpc.js +0 -53
  110. package/dist/DotplotRenderer/DotplotRenderer.d.ts +0 -65
  111. package/dist/DotplotRenderer/DotplotRenderer.js +0 -102
  112. package/dist/DotplotRenderer/clamp.d.ts +0 -7
  113. package/dist/DotplotRenderer/clamp.js +0 -62
  114. package/dist/DotplotRenderer/components/DotplotRendering.d.ts +0 -3
  115. package/dist/DotplotRenderer/components/DotplotRendering.js +0 -9
  116. package/dist/DotplotRenderer/configSchema.d.ts +0 -40
  117. package/dist/DotplotRenderer/configSchema.js +0 -57
  118. package/dist/DotplotRenderer/drawDotplot.d.ts +0 -22
  119. package/dist/DotplotRenderer/drawDotplot.js +0 -209
  120. package/dist/DotplotRenderer/index.d.ts +0 -2
  121. package/dist/DotplotRenderer/index.js +0 -17
  122. package/dist/DotplotView/1dview.d.ts +0 -199
  123. package/dist/DotplotView/1dview.js +0 -65
  124. package/dist/DotplotView/components/Axes.d.ts +0 -13
  125. package/dist/DotplotView/components/Axes.js +0 -107
  126. package/dist/DotplotView/components/ColorBySelector.d.ts +0 -5
  127. package/dist/DotplotView/components/ColorBySelector.js +0 -79
  128. package/dist/DotplotView/components/CursorIcon.d.ts +0 -3
  129. package/dist/DotplotView/components/CursorIcon.js +0 -15
  130. package/dist/DotplotView/components/DiagonalizationProgressDialog.d.ts +0 -6
  131. package/dist/DotplotView/components/DiagonalizationProgressDialog.js +0 -125
  132. package/dist/DotplotView/components/DotplotControls.d.ts +0 -5
  133. package/dist/DotplotView/components/DotplotControls.js +0 -187
  134. package/dist/DotplotView/components/DotplotTooltipClick.d.ts +0 -10
  135. package/dist/DotplotView/components/DotplotTooltipClick.js +0 -17
  136. package/dist/DotplotView/components/DotplotTooltipMouseover.d.ts +0 -9
  137. package/dist/DotplotView/components/DotplotTooltipMouseover.js +0 -16
  138. package/dist/DotplotView/components/DotplotTooltips.d.ts +0 -15
  139. package/dist/DotplotView/components/DotplotTooltips.js +0 -43
  140. package/dist/DotplotView/components/DotplotView.d.ts +0 -5
  141. package/dist/DotplotView/components/DotplotView.js +0 -100
  142. package/dist/DotplotView/components/DotplotWarnings.d.ts +0 -5
  143. package/dist/DotplotView/components/DotplotWarnings.js +0 -53
  144. package/dist/DotplotView/components/ExportSvgDialog.d.ts +0 -7
  145. package/dist/DotplotView/components/ExportSvgDialog.js +0 -53
  146. package/dist/DotplotView/components/Grid.d.ts +0 -9
  147. package/dist/DotplotView/components/Grid.js +0 -47
  148. package/dist/DotplotView/components/Header.d.ts +0 -9
  149. package/dist/DotplotView/components/Header.js +0 -33
  150. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +0 -7
  151. package/dist/DotplotView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +0 -78
  152. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.d.ts +0 -7
  153. package/dist/DotplotView/components/ImportForm/ImportSyntenyTrackSelector.js +0 -42
  154. package/dist/DotplotView/components/ImportForm/TrackSelector.d.ts +0 -7
  155. package/dist/DotplotView/components/ImportForm/TrackSelector.js +0 -23
  156. package/dist/DotplotView/components/ImportForm/getAdapter.d.ts +0 -117
  157. package/dist/DotplotView/components/ImportForm/getAdapter.js +0 -68
  158. package/dist/DotplotView/components/ImportForm/index.d.ts +0 -5
  159. package/dist/DotplotView/components/ImportForm/index.js +0 -75
  160. package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.d.ts +0 -3
  161. package/dist/DotplotView/components/ImportForm/selectors/AnchorsFileSelector.js +0 -23
  162. package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.d.ts +0 -3
  163. package/dist/DotplotView/components/ImportForm/selectors/PifGzSelector.js +0 -13
  164. package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.d.ts +0 -23
  165. package/dist/DotplotView/components/ImportForm/selectors/SelectorTypes.js +0 -10
  166. package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.d.ts +0 -13
  167. package/dist/DotplotView/components/ImportForm/selectors/SwapAssemblies.js +0 -32
  168. package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.d.ts +0 -3
  169. package/dist/DotplotView/components/ImportForm/selectors/SyntenyFileSelector.js +0 -24
  170. package/dist/DotplotView/components/ImportForm/selectors/index.d.ts +0 -3
  171. package/dist/DotplotView/components/ImportForm/selectors/index.js +0 -12
  172. package/dist/DotplotView/components/ImportForm/util.d.ts +0 -10
  173. package/dist/DotplotView/components/ImportForm/util.js +0 -24
  174. package/dist/DotplotView/components/MinLengthSlider.d.ts +0 -5
  175. package/dist/DotplotView/components/MinLengthSlider.js +0 -44
  176. package/dist/DotplotView/components/MouseInteractionLayer.d.ts +0 -17
  177. package/dist/DotplotView/components/MouseInteractionLayer.js +0 -18
  178. package/dist/DotplotView/components/OpacitySlider.d.ts +0 -5
  179. package/dist/DotplotView/components/OpacitySlider.js +0 -43
  180. package/dist/DotplotView/components/PanButtons.d.ts +0 -5
  181. package/dist/DotplotView/components/PanButtons.js +0 -47
  182. package/dist/DotplotView/components/SelectionContextMenu.d.ts +0 -13
  183. package/dist/DotplotView/components/SelectionContextMenu.js +0 -42
  184. package/dist/DotplotView/components/SliderTooltip.d.ts +0 -2
  185. package/dist/DotplotView/components/SliderTooltip.js +0 -9
  186. package/dist/DotplotView/components/WarningDialog.d.ts +0 -16
  187. package/dist/DotplotView/components/WarningDialog.js +0 -39
  188. package/dist/DotplotView/components/hooks/useCtrlKeyTracking.d.ts +0 -1
  189. package/dist/DotplotView/components/hooks/useCtrlKeyTracking.js +0 -24
  190. package/dist/DotplotView/components/hooks/useCursorMode.d.ts +0 -7
  191. package/dist/DotplotView/components/hooks/useCursorMode.js +0 -19
  192. package/dist/DotplotView/components/hooks/useMouseCoordinates.d.ts +0 -29
  193. package/dist/DotplotView/components/hooks/useMouseCoordinates.js +0 -52
  194. package/dist/DotplotView/components/hooks/useMouseMoveHandler.d.ts +0 -6
  195. package/dist/DotplotView/components/hooks/useMouseMoveHandler.js +0 -27
  196. package/dist/DotplotView/components/hooks/useMouseUpHandler.d.ts +0 -3
  197. package/dist/DotplotView/components/hooks/useMouseUpHandler.js +0 -31
  198. package/dist/DotplotView/components/hooks/useWheelHandler.d.ts +0 -8
  199. package/dist/DotplotView/components/hooks/useWheelHandler.js +0 -47
  200. package/dist/DotplotView/components/util.d.ts +0 -14
  201. package/dist/DotplotView/components/util.js +0 -80
  202. package/dist/DotplotView/index.d.ts +0 -2
  203. package/dist/DotplotView/index.js +0 -52
  204. package/dist/DotplotView/model.d.ts +0 -440
  205. package/dist/DotplotView/model.js +0 -502
  206. package/dist/DotplotView/svgcomponents/SVGBackground.d.ts +0 -4
  207. package/dist/DotplotView/svgcomponents/SVGBackground.js +0 -10
  208. package/dist/DotplotView/svgcomponents/SVGDotplotView.d.ts +0 -2
  209. package/dist/DotplotView/svgcomponents/SVGDotplotView.js +0 -30
  210. package/dist/DotplotView/types.d.ts +0 -12
  211. package/dist/DotplotView/types.js +0 -2
  212. package/dist/LaunchDotplotView.d.ts +0 -2
  213. package/dist/LaunchDotplotView.js +0 -43
  214. package/dist/ServerSideRenderedBlockContent.d.ts +0 -12
  215. package/dist/ServerSideRenderedBlockContent.js +0 -48
  216. package/dist/ServerSideSyntenyRendering.d.ts +0 -13
  217. package/dist/ServerSideSyntenyRendering.js +0 -23
  218. package/dist/index.d.ts +0 -7
  219. package/dist/index.js +0 -42
  220. package/dist/util.d.ts +0 -9
  221. package/dist/util.js +0 -7
  222. package/esm/DotplotRenderer/ComparativeRenderRpc.d.ts +0 -22
  223. package/esm/DotplotRenderer/ComparativeRenderRpc.js +0 -47
  224. package/esm/DotplotView/components/Grid.d.ts +0 -9
@@ -1,9 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = SliderTooltip;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const material_1 = require("@mui/material");
6
- function SliderTooltip(props) {
7
- const { children, open, value } = props;
8
- return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { open: open, enterTouchDelay: 0, placement: "top", title: value, arrow: true, children: children }));
9
- }
@@ -1,16 +0,0 @@
1
- import type { AnyConfigurationModel } from '@jbrowse/core/configuration';
2
- interface Warning {
3
- message: string;
4
- effect: string;
5
- }
6
- interface TrackWarning {
7
- configuration: AnyConfigurationModel;
8
- displays: {
9
- warnings: Warning[];
10
- }[];
11
- }
12
- declare const WarningDialog: ({ trackWarnings, handleClose, }: {
13
- handleClose: () => void;
14
- trackWarnings: TrackWarning[];
15
- }) => import("react/jsx-runtime").JSX.Element;
16
- export default WarningDialog;
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const jsx_runtime_1 = require("react/jsx-runtime");
4
- const configuration_1 = require("@jbrowse/core/configuration");
5
- const ui_1 = require("@jbrowse/core/ui");
6
- const util_1 = require("@jbrowse/core/util");
7
- const material_1 = require("@mui/material");
8
- const x_data_grid_1 = require("@mui/x-data-grid");
9
- const mobx_react_1 = require("mobx-react");
10
- const mui_1 = require("tss-react/mui");
11
- const useStyles = (0, mui_1.makeStyles)()({
12
- content: {
13
- minWidth: 600,
14
- },
15
- });
16
- function getTrackWarnings({ trackWarnings, }) {
17
- const rows = [];
18
- for (const [i, trackWarning] of trackWarnings.entries()) {
19
- const track = trackWarning;
20
- const name = (0, configuration_1.getConf)(track, 'name');
21
- const d = track.displays[0];
22
- for (let j = 0; j < d.warnings.length; j++) {
23
- const warning = d.warnings[j];
24
- rows.push({ name, ...warning, id: `${i}_${j}` });
25
- }
26
- }
27
- return rows;
28
- }
29
- const WarningDialog = (0, mobx_react_1.observer)(function WarningDialog({ trackWarnings, handleClose, }) {
30
- const { classes } = useStyles();
31
- const rows = getTrackWarnings({ trackWarnings });
32
- const columns = [
33
- { field: 'name' },
34
- { field: 'message', width: (0, util_1.measureGridWidth)(rows.map(r => r.message)) },
35
- { field: 'effect', width: (0, util_1.measureGridWidth)(rows.map(r => r.effect)) },
36
- ];
37
- return ((0, jsx_runtime_1.jsx)(ui_1.Dialog, { open: true, onClose: handleClose, maxWidth: "xl", title: "Dotplot rendered with warnings", children: (0, jsx_runtime_1.jsxs)(material_1.DialogContent, { className: classes.content, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: "Found warnings while rendering the dotplot. This is often due to out-of-bound features that may indicate the wrong assemblies are being used. Check that the query and target are configured correctly, and that the right assemblies are being compared." }), (0, jsx_runtime_1.jsx)("div", { style: { height: 600, width: '100%', overflow: 'auto' }, children: (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { rows: rows, columns: columns, disableRowSelectionOnClick: true, rowHeight: 25, disableColumnMenu: true }) })] }) }));
38
- });
39
- exports.default = WarningDialog;
@@ -1 +0,0 @@
1
- export declare function useCtrlKeyTracking(setCtrlKeyDown: (isDown: boolean) => void): void;
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCtrlKeyTracking = useCtrlKeyTracking;
4
- const react_1 = require("react");
5
- function useCtrlKeyTracking(setCtrlKeyDown) {
6
- (0, react_1.useEffect)(() => {
7
- function globalCtrlKeyDown(event) {
8
- if (event.metaKey || event.ctrlKey) {
9
- setCtrlKeyDown(true);
10
- }
11
- }
12
- function globalCtrlKeyUp(event) {
13
- if (!event.metaKey && !event.ctrlKey) {
14
- setCtrlKeyDown(false);
15
- }
16
- }
17
- window.addEventListener('keydown', globalCtrlKeyDown);
18
- window.addEventListener('keyup', globalCtrlKeyUp);
19
- return () => {
20
- window.removeEventListener('keydown', globalCtrlKeyDown);
21
- window.removeEventListener('keyup', globalCtrlKeyUp);
22
- };
23
- }, [setCtrlKeyDown]);
24
- }
@@ -1,7 +0,0 @@
1
- export declare function useCursorMode(cursorMode: string): {
2
- ctrlKeyDown: boolean;
3
- validPan: boolean;
4
- validSelect: boolean;
5
- setCtrlKeyWasUsed: import("react").Dispatch<import("react").SetStateAction<boolean>>;
6
- setCtrlKeyDown: import("react").Dispatch<import("react").SetStateAction<boolean>>;
7
- };
@@ -1,19 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useCursorMode = useCursorMode;
4
- const react_1 = require("react");
5
- function useCursorMode(cursorMode) {
6
- const [ctrlKeyWasUsed, setCtrlKeyWasUsed] = (0, react_1.useState)(false);
7
- const [ctrlKeyDown, setCtrlKeyDown] = (0, react_1.useState)(false);
8
- const validPan = (cursorMode === 'move' && !ctrlKeyWasUsed) ||
9
- (cursorMode === 'crosshair' && ctrlKeyWasUsed);
10
- const validSelect = (cursorMode === 'move' && ctrlKeyWasUsed) ||
11
- (cursorMode === 'crosshair' && !ctrlKeyWasUsed);
12
- return {
13
- ctrlKeyDown,
14
- validPan,
15
- validSelect,
16
- setCtrlKeyWasUsed,
17
- setCtrlKeyDown,
18
- };
19
- }
@@ -1,29 +0,0 @@
1
- type Coord = [number, number] | undefined;
2
- interface Rect {
3
- left: number;
4
- top: number;
5
- width: number;
6
- height: number;
7
- }
8
- export declare function useMouseCoordinates(): {
9
- mousecurrClient: Coord;
10
- mousedownClient: Coord;
11
- mouseupClient: Coord;
12
- mouseOvered: boolean;
13
- setMouseCurrClient: import("react").Dispatch<import("react").SetStateAction<Coord>>;
14
- setMouseDownClient: import("react").Dispatch<import("react").SetStateAction<Coord>>;
15
- setMouseUpClient: import("react").Dispatch<import("react").SetStateAction<Coord>>;
16
- setMouseOvered: import("react").Dispatch<import("react").SetStateAction<boolean>>;
17
- ref: import("react").RefObject<HTMLDivElement | null>;
18
- root: import("react").RefObject<HTMLDivElement | null>;
19
- svg: Rect;
20
- rootRect: Rect;
21
- mousedown: Coord;
22
- mousecurr: Coord;
23
- mouseup: Coord;
24
- mouserect: Coord;
25
- mouserectClient: Coord;
26
- xdistance: number;
27
- ydistance: number;
28
- };
29
- export {};
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMouseCoordinates = useMouseCoordinates;
4
- const react_1 = require("react");
5
- const blank = { left: 0, top: 0, width: 0, height: 0 };
6
- function getOffset(coord, rect) {
7
- return coord && [coord[0] - rect.left, coord[1] - rect.top];
8
- }
9
- function useMouseCoordinates() {
10
- const [mousecurrClient, setMouseCurrClient] = (0, react_1.useState)();
11
- const [mousedownClient, setMouseDownClient] = (0, react_1.useState)();
12
- const [mouseupClient, setMouseUpClient] = (0, react_1.useState)();
13
- const [mouseOvered, setMouseOvered] = (0, react_1.useState)(false);
14
- const [rect, setRect] = (0, react_1.useState)(blank);
15
- const ref = (0, react_1.useRef)(null);
16
- const root = (0, react_1.useRef)(null);
17
- (0, react_1.useLayoutEffect)(() => {
18
- if (ref.current) {
19
- setRect(ref.current.getBoundingClientRect());
20
- }
21
- }, [mousecurrClient, mousedownClient, mouseupClient]);
22
- const svg = rect;
23
- const rootRect = rect;
24
- const mousedown = getOffset(mousedownClient, rect);
25
- const mousecurr = getOffset(mousecurrClient, rect);
26
- const mouseup = getOffset(mouseupClient, rect);
27
- const mouserect = mouseup || mousecurr;
28
- const mouserectClient = mouseupClient || mousecurrClient;
29
- const xdistance = mousedown && mouserect ? mouserect[0] - mousedown[0] : 0;
30
- const ydistance = mousedown && mouserect ? mouserect[1] - mousedown[1] : 0;
31
- return {
32
- mousecurrClient,
33
- mousedownClient,
34
- mouseupClient,
35
- mouseOvered,
36
- setMouseCurrClient,
37
- setMouseDownClient,
38
- setMouseUpClient,
39
- setMouseOvered,
40
- ref,
41
- root,
42
- svg,
43
- rootRect,
44
- mousedown,
45
- mousecurr,
46
- mouseup,
47
- mouserect,
48
- mouserectClient,
49
- xdistance,
50
- ydistance,
51
- };
52
- }
@@ -1,6 +0,0 @@
1
- type Coord = [number, number] | undefined;
2
- interface View {
3
- scroll: (distance: number) => void;
4
- }
5
- export declare function useMouseMoveHandler(mousecurrClient: Coord, mousedownClient: Coord, mouseupClient: Coord, validPan: boolean, hview: View, vview: View, setMouseCurrClient: (coord: Coord) => void): void;
6
- export {};
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMouseMoveHandler = useMouseMoveHandler;
4
- const react_1 = require("react");
5
- function useMouseMoveHandler(mousecurrClient, mousedownClient, mouseupClient, validPan, hview, vview, setMouseCurrClient) {
6
- (0, react_1.useEffect)(() => {
7
- function globalMouseMove(event) {
8
- setMouseCurrClient([event.clientX, event.clientY]);
9
- if (mousecurrClient && mousedownClient && validPan && !mouseupClient) {
10
- hview.scroll(-event.clientX + mousecurrClient[0]);
11
- vview.scroll(event.clientY - mousecurrClient[1]);
12
- }
13
- }
14
- window.addEventListener('mousemove', globalMouseMove);
15
- return () => {
16
- window.removeEventListener('mousemove', globalMouseMove);
17
- };
18
- }, [
19
- validPan,
20
- mousecurrClient,
21
- mousedownClient,
22
- mouseupClient,
23
- hview,
24
- vview,
25
- setMouseCurrClient,
26
- ]);
27
- }
@@ -1,3 +0,0 @@
1
- type Coord = [number, number] | undefined;
2
- export declare function useMouseUpHandler(mousedown: Coord, mouseup: Coord, xdistance: number, ydistance: number, validSelect: boolean, setMouseUpClient: (coord: Coord) => void, setMouseDownClient: (coord: Coord) => void): void;
3
- export {};
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useMouseUpHandler = useMouseUpHandler;
4
- const react_1 = require("react");
5
- function useMouseUpHandler(mousedown, mouseup, xdistance, ydistance, validSelect, setMouseUpClient, setMouseDownClient) {
6
- (0, react_1.useEffect)(() => {
7
- function globalMouseUp(event) {
8
- if (Math.abs(xdistance) > 3 && Math.abs(ydistance) > 3 && validSelect) {
9
- setMouseUpClient([event.clientX, event.clientY]);
10
- }
11
- else {
12
- setMouseDownClient(undefined);
13
- }
14
- }
15
- if (mousedown && !mouseup) {
16
- window.addEventListener('mouseup', globalMouseUp, true);
17
- return () => {
18
- window.removeEventListener('mouseup', globalMouseUp, true);
19
- };
20
- }
21
- return () => { };
22
- }, [
23
- validSelect,
24
- mousedown,
25
- mouseup,
26
- xdistance,
27
- ydistance,
28
- setMouseUpClient,
29
- setMouseDownClient,
30
- ]);
31
- }
@@ -1,8 +0,0 @@
1
- type Coord = [number, number] | undefined;
2
- interface View {
3
- scroll: (distance: number) => void;
4
- zoomTo: (bpPerPx: number, position: number) => void;
5
- bpPerPx: number;
6
- }
7
- export declare function useWheelHandler(ref: React.RefObject<HTMLDivElement | null>, wheelMode: string, hview: View, vview: View, mousecurr: Coord, rootRectHeight: number): void;
8
- export {};
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useWheelHandler = useWheelHandler;
4
- const react_1 = require("react");
5
- const mobx_1 = require("mobx");
6
- function useWheelHandler(ref, wheelMode, hview, vview, mousecurr, rootRectHeight) {
7
- const distanceX = (0, react_1.useRef)(0);
8
- const distanceY = (0, react_1.useRef)(0);
9
- const scheduled = (0, react_1.useRef)(false);
10
- (0, react_1.useEffect)(() => {
11
- function onWheel(event) {
12
- event.preventDefault();
13
- distanceX.current += event.deltaX;
14
- distanceY.current -= event.deltaY;
15
- if (!scheduled.current) {
16
- scheduled.current = true;
17
- window.requestAnimationFrame(() => {
18
- (0, mobx_1.transaction)(() => {
19
- if (wheelMode === 'pan') {
20
- hview.scroll(distanceX.current / 3);
21
- vview.scroll(distanceY.current / 10);
22
- }
23
- else if (wheelMode === 'zoom') {
24
- if (Math.abs(distanceY.current) > Math.abs(distanceX.current) * 2 &&
25
- mousecurr) {
26
- const val = distanceY.current < 0 ? 1.1 : 0.9;
27
- hview.zoomTo(hview.bpPerPx * val, mousecurr[0]);
28
- vview.zoomTo(vview.bpPerPx * val, rootRectHeight - mousecurr[1]);
29
- }
30
- }
31
- });
32
- scheduled.current = false;
33
- distanceX.current = 0;
34
- distanceY.current = 0;
35
- });
36
- }
37
- }
38
- if (ref.current) {
39
- const curr = ref.current;
40
- curr.addEventListener('wheel', onWheel);
41
- return () => {
42
- curr.removeEventListener('wheel', onWheel);
43
- };
44
- }
45
- return () => { };
46
- }, [hview, vview, wheelMode, mousecurr, rootRectHeight, ref]);
47
- }
@@ -1,14 +0,0 @@
1
- import type { Dotplot1DViewModel } from '../model';
2
- import type { BaseBlock } from '@jbrowse/core/util/blockTypes';
3
- export declare function locstr(px: number, view: Dotplot1DViewModel, includeAsm?: boolean): string;
4
- export declare function getBlockLabelKeysToHide(blocks: BaseBlock[], length: number, viewOffsetPx: number): Set<string>;
5
- export declare function chooseGridPitch(scale: number, minMajorPitchPx: number, minMinorPitchPx: number): {
6
- majorPitch: number;
7
- minorPitch: number;
8
- };
9
- export declare function makeTicks(regions: BaseBlock[], bpPerPx: number, emitMajor?: boolean, emitMinor?: boolean): {
10
- type: string;
11
- base: number;
12
- index: number;
13
- refName: string;
14
- }[];
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.locstr = locstr;
4
- exports.getBlockLabelKeysToHide = getBlockLabelKeysToHide;
5
- exports.chooseGridPitch = chooseGridPitch;
6
- exports.makeTicks = makeTicks;
7
- function locstr(px, view, includeAsm = true) {
8
- const { assemblyName, refName, start, offset, oob } = view.pxToBp(px);
9
- const coord = Math.floor(start + offset);
10
- return oob
11
- ? 'out of bounds'
12
- : `${includeAsm ? `{${assemblyName}}` : ''}${refName}:${coord.toLocaleString('en-US')}`;
13
- }
14
- function getBlockLabelKeysToHide(blocks, length, viewOffsetPx) {
15
- const blockLabelKeysToHide = new Set();
16
- const sortedBlocks = [...blocks].sort((a, b) => {
17
- const alen = a.end - a.start;
18
- const blen = b.end - b.start;
19
- return blen - alen;
20
- });
21
- const positions = Array.from({ length: Math.round(length) });
22
- for (const { key, offsetPx } of sortedBlocks) {
23
- const y = Math.round(length - offsetPx + viewOffsetPx);
24
- const labelBounds = [Math.max(y - 12, 0), y];
25
- if (y === 0 || positions.slice(...labelBounds).some(Boolean)) {
26
- blockLabelKeysToHide.add(key);
27
- }
28
- else {
29
- positions.fill(true, ...labelBounds);
30
- }
31
- }
32
- return blockLabelKeysToHide;
33
- }
34
- function chooseGridPitch(scale, minMajorPitchPx, minMinorPitchPx) {
35
- scale = Math.abs(scale);
36
- const minMajorPitchBp = minMajorPitchPx * scale;
37
- const majorMagnitude = +minMajorPitchBp.toExponential().split(/e/i)[1];
38
- let majorPitch = 10 ** majorMagnitude;
39
- while (majorPitch < minMajorPitchBp) {
40
- majorPitch *= 2;
41
- if (majorPitch >= minMajorPitchBp) {
42
- break;
43
- }
44
- majorPitch *= 2.5;
45
- }
46
- majorPitch = Math.max(majorPitch, 5);
47
- const majorPitchPx = majorPitch / scale;
48
- let minorPitch = 0;
49
- if (!(majorPitch % 10) && majorPitchPx / 10 >= minMinorPitchPx) {
50
- minorPitch = majorPitch / 10;
51
- }
52
- else if (!(majorPitch % 5) && majorPitchPx / 5 >= minMinorPitchPx) {
53
- minorPitch = majorPitch / 5;
54
- }
55
- else if (!(majorPitch % 2) && majorPitchPx / 2 >= minMinorPitchPx) {
56
- minorPitch = majorPitch / 2;
57
- }
58
- return { majorPitch, minorPitch };
59
- }
60
- function makeTicks(regions, bpPerPx, emitMajor = true, emitMinor = true) {
61
- const ticks = [];
62
- const gridPitch = chooseGridPitch(bpPerPx, 60, 15);
63
- const iterPitch = gridPitch.minorPitch || gridPitch.majorPitch;
64
- for (const { start, end, refName } of regions) {
65
- let index = 0;
66
- const minBase = start;
67
- const maxBase = end;
68
- for (let base = Math.floor(minBase / iterPitch) * iterPitch; base < Math.ceil(maxBase / iterPitch) * iterPitch + 1; base += iterPitch) {
69
- if (emitMinor && base % gridPitch.majorPitch) {
70
- ticks.push({ type: 'minor', base: base - 1, index, refName });
71
- index += 1;
72
- }
73
- else if (emitMajor && Math.abs(base - start) > gridPitch.minorPitch) {
74
- ticks.push({ type: 'major', base: base - 1, index, refName });
75
- index += 1;
76
- }
77
- }
78
- }
79
- return ticks;
80
- }
@@ -1,2 +0,0 @@
1
- import type PluginManager from '@jbrowse/core/PluginManager';
2
- export default function DotplotViewF(pluginManager: PluginManager): void;
@@ -1,52 +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
- exports.default = DotplotViewF;
40
- const react_1 = require("react");
41
- const ViewType_1 = __importDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
42
- const model_1 = __importDefault(require("./model"));
43
- function DotplotViewF(pluginManager) {
44
- pluginManager.addViewType(() => {
45
- return new ViewType_1.default({
46
- name: 'DotplotView',
47
- displayName: 'Dotplot view',
48
- stateModel: (0, model_1.default)(pluginManager),
49
- ReactComponent: (0, react_1.lazy)(() => Promise.resolve().then(() => __importStar(require('./components/DotplotView')))),
50
- });
51
- });
52
- }