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

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.
@@ -231,6 +231,12 @@ export default {
231
231
  'location': selectionsTitle
232
232
  });
233
233
  },
234
+ onSidebarAnnotationClose: function() {
235
+ if (this.flatmapReady) {
236
+ const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
237
+ currentFlatmap.annotationEventCallback({}, { type: 'aborted' })
238
+ }
239
+ },
234
240
  onOpenPubmedUrl: function (url) {
235
241
  // GA Tagging
236
242
  // Event tracking for open pubmed url from popup
@@ -341,7 +347,7 @@ export default {
341
347
  const flatmapImp = flatmap.mapImp;
342
348
  this.flatmapMarkerUpdate(flatmapImp);
343
349
  this.updateProvCard();
344
- this.updateSettings();
350
+ this.updateViewerSettings();
345
351
  this.loadConnectivityExplorerConfig(flatmap);
346
352
  EventBus.emit("mapLoaded", flatmap);
347
353
  }
@@ -426,25 +432,45 @@ export default {
426
432
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
427
433
  flatmap.changeViewingMode(modeName);
428
434
  },
435
+ showConnectivity: function (payload) {
436
+ if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
437
+ const { featureIds, offset } = payload;
438
+ const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
439
+ if (currentFlatmap) {
440
+ currentFlatmap.moveMap(featureIds, {
441
+ offsetX: offset ? -150 : 0,
442
+ zoom: 4,
443
+ });
444
+ }
445
+ }
446
+ },
429
447
  showConnectivityTooltips: function (payload) {
430
448
  if (this?.alive && this.flatmapReady) {
431
449
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
432
450
  flatmap.showConnectivityTooltips(payload);
433
451
  }
434
452
  },
453
+ showConnectivitiesByReference: function (payload) {
454
+ if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
455
+ const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
456
+ if (currentFlatmap) {
457
+ currentFlatmap.showConnectivitiesByReference(payload);
458
+ }
459
+ }
460
+ },
435
461
  changeConnectivitySource: function (payload) {
436
462
  if (this?.alive && this.flatmapReady) {
437
463
  const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
438
464
  flatmap.changeConnectivitySource(payload);
439
465
  }
440
466
  },
441
- updateSettings: function () {
467
+ updateViewerSettings: function () {
442
468
  const {
443
469
  backgroundDisplay,
444
470
  viewingMode,
445
471
  flightPathDisplay,
446
472
  organsDisplay,
447
- outlines,
473
+ outlinesDisplay,
448
474
  } = this.settingsStore.globalSettings;
449
475
 
450
476
  if (this.flatmapReady) {
@@ -453,7 +479,7 @@ export default {
453
479
  currentFlatmap.changeViewingMode(viewingMode);
454
480
  currentFlatmap.setFlightPath3D(flightPathDisplay);
455
481
  currentFlatmap.setColour(organsDisplay);
456
- currentFlatmap.setOutlines(outlines);
482
+ currentFlatmap.setOutlines(outlinesDisplay);
457
483
  currentFlatmap.backgroundChangeCallback(backgroundDisplay);
458
484
  }
459
485
  },
@@ -481,84 +507,6 @@ export default {
481
507
  },
482
508
  mounted: function () {
483
509
  this.getFeaturedDatasets();
484
-
485
- EventBus.on('annotation-close', () => {
486
- if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
487
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
488
- currentFlatmap.annotationEventCallback({}, { type: 'aborted' })
489
- }
490
- });
491
-
492
- EventBus.on('show-connectivity', (payload) => {
493
- const { featureIds, offset } = payload;
494
- if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
495
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
496
- if (currentFlatmap) {
497
- currentFlatmap.moveMap(featureIds, {
498
- offsetX: offset ? -150 : 0,
499
- zoom: 4,
500
- });
501
- }
502
- }
503
- });
504
-
505
- EventBus.on('show-reference-connectivities', (payload) => {
506
- if (this?.alive && this.flatmapReady && this.$refs.multiflatmap) {
507
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
508
- if (currentFlatmap) {
509
- currentFlatmap.showConnectivitiesByReference(payload);
510
- }
511
- }
512
- });
513
-
514
- EventBus.on('connectivity-hovered', (payload) => {
515
- this.showConnectivityTooltips(payload);
516
- });
517
-
518
- EventBus.on('connectivity-source-change', (payload) => {
519
- this.changeConnectivitySource(payload);
520
- });
521
-
522
- EventBus.on("markerUpdate", () => {
523
- if (this?.alive && this.flatmapReady) {
524
- this.flatmapMarkerUpdate(this.$refs.multiflatmap.getCurrentFlatmap().mapImp);
525
- }
526
- });
527
- EventBus.on("hoverUpdate", () => {
528
- if (this?.alive && this.flatmapReady) {
529
- this.cardHoverHighlight();
530
- }
531
- });
532
- EventBus.on('viewingModeUpdate', (payload) => {
533
- if (this?.alive && this.flatmapReady) {
534
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
535
- currentFlatmap.changeViewingMode(payload);
536
- }
537
- });
538
- EventBus.on('flightPathUpdate', (payload) => {
539
- if (this?.alive && this.flatmapReady) {
540
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
541
- currentFlatmap.setFlightPath3D(payload);
542
- }
543
- });
544
- EventBus.on('organsDisplayUpdate', (payload) => {
545
- if (this?.alive && this.flatmapReady) {
546
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
547
- currentFlatmap.setColour(payload);
548
- }
549
- });
550
- EventBus.on('outlinesDisplayUpdate', (payload) => {
551
- if (this?.alive && this.flatmapReady) {
552
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
553
- currentFlatmap.setOutlines(payload);
554
- }
555
- });
556
- EventBus.on('backgroundDisplayUpdate', (payload) => {
557
- if (this?.alive && this.flatmapReady) {
558
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
559
- currentFlatmap.backgroundChangeCallback(payload);
560
- }
561
- });
562
510
  },
563
511
  };
564
512
  </script>
@@ -142,8 +142,8 @@ export default {
142
142
  if (this.entry.rotation) rotation = this.entry.rotation;
143
143
  this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, rotation);
144
144
  if (this.splitFlowStore.syncMode) this.$refs.scaffold.fitWindow();
145
- this.updateSettings();
146
145
  }
146
+ this.updateViewerSettings();
147
147
  EventBus.emit("mapLoaded", this.$refs.scaffold);
148
148
  },
149
149
  requestSynchronisedEvent: function (flag) {
@@ -195,14 +195,17 @@ export default {
195
195
  changeViewingMode: function (modeName) {
196
196
  this.$refs.scaffold.changeViewingMode(modeName);
197
197
  },
198
- updateSettings: function () {
198
+ updateViewerSettings: function () {
199
199
  const {
200
200
  backgroundDisplay,
201
+ organsDisplay,
202
+ outlinesDisplay,
201
203
  viewingMode,
202
204
  } = this.settingsStore.globalSettings;
203
-
204
205
  this.$refs.scaffold.backgroundChangeCallback(backgroundDisplay);
205
206
  this.$refs.scaffold.changeViewingMode(viewingMode);
207
+ this.$refs.scaffold.setColour(organsDisplay);
208
+ this.$refs.scaffold.setOutlines(outlinesDisplay);
206
209
  },
207
210
  },
208
211
  computed: {
@@ -227,24 +230,6 @@ export default {
227
230
  mounted: function () {
228
231
  this.scaffoldCamera =
229
232
  this.$refs.scaffold.$module.scene.getZincCameraControls();
230
- EventBus.on("startHelp", () => {
231
- this.startHelp();
232
- });
233
- EventBus.on("hoverUpdate", () => {
234
- if (this.scaffoldLoaded && this?.alive) {
235
- this.cardHoverHighlight();
236
- }
237
- });
238
- EventBus.on('backgroundDisplayUpdate', (payload) => {
239
- if (this?.alive) {
240
- this.$refs.scaffold.backgroundChangeCallback(payload);
241
- }
242
- });
243
- EventBus.on('viewingModeUpdate', (payload) => {
244
- if (this?.alive) {
245
- this.$refs.scaffold.changeViewingMode(payload);
246
- }
247
- });
248
233
  },
249
234
  };
250
235
  </script>
@@ -62,8 +62,6 @@ export default {
62
62
  this.alive = false;
63
63
  },
64
64
  mounted: function () {
65
- EventBus.on("startHelp", this.startHelp);
66
- EventBus.on('connectivity-item-close', this.onConnectivityItemClose);
67
65
  this.multiflatmapRef = this.$refs.multiflatmap;
68
66
  this.flatmapRef = this.$refs.flatmap;
69
67
  this.scaffoldRef = this.$refs.scaffold;
@@ -228,11 +226,13 @@ export default {
228
226
  },
229
227
  resourceHasAction: function (resource) {
230
228
  return (
231
- resource.type === "URL" ||
232
- resource.type === "Search" ||
233
- resource.type === "Neuron Search" ||
234
- resource.type == "Facet" ||
235
- resource.type == "Facets"
229
+ resource && (
230
+ resource.type === "URL" ||
231
+ resource.type === "Search" ||
232
+ resource.type === "Neuron Search" ||
233
+ resource.type == "Facet" ||
234
+ resource.type == "Facets"
235
+ )
236
236
  );
237
237
  },
238
238
  /**
@@ -425,6 +425,9 @@ export default {
425
425
  onResize: function () {
426
426
  return;
427
427
  },
428
+ updateViewerSettings: function() {
429
+ return;
430
+ },
428
431
  startHelp: function () {
429
432
  if (this?.alive) {
430
433
  if (this.isInHelp === false) {
@@ -515,8 +518,11 @@ export default {
515
518
  toHighlight = [...new Set(toHighlight)];
516
519
  return toHighlight;
517
520
  },
518
- cardHoverHighlight: function () {
519
- if (this.visible) {
521
+ sidebarHoverHighlight: function (payload) {
522
+ if (this.visible && (
523
+ ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady) ||
524
+ (this.scaffoldRef && this.scaffoldLoaded))
525
+ ) {
520
526
  const hoverAnatomies = this.settingsStore.hoverAnatomies;
521
527
  const hoverOrgans = this.settingsStore.hoverOrgans;
522
528
  const hoverDOI = this.settingsStore.hoverDOI;
@@ -533,6 +539,10 @@ export default {
533
539
  if (!hoverAnatomies.length && !hoverOrgans.length && !hoverDOI && !hoverConnectivity.length) {
534
540
  if ((this.multiflatmapRef || this.flatmapRef) && flatmap) {
535
541
  flatmap.mapImp?.clearSearchResults();
542
+ if (payload.connectivitySearch) {
543
+ // grey out all connectivity if no search results
544
+ flatmap.mapImp?.setPaint({ dimmed: true })
545
+ }
536
546
  } else if (this.scaffoldRef && scaffold) {
537
547
  scaffold.changeHighlightedByName(hoverOrgans, "", false);
538
548
  }
@@ -574,7 +584,7 @@ export default {
574
584
  EventBus.emit('annotation-open', payload);
575
585
  },
576
586
  onAnnotationClose: function () {
577
- EventBus.emit('annotation-close');
587
+ EventBus.emit('sidebar-annotation-close');
578
588
  },
579
589
  updateOfflineAnnotationEnabled: function (payload) {
580
590
  EventBus.emit('update-offline-annotation-enabled', payload);
@@ -588,6 +598,21 @@ export default {
588
598
  onConnectivityInfoClose: function () {
589
599
  EventBus.emit('connectivity-info-close');
590
600
  },
601
+ onSidebarAnnotationClose: function() {
602
+ return;
603
+ },
604
+ showConnectivity: function(payload) {
605
+ return;
606
+ },
607
+ showConnectivitiesByReference: function(payload) {
608
+ return;
609
+ },
610
+ showConnectivityTooltips: function(payload) {
611
+ return;
612
+ },
613
+ changeConnectivitySource: function(payload) {
614
+ return;
615
+ },
591
616
  loadConnectivityExplorerConfig: async function (flatmap) {
592
617
  const flatmapImp = flatmap.mapImp;
593
618
  const sckanVersion = getKnowledgeSource(flatmapImp);
@@ -56,6 +56,13 @@ export const useSettingsStore = defineStore('settings', {
56
56
  );
57
57
  return state.featuredMarkerDois[index];
58
58
  },
59
+ getGlobalSettings: state => () => {
60
+ const globalSettings = {};
61
+ for (const [key, value] of Object.entries(state.globalSettings)) {
62
+ globalSettings[key] = value;
63
+ }
64
+ return globalSettings;
65
+ },
59
66
  getUpdatedGlobalSettingsKey: state => settings => {
60
67
  let updatedSettings = [];
61
68
  for (const [key, value] of Object.entries(settings)) {