@abi-software/mapintegratedvuer 1.16.1 → 1.16.3-simulation.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/{ContentMixin-C3-OeGQ0.js → ContentMixin-CXBghkG4.js} +224 -455
- package/dist/{style-DobzTuWc.js → DynamicMarkerMixin-C077TWyL.js} +1 -1
- package/dist/Flatmap-CKWEbXwI.js +103454 -0
- package/dist/{Iframe-BDztAIUe.js → Iframe-CImGKtGq.js} +2 -2
- package/dist/{MultiFlatmap-CxvFZqgX.js → MultiFlatmap-jLxHqKwa.js} +15 -15
- package/dist/{Plot-D3Ff5rKZ.js → Plot-CZP1T3yL.js} +2 -2
- package/dist/{Scaffold-BYvsIJcy.js → Scaffold-Z2Jv6mwD.js} +79 -53
- package/dist/Simulation-OtmfB6BF.js +72 -0
- package/dist/{index-CGSECPAp.js → index-Bym6cokq.js} +19683 -20023
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +4271 -231
- package/dist/style.css +1 -1
- package/package.json +9 -4
- package/src/App.vue +290 -260
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentBar.vue +0 -1
- package/src/components/ContentVuer.vue +0 -2
- package/src/components/ContextCard.vue +0 -1
- package/src/components/DummyRouteComponent.vue +1 -0
- package/src/components/EventBus.ts +13 -0
- package/src/components/FloatingWindow.vue +125 -0
- package/src/components/MapContent.vue +1 -3
- package/src/components/PlotComponent.vue +56 -0
- package/src/components/SplitFlow.vue +470 -439
- package/src/components/scripts/utilities.js +1 -1
- package/src/components/viewers/Flatmap.vue +136 -84
- package/src/components/viewers/MultiFlatmap.vue +1 -1
- package/src/components/viewers/Simulation.vue +65 -15
- package/src/components.d.ts +3 -0
- package/src/main.js +9 -3
- package/src/mixins/ContentMixin.js +419 -390
- package/src/services/mapping.js +69 -0
- package/src/stores/entries.js +1 -1
- package/src/stores/mapping.js +29 -0
- package/src/stores/settings.js +0 -4
- package/src/stores/simulationPlotStore.js +104 -0
- package/src/stores/splitFlow.js +427 -362
- package/src/types/simulation.js +18 -0
- package/dist/Flatmap-BbTHRVGX.js +0 -202
- package/dist/Simulation-By8hjqPs.js +0 -28
- package/src/components/EventBus.js +0 -3
|
@@ -1,278 +1,8 @@
|
|
|
1
|
-
import { markRaw as
|
|
2
|
-
import { c as
|
|
3
|
-
import { mapStores as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(r) => JSON.parse(r)
|
|
7
|
-
) : [];
|
|
8
|
-
}, d = [], T = async function(e, r) {
|
|
9
|
-
const t = r.filter(
|
|
10
|
-
(i) => d.some((s) => s.taxon === i)
|
|
11
|
-
), n = d.filter(
|
|
12
|
-
(i) => t.includes(i.taxon)
|
|
13
|
-
), a = r.filter(
|
|
14
|
-
(i) => !t.includes(i)
|
|
15
|
-
);
|
|
16
|
-
if (a.length) {
|
|
17
|
-
const i = await e.queryLabels(a);
|
|
18
|
-
if (i.length)
|
|
19
|
-
return i.forEach((s) => {
|
|
20
|
-
let { entity: l, label: o } = s;
|
|
21
|
-
o === "Mammalia" && (o = "Mammalia not otherwise specified");
|
|
22
|
-
const c = { taxon: l, label: o };
|
|
23
|
-
n.push(c), d.push(c);
|
|
24
|
-
}), n;
|
|
25
|
-
} else
|
|
26
|
-
return n;
|
|
27
|
-
}, L = function(e, r) {
|
|
28
|
-
if (!e || !r) return !1;
|
|
29
|
-
let t = JSON.stringify(e), n = JSON.stringify(r);
|
|
30
|
-
return t.indexOf(n) !== -1;
|
|
31
|
-
}, A = (e, r) => {
|
|
32
|
-
const t = e.name ?? e, n = r.name ?? r, a = t.toUpperCase(), i = n.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.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
|
|
38
|
-
}, this.createTooltipData = async function(e, r) {
|
|
39
|
-
let t = [];
|
|
40
|
-
r.feature.hyperlinks && r.feature.hyperlinks.length > 0 ? t = r.feature.hyperlinks : t = this.rawURLs;
|
|
41
|
-
let n;
|
|
42
|
-
if (r.provenanceTaxonomy) {
|
|
43
|
-
n = [];
|
|
44
|
-
try {
|
|
45
|
-
const i = await T(e, r.provenanceTaxonomy);
|
|
46
|
-
i.length && i.forEach((s) => {
|
|
47
|
-
const { label: l } = s;
|
|
48
|
-
n.push(l);
|
|
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
|
-
title: r.label,
|
|
62
|
-
featureId: r.resource,
|
|
63
|
-
hyperlinks: t,
|
|
64
|
-
provenanceTaxonomy: r.provenanceTaxonomy,
|
|
65
|
-
provenanceTaxonomyLabel: n,
|
|
66
|
-
connectivitySource: this.connectivitySource,
|
|
67
|
-
noMapConnectivity: this.noMapConnectivity
|
|
68
|
-
};
|
|
69
|
-
}, this.updateTooltipData = function(e) {
|
|
70
|
-
return {
|
|
71
|
-
...e,
|
|
72
|
-
origins: this.origins,
|
|
73
|
-
originsWithDatasets: this.originsWithDatasets,
|
|
74
|
-
components: this.components,
|
|
75
|
-
componentsWithDatasets: this.componentsWithDatasets,
|
|
76
|
-
destinations: this.destinations,
|
|
77
|
-
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
78
|
-
connectivitySource: this.connectivitySource,
|
|
79
|
-
noMapConnectivity: this.noMapConnectivity
|
|
80
|
-
};
|
|
81
|
-
}, this.createComponentsLabelList = function(e, r) {
|
|
82
|
-
let t = [];
|
|
83
|
-
return e.forEach((n) => {
|
|
84
|
-
t.push(this.createLabelFromNeuralNode(n[0]), r), n.length === 2 && t.push(this.createLabelFromNeuralNode(n[1]), r);
|
|
85
|
-
}), t;
|
|
86
|
-
}, this.createLabelLookup = function(e, r) {
|
|
87
|
-
return new Promise(async (t) => {
|
|
88
|
-
let n = {};
|
|
89
|
-
this.uberons = [];
|
|
90
|
-
const a = await T(e, r);
|
|
91
|
-
a.length && (a.forEach((i) => {
|
|
92
|
-
const { taxon: s, label: l } = i;
|
|
93
|
-
n[s] = l, this.uberons.push({
|
|
94
|
-
id: s,
|
|
95
|
-
name: l
|
|
96
|
-
});
|
|
97
|
-
}), t(n));
|
|
98
|
-
});
|
|
99
|
-
}, this.buildConnectivitySqlStatement = function(e) {
|
|
100
|
-
let r = "select knowledge from knowledge where entity in (";
|
|
101
|
-
if (e.length === 1)
|
|
102
|
-
r += `'${e[0]}')`;
|
|
103
|
-
else if (e.length > 1)
|
|
104
|
-
for (let t in e)
|
|
105
|
-
r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
|
|
106
|
-
return r;
|
|
107
|
-
}, this.buildLabelSqlStatement = function(e) {
|
|
108
|
-
let r = "select entity, label from labels where entity in (";
|
|
109
|
-
if (e.length === 1)
|
|
110
|
-
r += `'${e[0]}')`;
|
|
111
|
-
else if (e.length > 1)
|
|
112
|
-
for (let t in e)
|
|
113
|
-
r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
|
|
114
|
-
return r;
|
|
115
|
-
}, this.findAllIdsFromConnectivity = function(e) {
|
|
116
|
-
let r = e.connectivity.flat(), t = [...new Set(r)], n = [];
|
|
117
|
-
return t.forEach((a) => {
|
|
118
|
-
Array.isArray(a) ? n.push(a.flat()) : n.push(a);
|
|
119
|
-
}), [...new Set(n.flat())];
|
|
120
|
-
}, this.flattenConnectivity = function(e) {
|
|
121
|
-
let r = e.flat(), t = [...new Set(r)], n = [];
|
|
122
|
-
return t.forEach((a) => {
|
|
123
|
-
Array.isArray(a) ? n.push(a.flat()) : n.push(a);
|
|
124
|
-
}), n.flat();
|
|
125
|
-
}, this.findComponents = function(e, r, t, n) {
|
|
126
|
-
let a = e.connectivity.flat(), i = M(a), s = [], l = !1;
|
|
127
|
-
return i.forEach((o) => {
|
|
128
|
-
l = !1, L(r, o) && (l = !0), n && L(n, o) && (l = !0), L(t, o) && (l = !0), l || s.push(o);
|
|
129
|
-
}), s;
|
|
130
|
-
}, this.retrieveFlatmapKnowledgeForEvent = async function(e, r) {
|
|
131
|
-
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
|
|
132
|
-
const t = r.resource;
|
|
133
|
-
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !t || t.length === 0 || !t[0]) return;
|
|
134
|
-
let n = this.queryForConnectivityNew(e, t[0]);
|
|
135
|
-
return await Promise.all([n]);
|
|
136
|
-
}, this.queryForConnectivityNew = function(e, r, t = "map", n = !0) {
|
|
137
|
-
return this.connectivitySource = t, new Promise((a) => {
|
|
138
|
-
(t === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, r) : e.queryKnowledge(r)).then((s) => {
|
|
139
|
-
if (this.checkConnectivityExists(s)) {
|
|
140
|
-
t === "map" && (this.noMapConnectivity = !1);
|
|
141
|
-
let l = s;
|
|
142
|
-
n ? this.processConnectivity(e, l).then((o) => {
|
|
143
|
-
s.references && (this.rawURLs = [...s.references]), a(o);
|
|
144
|
-
}) : a(l);
|
|
145
|
-
} else t === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(r).then((l) => {
|
|
146
|
-
if (this.checkConnectivityExists(l)) {
|
|
147
|
-
let o = l;
|
|
148
|
-
n ? this.processConnectivity(e, o).then((c) => {
|
|
149
|
-
l.references && (this.rawURLs = [...l.references]), a(c);
|
|
150
|
-
}) : a(o);
|
|
151
|
-
} else
|
|
152
|
-
a(!1);
|
|
153
|
-
}).catch(() => a(!1))) : a(!1);
|
|
154
|
-
}).catch((s) => {
|
|
155
|
-
s.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${r}.`), a(!1);
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
}, this.queryMapConnectivity = async function(e, r) {
|
|
159
|
-
const t = this.flatmapAPI + `flatmap/${e}/connectivity/${r}`;
|
|
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, r, t, n = !0) {
|
|
169
|
-
const a = { sql: this.buildConnectivitySqlStatement(r) }, i = {
|
|
170
|
-
method: "POST",
|
|
171
|
-
headers: {
|
|
172
|
-
"Content-Type": "application/json"
|
|
173
|
-
},
|
|
174
|
-
body: JSON.stringify(a),
|
|
175
|
-
...t ? { signal: t } : {}
|
|
176
|
-
// add signal to header if it exists
|
|
177
|
-
};
|
|
178
|
-
return new Promise((s) => {
|
|
179
|
-
fetch(`${this.flatmapAPI}knowledge/query/`, i).then((l) => l.json()).then((l) => {
|
|
180
|
-
if (this.connectivityExists(l)) {
|
|
181
|
-
let o = JSON.parse(l.values[0][0]);
|
|
182
|
-
n ? this.processConnectivity(e, o).then((c) => {
|
|
183
|
-
s(c);
|
|
184
|
-
}) : s(o);
|
|
185
|
-
} else
|
|
186
|
-
s(!1);
|
|
187
|
-
}).catch((l) => {
|
|
188
|
-
l.name === "AbortError" || console.error("Error:", l), s(!1);
|
|
189
|
-
});
|
|
190
|
-
});
|
|
191
|
-
}, this.checkConnectivityExists = function(e) {
|
|
192
|
-
var r;
|
|
193
|
-
return e && ((r = e.connectivity) == null ? void 0 : r.length);
|
|
194
|
-
}, this.connectivityExists = function(e) {
|
|
195
|
-
return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
|
|
196
|
-
}, this.findIfNodeIsSingle = function(e) {
|
|
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
|
-
}, this.createLabelFromNeuralNode = function(e, r) {
|
|
199
|
-
let t = this.findIfNodeIsSingle(e);
|
|
200
|
-
if (t)
|
|
201
|
-
return r[t];
|
|
202
|
-
let n = r[e[0]];
|
|
203
|
-
return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
|
|
204
|
-
r[a] == null ? n += `, ${a}` : n += `, ${r[a]}`;
|
|
205
|
-
}), n;
|
|
206
|
-
}, this.flattenAndFindDatasets = function(e, r, t) {
|
|
207
|
-
let n = this.flattenConnectivity(e), a = this.flattenConnectivity(r), i = this.flattenConnectivity(t);
|
|
208
|
-
this.originsWithDatasets = this.uberons.filter(
|
|
209
|
-
(s) => n.indexOf(s.id) !== -1
|
|
210
|
-
).sort(A), this.componentsWithDatasets = this.uberons.filter(
|
|
211
|
-
(s) => a.indexOf(s.id) !== -1
|
|
212
|
-
).sort(A), this.destinationsWithDatasets = this.uberons.filter(
|
|
213
|
-
(s) => i.indexOf(s.id) !== -1
|
|
214
|
-
).sort(A);
|
|
215
|
-
}, this.processConnectivity = function(e, r) {
|
|
216
|
-
return new Promise((t) => {
|
|
217
|
-
let n = [], a = [], i;
|
|
218
|
-
if (r && r["node-phenotypes"]) {
|
|
219
|
-
const o = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
|
220
|
-
o.forEach((u) => {
|
|
221
|
-
u in r["node-phenotypes"] && n.push(...r["node-phenotypes"][u]);
|
|
222
|
-
}), n = M(n), c.forEach((u) => {
|
|
223
|
-
u in r["node-phenotypes"] && a.push(...r["node-phenotypes"][u]);
|
|
224
|
-
}), a = M(a);
|
|
225
|
-
} else
|
|
226
|
-
a = M(r.axons), r.somas && r.somas.length > 0 && n.push(...r.somas), r.dendrites && r.dendrites.length > 0 && n.push(...r.dendrites), n = M(n), i = r.somas;
|
|
227
|
-
const s = this.findComponents(r, a, n, i), l = this.findAllIdsFromConnectivity(r);
|
|
228
|
-
this.createLabelLookup(e, l).then((o) => {
|
|
229
|
-
this.origins = n.map(
|
|
230
|
-
(c) => this.createLabelFromNeuralNode(c, o)
|
|
231
|
-
).sort(A), this.components = s.map(
|
|
232
|
-
(c) => this.createLabelFromNeuralNode(c, o)
|
|
233
|
-
).sort(A), this.destinations = a.map(
|
|
234
|
-
(c) => this.createLabelFromNeuralNode(c, o)
|
|
235
|
-
).sort(A), this.flattenAndFindDatasets(n, s, a), t({
|
|
236
|
-
ids: {
|
|
237
|
-
dendrites: n,
|
|
238
|
-
components: s,
|
|
239
|
-
axons: a
|
|
240
|
-
},
|
|
241
|
-
labels: {
|
|
242
|
-
origins: this.origins,
|
|
243
|
-
components: this.components,
|
|
244
|
-
destinations: this.destinations
|
|
245
|
-
}
|
|
246
|
-
});
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
}, this.buildPubmedSqlStatement = function(e) {
|
|
250
|
-
let r = "select distinct publication from publications where entity in (";
|
|
251
|
-
if (e.length === 1)
|
|
252
|
-
r += `'${e[0]}')`;
|
|
253
|
-
else if (e.length > 1)
|
|
254
|
-
for (let t in e)
|
|
255
|
-
r += `'${e[t]}'${t >= e.length - 1 ? ")" : ","} `;
|
|
256
|
-
return r;
|
|
257
|
-
}, this.buildPubmedSqlStatementForModels = function(e) {
|
|
258
|
-
return `select distinct publication from publications where entity = '${e}'`;
|
|
259
|
-
}, this.queryKnowledge = async (e, r) => {
|
|
260
|
-
const t = `${this.flatmapAPI}/knowledge/query/`, a = await fetch(t, {
|
|
261
|
-
method: "POST",
|
|
262
|
-
headers: {
|
|
263
|
-
Accept: "application/json"
|
|
264
|
-
},
|
|
265
|
-
body: JSON.stringify({ sql: e, params: r })
|
|
266
|
-
});
|
|
267
|
-
if (!a.ok)
|
|
268
|
-
throw new Error(`Cannot access ${t}`);
|
|
269
|
-
const i = await a.json();
|
|
270
|
-
if ("error" in i)
|
|
271
|
-
throw new TypeError(i.error);
|
|
272
|
-
return i.values;
|
|
273
|
-
};
|
|
274
|
-
};
|
|
275
|
-
const I = [
|
|
1
|
+
import { markRaw as M } from "vue";
|
|
2
|
+
import { c as T, u as w, d as I, e as S, f as _, T as F, E as f, h as b, i as C, J as O } from "./index-Bym6cokq.js";
|
|
3
|
+
import { mapStores as E } from "pinia";
|
|
4
|
+
import { getKnowledgeSource as d, FlatmapQueries as L, loadAndStoreKnowledge as N } from "@abi-software/flatmapvuer";
|
|
5
|
+
const R = [
|
|
276
6
|
{
|
|
277
7
|
id: 0,
|
|
278
8
|
nerve_id: "ILX:0793723",
|
|
@@ -1085,50 +815,50 @@ const I = [
|
|
|
1085
815
|
"FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
|
|
1086
816
|
"subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
|
|
1087
817
|
}
|
|
1088
|
-
],
|
|
818
|
+
], B = () => {
|
|
1089
819
|
const e = {};
|
|
1090
|
-
return
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1093
|
-
if (!
|
|
820
|
+
return R.forEach((r) => {
|
|
821
|
+
const a = r.nerve_id, n = r.label.toLowerCase(), t = r["subclass labels"];
|
|
822
|
+
if (a && n !== "nerve") {
|
|
823
|
+
if (!t.length)
|
|
1094
824
|
return;
|
|
1095
|
-
|
|
1096
|
-
const
|
|
1097
|
-
e[
|
|
825
|
+
a in e || (e[a] = {});
|
|
826
|
+
const s = t.map((l) => l.toLowerCase()).sort();
|
|
827
|
+
e[a] = {
|
|
1098
828
|
nerve: n,
|
|
1099
|
-
subNerves:
|
|
829
|
+
subNerves: s
|
|
1100
830
|
};
|
|
1101
831
|
}
|
|
1102
832
|
}), e;
|
|
1103
|
-
},
|
|
833
|
+
}, X = () => {
|
|
1104
834
|
let e = [], r = {
|
|
1105
835
|
key: "scaffold.connectivity.nerve",
|
|
1106
836
|
label: "Nerves",
|
|
1107
837
|
children: []
|
|
1108
|
-
},
|
|
1109
|
-
for (const n of
|
|
838
|
+
}, a = [];
|
|
839
|
+
for (const n of R) {
|
|
1110
840
|
if (n.label === "nerve")
|
|
1111
841
|
continue;
|
|
1112
|
-
let
|
|
842
|
+
let t = {
|
|
1113
843
|
facetPropPath: "scaffold.connectivity.nerve",
|
|
1114
844
|
label: "",
|
|
1115
845
|
children: []
|
|
1116
|
-
},
|
|
1117
|
-
for (const [
|
|
1118
|
-
if (
|
|
1119
|
-
for (const o of
|
|
1120
|
-
|
|
846
|
+
}, s = [];
|
|
847
|
+
for (const [l, i] of Object.entries(n))
|
|
848
|
+
if (l === "label" && (t.label = i), l === "subclass labels")
|
|
849
|
+
for (const o of i)
|
|
850
|
+
s.push({
|
|
1121
851
|
facetPropPath: "scaffold.connectivity.subnerve",
|
|
1122
852
|
label: o
|
|
1123
853
|
});
|
|
1124
|
-
|
|
854
|
+
s.length && (t.children = s.sort((l, i) => l.label.localeCompare(i.label)), a.push(t));
|
|
1125
855
|
}
|
|
1126
|
-
return
|
|
856
|
+
return a.length && (r.children = a.sort((n, t) => n.label.localeCompare(t.label)), e.push(r)), e;
|
|
1127
857
|
};
|
|
1128
|
-
function
|
|
858
|
+
function x(e) {
|
|
1129
859
|
return e[0].toUpperCase() + e.substring(1);
|
|
1130
860
|
}
|
|
1131
|
-
const
|
|
861
|
+
const $ = {
|
|
1132
862
|
emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
|
|
1133
863
|
props: {
|
|
1134
864
|
/**
|
|
@@ -1147,7 +877,7 @@ const J = {
|
|
|
1147
877
|
},
|
|
1148
878
|
inject: ["showGlobalSettings", "showOpenMapButton"],
|
|
1149
879
|
computed: {
|
|
1150
|
-
...
|
|
880
|
+
...E(T, w, I, S),
|
|
1151
881
|
idNamePair() {
|
|
1152
882
|
return this.splitFlowStore.idNamePair;
|
|
1153
883
|
},
|
|
@@ -1173,17 +903,19 @@ const J = {
|
|
|
1173
903
|
},
|
|
1174
904
|
methods: {
|
|
1175
905
|
toggleMinimap: function(e, r) {
|
|
1176
|
-
var
|
|
906
|
+
var a;
|
|
1177
907
|
if (this.multiflatmapRef) {
|
|
1178
|
-
const n = this.multiflatmapRef.getCurrentFlatmap(),
|
|
1179
|
-
if (
|
|
908
|
+
const n = this.multiflatmapRef.getCurrentFlatmap(), t = n == null ? void 0 : n.mapImp;
|
|
909
|
+
if (t)
|
|
1180
910
|
if (e === !0) {
|
|
1181
911
|
if (r === !1) {
|
|
1182
|
-
const
|
|
1183
|
-
|
|
912
|
+
const s = ((a = t.options) == null ? void 0 : a.minimap) || {
|
|
913
|
+
position: "top-right"
|
|
914
|
+
};
|
|
915
|
+
t.createMinimap(s), n.addResizeButtonToMinimap(), n.minimapSmall = !1;
|
|
1184
916
|
}
|
|
1185
917
|
} else
|
|
1186
|
-
|
|
918
|
+
t.closeMinimap();
|
|
1187
919
|
}
|
|
1188
920
|
},
|
|
1189
921
|
onConnectivityItemClose() {
|
|
@@ -1204,7 +936,7 @@ const J = {
|
|
|
1204
936
|
this.settingsStore.updateMapManager(e);
|
|
1205
937
|
},
|
|
1206
938
|
trackOpenMap: function(e) {
|
|
1207
|
-
|
|
939
|
+
F.sendEvent({
|
|
1208
940
|
event: "interaction_event",
|
|
1209
941
|
event_name: "portal_maps_open_map",
|
|
1210
942
|
category: e,
|
|
@@ -1234,14 +966,14 @@ const J = {
|
|
|
1234
966
|
* Callback when the vuers emit a selected event.
|
|
1235
967
|
*/
|
|
1236
968
|
resourceSelected: function(e, r) {
|
|
1237
|
-
var
|
|
1238
|
-
const
|
|
1239
|
-
if (this.resourceHasAction(
|
|
1240
|
-
f.emit("PopoverActionClick",
|
|
969
|
+
var l, i, o, u;
|
|
970
|
+
const a = r[0];
|
|
971
|
+
if (this.resourceHasAction(a)) {
|
|
972
|
+
f.emit("PopoverActionClick", a);
|
|
1241
973
|
return;
|
|
1242
974
|
}
|
|
1243
|
-
let n,
|
|
1244
|
-
const
|
|
975
|
+
let n, t = !1;
|
|
976
|
+
const s = {
|
|
1245
977
|
paneIndex: this.entry.id,
|
|
1246
978
|
type: e,
|
|
1247
979
|
resource: r,
|
|
@@ -1249,44 +981,41 @@ const J = {
|
|
|
1249
981
|
eventType: void 0
|
|
1250
982
|
};
|
|
1251
983
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
|
1252
|
-
if (
|
|
1253
|
-
if (
|
|
1254
|
-
let
|
|
1255
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
|
984
|
+
if (s.internalName = (l = a == null ? void 0 : a.feature) != null && l.label ? a.feature.label : this.idNamePair[a.feature.models], a.eventType == "click") {
|
|
985
|
+
if (s.eventType = "selected", a.feature.type == "marker") {
|
|
986
|
+
let h = s.internalName;
|
|
987
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(a.feature.id))
|
|
1256
988
|
n = {
|
|
1257
989
|
type: "Search",
|
|
1258
|
-
term: this.settingsStore.featuredMarkerDoi(
|
|
990
|
+
term: this.settingsStore.featuredMarkerDoi(a.feature.id),
|
|
1259
991
|
featuredDataset: !0
|
|
1260
992
|
};
|
|
1261
993
|
else {
|
|
1262
994
|
n = {
|
|
1263
995
|
type: "Facet",
|
|
1264
|
-
facets: [
|
|
996
|
+
facets: [h]
|
|
1265
997
|
};
|
|
1266
|
-
let
|
|
1267
|
-
if (
|
|
1268
|
-
|
|
1269
|
-
}),
|
|
998
|
+
let c = /* @__PURE__ */ new Set();
|
|
999
|
+
if (a.feature["dataset-terms"].forEach((m) => {
|
|
1000
|
+
c.add(m.label ? m.label : m.term);
|
|
1001
|
+
}), c.size === 0 && c.add(h), n.facets = [...c], this.settingsStore.hasAppliedFacets(c) && this.settingsStore.appliedFacets.length <= c.size)
|
|
1270
1002
|
return;
|
|
1271
1003
|
if (this.settingsStore.appliedFacets.length) {
|
|
1272
|
-
if (!this.settingsStore.hasAppliedFacets(
|
|
1273
|
-
const m = [.../* @__PURE__ */ new Set([
|
|
1274
|
-
...this.settingsStore.appliedFacets,
|
|
1275
|
-
...h
|
|
1276
|
-
])];
|
|
1004
|
+
if (!this.settingsStore.hasAppliedFacets(c)) {
|
|
1005
|
+
const m = [.../* @__PURE__ */ new Set([...this.settingsStore.appliedFacets, ...c])];
|
|
1277
1006
|
this.settingsStore.updateAppliedFacets(m);
|
|
1278
1007
|
}
|
|
1279
1008
|
} else
|
|
1280
|
-
|
|
1009
|
+
c.size > 1 && (n.type = "Facets"), this.settingsStore.updateAppliedFacets(n.facets);
|
|
1281
1010
|
}
|
|
1282
|
-
|
|
1011
|
+
t = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
|
1283
1012
|
}
|
|
1284
|
-
} else
|
|
1285
|
-
else e == "Scaffold" && (
|
|
1013
|
+
} else a.eventType == "mouseenter" && (s.eventType = "highlighted", t = !0);
|
|
1014
|
+
else e == "Scaffold" && (a && ((((i = a.data) == null ? void 0 : i.id) === void 0 || ((o = a.data) == null ? void 0 : o.id) === "") && (a.data.id = (u = a.data) == null ? void 0 : u.group), s.internalName = a.data.id, a.data.lastActionOnMarker === !0 && (n = {
|
|
1286
1015
|
type: "Facet",
|
|
1287
|
-
facets: [
|
|
1288
|
-
})),
|
|
1289
|
-
n && f.emit("PopoverActionClick", n),
|
|
1016
|
+
facets: [x(a.data.id)]
|
|
1017
|
+
})), s.eventType = "selected", t = !0);
|
|
1018
|
+
n && f.emit("PopoverActionClick", n), t && this.$emit("resource-selected", s);
|
|
1290
1019
|
},
|
|
1291
1020
|
resourceHasAction: function(e) {
|
|
1292
1021
|
return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
|
|
@@ -1299,63 +1028,63 @@ const J = {
|
|
|
1299
1028
|
getNameAndIdFromSyncData: async function(e) {
|
|
1300
1029
|
let r = e.internalName;
|
|
1301
1030
|
r === void 0 && e.resource && (r = e.resource.label);
|
|
1302
|
-
let
|
|
1303
|
-
if (e.resource && e.resource.resource && (
|
|
1031
|
+
let a;
|
|
1032
|
+
if (e.resource && e.resource.resource && (a = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
|
1304
1033
|
if (this.$refs.scaffold.findObjectsWithGroupName(r).length === 0) {
|
|
1305
1034
|
if (e.resource && e.resource.feature) {
|
|
1306
|
-
const
|
|
1307
|
-
if (
|
|
1035
|
+
const s = b(e.resource.feature.models);
|
|
1036
|
+
if (s.length > 0) return s;
|
|
1308
1037
|
}
|
|
1309
|
-
let
|
|
1310
|
-
if (
|
|
1311
|
-
return
|
|
1312
|
-
if (
|
|
1313
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
|
1314
|
-
var
|
|
1315
|
-
if (((
|
|
1316
|
-
return r =
|
|
1038
|
+
let t = C(r);
|
|
1039
|
+
if (t)
|
|
1040
|
+
return t;
|
|
1041
|
+
if (a && e.eventType === "selected")
|
|
1042
|
+
return fetch(`${this.apiLocation}get-related-terms/${a}`).then((s) => s.json()).then((s) => {
|
|
1043
|
+
var l;
|
|
1044
|
+
if (((l = s.uberon) == null ? void 0 : l.array.length) > 0)
|
|
1045
|
+
return r = s.uberon.array[0].name.charAt(0).toUpperCase() + s.uberon.array[0].name.slice(1), a = s.uberon.array[0].id.toUpperCase(), { id: a, name: r };
|
|
1317
1046
|
});
|
|
1318
1047
|
}
|
|
1319
1048
|
} else if (this.entry.type === "MultiFlatmap")
|
|
1320
1049
|
if (r === "Bladder")
|
|
1321
1050
|
r = "Urinary Bladder";
|
|
1322
1051
|
else {
|
|
1323
|
-
const n =
|
|
1052
|
+
const n = b(r);
|
|
1324
1053
|
n.length > 0 && (r = n[0]);
|
|
1325
1054
|
}
|
|
1326
|
-
return { id:
|
|
1055
|
+
return { id: a, name: r };
|
|
1327
1056
|
},
|
|
1328
1057
|
// Get the species and andaotmy info for the featured datasets
|
|
1329
1058
|
getDatasetAnatomyInfo: function(e) {
|
|
1330
1059
|
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((r) => r.json()).then((r) => {
|
|
1331
|
-
const
|
|
1060
|
+
const a = r.result[0];
|
|
1332
1061
|
let n;
|
|
1333
1062
|
try {
|
|
1334
|
-
n =
|
|
1063
|
+
n = a.anatomy.organ[0].curie;
|
|
1335
1064
|
} catch {
|
|
1336
1065
|
n = void 0;
|
|
1337
1066
|
}
|
|
1338
|
-
let
|
|
1067
|
+
let t;
|
|
1339
1068
|
try {
|
|
1340
|
-
|
|
1069
|
+
t = a.item.curie;
|
|
1341
1070
|
} catch {
|
|
1342
|
-
|
|
1071
|
+
t = void 0;
|
|
1343
1072
|
}
|
|
1344
|
-
let
|
|
1073
|
+
let s;
|
|
1345
1074
|
try {
|
|
1346
|
-
let
|
|
1347
|
-
for (; !
|
|
1348
|
-
const o =
|
|
1349
|
-
o.species && (
|
|
1075
|
+
let l = 0, i = !1;
|
|
1076
|
+
for (; !i && l < a.organisms.subject.length; ) {
|
|
1077
|
+
const o = a.organisms.subject[l];
|
|
1078
|
+
o.species && (s = o.species.name, i = !0), l += 1;
|
|
1350
1079
|
}
|
|
1351
1080
|
} catch {
|
|
1352
|
-
|
|
1081
|
+
s = void 0;
|
|
1353
1082
|
}
|
|
1354
1083
|
this.settingsStore.updateFeaturedMarker({
|
|
1355
1084
|
identifier: e,
|
|
1356
1085
|
marker: n,
|
|
1357
|
-
doi:
|
|
1358
|
-
species:
|
|
1086
|
+
doi: t,
|
|
1087
|
+
species: s
|
|
1359
1088
|
});
|
|
1360
1089
|
});
|
|
1361
1090
|
},
|
|
@@ -1367,24 +1096,41 @@ const J = {
|
|
|
1367
1096
|
// Check if the new featured dataset api has any info
|
|
1368
1097
|
newFeaturedDatasetApiHasInfo: async function() {
|
|
1369
1098
|
let r = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
|
1370
|
-
return !r.datasets || r.datasets.length == 0 ? !1 : r.datasets.map((
|
|
1099
|
+
return !r.datasets || r.datasets.length == 0 ? !1 : r.datasets.map((a) => a.id);
|
|
1371
1100
|
},
|
|
1372
1101
|
flatmapResourceSelected: function(e, r) {
|
|
1373
|
-
var
|
|
1102
|
+
var l;
|
|
1374
1103
|
this.resourceSelected(e, r);
|
|
1375
|
-
const
|
|
1376
|
-
if (n === "click" &&
|
|
1377
|
-
const
|
|
1104
|
+
const a = r[0], { eventType: n, feature: t } = a, { viewingMode: s } = this.settingsStore.globalSettings;
|
|
1105
|
+
if (n === "click" && t.type === "feature" && ((l = t.models) != null && l.startsWith("ilxtr:"))) {
|
|
1106
|
+
const i = [];
|
|
1378
1107
|
r.forEach((o) => {
|
|
1379
|
-
const { models:
|
|
1380
|
-
|
|
1381
|
-
}),
|
|
1108
|
+
const { models: u } = o.feature;
|
|
1109
|
+
i.push(u);
|
|
1110
|
+
}), F.sendEvent({
|
|
1382
1111
|
event: "interaction_event",
|
|
1383
1112
|
event_name: "portal_maps_connectivity",
|
|
1384
|
-
category:
|
|
1385
|
-
location: e + " " +
|
|
1113
|
+
category: i.join(", "),
|
|
1114
|
+
location: e + " " + s
|
|
1386
1115
|
});
|
|
1387
1116
|
}
|
|
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
|
+
}
|
|
1388
1134
|
},
|
|
1389
1135
|
/**
|
|
1390
1136
|
* Get a list of featured datasets to display.
|
|
@@ -1393,11 +1139,11 @@ const J = {
|
|
|
1393
1139
|
let e = [], r = await this.oldFeaturedDatasetApiHasInfo();
|
|
1394
1140
|
if (r) e = r;
|
|
1395
1141
|
else {
|
|
1396
|
-
let
|
|
1397
|
-
|
|
1142
|
+
let a = await this.newFeaturedDatasetApiHasInfo();
|
|
1143
|
+
a && (e = a);
|
|
1398
1144
|
}
|
|
1399
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
|
1400
|
-
this.getDatasetAnatomyInfo(
|
|
1145
|
+
this.settingsStore.updateFeatured(e), e.forEach((a) => {
|
|
1146
|
+
this.getDatasetAnatomyInfo(a);
|
|
1401
1147
|
});
|
|
1402
1148
|
},
|
|
1403
1149
|
flatmapMarkerUpdate() {
|
|
@@ -1435,42 +1181,40 @@ const J = {
|
|
|
1435
1181
|
checkEndHelpMouseDown: function(e) {
|
|
1436
1182
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
|
1437
1183
|
},
|
|
1438
|
-
flatmapHighlight: async function(e, r,
|
|
1439
|
-
let
|
|
1440
|
-
const
|
|
1441
|
-
if (
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1184
|
+
flatmapHighlight: async function(e, r, a, n) {
|
|
1185
|
+
let t = [...r, ...n];
|
|
1186
|
+
const s = this.settingsStore.globalSettings;
|
|
1187
|
+
if (s.highlightConnectedPaths) {
|
|
1188
|
+
const l = r.length ? r : n.length ? n : [], i = await e.retrieveConnectedPaths(l);
|
|
1189
|
+
i && t.push(...i);
|
|
1444
1190
|
}
|
|
1445
|
-
if (
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1191
|
+
if (s.highlightDOIPaths) {
|
|
1192
|
+
const l = await e.searchConnectivitiesByReference(a);
|
|
1193
|
+
l && t.push(...l);
|
|
1448
1194
|
}
|
|
1449
|
-
return
|
|
1195
|
+
return t = [...new Set(t)], t;
|
|
1450
1196
|
},
|
|
1451
1197
|
sidebarHoverHighlight: function(e) {
|
|
1452
|
-
var r,
|
|
1198
|
+
var r, a;
|
|
1453
1199
|
if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
|
|
1454
|
-
const n = this.settingsStore.hoverAnatomies,
|
|
1455
|
-
let
|
|
1456
|
-
this.flatmapRef && (
|
|
1457
|
-
(n.length ||
|
|
1200
|
+
const n = this.settingsStore.hoverAnatomies, t = this.settingsStore.hoverOrgans, s = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
|
|
1201
|
+
let i = null, o = null;
|
|
1202
|
+
this.flatmapRef && (i = this.flatmapRef), this.multiflatmapRef && (i = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (o = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !t.length && !s && !l.length && ((this.multiflatmapRef || this.flatmapRef) && i ? i.mapImp && !i.mapImp.contextLost && ((r = i.mapImp) == null || r.clearSearchResults(), e.connectivityProcessed && ((a = i.mapImp) == null || a.setPaint({ dimmed: !0 }))) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1)), this.highlightDelay = setTimeout(() => {
|
|
1203
|
+
(n.length || t.length || s || l.length) && ((this.multiflatmapRef || this.flatmapRef) && i ? this.flatmapHighlight(i, n, s, l).then((u) => {
|
|
1458
1204
|
try {
|
|
1459
|
-
|
|
1460
|
-
connectivityInfo: { featureId:
|
|
1205
|
+
i.showConnectivityTooltips({
|
|
1206
|
+
connectivityInfo: { featureId: u },
|
|
1461
1207
|
data: []
|
|
1462
1208
|
});
|
|
1463
|
-
} catch
|
|
1464
|
-
if (
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
(v) => this.connectivityKnowledge[
|
|
1468
|
-
|
|
1469
|
-
)
|
|
1470
|
-
) || l.mapImp && !l.mapImp.contextLost && l.mapImp.clearSearchResults();
|
|
1209
|
+
} catch {
|
|
1210
|
+
if (l.length && i.mapImp) {
|
|
1211
|
+
const c = i.mapImp.uuid;
|
|
1212
|
+
u.every(
|
|
1213
|
+
(v) => this.connectivityKnowledge[c].some((p) => p.id === v)
|
|
1214
|
+
) || i.mapImp && !i.mapImp.contextLost && i.mapImp.clearSearchResults();
|
|
1471
1215
|
}
|
|
1472
1216
|
}
|
|
1473
|
-
}) : this.scaffoldRef && o && o.changeHighlightedByName(
|
|
1217
|
+
}) : this.scaffoldRef && o && o.changeHighlightedByName(t, "", !1));
|
|
1474
1218
|
}, 100);
|
|
1475
1219
|
}
|
|
1476
1220
|
},
|
|
@@ -1507,80 +1251,95 @@ const J = {
|
|
|
1507
1251
|
this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
|
|
1508
1252
|
},
|
|
1509
1253
|
mockUpFlatmapService: async function() {
|
|
1510
|
-
const
|
|
1511
|
-
this.flatmapQueries =
|
|
1512
|
-
const
|
|
1254
|
+
const a = (await (await fetch(this.flatmapAPI)).json()).filter((h) => h.id === "human-flatmap_male").sort((h, c) => c.created.localeCompare(h.created))[0], n = a.uuid, t = a.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${n}/pathways`)).json();
|
|
1255
|
+
this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1256
|
+
const i = {
|
|
1513
1257
|
mapMetadata: {
|
|
1514
1258
|
uuid: n,
|
|
1515
1259
|
connectivity: {
|
|
1516
|
-
...
|
|
1260
|
+
...a.sckan
|
|
1517
1261
|
}
|
|
1518
1262
|
},
|
|
1519
|
-
pathways:
|
|
1263
|
+
pathways: l,
|
|
1520
1264
|
resource: this.entry.resource,
|
|
1521
|
-
knowledgeSource:
|
|
1522
|
-
queryKnowledge: async (
|
|
1523
|
-
const
|
|
1265
|
+
knowledgeSource: t,
|
|
1266
|
+
queryKnowledge: async (h) => {
|
|
1267
|
+
const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", m = [t, h], v = await this.flatmapQueries.queryKnowledge(c, m);
|
|
1524
1268
|
return JSON.parse(v);
|
|
1525
1269
|
},
|
|
1526
|
-
queryLabels: async (
|
|
1527
|
-
const
|
|
1270
|
+
queryLabels: async (h) => {
|
|
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 = [];
|
|
1528
1274
|
let g;
|
|
1529
|
-
for (const
|
|
1530
|
-
if (
|
|
1531
|
-
const
|
|
1275
|
+
for (const A of v)
|
|
1276
|
+
if (A[1] !== g) {
|
|
1277
|
+
const y = JSON.parse(A[2]);
|
|
1532
1278
|
p.push({
|
|
1533
|
-
entity:
|
|
1534
|
-
label:
|
|
1535
|
-
}), g =
|
|
1279
|
+
entity: A[1],
|
|
1280
|
+
label: y.label || A[1]
|
|
1281
|
+
}), g = A[1];
|
|
1536
1282
|
}
|
|
1537
1283
|
return p;
|
|
1538
1284
|
}
|
|
1539
|
-
}, o =
|
|
1285
|
+
}, o = X();
|
|
1540
1286
|
return {
|
|
1541
1287
|
mockup: !0,
|
|
1542
|
-
getFilterOptions: async (
|
|
1543
|
-
const v = await
|
|
1288
|
+
getFilterOptions: async (h, c) => {
|
|
1289
|
+
const v = await O(
|
|
1290
|
+
this.flatmapAPI,
|
|
1291
|
+
h,
|
|
1292
|
+
c,
|
|
1293
|
+
void 0
|
|
1294
|
+
);
|
|
1544
1295
|
return [...o, ...v];
|
|
1545
1296
|
},
|
|
1546
|
-
getTermNerveMaps:
|
|
1547
|
-
mapImp:
|
|
1297
|
+
getTermNerveMaps: B,
|
|
1298
|
+
mapImp: i
|
|
1548
1299
|
};
|
|
1549
1300
|
},
|
|
1550
1301
|
loadConnectivityExplorerConfig: async function(e) {
|
|
1551
|
-
var
|
|
1552
|
-
const r = e.mapImp,
|
|
1553
|
-
let
|
|
1554
|
-
if (!this.connectivityKnowledge[
|
|
1555
|
-
this.flatmapQueries =
|
|
1556
|
-
const
|
|
1557
|
-
this.connectivityKnowledge[
|
|
1302
|
+
var s;
|
|
1303
|
+
const r = e.mapImp, a = d(r), n = e.mockup ? r.resource : r.uuid;
|
|
1304
|
+
let t = [];
|
|
1305
|
+
if (!this.connectivityKnowledge[a]) {
|
|
1306
|
+
this.flatmapQueries = M(new L()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1307
|
+
const l = await N(r, this.flatmapQueries);
|
|
1308
|
+
this.connectivityKnowledge[a] = l.filter((i) => {
|
|
1558
1309
|
var o;
|
|
1559
|
-
return (o =
|
|
1560
|
-
}).sort((
|
|
1310
|
+
return (o = i.connectivity) == null ? void 0 : o.length;
|
|
1311
|
+
}).sort((i, o) => i.label.localeCompare(o.label));
|
|
1561
1312
|
}
|
|
1562
1313
|
if (!this.connectivityKnowledge[n]) {
|
|
1563
|
-
const
|
|
1564
|
-
this.connectivityKnowledge[n] = this.connectivityKnowledge[
|
|
1314
|
+
const l = ((s = r.pathways) == null ? void 0 : s.paths) || {};
|
|
1315
|
+
this.connectivityKnowledge[n] = this.connectivityKnowledge[a].filter(
|
|
1316
|
+
(i) => i.id in l
|
|
1317
|
+
);
|
|
1565
1318
|
}
|
|
1566
|
-
if (!this.connectivityFilterOptions[n] && !e.mockup && (this.connectivityFilterOptions[n] = await e.getFilterOptions(
|
|
1567
|
-
|
|
1568
|
-
this.connectivityKnowledge[n]
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1319
|
+
if (!this.connectivityFilterOptions[n] && !e.mockup && (this.connectivityFilterOptions[n] = await e.getFilterOptions(
|
|
1320
|
+
r,
|
|
1321
|
+
this.connectivityKnowledge[n]
|
|
1322
|
+
)), e.mockup) {
|
|
1323
|
+
const l = e.getTermNerveMaps() || {}, i = JSON.parse(JSON.stringify(this.connectivityKnowledge[n]));
|
|
1324
|
+
this.connectivityKnowledge[n] = i.map((u) => {
|
|
1325
|
+
var c;
|
|
1326
|
+
let h = u;
|
|
1327
|
+
if ((c = u.nerves) != null && c.length) {
|
|
1328
|
+
const v = u.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
|
|
1329
|
+
v != null && v.length && (t.push(...v), h["nerve-label"] = v.sort((p, g) => p.nerve.localeCompare(g.nerve)));
|
|
1574
1330
|
}
|
|
1575
|
-
return
|
|
1576
|
-
}).filter((
|
|
1331
|
+
return h;
|
|
1332
|
+
}).filter((u) => u["nerve-label"]), this.connectivityFilterOptions[n] || (this.connectivityFilterOptions[n] = await e.getFilterOptions(
|
|
1333
|
+
r,
|
|
1334
|
+
this.connectivityKnowledge[n]
|
|
1335
|
+
)), t = t.map((u) => u.nerve.toLowerCase());
|
|
1577
1336
|
const o = JSON.parse(JSON.stringify(this.connectivityFilterOptions[n]));
|
|
1578
|
-
this.connectivityFilterOptions[n] = o.map((
|
|
1579
|
-
if (
|
|
1580
|
-
const
|
|
1581
|
-
return { ...
|
|
1337
|
+
this.connectivityFilterOptions[n] = o.map((u) => {
|
|
1338
|
+
if (u.key === "scaffold.connectivity.nerve") {
|
|
1339
|
+
const h = u.children.filter((c) => t.includes(c.label.toLowerCase()));
|
|
1340
|
+
return { ...u, children: h };
|
|
1582
1341
|
} else
|
|
1583
|
-
return
|
|
1342
|
+
return u;
|
|
1584
1343
|
});
|
|
1585
1344
|
} else
|
|
1586
1345
|
this.connectivityFilterSources[n] || (this.connectivityFilterSources[n] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
|
|
@@ -1594,28 +1353,38 @@ const J = {
|
|
|
1594
1353
|
provenanceTaxonomy: e.taxons,
|
|
1595
1354
|
feature: []
|
|
1596
1355
|
});
|
|
1597
|
-
return r.knowledgeSource =
|
|
1356
|
+
return r.knowledgeSource = d(this.flatmapService.mapImp), r.mapId = this.flatmapService.mapImp.mapMetadata.id, r.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, r["nerve-label"] = e["nerve-label"], r.ready = !0, r;
|
|
1598
1357
|
},
|
|
1599
1358
|
getKnowledgeTooltip: async function(e) {
|
|
1600
|
-
this.tooltipEntry = [], e.data.forEach(
|
|
1359
|
+
this.tooltipEntry = [], e.data.forEach(
|
|
1360
|
+
(n) => this.tooltipEntry.push({
|
|
1361
|
+
title: n.label,
|
|
1362
|
+
featureId: [n.id],
|
|
1363
|
+
ready: !1
|
|
1364
|
+
})
|
|
1365
|
+
), f.emit("connectivity-info-open", this.tooltipEntry);
|
|
1601
1366
|
let r = [];
|
|
1602
1367
|
for (let n = 0; n < e.data.length; n++)
|
|
1603
1368
|
r.push(await this.knowledgeTooltipQuery(e.data[n]));
|
|
1604
1369
|
this.tooltipEntry = await Promise.all(r), this.tooltipEntry.map((n) => n.featureId[0]).length > 0 && f.emit("connectivity-info-open", this.tooltipEntry);
|
|
1605
1370
|
},
|
|
1606
1371
|
changeConnectivitySource: async function(e, r) {
|
|
1607
|
-
var
|
|
1608
|
-
const { entry:
|
|
1609
|
-
r.includes(
|
|
1372
|
+
var s, l;
|
|
1373
|
+
const { entry: a, connectivitySource: n } = e, t = (l = (s = this == null ? void 0 : this.flatmapService) == null ? void 0 : s.mapImp) == null ? void 0 : l.mapMetadata.uuid;
|
|
1374
|
+
r.includes(t) || (r.push(t), await this.flatmapQueries.queryForConnectivityNew(
|
|
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));
|
|
1610
1379
|
},
|
|
1611
1380
|
trackEvent: function(e) {
|
|
1612
|
-
|
|
1381
|
+
F.sendEvent(e);
|
|
1613
1382
|
}
|
|
1614
1383
|
},
|
|
1615
1384
|
data: function() {
|
|
1616
1385
|
return {
|
|
1617
1386
|
apiLocation: void 0,
|
|
1618
|
-
activeSpecies:
|
|
1387
|
+
activeSpecies: _,
|
|
1619
1388
|
scaffoldCamera: void 0,
|
|
1620
1389
|
mainStyle: {
|
|
1621
1390
|
height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
|
|
@@ -1651,5 +1420,5 @@ const J = {
|
|
|
1651
1420
|
}
|
|
1652
1421
|
};
|
|
1653
1422
|
export {
|
|
1654
|
-
|
|
1423
|
+
$ as C
|
|
1655
1424
|
};
|