@abi-software/mapintegratedvuer 1.3.4-beta.1 → 1.3.4-beta.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/mapintegratedvuer",
3
- "version": "1.3.4-beta.1",
3
+ "version": "1.3.4-beta.3",
4
4
  "license": "Apache-2.0",
5
5
  "scripts": {
6
6
  "serve": "vite --host --force",
@@ -50,11 +50,11 @@
50
50
  "*.js"
51
51
  ],
52
52
  "dependencies": {
53
- "@abi-software/flatmapvuer": "1.3.2-beta.1",
53
+ "@abi-software/flatmapvuer": "^1.3.2-beta.2",
54
54
  "@abi-software/map-side-bar": "^2.3.1",
55
55
  "@abi-software/map-utilities": "^1.0.0",
56
56
  "@abi-software/plotvuer": "1.0.0",
57
- "@abi-software/scaffoldvuer": "^1.3.2",
57
+ "@abi-software/scaffoldvuer": "^1.3.3-beta.0",
58
58
  "@abi-software/simulationvuer": "1.0.0",
59
59
  "@abi-software/svg-sprite": "1.0.0",
60
60
  "@element-plus/icons-vue": "^2.3.1",
package/src/App.vue CHANGED
@@ -99,6 +99,9 @@ export default {
99
99
  }
100
100
  },
101
101
  methods: {
102
+ changeViewingMode: function(modeName) {
103
+ this.$refs.map.changeViewingMode(modeName);
104
+ },
102
105
  saveSettings: function() {
103
106
  this.mapSettings.push(this.$refs.map.getState());
104
107
  },
@@ -166,6 +169,7 @@ export default {
166
169
  },
167
170
  mapIsReady: function() {
168
171
  console.log("map is ready")
172
+ // this.changeViewingMode('Annotation')
169
173
  },
170
174
  parseQuery: function () {
171
175
  this.$router.isReady().then(() => {
@@ -266,11 +266,6 @@ export default {
266
266
  */
267
267
  flowMounted: function () {
268
268
  this._flowMounted = true;
269
- /**
270
- * This event emit when the component is mounted.
271
- */
272
- this.$emit("isReady");
273
-
274
269
  // GA Tagging
275
270
  // Page view tracking for maps' buttons click on portal
276
271
  // category: AC | FC | WholeBody
@@ -280,6 +275,9 @@ export default {
280
275
  'category': this.startingMap
281
276
  });
282
277
  },
278
+ changeViewingMode: function(modeName) {
279
+ EventBus.emit("changeViewingMode", modeName);
280
+ },
283
281
  },
284
282
  computed: {
285
283
  ...mapStores(useSettingsStore, useSplitFlowStore),
@@ -308,6 +306,7 @@ export default {
308
306
  this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
309
307
  }
310
308
  this.splitFlowStore?.reset();
309
+ this.splitFlowStore?.getAvailableTerms(this.settingsStore.sparcApi);
311
310
  },
312
311
  mounted: async function() {
313
312
  EventBus.on("updateShareLinkRequested", () => {
@@ -325,6 +324,12 @@ export default {
325
324
  if (!this.state) {
326
325
  this.initialState = await initialState(this.startingMap, this.options.sparcApi);
327
326
  }
327
+ EventBus.on('mapReady', () => {
328
+ /**
329
+ * This event emit when the component is mounted and map is ready.
330
+ */
331
+ if (this._flowMounted) this.$emit("isReady");
332
+ });
328
333
  this.isReady = true;
329
334
  this.settingsStore.updateUseHelpModeDialog(this.useHelpModeDialog);
330
335
  this.settingsStore.updateConnectivityInfoSidebar(this.connectivityInfoSidebar);
@@ -100,10 +100,10 @@ export default {
100
100
  let provClone = {id: this.entry.id, prov: this.getFlatmapImp().provenance}; //create clone of provenance and add id
101
101
  EventBus.emit("mapImpProv", provClone); // send clone to context card
102
102
  this.$emit("flatmap-provenance-ready", provClone);
103
- this.getAvailableTerms();
104
103
  if (this.entry.resource === "FunctionalConnectivity"){
105
104
  this.flatmapReadyForMarkerUpdates(flatmap);
106
105
  }
106
+ EventBus.emit("mapReady", flatmap);
107
107
  },
108
108
  onPathwaySelectionChanged: function (data) {
109
109
  const { label, property, checked, selectionsTitle } = data;
@@ -159,6 +159,9 @@ export default {
159
159
  flatmap.clearSearchResults();
160
160
  }
161
161
  },
162
+ changeViewingMode: function (modeName) {
163
+ this.$refs.flatmap.changeViewingMode(modeName);
164
+ },
162
165
  },
163
166
  computed: {
164
167
  facetSpecies() {
@@ -166,7 +169,6 @@ export default {
166
169
  },
167
170
  },
168
171
  mounted: function() {
169
- this.getAvailableTerms();
170
172
  EventBus.on("markerUpdate", () => {
171
173
  this.flatmapMarkerUpdate(undefined);
172
174
  });
@@ -183,6 +185,9 @@ export default {
183
185
  });
184
186
  }
185
187
  });
188
+ EventBus.on("changeViewingMode", (modeName) => {
189
+ this.changeViewingMode(modeName);
190
+ });
186
191
  },
187
192
  };
188
193
  </script>
@@ -329,6 +329,7 @@ export default {
329
329
  const flatmapImp = flatmap.mapImp;
330
330
  this.flatmapMarkerUpdate(flatmapImp);
331
331
  this.updateProvCard();
332
+ EventBus.emit("mapReady", flatmap);
332
333
  }
333
334
  },
334
335
  getFlatmapImp: function () {
@@ -404,6 +405,13 @@ export default {
404
405
  }
405
406
  return false;
406
407
  },
408
+ /**
409
+ * Change the view mode of the current flatmap
410
+ */
411
+ changeViewingMode: function (modeName) {
412
+ const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
413
+ flatmap.changeViewingMode(modeName);
414
+ },
407
415
  },
408
416
  computed: {
409
417
  facetSpecies() {
@@ -427,9 +435,7 @@ export default {
427
435
  },
428
436
  },
429
437
  mounted: function () {
430
- this.getAvailableTerms();
431
438
  this.getFeaturedDatasets();
432
-
433
439
  EventBus.on('show-connectivity', (payload) => {
434
440
  const { featureIds, offset } = payload;
435
441
  if (this.flatmapReady && this.$refs.multiflatmap) {
@@ -453,6 +459,11 @@ export default {
453
459
  this.mapHoverHighlight(this.$refs.multiflatmap.getCurrentFlatmap().mapImp);
454
460
  }
455
461
  });
462
+ EventBus.on("changeViewingMode", (modeName) => {
463
+ if (this.flatmapReady) {
464
+ this.changeViewingMode(modeName);
465
+ }
466
+ });
456
467
  },
457
468
  };
458
469
  </script>
@@ -480,7 +491,7 @@ export default {
480
491
  z-index: 1;
481
492
  div {
482
493
  scale: 0.5;
483
- transform: translate(45px, -7px);
494
+ width: 0;
484
495
  }
485
496
  }
486
497
  }
@@ -139,6 +139,7 @@ export default {
139
139
  this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, rotation);
140
140
  if (this.splitFlowStore.syncMode) this.$refs.scaffold.fitWindow();
141
141
  }
142
+ EventBus.emit("mapReady", this.$refs.scaffold);
142
143
  },
143
144
  requestSynchronisedEvent: function (flag) {
144
145
  if (this.scaffoldLoaded) {
@@ -183,6 +184,12 @@ export default {
183
184
  updateWithViewUrl: function(viewUrl) {
184
185
  this.$refs.scaffold.updateViewURL(viewUrl);
185
186
  },
187
+ /**
188
+ * Change the view mode of the current scaffold
189
+ */
190
+ changeViewingMode: function (modeName) {
191
+ this.$refs.scaffold.changeViewingMode(modeName);
192
+ },
186
193
  },
187
194
  computed: {
188
195
  warningMessage: function() {
@@ -214,6 +221,11 @@ export default {
214
221
  this.mapHoverHighlight(this.$refs.scaffold);
215
222
  }
216
223
  });
224
+ EventBus.on("changeViewingMode", (modeName) => {
225
+ if (this.scaffoldLoaded) {
226
+ this.changeViewingMode(modeName);
227
+ }
228
+ });
217
229
  },
218
230
  };
219
231
  </script>
@@ -1,5 +1,4 @@
1
1
  import {
2
- getAvailableTermsForSpecies,
3
2
  getInteractiveAction,
4
3
  getNerveNames,
5
4
  getParentsRegion,
@@ -35,6 +34,9 @@ export default {
35
34
  },
36
35
  computed: {
37
36
  ...mapStores(useSettingsStore, useSplitFlowStore),
37
+ idNamePair() {
38
+ return this.splitFlowStore.idNamePair;
39
+ },
38
40
  syncMode() {
39
41
  return this.splitFlowStore.syncMode;
40
42
  },
@@ -397,31 +399,6 @@ export default {
397
399
  requestSynchronisedEvent: function () {
398
400
  return;
399
401
  },
400
- getAvailableTerms: function () {
401
- //Use the default list of uberons before we get the list from
402
- //the api
403
- let terms = getAvailableTermsForSpecies();
404
- for (let i = 0; i < terms.length; i++) {
405
- this.idNamePair[terms[i].id] = terms[i].name;
406
- }
407
- if (this.apiLocation) {
408
- if (this._controller) this._controller.abort();
409
- this._controller = new AbortController();
410
- let signal = this._controller.signal;
411
- fetch(`${this.apiLocation}get-organ-curies`, {
412
- signal,
413
- })
414
- .then(response => response.json())
415
- .then(data => {
416
- this._controller = undefined;
417
- data.uberon.array.forEach(pair => {
418
- this.idNamePair[pair.id.toUpperCase()] =
419
- pair.name.charAt(0).toUpperCase() + pair.name.slice(1);
420
- });
421
- return;
422
- });
423
- }
424
- },
425
402
  flatmapMarkerUpdate() {
426
403
  return;
427
404
  },
@@ -536,7 +513,6 @@ export default {
536
513
  multiflatmapRef: null,
537
514
  flatmapRef: null,
538
515
  scaffoldRef: null,
539
- idNamePair: {},
540
516
  scaffoldLoaded: false,
541
517
  isInHelp: false,
542
518
  hoverDelay: undefined
@@ -8,7 +8,7 @@ import { defineStore } from 'pinia'
8
8
  export const useMainStore = defineStore('main', {
9
9
  state: () => ({
10
10
  userProfile: {
11
- token: ''
11
+ token: 'eyJraWQiOiJ1UUMzRDl1RGpTTlhoNzZJRW1ldExcL05uOGRMazFyaU1LWSt5T2ZTUytHaz0iLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJjNDhmZDkyOS0wYjIwLTQxNjEtOTEyZi03NTBmMGZiY2VkNWQiLCJ0b2tlbl91c2UiOiJhY2Nlc3MiLCJzY29wZSI6Im9wZW5pZCIsImF1dGhfdGltZSI6MTcyMzA3ODgyOCwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfRlZMaEo3Q1FBIiwiZXhwIjoxNzIzMDgyNDI4LCJpYXQiOjE3MjMwNzg4MjgsInZlcnNpb24iOjIsImp0aSI6ImZiZDZiYmU5LWQwNjgtNGI1Ni05ZTcwLTJkZTJhMmFhNTdjYSIsImNsaWVudF9pZCI6IjcwM2xtNWQ4b2RjY3UyMXBhZ2NmamtlYWVhIiwidXNlcm5hbWUiOiJjNDhmZDkyOS0wYjIwLTQxNjEtOTEyZi03NTBmMGZiY2VkNWQifQ.QbLut-N287n6cPFl8KLytSsyv6OREwS30Xy_ydc-g5tOKItmAKry40MWQTDJNTXj8qetxn-dDsnvlwPm9Bf-L6cgKQcBRdKfTQ551PGLhkoSbCJYPFD7O1HRcf3WAdOU1uqmlSoQ-qlvX0r3GfYGgqctWghK4SmZyI6IsIe2-c6yl_A0mJDUwOL0Hfv7TKb0i_bGX-cxnDnGP0GJC8Szp4497PXb9iugbPosj-VWHmS_gKNt4SaByiUx0jmtfzCODMMjCjVNuZinc65xd1obPxiIuFPozLw2Ju6st7ShPz8iBG_r_uj9pfxiHSBEZDMvA4fMT9J_3CspVqs5iI5YYw'
12
12
  },
13
13
  }),
14
14
  getters: {
@@ -1,4 +1,7 @@
1
1
  import { defineStore } from 'pinia';
2
+ import {
3
+ getAvailableTermsForSpecies,
4
+ } from "../components/SimulatedData.js";
2
5
 
3
6
  /* eslint-disable no-alert, no-console */
4
7
  const presetLayouts = (view) => {
@@ -130,6 +133,7 @@ const findKeyWithId = (layout, id) => {
130
133
  const getOriginalState = () => {
131
134
  return {
132
135
  activeView: "singlepanel",
136
+ idNamePair: {},
133
137
  viewIcons: [
134
138
  { icon: "singlepanel", name: "Single view", min: 1 },
135
139
  { icon: "2horpanel", name: "Horizontal split", min: 2 },
@@ -195,6 +199,30 @@ export const useSplitFlowStore = defineStore('splitFlow', {
195
199
  this.customLayout[sourceKey].id = payload.target;
196
200
  }
197
201
  },
202
+ getAvailableTerms(apiLocation) {
203
+ let terms = getAvailableTermsForSpecies();
204
+ for (let i = 0; i < terms.length; i++) {
205
+ this.idNamePair[terms[i].id] = terms[i].name;
206
+ }
207
+ if (apiLocation) {
208
+ if (this._controller) this._controller.abort();
209
+ this._controller = new AbortController();
210
+ let signal = this._controller.signal;
211
+ console.log("getAvailableTerms")
212
+ fetch(`${apiLocation}get-organ-curies`, {
213
+ signal,
214
+ })
215
+ .then(response => response.json())
216
+ .then(data => {
217
+ this._controller = undefined;
218
+ data.uberon.array.forEach(pair => {
219
+ this.idNamePair[pair.id.toUpperCase()] =
220
+ pair.name.charAt(0).toUpperCase() + pair.name.slice(1);
221
+ });
222
+ return;
223
+ });
224
+ }
225
+ },
198
226
  toggleGlobalCallback(flag) {
199
227
  this.globalCallback = flag;
200
228
  },