@jbrowse/plugin-linear-comparative-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 (231) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
  2. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +36 -60
  3. package/dist/LGVSyntenyDisplay/components/util.d.ts +9 -6
  4. package/dist/LGVSyntenyDisplay/components/util.js +6 -13
  5. package/dist/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  6. package/dist/LGVSyntenyDisplay/configSchemaF.js +12 -9
  7. package/dist/LGVSyntenyDisplay/index.d.ts +1 -1
  8. package/dist/LGVSyntenyDisplay/index.js +1 -1
  9. package/dist/LGVSyntenyDisplay/model.d.ts +122 -69
  10. package/dist/LGVSyntenyDisplay/model.js +20 -37
  11. package/dist/LaunchLinearSyntenyView.d.ts +1 -1
  12. package/dist/LaunchLinearSyntenyView.js +1 -3
  13. package/dist/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  14. package/dist/LinearComparativeDisplay/configSchemaF.js +0 -6
  15. package/dist/LinearComparativeDisplay/index.d.ts +1 -1
  16. package/dist/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  17. package/dist/LinearComparativeDisplay/stateModelFactory.js +13 -57
  18. package/dist/LinearComparativeView/components/Header.d.ts +2 -3
  19. package/dist/LinearComparativeView/components/Header.js +56 -86
  20. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
  21. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +5 -15
  22. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
  23. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -32
  24. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
  25. package/dist/LinearComparativeView/components/LinearComparativeView.js +4 -9
  26. package/dist/LinearComparativeView/components/Rubberband.d.ts +2 -3
  27. package/dist/LinearComparativeView/components/Rubberband.js +36 -69
  28. package/dist/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
  29. package/dist/LinearComparativeView/components/VerticalGuide.js +5 -9
  30. package/dist/LinearComparativeView/index.d.ts +1 -1
  31. package/dist/LinearComparativeView/index.js +17 -7
  32. package/dist/LinearComparativeView/model.d.ts +38 -90
  33. package/dist/LinearComparativeView/model.js +40 -107
  34. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
  35. package/dist/LinearReadVsRef/LinearReadVsRef.js +10 -55
  36. package/dist/LinearReadVsRef/index.d.ts +1 -1
  37. package/dist/LinearReadVsRef/index.js +17 -9
  38. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  39. package/dist/LinearSyntenyDisplay/afterAttach.js +8 -12
  40. package/dist/LinearSyntenyDisplay/components/Component.d.ts +2 -3
  41. package/dist/LinearSyntenyDisplay/components/Component.js +11 -36
  42. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
  43. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +95 -106
  44. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
  45. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -6
  46. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
  47. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
  48. package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -3
  49. package/dist/LinearSyntenyDisplay/components/util.js +0 -9
  50. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  51. package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -15
  52. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  53. package/dist/LinearSyntenyDisplay/drawSynteny.js +1 -23
  54. package/dist/LinearSyntenyDisplay/index.d.ts +1 -1
  55. package/dist/LinearSyntenyDisplay/index.js +18 -9
  56. package/dist/LinearSyntenyDisplay/model.d.ts +8 -102
  57. package/dist/LinearSyntenyDisplay/model.js +18 -99
  58. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
  59. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +35 -76
  60. package/dist/LinearSyntenyView/components/Icons.d.ts +3 -4
  61. package/dist/LinearSyntenyView/components/Icons.js +3 -8
  62. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
  63. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +130 -0
  64. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
  65. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +39 -0
  66. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
  67. package/dist/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +22 -0
  68. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
  69. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -150
  70. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
  71. package/dist/LinearSyntenyView/components/ImportForm/doSubmit.js +43 -0
  72. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
  73. package/dist/LinearSyntenyView/components/ImportForm/getAdapter.js +68 -0
  74. package/dist/LinearSyntenyView/components/ImportForm/util.js +1 -3
  75. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
  76. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +20 -10
  77. package/dist/LinearSyntenyView/index.d.ts +1 -1
  78. package/dist/LinearSyntenyView/index.js +17 -7
  79. package/dist/LinearSyntenyView/model.d.ts +54 -58
  80. package/dist/LinearSyntenyView/model.js +61 -56
  81. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
  82. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -6
  83. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
  84. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +3 -11
  85. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  86. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +7 -24
  87. package/dist/LinearSyntenyView/types.d.ts +12 -0
  88. package/dist/LinearSyntenyView/types.js +2 -0
  89. package/dist/LinearSyntenyViewHelper/index.d.ts +1 -1
  90. package/dist/LinearSyntenyViewHelper/index.js +2 -2
  91. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  92. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  93. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
  94. package/dist/SyntenyFeatureDetail/LinkToSyntenyView.js +87 -0
  95. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
  96. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +5 -90
  97. package/dist/SyntenyFeatureDetail/index.d.ts +1 -1
  98. package/dist/SyntenyFeatureDetail/index.js +18 -14
  99. package/dist/SyntenyFeatureDetail/types.d.ts +9 -0
  100. package/dist/SyntenyFeatureDetail/types.js +2 -0
  101. package/dist/SyntenyTrack/configSchema.d.ts +1 -1
  102. package/dist/SyntenyTrack/configSchema.js +1 -9
  103. package/dist/SyntenyTrack/index.d.ts +1 -1
  104. package/dist/SyntenyTrack/index.js +1 -1
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.js +4 -4
  107. package/dist/util.d.ts +2 -2
  108. package/dist/util.js +1 -11
  109. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +6 -5
  110. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +35 -36
  111. package/esm/LGVSyntenyDisplay/components/util.d.ts +9 -6
  112. package/esm/LGVSyntenyDisplay/components/util.js +6 -13
  113. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  114. package/esm/LGVSyntenyDisplay/configSchemaF.js +12 -9
  115. package/esm/LGVSyntenyDisplay/index.d.ts +1 -1
  116. package/esm/LGVSyntenyDisplay/index.js +1 -1
  117. package/esm/LGVSyntenyDisplay/model.d.ts +122 -69
  118. package/esm/LGVSyntenyDisplay/model.js +4 -31
  119. package/esm/LaunchLinearSyntenyView.d.ts +1 -1
  120. package/esm/LaunchLinearSyntenyView.js +1 -3
  121. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  122. package/esm/LinearComparativeDisplay/configSchemaF.js +0 -6
  123. package/esm/LinearComparativeDisplay/index.d.ts +1 -1
  124. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  125. package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -58
  126. package/esm/LinearComparativeView/components/Header.d.ts +2 -3
  127. package/esm/LinearComparativeView/components/Header.js +56 -63
  128. package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +2 -3
  129. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +5 -12
  130. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +2 -3
  131. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +17 -29
  132. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +2 -3
  133. package/esm/LinearComparativeView/components/LinearComparativeView.js +4 -9
  134. package/esm/LinearComparativeView/components/Rubberband.d.ts +2 -3
  135. package/esm/LinearComparativeView/components/Rubberband.js +36 -46
  136. package/esm/LinearComparativeView/components/VerticalGuide.d.ts +2 -3
  137. package/esm/LinearComparativeView/components/VerticalGuide.js +5 -6
  138. package/esm/LinearComparativeView/index.d.ts +1 -1
  139. package/esm/LinearComparativeView/model.d.ts +38 -90
  140. package/esm/LinearComparativeView/model.js +24 -101
  141. package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +2 -3
  142. package/esm/LinearReadVsRef/LinearReadVsRef.js +10 -32
  143. package/esm/LinearReadVsRef/index.d.ts +1 -1
  144. package/esm/LinearReadVsRef/index.js +1 -3
  145. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  146. package/esm/LinearSyntenyDisplay/afterAttach.js +8 -12
  147. package/esm/LinearSyntenyDisplay/components/Component.d.ts +2 -3
  148. package/esm/LinearSyntenyDisplay/components/Component.js +11 -13
  149. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +2 -3
  150. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +79 -100
  151. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +3 -4
  152. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +3 -3
  153. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.d.ts +1 -2
  154. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +3 -4
  155. package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -3
  156. package/esm/LinearSyntenyDisplay/components/util.js +2 -11
  157. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  158. package/esm/LinearSyntenyDisplay/configSchemaF.js +0 -15
  159. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  160. package/esm/LinearSyntenyDisplay/drawSynteny.js +1 -23
  161. package/esm/LinearSyntenyDisplay/index.d.ts +1 -1
  162. package/esm/LinearSyntenyDisplay/index.js +1 -2
  163. package/esm/LinearSyntenyDisplay/model.d.ts +8 -102
  164. package/esm/LinearSyntenyDisplay/model.js +1 -92
  165. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +2 -3
  166. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +35 -53
  167. package/esm/LinearSyntenyView/components/Icons.d.ts +3 -4
  168. package/esm/LinearSyntenyView/components/Icons.js +3 -5
  169. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.d.ts +8 -0
  170. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyOpenCustomTrack.js +125 -0
  171. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.d.ts +8 -0
  172. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyPreConfigured.js +37 -0
  173. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.d.ts +7 -0
  174. package/esm/LinearSyntenyView/components/ImportForm/ImportSyntenyTrackSelectorArea.js +16 -0
  175. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +2 -3
  176. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +49 -127
  177. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.d.ts +5 -0
  178. package/esm/LinearSyntenyView/components/ImportForm/doSubmit.js +40 -0
  179. package/esm/LinearSyntenyView/components/ImportForm/getAdapter.d.ts +117 -0
  180. package/esm/LinearSyntenyView/components/ImportForm/getAdapter.js +65 -0
  181. package/esm/LinearSyntenyView/components/ImportForm/util.js +1 -3
  182. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +2 -3
  183. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +3 -3
  184. package/esm/LinearSyntenyView/index.d.ts +1 -1
  185. package/esm/LinearSyntenyView/model.d.ts +54 -58
  186. package/esm/LinearSyntenyView/model.js +44 -49
  187. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.d.ts +1 -2
  188. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +3 -3
  189. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +2 -3
  190. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +4 -9
  191. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  192. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +8 -25
  193. package/esm/LinearSyntenyView/types.d.ts +12 -0
  194. package/esm/LinearSyntenyView/types.js +1 -0
  195. package/esm/LinearSyntenyViewHelper/index.d.ts +1 -1
  196. package/esm/LinearSyntenyViewHelper/index.js +2 -2
  197. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  198. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  199. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.d.ts +5 -0
  200. package/esm/SyntenyFeatureDetail/LinkToSyntenyView.js +52 -0
  201. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +2 -11
  202. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +6 -68
  203. package/esm/SyntenyFeatureDetail/index.d.ts +1 -1
  204. package/esm/SyntenyFeatureDetail/index.js +1 -7
  205. package/esm/SyntenyFeatureDetail/types.d.ts +9 -0
  206. package/esm/SyntenyFeatureDetail/types.js +1 -0
  207. package/esm/SyntenyTrack/configSchema.d.ts +1 -1
  208. package/esm/SyntenyTrack/configSchema.js +1 -9
  209. package/esm/SyntenyTrack/index.d.ts +1 -1
  210. package/esm/SyntenyTrack/index.js +1 -1
  211. package/esm/index.d.ts +1 -1
  212. package/esm/index.js +4 -4
  213. package/esm/util.d.ts +2 -2
  214. package/esm/util.js +1 -11
  215. package/package.json +2 -4
  216. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
  217. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -194
  218. package/dist/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
  219. package/dist/LinearSyntenyView/components/ImportForm/Spacer.js +0 -10
  220. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
  221. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -59
  222. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
  223. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -52
  224. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +0 -10
  225. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +0 -169
  226. package/esm/LinearSyntenyView/components/ImportForm/Spacer.d.ts +0 -2
  227. package/esm/LinearSyntenyView/components/ImportForm/Spacer.js +0 -4
  228. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +0 -10
  229. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +0 -34
  230. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +0 -14
  231. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +0 -23
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from 'react';
3
+ import { readConfObject } from '@jbrowse/core/configuration';
4
+ import { ErrorMessage } from '@jbrowse/core/ui';
5
+ import { getSession } from '@jbrowse/core/util';
6
+ import { getTrackName } from '@jbrowse/core/util/tracks';
7
+ import { MenuItem, Paper, Select, Typography } from '@mui/material';
8
+ import { observer } from 'mobx-react';
9
+ const ImportSyntenyTrackSelector = observer(function ({ model, selectedRow, assembly1, assembly2, }) {
10
+ var _a;
11
+ const session = getSession(model);
12
+ const { importFormSyntenyTrackSelections } = model;
13
+ const { tracks = [], sessionTracks = [] } = session;
14
+ const allTracks = [...tracks, ...sessionTracks];
15
+ const filteredTracks = allTracks.filter(track => {
16
+ const assemblyNames = readConfObject(track, 'assemblyNames');
17
+ return (assemblyNames.includes(assembly1) &&
18
+ assemblyNames.includes(assembly2) &&
19
+ track.type.includes('Synteny'));
20
+ });
21
+ const resetTrack = ((_a = filteredTracks[0]) === null || _a === void 0 ? void 0 : _a.trackId) || '';
22
+ const r = importFormSyntenyTrackSelections[selectedRow];
23
+ const value = (r === null || r === void 0 ? void 0 : r.type) === 'preConfigured' ? r.value : undefined;
24
+ useEffect(() => {
25
+ model.setImportFormSyntenyTrack(selectedRow, {
26
+ type: 'preConfigured',
27
+ value: resetTrack,
28
+ });
29
+ }, [assembly2, assembly1, resetTrack, selectedRow, model]);
30
+ return (_jsxs(Paper, { style: { padding: 12 }, children: [_jsx(Typography, { children: "Select a track from the select box below, the track will be shown when you hit \"Launch\"." }), value && filteredTracks.map(r => r.trackId).includes(value) ? (_jsx(Select, { value: value, onChange: event => {
31
+ model.setImportFormSyntenyTrack(selectedRow, {
32
+ type: 'preConfigured',
33
+ value: event.target.value,
34
+ });
35
+ }, children: filteredTracks.map(track => (_jsx(MenuItem, { value: track.trackId, children: getTrackName(track, session) }, track.trackId))) })) : (_jsx(ErrorMessage, { error: `No synteny tracks found for ${assembly1},${assembly2}` }))] }));
36
+ });
37
+ export default ImportSyntenyTrackSelector;
@@ -0,0 +1,7 @@
1
+ import type { LinearSyntenyViewModel } from '../../model';
2
+ export default function ImportSyntenyTrackSelectorArea({ model, assembly1, assembly2, selectedRow, }: {
3
+ model: LinearSyntenyViewModel;
4
+ assembly1: string;
5
+ assembly2: string;
6
+ selectedRow: number;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useState } from 'react';
3
+ import { FormControl, FormControlLabel, Radio, RadioGroup } from '@mui/material';
4
+ import ImportCustomTrack from './ImportSyntenyOpenCustomTrack';
5
+ import ImportSyntenyTrackSelector from './ImportSyntenyPreConfigured';
6
+ export default function ImportSyntenyTrackSelectorArea({ model, assembly1, assembly2, selectedRow, }) {
7
+ const [choice, setChoice] = useState('tracklist');
8
+ useEffect(() => {
9
+ if (choice === 'none') {
10
+ model.setImportFormSyntenyTrack(selectedRow, { type: 'none' });
11
+ }
12
+ }, [choice, model, selectedRow]);
13
+ return (_jsxs("div", { children: [_jsx(FormControl, { children: _jsxs(RadioGroup, { row: true, value: choice, "aria-labelledby": "group-label", onChange: event => {
14
+ setChoice(event.target.value);
15
+ }, 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(ImportCustomTrack, { model: model, selectedRow: selectedRow, assembly2: assembly2, assembly1: assembly1 })) : null, choice === 'tracklist' ? (_jsx(ImportSyntenyTrackSelector, { model: model, selectedRow: selectedRow, assembly1: assembly1, assembly2: assembly2 })) : null] }));
16
+ }
@@ -1,6 +1,5 @@
1
- import React from 'react';
2
- import { LinearSyntenyViewModel } from '../../model';
1
+ import type { LinearSyntenyViewModel } from '../../model';
3
2
  declare const LinearSyntenyViewImportForm: ({ model, }: {
4
3
  model: LinearSyntenyViewModel;
5
- }) => React.JSX.Element;
4
+ }) => import("react/jsx-runtime").JSX.Element;
6
5
  export default LinearSyntenyViewImportForm;
@@ -1,14 +1,14 @@
1
- import React, { useState } from 'react';
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from 'react';
3
+ import { AssemblySelector, ErrorMessage } from '@jbrowse/core/ui';
4
+ import { getSession, notEmpty } from '@jbrowse/core/util';
5
+ import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
6
+ import CloseIcon from '@mui/icons-material/Close';
2
7
  import { Button, Container, IconButton } from '@mui/material';
3
- import { makeStyles } from 'tss-react/mui';
4
8
  import { observer } from 'mobx-react';
5
- import { getSession, isSessionWithAddTracks, notEmpty, } from '@jbrowse/core/util';
6
- import { ErrorMessage, AssemblySelector } from '@jbrowse/core/ui';
7
- // icons
8
- import CloseIcon from '@mui/icons-material/Close';
9
- import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos';
10
- import TrackSelector from './TrackSelectorUtil';
11
- import Spacer from './Spacer';
9
+ import { makeStyles } from 'tss-react/mui';
10
+ import ImportSyntenyTrackSelector from './ImportSyntenyTrackSelectorArea';
11
+ import { doSubmit } from './doSubmit';
12
12
  const useStyles = makeStyles()(theme => ({
13
13
  importFormContainer: {
14
14
  padding: theme.spacing(4),
@@ -25,6 +25,7 @@ const useStyles = makeStyles()(theme => ({
25
25
  },
26
26
  flex: {
27
27
  display: 'flex',
28
+ gap: 90,
28
29
  },
29
30
  mb: {
30
31
  marginBottom: 10,
@@ -32,8 +33,12 @@ const useStyles = makeStyles()(theme => ({
32
33
  bg: {
33
34
  background: theme.palette.divider,
34
35
  },
35
- fixedWidth: {
36
- width: 700,
36
+ rightPanel: {
37
+ flexGrow: 11,
38
+ },
39
+ leftPanel: {
40
+ flexGrow: 4,
41
+ flexShrink: 0,
37
42
  },
38
43
  }));
39
44
  const LinearSyntenyViewImportForm = observer(function ({ model, }) {
@@ -47,121 +52,38 @@ const LinearSyntenyViewImportForm = observer(function ({ model, }) {
47
52
  defaultAssemblyName,
48
53
  ]);
49
54
  const [error, setError] = useState();
50
- const [userOpenedSyntenyTracksToShow, setUserOpenedSyntenyTracksToShow] = useState([]);
51
- const [preConfiguredSyntenyTracksToShow, setPreConfiguredSyntenyTracksToShow,] = useState([]);
52
- return (React.createElement(Container, { className: classes.importFormContainer },
53
- error ? React.createElement(ErrorMessage, { error: error }) : null,
54
- React.createElement("div", { className: classes.flex },
55
- React.createElement(Spacer, null),
56
- React.createElement("div", null,
57
- React.createElement("div", { className: classes.mb }, "Select assemblies for linear synteny view"),
58
- selectedAssemblyNames.map((assemblyName, idx) => (React.createElement("div", { key: `${assemblyName}-${idx}`, className: classes.rel },
59
- React.createElement("span", null,
60
- "Row ",
61
- idx + 1,
62
- ": "),
63
- React.createElement(IconButton, { disabled: selectedAssemblyNames.length <= 2, onClick: () => {
64
- setSelectedAssemblyNames(selectedAssemblyNames
65
- .map((asm, idx2) => (idx2 === idx ? undefined : asm))
66
- .filter(notEmpty));
67
- setPreConfiguredSyntenyTracksToShow(preConfiguredSyntenyTracksToShow
68
- .map((asm, idx2) => (idx2 === idx ? undefined : asm))
69
- .filter(notEmpty));
70
- setUserOpenedSyntenyTracksToShow(userOpenedSyntenyTracksToShow
71
- .map((asm, idx2) => (idx2 === idx ? undefined : asm))
72
- .filter(notEmpty));
73
- if (selectedRow >= selectedAssemblyNames.length - 2) {
74
- setSelectedRow(0);
75
- }
76
- } },
77
- React.createElement(CloseIcon, null)),
78
- React.createElement(AssemblySelector, { helperText: "", selected: assemblyName, onChange: newAssembly => {
79
- setSelectedAssemblyNames(selectedAssemblyNames.map((asm, idx2) => idx2 === idx ? newAssembly : asm));
80
- }, session: session }),
81
- idx !== selectedAssemblyNames.length - 1 ? (React.createElement(IconButton, { className: cx(classes.synbutton, idx === selectedRow ? classes.bg : undefined), onClick: () => {
82
- setSelectedRow(idx);
83
- } },
84
- React.createElement(ArrowForwardIosIcon, null))) : null))),
85
- React.createElement("div", null,
86
- React.createElement(Button, { className: classes.button, variant: "contained", color: "secondary", onClick: () => {
87
- setSelectedAssemblyNames([
88
- ...selectedAssemblyNames,
89
- defaultAssemblyName,
90
- ]);
91
- } }, "Add row"),
92
- React.createElement(Button, { className: classes.button, onClick: () => {
93
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
94
- ;
95
- (async () => {
96
- try {
97
- setError(undefined);
98
- await doSubmit({
99
- userOpenedSyntenyTracksToShow,
100
- preConfiguredSyntenyTracksToShow,
101
- selectedAssemblyNames,
102
- model,
103
- });
104
- }
105
- catch (e) {
106
- console.error(e);
107
- setError(e);
108
- }
109
- })();
110
- }, variant: "contained", color: "primary" }, "Launch"))),
111
- React.createElement(Spacer, null),
112
- React.createElement("div", { className: classes.fixedWidth },
113
- React.createElement("div", null,
114
- "Synteny dataset to display between row ",
115
- selectedRow + 1,
116
- " and",
117
- ' ',
118
- selectedRow + 2),
119
- React.createElement(TrackSelector, { model: model, preConfiguredSyntenyTrack: preConfiguredSyntenyTracksToShow[selectedRow], assembly1: selectedAssemblyNames[selectedRow], assembly2: selectedAssemblyNames[selectedRow + 1], setPreConfiguredSyntenyTrack: arg => {
120
- const clone = [...preConfiguredSyntenyTracksToShow];
121
- clone[selectedRow] = arg;
122
- setPreConfiguredSyntenyTracksToShow(clone);
123
- }, setUserOpenedSyntenyTrack: arg => {
124
- const clone = [...userOpenedSyntenyTracksToShow];
125
- clone[selectedRow] = arg;
126
- setUserOpenedSyntenyTracksToShow(clone);
127
- } }))),
128
- React.createElement(Spacer, null)));
55
+ return (_jsxs(Container, { className: classes.importFormContainer, children: [error ? _jsx(ErrorMessage, { error: error }) : null, _jsxs("div", { className: classes.flex, children: [_jsxs("div", { className: classes.leftPanel, children: [_jsx("div", { className: classes.mb, children: "Select assemblies for linear synteny view" }), selectedAssemblyNames.map((assemblyName, idx) => (_jsxs("div", { className: classes.rel, children: [_jsxs("span", { children: ["Row ", idx + 1, ": "] }), _jsx(IconButton, { disabled: selectedAssemblyNames.length <= 2, onClick: () => {
56
+ model.importFormRemoveRow(idx);
57
+ setSelectedAssemblyNames(selectedAssemblyNames
58
+ .map((asm, idx2) => (idx2 === idx ? undefined : asm))
59
+ .filter(notEmpty));
60
+ if (selectedRow >= selectedAssemblyNames.length - 2) {
61
+ setSelectedRow(0);
62
+ }
63
+ }, children: _jsx(CloseIcon, {}) }), _jsx(AssemblySelector, { helperText: "", selected: assemblyName, onChange: newAssembly => {
64
+ setSelectedAssemblyNames(selectedAssemblyNames.map((asm, idx2) => idx2 === idx ? newAssembly : asm));
65
+ }, session: session }), idx !== selectedAssemblyNames.length - 1 ? (_jsx(IconButton, { "data-testid": "synbutton", className: cx(classes.synbutton, idx === selectedRow ? classes.bg : undefined), onClick: () => {
66
+ setSelectedRow(idx);
67
+ }, children: _jsx(ArrowForwardIosIcon, {}) })) : null] }, `${assemblyName}-${idx}`))), _jsxs("div", { children: [_jsx(Button, { className: classes.button, variant: "contained", color: "secondary", onClick: () => {
68
+ setSelectedAssemblyNames([
69
+ ...selectedAssemblyNames,
70
+ defaultAssemblyName,
71
+ ]);
72
+ }, children: "Add row" }), _jsx(Button, { className: classes.button, onClick: () => {
73
+ ;
74
+ (async () => {
75
+ try {
76
+ setError(undefined);
77
+ await doSubmit({
78
+ selectedAssemblyNames,
79
+ model,
80
+ });
81
+ }
82
+ catch (e) {
83
+ console.error(e);
84
+ setError(e);
85
+ }
86
+ })();
87
+ }, variant: "contained", color: "primary", children: "Launch" })] })] }), _jsxs("div", { className: classes.rightPanel, children: [_jsxs("div", { children: ["Synteny dataset to display between row ", selectedRow + 1, " and", ' ', selectedRow + 2] }), _jsx(ImportSyntenyTrackSelector, { model: model, selectedRow: selectedRow, assembly1: selectedAssemblyNames[selectedRow], assembly2: selectedAssemblyNames[selectedRow + 1] })] })] })] }));
129
88
  });
130
- async function doSubmit({ selectedAssemblyNames, model, preConfiguredSyntenyTracksToShow, userOpenedSyntenyTracksToShow, }) {
131
- const session = getSession(model);
132
- const { assemblyManager } = session;
133
- model.setViews(await Promise.all(selectedAssemblyNames.map(async (assemblyName) => {
134
- const asm = await assemblyManager.waitForAssembly(assemblyName);
135
- if (!asm) {
136
- throw new Error(`Assembly "${assemblyName}" failed to load`);
137
- }
138
- return {
139
- type: 'LinearGenomeView',
140
- bpPerPx: 1,
141
- offsetPx: 0,
142
- hideHeader: true,
143
- displayedRegions: asm.regions,
144
- };
145
- })));
146
- for (const view of model.views) {
147
- view.setWidth(model.width);
148
- view.showAllRegions();
149
- }
150
- if (!isSessionWithAddTracks(session)) {
151
- session.notify("Can't add tracks", 'warning');
152
- }
153
- else {
154
- userOpenedSyntenyTracksToShow.map((f, idx) => {
155
- if (f) {
156
- session.addTrackConf(f);
157
- model.toggleTrack(f.trackId, idx);
158
- }
159
- });
160
- }
161
- preConfiguredSyntenyTracksToShow.map((f, idx) => {
162
- if (f) {
163
- model.showTrack(f, idx);
164
- }
165
- });
166
- }
167
89
  export default LinearSyntenyViewImportForm;
@@ -0,0 +1,5 @@
1
+ import type { LinearSyntenyViewModel } from '../../model';
2
+ export declare function doSubmit({ selectedAssemblyNames, model, }: {
3
+ selectedAssemblyNames: string[];
4
+ model: LinearSyntenyViewModel;
5
+ }): Promise<void>;
@@ -0,0 +1,40 @@
1
+ import { getSession, isSessionWithAddTracks } from '@jbrowse/core/util';
2
+ import { toJS } from 'mobx';
3
+ export async function doSubmit({ selectedAssemblyNames, model, }) {
4
+ const session = getSession(model);
5
+ const { assemblyManager } = session;
6
+ const { importFormSyntenyTrackSelections } = model;
7
+ model.setViews(await Promise.all(selectedAssemblyNames.map(async (assemblyName) => {
8
+ const asm = await assemblyManager.waitForAssembly(assemblyName);
9
+ if (!asm) {
10
+ throw new Error(`Assembly "${assemblyName}" failed to load`);
11
+ }
12
+ return {
13
+ type: 'LinearGenomeView',
14
+ bpPerPx: 1,
15
+ offsetPx: 0,
16
+ hideHeader: true,
17
+ displayedRegions: asm.regions,
18
+ };
19
+ })));
20
+ for (const view of model.views) {
21
+ view.setWidth(model.width);
22
+ view.showAllRegions();
23
+ }
24
+ if (!isSessionWithAddTracks(session)) {
25
+ session.notify("Can't add tracks", 'warning');
26
+ }
27
+ else {
28
+ toJS(importFormSyntenyTrackSelections).map((f, idx) => {
29
+ var _a;
30
+ if (f.type === 'userOpened') {
31
+ session.addTrackConf(f.value);
32
+ model.toggleTrack((_a = f.value) === null || _a === void 0 ? void 0 : _a.trackId, idx);
33
+ }
34
+ else if (f.type === 'preConfigured') {
35
+ model.showTrack(f.value, idx);
36
+ }
37
+ });
38
+ }
39
+ model.clearImportFormSyntenyTracks();
40
+ }
@@ -0,0 +1,117 @@
1
+ import type { FileLocation } from '@jbrowse/core/util';
2
+ export declare function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }: {
3
+ radioOption: string;
4
+ assembly1: string;
5
+ assembly2: string;
6
+ fileLocation?: FileLocation;
7
+ indexFileLocation?: FileLocation;
8
+ bed1Location?: FileLocation;
9
+ bed2Location?: FileLocation;
10
+ }): {
11
+ type: string;
12
+ pafLocation: FileLocation | undefined;
13
+ queryAssembly: string;
14
+ targetAssembly: string;
15
+ outLocation?: undefined;
16
+ deltaLocation?: undefined;
17
+ chainLocation?: undefined;
18
+ mcscanAnchorsLocation?: undefined;
19
+ bed1Location?: undefined;
20
+ bed2Location?: undefined;
21
+ assemblyNames?: undefined;
22
+ mcscanSimpleAnchorsLocation?: undefined;
23
+ pifGzLocation?: undefined;
24
+ index?: undefined;
25
+ } | {
26
+ type: string;
27
+ outLocation: FileLocation | undefined;
28
+ queryAssembly: string;
29
+ targetAssembly: string;
30
+ pafLocation?: undefined;
31
+ deltaLocation?: undefined;
32
+ chainLocation?: undefined;
33
+ mcscanAnchorsLocation?: undefined;
34
+ bed1Location?: undefined;
35
+ bed2Location?: undefined;
36
+ assemblyNames?: undefined;
37
+ mcscanSimpleAnchorsLocation?: undefined;
38
+ pifGzLocation?: undefined;
39
+ index?: undefined;
40
+ } | {
41
+ type: string;
42
+ deltaLocation: FileLocation | undefined;
43
+ queryAssembly: string;
44
+ targetAssembly: string;
45
+ pafLocation?: undefined;
46
+ outLocation?: undefined;
47
+ chainLocation?: undefined;
48
+ mcscanAnchorsLocation?: undefined;
49
+ bed1Location?: undefined;
50
+ bed2Location?: undefined;
51
+ assemblyNames?: undefined;
52
+ mcscanSimpleAnchorsLocation?: undefined;
53
+ pifGzLocation?: undefined;
54
+ index?: undefined;
55
+ } | {
56
+ type: string;
57
+ chainLocation: FileLocation | undefined;
58
+ queryAssembly: string;
59
+ targetAssembly: string;
60
+ pafLocation?: undefined;
61
+ outLocation?: undefined;
62
+ deltaLocation?: undefined;
63
+ mcscanAnchorsLocation?: undefined;
64
+ bed1Location?: undefined;
65
+ bed2Location?: undefined;
66
+ assemblyNames?: undefined;
67
+ mcscanSimpleAnchorsLocation?: undefined;
68
+ pifGzLocation?: undefined;
69
+ index?: undefined;
70
+ } | {
71
+ type: string;
72
+ mcscanAnchorsLocation: FileLocation | undefined;
73
+ bed1Location: FileLocation | undefined;
74
+ bed2Location: FileLocation | undefined;
75
+ assemblyNames: string[];
76
+ pafLocation?: undefined;
77
+ queryAssembly?: undefined;
78
+ targetAssembly?: undefined;
79
+ outLocation?: undefined;
80
+ deltaLocation?: undefined;
81
+ chainLocation?: undefined;
82
+ mcscanSimpleAnchorsLocation?: undefined;
83
+ pifGzLocation?: undefined;
84
+ index?: undefined;
85
+ } | {
86
+ type: string;
87
+ mcscanSimpleAnchorsLocation: FileLocation | undefined;
88
+ bed1Location: FileLocation | undefined;
89
+ bed2Location: FileLocation | undefined;
90
+ assemblyNames: string[];
91
+ pafLocation?: undefined;
92
+ queryAssembly?: undefined;
93
+ targetAssembly?: undefined;
94
+ outLocation?: undefined;
95
+ deltaLocation?: undefined;
96
+ chainLocation?: undefined;
97
+ mcscanAnchorsLocation?: undefined;
98
+ pifGzLocation?: undefined;
99
+ index?: undefined;
100
+ } | {
101
+ type: string;
102
+ pifGzLocation: FileLocation | undefined;
103
+ index: {
104
+ location: FileLocation | undefined;
105
+ };
106
+ assemblyNames: string[];
107
+ pafLocation?: undefined;
108
+ queryAssembly?: undefined;
109
+ targetAssembly?: undefined;
110
+ outLocation?: undefined;
111
+ deltaLocation?: undefined;
112
+ chainLocation?: undefined;
113
+ mcscanAnchorsLocation?: undefined;
114
+ bed1Location?: undefined;
115
+ bed2Location?: undefined;
116
+ mcscanSimpleAnchorsLocation?: undefined;
117
+ };
@@ -0,0 +1,65 @@
1
+ export function getAdapter({ radioOption, assembly1, assembly2, fileLocation, indexFileLocation, bed1Location, bed2Location, }) {
2
+ if (radioOption === '.paf') {
3
+ return {
4
+ type: 'PAFAdapter',
5
+ pafLocation: fileLocation,
6
+ queryAssembly: assembly1,
7
+ targetAssembly: assembly2,
8
+ };
9
+ }
10
+ else if (radioOption === '.out') {
11
+ return {
12
+ type: 'MashMapAdapter',
13
+ outLocation: fileLocation,
14
+ queryAssembly: assembly1,
15
+ targetAssembly: assembly2,
16
+ };
17
+ }
18
+ else if (radioOption === '.delta') {
19
+ return {
20
+ type: 'DeltaAdapter',
21
+ deltaLocation: fileLocation,
22
+ queryAssembly: assembly1,
23
+ targetAssembly: assembly2,
24
+ };
25
+ }
26
+ else if (radioOption === '.chain') {
27
+ return {
28
+ type: 'ChainAdapter',
29
+ chainLocation: fileLocation,
30
+ queryAssembly: assembly1,
31
+ targetAssembly: assembly2,
32
+ };
33
+ }
34
+ else if (radioOption === '.anchors') {
35
+ return {
36
+ type: 'MCScanAnchorsAdapter',
37
+ mcscanAnchorsLocation: fileLocation,
38
+ bed1Location,
39
+ bed2Location,
40
+ assemblyNames: [assembly1, assembly2],
41
+ };
42
+ }
43
+ else if (radioOption === '.anchors.simple') {
44
+ return {
45
+ type: 'MCScanSimpleAnchorsAdapter',
46
+ mcscanSimpleAnchorsLocation: fileLocation,
47
+ bed1Location,
48
+ bed2Location,
49
+ assemblyNames: [assembly1, assembly2],
50
+ };
51
+ }
52
+ else if (radioOption === '.pif.gz') {
53
+ return {
54
+ type: 'PairwiseIndexedPAFAdapter',
55
+ pifGzLocation: fileLocation,
56
+ index: {
57
+ location: indexFileLocation,
58
+ },
59
+ assemblyNames: [assembly1, assembly2],
60
+ };
61
+ }
62
+ else {
63
+ throw new Error(`Unknown to detect type ${radioOption} from filename (select radio button to clarify)`);
64
+ }
65
+ }
@@ -1,10 +1,8 @@
1
1
  export function getName(sessionTrackData) {
2
2
  return sessionTrackData
3
- ? // @ts-expect-error
3
+ ?
4
4
  sessionTrackData.uri ||
5
- // @ts-expect-error
6
5
  sessionTrackData.localPath ||
7
- // @ts-expect-error
8
6
  sessionTrackData.name
9
7
  : undefined;
10
8
  }
@@ -1,7 +1,6 @@
1
- import React from 'react';
2
- import { LinearSyntenyViewModel } from '../model';
1
+ import type { LinearSyntenyViewModel } from '../model';
3
2
  type LSV = LinearSyntenyViewModel;
4
3
  declare const LinearSyntenyView: ({ model }: {
5
4
  model: LSV;
6
- }) => React.JSX.Element;
5
+ }) => import("react/jsx-runtime").JSX.Element;
7
6
  export default LinearSyntenyView;
@@ -1,9 +1,9 @@
1
- import React, { lazy } from 'react';
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { lazy } from 'react';
2
3
  import { observer } from 'mobx-react';
3
- // locals
4
4
  import LinearComparativeViewComponent from '../../LinearComparativeView/components/LinearComparativeView';
5
5
  const LinearSyntenyImportForm = lazy(() => import('./ImportForm/LinearSyntenyImportForm'));
6
6
  const LinearSyntenyView = observer(function ({ model }) {
7
- return !model.initialized ? (React.createElement(LinearSyntenyImportForm, { model: model })) : (React.createElement(LinearComparativeViewComponent, { model: model }));
7
+ return !model.initialized ? (_jsx(LinearSyntenyImportForm, { model: model })) : (_jsx(LinearComparativeViewComponent, { model: model }));
8
8
  });
9
9
  export default LinearSyntenyView;
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LinearSyntenyViewF(pluginManager: PluginManager): void;