@jbrowse/plugin-linear-comparative-view 2.16.1 → 2.18.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 (184) hide show
  1. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +1 -1
  2. package/dist/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -2
  3. package/dist/LGVSyntenyDisplay/components/util.d.ts +3 -3
  4. package/dist/LGVSyntenyDisplay/components/util.js +0 -1
  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 +104 -81
  10. package/dist/LGVSyntenyDisplay/model.js +1 -29
  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 +1 -1
  19. package/dist/LinearComparativeView/components/Header.js +4 -5
  20. package/dist/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -1
  21. package/dist/LinearComparativeView/components/HeaderSearchBoxes.js +3 -4
  22. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
  23. package/dist/LinearComparativeView/components/LinearComparativeRenderArea.js +8 -15
  24. package/dist/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
  25. package/dist/LinearComparativeView/components/LinearComparativeView.js +2 -4
  26. package/dist/LinearComparativeView/components/Rubberband.d.ts +1 -1
  27. package/dist/LinearComparativeView/components/Rubberband.js +17 -19
  28. package/dist/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
  29. package/dist/LinearComparativeView/components/VerticalGuide.js +1 -1
  30. package/dist/LinearComparativeView/index.d.ts +1 -1
  31. package/dist/LinearComparativeView/model.d.ts +6 -62
  32. package/dist/LinearComparativeView/model.js +3 -99
  33. package/dist/LinearReadVsRef/LinearReadVsRef.d.ts +1 -1
  34. package/dist/LinearReadVsRef/LinearReadVsRef.js +5 -19
  35. package/dist/LinearReadVsRef/index.d.ts +1 -1
  36. package/dist/LinearReadVsRef/index.js +0 -2
  37. package/dist/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  38. package/dist/LinearSyntenyDisplay/afterAttach.js +2 -9
  39. package/dist/LinearSyntenyDisplay/components/Component.d.ts +1 -1
  40. package/dist/LinearSyntenyDisplay/components/Component.js +2 -4
  41. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
  42. package/dist/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +6 -23
  43. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +2 -2
  44. package/dist/LinearSyntenyDisplay/components/SyntenyContextMenu.js +1 -1
  45. package/dist/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  46. package/dist/LinearSyntenyDisplay/components/util.d.ts +3 -3
  47. package/dist/LinearSyntenyDisplay/components/util.js +0 -9
  48. package/dist/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  49. package/dist/LinearSyntenyDisplay/configSchemaF.js +0 -15
  50. package/dist/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  51. package/dist/LinearSyntenyDisplay/drawSynteny.js +1 -23
  52. package/dist/LinearSyntenyDisplay/index.d.ts +1 -1
  53. package/dist/LinearSyntenyDisplay/index.js +1 -2
  54. package/dist/LinearSyntenyDisplay/model.d.ts +8 -102
  55. package/dist/LinearSyntenyDisplay/model.js +1 -92
  56. package/dist/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
  57. package/dist/LinearSyntenyView/components/ExportSvgDialog.js +2 -4
  58. package/dist/LinearSyntenyView/components/Icons.d.ts +1 -1
  59. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +2 -2
  60. package/dist/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +1 -1
  61. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
  62. package/dist/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +6 -8
  63. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +1 -1
  64. package/dist/LinearSyntenyView/components/ImportForm/TrackSelector.js +3 -5
  65. package/dist/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +3 -3
  66. package/dist/LinearSyntenyView/components/ImportForm/util.js +1 -3
  67. package/dist/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
  68. package/dist/LinearSyntenyView/components/LinearSyntenyView.js +0 -1
  69. package/dist/LinearSyntenyView/index.d.ts +1 -1
  70. package/dist/LinearSyntenyView/model.d.ts +5 -28
  71. package/dist/LinearSyntenyView/model.js +4 -41
  72. package/dist/LinearSyntenyView/svgcomponents/SVGBackground.js +1 -1
  73. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -1
  74. package/dist/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +1 -1
  75. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  76. package/dist/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +5 -10
  77. package/dist/LinearSyntenyViewHelper/index.d.ts +1 -1
  78. package/dist/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  79. package/dist/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  80. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
  81. package/dist/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -13
  82. package/dist/SyntenyFeatureDetail/index.d.ts +1 -1
  83. package/dist/SyntenyFeatureDetail/index.js +1 -7
  84. package/dist/SyntenyTrack/configSchema.d.ts +1 -1
  85. package/dist/SyntenyTrack/configSchema.js +1 -9
  86. package/dist/SyntenyTrack/index.d.ts +1 -1
  87. package/dist/SyntenyTrack/index.js +1 -1
  88. package/dist/index.d.ts +1 -1
  89. package/dist/index.js +4 -4
  90. package/dist/util.d.ts +2 -2
  91. package/dist/util.js +1 -11
  92. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.d.ts +1 -1
  93. package/esm/LGVSyntenyDisplay/components/LaunchSyntenyViewDialog.js +0 -2
  94. package/esm/LGVSyntenyDisplay/components/util.d.ts +3 -3
  95. package/esm/LGVSyntenyDisplay/components/util.js +0 -1
  96. package/esm/LGVSyntenyDisplay/configSchemaF.d.ts +19 -10
  97. package/esm/LGVSyntenyDisplay/configSchemaF.js +12 -9
  98. package/esm/LGVSyntenyDisplay/index.d.ts +1 -1
  99. package/esm/LGVSyntenyDisplay/index.js +1 -1
  100. package/esm/LGVSyntenyDisplay/model.d.ts +104 -81
  101. package/esm/LGVSyntenyDisplay/model.js +2 -30
  102. package/esm/LaunchLinearSyntenyView.d.ts +1 -1
  103. package/esm/LaunchLinearSyntenyView.js +1 -3
  104. package/esm/LinearComparativeDisplay/configSchemaF.d.ts +0 -3
  105. package/esm/LinearComparativeDisplay/configSchemaF.js +0 -6
  106. package/esm/LinearComparativeDisplay/index.d.ts +1 -1
  107. package/esm/LinearComparativeDisplay/stateModelFactory.d.ts +12 -69
  108. package/esm/LinearComparativeDisplay/stateModelFactory.js +14 -58
  109. package/esm/LinearComparativeView/components/Header.d.ts +1 -1
  110. package/esm/LinearComparativeView/components/Header.js +4 -5
  111. package/esm/LinearComparativeView/components/HeaderSearchBoxes.d.ts +1 -1
  112. package/esm/LinearComparativeView/components/HeaderSearchBoxes.js +3 -4
  113. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.d.ts +1 -1
  114. package/esm/LinearComparativeView/components/LinearComparativeRenderArea.js +8 -15
  115. package/esm/LinearComparativeView/components/LinearComparativeView.d.ts +1 -1
  116. package/esm/LinearComparativeView/components/LinearComparativeView.js +2 -4
  117. package/esm/LinearComparativeView/components/Rubberband.d.ts +1 -1
  118. package/esm/LinearComparativeView/components/Rubberband.js +18 -20
  119. package/esm/LinearComparativeView/components/VerticalGuide.d.ts +1 -1
  120. package/esm/LinearComparativeView/components/VerticalGuide.js +1 -1
  121. package/esm/LinearComparativeView/index.d.ts +1 -1
  122. package/esm/LinearComparativeView/model.d.ts +6 -62
  123. package/esm/LinearComparativeView/model.js +4 -100
  124. package/esm/LinearReadVsRef/LinearReadVsRef.d.ts +1 -1
  125. package/esm/LinearReadVsRef/LinearReadVsRef.js +5 -19
  126. package/esm/LinearReadVsRef/index.d.ts +1 -1
  127. package/esm/LinearReadVsRef/index.js +1 -3
  128. package/esm/LinearSyntenyDisplay/afterAttach.d.ts +1 -1
  129. package/esm/LinearSyntenyDisplay/afterAttach.js +2 -9
  130. package/esm/LinearSyntenyDisplay/components/Component.d.ts +1 -1
  131. package/esm/LinearSyntenyDisplay/components/Component.js +2 -4
  132. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.d.ts +1 -1
  133. package/esm/LinearSyntenyDisplay/components/LinearSyntenyRendering.js +8 -25
  134. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.d.ts +2 -2
  135. package/esm/LinearSyntenyDisplay/components/SyntenyContextMenu.js +1 -1
  136. package/esm/LinearSyntenyDisplay/components/SyntenyTooltip.js +1 -1
  137. package/esm/LinearSyntenyDisplay/components/util.d.ts +3 -3
  138. package/esm/LinearSyntenyDisplay/components/util.js +2 -11
  139. package/esm/LinearSyntenyDisplay/configSchemaF.d.ts +1 -12
  140. package/esm/LinearSyntenyDisplay/configSchemaF.js +0 -15
  141. package/esm/LinearSyntenyDisplay/drawSynteny.d.ts +1 -1
  142. package/esm/LinearSyntenyDisplay/drawSynteny.js +1 -23
  143. package/esm/LinearSyntenyDisplay/index.d.ts +1 -1
  144. package/esm/LinearSyntenyDisplay/index.js +1 -2
  145. package/esm/LinearSyntenyDisplay/model.d.ts +8 -102
  146. package/esm/LinearSyntenyDisplay/model.js +1 -92
  147. package/esm/LinearSyntenyView/components/ExportSvgDialog.d.ts +1 -1
  148. package/esm/LinearSyntenyView/components/ExportSvgDialog.js +2 -4
  149. package/esm/LinearSyntenyView/components/Icons.d.ts +1 -1
  150. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.d.ts +2 -2
  151. package/esm/LinearSyntenyView/components/ImportForm/AddCustomTrack.js +2 -2
  152. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.d.ts +1 -1
  153. package/esm/LinearSyntenyView/components/ImportForm/LinearSyntenyImportForm.js +6 -8
  154. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.d.ts +1 -1
  155. package/esm/LinearSyntenyView/components/ImportForm/TrackSelector.js +4 -6
  156. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.d.ts +3 -3
  157. package/esm/LinearSyntenyView/components/ImportForm/TrackSelectorUtil.js +1 -1
  158. package/esm/LinearSyntenyView/components/ImportForm/util.js +1 -3
  159. package/esm/LinearSyntenyView/components/LinearSyntenyView.d.ts +1 -1
  160. package/esm/LinearSyntenyView/components/LinearSyntenyView.js +0 -1
  161. package/esm/LinearSyntenyView/index.d.ts +1 -1
  162. package/esm/LinearSyntenyView/model.d.ts +5 -28
  163. package/esm/LinearSyntenyView/model.js +4 -41
  164. package/esm/LinearSyntenyView/svgcomponents/SVGBackground.js +1 -1
  165. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.d.ts +1 -1
  166. package/esm/LinearSyntenyView/svgcomponents/SVGLinearGenomeView.js +2 -2
  167. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.d.ts +1 -1
  168. package/esm/LinearSyntenyView/svgcomponents/SVGLinearSyntenyView.js +6 -11
  169. package/esm/LinearSyntenyViewHelper/index.d.ts +1 -1
  170. package/esm/LinearSyntenyViewHelper/stateModelFactory.d.ts +2 -14
  171. package/esm/LinearSyntenyViewHelper/stateModelFactory.js +2 -29
  172. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.d.ts +1 -1
  173. package/esm/SyntenyFeatureDetail/SyntenyFeatureDetail.js +4 -13
  174. package/esm/SyntenyFeatureDetail/index.d.ts +1 -1
  175. package/esm/SyntenyFeatureDetail/index.js +1 -7
  176. package/esm/SyntenyTrack/configSchema.d.ts +1 -1
  177. package/esm/SyntenyTrack/configSchema.js +1 -9
  178. package/esm/SyntenyTrack/index.d.ts +1 -1
  179. package/esm/SyntenyTrack/index.js +1 -1
  180. package/esm/index.d.ts +1 -1
  181. package/esm/index.js +4 -4
  182. package/esm/util.d.ts +2 -2
  183. package/esm/util.js +1 -11
  184. package/package.json +2 -4
@@ -1,46 +1,27 @@
1
- import { readConfObject, ConfigurationReference, } from '@jbrowse/core/configuration';
2
- import { types, getSnapshot, getParent } from 'mobx-state-tree';
1
+ import { ConfigurationReference, readConfObject, } from '@jbrowse/core/configuration';
2
+ import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models';
3
3
  import { dedupe, getContainingView, getSession, makeAbortableReaction, } from '@jbrowse/core/util';
4
+ import { stopStopToken } from '@jbrowse/core/util/stopToken';
4
5
  import { getRpcSessionId } from '@jbrowse/core/util/tracks';
5
- import { BaseDisplay } from '@jbrowse/core/pluggableElementTypes/models';
6
- /**
7
- * #stateModel LinearComparativeDisplay
8
- * extends
9
- * - [BaseDisplay](../basedisplay)
10
- */
6
+ import { getParent, getSnapshot, types } from 'mobx-state-tree';
11
7
  function stateModelFactory(configSchema) {
12
8
  return types
13
9
  .compose('LinearComparativeDisplay', BaseDisplay, types.model({
14
- /**
15
- * #property
16
- */
17
10
  type: types.literal('LinearComparativeDisplay'),
18
- /**
19
- * #property
20
- */
21
11
  configuration: ConfigurationReference(configSchema),
22
12
  }))
23
- .volatile(( /* self */) => ({
13
+ .volatile(() => ({
24
14
  renderInProgress: undefined,
25
15
  features: undefined,
26
16
  message: undefined,
27
17
  }))
28
18
  .views(self => ({
29
- /**
30
- * #getter
31
- */
32
19
  get level() {
33
20
  return getParent(self, 4).level;
34
21
  },
35
- /**
36
- * #getter
37
- */
38
22
  get height() {
39
23
  return getParent(self, 4).height;
40
24
  },
41
- /**
42
- * #getter
43
- */
44
25
  renderProps() {
45
26
  return {
46
27
  rpcDriverName: self.rpcDriverName,
@@ -50,33 +31,18 @@ function stateModelFactory(configSchema) {
50
31
  },
51
32
  }))
52
33
  .actions(self => {
53
- let renderInProgress;
34
+ let stopToken;
54
35
  return {
55
- /**
56
- * #action
57
- * controlled by a reaction
58
- */
59
- setLoading(abortController) {
36
+ setLoading(newStopToken) {
60
37
  self.message = undefined;
61
38
  self.error = undefined;
62
- renderInProgress = abortController;
39
+ stopToken = newStopToken;
63
40
  },
64
- /**
65
- * #action
66
- * controlled by a reaction
67
- */
68
41
  setMessage(messageText) {
69
- if (renderInProgress && !renderInProgress.signal.aborted) {
70
- renderInProgress.abort();
71
- }
72
42
  self.message = messageText;
73
43
  self.error = undefined;
74
- renderInProgress = undefined;
44
+ stopToken = undefined;
75
45
  },
76
- /**
77
- * #action
78
- * controlled by a reaction
79
- */
80
46
  setRendered(args) {
81
47
  if (!args) {
82
48
  return;
@@ -101,34 +67,27 @@ function stateModelFactory(configSchema) {
101
67
  }
102
68
  self.message = undefined;
103
69
  self.error = undefined;
104
- renderInProgress = undefined;
70
+ stopToken = undefined;
105
71
  if (foundNewFeatureNotInExistingMap ||
106
72
  foundExistingFeatureNotInNewMap ||
107
73
  !self.features) {
108
74
  self.features = features;
109
75
  }
110
76
  },
111
- /**
112
- * #action
113
- * controlled by a reaction
114
- */
115
77
  setError(error) {
116
78
  console.error(error);
117
- if (renderInProgress && !renderInProgress.signal.aborted) {
118
- renderInProgress.abort();
79
+ if (stopToken !== undefined) {
80
+ stopStopToken(stopToken);
119
81
  }
120
- // the rendering failed for some reason
121
82
  self.message = undefined;
122
83
  self.error = error;
123
- renderInProgress = undefined;
84
+ stopToken = undefined;
124
85
  },
125
86
  };
126
87
  })
127
88
  .actions(self => ({
128
89
  afterAttach() {
129
- makeAbortableReaction(
130
- // @ts-expect-error
131
- self, renderBlockData, renderBlockEffect, {
90
+ makeAbortableReaction(self, renderBlockData, renderBlockEffect, {
132
91
  name: `${self.type} ${self.id} rendering`,
133
92
  delay: 1000,
134
93
  fireImmediately: true,
@@ -139,9 +98,6 @@ function stateModelFactory(configSchema) {
139
98
  function renderBlockData(self) {
140
99
  const { rpcManager } = getSession(self);
141
100
  const display = self;
142
- // Alternative to readConfObject(config) is below used because
143
- // renderProps is something under our control. Compare to
144
- // serverSideRenderedBlock
145
101
  readConfObject(self.configuration);
146
102
  const { level, adapterConfig } = self;
147
103
  const parent = getContainingView(self);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearComparativeViewModel } from '../model';
2
+ import type { LinearComparativeViewModel } from '../model';
3
3
  declare const Header: ({ model, }: {
4
4
  model: LinearComparativeViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,12 +1,11 @@
1
1
  import React, { useState } from 'react';
2
- import { observer } from 'mobx-react';
3
- import { FormGroup } from '@mui/material';
4
- import { makeStyles } from 'tss-react/mui';
5
2
  import CascadingMenuButton from '@jbrowse/core/ui/CascadingMenuButton';
6
- // icons
3
+ import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
7
4
  import MoreVertIcon from '@mui/icons-material/MoreVert';
8
5
  import SearchIcon from '@mui/icons-material/Search';
9
- import { TrackSelector as TrackSelectorIcon } from '@jbrowse/core/ui/Icons';
6
+ import { FormGroup } from '@mui/material';
7
+ import { observer } from 'mobx-react';
8
+ import { makeStyles } from 'tss-react/mui';
10
9
  import HeaderSearchBoxes from './HeaderSearchBoxes';
11
10
  const useStyles = makeStyles()({
12
11
  inline: {
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
2
+ import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
3
3
  declare const HeaderSearchBoxes: ({ view, }: {
4
4
  view: LinearGenomeViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,10 +1,9 @@
1
1
  import React from 'react';
2
- import { observer } from 'mobx-react';
2
+ import { toLocale } from '@jbrowse/core/util';
3
+ import { SearchBox } from '@jbrowse/plugin-linear-genome-view';
3
4
  import { Typography } from '@mui/material';
5
+ import { observer } from 'mobx-react';
4
6
  import { makeStyles } from 'tss-react/mui';
5
- // jbrowse
6
- import { SearchBox, } from '@jbrowse/plugin-linear-genome-view';
7
- import { toLocale } from '@jbrowse/core/util';
8
7
  const useStyles = makeStyles()(() => ({
9
8
  bp: {
10
9
  display: 'flex',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearComparativeViewModel } from '../model';
2
+ import type { LinearComparativeViewModel } from '../model';
3
3
  declare const LinearComparativeRenderArea: ({ model, }: {
4
4
  model: LinearComparativeViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { makeStyles } from 'tss-react/mui';
3
- import { observer } from 'mobx-react';
4
- import { getEnv } from '@jbrowse/core/util';
5
- import { ResizeHandle } from '@jbrowse/core/ui';
6
2
  import { getConf } from '@jbrowse/core/configuration';
3
+ import { ResizeHandle } from '@jbrowse/core/ui';
4
+ import { getEnv } from '@jbrowse/core/util';
5
+ import { observer } from 'mobx-react';
6
+ import { makeStyles } from 'tss-react/mui';
7
7
  const useStyles = makeStyles()({
8
8
  container: {
9
9
  display: 'grid',
@@ -25,19 +25,12 @@ function View({ view }) {
25
25
  const LinearComparativeRenderArea = observer(function ({ model, }) {
26
26
  const { classes } = useStyles();
27
27
  const { views, levels } = model;
28
- const RenderList = [
29
- React.createElement(View, { key: views[0].id, view: views[0] }),
30
- ];
31
- for (let i = 1; i < views.length; i++) {
32
- const view = views[i];
33
- const level = levels[i - 1];
34
- RenderList.push(React.createElement(React.Fragment, { key: view.id },
28
+ return (React.createElement("div", { className: classes.container }, views.map((view, i) => (React.createElement(React.Fragment, { key: view.id },
29
+ i > 0 ? (React.createElement(React.Fragment, null,
35
30
  React.createElement("div", { className: classes.container },
36
31
  React.createElement(Overlays, { model: model, level: i - 1 })),
37
- React.createElement(ResizeHandle, { onDrag: n => level === null || level === void 0 ? void 0 : level.setHeight(level.height + n), className: classes.resizeHandle }),
38
- React.createElement(View, { view: view })));
39
- }
40
- return React.createElement("div", { className: classes.container }, RenderList);
32
+ React.createElement(ResizeHandle, { onDrag: n => { var _a, _b; return (_a = levels[i - 1]) === null || _a === void 0 ? void 0 : _a.setHeight((((_b = levels[i - 1]) === null || _b === void 0 ? void 0 : _b.height) || 0) + n); }, className: classes.resizeHandle }))) : null,
33
+ React.createElement(View, { view: view }))))));
41
34
  });
42
35
  const Overlays = observer(function ({ model, level, }) {
43
36
  var _a;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearComparativeViewModel } from '../model';
2
+ import type { LinearComparativeViewModel } from '../model';
3
3
  declare const LinearComparativeView: ({ model, }: {
4
4
  model: LinearComparativeViewModel;
5
5
  }) => React.JSX.Element;
@@ -1,12 +1,10 @@
1
1
  import React from 'react';
2
- import { makeStyles } from 'tss-react/mui';
3
2
  import { observer } from 'mobx-react';
4
- import Rubberband from './Rubberband';
3
+ import { makeStyles } from 'tss-react/mui';
5
4
  import Header from './Header';
6
5
  import LinearComparativeRenderArea from './LinearComparativeRenderArea';
6
+ import Rubberband from './Rubberband';
7
7
  const useStyles = makeStyles()(theme => ({
8
- // this helps keep the vertical guide inside the parent view container,
9
- // similar style exists in the single LGV's trackscontainer
10
8
  rubberbandContainer: {
11
9
  position: 'relative',
12
10
  overflow: 'hidden',
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearComparativeViewModel } from '../model';
2
+ import type { LinearComparativeViewModel } from '../model';
3
3
  type LCV = LinearComparativeViewModel;
4
4
  declare const LinearComparativeRubberband: ({ model, ControlComponent, }: {
5
5
  model: LCV;
@@ -1,9 +1,10 @@
1
- import React, { useRef, useEffect, useState } from 'react';
2
- import { observer } from 'mobx-react';
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import { Menu } from '@jbrowse/core/ui';
3
+ import { stringify } from '@jbrowse/core/util';
3
4
  import { Popover, Typography, alpha } from '@mui/material';
5
+ import { transaction } from 'mobx';
6
+ import { observer } from 'mobx-react';
4
7
  import { makeStyles } from 'tss-react/mui';
5
- import { stringify } from '@jbrowse/core/util';
6
- import { Menu } from '@jbrowse/core/ui';
7
8
  import VerticalGuide from './VerticalGuide';
8
9
  const useStyles = makeStyles()(theme => {
9
10
  return {
@@ -36,8 +37,6 @@ const useStyles = makeStyles()(theme => {
36
37
  const LinearComparativeRubberband = observer(function Rubberband({ model, ControlComponent = React.createElement("div", null), }) {
37
38
  const [startX, setStartX] = useState();
38
39
  const [currentX, setCurrentX] = useState();
39
- // clientX and clientY used for anchorPosition for menu
40
- // offsetX used for calculations about width of selection
41
40
  const [anchorPosition, setAnchorPosition] = useState();
42
41
  const [guideX, setGuideX] = useState();
43
42
  const controlsRef = useRef(null);
@@ -51,7 +50,6 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
51
50
  }
52
51
  let leftPx = startX;
53
52
  let rightPx = offsetX;
54
- // handles clicking and dragging to the left
55
53
  if (rightPx < leftPx) {
56
54
  ;
57
55
  [leftPx, rightPx] = [rightPx, leftPx];
@@ -71,19 +69,19 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
71
69
  const { clientX, clientY } = event;
72
70
  const ref = controlsRef.current;
73
71
  const offsetX = clientX - ref.getBoundingClientRect().left;
74
- // as stated above, store both clientX/Y and offsetX for different
75
- // purposes
76
72
  setAnchorPosition({
77
73
  offsetX,
78
74
  clientX,
79
75
  clientY,
80
76
  });
81
- model.views.forEach(view => {
82
- const args = computeOffsets(offsetX, view);
83
- if (args) {
84
- const { leftOffset, rightOffset } = args;
85
- view.setOffsets(leftOffset, rightOffset);
86
- }
77
+ transaction(() => {
78
+ model.views.forEach(view => {
79
+ const args = computeOffsets(offsetX, view);
80
+ if (args) {
81
+ const { leftOffset, rightOffset } = args;
82
+ view.setOffsets(leftOffset, rightOffset);
83
+ }
84
+ });
87
85
  });
88
86
  setGuideX(undefined);
89
87
  }
@@ -120,8 +118,10 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
120
118
  }
121
119
  function mouseOut() {
122
120
  setGuideX(undefined);
123
- model.views.forEach(view => {
124
- view.setOffsets(undefined, undefined);
121
+ transaction(() => {
122
+ model.views.forEach(view => {
123
+ view.setOffsets(undefined, undefined);
124
+ });
125
125
  });
126
126
  }
127
127
  function handleClose() {
@@ -163,9 +163,7 @@ const LinearComparativeRubberband = observer(function Rubberband({ model, Contro
163
163
  horizontal: 'left',
164
164
  }, keepMounted: true, disableRestoreFocus: true }, rightBpOffset.map((l, idx) => (React.createElement(Typography, { key: [JSON.stringify(l), idx, 'right'].join('-') }, stringify(l, true))))))) : null,
165
165
  React.createElement("div", { ref: rubberbandRef, className: classes.rubberband, style: { left, width } },
166
- React.createElement(Typography, { variant: "h6", className: classes.rubberbandText }, numOfBpSelected.map((n, i) => (
167
- /* biome-ignore lint/suspicious/noArrayIndexKey: */
168
- React.createElement(Typography, { key: `${n}_${i}` }, `${n.toLocaleString('en-US')}bp`))))),
166
+ React.createElement(Typography, { variant: "h6", className: classes.rubberbandText }, numOfBpSelected.map((n, i) => (React.createElement(Typography, { key: `${n}_${i}` }, `${n.toLocaleString('en-US')}bp`))))),
169
167
  React.createElement("div", { className: classes.rubberbandControl, ref: controlsRef, onMouseDown: mouseDown, onMouseOut: mouseOut, onMouseMove: mouseMove }, ControlComponent),
170
168
  anchorPosition ? (React.createElement(Menu, { anchorReference: "anchorPosition", anchorPosition: {
171
169
  left: anchorPosition.clientX,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { LinearComparativeViewModel } from '../model';
2
+ import type { LinearComparativeViewModel } from '../model';
3
3
  type LCV = LinearComparativeViewModel;
4
4
  declare const VerticalGuide: ({ model, coordX, }: {
5
5
  model: LCV;
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
+ import { stringify } from '@jbrowse/core/util';
2
3
  import { Tooltip, Typography } from '@mui/material';
3
4
  import { observer } from 'mobx-react';
4
- import { stringify } from '@jbrowse/core/util';
5
5
  import { makeStyles } from 'tss-react/mui';
6
6
  const useStyles = makeStyles()({
7
7
  guide: {
@@ -1,2 +1,2 @@
1
- import PluginManager from '@jbrowse/core/PluginManager';
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
2
  export default function LinearComparativeViewF(pluginManager: PluginManager): void;
@@ -1,12 +1,7 @@
1
- import { Instance, SnapshotIn } from 'mobx-state-tree';
2
- import { MenuItem } from '@jbrowse/core/ui';
3
- import PluginManager from '@jbrowse/core/PluginManager';
4
- import { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
5
- /**
6
- * #stateModel LinearComparativeView
7
- * extends
8
- * - [BaseViewModel](../baseviewmodel)
9
- */
1
+ import type PluginManager from '@jbrowse/core/PluginManager';
2
+ import type { MenuItem } from '@jbrowse/core/ui';
3
+ import type { LinearGenomeViewModel } from '@jbrowse/plugin-linear-genome-view';
4
+ import type { Instance, SnapshotIn } from 'mobx-state-tree';
10
5
  declare function stateModelFactory(pluginManager: PluginManager): import("mobx-state-tree").IModelType<{
11
6
  id: import("mobx-state-tree").IOptionalIType<import("mobx-state-tree").ISimpleType<string>, [undefined]>;
12
7
  displayName: import("mobx-state-tree").IMaybe<import("mobx-state-tree").ISimpleType<string>>;
@@ -82,6 +77,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
82
77
  scaleBarDisplayPrefix(): string | undefined;
83
78
  MiniControlsComponent(): React.FC<any>;
84
79
  HeaderComponent(): React.FC<any>;
80
+ readonly assembliesNotFound: string | undefined;
85
81
  readonly assemblyErrors: string;
86
82
  readonly assembliesInitialized: boolean;
87
83
  readonly initialized: boolean;
@@ -261,81 +257,28 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
261
257
  setWidth(newWidth: number): void;
262
258
  setMinimized(flag: boolean): void;
263
259
  } & {
264
- /**
265
- * #volatile
266
- */
267
260
  width: number | undefined;
268
261
  } & {
269
- /**
270
- * #getter
271
- */
272
262
  readonly initialized: boolean;
273
- /**
274
- * #getter
275
- */
276
263
  readonly refNames: string[][];
277
- /**
278
- * #getter
279
- */
280
264
  readonly assemblyNames: string[];
281
265
  } & {
282
266
  beforeDestroy(): void;
283
267
  onSubviewAction(actionName: string, path: string, args?: unknown[]): void;
284
- /**
285
- * #action
286
- */
287
268
  setWidth(newWidth: number): void;
288
- /**
289
- * #action
290
- */
291
269
  setViews(views: SnapshotIn<LinearGenomeViewModel>[]): void;
292
- /**
293
- * #action
294
- */
295
270
  removeView(view: LinearGenomeViewModel): void;
296
- /**
297
- * #action
298
- */
299
271
  setLevelHeight(newHeight: number, level?: number): number;
300
- /**
301
- * #action
302
- */
303
272
  activateTrackSelector(level: number): import("@jbrowse/core/util").Widget;
304
- /**
305
- * #action
306
- */
307
273
  toggleTrack(trackId: string, level?: number): void;
308
- /**
309
- * #action
310
- */
311
274
  showTrack(trackId: string, level?: number, initialSnapshot?: {}): void;
312
- /**
313
- * #action
314
- */
315
275
  hideTrack(trackId: string, level?: number): void;
316
- /**
317
- * #action
318
- */
319
276
  squareView(): void;
320
- /**
321
- * #action
322
- */
323
277
  clearView(): void;
324
278
  } & {
325
- /**
326
- * #method
327
- * includes a subset of view menu options because the full list is a
328
- * little overwhelming. overridden by subclasses
329
- */
330
279
  headerMenuItems(): MenuItem[];
331
280
  } & {
332
- /**
333
- * #method
334
- */
335
281
  menuItems(): MenuItem[];
336
- /**
337
- * #method
338
- */
339
282
  rubberBandMenuItems(): {
340
283
  label: string;
341
284
  onClick: () => void;
@@ -417,6 +360,7 @@ declare function stateModelFactory(pluginManager: PluginManager): import("mobx-s
417
360
  scaleBarDisplayPrefix(): string | undefined;
418
361
  MiniControlsComponent(): React.FC<any>;
419
362
  HeaderComponent(): React.FC<any>;
363
+ readonly assembliesNotFound: string | undefined;
420
364
  readonly assemblyErrors: string;
421
365
  readonly assembliesInitialized: boolean;
422
366
  readonly initialized: boolean;