@jbrowse/plugin-linear-genome-view 1.6.9 → 1.7.3

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 (111) hide show
  1. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.d.ts +13 -13
  2. package/dist/BaseLinearDisplay/components/BaseLinearDisplay.js +232 -0
  3. package/dist/BaseLinearDisplay/components/Block.d.ts +15 -15
  4. package/dist/BaseLinearDisplay/components/Block.js +86 -0
  5. package/dist/BaseLinearDisplay/components/LinearBlocks.d.ts +12 -12
  6. package/dist/BaseLinearDisplay/components/LinearBlocks.js +110 -0
  7. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.d.ts +4 -4
  8. package/dist/BaseLinearDisplay/components/ServerSideRenderedBlockContent.js +192 -0
  9. package/dist/BaseLinearDisplay/index.d.ts +5 -5
  10. package/dist/BaseLinearDisplay/index.js +41 -0
  11. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.d.ts +227 -230
  12. package/dist/BaseLinearDisplay/models/BaseLinearDisplayModel.js +763 -0
  13. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.d.ts +1 -1
  14. package/dist/BaseLinearDisplay/models/baseLinearDisplayConfigSchema.js +24 -0
  15. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.d.ts +96 -96
  16. package/dist/BaseLinearDisplay/models/serverSideRenderedBlock.js +328 -0
  17. package/dist/LinearBareDisplay/configSchema.d.ts +2 -2
  18. package/dist/LinearBareDisplay/configSchema.js +19 -0
  19. package/dist/LinearBareDisplay/index.d.ts +2 -2
  20. package/dist/LinearBareDisplay/index.js +21 -0
  21. package/dist/LinearBareDisplay/index.test.js +33 -0
  22. package/dist/LinearBareDisplay/model.d.ts +192 -192
  23. package/dist/LinearBareDisplay/model.js +44 -0
  24. package/dist/LinearBasicDisplay/components/SetMaxHeight.d.ts +10 -10
  25. package/dist/LinearBasicDisplay/components/SetMaxHeight.js +94 -0
  26. package/dist/LinearBasicDisplay/configSchema.d.ts +2 -2
  27. package/dist/LinearBasicDisplay/configSchema.js +25 -0
  28. package/dist/LinearBasicDisplay/index.d.ts +2 -2
  29. package/dist/LinearBasicDisplay/index.js +23 -0
  30. package/dist/LinearBasicDisplay/model.d.ts +213 -213
  31. package/dist/LinearBasicDisplay/model.js +162 -0
  32. package/dist/LinearGenomeView/components/CenterLine.d.ts +14 -14
  33. package/dist/LinearGenomeView/components/CenterLine.js +80 -0
  34. package/dist/LinearGenomeView/components/ExportSvgDialog.d.ts +6 -6
  35. package/dist/LinearGenomeView/components/ExportSvgDialog.js +137 -0
  36. package/dist/LinearGenomeView/components/Header.d.ts +7 -7
  37. package/dist/LinearGenomeView/components/Header.js +144 -0
  38. package/dist/LinearGenomeView/components/HelpDialog.d.ts +5 -5
  39. package/dist/LinearGenomeView/components/HelpDialog.js +48 -0
  40. package/dist/LinearGenomeView/components/ImportForm.d.ts +7 -7
  41. package/dist/LinearGenomeView/components/ImportForm.js +330 -0
  42. package/dist/LinearGenomeView/components/LinearGenomeView.d.ts +7 -7
  43. package/dist/LinearGenomeView/components/LinearGenomeView.js +129 -0
  44. package/dist/LinearGenomeView/components/LinearGenomeView.test.js +234 -0
  45. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.d.ts +4 -4
  46. package/dist/LinearGenomeView/components/LinearGenomeViewSvg.js +349 -0
  47. package/dist/LinearGenomeView/components/MiniControls.d.ts +6 -6
  48. package/dist/LinearGenomeView/components/MiniControls.js +83 -0
  49. package/dist/LinearGenomeView/components/OverviewRubberBand.d.ts +22 -22
  50. package/dist/LinearGenomeView/components/OverviewRubberBand.js +310 -0
  51. package/dist/LinearGenomeView/components/OverviewScaleBar.d.ts +132 -124
  52. package/dist/LinearGenomeView/components/OverviewScaleBar.js +403 -0
  53. package/dist/LinearGenomeView/components/RefNameAutocomplete.d.ts +21 -21
  54. package/dist/LinearGenomeView/components/RefNameAutocomplete.js +331 -0
  55. package/dist/LinearGenomeView/components/RubberBand.d.ts +9 -20
  56. package/dist/LinearGenomeView/components/RubberBand.js +309 -0
  57. package/dist/LinearGenomeView/components/Ruler.d.ts +27 -27
  58. package/dist/LinearGenomeView/components/Ruler.js +101 -0
  59. package/dist/LinearGenomeView/components/ScaleBar.d.ts +401 -401
  60. package/dist/LinearGenomeView/components/ScaleBar.js +184 -0
  61. package/dist/LinearGenomeView/components/ScaleBar.test.js +180 -0
  62. package/dist/LinearGenomeView/components/SearchBox.d.ts +8 -8
  63. package/dist/LinearGenomeView/components/SearchBox.js +201 -0
  64. package/dist/LinearGenomeView/components/SearchResultsDialog.d.ts +8 -8
  65. package/dist/LinearGenomeView/components/SearchResultsDialog.js +159 -0
  66. package/dist/LinearGenomeView/components/SequenceDialog.d.ts +8 -8
  67. package/dist/LinearGenomeView/components/SequenceDialog.js +304 -0
  68. package/dist/LinearGenomeView/components/TrackContainer.d.ts +9 -9
  69. package/dist/LinearGenomeView/components/TrackContainer.js +179 -0
  70. package/dist/LinearGenomeView/components/TrackLabel.d.ts +44 -44
  71. package/dist/LinearGenomeView/components/TrackLabel.js +165 -0
  72. package/dist/LinearGenomeView/components/TracksContainer.d.ts +10 -10
  73. package/dist/LinearGenomeView/components/TracksContainer.js +214 -0
  74. package/dist/LinearGenomeView/components/VerticalGuides.d.ts +9 -9
  75. package/dist/LinearGenomeView/components/VerticalGuides.js +116 -0
  76. package/dist/LinearGenomeView/components/ZoomControls.d.ts +7 -7
  77. package/dist/LinearGenomeView/components/ZoomControls.js +92 -0
  78. package/dist/LinearGenomeView/components/util.d.ts +2 -2
  79. package/dist/LinearGenomeView/components/util.js +16 -0
  80. package/dist/LinearGenomeView/index.d.ts +292 -292
  81. package/dist/LinearGenomeView/index.js +1418 -0
  82. package/dist/LinearGenomeView/index.test.js +1170 -0
  83. package/dist/LinearGenomeView/util.d.ts +14 -14
  84. package/dist/LinearGenomeView/util.js +93 -0
  85. package/dist/LinearGenomeView/util.test.js +78 -0
  86. package/dist/index.d.ts +565 -565
  87. package/dist/index.js +293 -6
  88. package/package.json +6 -9
  89. package/src/BaseLinearDisplay/models/BaseLinearDisplayModel.tsx +2 -0
  90. package/src/BaseLinearDisplay/models/serverSideRenderedBlock.ts +10 -8
  91. package/src/LinearBasicDisplay/components/SetMaxHeight.tsx +1 -1
  92. package/src/LinearBasicDisplay/model.ts +17 -18
  93. package/src/LinearGenomeView/components/Header.tsx +1 -1
  94. package/src/LinearGenomeView/components/ImportForm.tsx +10 -4
  95. package/src/LinearGenomeView/components/LinearGenomeView.test.js +1 -0
  96. package/src/LinearGenomeView/components/OverviewScaleBar.tsx +2 -2
  97. package/src/LinearGenomeView/components/RubberBand.tsx +14 -24
  98. package/src/LinearGenomeView/components/ScaleBar.test.tsx +1 -0
  99. package/src/LinearGenomeView/components/ScaleBar.tsx +3 -6
  100. package/src/LinearGenomeView/components/SequenceDialog.tsx +1 -1
  101. package/src/LinearGenomeView/components/TrackLabel.tsx +1 -1
  102. package/src/LinearGenomeView/components/__snapshots__/LinearGenomeView.test.js.snap +0 -4
  103. package/src/LinearGenomeView/index.tsx +2 -3
  104. package/dist/LinearBareDisplay/index.test.d.ts +0 -1
  105. package/dist/LinearGenomeView/components/LinearGenomeView.test.d.ts +0 -1
  106. package/dist/plugin-linear-genome-view.cjs.development.js +0 -8121
  107. package/dist/plugin-linear-genome-view.cjs.development.js.map +0 -1
  108. package/dist/plugin-linear-genome-view.cjs.production.min.js +0 -2
  109. package/dist/plugin-linear-genome-view.cjs.production.min.js.map +0 -1
  110. package/dist/plugin-linear-genome-view.esm.js +0 -8105
  111. package/dist/plugin-linear-genome-view.esm.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,295 @@
1
+ "use strict";
1
2
 
2
- 'use strict'
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
 
4
- if (process.env.NODE_ENV === 'production') {
5
- module.exports = require('./plugin-linear-genome-view.cjs.production.min.js')
6
- } else {
7
- module.exports = require('./plugin-linear-genome-view.cjs.development.js')
8
- }
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
7
+ Object.defineProperty(exports, "__esModule", {
8
+ value: true
9
+ });
10
+ Object.defineProperty(exports, "BaseLinearDisplay", {
11
+ enumerable: true,
12
+ get: function get() {
13
+ return _BaseLinearDisplay.BaseLinearDisplay;
14
+ }
15
+ });
16
+ Object.defineProperty(exports, "BaseLinearDisplayComponent", {
17
+ enumerable: true,
18
+ get: function get() {
19
+ return _BaseLinearDisplay.BaseLinearDisplayComponent;
20
+ }
21
+ });
22
+ Object.defineProperty(exports, "RefNameAutocomplete", {
23
+ enumerable: true,
24
+ get: function get() {
25
+ return _LinearGenomeView.RefNameAutocomplete;
26
+ }
27
+ });
28
+ Object.defineProperty(exports, "SearchBox", {
29
+ enumerable: true,
30
+ get: function get() {
31
+ return _LinearGenomeView.SearchBox;
32
+ }
33
+ });
34
+ Object.defineProperty(exports, "baseLinearDisplayConfigSchema", {
35
+ enumerable: true,
36
+ get: function get() {
37
+ return _BaseLinearDisplay.baseLinearDisplayConfigSchema;
38
+ }
39
+ });
40
+ exports["default"] = void 0;
41
+ Object.defineProperty(exports, "linearBareDisplayConfigSchemaFactory", {
42
+ enumerable: true,
43
+ get: function get() {
44
+ return _LinearBareDisplay.configSchemaFactory;
45
+ }
46
+ });
47
+ Object.defineProperty(exports, "linearBasicDisplayConfigSchemaFactory", {
48
+ enumerable: true,
49
+ get: function get() {
50
+ return _LinearBasicDisplay.configSchema;
51
+ }
52
+ });
53
+ Object.defineProperty(exports, "linearBasicDisplayModelFactory", {
54
+ enumerable: true,
55
+ get: function get() {
56
+ return _LinearBasicDisplay.modelFactory;
57
+ }
58
+ });
59
+ Object.defineProperty(exports, "renderToSvg", {
60
+ enumerable: true,
61
+ get: function get() {
62
+ return _LinearGenomeView.renderToSvg;
63
+ }
64
+ });
65
+
66
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
67
+
68
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
69
+
70
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
71
+
72
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
73
+
74
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
75
+
76
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
77
+
78
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
79
+
80
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
81
+
82
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
83
+
84
+ var _react = require("react");
85
+
86
+ var _mobx = require("mobx");
87
+
88
+ var _configuration = require("@jbrowse/core/configuration");
89
+
90
+ var _models = require("@jbrowse/core/pluggableElementTypes/models");
91
+
92
+ var _TrackType = _interopRequireDefault(require("@jbrowse/core/pluggableElementTypes/TrackType"));
93
+
94
+ var _DisplayType = _interopRequireDefault(require("@jbrowse/core/pluggableElementTypes/DisplayType"));
95
+
96
+ var _ViewType = _interopRequireDefault(require("@jbrowse/core/pluggableElementTypes/ViewType"));
97
+
98
+ var _Plugin2 = _interopRequireDefault(require("@jbrowse/core/Plugin"));
99
+
100
+ var _util = require("@jbrowse/core/util");
101
+
102
+ var _LineStyle = _interopRequireDefault(require("@material-ui/icons/LineStyle"));
103
+
104
+ var _BaseLinearDisplay = require("./BaseLinearDisplay");
105
+
106
+ var _LinearBareDisplay = require("./LinearBareDisplay");
107
+
108
+ var _LinearGenomeView = require("./LinearGenomeView");
109
+
110
+ var _LinearBasicDisplay = require("./LinearBasicDisplay");
111
+
112
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
113
+
114
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
115
+
116
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
117
+
118
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
119
+
120
+ var LinearGenomeViewPlugin = /*#__PURE__*/function (_Plugin) {
121
+ (0, _inherits2["default"])(LinearGenomeViewPlugin, _Plugin);
122
+
123
+ var _super = _createSuper(LinearGenomeViewPlugin);
124
+
125
+ function LinearGenomeViewPlugin() {
126
+ var _this;
127
+
128
+ (0, _classCallCheck2["default"])(this, LinearGenomeViewPlugin);
129
+
130
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
131
+ args[_key] = arguments[_key];
132
+ }
133
+
134
+ _this = _super.call.apply(_super, [this].concat(args));
135
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "name", 'LinearGenomeViewPlugin');
136
+ (0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "exports", {
137
+ BaseLinearDisplayComponent: _BaseLinearDisplay.BaseLinearDisplayComponent,
138
+ BaseLinearDisplay: _BaseLinearDisplay.BaseLinearDisplay,
139
+ baseLinearDisplayConfigSchema: _BaseLinearDisplay.baseLinearDisplayConfigSchema
140
+ });
141
+ return _this;
142
+ }
143
+
144
+ (0, _createClass2["default"])(LinearGenomeViewPlugin, [{
145
+ key: "install",
146
+ value: function install(pluginManager) {
147
+ pluginManager.addTrackType(function () {
148
+ var configSchema = (0, _configuration.ConfigurationSchema)('FeatureTrack', {}, {
149
+ baseConfiguration: (0, _models.createBaseTrackConfig)(pluginManager),
150
+ explicitIdentifier: 'trackId'
151
+ });
152
+ return new _TrackType["default"]({
153
+ name: 'FeatureTrack',
154
+ configSchema: configSchema,
155
+ stateModel: (0, _models.createBaseTrackModel)(pluginManager, 'FeatureTrack', configSchema)
156
+ });
157
+ });
158
+ pluginManager.addTrackType(function () {
159
+ var configSchema = (0, _configuration.ConfigurationSchema)('BasicTrack', {}, {
160
+ baseConfiguration: (0, _models.createBaseTrackConfig)(pluginManager),
161
+ explicitIdentifier: 'trackId'
162
+ });
163
+ return new _TrackType["default"]({
164
+ name: 'BasicTrack',
165
+ configSchema: configSchema,
166
+ stateModel: (0, _models.createBaseTrackModel)(pluginManager, 'BasicTrack', configSchema)
167
+ });
168
+ });
169
+ pluginManager.addDisplayType(function () {
170
+ var configSchema = (0, _LinearBareDisplay.configSchemaFactory)(pluginManager);
171
+ return new _DisplayType["default"]({
172
+ name: 'LinearBareDisplay',
173
+ configSchema: configSchema,
174
+ stateModel: (0, _LinearBareDisplay.stateModelFactory)(configSchema),
175
+ trackType: 'BasicTrack',
176
+ viewType: 'LinearGenomeView',
177
+ ReactComponent: _BaseLinearDisplay.BaseLinearDisplayComponent
178
+ });
179
+ });
180
+ pluginManager.addDisplayType(function () {
181
+ var configSchema = (0, _LinearBasicDisplay.configSchema)(pluginManager);
182
+ return new _DisplayType["default"]({
183
+ name: 'LinearBasicDisplay',
184
+ configSchema: configSchema,
185
+ stateModel: (0, _LinearBasicDisplay.modelFactory)(configSchema),
186
+ trackType: 'FeatureTrack',
187
+ viewType: 'LinearGenomeView',
188
+ ReactComponent: _BaseLinearDisplay.BaseLinearDisplayComponent
189
+ });
190
+ });
191
+ pluginManager.addViewType(function () {
192
+ return new _ViewType["default"]({
193
+ name: 'LinearGenomeView',
194
+ stateModel: (0, _LinearGenomeView.stateModelFactory)(pluginManager),
195
+ ReactComponent: /*#__PURE__*/(0, _react.lazy)(function () {
196
+ return Promise.resolve().then(function () {
197
+ return _interopRequireWildcard(require('./LinearGenomeView/components/LinearGenomeView'));
198
+ });
199
+ })
200
+ });
201
+ });
202
+ pluginManager.addToExtensionPoint('LaunchView-LinearGenomeView',
203
+ /*#__PURE__*/
204
+ // @ts-ignore
205
+ function () {
206
+ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_ref) {
207
+ var session, assembly, loc, _ref$tracks, tracks, assemblyManager, view, asm, idsNotFound;
208
+
209
+ return _regenerator["default"].wrap(function _callee$(_context) {
210
+ while (1) {
211
+ switch (_context.prev = _context.next) {
212
+ case 0:
213
+ session = _ref.session, assembly = _ref.assembly, loc = _ref.loc, _ref$tracks = _ref.tracks, tracks = _ref$tracks === void 0 ? [] : _ref$tracks;
214
+ assemblyManager = session.assemblyManager;
215
+ view = session.addView('LinearGenomeView', {});
216
+ _context.next = 5;
217
+ return (0, _mobx.when)(function () {
218
+ return !!view.volatileWidth;
219
+ });
220
+
221
+ case 5:
222
+ if (assembly) {
223
+ _context.next = 7;
224
+ break;
225
+ }
226
+
227
+ throw new Error('No assembly provided when launching linear genome view');
228
+
229
+ case 7:
230
+ _context.next = 9;
231
+ return assemblyManager.waitForAssembly(assembly);
232
+
233
+ case 9:
234
+ asm = _context.sent;
235
+
236
+ if (asm) {
237
+ _context.next = 12;
238
+ break;
239
+ }
240
+
241
+ throw new Error("Assembly \"".concat(assembly, "\" not found when launching linear genome view"));
242
+
243
+ case 12:
244
+ view.navToLocString(loc, assembly);
245
+ idsNotFound = [];
246
+ tracks.forEach(function (track) {
247
+ try {
248
+ view.showTrack(track);
249
+ } catch (e) {
250
+ if ("".concat(e).match('Could not resolve identifier')) {
251
+ idsNotFound.push(track);
252
+ } else {
253
+ throw e;
254
+ }
255
+ }
256
+ });
257
+
258
+ if (!idsNotFound.length) {
259
+ _context.next = 17;
260
+ break;
261
+ }
262
+
263
+ throw new Error("Could not resolve identifiers: ".concat(idsNotFound.join(',')));
264
+
265
+ case 17:
266
+ case "end":
267
+ return _context.stop();
268
+ }
269
+ }
270
+ }, _callee);
271
+ }));
272
+
273
+ return function (_x) {
274
+ return _ref2.apply(this, arguments);
275
+ };
276
+ }());
277
+ }
278
+ }, {
279
+ key: "configure",
280
+ value: function configure(pluginManager) {
281
+ if ((0, _util.isAbstractMenuManager)(pluginManager.rootModel)) {
282
+ pluginManager.rootModel.appendToSubMenu(['Add'], {
283
+ label: 'Linear genome view',
284
+ icon: _LineStyle["default"],
285
+ onClick: function onClick(session) {
286
+ session.addView('LinearGenomeView', {});
287
+ }
288
+ });
289
+ }
290
+ }
291
+ }]);
292
+ return LinearGenomeViewPlugin;
293
+ }(_Plugin2["default"]);
294
+
295
+ exports["default"] = LinearGenomeViewPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jbrowse/plugin-linear-genome-view",
3
- "version": "1.6.9",
3
+ "version": "1.7.3",
4
4
  "description": "JBrowse 2 linear genome view",
5
5
  "keywords": [
6
6
  "jbrowse",
@@ -18,21 +18,19 @@
18
18
  "distMain": "dist/index.js",
19
19
  "srcMain": "src/index.ts",
20
20
  "main": "dist/index.js",
21
- "distModule": "dist/plugin-linear-genome-view.esm.js",
22
- "module": "dist/plugin-linear-genome-view.esm.js",
23
21
  "files": [
24
22
  "dist",
25
23
  "src"
26
24
  ],
27
25
  "scripts": {
28
- "start": "tsdx watch --verbose --noClean",
29
- "build": "tsdx build",
26
+ "build": "babel src --root-mode upward --out-dir dist --extensions .ts,.js,.tsx,.jsx",
30
27
  "test": "cd ../..; jest plugins/linear-genome-view",
31
28
  "prepublishOnly": "yarn test",
32
29
  "prepack": "yarn build; yarn useDist",
33
30
  "postpack": "yarn useSrc",
34
31
  "useDist": "node ../../scripts/useDist.js",
35
- "useSrc": "node ../../scripts/useSrc.js"
32
+ "useSrc": "node ../../scripts/useSrc.js",
33
+ "postbuild": "tsc --build tsconfig.build.json"
36
34
  },
37
35
  "dependencies": {
38
36
  "@material-ui/icons": "^4.9.1",
@@ -44,8 +42,7 @@
44
42
  "is-object": "^1.0.1",
45
43
  "json-stable-stringify": "^1.0.1",
46
44
  "normalize-wheel": "^1.0.1",
47
- "react-popper": "^2.0.0",
48
- "react-sizeme": "^3.0.2"
45
+ "react-popper": "^2.0.0"
49
46
  },
50
47
  "peerDependencies": {
51
48
  "@jbrowse/core": "^1.0.0",
@@ -61,5 +58,5 @@
61
58
  "publishConfig": {
62
59
  "access": "public"
63
60
  },
64
- "gitHead": "f6c3d4edfadc26f7ac635a2fa7259f50f0c7e5e3"
61
+ "gitHead": "09b13c85acf4ac68dd71ab23af87656c7552fdaf"
65
62
  }
@@ -8,6 +8,7 @@ import {
8
8
  isAbortException,
9
9
  getContainingView,
10
10
  getSession,
11
+ getViewParams,
11
12
  isSelectionContainer,
12
13
  isSessionModelWithWidgets,
13
14
  } from '@jbrowse/core/util'
@@ -623,6 +624,7 @@ export const BaseLinearDisplay = types
623
624
  return rendererType.renderInClient(rpcManager, {
624
625
  ...renderArgs,
625
626
  ...renderProps,
627
+ viewParams: getViewParams(self, true),
626
628
  exportSVG: opts,
627
629
  })
628
630
  }),
@@ -1,20 +1,21 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
+ import React from 'react'
2
3
  import { types, getParent, isAlive, cast, Instance } from 'mobx-state-tree'
3
4
  import { readConfObject } from '@jbrowse/core/configuration'
4
- import { Feature } from '@jbrowse/core/util/simpleFeature'
5
+ import {
6
+ assembleLocString,
7
+ getSession,
8
+ getContainingDisplay,
9
+ getViewParams,
10
+ makeAbortableReaction,
11
+ Feature,
12
+ } from '@jbrowse/core/util'
5
13
  import { Region } from '@jbrowse/core/util/types/mst'
6
14
  import {
7
15
  AbstractDisplayModel,
8
16
  isRetryException,
9
17
  } from '@jbrowse/core/util/types'
10
- import React from 'react'
11
18
 
12
- import {
13
- assembleLocString,
14
- makeAbortableReaction,
15
- getSession,
16
- getContainingDisplay,
17
- } from '@jbrowse/core/util'
18
19
  import {
19
20
  getTrackAssemblyNames,
20
21
  getRpcSessionId,
@@ -296,6 +297,7 @@ async function renderBlockEffect(
296
297
  await rendererType.renderInClient(rpcManager, {
297
298
  ...renderArgs,
298
299
  ...renderProps,
300
+ viewParams: getViewParams(self),
299
301
  signal,
300
302
  })
301
303
  return {
@@ -61,7 +61,7 @@ function SetMaxHeightDlg(props: {
61
61
  <DialogContent className={classes.root}>
62
62
  <Typography>
63
63
  Set max height for the track. For example, you can increase this if
64
- the layout says "Max height reached"
64
+ the layout says &quot;Max height reached&quot;
65
65
  </Typography>
66
66
  <TextField
67
67
  value={max}
@@ -1,10 +1,17 @@
1
1
  import { lazy } from 'react'
2
- import { ConfigurationReference, getConf } from '@jbrowse/core/configuration'
2
+ import {
3
+ getConf,
4
+ ConfigurationReference,
5
+ AnyConfigurationSchemaType,
6
+ } from '@jbrowse/core/configuration'
3
7
  import { getSession } from '@jbrowse/core/util'
4
8
  import { MenuItem } from '@jbrowse/core/ui'
5
- import VisibilityIcon from '@material-ui/icons/Visibility'
6
9
  import { types, getEnv, Instance } from 'mobx-state-tree'
7
- import { AnyConfigurationSchemaType } from '@jbrowse/core/configuration/configurationSchema'
10
+
11
+ // icons
12
+ import VisibilityIcon from '@material-ui/icons/Visibility'
13
+
14
+ // locals
8
15
  import { BaseLinearDisplay } from '../BaseLinearDisplay'
9
16
 
10
17
  const SetMaxHeightDlg = lazy(() => import('./components/SetMaxHeight'))
@@ -29,31 +36,23 @@ const stateModelFactory = (configSchema: AnyConfigurationSchemaType) =>
29
36
  },
30
37
 
31
38
  get showLabels() {
32
- const showLabels = getConf(self, ['renderer', 'showLabels'])
33
- return self.trackShowLabels !== undefined
34
- ? self.trackShowLabels
35
- : showLabels
39
+ return self.trackShowLabels ?? getConf(self, ['renderer', 'showLabels'])
36
40
  },
37
41
 
38
42
  get showDescriptions() {
39
- const showDescriptions = getConf(self, ['renderer', 'showLabels'])
40
- return self.trackShowDescriptions !== undefined
41
- ? self.trackShowDescriptions
42
- : showDescriptions
43
+ return (
44
+ self.trackShowDescriptions ??
45
+ getConf(self, ['renderer', 'showLabels'])
46
+ )
43
47
  },
44
48
 
45
49
  get maxHeight() {
46
- const maxHeight = getConf(self, ['renderer', 'maxHeight'])
47
- return self.trackMaxHeight !== undefined
48
- ? self.trackMaxHeight
49
- : maxHeight
50
+ return self.trackMaxHeight ?? getConf(self, ['renderer', 'maxHeight'])
50
51
  },
51
52
 
52
53
  get displayMode() {
53
54
  const displayMode = getConf(self, ['renderer', 'displayMode'])
54
- return self.trackDisplayMode !== undefined
55
- ? self.trackDisplayMode
56
- : displayMode
55
+ return self.trackDisplayMode ?? displayMode
57
56
  },
58
57
  get rendererConfig() {
59
58
  const configBlob = getConf(self, ['renderer']) || {}
@@ -17,8 +17,8 @@ import ArrowBackIcon from '@material-ui/icons/ArrowBack'
17
17
  // locals
18
18
  import {
19
19
  LinearGenomeViewModel,
20
- SPACING,
21
20
  WIDGET_HEIGHT,
21
+ SPACING,
22
22
  HEADER_BAR_HEIGHT,
23
23
  } from '..'
24
24
  import OverviewScaleBar from './OverviewScaleBar'
@@ -16,7 +16,7 @@ import CloseIcon from '@material-ui/icons/Close'
16
16
 
17
17
  // locals
18
18
  import RefNameAutocomplete from './RefNameAutocomplete'
19
- import { LinearGenomeViewModel } from '..'
19
+ import { LinearGenomeViewModel, WIDGET_HEIGHT } from '..'
20
20
  const SearchResultsDialog = lazy(() => import('./SearchResultsDialog'))
21
21
 
22
22
  const useStyles = makeStyles(theme => ({
@@ -26,6 +26,9 @@ const useStyles = makeStyles(theme => ({
26
26
  button: {
27
27
  margin: theme.spacing(2),
28
28
  },
29
+ container: {
30
+ padding: theme.spacing(4),
31
+ },
29
32
  }))
30
33
 
31
34
  type LGV = LinearGenomeViewModel
@@ -119,10 +122,12 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
119
122
  }
120
123
  }
121
124
 
125
+ const height = WIDGET_HEIGHT + 5
126
+
122
127
  // implementation notes:
123
128
  // having this wrapped in a form allows intuitive use of enter key to submit
124
129
  return (
125
- <div>
130
+ <div className={classes.container}>
126
131
  {err ? <ErrorMessage error={err} /> : null}
127
132
  <Container className={classes.importFormContainer}>
128
133
  <form onSubmit={event => event.preventDefault()}>
@@ -140,6 +145,7 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
140
145
  }}
141
146
  session={session}
142
147
  selected={selectedAsm}
148
+ InputProps={{ style: { height } }}
143
149
  />
144
150
  </Grid>
145
151
  <Grid item>
@@ -156,10 +162,11 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
156
162
  minWidth={270}
157
163
  onSelect={option => setOption(option)}
158
164
  TextFieldProps={{
159
- margin: 'normal',
160
165
  variant: 'outlined',
161
166
  helperText:
162
167
  'Enter sequence name, feature name, or location',
168
+ style: { minWidth: '175px' },
169
+ InputProps: { style: { height } },
163
170
  }}
164
171
  />
165
172
  ) : (
@@ -171,7 +178,6 @@ const ImportForm = observer(({ model }: { model: LGV }) => {
171
178
  )
172
179
  ) : null}
173
180
  </Grid>
174
- <Grid item></Grid>
175
181
  <Grid item>
176
182
  <Button
177
183
  type="submit"
@@ -4,6 +4,7 @@ import '@testing-library/jest-dom/extend-expect'
4
4
  import { createTestSession } from '@jbrowse/web/src/rootModel'
5
5
  import 'requestidlecallback-polyfill'
6
6
  import LinearGenomeView from './LinearGenomeView'
7
+ jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
7
8
 
8
9
  const assemblyConf = {
9
10
  name: 'volMyt1',
@@ -138,7 +138,7 @@ type LGV = LinearGenomeViewModel
138
138
 
139
139
  // rounded rect from https://stackoverflow.com/a/45889603/2129219
140
140
  // prettier-ignore
141
- function rightRoundedRect(x:number, y:number, width:number, height:number, radius:number) {
141
+ function rightRoundedRect(x: number, y: number, width: number, height: number, radius: number) {
142
142
  return "M" + x + "," + y
143
143
  + "h" + (width - radius)
144
144
  + "a" + radius + "," + radius + " 0 0 1 " + radius + "," + radius
@@ -149,7 +149,7 @@ function rightRoundedRect(x:number, y:number, width:number, height:number, radiu
149
149
  }
150
150
 
151
151
  // prettier-ignore
152
- function leftRoundedRect(x:number, y:number, width:number, height:number, radius:number ) {
152
+ function leftRoundedRect(x: number, y: number, width: number, height: number, radius: number ) {
153
153
  return "M" + (x + radius) + "," + y
154
154
  + "h" + (width - radius)
155
155
  + "v" + height
@@ -1,18 +1,17 @@
1
1
  import React, { useRef, useEffect, useState } from 'react'
2
- import ReactPropTypes from 'prop-types'
3
- import { observer, PropTypes as MobxPropTypes } from 'mobx-react'
4
- import { Instance } from 'mobx-state-tree'
5
- // material ui
6
- import { alpha } from '@material-ui/core/styles/colorManipulator'
7
- import { makeStyles } from '@material-ui/core/styles'
8
- import Popover from '@material-ui/core/Popover'
9
- import Tooltip from '@material-ui/core/Tooltip'
10
- import Typography from '@material-ui/core/Typography'
2
+ import { observer } from 'mobx-react'
3
+ import {
4
+ Popover,
5
+ Tooltip,
6
+ Typography,
7
+ makeStyles,
8
+ alpha,
9
+ } from '@material-ui/core'
11
10
  import { stringify } from '@jbrowse/core/util'
12
11
  import { Menu } from '@jbrowse/core/ui'
13
- import { LinearGenomeViewStateModel, BpOffset } from '..'
12
+ import { LinearGenomeViewModel } from '..'
14
13
 
15
- type LGV = Instance<LinearGenomeViewStateModel>
14
+ type LGV = LinearGenomeViewModel
16
15
 
17
16
  const useStyles = makeStyles(theme => {
18
17
  const background = theme.palette.tertiary
@@ -139,11 +138,11 @@ function RubberBand({
139
138
  clientX,
140
139
  clientY,
141
140
  })
142
- const { leftOffset, rightOffset } = computeOffsets(offsetX) as {
143
- leftOffset: BpOffset
144
- rightOffset: BpOffset
141
+ const args = computeOffsets(offsetX)
142
+ if (args) {
143
+ const { leftOffset, rightOffset } = args
144
+ setOffsets(leftOffset, rightOffset)
145
145
  }
146
- setOffsets(leftOffset, rightOffset)
147
146
  setGuideX(undefined)
148
147
  }
149
148
  }
@@ -313,13 +312,4 @@ function RubberBand({
313
312
  )
314
313
  }
315
314
 
316
- RubberBand.propTypes = {
317
- model: MobxPropTypes.objectOrObservableObject.isRequired,
318
- ControlComponent: ReactPropTypes.node,
319
- }
320
-
321
- RubberBand.defaultProps = {
322
- ControlComponent: <div />,
323
- }
324
-
325
315
  export default observer(RubberBand)
@@ -3,6 +3,7 @@ import React from 'react'
3
3
  import { render } from '@testing-library/react'
4
4
  import { createTestSession } from '@jbrowse/web/src/rootModel'
5
5
  import ScaleBar from './ScaleBar'
6
+ jest.mock('@jbrowse/web/src/makeWorkerInstance', () => () => {})
6
7
 
7
8
  describe('ScaleBar genome view component', () => {
8
9
  it('renders two regions', () => {
@@ -1,16 +1,13 @@
1
+ import { Paper, Typography, makeStyles } from '@material-ui/core'
1
2
  import {
2
3
  ContentBlock,
3
4
  ElidedBlock,
4
5
  InterRegionPaddingBlock,
5
6
  } from '@jbrowse/core/util/blockTypes'
6
- import Paper from '@material-ui/core/Paper'
7
- import Typography from '@material-ui/core/Typography'
8
- import { makeStyles } from '@material-ui/core/styles'
9
7
  import clsx from 'clsx'
10
8
  import { observer } from 'mobx-react'
11
- import { Instance } from 'mobx-state-tree'
12
9
  import React from 'react'
13
- import { LinearGenomeViewStateModel } from '..'
10
+ import { LinearGenomeViewModel } from '..'
14
11
  import {
15
12
  ContentBlock as ContentBlockComponent,
16
13
  ElidedBlock as ElidedBlockComponent,
@@ -18,7 +15,7 @@ import {
18
15
  } from '../../BaseLinearDisplay/components/Block'
19
16
  import { makeTicks } from '../util'
20
17
 
21
- type LGV = Instance<LinearGenomeViewStateModel>
18
+ type LGV = LinearGenomeViewModel
22
19
 
23
20
  const useStyles = makeStyles(theme => ({
24
21
  scaleBarContainer: {