@abi-software/mapintegratedvuer 1.3.4-beta.0 → 1.3.4-beta.2

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.0",
3
+ "version": "1.3.4-beta.2",
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.0",
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
@@ -23,6 +23,9 @@
23
23
  <el-button @click="setFlatmap()" size="small">Set Flatmap</el-button>
24
24
  <el-button @click="setSearch()" size="small">Set Search</el-button>
25
25
  </el-row>
26
+ <el-row class="row" :gutter="20">
27
+ <el-button @click="changeViewingMode('Annotation')" size="small">Switch to Annotation View</el-button>
28
+ </el-row>
26
29
  </div>
27
30
  <template #reference>
28
31
 
@@ -99,6 +102,9 @@ export default {
99
102
  }
100
103
  },
101
104
  methods: {
105
+ changeViewingMode: function(modeName) {
106
+ this.$refs.map.changeViewingMode(modeName);
107
+ },
102
108
  saveSettings: function() {
103
109
  this.mapSettings.push(this.$refs.map.getState());
104
110
  },
@@ -138,6 +138,9 @@ export default {
138
138
  onResize: function () {
139
139
  this.$refs.viewer?.onResize();
140
140
  },
141
+ changeViewingMode: function(modeName) {
142
+ this.$refs.viewer?.changeViewingMode(modeName);
143
+ },
141
144
  },
142
145
  data: function () {
143
146
  return {
@@ -280,6 +280,9 @@ export default {
280
280
  'category': this.startingMap
281
281
  });
282
282
  },
283
+ changeViewingMode: function(modeName) {
284
+ this.$refs.flow.changeViewingMode(modeName);
285
+ },
283
286
  },
284
287
  computed: {
285
288
  ...mapStores(useSettingsStore, useSplitFlowStore),
@@ -308,6 +311,7 @@ export default {
308
311
  this.options.rootUrl ? this.settingsStore.updateRootUrl(this.options.rootUrl) : null
309
312
  }
310
313
  this.splitFlowStore?.reset();
314
+ this.splitFlowStore?.getAvailableTerms(this.settingsStore.sparcApi);
311
315
  },
312
316
  mounted: async function() {
313
317
  EventBus.on("updateShareLinkRequested", () => {
@@ -502,6 +502,11 @@ export default {
502
502
  activeCanvas.click();
503
503
  }
504
504
  },
505
+ changeViewingMode: function(modeName) {
506
+ let splitdialog = this.$refs.splitdialog;
507
+ const activeContents = splitdialog.getActiveContents();
508
+ activeContents.forEach(content => content.changeViewingMode(modeName));
509
+ },
505
510
  },
506
511
  created: function () {
507
512
  this._facets = [];
@@ -100,7 +100,6 @@ 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
  }
@@ -159,6 +158,10 @@ export default {
159
158
  flatmap.clearSearchResults();
160
159
  }
161
160
  },
161
+ changeViewingMode: function (modeName) {
162
+ const flatmap = this.$refs.flatmap.mapImp;
163
+ 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
  });
@@ -404,6 +404,13 @@ export default {
404
404
  }
405
405
  return false;
406
406
  },
407
+ /**
408
+ * Change the view mode of the current flatmap
409
+ */
410
+ changeViewingMode: function (modeName) {
411
+ const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
412
+ flatmap.changeViewingMode(modeName);
413
+ },
407
414
  },
408
415
  computed: {
409
416
  facetSpecies() {
@@ -427,9 +434,7 @@ export default {
427
434
  },
428
435
  },
429
436
  mounted: function () {
430
- this.getAvailableTerms();
431
437
  this.getFeaturedDatasets();
432
-
433
438
  EventBus.on('show-connectivity', (payload) => {
434
439
  const { featureIds, offset } = payload;
435
440
  if (this.flatmapReady && this.$refs.multiflatmap) {
@@ -480,7 +485,7 @@ export default {
480
485
  z-index: 1;
481
486
  div {
482
487
  scale: 0.5;
483
- transform: translate(45px, -7px);
488
+ width: 0;
484
489
  }
485
490
  }
486
491
  }
@@ -183,6 +183,12 @@ export default {
183
183
  updateWithViewUrl: function(viewUrl) {
184
184
  this.$refs.scaffold.updateViewURL(viewUrl);
185
185
  },
186
+ /**
187
+ * Change the view mode of the current scaffold
188
+ */
189
+ changeViewingMode: function (modeName) {
190
+ this.$refs.scaffold.changeViewingMode(modeName);
191
+ },
186
192
  },
187
193
  computed: {
188
194
  warningMessage: function() {
@@ -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
@@ -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
  },