genoverse 4.0.1 → 4.0.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genoverse",
3
- "version": "4.0.1",
3
+ "version": "4.0.4",
4
4
  "description": "Genoverse is a portable, customizable, back-end independent JavaScript and HTML5 based genome browser which allows the user to explore data in a dynamic and interactive manner.",
5
5
  "main": "src/js/Genoverse.js",
6
6
  "directories": {
@@ -146,17 +146,20 @@ const Genoverse = Base.extend({
146
146
  this.loadedPlugins[plugin.name] = true;
147
147
  };
148
148
 
149
- const pluginImports = Object.keys(pluginsByName).map(pluginName => import(`./plugins/${pluginName}`).then(
150
- (imported) => {
151
- initializePlugin({
152
- name : pluginName,
153
- conf : pluginsByName[pluginName].conf,
154
- exports : imported.default,
155
- });
156
- }
157
- ));
149
+ const pluginImports = Object.keys(pluginsByName).reduce(
150
+ (ready, pluginName) => ready.then(
151
+ () => import(`./plugins/${pluginName}`).then(
152
+ imported => initializePlugin({
153
+ name : pluginName,
154
+ conf : pluginsByName[pluginName].conf,
155
+ exports : imported.default,
156
+ })
157
+ )
158
+ ),
159
+ this.jQuery.Deferred().resolve()
160
+ );
158
161
 
159
- return this.jQuery.when(...pluginImports);
162
+ return this.jQuery.when(pluginImports);
160
163
  },
161
164
 
162
165
  init: function () {
@@ -543,7 +546,7 @@ const Genoverse = Base.extend({
543
546
  onTracks: function (func, ...args) {
544
547
  this.tracks.forEach(
545
548
  (track) => {
546
- if (track.disabled) {
549
+ if (track.disabled || !track._interface) { // if track._interface is undefined, the track has not been fully initialized yet
547
550
  return;
548
551
  }
549
552
 
@@ -126,18 +126,20 @@ export default Base.extend({
126
126
  data : this.urlParams,
127
127
  dataType : this.dataType,
128
128
  xhrFields : this.xhrFields,
129
- }).then(
129
+ }).done(
130
130
  (data) => {
131
131
  this.receiveData(data, chr, bin[0], bin[1]);
132
132
  }
133
- ).catch(
133
+ ).fail(
134
134
  (xhr, statusText, ...args) => {
135
- this.track.controller.showError(
136
- this.showServerErrors && xhr.responseJSON?.message
137
- ? xhr.responseJSON.message
138
- : `${statusText} while getting the data, see console for more details`,
139
- [ xhr, statusText, ...args ]
140
- );
135
+ if (this.track?.controller?.showError) {
136
+ this.track.controller.showError(
137
+ this.showServerErrors && xhr.responseJSON?.message
138
+ ? xhr.responseJSON.message
139
+ : `${statusText} while getting the data, see console for more details`,
140
+ [ xhr, statusText, ...args ]
141
+ );
142
+ }
141
143
  }
142
144
  ).always(
143
145
  () => {
@@ -1,13 +1,13 @@
1
- import './controlPanel';
1
+ import controlPanel from './controlPanel';
2
2
 
3
3
  const plugin = function () {
4
4
  this.controls.push({
5
- icon : '<i class="fas fa-map-marker-alt"></i>',
6
- 'class' : 'gv-button-large',
7
- name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
8
- action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
9
- init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
5
+ icon : '<i class="fas fa-map-marker-alt"></i>',
6
+ class : 'gv-button-large',
7
+ name : `Reset focus to ${this.focusRegion && this.focusRegion.name ? this.focusRegion.name : `${this.chr}:${this.start}-${this.end}`}`,
8
+ action : (browser) => { browser.moveTo(browser.focusRegion.chr, browser.focusRegion.start, browser.focusRegion.end, true); },
9
+ init : (browser) => { browser.focusRegion = browser.focusRegion || { chr: browser.chr, start: browser.start, end: browser.end }; },
10
10
  });
11
11
  };
12
12
 
13
- export default { focusRegion: plugin };
13
+ export default { focusRegion: plugin, requires: controlPanel };
Binary file
Binary file