@abi-software/mapintegratedvuer 1.9.0-beta.0 → 1.9.0-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.
@@ -1,358 +0,0 @@
1
- import "vue";
2
- import { u as p, c as u, E as r, T as d, d as h, e as m } from "./index-BGZgzrzo.js";
3
- import { mapStores as g } from "pinia";
4
- function y(e) {
5
- return e[0].toUpperCase() + e.substring(1);
6
- }
7
- const I = {
8
- emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
9
- props: {
10
- /**
11
- * Object containing information for
12
- * the required viewing.
13
- */
14
- entry: Object,
15
- visible: {
16
- type: Boolean,
17
- default: !0
18
- },
19
- mouseHovered: {
20
- type: Boolean,
21
- default: !1
22
- }
23
- },
24
- computed: {
25
- ...g(p, u),
26
- idNamePair() {
27
- return this.splitFlowStore.idNamePair;
28
- },
29
- syncMode() {
30
- return this.splitFlowStore.syncMode;
31
- },
32
- useHelpModeDialog() {
33
- return this.settingsStore.useHelpModeDialog;
34
- },
35
- connectivityInfoSidebar() {
36
- return this.settingsStore.connectivityInfoSidebar;
37
- },
38
- annotationSidebar() {
39
- return this.settingsStore.annotationSidebar;
40
- }
41
- },
42
- mounted: function() {
43
- r.on("startHelp", () => {
44
- this.startHelp();
45
- }), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold;
46
- },
47
- methods: {
48
- toggleSyncMode: function() {
49
- },
50
- getState: function() {
51
- },
52
- openMap: function(e) {
53
- e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (r.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`)), this.onConnectivityInfoClose();
54
- },
55
- onMapmanagerLoaded: function(e) {
56
- this.settingsStore.updateMapManager(e);
57
- },
58
- trackOpenMap: function(e) {
59
- d.sendEvent({
60
- event: "interaction_event",
61
- event_name: "portal_maps_open_map",
62
- category: e,
63
- location: "open_new_map"
64
- });
65
- },
66
- updateWithViewUrl: function() {
67
- },
68
- /**
69
- * Perform a local search on this contentvuer
70
- */
71
- search: function() {
72
- return !1;
73
- },
74
- /**
75
- * Get a list of search suggestions on this contentvuer
76
- */
77
- searchSuggestions: function() {
78
- },
79
- /**
80
- * Callback when the vuers emit a selected event.
81
- */
82
- resourceSelected: function(e, t) {
83
- var s, o, l, f;
84
- if (this.resourceHasAction(t)) {
85
- r.emit("PopoverActionClick", t);
86
- return;
87
- }
88
- let i, n = !1;
89
- const a = {
90
- paneIndex: this.entry.id,
91
- type: e,
92
- resource: t,
93
- internalName: void 0,
94
- eventType: void 0
95
- };
96
- if (e == "MultiFlatmap" || e == "Flatmap")
97
- if (a.internalName = (s = t == null ? void 0 : t.feature) != null && s.label ? t.feature.label : this.idNamePair[t.feature.models], t.eventType == "click")
98
- if (a.eventType = "selected", t.feature.type == "marker") {
99
- let c = a.internalName;
100
- this.settingsStore.isFeaturedMarkerIdentifier(
101
- t.feature.id
102
- ) ? i = {
103
- type: "Search",
104
- term: this.settingsStore.featuredMarkerDoi(
105
- t.feature.id
106
- ),
107
- featuredDataset: !0
108
- } : i = {
109
- type: "Facet",
110
- facet: c,
111
- facetPropPath: "anatomy.organ.category.name",
112
- term: "Anatomical structure"
113
- }, n = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
114
- } else t.feature.type == "feature" && this.syncMode && (n = !0);
115
- else t.eventType == "mouseenter" && (a.eventType = "highlighted", n = !0);
116
- else e == "Scaffold" && (t && t[0] && ((((o = t[0].data) == null ? void 0 : o.id) === void 0 || ((l = t[0].data) == null ? void 0 : l.id) === "") && (t[0].data.id = (f = t[0].data) == null ? void 0 : f.group), a.internalName = t[0].data.id, t[0].data.lastActionOnMarker === !0 && (i = {
117
- type: "Facet",
118
- facet: y(t[0].data.id),
119
- facetPropPath: "anatomy.organ.category.name",
120
- term: "Anatomical structure"
121
- })), a.eventType = "selected", n = !0);
122
- i && r.emit("PopoverActionClick", i), n && this.$emit("resource-selected", a);
123
- },
124
- resourceHasAction: function(e) {
125
- return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
126
- },
127
- /**
128
- * Check if this viewer is currently visible
129
- */
130
- isVisible: function() {
131
- return this.splitFlowStore.getPaneNameById(this.entry.id) !== void 0;
132
- },
133
- displayTooltip: function() {
134
- },
135
- /**
136
- * Get the term to zoom/highlight in a synchronisation event,
137
- * if it cannot be found in the map, it will perform several
138
- * calls to try to ge a valid name/id.
139
- */
140
- getNameAndIdFromSyncData: async function(e) {
141
- let t = e.internalName;
142
- t === void 0 && e.resource && (t = e.resource.label);
143
- let i;
144
- if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
145
- if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
146
- if (e.resource && e.resource.feature) {
147
- const s = h(e.resource.feature.models);
148
- if (s.length > 0) return s;
149
- }
150
- let a = m(t);
151
- if (a)
152
- return a;
153
- if (i && e.eventType === "selected")
154
- return fetch(`${this.apiLocation}get-related-terms/${i}`).then((s) => s.json()).then((s) => {
155
- var o;
156
- if (((o = s.uberon) == null ? void 0 : o.array.length) > 0)
157
- return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), i = s.uberon.array[0].id.toUpperCase(), { id: i, name: t };
158
- });
159
- }
160
- } else if (this.entry.type === "MultiFlatmap")
161
- if (t === "Bladder")
162
- t = "Urinary Bladder";
163
- else {
164
- const n = h(t);
165
- n.length > 0 && (t = n[0]);
166
- }
167
- return { id: i, name: t };
168
- },
169
- // Get the species and andaotmy info for the featured datasets
170
- getDatasetAnatomyInfo: function(e) {
171
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
172
- const i = t.result[0];
173
- let n;
174
- try {
175
- n = i.anatomy.organ[0].curie;
176
- } catch {
177
- n = void 0;
178
- }
179
- let a;
180
- try {
181
- a = i.item.curie;
182
- } catch {
183
- a = void 0;
184
- }
185
- let s;
186
- try {
187
- let o = 0, l = !1;
188
- for (; !l && o < i.organisms.subject.length; ) {
189
- const f = i.organisms.subject[o];
190
- f.species && (s = f.species.name, l = !0), o += 1;
191
- }
192
- } catch {
193
- s = void 0;
194
- }
195
- this.settingsStore.updateFeaturedMarker({
196
- identifier: e,
197
- marker: n,
198
- doi: a,
199
- species: s
200
- });
201
- });
202
- },
203
- // Check if the old featured dataset api has any info
204
- oldFeaturedDatasetApiHasInfo: async function() {
205
- let t = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
206
- return !t.identifiers || t.identifiers.length == 0 ? !1 : t.identifiers;
207
- },
208
- // Check if the new featured dataset api has any info
209
- newFeaturedDatasetApiHasInfo: async function() {
210
- let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
211
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
212
- },
213
- /**
214
- * Get a list of featured datasets to display.
215
- */
216
- getFeaturedDatasets: async function() {
217
- let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
218
- if (t) e = t;
219
- else {
220
- let i = await this.newFeaturedDatasetApiHasInfo();
221
- i && (e = i);
222
- }
223
- this.settingsStore.updateFeatured(e), e.forEach((i) => {
224
- this.getDatasetAnatomyInfo(i);
225
- });
226
- },
227
- zoomToFeatures: function() {
228
- },
229
- handleSyncMouseEvent: async function(e) {
230
- let t = await this.getNameAndIdFromSyncData(e);
231
- e.eventType === "highlighted" ? this.highlightFeatures(t) : e.eventType === "selected" && this.displayTooltip(t);
232
- },
233
- /**
234
- * Handle sync pan zoom event
235
- */
236
- handleSyncPanZoomEvent: function() {
237
- },
238
- highlightFeatures: function() {
239
- },
240
- receiveSynchronisedEvent: async function(e) {
241
- if (e.paneIndex !== this.entry.id)
242
- e.eventType == "panZoom" || this.handleSyncMouseEvent(e);
243
- else if (e.eventType == "selected") {
244
- let t = await this.getNameAndIdFromSyncData(e);
245
- this.zoomToFeatures(t, !1);
246
- }
247
- },
248
- requestSynchronisedEvent: function() {
249
- },
250
- flatmapMarkerUpdate() {
251
- },
252
- onResize: function() {
253
- },
254
- startHelp: function() {
255
- this.isInHelp === !1 && (this.helpMode = !0, window.addEventListener("mousedown", this.checkEndHelpMouseDown), this.isInHelp = !0);
256
- },
257
- endHelp: function() {
258
- window.removeEventListener("mousedown", this.checkEndHelpMouseDown), this.helpMode = !1, setTimeout(() => {
259
- this.isInHelp = !1;
260
- }, 200);
261
- },
262
- onHelpModeShowNext: function() {
263
- this.helpModeActiveItem += 1;
264
- },
265
- onHelpModeLastItem: function(e) {
266
- e && (this.helpModeLastItem = !0);
267
- },
268
- onFinishHelpMode: function() {
269
- this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
270
- },
271
- onTooltipShown: function() {
272
- this.$refs.multiflatmap && this.$refs.multiflatmapHelp && this.$refs.multiflatmapHelp.toggleTooltipHighlight(), this.$refs.flatmap && this.$refs.flatmapHelp && this.$refs.flatmapHelp.toggleTooltipHighlight(), this.$refs.scaffold && this.$refs.scaffoldHelp && this.$refs.scaffoldHelp.toggleTooltipHighlight();
273
- },
274
- onMapTooltipShown: function() {
275
- this.$refs.multiflatmap && this.$refs.multiflatmapHelp && this.$refs.multiflatmapHelp.toggleTooltipPinHighlight(), this.$refs.flatmap && this.$refs.flatmapHelp && this.$refs.flatmapHelp.toggleTooltipPinHighlight(), this.$refs.scaffold && this.$refs.scaffoldHelp && this.$refs.scaffoldHelp.toggleTooltipPinHighlight();
276
- },
277
- /**
278
- * End help-mode only if user clicks outside of help mode dialog.
279
- */
280
- checkEndHelpMouseDown: function(e) {
281
- e.target.closest(".help-mode-dialog") || this.endHelp();
282
- },
283
- getConnectivitiesByDOI: async function(e) {
284
- return await this.$refs.multiflatmap.getCurrentFlatmap().searchConnectivitiesByReference(e);
285
- },
286
- highlightAnatomies: async function(e, t, i) {
287
- const n = [...t], a = this.settingsStore.hoverHighlightOptions;
288
- if (a.highlightConnectedPaths) {
289
- const s = await e.queryPathsForFeatures(t);
290
- s && n.push(...s);
291
- }
292
- if (a.highlightDOIPaths) {
293
- const s = await this.getConnectivitiesByDOI(i);
294
- s && n.push(...s);
295
- }
296
- return n;
297
- },
298
- mapHoverHighlight: function() {
299
- if (this.visible) {
300
- const e = this.settingsStore.hoverAnatomies, t = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI;
301
- let n = null, a = null;
302
- this.flatmapRef && (n = this.$refs.flatmap.mapImp), this.multiflatmapRef && (n = this.$refs.multiflatmap.getCurrentFlatmap().mapImp), this.scaffoldRef && (a = this.$refs.scaffold), n && n.clearSearchResults(), e.length || t.length ? (clearTimeout(this.hoverDelay), this.multiflatmapRef || this.flatmapRef ? this.highlightAnatomies(n, e, i).then((s) => {
303
- n.selectFeatures(s);
304
- }) : this.scaffoldRef && (a == null || a.changeHighlightedByName(t, "", !1))) : this.hoverDelay = setTimeout(() => {
305
- this.multiflatmapRef || this.flatmapRef ? n == null || n.clearSearchResults() : this.scaffoldRef && (a == null || a.changeHighlightedByName(t, "", !1));
306
- }, 500);
307
- }
308
- },
309
- onAnnotationOpen: function(e) {
310
- r.emit("annotation-open", e);
311
- },
312
- onAnnotationClose: function() {
313
- r.emit("annotation-close");
314
- },
315
- onConnectivityInfoOpen: function(e) {
316
- r.emit("connectivity-info-open", e);
317
- },
318
- onConnectivityInfoClose: function() {
319
- r.emit("connectivity-info-close");
320
- },
321
- onConnectivityGraphError: function(e) {
322
- r.emit("connectivity-graph-error", e);
323
- }
324
- },
325
- data: function() {
326
- return {
327
- apiLocation: void 0,
328
- activeSpecies: "Human Male",
329
- scaffoldCamera: void 0,
330
- mainStyle: {
331
- height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
332
- width: "100%",
333
- bottom: "0px"
334
- },
335
- helpMode: !1,
336
- helpModeActiveItem: 0,
337
- helpModeLastItem: !1,
338
- multiflatmapRef: null,
339
- flatmapRef: null,
340
- scaffoldRef: null,
341
- scaffoldLoaded: !1,
342
- isInHelp: !1,
343
- hoverDelay: void 0,
344
- mapManager: void 0
345
- };
346
- },
347
- created: function() {
348
- this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi), this.settingsStore.mapManager && (this.mapManager = this.settingsStore.mapManager);
349
- },
350
- watch: {
351
- helpMode: function(e) {
352
- e || (this.helpModeActiveItem = 0);
353
- }
354
- }
355
- };
356
- export {
357
- I as C
358
- };
@@ -1,250 +0,0 @@
1
- // Set zoom values for micro and mesoscopic
2
- let microscopic = 7
3
- let mesoscopic = 5
4
-
5
- // Set what level each uberon shows at
6
- export default [
7
- {
8
- "id": "UBERON:0000948",
9
- "name": "heart",
10
- "showAtZoom": 1,
11
- },
12
- {
13
- "id": "UBERON:0001759",
14
- "name": "vagus nerve",
15
- "showAtZoom": 1
16
- },
17
- {
18
- "id": "UBERON:0001155",
19
- "name": "colon",
20
- "showAtZoom": 1
21
- },
22
- {
23
- "id": "UBERON:0000945",
24
- "name": "stomach",
25
- "showAtZoom": 1
26
- },
27
- {
28
- "id": "UBERON:0001013",
29
- "name": "adipose tissue",
30
- "showAtZoom": 1
31
- },
32
- {
33
- "id": "UBERON:0001255",
34
- "name": "urinary bladder",
35
- "showAtZoom": 1
36
- },
37
- {
38
- "id": "UBERON:0001348",
39
- "name": "brown adipose tissue",
40
- "showAtZoom": 6
41
- },
42
- {
43
- "id": "UBERON:0002008",
44
- "name": "cardiac nerve plexus",
45
- "showAtZoom": 1
46
- },
47
- {
48
- "id": "UBERON:0002240",
49
- "name": "spinal cord",
50
- "showAtZoom": 1
51
- },
52
- {
53
- "id": "UBERON:0002005",
54
- "name": "Enteric Nervous System",
55
- "showAtZoom": 4
56
- },
57
- {
58
- "id": "UBERON:0013702",
59
- "name": "body proper",
60
- "showAtZoom": 1
61
- },
62
- {
63
- "id": "UBERON:0002298",
64
- "name": "brainstem",
65
- "showAtZoom": 1
66
- },
67
- {
68
- "id": "UBERON:0002439",
69
- "name": "myenteric nerve plexus",
70
- "showAtZoom": 6
71
- },
72
- {
73
- "id": "UBERON:0000010",
74
- "name": "peripheral nervous system",
75
- "showAtZoom": 6
76
- },
77
- {
78
- "id": "UBERON:0002048",
79
- "name": "lung",
80
- "showAtZoom": 1
81
- },
82
- {
83
- "id": "UBERON:0002410",
84
- "name": "autonomic nervous system",
85
- "showAtZoom": 6
86
- },
87
- {
88
- "id": "UBERON:0002441",
89
- "name": "cervicothoracic ganglion",
90
- "showAtZoom": 6
91
- },
92
- {
93
- "id": "UBERON:0005363",
94
- "name": "inferior vagus X ganglion",
95
- "showAtZoom": 6
96
- },
97
- {
98
- "id": "UBERON:0001264",
99
- "name": "pancreas",
100
- "showAtZoom": 1
101
- },
102
- {
103
- "id": "UBERON:0001884",
104
- "name": "phrenic nerve",
105
- "showAtZoom": 6
106
- },
107
- {
108
- "id": "UBERON:0002059",
109
- "name": "submandibular ganglion",
110
- "showAtZoom": 7
111
- },
112
- {
113
- "id": "UBERON:0001347",
114
- "name": "white adipose tissue",
115
- "showAtZoom": 6
116
- },
117
- {
118
- "id": "UBERON:0001556",
119
- "name": "lower urinary tract",
120
- "showAtZoom": 1
121
- },
122
- {
123
- "id": "UBERON:0002262",
124
- "name": "celiac ganglion",
125
- "showAtZoom": 5
126
- },
127
- {
128
- "id": "UBERON:0000955",
129
- "name": "Brain",
130
- "showAtZoom": 1
131
- },
132
- {
133
- "id": "UBERON:0000160",
134
- "name": "intestine",
135
- "showAtZoom": 1
136
- },
137
- {
138
- "id": "UBERON:0001322",
139
- "name": "sciatic nerve",
140
- "showAtZoom": 1
141
- },
142
- {
143
- "id": "UBERON:0001649",
144
- "name": "glossopharyngeal nerve",
145
- "showAtZoom": 6
146
- },
147
- {
148
- "id": "UBERON:0002063",
149
- "name": "sinus venosus",
150
- "showAtZoom": 6
151
- },
152
- {
153
- "id": "UBERON:0002107",
154
- "name": "liver",
155
- "showAtZoom": 1
156
- },
157
- {
158
- "id": "UBERON:0002113",
159
- "name": "kidney",
160
- "showAtZoom": 1
161
- },
162
- {
163
- "id": "UBERON:0002481",
164
- "name": "bone tissue",
165
- "showAtZoom": 1
166
- },
167
- {
168
- "id": "UBERON:0004907",
169
- "name": "lower digestive tract",
170
- "showAtZoom": 4
171
- },
172
- {
173
- "id": "UBERON:0000044",
174
- "name": "Dorsal root ganglion",
175
- "showAtZoom": 5
176
- },
177
- // New levels from Keeran
178
- {
179
- "id": "UBERON:0001736",
180
- "name": "Submandibular gland",
181
- "showAtZoom": microscopic,
182
- "keyword": true
183
- },
184
- {
185
- "id": "UBERON:0001160",
186
- "name": "Fundus of stgit omach",
187
- "showAtZoom": mesoscopic,
188
- "keyword": true
189
- },
190
- {
191
- "id": "UBERON:0000955",
192
- "name": "Brain",
193
- "showAtZoom": mesoscopic,
194
- "keyword": true
195
- },
196
- {
197
- "id": "UBERON:0003708",
198
- "name": "Carotid sinus",
199
- "showAtZoom": microscopic,
200
- "keyword": true
201
- },
202
- {
203
- "id": "UBERON:0002079",
204
- "name": "Left cardiac atrium",
205
- "showAtZoom": mesoscopic,
206
- "keyword": true
207
- },
208
- {
209
- "id": "ILX:0485722",
210
- "name": "Nodose ganglion",
211
- "showAtZoom": microscopic,
212
- "keyword": true
213
- },
214
- {
215
- "id": "UBERON:0002078",
216
- "name": "Right cardiac atrium",
217
- "showAtZoom": mesoscopic,
218
- "keyword": true
219
- },
220
- {
221
- "id": "UBERON:0002084",
222
- "name": "Heart left ventricle",
223
- "showAtZoom": mesoscopic,
224
- "keyword": true
225
- },
226
- {
227
- "id": "UBERON:0002080",
228
- "name": "Heart right ventricle",
229
- "showAtZoom": mesoscopic,
230
- "keyword": true
231
- },
232
- {
233
- "id": "UBERON:0001508",
234
- "name": "Arch of Aorta",
235
- "showAtZoom": mesoscopic,
236
- "keyword": true
237
- },
238
- {
239
- "id": "UBERON:0001738",
240
- "name": "Thyroid cartilage",
241
- "showAtZoom": mesoscopic,
242
- "keyword": true
243
- },
244
- {
245
- "id": "UBERON:0000388",
246
- "name": "Epiglottis",
247
- "showAtZoom": mesoscopic,
248
- "keyword": true
249
- },
250
- ]