@abi-software/mapintegratedvuer 1.9.1 → 1.9.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.
- package/dist/{ContentMixin-c9DvlJVP.js → ContentMixin-DO6jlHIh.js} +161 -194
- package/dist/{Flatmap-D66Ygegj.js → Flatmap-CY9MPW7I.js} +43 -45
- package/dist/{Iframe-DFAzMMSw.js → Iframe-XTSWvVQw.js} +2 -2
- package/dist/{MultiFlatmap-BOOSKitQ.js → MultiFlatmap-B7e2d6WK.js} +6 -11
- package/dist/{Plot-DPxSQnwg.js → Plot-D3lEgm6I.js} +2 -2
- package/dist/{Scaffold-DRQEE-j_.js → Scaffold-2Zg19azr.js} +2 -2
- package/dist/{Simulation-BVcaSVmW.js → Simulation-CrPJ4_pw.js} +2 -2
- package/dist/{index-qckfB1dl.js → index-BcpVBq1h.js} +177 -121
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +10 -10
- package/dist/{style-C6pIyWak.js → style-CIceSTeY.js} +4 -4
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/components/SplitDialog.vue +95 -1
- package/src/components/SplitFlow.vue +12 -2
- package/src/components/viewers/Flatmap.vue +1 -6
- package/src/components/viewers/MultiFlatmap.vue +0 -8
- package/src/mixins/ContentMixin.js +0 -50
@@ -1,17 +1,17 @@
|
|
1
|
-
import { markRaw as
|
2
|
-
import { u as b, p as
|
3
|
-
import { mapStores as
|
1
|
+
import { markRaw as v } from "vue";
|
2
|
+
import { u as b, p as M, q as A, E as f, T as C, r as S, s as F, v as $, x as H } from "./index-BcpVBq1h.js";
|
3
|
+
import { mapStores as I } from "pinia";
|
4
4
|
const d = function(e) {
|
5
5
|
return e ? [...new Set(e.map((t) => JSON.stringify(t)))].map(
|
6
6
|
(t) => JSON.parse(t)
|
7
7
|
) : [];
|
8
|
-
}, g = [],
|
9
|
-
const
|
8
|
+
}, g = [], w = async function(e, t) {
|
9
|
+
const n = t.filter(
|
10
10
|
(s) => g.some((a) => a.taxon === s)
|
11
|
-
),
|
12
|
-
(s) =>
|
11
|
+
), i = g.filter(
|
12
|
+
(s) => n.includes(s.taxon)
|
13
13
|
), o = t.filter(
|
14
|
-
(s) => !
|
14
|
+
(s) => !n.includes(s)
|
15
15
|
);
|
16
16
|
if (o.length) {
|
17
17
|
const s = await e.queryLabels(o);
|
@@ -20,32 +20,32 @@ const d = function(e) {
|
|
20
20
|
let { entity: r, label: l } = a;
|
21
21
|
l === "Mammalia" && (l = "Mammalia not otherwise specified");
|
22
22
|
const c = { taxon: r, label: l };
|
23
|
-
|
24
|
-
}),
|
23
|
+
i.push(c), g.push(c);
|
24
|
+
}), i;
|
25
25
|
} else
|
26
|
-
return
|
26
|
+
return i;
|
27
27
|
}, y = function(e, t) {
|
28
28
|
if (!e || !t) return !1;
|
29
|
-
let
|
30
|
-
return
|
29
|
+
let n = JSON.stringify(e), i = JSON.stringify(t);
|
30
|
+
return n.indexOf(i) !== -1;
|
31
31
|
}, p = (e, t) => {
|
32
|
-
const
|
32
|
+
const n = e.name ?? e, i = t.name ?? t, o = n.toUpperCase(), s = i.toUpperCase();
|
33
33
|
return o < s ? -1 : o > s ? 1 : 0;
|
34
34
|
};
|
35
35
|
let N = function() {
|
36
36
|
this.initialise = function(e) {
|
37
37
|
this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
|
38
38
|
}, this.createTooltipData = async function(e, t) {
|
39
|
-
let
|
40
|
-
t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ?
|
41
|
-
let
|
39
|
+
let n = [];
|
40
|
+
t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? n = t.feature.hyperlinks : n = this.rawURLs;
|
41
|
+
let i;
|
42
42
|
if (t.provenanceTaxonomy) {
|
43
|
-
|
43
|
+
i = [];
|
44
44
|
try {
|
45
|
-
const s = await
|
45
|
+
const s = await w(e, t.provenanceTaxonomy);
|
46
46
|
s.length && s.forEach((a) => {
|
47
47
|
const { label: r } = a;
|
48
|
-
|
48
|
+
i.push(r);
|
49
49
|
});
|
50
50
|
} catch (s) {
|
51
51
|
console.log(s);
|
@@ -60,9 +60,9 @@ let N = function() {
|
|
60
60
|
componentsWithDatasets: this.componentsWithDatasets,
|
61
61
|
title: t.label,
|
62
62
|
featureId: t.resource,
|
63
|
-
hyperlinks:
|
63
|
+
hyperlinks: n,
|
64
64
|
provenanceTaxonomy: t.provenanceTaxonomy,
|
65
|
-
provenanceTaxonomyLabel:
|
65
|
+
provenanceTaxonomyLabel: i,
|
66
66
|
connectivitySource: this.connectivitySource
|
67
67
|
};
|
68
68
|
}, this.updateTooltipData = function(e) {
|
@@ -77,66 +77,66 @@ let N = function() {
|
|
77
77
|
connectivitySource: this.connectivitySource
|
78
78
|
};
|
79
79
|
}, this.createComponentsLabelList = function(e, t) {
|
80
|
-
let
|
81
|
-
return e.forEach((
|
82
|
-
|
83
|
-
}),
|
80
|
+
let n = [];
|
81
|
+
return e.forEach((i) => {
|
82
|
+
n.push(this.createLabelFromNeuralNode(i[0]), t), i.length === 2 && n.push(this.createLabelFromNeuralNode(i[1]), t);
|
83
|
+
}), n;
|
84
84
|
}, this.createLabelLookup = function(e, t) {
|
85
|
-
return new Promise(async (
|
86
|
-
let
|
85
|
+
return new Promise(async (n) => {
|
86
|
+
let i = {};
|
87
87
|
this.uberons = [];
|
88
|
-
const o = await
|
88
|
+
const o = await w(e, t);
|
89
89
|
o.length && (o.forEach((s) => {
|
90
90
|
const { taxon: a, label: r } = s;
|
91
|
-
|
91
|
+
i[a] = r, this.uberons.push({
|
92
92
|
id: a,
|
93
93
|
name: r
|
94
94
|
});
|
95
|
-
}), i
|
95
|
+
}), n(i));
|
96
96
|
});
|
97
97
|
}, this.buildConnectivitySqlStatement = function(e) {
|
98
98
|
let t = "select knowledge from knowledge where entity in (";
|
99
99
|
if (e.length === 1)
|
100
100
|
t += `'${e[0]}')`;
|
101
101
|
else if (e.length > 1)
|
102
|
-
for (let
|
103
|
-
t += `'${e[
|
102
|
+
for (let n in e)
|
103
|
+
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
|
104
104
|
return t;
|
105
105
|
}, this.buildLabelSqlStatement = function(e) {
|
106
106
|
let t = "select entity, label from labels where entity in (";
|
107
107
|
if (e.length === 1)
|
108
108
|
t += `'${e[0]}')`;
|
109
109
|
else if (e.length > 1)
|
110
|
-
for (let
|
111
|
-
t += `'${e[
|
110
|
+
for (let n in e)
|
111
|
+
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
|
112
112
|
return t;
|
113
113
|
}, this.findAllIdsFromConnectivity = function(e) {
|
114
|
-
let t = e.connectivity.flat(),
|
115
|
-
return
|
116
|
-
Array.isArray(o) ?
|
117
|
-
}), [...new Set(
|
114
|
+
let t = e.connectivity.flat(), n = [...new Set(t)], i = [];
|
115
|
+
return n.forEach((o) => {
|
116
|
+
Array.isArray(o) ? i.push(o.flat()) : i.push(o);
|
117
|
+
}), [...new Set(i.flat())];
|
118
118
|
}, this.flattenConnectivity = function(e) {
|
119
|
-
let t = e.flat(),
|
120
|
-
return
|
121
|
-
Array.isArray(o) ?
|
122
|
-
}),
|
123
|
-
}, this.findComponents = function(e, t,
|
119
|
+
let t = e.flat(), n = [...new Set(t)], i = [];
|
120
|
+
return n.forEach((o) => {
|
121
|
+
Array.isArray(o) ? i.push(o.flat()) : i.push(o);
|
122
|
+
}), i.flat();
|
123
|
+
}, this.findComponents = function(e, t, n, i) {
|
124
124
|
let o = e.connectivity.flat(), s = d(o), a = [], r = !1;
|
125
125
|
return s.forEach((l) => {
|
126
|
-
r = !1, y(t, l) && (r = !0),
|
126
|
+
r = !1, y(t, l) && (r = !0), i && y(i, l) && (r = !0), y(n, l) && (r = !0), r || a.push(l);
|
127
127
|
}), a;
|
128
128
|
}, this.retrieveFlatmapKnowledgeForEvent = async function(e, t) {
|
129
129
|
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
|
130
|
-
const
|
131
|
-
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !
|
132
|
-
let
|
133
|
-
return await Promise.all([
|
134
|
-
}, this.queryForConnectivityNew = function(e, t,
|
135
|
-
return this.connectivitySource =
|
136
|
-
(
|
130
|
+
const n = t.resource;
|
131
|
+
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !n || n.length === 0 || !n[0]) return;
|
132
|
+
let i = this.queryForConnectivityNew(e, n[0]);
|
133
|
+
return await Promise.all([i]);
|
134
|
+
}, this.queryForConnectivityNew = function(e, t, n = "sckan", i = !0) {
|
135
|
+
return this.connectivitySource = n, new Promise((o) => {
|
136
|
+
(n === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
|
137
137
|
if (this.checkConnectivityExists(a)) {
|
138
138
|
let r = a;
|
139
|
-
|
139
|
+
i ? this.processConnectivity(e, r).then((l) => {
|
140
140
|
a.references && (this.rawURLs = [...a.references]), o(l);
|
141
141
|
}) : o(r);
|
142
142
|
} else
|
@@ -146,40 +146,40 @@ let N = function() {
|
|
146
146
|
});
|
147
147
|
});
|
148
148
|
}, this.queryMapConnectivity = async function(e, t) {
|
149
|
-
const
|
150
|
-
try {
|
151
|
-
const n = await fetch(i);
|
152
|
-
if (!n.ok)
|
153
|
-
throw new Error(`Response status: ${n.status}`);
|
154
|
-
return await n.json();
|
155
|
-
} catch (n) {
|
156
|
-
throw new Error(n);
|
157
|
-
}
|
158
|
-
}, this.queryMapPaths = async function(e) {
|
159
|
-
const t = this.flatmapAPI + `flatmap/${e}/pathways`;
|
149
|
+
const n = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
|
160
150
|
try {
|
161
|
-
const i = await fetch(
|
151
|
+
const i = await fetch(n);
|
162
152
|
if (!i.ok)
|
163
153
|
throw new Error(`Response status: ${i.status}`);
|
164
154
|
return await i.json();
|
165
155
|
} catch (i) {
|
166
156
|
throw new Error(i);
|
167
157
|
}
|
168
|
-
}, this.
|
158
|
+
}, this.queryMapPaths = async function(e) {
|
159
|
+
const t = this.flatmapAPI + `flatmap/${e}/pathways`;
|
160
|
+
try {
|
161
|
+
const n = await fetch(t);
|
162
|
+
if (!n.ok)
|
163
|
+
throw new Error(`Response status: ${n.status}`);
|
164
|
+
return await n.json();
|
165
|
+
} catch (n) {
|
166
|
+
throw new Error(n);
|
167
|
+
}
|
168
|
+
}, this.queryForConnectivity = function(e, t, n, i = !0) {
|
169
169
|
const o = { sql: this.buildConnectivitySqlStatement(t) }, s = {
|
170
170
|
method: "POST",
|
171
171
|
headers: {
|
172
172
|
"Content-Type": "application/json"
|
173
173
|
},
|
174
174
|
body: JSON.stringify(o),
|
175
|
-
...
|
175
|
+
...n ? { signal: n } : {}
|
176
176
|
// add signal to header if it exists
|
177
177
|
};
|
178
178
|
return new Promise((a) => {
|
179
179
|
fetch(`${this.flatmapAPI}knowledge/query/`, s).then((r) => r.json()).then((r) => {
|
180
180
|
if (this.connectivityExists(r)) {
|
181
181
|
let l = JSON.parse(r.values[0][0]);
|
182
|
-
|
182
|
+
i ? this.processConnectivity(e, l).then((c) => {
|
183
183
|
a(c);
|
184
184
|
}) : a(l);
|
185
185
|
} else
|
@@ -196,45 +196,45 @@ let N = function() {
|
|
196
196
|
}, this.findIfNodeIsSingle = function(e) {
|
197
197
|
return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
|
198
198
|
}, this.createLabelFromNeuralNode = function(e, t) {
|
199
|
-
let
|
200
|
-
if (
|
201
|
-
return t[
|
202
|
-
let
|
199
|
+
let n = this.findIfNodeIsSingle(e);
|
200
|
+
if (n)
|
201
|
+
return t[n];
|
202
|
+
let i = t[e[0]];
|
203
203
|
return e.length === 2 && e[1].length > 0 && e[1].forEach((o) => {
|
204
|
-
t[o] == null ?
|
205
|
-
}),
|
206
|
-
}, this.flattenAndFindDatasets = function(e, t,
|
207
|
-
let
|
204
|
+
t[o] == null ? i += `, ${o}` : i += `, ${t[o]}`;
|
205
|
+
}), i;
|
206
|
+
}, this.flattenAndFindDatasets = function(e, t, n) {
|
207
|
+
let i = this.flattenConnectivity(e), o = this.flattenConnectivity(t), s = this.flattenConnectivity(n);
|
208
208
|
this.originsWithDatasets = this.uberons.filter(
|
209
|
-
(a) =>
|
209
|
+
(a) => i.indexOf(a.id) !== -1
|
210
210
|
).sort(p), this.componentsWithDatasets = this.uberons.filter(
|
211
211
|
(a) => o.indexOf(a.id) !== -1
|
212
212
|
).sort(p), this.destinationsWithDatasets = this.uberons.filter(
|
213
213
|
(a) => s.indexOf(a.id) !== -1
|
214
214
|
).sort(p);
|
215
215
|
}, this.processConnectivity = function(e, t) {
|
216
|
-
return new Promise((
|
217
|
-
let
|
216
|
+
return new Promise((n) => {
|
217
|
+
let i = [], o = [], s;
|
218
218
|
if (t && t["node-phenotypes"]) {
|
219
219
|
const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
220
|
-
l.forEach((
|
221
|
-
|
222
|
-
}),
|
223
|
-
o.push(...t["node-phenotypes"][
|
220
|
+
l.forEach((h) => {
|
221
|
+
i.push(...t["node-phenotypes"][h]);
|
222
|
+
}), i = d(i), c.forEach((h) => {
|
223
|
+
o.push(...t["node-phenotypes"][h]);
|
224
224
|
}), o = d(o);
|
225
225
|
} else
|
226
|
-
o = d(t.axons), t.somas && t.somas.length > 0 &&
|
227
|
-
const a = this.findComponents(t, o,
|
226
|
+
o = d(t.axons), t.somas && t.somas.length > 0 && i.push(...t.somas), t.dendrites && t.dendrites.length > 0 && i.push(...t.dendrites), i = d(i), s = t.somas;
|
227
|
+
const a = this.findComponents(t, o, i, s), r = this.findAllIdsFromConnectivity(t);
|
228
228
|
this.createLabelLookup(e, r).then((l) => {
|
229
|
-
this.origins =
|
229
|
+
this.origins = i.map(
|
230
230
|
(c) => this.createLabelFromNeuralNode(c, l)
|
231
231
|
).sort(p), this.components = a.map(
|
232
232
|
(c) => this.createLabelFromNeuralNode(c, l)
|
233
233
|
).sort(p), this.destinations = o.map(
|
234
234
|
(c) => this.createLabelFromNeuralNode(c, l)
|
235
|
-
).sort(p), this.flattenAndFindDatasets(
|
235
|
+
).sort(p), this.flattenAndFindDatasets(i, a, o), n({
|
236
236
|
ids: {
|
237
|
-
dendrites:
|
237
|
+
dendrites: i,
|
238
238
|
components: a,
|
239
239
|
axons: o
|
240
240
|
},
|
@@ -251,8 +251,8 @@ let N = function() {
|
|
251
251
|
if (e.length === 1)
|
252
252
|
t += `'${e[0]}')`;
|
253
253
|
else if (e.length > 1)
|
254
|
-
for (let
|
255
|
-
t += `'${e[
|
254
|
+
for (let n in e)
|
255
|
+
t += `'${e[n]}'${n >= e.length - 1 ? ")" : ","} `;
|
256
256
|
return t;
|
257
257
|
}, this.buildPubmedSqlStatementForModels = function(e) {
|
258
258
|
return `select distinct publication from publications where entity = '${e}'`;
|
@@ -264,8 +264,8 @@ let N = function() {
|
|
264
264
|
"Content-Type": "application/json"
|
265
265
|
},
|
266
266
|
body: JSON.stringify(t)
|
267
|
-
}).then((
|
268
|
-
console.error("Error:",
|
267
|
+
}).then((n) => n.json()).catch((n) => {
|
268
|
+
console.error("Error:", n);
|
269
269
|
});
|
270
270
|
};
|
271
271
|
};
|
@@ -290,7 +290,7 @@ const D = {
|
|
290
290
|
}
|
291
291
|
},
|
292
292
|
computed: {
|
293
|
-
...
|
293
|
+
...I(b, M, A),
|
294
294
|
idNamePair() {
|
295
295
|
return this.splitFlowStore.idNamePair;
|
296
296
|
},
|
@@ -308,7 +308,7 @@ const D = {
|
|
308
308
|
}
|
309
309
|
},
|
310
310
|
mounted: function() {
|
311
|
-
|
311
|
+
f.on("startHelp", () => {
|
312
312
|
this.startHelp();
|
313
313
|
}), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
|
314
314
|
},
|
@@ -318,13 +318,13 @@ const D = {
|
|
318
318
|
getState: function() {
|
319
319
|
},
|
320
320
|
openMap: function(e) {
|
321
|
-
e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (
|
321
|
+
e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (f.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`));
|
322
322
|
},
|
323
323
|
onMapmanagerLoaded: function(e) {
|
324
324
|
this.settingsStore.updateMapManager(e);
|
325
325
|
},
|
326
326
|
trackOpenMap: function(e) {
|
327
|
-
|
327
|
+
C.sendEvent({
|
328
328
|
event: "interaction_event",
|
329
329
|
event_name: "portal_maps_open_map",
|
330
330
|
category: e,
|
@@ -349,12 +349,12 @@ const D = {
|
|
349
349
|
*/
|
350
350
|
resourceSelected: function(e, t) {
|
351
351
|
var a, r, l, c;
|
352
|
-
const
|
353
|
-
if (this.resourceHasAction(
|
354
|
-
|
352
|
+
const n = t[0];
|
353
|
+
if (this.resourceHasAction(n)) {
|
354
|
+
f.emit("PopoverActionClick", n);
|
355
355
|
return;
|
356
356
|
}
|
357
|
-
let
|
357
|
+
let i, o = !1;
|
358
358
|
const s = {
|
359
359
|
paneIndex: this.entry.id,
|
360
360
|
type: e,
|
@@ -363,41 +363,41 @@ const D = {
|
|
363
363
|
eventType: void 0
|
364
364
|
};
|
365
365
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
366
|
-
if (s.internalName = (a =
|
367
|
-
if (s.eventType = "selected",
|
368
|
-
let
|
369
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
370
|
-
|
366
|
+
if (s.internalName = (a = n == null ? void 0 : n.feature) != null && a.label ? n.feature.label : this.idNamePair[n.feature.models], n.eventType == "click")
|
367
|
+
if (s.eventType = "selected", n.feature.type == "marker") {
|
368
|
+
let h = s.internalName;
|
369
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(n.feature.id))
|
370
|
+
i = {
|
371
371
|
type: "Search",
|
372
|
-
term: this.settingsStore.featuredMarkerDoi(
|
372
|
+
term: this.settingsStore.featuredMarkerDoi(n.feature.id),
|
373
373
|
featuredDataset: !0
|
374
374
|
};
|
375
375
|
else {
|
376
|
-
|
376
|
+
i = {
|
377
377
|
type: "Facet",
|
378
|
-
facet:
|
378
|
+
facet: h,
|
379
379
|
facetPropPath: "anatomy.organ.category.name",
|
380
380
|
facetSubPropPath: "anatomy.organ.name",
|
381
381
|
term: "Anatomical structure"
|
382
382
|
};
|
383
|
-
let
|
384
|
-
|
385
|
-
|
386
|
-
}),
|
383
|
+
let u = /* @__PURE__ */ new Set();
|
384
|
+
n.feature["marker-terms"].forEach((m) => {
|
385
|
+
u.add(m.label);
|
386
|
+
}), u.add(h), u.size > 0 && (i = {
|
387
387
|
type: "Facets",
|
388
|
-
labels: [...
|
388
|
+
labels: [...u]
|
389
389
|
});
|
390
390
|
}
|
391
391
|
o = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
392
|
-
} else
|
393
|
-
else
|
394
|
-
else e == "Scaffold" && (
|
392
|
+
} else n.feature.type == "feature" && this.syncMode && (o = !0);
|
393
|
+
else n.eventType == "mouseenter" && (s.eventType = "highlighted", o = !0);
|
394
|
+
else e == "Scaffold" && (n && ((((r = n.data) == null ? void 0 : r.id) === void 0 || ((l = n.data) == null ? void 0 : l.id) === "") && (n.data.id = (c = n.data) == null ? void 0 : c.group), s.internalName = n.data.id, n.data.lastActionOnMarker === !0 && (i = {
|
395
395
|
type: "Facet",
|
396
|
-
facet: P(
|
396
|
+
facet: P(n.data.id),
|
397
397
|
facetPropPath: "anatomy.organ.category.name",
|
398
398
|
term: "Anatomical structure"
|
399
399
|
})), s.eventType = "selected", o = !0);
|
400
|
-
|
400
|
+
i && f.emit("PopoverActionClick", i), o && this.$emit("resource-selected", s);
|
401
401
|
},
|
402
402
|
resourceHasAction: function(e) {
|
403
403
|
return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
|
@@ -418,8 +418,8 @@ const D = {
|
|
418
418
|
getNameAndIdFromSyncData: async function(e) {
|
419
419
|
let t = e.internalName;
|
420
420
|
t === void 0 && e.resource && (t = e.resource.label);
|
421
|
-
let
|
422
|
-
if (e.resource && e.resource.resource && (
|
421
|
+
let n;
|
422
|
+
if (e.resource && e.resource.resource && (n = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
423
423
|
if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
|
424
424
|
if (e.resource && e.resource.feature) {
|
425
425
|
const s = S(e.resource.feature.models);
|
@@ -428,43 +428,43 @@ const D = {
|
|
428
428
|
let o = F(t);
|
429
429
|
if (o)
|
430
430
|
return o;
|
431
|
-
if (
|
432
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
431
|
+
if (n && e.eventType === "selected")
|
432
|
+
return fetch(`${this.apiLocation}get-related-terms/${n}`).then((s) => s.json()).then((s) => {
|
433
433
|
var a;
|
434
434
|
if (((a = s.uberon) == null ? void 0 : a.array.length) > 0)
|
435
|
-
return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1),
|
435
|
+
return t = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), n = s.uberon.array[0].id.toUpperCase(), { id: n, name: t };
|
436
436
|
});
|
437
437
|
}
|
438
438
|
} else if (this.entry.type === "MultiFlatmap")
|
439
439
|
if (t === "Bladder")
|
440
440
|
t = "Urinary Bladder";
|
441
441
|
else {
|
442
|
-
const
|
443
|
-
|
442
|
+
const i = S(t);
|
443
|
+
i.length > 0 && (t = i[0]);
|
444
444
|
}
|
445
|
-
return { id:
|
445
|
+
return { id: n, name: t };
|
446
446
|
},
|
447
447
|
// Get the species and andaotmy info for the featured datasets
|
448
448
|
getDatasetAnatomyInfo: function(e) {
|
449
449
|
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
|
450
|
-
const
|
451
|
-
let
|
450
|
+
const n = t.result[0];
|
451
|
+
let i;
|
452
452
|
try {
|
453
|
-
|
453
|
+
i = n.anatomy.organ[0].curie;
|
454
454
|
} catch {
|
455
|
-
|
455
|
+
i = void 0;
|
456
456
|
}
|
457
457
|
let o;
|
458
458
|
try {
|
459
|
-
o =
|
459
|
+
o = n.item.curie;
|
460
460
|
} catch {
|
461
461
|
o = void 0;
|
462
462
|
}
|
463
463
|
let s;
|
464
464
|
try {
|
465
465
|
let a = 0, r = !1;
|
466
|
-
for (; !r && a <
|
467
|
-
const l =
|
466
|
+
for (; !r && a < n.organisms.subject.length; ) {
|
467
|
+
const l = n.organisms.subject[a];
|
468
468
|
l.species && (s = l.species.name, r = !0), a += 1;
|
469
469
|
}
|
470
470
|
} catch {
|
@@ -472,7 +472,7 @@ const D = {
|
|
472
472
|
}
|
473
473
|
this.settingsStore.updateFeaturedMarker({
|
474
474
|
identifier: e,
|
475
|
-
marker:
|
475
|
+
marker: i,
|
476
476
|
doi: o,
|
477
477
|
species: s
|
478
478
|
});
|
@@ -486,7 +486,7 @@ const D = {
|
|
486
486
|
// Check if the new featured dataset api has any info
|
487
487
|
newFeaturedDatasetApiHasInfo: async function() {
|
488
488
|
let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
489
|
-
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((
|
489
|
+
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((n) => n.id);
|
490
490
|
},
|
491
491
|
/**
|
492
492
|
* Get a list of featured datasets to display.
|
@@ -495,11 +495,11 @@ const D = {
|
|
495
495
|
let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
|
496
496
|
if (t) e = t;
|
497
497
|
else {
|
498
|
-
let
|
499
|
-
|
498
|
+
let n = await this.newFeaturedDatasetApiHasInfo();
|
499
|
+
n && (e = n);
|
500
500
|
}
|
501
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
502
|
-
this.getDatasetAnatomyInfo(
|
501
|
+
this.settingsStore.updateFeatured(e), e.forEach((n) => {
|
502
|
+
this.getDatasetAnatomyInfo(n);
|
503
503
|
});
|
504
504
|
},
|
505
505
|
zoomToFeatures: function() {
|
@@ -558,15 +558,15 @@ const D = {
|
|
558
558
|
checkEndHelpMouseDown: function(e) {
|
559
559
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
560
560
|
},
|
561
|
-
flatmapHighlight: async function(e, t,
|
562
|
-
let o = [...t, ...
|
561
|
+
flatmapHighlight: async function(e, t, n, i) {
|
562
|
+
let o = [...t, ...i];
|
563
563
|
const s = this.settingsStore.globalSettings;
|
564
564
|
if (s.highlightConnectedPaths) {
|
565
|
-
const a = t.length ? t :
|
565
|
+
const a = t.length ? t : i.length ? i : [], r = await e.retrieveConnectedPaths(a);
|
566
566
|
r && o.push(...r);
|
567
567
|
}
|
568
568
|
if (s.highlightDOIPaths) {
|
569
|
-
const a = await e.searchConnectivitiesByReference(
|
569
|
+
const a = await e.searchConnectivitiesByReference(n);
|
570
570
|
a && o.push(...a);
|
571
571
|
}
|
572
572
|
return o = [...new Set(o)], o;
|
@@ -574,87 +574,56 @@ const D = {
|
|
574
574
|
cardHoverHighlight: function() {
|
575
575
|
var e;
|
576
576
|
if (this.visible) {
|
577
|
-
const t = this.settingsStore.hoverAnatomies,
|
577
|
+
const t = this.settingsStore.hoverAnatomies, n = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, o = this.settingsStore.hoverConnectivity;
|
578
578
|
let s = null, a = null;
|
579
|
-
this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (a = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !
|
580
|
-
(t.length ||
|
579
|
+
this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (a = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !n.length && !i && !o.length && ((this.multiflatmapRef || this.flatmapRef) && s ? (e = s.mapImp) == null || e.clearSearchResults() : this.scaffoldRef && a && a.changeHighlightedByName(n, "", !1)), this.highlightDelay = setTimeout(() => {
|
580
|
+
(t.length || n.length || i || o.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, i, o).then((r) => {
|
581
581
|
try {
|
582
582
|
s.zoomToFeatures(r);
|
583
583
|
} catch (l) {
|
584
584
|
if (console.log(l), o.length && s.mapImp) {
|
585
585
|
const c = s.mapImp.uuid;
|
586
586
|
r.every(
|
587
|
-
(
|
588
|
-
(m) => m.id ===
|
587
|
+
(u) => this.connectivityKnowledge[c].some(
|
588
|
+
(m) => m.id === u
|
589
589
|
)
|
590
590
|
) || s.mapImp.clearSearchResults();
|
591
591
|
}
|
592
592
|
}
|
593
|
-
}) : this.scaffoldRef && a && a.changeHighlightedByName(
|
593
|
+
}) : this.scaffoldRef && a && a.changeHighlightedByName(n, "", !1));
|
594
594
|
}, 100);
|
595
595
|
}
|
596
596
|
},
|
597
597
|
onAnnotationOpen: function(e) {
|
598
|
-
|
598
|
+
f.emit("annotation-open", e);
|
599
599
|
},
|
600
600
|
onAnnotationClose: function() {
|
601
|
-
|
601
|
+
f.emit("annotation-close");
|
602
602
|
},
|
603
603
|
onConnectivityInfoOpen: function(e) {
|
604
|
-
|
604
|
+
f.emit("connectivity-info-open", e);
|
605
605
|
},
|
606
606
|
onConnectivityError: function(e) {
|
607
|
-
|
607
|
+
f.emit("connectivity-error", e);
|
608
608
|
},
|
609
609
|
onConnectivityInfoClose: function() {
|
610
|
-
|
610
|
+
f.emit("connectivity-info-close");
|
611
611
|
},
|
612
612
|
loadConnectivityKnowledge: async function(e) {
|
613
|
-
const t =
|
614
|
-
|
615
|
-
const
|
616
|
-
if (this.connectivityKnowledge[t] || (this.connectivityKnowledge[t] =
|
613
|
+
const t = $(e), n = v(new N());
|
614
|
+
n.initialise(this.flatmapAPI);
|
615
|
+
const i = await H(e, n), o = e.uuid;
|
616
|
+
if (this.connectivityKnowledge[t] || (this.connectivityKnowledge[t] = i.filter((s) => {
|
617
617
|
var a;
|
618
618
|
return s.source === t && ((a = s.connectivity) == null ? void 0 : a.length);
|
619
619
|
}).sort((s, a) => s.label.localeCompare(a.label))), !this.connectivitiesStore.globalConnectivities[o]) {
|
620
|
-
const s = await
|
621
|
-
this.connectivityKnowledge[o] =
|
620
|
+
const s = await n.queryMapPaths(o), a = s ? s.paths : {};
|
621
|
+
this.connectivityKnowledge[o] = i.filter((r) => {
|
622
622
|
var l;
|
623
623
|
return r.source === t && ((l = r.connectivity) == null ? void 0 : l.length) && r.id in a;
|
624
624
|
}).sort((r, l) => r.label.localeCompare(l.label));
|
625
625
|
}
|
626
|
-
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge),
|
627
|
-
},
|
628
|
-
getSearchedId: function(e, t) {
|
629
|
-
let i = [];
|
630
|
-
const n = e.mapImp.search(t);
|
631
|
-
return (n.__featureIds || n.featureIds).forEach((s) => {
|
632
|
-
var r;
|
633
|
-
const a = e.mapImp.annotation(s);
|
634
|
-
(r = a.label) != null && r.toLowerCase().includes(t.toLowerCase()) && a.models && !i.includes(a.models) && i.push(a.models);
|
635
|
-
}), i;
|
636
|
-
},
|
637
|
-
connectivityQueryFilter: async function(e, t) {
|
638
|
-
const i = this.connectivitiesStore.getUniqueConnectivitiesByKeys;
|
639
|
-
if (e.$el.checkVisibility()) {
|
640
|
-
let n = {
|
641
|
-
state: "default",
|
642
|
-
data: [...i]
|
643
|
-
};
|
644
|
-
if (t && (t.type === "query-update" ? (this.query !== t.value && (this.target = []), this.query = t.value) : t.type === "filter-update" && (this.filter = t.value)), this.query) {
|
645
|
-
n.state = "processed";
|
646
|
-
let o = [], s = {};
|
647
|
-
const a = this.query.split(",").map((f) => f.trim());
|
648
|
-
for (let f = 0; f < a.length; f++)
|
649
|
-
o.push(this.getSearchedId(e, a[f]));
|
650
|
-
const r = await Promise.all(o), l = [...new Set(r.flat())];
|
651
|
-
let c = await e.retrieveConnectedPaths(l, s);
|
652
|
-
c = [...l, ...c.filter((f) => !l.includes(f))];
|
653
|
-
let u = i.filter((f) => c.includes(f.id));
|
654
|
-
n.data = u;
|
655
|
-
}
|
656
|
-
h.emit("connectivity-knowledge", n);
|
657
|
-
}
|
626
|
+
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
|
658
627
|
}
|
659
628
|
},
|
660
629
|
data: function() {
|
@@ -677,8 +646,6 @@ const D = {
|
|
677
646
|
isInHelp: !1,
|
678
647
|
mapManager: void 0,
|
679
648
|
connectivityKnowledge: {},
|
680
|
-
query: "",
|
681
|
-
filter: [],
|
682
649
|
highlightDelay: void 0
|
683
650
|
};
|
684
651
|
},
|