@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/dist/flatmapvuer.common.js +113 -103
- package/dist/flatmapvuer.common.js.map +1 -1
- package/dist/flatmapvuer.css +1 -1
- package/dist/flatmapvuer.umd.js +113 -103
- package/dist/flatmapvuer.umd.js.map +1 -1
- package/dist/flatmapvuer.umd.min.js +1 -1
- package/dist/flatmapvuer.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FlatmapVuer.vue +4 -1
- package/src/components/MultiFlatmapVuer.vue +53 -40
- package/src/components/legends/Legends.vue +1 -1
package/package.json
CHANGED
|
@@ -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% -
|
|
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
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
this.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
120
|
-
|
|
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
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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: {
|