@abi-software/flatmapvuer 0.3.12-beta-0 → 0.3.12

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": "@abi-software/flatmapvuer",
3
- "version": "0.3.12-beta-0",
3
+ "version": "0.3.12",
4
4
  "main": "./dist/flatmapvuer.common.js",
5
5
  "files": [
6
6
  "dist/*",
@@ -639,6 +639,7 @@ export default {
639
639
  // be loaded, overriding ``taxon`` and ``biologicalSex``.
640
640
 
641
641
  let identifier = { taxon: this.entry };
642
+ //This now handle the uses of uuid when resuming states
642
643
  if (state) {
643
644
  if (state.uuid) {
644
645
  identifier = { uuid: state.uuid };
@@ -988,13 +989,15 @@ export default {
988
989
  .svg-legends-container {
989
990
  width:70%;
990
991
  height:auto;
992
+ position:relative;
993
+ max-height:140px;
991
994
  }
992
995
 
993
996
  .pathway-container {
994
997
  float: left;
995
998
  padding-left: 16px;
996
999
  padding-right: 18px;
997
- max-height: calc(100% - 184px);
1000
+ max-height: calc(100% - 140px);
998
1001
  text-align: left;
999
1002
  overflow: auto;
1000
1003
  border: 1px solid rgb(220, 223, 230);
@@ -94,42 +94,45 @@ export default {
94
94
  methods: {
95
95
  initialise: function() {
96
96
  return new Promise(resolve => {
97
- fetch(this.flatmapAPI)
98
- .then(response => response.json())
99
- .then(data => {
100
- this.speciesList= {};
101
- //Check each key in the provided availableSpecies against the one
102
- // on the server, add them to the Select if the key is found
103
- Object.keys(this.availableSpecies).forEach(key => {
104
- for (let i = 0; i < data.length; i++) {
105
- if (this.availableSpecies[key].taxo === data[i].taxon) {
106
- if (this.availableSpecies[key].biologicalSex) {
107
- if (data[i].biologicalSex &&
108
- data[i].biologicalSex === this.availableSpecies[key].biologicalSex) {
109
- this.speciesList[key] = this.availableSpecies[key];
110
- break;
111
- }
112
- } else {
113
- this.speciesList[key] = this.availableSpecies[key];
114
- break;
97
+ if (this.requireInitialisation) {
98
+ //It has not been initialised yet
99
+ this.requireInitialisation = false;
100
+ fetch(this.flatmapAPI)
101
+ .then(response => response.json())
102
+ .then(data => {
103
+ //Check each key in the provided availableSpecies against the one
104
+ //on the server, add them to the Select if the key is found
105
+ Object.keys(this.availableSpecies).forEach(key => {
106
+ for (let i = 0; i < data.length; i++) {
107
+ if (this.availableSpecies[key].taxo === data[i].taxon) {
108
+ if (this.availableSpecies[key].biologicalSex) {
109
+ if (data[i].biologicalSex &&
110
+ data[i].biologicalSex === this.availableSpecies[key].biologicalSex) {
111
+ this.$set(this.speciesList, key, this.availableSpecies[key]);
112
+ break;
113
+ }
114
+ } else {
115
+ this.$set(this.speciesList, key, this.availableSpecies[key]);
116
+ break;
117
+ }
115
118
  }
116
119
  }
120
+ });
121
+ if (!this.state) {
122
+ //No state resuming, set the current flatmap to {this.initial}
123
+ if (this.initial && this.speciesList[this.initial] !== undefined) {
124
+ this.activeSpecies = this.initial;
125
+ } else {
126
+ this.activeSpecies = Object.keys(this.speciesList)[0];
127
+ }
128
+ Vue.nextTick(() => {
129
+ if (this.$refs[this.activeSpecies])
130
+ this.$refs[this.activeSpecies][0].createFlatmap();
131
+ });
117
132
  }
118
133
  });
119
- if (!this.state) {
120
- //No state resuming, set the current flatmap to {this.initial}
121
- if (this.initial && this.speciesList[this.initial] !== undefined) {
122
- this.activeSpecies = this.initial;
123
- } else {
124
- this.activeSpecies = Object.keys(this.speciesList)[0];
125
- }
126
- Vue.nextTick(() => {
127
- if (this.$refs[this.activeSpecies])
128
- this.$refs[this.activeSpecies][0].createFlatmap();
129
- });
130
- }
131
- resolve();
132
- });
134
+ }
135
+ resolve();
133
136
  })
134
137
  },
135
138
  FlatmapSelected: function(resource) {
@@ -183,6 +186,11 @@ export default {
183
186
  }
184
187
  }
185
188
  },
189
+ /**
190
+ * Create a legacy entry with the provided information
191
+ *
192
+ * @private
193
+ */
186
194
  createLegacyEntry: function(state, taxo, uuid) {
187
195
  if (uuid && taxo) {
188
196
  let name = "Legacy";
@@ -192,18 +200,22 @@ export default {
192
200
  else
193
201
  name = name + ` ${state.species}`;
194
202
  }
195
- this.speciesList[name] = {
196
- taxo: taxo,
197
- isLegacy: true,
198
- displayWarning: true
199
- };
203
+ this.$set(
204
+ this.speciesList,
205
+ name,
206
+ {
207
+ taxo: taxo,
208
+ isLegacy: true,
209
+ displayWarning: true
210
+ }
211
+ );
200
212
  return {
201
213
  species: name,
202
214
  state: {
203
215
  entry: taxo,
204
- uuid: uuid
216
+ uuid: uuid,
217
+ viewport: state.state.viewport,
205
218
  },
206
- viewport: state.state.viewport,
207
219
  }
208
220
  }
209
221
  },
@@ -377,7 +389,8 @@ export default {
377
389
  return {
378
390
  activeSpecies: undefined,
379
391
  appendToBody: false,
380
- speciesList: {}
392
+ speciesList: {},
393
+ requireInitialisation: true,
381
394
  };
382
395
  },
383
396
  watch: {
@@ -29,7 +29,7 @@ export default {
29
29
  <style scoped lang="scss">
30
30
  .legends-container {
31
31
  pointer-events: none;
32
- transform: translate(0px, -20px);
32
+ transform: translate(0px, -35px);
33
33
  }
34
34
 
35
35
  .st0-translate {