@abi-software/mapintegratedvuer 1.8.0-beta.1 → 1.8.0-isan.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.
Files changed (31) hide show
  1. package/dist/ContentMixin-CthZZNjI.js +706 -0
  2. package/dist/{Flatmap-BMowLXfS.js → Flatmap-Bi9esI2v.js} +62 -60
  3. package/dist/{Iframe-fNcVYbXe.js → Iframe-bsYxppii.js} +2 -2
  4. package/dist/{MultiFlatmap-DuKi1y2A.js → MultiFlatmap-BWFsdMgS.js} +46 -37
  5. package/dist/{Plot-3jlnqIiS.js → Plot-gX8radCI.js} +2 -2
  6. package/dist/{Scaffold-Brboi1Ah.js → Scaffold-Dn3GeNi0.js} +7197 -7151
  7. package/dist/Simulation-Zgs0MXh1.js +30 -0
  8. package/dist/{index-B_H6BPK_.js → index-DFkMrKek.js} +23282 -21203
  9. package/dist/mapintegratedvuer.js +1 -1
  10. package/dist/mapintegratedvuer.umd.cjs +1663 -1009
  11. package/dist/{style-Bt2YbWCx.js → style-DlUxkFU-.js} +70145 -67320
  12. package/dist/style.css +1 -1
  13. package/package.json +8 -7
  14. package/src/App.vue +3 -14
  15. package/src/assets/header-icon.scss +7 -0
  16. package/src/components/ContentBar.vue +5 -1
  17. package/src/components/DialogToolbarContent.vue +87 -15
  18. package/src/components/FlatmapContextCard.vue +11 -8
  19. package/src/components/MapContent.vue +11 -21
  20. package/src/components/SplitFlow.vue +183 -108
  21. package/src/components/scripts/utilities.js +1 -1
  22. package/src/components/viewers/Flatmap.vue +6 -7
  23. package/src/components/viewers/MultiFlatmap.vue +25 -7
  24. package/src/components/viewers/Scaffold.vue +2 -2
  25. package/src/components/viewers/Simulation.vue +19 -1
  26. package/src/components.d.ts +4 -0
  27. package/src/mixins/ContentMixin.js +138 -80
  28. package/src/mixins/DynamicMarkerMixin.js +3 -1
  29. package/src/stores/settings.js +13 -10
  30. package/dist/ContentMixin-B9DtqhYT.js +0 -357
  31. package/dist/Simulation-BPEbHrzv.js +0 -22
@@ -16,16 +16,20 @@ declare module 'vue' {
16
16
  DialogToolbarContent: typeof import('./components/DialogToolbarContent.vue')['default']
17
17
  ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
18
18
  ElButton: typeof import('element-plus/es')['ElButton']
19
+ ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
19
20
  ElCol: typeof import('element-plus/es')['ElCol']
20
21
  ElContainer: typeof import('element-plus/es')['ElContainer']
21
22
  ElHeader: typeof import('element-plus/es')['ElHeader']
22
23
  ElIcon: typeof import('element-plus/es')['ElIcon']
23
24
  ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
24
25
  ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
26
+ ElIconMoreFilled: typeof import('@element-plus/icons-vue')['MoreFilled']
25
27
  ElInput: typeof import('element-plus/es')['ElInput']
26
28
  ElMain: typeof import('element-plus/es')['ElMain']
27
29
  ElOption: typeof import('element-plus/es')['ElOption']
28
30
  ElPopover: typeof import('element-plus/es')['ElPopover']
31
+ ElRadio: typeof import('element-plus/es')['ElRadio']
32
+ ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
29
33
  ElRow: typeof import('element-plus/es')['ElRow']
30
34
  ElSelect: typeof import('element-plus/es')['ElSelect']
31
35
  ElSwitch: typeof import('element-plus/es')['ElSwitch']
@@ -9,6 +9,9 @@ import { useSettingsStore } from '../stores/settings';
9
9
  import { useSplitFlowStore } from '../stores/splitFlow';
10
10
  import Tagging from '../services/tagging.js';
11
11
 
12
+ import { FlatmapQueries } from "@abi-software/flatmapvuer/src/services/flatmapQueries.js";
13
+ import { getKnowledgeSource, loadAndStoreKnowledge } from "@abi-software/flatmapvuer/src/services/flatmapKnowledge.js";
14
+
12
15
  function capitalise(text) {
13
16
  return text[0].toUpperCase() + text.substring(1)
14
17
  }
@@ -73,8 +76,6 @@ export default {
73
76
  EventBus.emit("OpenNewMap", type);
74
77
  this.trackOpenMap(`open_new_${type}_map`);
75
78
  }
76
-
77
- this.onConnectivityInfoClose();
78
79
  },
79
80
  onMapmanagerLoaded: function (mapManager) {
80
81
  this.settingsStore.updateMapManager(mapManager);
@@ -107,42 +108,37 @@ export default {
107
108
  /**
108
109
  * Callback when the vuers emit a selected event.
109
110
  */
110
- resourceSelected: function (type, resource) {
111
+ resourceSelected: function (type, resources) {
112
+ const resource = resources[0]
111
113
  // Skip processing if resources already has actions
112
- if (this.resourceHasAction(resource)) {
114
+ if (resource && this.resourceHasAction(resource)) {
113
115
  EventBus.emit("PopoverActionClick", resource);
114
116
  return;
115
117
  }
116
-
117
118
  let returnedAction = undefined;
118
119
  let action = "none";
119
120
  let fireResourceSelected = false;
120
121
  const result = {
121
122
  paneIndex: this.entry.id,
122
123
  type: type,
123
- resource: resource,
124
+ resource: resources,
124
125
  internalName: undefined,
125
126
  eventType: undefined,
126
127
  };
127
-
128
-
129
128
  if (type == "MultiFlatmap" || type == "Flatmap") {
130
- result.internalName = resource?.feature?.label ? resource.feature.label : this.idNamePair[resource.feature.models];
129
+ const flatmapImp = this.getFlatmapImp();
130
+ result.internalName = resource?.feature?.label ?
131
+ resource.feature.label : this.idNamePair[resource.feature.models];
131
132
  if (resource.eventType == "click") {
132
133
  result.eventType = "selected";
133
134
  if (resource.feature.type == "marker") {
135
+
134
136
  let label = result.internalName;
135
- if (
136
- this.settingsStore.isFeaturedMarkerIdentifier(
137
- resource.feature.id
138
- )
139
- ) {
137
+ if (this.settingsStore.isFeaturedMarkerIdentifier(resource.feature.id)) {
140
138
  // It is a featured dataset search for DOI.
141
139
  returnedAction = {
142
140
  type: "Search",
143
- term: this.settingsStore.featuredMarkerDoi(
144
- resource.feature.id
145
- ),
141
+ term: this.settingsStore.featuredMarkerDoi(resource.feature.id),
146
142
  featuredDataset: true,
147
143
  };
148
144
  } else {
@@ -151,17 +147,41 @@ export default {
151
147
  type: "Facet",
152
148
  facet: label,
153
149
  facetPropPath: "anatomy.organ.category.name",
150
+ facetSubPropPath: "anatomy.organ.name",
154
151
  term: "Anatomical structure",
155
152
  };
153
+ let labels = new Set();
154
+ if (resource?.feature['marker-terms']) {
155
+ resource.feature['marker-terms'].forEach((term) => {
156
+ labels.add(term.label)
157
+ });
158
+ labels.add(label)
159
+ if (labels.size > 0) {
160
+ returnedAction = {
161
+ type: "Facets",
162
+ labels: [...labels],
163
+ };
164
+ }
165
+ } else if (resource?.feature?.models) {
166
+ returnedAction = {
167
+ type: "PMRSearch",
168
+ term: resource.feature.models,
169
+ };
170
+ }
156
171
  }
157
-
158
172
  fireResourceSelected = true;
159
173
  if (type == "MultiFlatmap") {
160
- const flatmap =
161
- this.$refs.multiflatmap.getCurrentFlatmap().mapImp;
162
- flatmap.clearSearchResults();
174
+ flatmapImp.clearSearchResults();
163
175
  }
164
176
  } else if (resource.feature.type == "feature") {
177
+ if (flatmapImp.options && flatmapImp.options.style === 'functional') {
178
+ if (resource.feature?.hyperlinks?.pmr) {
179
+ returnedAction = {
180
+ type: "URL",
181
+ resource: resource.feature?.hyperlinks?.pmr,
182
+ };
183
+ }
184
+ }
165
185
  // Do no open scaffold in sync map
166
186
  if (this.syncMode) {
167
187
  fireResourceSelected = true;
@@ -174,16 +194,16 @@ export default {
174
194
  fireResourceSelected = true;
175
195
  }
176
196
  } else if (type == "Scaffold") {
177
- if (resource && resource[0]) {
178
- if (resource[0].data?.id === undefined || resource[0].data?.id === "") {
179
- resource[0].data.id = resource[0].data?.group;
197
+ if (resource) {
198
+ if (resource.data?.id === undefined || resource.data?.id === "") {
199
+ resource.data.id = resource.data?.group;
180
200
  }
181
- result.internalName = resource[0].data.id;
201
+ result.internalName = resource.data.id;
182
202
  // Facet search if marker is clicked
183
- if (resource[0].data.lastActionOnMarker === true) {
203
+ if (resource.data.lastActionOnMarker === true) {
184
204
  returnedAction = {
185
205
  type: "Facet",
186
- facet: capitalise(resource[0].data.id),
206
+ facet: capitalise(resource.data.id),
187
207
  facetPropPath: "anatomy.organ.category.name",
188
208
  term: "Anatomical structure",
189
209
  };
@@ -248,7 +268,7 @@ export default {
248
268
  return fetch(`${this.apiLocation}get-related-terms/${id}`)
249
269
  .then(response => response.json())
250
270
  .then(data => {
251
- if (data.uberon.array.length > 0) {
271
+ if (data.uberon?.array.length > 0) {
252
272
  name =
253
273
  data.uberon.array[0].name.charAt(0).toUpperCase() +
254
274
  data.uberon.array[0].name.slice(1);
@@ -458,75 +478,64 @@ export default {
458
478
  this.endHelp();
459
479
  }
460
480
  },
461
- getConnectivitiesByDOI: async function (hoverDOI) {
462
- const currentFlatmap = this.$refs.multiflatmap.getCurrentFlatmap();
463
- const response = await currentFlatmap.searchConnectivitiesByReference(hoverDOI);
464
- return response;
465
- },
466
- highlightAnatomies: async function (mapImp, hoverAnatomies, hoverDOI) {
467
- const itemsToHighlight = [...hoverAnatomies];
468
- const hoverHighlightOptions = this.settingsStore.hoverHighlightOptions;
481
+ flatmapHighlight: async function (flatmap, hoverAnatomies, hoverDOI, hoverConnectivity) {
482
+ let toHighlight = [...hoverAnatomies, ...hoverConnectivity];
483
+ const globalSettings = this.settingsStore.globalSettings;
484
+
469
485
 
470
486
  // to highlight connected paths
471
- if (hoverHighlightOptions.highlightConnectedPaths) {
472
- const connectionsFromFeatures = await mapImp.queryPathsForFeatures(hoverAnatomies);
473
- if (connectionsFromFeatures) {
474
- itemsToHighlight.push(...connectionsFromFeatures);
487
+ if (globalSettings.highlightConnectedPaths) {
488
+ const hoverEntry = hoverAnatomies.length ? hoverAnatomies :
489
+ hoverConnectivity.length ? hoverConnectivity :
490
+ []
491
+ const connectedPaths = await flatmap.retrieveConnectedPaths(hoverEntry);
492
+ if (connectedPaths) {
493
+ toHighlight.push(...connectedPaths);
475
494
  }
476
495
  }
477
496
 
478
497
  // to highlight related paths from reference DOI
479
- if (hoverHighlightOptions.highlightDOIPaths) {
480
- const connectionsFromDOI = await this.getConnectivitiesByDOI(hoverDOI);
498
+ if (globalSettings.highlightDOIPaths) {
499
+ const connectionsFromDOI = await flatmap.searchConnectivitiesByReference(hoverDOI);
481
500
  if (connectionsFromDOI) {
482
- itemsToHighlight.push(...connectionsFromDOI);
501
+ toHighlight.push(...connectionsFromDOI);
483
502
  }
484
503
  }
485
-
486
- return itemsToHighlight;
504
+ toHighlight = [...new Set(toHighlight)];
505
+ return toHighlight;
487
506
  },
488
- mapHoverHighlight: function () {
507
+ cardHoverHighlight: function () {
489
508
  if (this.visible) {
490
509
  const hoverAnatomies = this.settingsStore.hoverAnatomies;
491
510
  const hoverOrgans = this.settingsStore.hoverOrgans;
492
511
  const hoverDOI = this.settingsStore.hoverDOI;
493
- let mapImp = null;
494
- let scaffold = null;
495
-
496
- if (this.flatmapRef) {
497
- mapImp = this.$refs.flatmap.mapImp;
498
- }
512
+ const hoverConnectivity = this.settingsStore.hoverConnectivity;
499
513
 
500
- if (this.multiflatmapRef) {
501
- mapImp = this.$refs.multiflatmap.getCurrentFlatmap().mapImp;
502
- }
503
-
504
- if (this.scaffoldRef) {
505
- scaffold = this.$refs.scaffold;
506
- }
514
+ let flatmap = null;
515
+ let scaffold = null;
516
+ if (this.flatmapRef) flatmap = this.$flatmapRef;
517
+ if (this.multiflatmapRef) flatmap = this.$multiflatmapRef;
518
+ if (this.scaffoldRef) scaffold = this.$scaffoldRef;
507
519
 
508
520
  // reset
509
- if (mapImp) {
510
- mapImp.clearSearchResults();
521
+ if ((this.multiflatmapRef || this.flatmapRef) && flatmap) {
522
+ flatmap.mapImp.clearSearchResults();
523
+ } else if (this.scaffoldRef && scaffold) {
524
+ scaffold.changeHighlightedByName(hoverOrgans, "", false);
511
525
  }
512
526
 
513
- if (hoverAnatomies.length || hoverOrgans.length) {
514
- clearTimeout(this.hoverDelay);
515
- if (this.multiflatmapRef || this.flatmapRef) {
516
- this.highlightAnatomies(mapImp, hoverAnatomies, hoverDOI).then((itemsToHighlight) => {
517
- mapImp.selectFeatures(itemsToHighlight);
527
+ if (hoverAnatomies.length || hoverOrgans.length || hoverDOI || hoverConnectivity.length) {
528
+ if ((this.multiflatmapRef || this.flatmapRef) && flatmap) {
529
+ this.flatmapHighlight(flatmap, hoverAnatomies, hoverDOI, hoverConnectivity).then((paths) => {
530
+ try {
531
+ flatmap.zoomToFeatures(paths);
532
+ } catch (error) {
533
+ console.log(error)
534
+ }
518
535
  });
519
- } else if (this.scaffoldRef) {
520
- scaffold?.changeHighlightedByName(hoverOrgans, "", false);
536
+ } else if (this.scaffoldRef && scaffold) {
537
+ scaffold.changeHighlightedByName(hoverOrgans, "", false);
521
538
  }
522
- } else {
523
- this.hoverDelay = setTimeout(() => {
524
- if (this.multiflatmapRef || this.flatmapRef) {
525
- mapImp?.clearSearchResults();
526
- } else if (this.scaffoldRef) {
527
- scaffold?.changeHighlightedByName(hoverOrgans, "", false);
528
- }
529
- }, 500);
530
539
  }
531
540
  }
532
541
  },
@@ -539,12 +548,58 @@ export default {
539
548
  onConnectivityInfoOpen: function (connectivityInfoData) {
540
549
  EventBus.emit('connectivity-info-open', connectivityInfoData);
541
550
  },
542
- onConnectivityInfoClose: function () {
543
- EventBus.emit('connectivity-info-close');
544
- },
545
551
  onConnectivityGraphError: function (errorInfo) {
546
552
  EventBus.emit('connectivity-graph-error', errorInfo);
547
553
  },
554
+ loadConnectivityKnowledge: async function (flatmap) {
555
+ const sckanVersion = getKnowledgeSource(flatmap);
556
+ const flatmapQueries = markRaw(new FlatmapQueries());
557
+ flatmapQueries.initialise(this.flatmapAPI);
558
+ const knowledge = await loadAndStoreKnowledge(flatmap, flatmapQueries);
559
+ this.connectivityKnowledge = knowledge.filter((item) => {
560
+ if (item.source === sckanVersion && item.connectivity?.length) return true;
561
+ return false;
562
+ });
563
+ EventBus.emit("connectivity-knowledge", this.connectivityKnowledge);
564
+ },
565
+ connectivityQueryFilter: async function (flatmap, payload) {
566
+ let results = this.connectivityKnowledge;
567
+ if (payload.type === "query-update") {
568
+ if (this.query !== payload.value) this.target = [];
569
+ this.query = payload.value;
570
+ } else if (payload.type === "filter-update") {
571
+ this.filter = payload.value;
572
+ this.target = [];
573
+ } else if (payload.type === "query-filter-update") {
574
+ this.query = payload.query;
575
+ this.filter = payload.filter;
576
+ this.target = payload.data;
577
+ // restore connectivity explorer content
578
+ if (!this.query) {
579
+ EventBus.emit("connectivity-knowledge", [...results]);
580
+ }
581
+ return;
582
+ }
583
+ if (this.query) {
584
+ let flag = "", order = [], suggestions = [], paths = [];
585
+ this.searchSuggestions(this.query, suggestions);
586
+ const labels = [...new Set(suggestions)];
587
+ flag = 'label';
588
+ order = labels;
589
+ if (labels.length === 1) {
590
+ const options = {
591
+ type: this.filter.map(f => f.facet.toLowerCase()),
592
+ target: this.target.map(d => d.id),
593
+ };
594
+ paths = await flatmap.retrieveConnectedPaths([this.query], options);
595
+ flag = 'id';
596
+ order = [this.query, ...paths.filter(item => item !== this.query)];
597
+ }
598
+ results = results.filter(item => paths.includes(item.id) || labels.includes(item.label));
599
+ results.sort((a, b) => order.indexOf(a[flag]) - order.indexOf(b[flag]));
600
+ }
601
+ EventBus.emit("connectivity-knowledge", results);
602
+ }
548
603
  },
549
604
  data: function () {
550
605
  return {
@@ -564,8 +619,11 @@ export default {
564
619
  scaffoldRef: null,
565
620
  scaffoldLoaded: false,
566
621
  isInHelp: false,
567
- hoverDelay: undefined,
568
622
  mapManager: undefined,
623
+ connectivityKnowledge: [],
624
+ query: "",
625
+ filter: [],
626
+ target: [], // Support origins/components/destinations term search
569
627
  };
570
628
  },
571
629
  created: function () {
@@ -40,8 +40,9 @@ export default {
40
40
 
41
41
  if (flatmapImp) {
42
42
  // Set the dataset markers
43
- let markers = this.settingsStore.globalSettings.displayMarker ? this.settingsStore.markers : [];
43
+ let markers = this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.markers : [];
44
44
  markers = removeDuplicates(markers);
45
+ let multiMarkers = this.settingsStore.globalSettings.displayMarkers ? this.settingsStore.multiScaleMarkers : [];
45
46
  let fmMarkers = this.removeMarkersNotOnFlatmap(flatmapImp, markers);
46
47
  flatmapImp.clearMarkers();
47
48
  flatmapImp.clearDatasetMarkers();
@@ -54,6 +55,7 @@ export default {
54
55
  } else {
55
56
  flatmapImp.addDatasetMarkers(fmMarkers);
56
57
  }
58
+ flatmapImp.addMarkers(multiMarkers);
57
59
 
58
60
  // Set the featured markers
59
61
  if (this.entry.type === "MultiFlatmap") {
@@ -11,6 +11,7 @@ export const useSettingsStore = defineStore('settings', {
11
11
  algoliaKey: undefined,
12
12
  algoliaId: undefined,
13
13
  pennsieveApi: undefined,
14
+ pmrHost: "https://models.physiomeproject.org/",
14
15
  flatmapAPI: undefined,
15
16
  nlLinkPrefix: undefined,
16
17
  mapManager: undefined,
@@ -18,9 +19,11 @@ export const useSettingsStore = defineStore('settings', {
18
19
  facets: { species: [], gender: [], organ: [] },
19
20
  numberOfDatasetsForFacets: [],
20
21
  markers: [],
22
+ multiScaleMarkers: ["cvs:functional.whole-body", "cvs:functional.tissue", "cvs:functional.cell"],
21
23
  hoverAnatomies: [],
22
24
  hoverOrgans: [],
23
25
  hoverDOI: '',
26
+ hoverConnectivity: [],
24
27
  featuredMarkers: [],
25
28
  featuredMarkerIdentifiers: [],
26
29
  featuredMarkerDois: [],
@@ -30,12 +33,11 @@ export const useSettingsStore = defineStore('settings', {
30
33
  useHelpModeDialog: false,
31
34
  connectivityInfoSidebar: true,
32
35
  annotationSidebar: true,
33
- hoverHighlightOptions: {
34
- highlightConnectedPaths: false,
35
- highlightDOIPaths: false,
36
- },
37
36
  globalSettings: {
38
- displayMarker: true,
37
+ displayMarkers: true,
38
+ highlightConnectedPaths: false,
39
+ highlightDOIPaths: false, // comment out to hide in settings
40
+ interactiveMode: 'dataset', // dataset, connectivity, multiscale
39
41
  },
40
42
  }
41
43
  },
@@ -53,7 +55,7 @@ export const useSettingsStore = defineStore('settings', {
53
55
  let updatedSettings = [];
54
56
  for (const [key, value] of Object.entries(settings)) {
55
57
  const attribute = state.globalSettings[key];
56
- if (!attribute || (attribute !== value)) {
58
+ if (attribute === undefined || (attribute !== value)) {
57
59
  updatedSettings.push(key);
58
60
  }
59
61
  }
@@ -91,13 +93,17 @@ export const useSettingsStore = defineStore('settings', {
91
93
  updateRootUrl(rootUrl) {
92
94
  this.rootUrl = rootUrl;
93
95
  },
96
+ updatePmrHost(pmrHost) {
97
+ this.pmrHost = pmrHost ? pmrHost : "https://models.physiomeproject.org/";
98
+ },
94
99
  updateMarkers(markers) {
95
100
  this.markers = markers;
96
101
  },
97
- updateHoverFeatures(anatomies, organs, doi) {
102
+ updateHoverFeatures(anatomies, organs, doi, connectivity) {
98
103
  this.hoverAnatomies = anatomies;
99
104
  this.hoverOrgans = organs;
100
105
  this.hoverDOI = doi;
106
+ this.hoverConnectivity = connectivity;
101
107
  },
102
108
  updateFeatured(datasetIdentifiers) {
103
109
  this.featuredMarkerIdentifiers = new Array(datasetIdentifiers.length);
@@ -181,9 +187,6 @@ export const useSettingsStore = defineStore('settings', {
181
187
  updateAnnotationSidebar(annotationSidebar) {
182
188
  this.annotationSidebar = annotationSidebar;
183
189
  },
184
- updateHoverHighlightOptions(hoverHighlightOptions) {
185
- this.hoverHighlightOptions = hoverHighlightOptions;
186
- },
187
190
  updateGlobalSettings(globalSettings) {
188
191
  for (const [key, value] of Object.entries(globalSettings)) {
189
192
  this.globalSettings[key] = value;