@abi-software/mapintegratedvuer 1.16.3-simulation.1 → 1.17.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.
- package/dist/ConnectivityGraph-DbqPx-8k.js +125 -0
- package/dist/{ContentMixin-CN4E1Tcm.js → ContentMixin-R9Bw7Ou4.js} +545 -270
- package/dist/Flatmap-BYUfDJ9B.js +202 -0
- package/dist/{Iframe-NY9zAQZz.js → Iframe-2ofJ9NJW.js} +2 -2
- package/dist/{MultiFlatmap-C8gAg-MI.js → MultiFlatmap-CYxpB20e.js} +25 -18
- package/dist/{Plot-DH_Px9IB.js → Plot-DmQzP7lz.js} +2 -2
- package/dist/{Scaffold-C6XY3IQb.js → Scaffold-C8x1IHb9.js} +53 -79
- package/dist/Simulation-D9pblkqI.js +28 -0
- package/dist/{index-DaB85Tpy.js → index-raNlNgsS.js} +30069 -28444
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +238 -4270
- package/dist/{DynamicMarkerMixin-ToiTtIcj.js → style-QpNSY6to.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -11
- package/src/App.vue +265 -283
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentVuer.vue +5 -1
- package/src/components/ContextCard.vue +1 -0
- package/src/components/EventBus.js +3 -0
- package/src/components/MapContent.vue +9 -8
- package/src/components/SplitDialog.vue +5 -6
- package/src/components/SplitFlow.vue +491 -469
- package/src/components/scripts/utilities.js +16 -1
- package/src/components/viewers/ConnectivityGraph.vue +146 -0
- package/src/components/viewers/Flatmap.vue +84 -136
- package/src/components/viewers/MultiFlatmap.vue +9 -5
- package/src/components/viewers/Simulation.vue +15 -66
- package/src/components.d.ts +1 -3
- package/src/main.js +3 -9
- package/src/mixins/ContentMixin.js +391 -420
- package/src/stores/connectivities.js +6 -1
- package/src/stores/entries.js +1 -1
- package/src/stores/splitFlow.js +366 -427
- package/dist/Flatmap-D7eEw_Q5.js +0 -103398
- package/dist/Simulation-Bb3HbeD4.js +0 -72
- package/src/components/DummyRouteComponent.vue +0 -1
- package/src/components/EventBus.ts +0 -13
- package/src/components/FloatingWindow.vue +0 -125
- package/src/components/PlotComponent.vue +0 -56
- package/src/services/mapping.js +0 -69
- package/src/stores/mapping.js +0 -29
- package/src/stores/simulationPlotStore.js +0 -104
- package/src/types/simulation.js +0 -18
|
@@ -1,8 +1,322 @@
|
|
|
1
|
-
import { markRaw as
|
|
2
|
-
import {
|
|
3
|
-
import { mapStores as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { markRaw as y } from "vue";
|
|
2
|
+
import { G as _, c as E, u as O, d as N, e as x, E as m, T as M, f as R, h as P, i as w, l as B, j as X, k as U } from "./index-raNlNgsS.js";
|
|
3
|
+
import { mapStores as k } from "pinia";
|
|
4
|
+
const b = function(e) {
|
|
5
|
+
return e ? [...new Set(e.map((n) => JSON.stringify(n)))].map(
|
|
6
|
+
(n) => JSON.parse(n)
|
|
7
|
+
) : [];
|
|
8
|
+
}, d = [], T = async function(e, n) {
|
|
9
|
+
const r = n.filter(
|
|
10
|
+
(i) => d.some((l) => l.taxon === i)
|
|
11
|
+
), t = d.filter(
|
|
12
|
+
(i) => r.includes(i.taxon)
|
|
13
|
+
), a = n.filter(
|
|
14
|
+
(i) => !r.includes(i)
|
|
15
|
+
);
|
|
16
|
+
if (a.length) {
|
|
17
|
+
const i = await e.queryLabels(a);
|
|
18
|
+
if (i.length)
|
|
19
|
+
return i.forEach((l) => {
|
|
20
|
+
let { entity: s, label: h } = l;
|
|
21
|
+
h === "Mammalia" && (h = "Mammalia not otherwise specified");
|
|
22
|
+
const o = { taxon: s, label: h };
|
|
23
|
+
t.push(o), d.push(o);
|
|
24
|
+
}), t;
|
|
25
|
+
} else
|
|
26
|
+
return t;
|
|
27
|
+
}, L = function(e, n) {
|
|
28
|
+
if (!e || !n) return !1;
|
|
29
|
+
let r = JSON.stringify(e), t = JSON.stringify(n);
|
|
30
|
+
return r.indexOf(t) !== -1;
|
|
31
|
+
}, A = (e, n) => {
|
|
32
|
+
const r = e.name ?? e, t = n.name ?? n, a = r.toUpperCase(), i = t.toUpperCase();
|
|
33
|
+
return a < i ? -1 : a > i ? 1 : 0;
|
|
34
|
+
};
|
|
35
|
+
let S = function() {
|
|
36
|
+
this.initialise = function(e) {
|
|
37
|
+
this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.hasSingleConnectivityList = !1, this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
|
|
38
|
+
}, this.createTooltipData = async function(e, n) {
|
|
39
|
+
let r = [];
|
|
40
|
+
n.feature.hyperlinks && n.feature.hyperlinks.length > 0 ? r = n.feature.hyperlinks : r = this.rawURLs;
|
|
41
|
+
let t;
|
|
42
|
+
if (n.provenanceTaxonomy) {
|
|
43
|
+
t = [];
|
|
44
|
+
try {
|
|
45
|
+
const i = await T(e, n.provenanceTaxonomy);
|
|
46
|
+
i.length && i.forEach((l) => {
|
|
47
|
+
const { label: s } = l;
|
|
48
|
+
t.push(s);
|
|
49
|
+
});
|
|
50
|
+
} catch (i) {
|
|
51
|
+
console.log(i);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return {
|
|
55
|
+
destinations: this.destinations,
|
|
56
|
+
origins: this.origins,
|
|
57
|
+
components: this.components,
|
|
58
|
+
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
59
|
+
originsWithDatasets: this.originsWithDatasets,
|
|
60
|
+
componentsWithDatasets: this.componentsWithDatasets,
|
|
61
|
+
destinationsCombinations: this.destinationsCombinations,
|
|
62
|
+
originsCombinations: this.originsCombinations,
|
|
63
|
+
componentsCombinations: this.componentsCombinations,
|
|
64
|
+
hasSingleConnectivityList: this.singleConnectivityList.length > 0,
|
|
65
|
+
title: n.label,
|
|
66
|
+
featureId: n.resource,
|
|
67
|
+
hyperlinks: r,
|
|
68
|
+
provenanceTaxonomy: n.provenanceTaxonomy,
|
|
69
|
+
provenanceTaxonomyLabel: t,
|
|
70
|
+
connectivitySource: this.connectivitySource,
|
|
71
|
+
noMapConnectivity: this.noMapConnectivity
|
|
72
|
+
};
|
|
73
|
+
}, this.updateTooltipData = function(e) {
|
|
74
|
+
return {
|
|
75
|
+
...e,
|
|
76
|
+
origins: this.origins,
|
|
77
|
+
originsWithDatasets: this.originsWithDatasets,
|
|
78
|
+
components: this.components,
|
|
79
|
+
componentsWithDatasets: this.componentsWithDatasets,
|
|
80
|
+
destinations: this.destinations,
|
|
81
|
+
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
82
|
+
destinationsCombinations: this.destinationsCombinations,
|
|
83
|
+
originsCombinations: this.originsCombinations,
|
|
84
|
+
componentsCombinations: this.componentsCombinations,
|
|
85
|
+
connectivitySource: this.connectivitySource,
|
|
86
|
+
noMapConnectivity: this.noMapConnectivity
|
|
87
|
+
};
|
|
88
|
+
}, this.createComponentsLabelList = function(e, n) {
|
|
89
|
+
let r = [];
|
|
90
|
+
return e.forEach((t) => {
|
|
91
|
+
r.push(this.createLabelFromNeuralNode(t[0]), n), t.length === 2 && r.push(this.createLabelFromNeuralNode(t[1]), n);
|
|
92
|
+
}), r;
|
|
93
|
+
}, this.createLabelLookup = function(e, n) {
|
|
94
|
+
return new Promise(async (r) => {
|
|
95
|
+
let t = {};
|
|
96
|
+
this.uberons = [];
|
|
97
|
+
const a = await T(e, n);
|
|
98
|
+
a.length && (a.forEach((i) => {
|
|
99
|
+
const { taxon: l, label: s } = i;
|
|
100
|
+
t[l] = s, this.uberons.push({
|
|
101
|
+
id: l,
|
|
102
|
+
name: s
|
|
103
|
+
});
|
|
104
|
+
}), r(t));
|
|
105
|
+
});
|
|
106
|
+
}, this.buildConnectivitySqlStatement = function(e) {
|
|
107
|
+
let n = "select knowledge from knowledge where entity in (";
|
|
108
|
+
if (e.length === 1)
|
|
109
|
+
n += `'${e[0]}')`;
|
|
110
|
+
else if (e.length > 1)
|
|
111
|
+
for (let r in e)
|
|
112
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
113
|
+
return n;
|
|
114
|
+
}, this.buildLabelSqlStatement = function(e) {
|
|
115
|
+
let n = "select entity, label from labels where entity in (";
|
|
116
|
+
if (e.length === 1)
|
|
117
|
+
n += `'${e[0]}')`;
|
|
118
|
+
else if (e.length > 1)
|
|
119
|
+
for (let r in e)
|
|
120
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
121
|
+
return n;
|
|
122
|
+
}, this.findAllIdsFromConnectivity = function(e) {
|
|
123
|
+
let n = e.connectivity.flat(), r = [...new Set(n)], t = [];
|
|
124
|
+
return r.forEach((a) => {
|
|
125
|
+
Array.isArray(a) ? t.push(a.flat()) : t.push(a);
|
|
126
|
+
}), [...new Set(t.flat())];
|
|
127
|
+
}, this.flattenConnectivity = function(e) {
|
|
128
|
+
let n = e.flat(), r = [...new Set(n)], t = [];
|
|
129
|
+
return r.forEach((a) => {
|
|
130
|
+
Array.isArray(a) ? t.push(a.flat()) : t.push(a);
|
|
131
|
+
}), t.flat();
|
|
132
|
+
}, this.findComponents = function(e, n, r, t) {
|
|
133
|
+
let a = e.connectivity.flat(), i = b(a), l = [], s = !1;
|
|
134
|
+
return i.forEach((h) => {
|
|
135
|
+
s = !1, L(n, h) && (s = !0), t && L(t, h) && (s = !0), L(r, h) && (s = !0), s || l.push(h);
|
|
136
|
+
}), l;
|
|
137
|
+
}, this.retrieveFlatmapKnowledgeForEvent = async function(e, n) {
|
|
138
|
+
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
|
|
139
|
+
const r = n.resource;
|
|
140
|
+
if (this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.rawURLs = [], !r || r.length === 0 || !r[0]) return;
|
|
141
|
+
let t = await this.queryForConnectivityNew(e, r[0]);
|
|
142
|
+
return await Promise.all([t]);
|
|
143
|
+
}, this.queryForConnectivityNew = async function(e, n, r = "map", t = !0) {
|
|
144
|
+
const a = /^sckan-(\d{4})/.exec(e.knowledgeSource || ""), l = (a ? Number(a[1]) : 0) >= 2026, s = e.mapMetadata.uuid, h = this.flatmapAPI;
|
|
145
|
+
return this.connectivitySource = l ? "sckan" : r, l && (this.singleConnectivityList = await _(h, s, n)), new Promise((o) => {
|
|
146
|
+
(this.connectivitySource === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, n) : e.queryKnowledge(n)).then((c) => {
|
|
147
|
+
if (this.checkConnectivityExists(c)) {
|
|
148
|
+
this.connectivitySource === "map" && (this.noMapConnectivity = !1);
|
|
149
|
+
let v = c;
|
|
150
|
+
t ? this.processConnectivity(e, v).then((f) => {
|
|
151
|
+
c.references && (this.rawURLs = [...c.references]), o(f);
|
|
152
|
+
}) : o(v);
|
|
153
|
+
} else this.connectivitySource === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(n).then((v) => {
|
|
154
|
+
if (this.checkConnectivityExists(v)) {
|
|
155
|
+
let f = v;
|
|
156
|
+
t ? this.processConnectivity(e, f).then((p) => {
|
|
157
|
+
v.references && (this.rawURLs = [...v.references]), o(p);
|
|
158
|
+
}) : o(f);
|
|
159
|
+
} else
|
|
160
|
+
o(!1);
|
|
161
|
+
}).catch(() => o(!1))) : o(!1);
|
|
162
|
+
}).catch((c) => {
|
|
163
|
+
c.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${n}.`), o(!1);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
}, this.queryMapConnectivity = async function(e, n) {
|
|
167
|
+
const r = this.flatmapAPI + `flatmap/${e}/connectivity/${n}`;
|
|
168
|
+
try {
|
|
169
|
+
const t = await fetch(r);
|
|
170
|
+
if (!t.ok)
|
|
171
|
+
throw new Error(`Response status: ${t.status}`);
|
|
172
|
+
return await t.json();
|
|
173
|
+
} catch (t) {
|
|
174
|
+
throw new Error(t);
|
|
175
|
+
}
|
|
176
|
+
}, this.queryForConnectivity = function(e, n, r, t = !0) {
|
|
177
|
+
const a = { sql: this.buildConnectivitySqlStatement(n) }, i = {
|
|
178
|
+
method: "POST",
|
|
179
|
+
headers: {
|
|
180
|
+
"Content-Type": "application/json"
|
|
181
|
+
},
|
|
182
|
+
body: JSON.stringify(a),
|
|
183
|
+
...r ? { signal: r } : {}
|
|
184
|
+
// add signal to header if it exists
|
|
185
|
+
};
|
|
186
|
+
return new Promise((l) => {
|
|
187
|
+
fetch(`${this.flatmapAPI}knowledge/query/`, i).then((s) => s.json()).then((s) => {
|
|
188
|
+
if (this.connectivityExists(s)) {
|
|
189
|
+
let h = JSON.parse(s.values[0][0]);
|
|
190
|
+
t ? this.processConnectivity(e, h).then((o) => {
|
|
191
|
+
l(o);
|
|
192
|
+
}) : l(h);
|
|
193
|
+
} else
|
|
194
|
+
l(!1);
|
|
195
|
+
}).catch((s) => {
|
|
196
|
+
s.name === "AbortError" || console.error("Error:", s), l(!1);
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
}, this.checkConnectivityExists = function(e) {
|
|
200
|
+
var n;
|
|
201
|
+
return e && ((n = e.connectivity) == null ? void 0 : n.length);
|
|
202
|
+
}, this.connectivityExists = function(e) {
|
|
203
|
+
return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
|
|
204
|
+
}, this.findIfNodeIsSingle = function(e) {
|
|
205
|
+
return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
|
|
206
|
+
}, this.createLabelFromNeuralNode = function(e, n) {
|
|
207
|
+
let r = this.findIfNodeIsSingle(e);
|
|
208
|
+
if (r)
|
|
209
|
+
return n[r];
|
|
210
|
+
let t = n[e[0]];
|
|
211
|
+
return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
|
|
212
|
+
n[a] == null ? t += `, ${a}` : t += `, ${n[a]}`;
|
|
213
|
+
}), t;
|
|
214
|
+
}, this.flattenAndFindDatasets = function(e, n, r) {
|
|
215
|
+
let t = this.flattenConnectivity(e), a = this.flattenConnectivity(n), i = this.flattenConnectivity(r);
|
|
216
|
+
this.originsWithDatasets = this.uberons.filter(
|
|
217
|
+
(l) => t.indexOf(l.id) !== -1
|
|
218
|
+
).sort(A), this.componentsWithDatasets = this.uberons.filter(
|
|
219
|
+
(l) => a.indexOf(l.id) !== -1
|
|
220
|
+
).sort(A), this.destinationsWithDatasets = this.uberons.filter(
|
|
221
|
+
(l) => i.indexOf(l.id) !== -1
|
|
222
|
+
).sort(A), this.singleConnectivityList.length > 0 && this.singleConnectivityList.forEach((l) => {
|
|
223
|
+
const { sckanNodeId: s, sckanNodeLabel: h, mapNodeId: o, mapNodeLabel: u } = l;
|
|
224
|
+
r.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.destinationsCombinations.push({
|
|
225
|
+
sckanId: s,
|
|
226
|
+
sckanLabel: h,
|
|
227
|
+
mapId: o,
|
|
228
|
+
mapLabel: u
|
|
229
|
+
}), o.forEach((c, v) => {
|
|
230
|
+
const f = typeof c == "string" ? c : c[0];
|
|
231
|
+
f && this.destinationsWithDatasets.push({
|
|
232
|
+
id: f,
|
|
233
|
+
name: u.split(",")[v]
|
|
234
|
+
});
|
|
235
|
+
})), e.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.originsCombinations.push({
|
|
236
|
+
sckanId: s,
|
|
237
|
+
sckanLabel: h,
|
|
238
|
+
mapId: o,
|
|
239
|
+
mapLabel: u
|
|
240
|
+
}), o.forEach((c, v) => {
|
|
241
|
+
const f = typeof c == "string" ? c : c[0];
|
|
242
|
+
f && this.originsWithDatasets.push({
|
|
243
|
+
id: f,
|
|
244
|
+
name: u.split(",")[v]
|
|
245
|
+
});
|
|
246
|
+
})), n.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.componentsCombinations.push({
|
|
247
|
+
sckanId: s,
|
|
248
|
+
sckanLabel: h,
|
|
249
|
+
mapId: o,
|
|
250
|
+
mapLabel: u
|
|
251
|
+
}), o.forEach((c, v) => {
|
|
252
|
+
const f = typeof c == "string" ? c : c[0];
|
|
253
|
+
f && this.componentsWithDatasets.push({
|
|
254
|
+
id: f,
|
|
255
|
+
name: u.split(",")[v]
|
|
256
|
+
});
|
|
257
|
+
}));
|
|
258
|
+
});
|
|
259
|
+
}, this.processConnectivity = function(e, n) {
|
|
260
|
+
return new Promise((r) => {
|
|
261
|
+
let t = [], a = [], i;
|
|
262
|
+
if (n && n["node-phenotypes"]) {
|
|
263
|
+
const h = ["ilxtr:hasSomaLocatedIn"], o = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
|
264
|
+
h.forEach((u) => {
|
|
265
|
+
u in n["node-phenotypes"] && t.push(...n["node-phenotypes"][u]);
|
|
266
|
+
}), t = b(t), o.forEach((u) => {
|
|
267
|
+
u in n["node-phenotypes"] && a.push(...n["node-phenotypes"][u]);
|
|
268
|
+
}), a = b(a);
|
|
269
|
+
} else
|
|
270
|
+
a = b(n.axons), n.somas && n.somas.length > 0 && t.push(...n.somas), n.dendrites && n.dendrites.length > 0 && t.push(...n.dendrites), t = b(t), i = n.somas;
|
|
271
|
+
const l = this.findComponents(n, a, t, i), s = this.findAllIdsFromConnectivity(n);
|
|
272
|
+
this.createLabelLookup(e, s).then((h) => {
|
|
273
|
+
this.origins = t.map(
|
|
274
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
275
|
+
).sort(A), this.components = l.map(
|
|
276
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
277
|
+
).sort(A), this.destinations = a.map(
|
|
278
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
279
|
+
).sort(A), this.flattenAndFindDatasets(t, l, a), r({
|
|
280
|
+
ids: {
|
|
281
|
+
dendrites: t,
|
|
282
|
+
components: l,
|
|
283
|
+
axons: a
|
|
284
|
+
},
|
|
285
|
+
labels: {
|
|
286
|
+
origins: this.origins,
|
|
287
|
+
components: this.components,
|
|
288
|
+
destinations: this.destinations
|
|
289
|
+
}
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
}, this.buildPubmedSqlStatement = function(e) {
|
|
294
|
+
let n = "select distinct publication from publications where entity in (";
|
|
295
|
+
if (e.length === 1)
|
|
296
|
+
n += `'${e[0]}')`;
|
|
297
|
+
else if (e.length > 1)
|
|
298
|
+
for (let r in e)
|
|
299
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
300
|
+
return n;
|
|
301
|
+
}, this.buildPubmedSqlStatementForModels = function(e) {
|
|
302
|
+
return `select distinct publication from publications where entity = '${e}'`;
|
|
303
|
+
}, this.queryKnowledge = async (e, n) => {
|
|
304
|
+
const r = `${this.flatmapAPI}knowledge/query/`, a = await fetch(r, {
|
|
305
|
+
method: "POST",
|
|
306
|
+
headers: {
|
|
307
|
+
Accept: "application/json"
|
|
308
|
+
},
|
|
309
|
+
body: JSON.stringify({ sql: e, params: n })
|
|
310
|
+
});
|
|
311
|
+
if (!a.ok)
|
|
312
|
+
throw new Error(`Cannot access ${r}`);
|
|
313
|
+
const i = await a.json();
|
|
314
|
+
if ("error" in i)
|
|
315
|
+
throw new TypeError(i.error);
|
|
316
|
+
return i.values;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
const I = [
|
|
6
320
|
{
|
|
7
321
|
id: 0,
|
|
8
322
|
nerve_id: "ILX:0793723",
|
|
@@ -815,50 +1129,50 @@ const R = [
|
|
|
815
1129
|
"FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
|
|
816
1130
|
"subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
|
|
817
1131
|
}
|
|
818
|
-
],
|
|
1132
|
+
], D = () => {
|
|
819
1133
|
const e = {};
|
|
820
|
-
return
|
|
821
|
-
const
|
|
822
|
-
if (
|
|
823
|
-
if (!
|
|
1134
|
+
return I.forEach((n) => {
|
|
1135
|
+
const r = n.nerve_id, t = n.label.toLowerCase(), a = n["subclass labels"];
|
|
1136
|
+
if (r && t !== "nerve") {
|
|
1137
|
+
if (!a.length)
|
|
824
1138
|
return;
|
|
825
|
-
|
|
826
|
-
const
|
|
827
|
-
e[
|
|
828
|
-
nerve:
|
|
829
|
-
subNerves:
|
|
1139
|
+
r in e || (e[r] = {});
|
|
1140
|
+
const i = a.map((l) => l.toLowerCase()).sort();
|
|
1141
|
+
e[r] = {
|
|
1142
|
+
nerve: t,
|
|
1143
|
+
subNerves: i
|
|
830
1144
|
};
|
|
831
1145
|
}
|
|
832
1146
|
}), e;
|
|
833
|
-
},
|
|
834
|
-
let e = [],
|
|
1147
|
+
}, $ = () => {
|
|
1148
|
+
let e = [], n = {
|
|
835
1149
|
key: "scaffold.connectivity.nerve",
|
|
836
1150
|
label: "Nerves",
|
|
837
1151
|
children: []
|
|
838
|
-
},
|
|
839
|
-
for (const
|
|
840
|
-
if (
|
|
1152
|
+
}, r = [];
|
|
1153
|
+
for (const t of I) {
|
|
1154
|
+
if (t.label === "nerve")
|
|
841
1155
|
continue;
|
|
842
|
-
let
|
|
1156
|
+
let a = {
|
|
843
1157
|
facetPropPath: "scaffold.connectivity.nerve",
|
|
844
1158
|
label: "",
|
|
845
1159
|
children: []
|
|
846
|
-
},
|
|
847
|
-
for (const [l,
|
|
848
|
-
if (l === "label" && (
|
|
849
|
-
for (const
|
|
850
|
-
|
|
1160
|
+
}, i = [];
|
|
1161
|
+
for (const [l, s] of Object.entries(t))
|
|
1162
|
+
if (l === "label" && (a.label = s), l === "subclass labels")
|
|
1163
|
+
for (const h of s)
|
|
1164
|
+
i.push({
|
|
851
1165
|
facetPropPath: "scaffold.connectivity.subnerve",
|
|
852
|
-
label:
|
|
1166
|
+
label: h
|
|
853
1167
|
});
|
|
854
|
-
|
|
1168
|
+
i.length && (a.children = i.sort((l, s) => l.label.localeCompare(s.label)), r.push(a));
|
|
855
1169
|
}
|
|
856
|
-
return
|
|
1170
|
+
return r.length && (n.children = r.sort((t, a) => t.label.localeCompare(a.label)), e.push(n)), e;
|
|
857
1171
|
};
|
|
858
|
-
function
|
|
1172
|
+
function H(e) {
|
|
859
1173
|
return e[0].toUpperCase() + e.substring(1);
|
|
860
1174
|
}
|
|
861
|
-
const
|
|
1175
|
+
const K = {
|
|
862
1176
|
emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
|
|
863
1177
|
props: {
|
|
864
1178
|
/**
|
|
@@ -877,7 +1191,7 @@ const $ = {
|
|
|
877
1191
|
},
|
|
878
1192
|
inject: ["showGlobalSettings", "showOpenMapButton"],
|
|
879
1193
|
computed: {
|
|
880
|
-
...E
|
|
1194
|
+
...k(E, O, N, x),
|
|
881
1195
|
idNamePair() {
|
|
882
1196
|
return this.splitFlowStore.idNamePair;
|
|
883
1197
|
},
|
|
@@ -902,20 +1216,18 @@ const $ = {
|
|
|
902
1216
|
this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.iframeRef = this.$refs.iframe, this.plotRef = this.$refs.plot, this.simulationRef = this.$refs.simulation, (this.scaffoldRef || this.iframeRef || this.plotRef || this.simulationRef) && this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
|
|
903
1217
|
},
|
|
904
1218
|
methods: {
|
|
905
|
-
toggleMinimap: function(e,
|
|
906
|
-
var
|
|
907
|
-
if (this.multiflatmapRef) {
|
|
908
|
-
const
|
|
909
|
-
if (
|
|
1219
|
+
toggleMinimap: function(e, n) {
|
|
1220
|
+
var r;
|
|
1221
|
+
if (this.multiflatmapRef && this.flatmapIsReady()) {
|
|
1222
|
+
const t = this.multiflatmapRef.getCurrentFlatmap(), a = t == null ? void 0 : t.mapImp;
|
|
1223
|
+
if (a)
|
|
910
1224
|
if (e === !0) {
|
|
911
|
-
if (
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
};
|
|
915
|
-
t.createMinimap(s), n.addResizeButtonToMinimap(), n.minimapSmall = !1;
|
|
1225
|
+
if (n === !1) {
|
|
1226
|
+
const i = ((r = a.options) == null ? void 0 : r.minimap) || { position: "top-right" };
|
|
1227
|
+
a.createMinimap(i), t.addResizeButtonToMinimap(), t.minimapSmall = !1;
|
|
916
1228
|
}
|
|
917
1229
|
} else
|
|
918
|
-
|
|
1230
|
+
a.closeMinimap();
|
|
919
1231
|
}
|
|
920
1232
|
},
|
|
921
1233
|
onConnectivityItemClose() {
|
|
@@ -930,13 +1242,13 @@ const $ = {
|
|
|
930
1242
|
getState: function() {
|
|
931
1243
|
},
|
|
932
1244
|
openMap: function(e) {
|
|
933
|
-
|
|
1245
|
+
m.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
|
|
934
1246
|
},
|
|
935
1247
|
onMapmanagerLoaded: function(e) {
|
|
936
1248
|
this.settingsStore.updateMapManager(e);
|
|
937
1249
|
},
|
|
938
1250
|
trackOpenMap: function(e) {
|
|
939
|
-
|
|
1251
|
+
M.sendEvent({
|
|
940
1252
|
event: "interaction_event",
|
|
941
1253
|
event_name: "portal_maps_open_map",
|
|
942
1254
|
category: e,
|
|
@@ -965,57 +1277,60 @@ const $ = {
|
|
|
965
1277
|
/**
|
|
966
1278
|
* Callback when the vuers emit a selected event.
|
|
967
1279
|
*/
|
|
968
|
-
resourceSelected: function(e,
|
|
969
|
-
var l,
|
|
970
|
-
const
|
|
971
|
-
if (this.resourceHasAction(
|
|
972
|
-
|
|
1280
|
+
resourceSelected: function(e, n) {
|
|
1281
|
+
var l, s, h, o;
|
|
1282
|
+
const r = n[0];
|
|
1283
|
+
if (this.resourceHasAction(r)) {
|
|
1284
|
+
m.emit("PopoverActionClick", r);
|
|
973
1285
|
return;
|
|
974
1286
|
}
|
|
975
|
-
let
|
|
976
|
-
const
|
|
1287
|
+
let t, a = !1;
|
|
1288
|
+
const i = {
|
|
977
1289
|
paneIndex: this.entry.id,
|
|
978
1290
|
type: e,
|
|
979
|
-
resource:
|
|
1291
|
+
resource: n,
|
|
980
1292
|
internalName: void 0,
|
|
981
1293
|
eventType: void 0
|
|
982
1294
|
};
|
|
983
1295
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
|
984
|
-
if (
|
|
985
|
-
if (
|
|
986
|
-
let
|
|
987
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
|
988
|
-
|
|
1296
|
+
if (i.internalName = (l = r == null ? void 0 : r.feature) != null && l.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
|
|
1297
|
+
if (i.eventType = "selected", r.feature.type == "marker") {
|
|
1298
|
+
let u = i.internalName;
|
|
1299
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(r.feature.id))
|
|
1300
|
+
t = {
|
|
989
1301
|
type: "Search",
|
|
990
|
-
term: this.settingsStore.featuredMarkerDoi(
|
|
1302
|
+
term: this.settingsStore.featuredMarkerDoi(r.feature.id),
|
|
991
1303
|
featuredDataset: !0
|
|
992
1304
|
};
|
|
993
1305
|
else {
|
|
994
|
-
|
|
1306
|
+
t = {
|
|
995
1307
|
type: "Facet",
|
|
996
|
-
facets: [
|
|
1308
|
+
facets: [u]
|
|
997
1309
|
};
|
|
998
1310
|
let c = /* @__PURE__ */ new Set();
|
|
999
|
-
if (
|
|
1000
|
-
c.add(
|
|
1001
|
-
}), c.size === 0 && c.add(
|
|
1311
|
+
if (r.feature["dataset-terms"].forEach((v) => {
|
|
1312
|
+
c.add(v.label ? v.label : v.term);
|
|
1313
|
+
}), c.size === 0 && c.add(u), t.facets = [...c], this.settingsStore.hasAppliedFacets(c) && this.settingsStore.appliedFacets.length <= c.size)
|
|
1002
1314
|
return;
|
|
1003
1315
|
if (this.settingsStore.appliedFacets.length) {
|
|
1004
1316
|
if (!this.settingsStore.hasAppliedFacets(c)) {
|
|
1005
|
-
const
|
|
1006
|
-
|
|
1317
|
+
const v = [.../* @__PURE__ */ new Set([
|
|
1318
|
+
...this.settingsStore.appliedFacets,
|
|
1319
|
+
...c
|
|
1320
|
+
])];
|
|
1321
|
+
this.settingsStore.updateAppliedFacets(v);
|
|
1007
1322
|
}
|
|
1008
1323
|
} else
|
|
1009
|
-
c.size > 1 && (
|
|
1324
|
+
c.size > 1 && (t.type = "Facets"), this.settingsStore.updateAppliedFacets(t.facets);
|
|
1010
1325
|
}
|
|
1011
|
-
|
|
1326
|
+
a = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
|
1012
1327
|
}
|
|
1013
|
-
} else
|
|
1014
|
-
else e == "Scaffold" && (
|
|
1328
|
+
} else r.eventType == "mouseenter" && (i.eventType = "highlighted", a = !0);
|
|
1329
|
+
else e == "Scaffold" && (r && ((((s = r.data) == null ? void 0 : s.id) === void 0 || ((h = r.data) == null ? void 0 : h.id) === "") && (r.data.id = (o = r.data) == null ? void 0 : o.group), i.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (t = {
|
|
1015
1330
|
type: "Facet",
|
|
1016
|
-
facets: [
|
|
1017
|
-
})),
|
|
1018
|
-
|
|
1331
|
+
facets: [H(r.data.id)]
|
|
1332
|
+
})), i.eventType = "selected", a = !0);
|
|
1333
|
+
t && m.emit("PopoverActionClick", t), a && this.$emit("resource-selected", i);
|
|
1019
1334
|
},
|
|
1020
1335
|
resourceHasAction: function(e) {
|
|
1021
1336
|
return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
|
|
@@ -1026,124 +1341,107 @@ const $ = {
|
|
|
1026
1341
|
* calls to try to ge a valid name/id.
|
|
1027
1342
|
*/
|
|
1028
1343
|
getNameAndIdFromSyncData: async function(e) {
|
|
1029
|
-
let
|
|
1030
|
-
|
|
1031
|
-
let
|
|
1032
|
-
if (e.resource && e.resource.resource && (
|
|
1033
|
-
if (this.$refs.scaffold.findObjectsWithGroupName(
|
|
1344
|
+
let n = e.internalName;
|
|
1345
|
+
n === void 0 && e.resource && (n = e.resource.label);
|
|
1346
|
+
let r;
|
|
1347
|
+
if (e.resource && e.resource.resource && (r = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
|
1348
|
+
if (this.$refs.scaffold.findObjectsWithGroupName(n).length === 0) {
|
|
1034
1349
|
if (e.resource && e.resource.feature) {
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1350
|
+
const i = R(e.resource.feature.models);
|
|
1351
|
+
if (i.length > 0) return i;
|
|
1037
1352
|
}
|
|
1038
|
-
let
|
|
1039
|
-
if (
|
|
1040
|
-
return
|
|
1041
|
-
if (
|
|
1042
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
|
1353
|
+
let a = P(n);
|
|
1354
|
+
if (a)
|
|
1355
|
+
return a;
|
|
1356
|
+
if (r && e.eventType === "selected")
|
|
1357
|
+
return fetch(`${this.apiLocation}get-related-terms/${r}`).then((i) => i.json()).then((i) => {
|
|
1043
1358
|
var l;
|
|
1044
|
-
if (((l =
|
|
1045
|
-
return
|
|
1359
|
+
if (((l = i.uberon) == null ? void 0 : l.array.length) > 0)
|
|
1360
|
+
return n = i.uberon.array[0].name.charAt(0).toUpperCase() + i.uberon.array[0].name.slice(1), r = i.uberon.array[0].id.toUpperCase(), { id: r, name: n };
|
|
1046
1361
|
});
|
|
1047
1362
|
}
|
|
1048
1363
|
} else if (this.entry.type === "MultiFlatmap")
|
|
1049
|
-
if (
|
|
1050
|
-
|
|
1364
|
+
if (n === "Bladder")
|
|
1365
|
+
n = "Urinary Bladder";
|
|
1051
1366
|
else {
|
|
1052
|
-
const
|
|
1053
|
-
|
|
1367
|
+
const t = R(n);
|
|
1368
|
+
t.length > 0 && (n = t[0]);
|
|
1054
1369
|
}
|
|
1055
|
-
return { id:
|
|
1370
|
+
return { id: r, name: n };
|
|
1056
1371
|
},
|
|
1057
1372
|
// Get the species and andaotmy info for the featured datasets
|
|
1058
1373
|
getDatasetAnatomyInfo: function(e) {
|
|
1059
|
-
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((
|
|
1060
|
-
const
|
|
1061
|
-
let
|
|
1374
|
+
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((n) => n.json()).then((n) => {
|
|
1375
|
+
const r = n.result[0];
|
|
1376
|
+
let t;
|
|
1062
1377
|
try {
|
|
1063
|
-
|
|
1378
|
+
t = r.anatomy.organ[0].curie;
|
|
1064
1379
|
} catch {
|
|
1065
|
-
|
|
1380
|
+
t = void 0;
|
|
1066
1381
|
}
|
|
1067
|
-
let
|
|
1382
|
+
let a;
|
|
1068
1383
|
try {
|
|
1069
|
-
|
|
1384
|
+
a = r.item.curie;
|
|
1070
1385
|
} catch {
|
|
1071
|
-
|
|
1386
|
+
a = void 0;
|
|
1072
1387
|
}
|
|
1073
|
-
let
|
|
1388
|
+
let i;
|
|
1074
1389
|
try {
|
|
1075
|
-
let l = 0,
|
|
1076
|
-
for (; !
|
|
1077
|
-
const
|
|
1078
|
-
|
|
1390
|
+
let l = 0, s = !1;
|
|
1391
|
+
for (; !s && l < r.organisms.subject.length; ) {
|
|
1392
|
+
const h = r.organisms.subject[l];
|
|
1393
|
+
h.species && (i = h.species.name, s = !0), l += 1;
|
|
1079
1394
|
}
|
|
1080
1395
|
} catch {
|
|
1081
|
-
|
|
1396
|
+
i = void 0;
|
|
1082
1397
|
}
|
|
1083
1398
|
this.settingsStore.updateFeaturedMarker({
|
|
1084
1399
|
identifier: e,
|
|
1085
|
-
marker:
|
|
1086
|
-
doi:
|
|
1087
|
-
species:
|
|
1400
|
+
marker: t,
|
|
1401
|
+
doi: a,
|
|
1402
|
+
species: i
|
|
1088
1403
|
});
|
|
1089
1404
|
});
|
|
1090
1405
|
},
|
|
1091
1406
|
// Check if the old featured dataset api has any info
|
|
1092
1407
|
oldFeaturedDatasetApiHasInfo: async function() {
|
|
1093
|
-
let
|
|
1094
|
-
return !
|
|
1408
|
+
let n = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
|
|
1409
|
+
return !n.identifiers || n.identifiers.length == 0 ? !1 : n.identifiers;
|
|
1095
1410
|
},
|
|
1096
1411
|
// Check if the new featured dataset api has any info
|
|
1097
1412
|
newFeaturedDatasetApiHasInfo: async function() {
|
|
1098
|
-
let
|
|
1099
|
-
return !
|
|
1413
|
+
let n = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
|
1414
|
+
return !n.datasets || n.datasets.length == 0 ? !1 : n.datasets.map((r) => r.id);
|
|
1100
1415
|
},
|
|
1101
|
-
flatmapResourceSelected: function(e,
|
|
1416
|
+
flatmapResourceSelected: function(e, n) {
|
|
1102
1417
|
var l;
|
|
1103
|
-
this.resourceSelected(e,
|
|
1104
|
-
const
|
|
1105
|
-
if (
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
const { models:
|
|
1109
|
-
|
|
1110
|
-
}),
|
|
1418
|
+
this.resourceSelected(e, n);
|
|
1419
|
+
const r = n[0], { eventType: t, feature: a } = r, { viewingMode: i } = this.settingsStore.globalSettings;
|
|
1420
|
+
if (t === "click" && a.type === "feature" && ((l = a.models) != null && l.startsWith("ilxtr:"))) {
|
|
1421
|
+
const s = [];
|
|
1422
|
+
n.forEach((h) => {
|
|
1423
|
+
const { models: o } = h.feature;
|
|
1424
|
+
s.push(o);
|
|
1425
|
+
}), M.sendEvent({
|
|
1111
1426
|
event: "interaction_event",
|
|
1112
1427
|
event_name: "portal_maps_connectivity",
|
|
1113
|
-
category:
|
|
1114
|
-
location: e + " " +
|
|
1428
|
+
category: s.join(", "),
|
|
1429
|
+
location: e + " " + i
|
|
1115
1430
|
});
|
|
1116
1431
|
}
|
|
1117
|
-
if (n === "click" && t.type === "feature" && e === "Flatmap") {
|
|
1118
|
-
const { component: i, variable: o } = this.mappingStore.mapToCellMLIdentifiers(t.mapUUID, t.id);
|
|
1119
|
-
if (!i || !o)
|
|
1120
|
-
return;
|
|
1121
|
-
const u = {
|
|
1122
|
-
component: i,
|
|
1123
|
-
featureId: t.id,
|
|
1124
|
-
mapId: t.mapUUID,
|
|
1125
|
-
offset: { left: 15, top: 15 },
|
|
1126
|
-
ownerId: this.entry.id,
|
|
1127
|
-
position: { x: this.elementX + this.left, y: this.elementY + this.top },
|
|
1128
|
-
protocol: a.protocol,
|
|
1129
|
-
variable: o,
|
|
1130
|
-
windowId: `simulation-window-${this.entry.id}-${i}-${o}`
|
|
1131
|
-
};
|
|
1132
|
-
this.simulationPlotStore.requestSimulation(u);
|
|
1133
|
-
}
|
|
1134
1432
|
},
|
|
1135
1433
|
/**
|
|
1136
1434
|
* Get a list of featured datasets to display.
|
|
1137
1435
|
*/
|
|
1138
1436
|
getFeaturedDatasets: async function() {
|
|
1139
|
-
let e = [],
|
|
1140
|
-
if (
|
|
1437
|
+
let e = [], n = await this.oldFeaturedDatasetApiHasInfo();
|
|
1438
|
+
if (n) e = n;
|
|
1141
1439
|
else {
|
|
1142
|
-
let
|
|
1143
|
-
|
|
1440
|
+
let r = await this.newFeaturedDatasetApiHasInfo();
|
|
1441
|
+
r && (e = r);
|
|
1144
1442
|
}
|
|
1145
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
|
1146
|
-
this.getDatasetAnatomyInfo(
|
|
1443
|
+
this.settingsStore.updateFeatured(e), e.forEach((r) => {
|
|
1444
|
+
this.getDatasetAnatomyInfo(r);
|
|
1147
1445
|
});
|
|
1148
1446
|
},
|
|
1149
1447
|
flatmapMarkerUpdate() {
|
|
@@ -1181,65 +1479,67 @@ const $ = {
|
|
|
1181
1479
|
checkEndHelpMouseDown: function(e) {
|
|
1182
1480
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
|
1183
1481
|
},
|
|
1184
|
-
flatmapHighlight: async function(e,
|
|
1185
|
-
let
|
|
1186
|
-
const
|
|
1187
|
-
if (
|
|
1188
|
-
const l =
|
|
1189
|
-
|
|
1482
|
+
flatmapHighlight: async function(e, n, r, t) {
|
|
1483
|
+
let a = [...n, ...t];
|
|
1484
|
+
const i = this.settingsStore.globalSettings;
|
|
1485
|
+
if (i.highlightConnectedPaths) {
|
|
1486
|
+
const l = n.length ? n : t.length ? t : [], s = await e.retrieveConnectedPaths(l);
|
|
1487
|
+
s && a.push(...s);
|
|
1190
1488
|
}
|
|
1191
|
-
if (
|
|
1192
|
-
const l = await e.searchConnectivitiesByReference(
|
|
1193
|
-
l &&
|
|
1489
|
+
if (i.highlightDOIPaths) {
|
|
1490
|
+
const l = await e.searchConnectivitiesByReference(r);
|
|
1491
|
+
l && a.push(...l);
|
|
1194
1492
|
}
|
|
1195
|
-
return
|
|
1493
|
+
return a = [...new Set(a)], a;
|
|
1196
1494
|
},
|
|
1197
1495
|
sidebarHoverHighlight: function(e) {
|
|
1198
|
-
var
|
|
1496
|
+
var n, r;
|
|
1199
1497
|
if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
|
|
1200
|
-
const
|
|
1201
|
-
let
|
|
1202
|
-
this.flatmapRef && (
|
|
1203
|
-
(
|
|
1498
|
+
const t = this.settingsStore.hoverAnatomies, a = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
|
|
1499
|
+
let s = null, h = null;
|
|
1500
|
+
this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (h = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !a.length && !i && !l.length && ((this.multiflatmapRef || this.flatmapRef) && s ? s.mapImp && !s.mapImp.contextLost && ((n = s.mapImp) == null || n.clearSearchResults(), e.connectivityProcessed && ((r = s.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1)), this.highlightDelay = setTimeout(() => {
|
|
1501
|
+
(t.length || a.length || i || l.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, i, l).then((o) => {
|
|
1204
1502
|
try {
|
|
1205
|
-
|
|
1206
|
-
connectivityInfo: { featureId:
|
|
1503
|
+
s.showConnectivityTooltips({
|
|
1504
|
+
connectivityInfo: { featureId: o },
|
|
1207
1505
|
data: []
|
|
1208
1506
|
});
|
|
1209
|
-
} catch {
|
|
1210
|
-
if (l.length &&
|
|
1211
|
-
const c =
|
|
1212
|
-
|
|
1213
|
-
(
|
|
1214
|
-
|
|
1507
|
+
} catch (u) {
|
|
1508
|
+
if (console.log(u), l.length && s.mapImp) {
|
|
1509
|
+
const c = s.mapImp.uuid;
|
|
1510
|
+
o.every(
|
|
1511
|
+
(f) => this.connectivityKnowledge[c].some(
|
|
1512
|
+
(p) => p.id === f
|
|
1513
|
+
)
|
|
1514
|
+
) || s.mapImp && !s.mapImp.contextLost && s.mapImp.clearSearchResults();
|
|
1215
1515
|
}
|
|
1216
1516
|
}
|
|
1217
|
-
}) : this.scaffoldRef &&
|
|
1517
|
+
}) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1));
|
|
1218
1518
|
}, 100);
|
|
1219
1519
|
}
|
|
1220
1520
|
},
|
|
1221
1521
|
onAnnotationOpen: function(e) {
|
|
1222
|
-
|
|
1522
|
+
m.emit("annotation-open", e);
|
|
1223
1523
|
},
|
|
1224
1524
|
onAnnotationClose: function() {
|
|
1225
|
-
|
|
1525
|
+
m.emit("sidebar-annotation-close");
|
|
1226
1526
|
},
|
|
1227
1527
|
updateOfflineAnnotationEnabled: function(e) {
|
|
1228
|
-
|
|
1528
|
+
m.emit("update-offline-annotation-enabled", e);
|
|
1229
1529
|
},
|
|
1230
1530
|
onConnectivityInfoOpen: function(e) {
|
|
1231
|
-
|
|
1531
|
+
m.emit("connectivity-info-open", e);
|
|
1232
1532
|
},
|
|
1233
1533
|
onConnectivityError: function(e) {
|
|
1234
|
-
|
|
1534
|
+
m.emit("connectivity-error", e);
|
|
1235
1535
|
},
|
|
1236
1536
|
onConnectivityInfoClose: function() {
|
|
1237
|
-
|
|
1537
|
+
m.emit("connectivity-info-close");
|
|
1238
1538
|
},
|
|
1239
1539
|
onSidebarAnnotationClose: function() {
|
|
1240
1540
|
},
|
|
1241
1541
|
onNeuronConnectionFeatureClick: function(e) {
|
|
1242
|
-
|
|
1542
|
+
m.emit("neuron-connection-feature-click", e);
|
|
1243
1543
|
},
|
|
1244
1544
|
showConnectivity: function() {
|
|
1245
1545
|
},
|
|
@@ -1251,140 +1551,115 @@ const $ = {
|
|
|
1251
1551
|
this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
|
|
1252
1552
|
},
|
|
1253
1553
|
mockUpFlatmapService: async function() {
|
|
1254
|
-
const
|
|
1255
|
-
this.flatmapQueries =
|
|
1256
|
-
const
|
|
1554
|
+
const r = (await (await fetch(this.flatmapAPI)).json()).filter((u) => u.id === "human-flatmap_male").sort((u, c) => c.created.localeCompare(u.created))[0], t = r.uuid, a = r.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${t}/pathways`)).json();
|
|
1555
|
+
this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1556
|
+
const s = {
|
|
1257
1557
|
mapMetadata: {
|
|
1258
|
-
uuid:
|
|
1558
|
+
uuid: t,
|
|
1259
1559
|
connectivity: {
|
|
1260
|
-
...
|
|
1560
|
+
...r.sckan
|
|
1261
1561
|
}
|
|
1262
1562
|
},
|
|
1263
1563
|
pathways: l,
|
|
1264
1564
|
resource: this.entry.resource,
|
|
1265
|
-
knowledgeSource:
|
|
1266
|
-
queryKnowledge: async (
|
|
1267
|
-
const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc",
|
|
1268
|
-
return JSON.parse(
|
|
1565
|
+
knowledgeSource: a,
|
|
1566
|
+
queryKnowledge: async (u) => {
|
|
1567
|
+
const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", v = [a, u], f = await this.flatmapQueries.queryKnowledge(c, v);
|
|
1568
|
+
return JSON.parse(f);
|
|
1269
1569
|
},
|
|
1270
|
-
queryLabels: async (
|
|
1271
|
-
const c = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(
|
|
1272
|
-
h.length - 1
|
|
1273
|
-
)}) order by entity, source desc`, m = [t, ...h], v = await this.flatmapQueries.queryKnowledge(c, m), p = [];
|
|
1570
|
+
queryLabels: async (u) => {
|
|
1571
|
+
const c = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length - 1)}) order by entity, source desc`, v = [a, ...u], f = await this.flatmapQueries.queryKnowledge(c, v), p = [];
|
|
1274
1572
|
let g;
|
|
1275
|
-
for (const
|
|
1276
|
-
if (
|
|
1277
|
-
const
|
|
1573
|
+
for (const F of f)
|
|
1574
|
+
if (F[1] !== g) {
|
|
1575
|
+
const C = JSON.parse(F[2]);
|
|
1278
1576
|
p.push({
|
|
1279
|
-
entity:
|
|
1280
|
-
label:
|
|
1281
|
-
}), g =
|
|
1577
|
+
entity: F[1],
|
|
1578
|
+
label: C.label || F[1]
|
|
1579
|
+
}), g = F[1];
|
|
1282
1580
|
}
|
|
1283
1581
|
return p;
|
|
1284
1582
|
}
|
|
1285
|
-
},
|
|
1583
|
+
}, h = $();
|
|
1286
1584
|
return {
|
|
1287
1585
|
mockup: !0,
|
|
1288
|
-
getFilterOptions: async (
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
h,
|
|
1292
|
-
c,
|
|
1293
|
-
void 0
|
|
1294
|
-
);
|
|
1295
|
-
return [...o, ...v];
|
|
1586
|
+
getFilterOptions: async (u, c) => {
|
|
1587
|
+
const f = await U(this.flatmapAPI, u, c, void 0);
|
|
1588
|
+
return [...h, ...f];
|
|
1296
1589
|
},
|
|
1297
|
-
getTermNerveMaps:
|
|
1298
|
-
mapImp:
|
|
1590
|
+
getTermNerveMaps: D,
|
|
1591
|
+
mapImp: s
|
|
1299
1592
|
};
|
|
1300
1593
|
},
|
|
1301
1594
|
loadConnectivityExplorerConfig: async function(e) {
|
|
1302
|
-
var
|
|
1303
|
-
const
|
|
1304
|
-
let
|
|
1305
|
-
if (!this.connectivityKnowledge[
|
|
1306
|
-
this.flatmapQueries =
|
|
1307
|
-
const l = await
|
|
1308
|
-
this.connectivityKnowledge[
|
|
1309
|
-
var
|
|
1310
|
-
return (
|
|
1311
|
-
}).sort((
|
|
1595
|
+
var i;
|
|
1596
|
+
const n = e.mapImp, r = w(n), t = e.mockup ? n.resource : n.uuid;
|
|
1597
|
+
let a = [];
|
|
1598
|
+
if (!this.connectivityKnowledge[r]) {
|
|
1599
|
+
this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1600
|
+
const l = await B(n, this.flatmapQueries);
|
|
1601
|
+
this.connectivityKnowledge[r] = l.filter((s) => {
|
|
1602
|
+
var h;
|
|
1603
|
+
return (h = s.connectivity) == null ? void 0 : h.length;
|
|
1604
|
+
}).sort((s, h) => s.label.localeCompare(h.label));
|
|
1312
1605
|
}
|
|
1313
|
-
if (!this.connectivityKnowledge[
|
|
1314
|
-
const l = ((
|
|
1315
|
-
this.connectivityKnowledge[
|
|
1316
|
-
(i) => i.id in l
|
|
1317
|
-
);
|
|
1606
|
+
if (!this.connectivityKnowledge[t]) {
|
|
1607
|
+
const l = ((i = n.pathways) == null ? void 0 : i.paths) || {};
|
|
1608
|
+
this.connectivityKnowledge[t] = this.connectivityKnowledge[r].filter((s) => s.id in l);
|
|
1318
1609
|
}
|
|
1319
|
-
if (!this.connectivityFilterOptions[
|
|
1320
|
-
|
|
1321
|
-
this.connectivityKnowledge[
|
|
1322
|
-
)), e.mockup) {
|
|
1323
|
-
const l = e.getTermNerveMaps() || {}, i = JSON.parse(JSON.stringify(this.connectivityKnowledge[n]));
|
|
1324
|
-
this.connectivityKnowledge[n] = i.map((u) => {
|
|
1610
|
+
if (!this.connectivityFilterOptions[t] && !e.mockup && (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), e.mockup) {
|
|
1611
|
+
const l = e.getTermNerveMaps() || {}, s = JSON.parse(JSON.stringify(this.connectivityKnowledge[t]));
|
|
1612
|
+
this.connectivityKnowledge[t] = s.map((o) => {
|
|
1325
1613
|
var c;
|
|
1326
|
-
let
|
|
1327
|
-
if ((c =
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1614
|
+
let u = o;
|
|
1615
|
+
if ((c = o.nerves) != null && c.length) {
|
|
1616
|
+
const f = o.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
|
|
1617
|
+
f != null && f.length && (a.push(...f), u["nerve-label"] = f.sort((p, g) => p.nerve.localeCompare(g.nerve)));
|
|
1330
1618
|
}
|
|
1331
|
-
return
|
|
1332
|
-
}).filter((
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
if (u.key === "scaffold.connectivity.nerve") {
|
|
1339
|
-
const h = u.children.filter((c) => t.includes(c.label.toLowerCase()));
|
|
1340
|
-
return { ...u, children: h };
|
|
1619
|
+
return u;
|
|
1620
|
+
}).filter((o) => o["nerve-label"]), this.connectivityFilterOptions[t] || (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), a = a.map((o) => o.nerve.toLowerCase());
|
|
1621
|
+
const h = JSON.parse(JSON.stringify(this.connectivityFilterOptions[t]));
|
|
1622
|
+
this.connectivityFilterOptions[t] = h.map((o) => {
|
|
1623
|
+
if (o.key === "scaffold.connectivity.nerve") {
|
|
1624
|
+
const u = o.children.filter((c) => a.includes(c.label.toLowerCase()));
|
|
1625
|
+
return { ...o, children: u };
|
|
1341
1626
|
} else
|
|
1342
|
-
return
|
|
1627
|
+
return o;
|
|
1343
1628
|
});
|
|
1344
1629
|
} else
|
|
1345
|
-
this.connectivityFilterSources[
|
|
1346
|
-
this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge),
|
|
1630
|
+
this.connectivityFilterSources[t] || (this.connectivityFilterSources[t] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
|
|
1631
|
+
this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), m.emit("species-layout-connectivity-update");
|
|
1347
1632
|
},
|
|
1348
1633
|
knowledgeTooltipQuery: async function(e) {
|
|
1349
1634
|
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, { resource: [e.id] });
|
|
1350
|
-
let
|
|
1635
|
+
let n = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
|
|
1351
1636
|
resource: [e.id],
|
|
1352
1637
|
label: e.label,
|
|
1353
1638
|
provenanceTaxonomy: e.taxons,
|
|
1354
1639
|
feature: []
|
|
1355
1640
|
});
|
|
1356
|
-
return
|
|
1641
|
+
return n.knowledgeSource = w(this.flatmapService.mapImp), n.mapId = this.flatmapService.mapImp.mapMetadata.id, n.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, n["nerve-label"] = e["nerve-label"], n.ready = !0, n;
|
|
1357
1642
|
},
|
|
1358
1643
|
getKnowledgeTooltip: async function(e) {
|
|
1359
|
-
this.tooltipEntry = [], e.data.forEach(
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
})
|
|
1365
|
-
), f.emit("connectivity-info-open", this.tooltipEntry);
|
|
1366
|
-
let r = [];
|
|
1367
|
-
for (let n = 0; n < e.data.length; n++)
|
|
1368
|
-
r.push(await this.knowledgeTooltipQuery(e.data[n]));
|
|
1369
|
-
this.tooltipEntry = await Promise.all(r), this.tooltipEntry.map((n) => n.featureId[0]).length > 0 && f.emit("connectivity-info-open", this.tooltipEntry);
|
|
1644
|
+
this.tooltipEntry = [], e.data.forEach((t) => this.tooltipEntry.push({ title: t.label, featureId: [t.id], ready: !1 })), m.emit("connectivity-info-open", this.tooltipEntry);
|
|
1645
|
+
let n = [];
|
|
1646
|
+
for (let t = 0; t < e.data.length; t++)
|
|
1647
|
+
n.push(await this.knowledgeTooltipQuery(e.data[t]));
|
|
1648
|
+
this.tooltipEntry = await Promise.all(n), this.tooltipEntry.map((t) => t.featureId[0]).length > 0 && m.emit("connectivity-info-open", this.tooltipEntry);
|
|
1370
1649
|
},
|
|
1371
|
-
changeConnectivitySource: async function(e,
|
|
1372
|
-
var
|
|
1373
|
-
const { entry:
|
|
1374
|
-
|
|
1375
|
-
this.flatmapService.mapImp,
|
|
1376
|
-
a.featureId[0],
|
|
1377
|
-
n
|
|
1378
|
-
), this.tooltipEntry = this.tooltipEntry.map((i) => i.featureId[0] === a.featureId[0] ? this.flatmapQueries.updateTooltipData(i) : i), f.emit("connectivity-info-open", this.tooltipEntry));
|
|
1650
|
+
changeConnectivitySource: async function(e, n) {
|
|
1651
|
+
var i, l;
|
|
1652
|
+
const { entry: r, connectivitySource: t } = e, a = (l = (i = this == null ? void 0 : this.flatmapService) == null ? void 0 : i.mapImp) == null ? void 0 : l.mapMetadata.uuid;
|
|
1653
|
+
n.includes(a) || (n.push(a), await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp, r.featureId[0], t), this.tooltipEntry = this.tooltipEntry.map((s) => s.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(s) : s), m.emit("connectivity-info-open", this.tooltipEntry));
|
|
1379
1654
|
},
|
|
1380
1655
|
trackEvent: function(e) {
|
|
1381
|
-
|
|
1656
|
+
M.sendEvent(e);
|
|
1382
1657
|
}
|
|
1383
1658
|
},
|
|
1384
1659
|
data: function() {
|
|
1385
1660
|
return {
|
|
1386
1661
|
apiLocation: void 0,
|
|
1387
|
-
activeSpecies:
|
|
1662
|
+
activeSpecies: X,
|
|
1388
1663
|
scaffoldCamera: void 0,
|
|
1389
1664
|
mainStyle: {
|
|
1390
1665
|
height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
|
|
@@ -1420,5 +1695,5 @@ const $ = {
|
|
|
1420
1695
|
}
|
|
1421
1696
|
};
|
|
1422
1697
|
export {
|
|
1423
|
-
|
|
1698
|
+
K as C
|
|
1424
1699
|
};
|