@abi-software/mapintegratedvuer 1.9.3-beta.0 → 1.10.1-beta.0

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.9.3-beta.0",
3
+ "version": "1.10.1-beta.0",
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.9.3-beta.6",
54
- "@abi-software/map-side-bar": "^2.8.3-beta.5",
55
- "@abi-software/map-utilities": "^1.5.0",
53
+ "@abi-software/flatmapvuer": "^1.9.3-beta.7",
54
+ "@abi-software/map-side-bar": "^2.8.3-beta.6",
55
+ "@abi-software/map-utilities": "^1.6.0-beta.0",
56
56
  "@abi-software/plotvuer": "1.0.4",
57
- "@abi-software/scaffoldvuer": "^1.9.1-beta.3",
57
+ "@abi-software/scaffoldvuer": "^1.10.0-beta.0",
58
58
  "@abi-software/simulationvuer": "^2.0.11-beta.0",
59
59
  "@abi-software/sparc-annotation": "0.3.2",
60
60
  "@abi-software/svg-sprite": "^1.0.1",
@@ -190,6 +190,9 @@ export default {
190
190
  closeAndRemove: function() {
191
191
  this.splitFlowStore.closeSlot({ id: this.entry.id, entries: this.entries});
192
192
  EventBus.emit("RemoveEntryRequest", this.entry.id);
193
+ this.$nextTick(() => {
194
+ this.splitFlowStore.updateSplitPanels();
195
+ });
193
196
  },
194
197
  getEntryTitle: function(entry) {
195
198
  if (entry) {
@@ -301,11 +301,19 @@ export default {
301
301
  });
302
302
  }
303
303
  });
304
- let ids = []
304
+ let ids = [];
305
305
  for (const [key, value] of Object.entries(filters)) {
306
- value.forEach((v) => ids.push(...uniqueFilterSources[key][v]));
306
+ if (value.length) {
307
+ let valueToIds = [];
308
+ // within AND
309
+ value.forEach((v) => valueToIds.push(...uniqueFilterSources[key][v]));
310
+ ids.push(valueToIds);
311
+ }
307
312
  }
308
- this.filter = [...new Set(ids)];
313
+ // between AND
314
+ this.filter = ids.length ?
315
+ [...new Set(ids.reduce((acc, curr) => acc.filter(id => curr.includes(id))))] :
316
+ [];
309
317
  if (data.type === "query-update") {
310
318
  this.query = data.value;
311
319
  } else if (data.type === "filter-update") {
@@ -135,6 +135,7 @@ export default {
135
135
  connectivityKnowledge: [],
136
136
  connectivityExplorerClicked: [], // to support multi views
137
137
  filterOptions: [],
138
+ annotationHighlight: [],
138
139
  }
139
140
  },
140
141
  watch: {
@@ -153,6 +154,11 @@ export default {
153
154
  this.hoverChanged({ tabType: 'connectivity' });
154
155
  },
155
156
  },
157
+ annotationHighlight: {
158
+ handler: function () {
159
+ this.hoverChanged({ tabType: 'annotation' });
160
+ },
161
+ },
156
162
  },
157
163
  methods: {
158
164
  onConnectivityCollapseChange: function (payload) {
@@ -343,6 +349,8 @@ export default {
343
349
  hoverDOI = data.doi ? data.doi : '';
344
350
  } else if (data.tabType === 'connectivity') {
345
351
  hoverConnectivity = data.id ? [data.id] : this.connectivityHighlight;
352
+ } else if (data.tabType === 'annotation') {
353
+ hoverConnectivity = data.models ? [data.models] : this.annotationHighlight;
346
354
  }
347
355
  this.settingsStore.updateHoverFeatures(hoverAnatomies, hoverOrgans, hoverDOI, hoverConnectivity);
348
356
  EventBus.emit("hoverUpdate");
@@ -658,6 +666,7 @@ export default {
658
666
  });
659
667
  EventBus.on('annotation-open', payload => {
660
668
  this.annotationEntry = payload.annotationEntry;
669
+ this.annotationHighlight = this.annotationEntry.map(entry => entry.models);
661
670
  this.annotationCallback = markRaw(payload.commitCallback);
662
671
  if (!payload.createData) {
663
672
  this.createData = markRaw({});
@@ -197,46 +197,52 @@ export default {
197
197
  },
198
198
  mounted: function() {
199
199
  EventBus.on('annotation-close', () => {
200
- const currentFlatmap = this.$refs.flatmap;
201
- if (currentFlatmap) {
202
- this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
200
+ if (this?.alive) {
201
+ const currentFlatmap = this.$refs.flatmap;
202
+ if (currentFlatmap) {
203
+ this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
204
+ }
203
205
  }
204
206
  });
205
207
  EventBus.on("markerUpdate", () => {
206
- this.flatmapMarkerUpdate(undefined);
208
+ if (this?.alive) this.flatmapMarkerUpdate(undefined);
207
209
  });
208
210
  EventBus.on("hoverUpdate", () => {
209
- this.cardHoverHighlight();
211
+ if (this?.alive) this.cardHoverHighlight();
210
212
  });
211
213
  EventBus.on('viewingModeUpdate', (payload) => {
212
- this.$refs.flatmap.changeViewingMode(payload);
214
+ if (this?.alive) this.$refs.flatmap.changeViewingMode(payload);
213
215
  });
214
216
  EventBus.on('flightPathUpdate', (payload) => {
215
- this.$refs.flatmap.setFlightPath3D(payload);
217
+ if (this?.alive) this.$refs.flatmap.setFlightPath3D(payload);
216
218
  });
217
219
  EventBus.on('organsDisplayUpdate', (payload) => {
218
- this.$refs.flatmap.setColour(payload);
220
+ if (this?.alive) this.$refs.flatmap.setColour(payload);
219
221
  });
220
222
  EventBus.on('outlinesDisplayUpdate', (payload) => {
221
- this.$refs.flatmap.setOutlines(payload);
223
+ if (this?.alive) this.$refs.flatmap.setOutlines(payload);
222
224
  });
223
225
  EventBus.on('backgroundDisplayUpdate', (payload) => {
224
- this.$refs.flatmap.backgroundChangeCallback(payload);
226
+ if (this?.alive) this.$refs.flatmap.backgroundChangeCallback(payload);
225
227
  });
226
228
  EventBus.on('show-connectivity', (payload) => {
227
- const { featureIds, offset } = payload;
228
- const currentFlatmap = this.$refs.flatmap;
229
- if (currentFlatmap) {
230
- currentFlatmap.moveMap(featureIds, {
231
- offsetX: offset ? -150 : 0,
232
- zoom: 4,
233
- });
229
+ if (this?.alive) {
230
+ const { featureIds, offset } = payload;
231
+ const currentFlatmap = this.$refs.flatmap;
232
+ if (currentFlatmap) {
233
+ currentFlatmap.moveMap(featureIds, {
234
+ offsetX: offset ? -150 : 0,
235
+ zoom: 4,
236
+ });
237
+ }
234
238
  }
235
239
  });
236
240
  EventBus.on('show-reference-connectivities', (payload) => {
237
- const currentFlatmap = this.$refs.flatmap;
238
- if (currentFlatmap) {
239
- currentFlatmap.showConnectivitiesByReference(payload);
241
+ if (this?.alive) {
242
+ const currentFlatmap = this.$refs.flatmap;
243
+ if (currentFlatmap) {
244
+ currentFlatmap.showConnectivitiesByReference(payload);
245
+ }
240
246
  }
241
247
  });
242
248
  },
@@ -427,13 +427,13 @@ export default {
427
427
  flatmap.changeViewingMode(modeName);
428
428
  },
429
429
  showConnectivityTooltips: function (payload) {
430
- if (this.flatmapReady) {
430
+ if (this?.alive && this.flatmapReady) {
431
431
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
432
432
  flatmap.showConnectivityTooltips(payload);
433
433
  }
434
434
  },
435
435
  changeConnectivitySource: function (payload) {
436
- if (this.flatmapReady) {
436
+ if (this?.alive && this.flatmapReady) {
437
437
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
438
438
  flatmap.changeConnectivitySource(payload);
439
439
  }
@@ -483,7 +483,7 @@ export default {
483
483
  this.getFeaturedDatasets();
484
484
 
485
485
  EventBus.on('annotation-close', () => {
486
- if (this.flatmapReady && this.$refs.multiflatmap) {
486
+ if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
487
487
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
488
488
  currentFlatmap.annotationEventCallback({}, { type: 'aborted' })
489
489
  }
@@ -491,7 +491,7 @@ export default {
491
491
 
492
492
  EventBus.on('show-connectivity', (payload) => {
493
493
  const { featureIds, offset } = payload;
494
- if (this.flatmapReady && this.$refs.multiflatmap) {
494
+ if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
495
495
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
496
496
  if (currentFlatmap) {
497
497
  currentFlatmap.moveMap(featureIds, {
@@ -503,7 +503,7 @@ export default {
503
503
  });
504
504
 
505
505
  EventBus.on('show-reference-connectivities', (payload) => {
506
- if (this.flatmapReady && this.$refs.multiflatmap) {
506
+ if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
507
507
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
508
508
  if (currentFlatmap) {
509
509
  currentFlatmap.showConnectivitiesByReference(payload);
@@ -520,41 +520,41 @@ export default {
520
520
  });
521
521
 
522
522
  EventBus.on("markerUpdate", () => {
523
- if (this.flatmapReady) {
523
+ if (this?.alive && this.flatmapReady) {
524
524
  this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp);
525
525
  }
526
526
  });
527
527
  EventBus.on("hoverUpdate", () => {
528
- if (this.flatmapReady) {
528
+ if (this?.alive && this.flatmapReady) {
529
529
  this.cardHoverHighlight();
530
530
  }
531
531
  });
532
532
  EventBus.on('viewingModeUpdate', (payload) => {
533
- if (this.flatmapReady) {
533
+ if (this?.alive && this.flatmapReady) {
534
534
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
535
535
  currentFlatmap.changeViewingMode(payload);
536
536
  }
537
537
  });
538
538
  EventBus.on('flightPathUpdate', (payload) => {
539
- if (this.flatmapReady) {
539
+ if (this?.alive && this.flatmapReady) {
540
540
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
541
541
  currentFlatmap.setFlightPath3D(payload);
542
542
  }
543
543
  });
544
544
  EventBus.on('organsDisplayUpdate', (payload) => {
545
- if (this.flatmapReady) {
545
+ if (this?.alive && this.flatmapReady) {
546
546
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
547
547
  currentFlatmap.setColour(payload);
548
548
  }
549
549
  });
550
550
  EventBus.on('outlinesDisplayUpdate', (payload) => {
551
- if (this.flatmapReady) {
551
+ if (this?.alive && this.flatmapReady) {
552
552
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
553
553
  currentFlatmap.setOutlines(payload);
554
554
  }
555
555
  });
556
556
  EventBus.on('backgroundDisplayUpdate', (payload) => {
557
- if (this.flatmapReady) {
557
+ if (this?.alive && this.flatmapReady) {
558
558
  const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
559
559
  currentFlatmap.backgroundChangeCallback(payload);
560
560
  }
@@ -231,15 +231,19 @@ export default {
231
231
  this.startHelp();
232
232
  });
233
233
  EventBus.on("hoverUpdate", () => {
234
- if (this.scaffoldLoaded) {
234
+ if (this.scaffoldLoaded && this?.alive) {
235
235
  this.cardHoverHighlight();
236
236
  }
237
237
  });
238
238
  EventBus.on('backgroundDisplayUpdate', (payload) => {
239
- this.$refs.scaffold.backgroundChangeCallback(payload);
239
+ if (this?.alive) {
240
+ this.$refs.scaffold.backgroundChangeCallback(payload);
241
+ }
240
242
  });
241
243
  EventBus.on('viewingModeUpdate', (payload) => {
242
- this.$refs.scaffold.changeViewingMode(payload);
244
+ if (this?.alive) {
245
+ this.$refs.scaffold.changeViewingMode(payload);
246
+ }
243
247
  });
244
248
  },
245
249
  };
@@ -58,23 +58,12 @@ export default {
58
58
  return !this.showGlobalSettings;
59
59
  },
60
60
  },
61
+ beforeUnmount: function() {
62
+ this.alive = false;
63
+ },
61
64
  mounted: function () {
62
- EventBus.on("startHelp", () => {
63
- this.startHelp();
64
- });
65
-
66
- EventBus.on('connectivity-item-close', () => {
67
- if (this.multiflatmapRef) {
68
- const currentFlatmap = this.multiflatmapRef.getCurrentFlatmap();
69
- if (currentFlatmap) {
70
- currentFlatmap.closeTooltip();
71
- }
72
- }
73
- if (this.flatmapRef) {
74
- this.flatmapRef.closeTooltip();
75
- }
76
- });
77
-
65
+ EventBus.on("startHelp", this.startHelp);
66
+ EventBus.on('connectivity-item-close', this.onConnectivityItemClose);
78
67
  this.multiflatmapRef = this.$refs.multiflatmap;
79
68
  this.flatmapRef = this.$refs.flatmap;
80
69
  this.scaffoldRef = this.$refs.scaffold;
@@ -83,6 +72,19 @@ export default {
83
72
  this.connectivityFilterSources = this.connectivitiesStore.filterSources;
84
73
  },
85
74
  methods: {
75
+ onConnectivityItemClose() {
76
+ if (this?.alive) {
77
+ if (this.multiflatmapRef) {
78
+ const currentFlatmap = this.multiflatmapRef.getCurrentFlatmap();
79
+ if (currentFlatmap) {
80
+ currentFlatmap.closeTooltip();
81
+ }
82
+ }
83
+ if (this.flatmapRef) {
84
+ this.flatmapRef.closeTooltip();
85
+ }
86
+ }
87
+ },
86
88
  toggleSyncMode: function () {
87
89
  return;
88
90
  },
@@ -424,10 +426,12 @@ export default {
424
426
  return;
425
427
  },
426
428
  startHelp: function () {
427
- if (this.isInHelp === false) {
428
- this.helpMode = true;
429
- window.addEventListener("mousedown", this.checkEndHelpMouseDown);
430
- this.isInHelp = true;
429
+ if (this?.alive) {
430
+ if (this.isInHelp === false) {
431
+ this.helpMode = true;
432
+ window.addEventListener("mousedown", this.checkEndHelpMouseDown);
433
+ this.isInHelp = true;
434
+ }
431
435
  }
432
436
  },
433
437
  endHelp: function () {
@@ -639,7 +643,8 @@ export default {
639
643
  connectivityKnowledge: {},
640
644
  connectivityFilterOptions: {},
641
645
  connectivityFilterSources: {},
642
- highlightDelay: undefined
646
+ highlightDelay: undefined,
647
+ alive: true,
643
648
  };
644
649
  },
645
650
  created: function () {
@@ -87,15 +87,16 @@ const autoAssignEntryIdsToPane = (entries, layout) => {
87
87
  const invalidIdKeys = [];
88
88
  for (const [key, value] of Object.entries(layout)) {
89
89
  if (value.content) {
90
- if (assignedIds.includes(value.id)) {
91
- //id has got an assigned pane, cache it and find one
92
- //later
90
+ if ((1 > value.id) || assignedIds.includes(value.id)) {
91
+ //id has got an assigned pane or pane contains an invalid id,
92
+ //cache it and find one later
93
93
  invalidIdKeys.push(key);
94
94
  } else {
95
95
  assignedIds.push(value.id);
96
96
  }
97
97
  }
98
98
  }
99
+
99
100
  invalidIdKeys.forEach((key) => {
100
101
  let done = false;
101
102
  for (let i = 0; i < entries.length && !done; i++) {
@@ -370,7 +371,7 @@ export const useSplitFlowStore = defineStore('splitFlow', {
370
371
  availableId == 0; i++) {
371
372
  //Find the first entry not currently in use
372
373
  if ((payload.entries[i].id !== payload.id) &&
373
- findKeyWithId(payload.entries[i].id) === undefined) {
374
+ findKeyWithId(this.customLayout, payload.entries[i].id) === undefined) {
374
375
  availableId = payload.entries[i].id;
375
376
  }
376
377
  }
@@ -402,7 +403,7 @@ export const useSplitFlowStore = defineStore('splitFlow', {
402
403
  }
403
404
  const customLayout = newLayoutWithOrigInfo(
404
405
  this.customLayout, this.activeView);
405
- const key = findKeyWithId(customLayout, payload.id);
406
+ const key = findKeyWithId(this.customLayout, payload.id);
406
407
  // The following move the entry id to the appropriate slot
407
408
  // and remove the target id
408
409
  switch (key) {
@@ -556,7 +557,6 @@ export const useSplitFlowStore = defineStore('splitFlow', {
556
557
  this.customLayout[key] = value;
557
558
  }
558
559
  }
559
- this.updateSplitPanels();
560
560
  }
561
561
  },
562
562
  updateSplitPanels() {