@abi-software/mapintegratedvuer 1.3.4-isan.2 → 1.3.5-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.
@@ -1,588 +0,0 @@
1
- import { u as g, b as y, E as l, T as w, c as A, d as p, e as v } from "./index-4GKCU9I7.js";
2
- import { mapStores as N } from "pinia";
3
- let c = 7, r = 5;
4
- const R = [
5
- {
6
- id: "UBERON:0000948",
7
- name: "heart",
8
- showAtZoom: 1
9
- },
10
- {
11
- id: "UBERON:0001759",
12
- name: "vagus nerve",
13
- showAtZoom: 1
14
- },
15
- {
16
- id: "UBERON:0001155",
17
- name: "colon",
18
- showAtZoom: 1
19
- },
20
- {
21
- id: "UBERON:0000945",
22
- name: "stomach",
23
- showAtZoom: 1
24
- },
25
- {
26
- id: "UBERON:0001013",
27
- name: "adipose tissue",
28
- showAtZoom: 1
29
- },
30
- {
31
- id: "UBERON:0001255",
32
- name: "urinary bladder",
33
- showAtZoom: 1
34
- },
35
- {
36
- id: "UBERON:0001348",
37
- name: "brown adipose tissue",
38
- showAtZoom: 6
39
- },
40
- {
41
- id: "UBERON:0002008",
42
- name: "cardiac nerve plexus",
43
- showAtZoom: 1
44
- },
45
- {
46
- id: "UBERON:0002240",
47
- name: "spinal cord",
48
- showAtZoom: 1
49
- },
50
- {
51
- id: "UBERON:0002005",
52
- name: "Enteric Nervous System",
53
- showAtZoom: 4
54
- },
55
- {
56
- id: "UBERON:0013702",
57
- name: "body proper",
58
- showAtZoom: 1
59
- },
60
- {
61
- id: "UBERON:0002298",
62
- name: "brainstem",
63
- showAtZoom: 1
64
- },
65
- {
66
- id: "UBERON:0002439",
67
- name: "myenteric nerve plexus",
68
- showAtZoom: 6
69
- },
70
- {
71
- id: "UBERON:0000010",
72
- name: "peripheral nervous system",
73
- showAtZoom: 6
74
- },
75
- {
76
- id: "UBERON:0002048",
77
- name: "lung",
78
- showAtZoom: 1
79
- },
80
- {
81
- id: "UBERON:0002410",
82
- name: "autonomic nervous system",
83
- showAtZoom: 6
84
- },
85
- {
86
- id: "UBERON:0002441",
87
- name: "cervicothoracic ganglion",
88
- showAtZoom: 6
89
- },
90
- {
91
- id: "UBERON:0005363",
92
- name: "inferior vagus X ganglion",
93
- showAtZoom: 6
94
- },
95
- {
96
- id: "UBERON:0001264",
97
- name: "pancreas",
98
- showAtZoom: 1
99
- },
100
- {
101
- id: "UBERON:0001884",
102
- name: "phrenic nerve",
103
- showAtZoom: 6
104
- },
105
- {
106
- id: "UBERON:0002059",
107
- name: "submandibular ganglion",
108
- showAtZoom: 7
109
- },
110
- {
111
- id: "UBERON:0001347",
112
- name: "white adipose tissue",
113
- showAtZoom: 6
114
- },
115
- {
116
- id: "UBERON:0001556",
117
- name: "lower urinary tract",
118
- showAtZoom: 1
119
- },
120
- {
121
- id: "UBERON:0002262",
122
- name: "celiac ganglion",
123
- showAtZoom: 5
124
- },
125
- {
126
- id: "UBERON:0000955",
127
- name: "Brain",
128
- showAtZoom: 1
129
- },
130
- {
131
- id: "UBERON:0000160",
132
- name: "intestine",
133
- showAtZoom: 1
134
- },
135
- {
136
- id: "UBERON:0001322",
137
- name: "sciatic nerve",
138
- showAtZoom: 1
139
- },
140
- {
141
- id: "UBERON:0001649",
142
- name: "glossopharyngeal nerve",
143
- showAtZoom: 6
144
- },
145
- {
146
- id: "UBERON:0002063",
147
- name: "sinus venosus",
148
- showAtZoom: 6
149
- },
150
- {
151
- id: "UBERON:0002107",
152
- name: "liver",
153
- showAtZoom: 1
154
- },
155
- {
156
- id: "UBERON:0002113",
157
- name: "kidney",
158
- showAtZoom: 1
159
- },
160
- {
161
- id: "UBERON:0002481",
162
- name: "bone tissue",
163
- showAtZoom: 1
164
- },
165
- {
166
- id: "UBERON:0004907",
167
- name: "lower digestive tract",
168
- showAtZoom: 4
169
- },
170
- {
171
- id: "UBERON:0000044",
172
- name: "Dorsal root ganglion",
173
- showAtZoom: 5
174
- },
175
- // New levels from Keeran
176
- {
177
- id: "UBERON:0001736",
178
- name: "Submandibular gland",
179
- showAtZoom: c,
180
- keyword: !0
181
- },
182
- {
183
- id: "UBERON:0001103",
184
- name: "Diaphragm",
185
- showAtZoom: r,
186
- keyword: !0
187
- },
188
- {
189
- id: "UBERON:0001160",
190
- name: "Fundus of stomach",
191
- showAtZoom: r,
192
- keyword: !0
193
- },
194
- {
195
- id: "UBERON:0000955",
196
- name: "Brain",
197
- showAtZoom: r,
198
- keyword: !0
199
- },
200
- {
201
- id: "UBERON:0003708",
202
- name: "Carotid sinus",
203
- showAtZoom: c,
204
- keyword: !0
205
- },
206
- {
207
- id: "UBERON:0002079",
208
- name: "Left cardiac atrium",
209
- showAtZoom: r,
210
- keyword: !0
211
- },
212
- {
213
- id: "ILX:0485722",
214
- name: "Nodose ganglion",
215
- showAtZoom: c,
216
- keyword: !0
217
- },
218
- {
219
- id: "UBERON:0002078",
220
- name: "Right cardiac atrium",
221
- showAtZoom: r,
222
- keyword: !0
223
- },
224
- {
225
- id: "UBERON:0002084",
226
- name: "Heart left ventricle",
227
- showAtZoom: r,
228
- keyword: !0
229
- },
230
- {
231
- id: "UBERON:0002080",
232
- name: "Heart right ventricle",
233
- showAtZoom: r,
234
- keyword: !0
235
- },
236
- {
237
- id: "UBERON:0001508",
238
- name: "Arch of Aorta",
239
- showAtZoom: r,
240
- keyword: !0
241
- },
242
- {
243
- id: "UBERON:0001738",
244
- name: "Thyroid cartilage",
245
- showAtZoom: r,
246
- keyword: !0
247
- },
248
- {
249
- id: "UBERON:0000388",
250
- name: "Epiglottis",
251
- showAtZoom: r,
252
- keyword: !0
253
- }
254
- ];
255
- function E(e) {
256
- return e[0].toUpperCase() + e.substring(1);
257
- }
258
- const U = {
259
- emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
260
- props: {
261
- /**
262
- * Object containing information for
263
- * the required viewing.
264
- */
265
- entry: Object,
266
- visible: {
267
- type: Boolean,
268
- default: !0
269
- },
270
- mouseHovered: {
271
- type: Boolean,
272
- default: !1
273
- }
274
- },
275
- computed: {
276
- ...N(g, y),
277
- idNamePair() {
278
- return this.splitFlowStore.idNamePair;
279
- },
280
- syncMode() {
281
- return this.splitFlowStore.syncMode;
282
- },
283
- useHelpModeDialog() {
284
- return this.settingsStore.useHelpModeDialog;
285
- },
286
- connectivityInfoSidebar() {
287
- return this.settingsStore.connectivityInfoSidebar;
288
- }
289
- },
290
- mounted: function() {
291
- l.on("startHelp", () => {
292
- this.startHelp();
293
- }), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold;
294
- },
295
- methods: {
296
- toggleSyncMode: function() {
297
- },
298
- getState: function() {
299
- },
300
- openMap: function(e) {
301
- e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (l.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`)), this.onConnectivityInfoClose();
302
- },
303
- trackOpenMap: function(e) {
304
- w.sendEvent({
305
- event: "interaction_event",
306
- event_name: "portal_maps_open_map",
307
- category: e,
308
- location: "open_new_map"
309
- });
310
- },
311
- updateWithViewUrl: function() {
312
- },
313
- /**
314
- * Perform a local search on this contentvuer
315
- */
316
- search: function() {
317
- return !1;
318
- },
319
- /**
320
- * Get a list of search suggestions on this contentvuer
321
- */
322
- searchSuggestions: function() {
323
- },
324
- getMarkerClickedACtion: function(e) {
325
- let t = this.idNamePair[e.feature.models], i = R.filter(
326
- (o) => o.id === e.feature.models
327
- );
328
- return this.settingsStore.isFeaturedMarkerIdentifier(e.feature.id) ? {
329
- type: "Search",
330
- term: this.settingsStore.featuredMarkerDoi(
331
- e.feature.id
332
- ),
333
- featuredDataset: !0
334
- } : i.filter((o) => o.keyword).length > 0 ? {
335
- type: "Search",
336
- term: "http://purl.obolibrary.org/obo/" + e.feature.models.replace(":", "_")
337
- } : {
338
- type: "Facet",
339
- facet: t,
340
- facetPropPath: "anatomy.organ.category.name",
341
- term: "Anatomical structure"
342
- };
343
- },
344
- /**
345
- * Callback when the vuers emit a selected event.
346
- */
347
- resourceSelected: function(e, t, i) {
348
- var f, d, m, u;
349
- if (this.resourceHasAction(t)) {
350
- l.emit("PopoverActionClick", t);
351
- return;
352
- }
353
- let o, s = "none", n = !1;
354
- const a = {
355
- paneIndex: this.entry.id,
356
- type: e,
357
- resource: t,
358
- internalName: void 0,
359
- eventType: void 0
360
- };
361
- if (e == "MultiFlatmap" || e == "Flatmap") {
362
- const h = this.getFlatmapImp();
363
- a.internalName = this.idNamePair[t.feature.models], t.eventType == "click" ? (a.eventType = "selected", t.feature.type == "marker" ? (o = this.getMarkerClickedACtion(t), n = !0, e == "MultiFlatmap" && h.clearSearchResults()) : t.feature.type == "feature" && (h.options && h.options.style === "functional" && (f = t.feature) != null && f.label && (o = {
364
- filter: {
365
- facet: "PMR",
366
- term: "Data type",
367
- facetPropPath: "item.types.name"
368
- },
369
- type: "Search",
370
- term: t.feature.label
371
- }), this.syncMode ? n = !0 : s = "scaffold")) : t.eventType == "mouseenter" && (a.eventType = "highlighted", n = !0);
372
- } else
373
- e == "Scaffold" && (t && t[0] && ((((d = t[0].data) == null ? void 0 : d.id) === void 0 || ((m = t[0].data) == null ? void 0 : m.id) === "") && (t[0].data.id = (u = t[0].data) == null ? void 0 : u.group), a.internalName = t[0].data.id, t[0].data.lastActionOnMarker === !0 && (o = {
374
- type: "Facet",
375
- facet: E(t[0].data.id),
376
- facetPropPath: "anatomy.organ.category.name",
377
- term: "Anatomical structure"
378
- })), a.eventType = "selected", n = !0, s = "search");
379
- o === void 0 && i && (o = A(a, s)), o && l.emit("PopoverActionClick", o), n && this.$emit("resource-selected", a);
380
- },
381
- resourceHasAction: function(e) {
382
- return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
383
- },
384
- /**
385
- * Check if this viewer is currently visible
386
- */
387
- isVisible: function() {
388
- return this.splitFlowStore.getPaneNameById(this.entry.id) !== void 0;
389
- },
390
- displayTooltip: function() {
391
- },
392
- /**
393
- * Get the term to zoom/highlight in a synchronisation event,
394
- * if it cannot be found in the map, it will perform several
395
- * calls to try to ge a valid name/id.
396
- */
397
- getNameAndIdFromSyncData: async function(e) {
398
- let t = e.internalName;
399
- t === void 0 && e.resource && (t = e.resource.label);
400
- let i;
401
- if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
402
- if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
403
- if (e.resource && e.resource.feature) {
404
- const n = p(e.resource.feature.models);
405
- if (n.length > 0)
406
- return n;
407
- }
408
- let s = v(t);
409
- if (s)
410
- return s;
411
- if (i && e.eventType === "selected")
412
- return fetch(`${this.apiLocation}get-related-terms/${i}`).then((n) => n.json()).then((n) => {
413
- if (n.uberon.array.length > 0)
414
- return t = n.uberon.array[0].name.charAt(0).toUpperCase() + n.uberon.array[0].name.slice(1), i = n.uberon.array[0].id.toUpperCase(), { id: i, name: t };
415
- });
416
- }
417
- } else if (this.entry.type === "MultiFlatmap")
418
- if (t === "Bladder")
419
- t = "Urinary Bladder";
420
- else {
421
- const o = p(t);
422
- o.length > 0 && (t = o[0]);
423
- }
424
- return { id: i, name: t };
425
- },
426
- // Get the species and andaotmy info for the featured datasets
427
- getDatasetAnatomyInfo: function(e) {
428
- fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
429
- const i = t.result[0];
430
- let o;
431
- try {
432
- o = i.anatomy.organ[0].curie;
433
- } catch {
434
- o = void 0;
435
- }
436
- let s;
437
- try {
438
- s = i.item.curie;
439
- } catch {
440
- s = void 0;
441
- }
442
- let n;
443
- try {
444
- let a = 0, f = !1;
445
- for (; !f && a < i.organisms.subject.length; ) {
446
- const d = i.organisms.subject[a];
447
- d.species && (n = d.species.name, f = !0), a += 1;
448
- }
449
- } catch {
450
- n = void 0;
451
- }
452
- this.settingsStore.updateFeaturedMarker({
453
- identifier: e,
454
- marker: o,
455
- doi: s,
456
- species: n
457
- });
458
- });
459
- },
460
- // Check if the old featured dataset api has any info
461
- oldFeaturedDatasetApiHasInfo: async function() {
462
- let t = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
463
- return !t.identifiers || t.identifiers.length == 0 ? !1 : t.identifiers;
464
- },
465
- // Check if the new featured dataset api has any info
466
- newFeaturedDatasetApiHasInfo: async function() {
467
- let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
468
- return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
469
- },
470
- /**
471
- * Get a list of featured datasets to display.
472
- */
473
- getFeaturedDatasets: async function() {
474
- let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
475
- if (t)
476
- e = t;
477
- else {
478
- let i = await this.newFeaturedDatasetApiHasInfo();
479
- i && (e = i);
480
- }
481
- this.settingsStore.updateFeatured(e), e.forEach((i) => {
482
- this.getDatasetAnatomyInfo(i);
483
- });
484
- },
485
- zoomToFeatures: function() {
486
- },
487
- handleSyncMouseEvent: async function(e) {
488
- let t = await this.getNameAndIdFromSyncData(e);
489
- e.eventType === "highlighted" ? this.highlightFeatures(t) : e.eventType === "selected" && this.displayTooltip(t);
490
- },
491
- /**
492
- * Handle sync pan zoom event
493
- */
494
- handleSyncPanZoomEvent: function() {
495
- },
496
- highlightFeatures: function() {
497
- },
498
- receiveSynchronisedEvent: async function(e) {
499
- if (e.paneIndex !== this.entry.id)
500
- e.eventType == "panZoom" || this.handleSyncMouseEvent(e);
501
- else if (e.eventType == "selected") {
502
- let t = await this.getNameAndIdFromSyncData(e);
503
- this.zoomToFeatures(t, !1);
504
- }
505
- },
506
- requestSynchronisedEvent: function() {
507
- },
508
- flatmapMarkerUpdate() {
509
- },
510
- onResize: function() {
511
- },
512
- startHelp: function() {
513
- this.isInHelp === !1 && (this.helpMode = !0, window.addEventListener("mousedown", this.checkEndHelpMouseDown), this.isInHelp = !0);
514
- },
515
- endHelp: function() {
516
- window.removeEventListener("mousedown", this.checkEndHelpMouseDown), this.helpMode = !1, setTimeout(() => {
517
- this.isInHelp = !1;
518
- }, 200);
519
- },
520
- onHelpModeShowNext: function() {
521
- this.helpModeActiveItem += 1;
522
- },
523
- onHelpModeLastItem: function(e) {
524
- e && (this.helpModeLastItem = !0);
525
- },
526
- onFinishHelpMode: function() {
527
- this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
528
- },
529
- onTooltipShown: function() {
530
- 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();
531
- },
532
- onMapTooltipShown: function() {
533
- 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();
534
- },
535
- /**
536
- * End help-mode only if user clicks outside of help mode dialog.
537
- */
538
- checkEndHelpMouseDown: function(e) {
539
- e.target.closest(".help-mode-dialog") || this.endHelp();
540
- },
541
- mapHoverHighlight: function(e) {
542
- if (this.visible) {
543
- const t = this.settingsStore.hoverAnatomies, i = this.settingsStore.hoverOrgans;
544
- t.length || i.length ? (clearTimeout(this.hoverDelay), this.multiflatmapRef || this.flatmapRef ? e == null || e.zoomToFeatures(t, { noZoomIn: !0 }) : this.scaffoldRef && (e == null || e.changeHighlightedByName(i, "", !1))) : this.hoverDelay = setTimeout(() => {
545
- this.multiflatmapRef || this.flatmapRef ? e == null || e.clearSearchResults() : this.scaffoldRef && (e == null || e.changeHighlightedByName(i, "", !1));
546
- }, 500);
547
- }
548
- },
549
- onConnectivityInfoOpen: function(e) {
550
- l.emit("connectivity-info-open", e);
551
- },
552
- onConnectivityInfoClose: function() {
553
- l.emit("connectivity-info-close");
554
- }
555
- },
556
- data: function() {
557
- return {
558
- apiLocation: void 0,
559
- activeSpecies: "Rat",
560
- scaffoldCamera: void 0,
561
- mainStyle: {
562
- height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
563
- width: "100%",
564
- bottom: "0px"
565
- },
566
- helpMode: !1,
567
- helpModeActiveItem: 0,
568
- helpModeLastItem: !1,
569
- multiflatmapRef: null,
570
- flatmapRef: null,
571
- scaffoldRef: null,
572
- scaffoldLoaded: !1,
573
- isInHelp: !1,
574
- hoverDelay: void 0
575
- };
576
- },
577
- created: function() {
578
- this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi);
579
- },
580
- watch: {
581
- helpMode: function(e) {
582
- e || (this.helpModeActiveItem = 0);
583
- }
584
- }
585
- };
586
- export {
587
- U as C
588
- };