@abi-software/mapintegratedvuer 1.9.0-externalise.0 → 1.9.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-DZNBigKl.js → ContentMixin-DyVwSF4C.js} +255 -277
- package/dist/{Flatmap-Cpq4KUDR.js → Flatmap-DrfTTLeB.js} +11 -12
- package/dist/{Iframe-Bs8MdpYf.js → Iframe-DNML_G7u.js} +2 -2
- package/dist/{MultiFlatmap-D2F4ghpg.js → MultiFlatmap-Vp10mrjr.js} +10 -11
- package/dist/{Plot-DTUNGWFU.js → Plot-BnuX-0LW.js} +2 -2
- package/dist/{Scaffold-DBwjYgzS.js → Scaffold-CLNZHo3r.js} +10858 -11419
- package/dist/{Simulation-Bw7qeokB.js → Simulation-BEU8ep5d.js} +2 -2
- package/dist/{index-DPgI7wGR.js → index-CVfAy4kK.js} +19947 -19608
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +2787 -411
- package/dist/style-BM2XOQIb.js +104676 -0
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/src/components/ContentVuer.vue +3 -2
- package/src/components/DialogToolbarContent.vue +24 -35
- package/src/components/SplitDialog.vue +92 -2
- package/src/components/SplitFlow.vue +17 -11
- package/src/components/viewers/Flatmap.vue +1 -1
- package/src/components/viewers/MultiFlatmap.vue +1 -1
- package/src/components.d.ts +1 -0
- package/src/mixins/ContentMixin.js +81 -42
- package/src/stores/connectivities.js +21 -0
- package/src/stores/entries.js +8 -1
- package/src/stores/splitFlow.js +14 -7
- package/vite.bundle-build.js +1 -2
- package/dist/style-C-2wp5WK.js +0 -66
@@ -1,54 +1,54 @@
|
|
1
|
-
import { markRaw as
|
2
|
-
import { u as I,
|
3
|
-
import { mapStores as
|
4
|
-
const
|
1
|
+
import { markRaw as w } from "vue";
|
2
|
+
import { u as b, p as I, q as M, E as u, T as C, r as S, s as F, v as A, x as $ } from "./index-CVfAy4kK.js";
|
3
|
+
import { mapStores as H } from "pinia";
|
4
|
+
const m = 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
|
10
|
-
(
|
11
|
-
),
|
12
|
-
(
|
13
|
-
),
|
14
|
-
(
|
8
|
+
}, g = [], v = async function(e, t) {
|
9
|
+
const i = t.filter(
|
10
|
+
(s) => g.some((a) => a.taxon === s)
|
11
|
+
), n = g.filter(
|
12
|
+
(s) => i.includes(s.taxon)
|
13
|
+
), o = t.filter(
|
14
|
+
(s) => !i.includes(s)
|
15
15
|
);
|
16
|
-
if (
|
17
|
-
const
|
18
|
-
if (
|
19
|
-
return
|
16
|
+
if (o.length) {
|
17
|
+
const s = await e.queryLabels(o);
|
18
|
+
if (s.length)
|
19
|
+
return s.forEach((a) => {
|
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
|
+
n.push(c), g.push(c);
|
24
|
+
}), n;
|
25
25
|
} else
|
26
|
-
return
|
26
|
+
return n;
|
27
27
|
}, y = function(e, t) {
|
28
28
|
if (!e || !t) return !1;
|
29
|
-
let
|
30
|
-
return
|
29
|
+
let i = JSON.stringify(e), n = JSON.stringify(t);
|
30
|
+
return i.indexOf(n) !== -1;
|
31
31
|
}, p = (e, t) => {
|
32
|
-
const
|
33
|
-
return
|
32
|
+
const i = e.name ?? e, n = t.name ?? t, o = i.toUpperCase(), s = n.toUpperCase();
|
33
|
+
return o < s ? -1 : o > s ? 1 : 0;
|
34
34
|
};
|
35
|
-
let
|
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 i = [];
|
40
|
+
t.feature.hyperlinks && t.feature.hyperlinks.length > 0 ? i = t.feature.hyperlinks : i = this.rawURLs;
|
41
|
+
let n;
|
42
42
|
if (t.provenanceTaxonomy) {
|
43
|
-
|
43
|
+
n = [];
|
44
44
|
try {
|
45
|
-
const
|
46
|
-
|
45
|
+
const s = await v(e, t.provenanceTaxonomy);
|
46
|
+
s.length && s.forEach((a) => {
|
47
47
|
const { label: r } = a;
|
48
|
-
|
48
|
+
n.push(r);
|
49
49
|
});
|
50
|
-
} catch (
|
51
|
-
console.log(
|
50
|
+
} catch (s) {
|
51
|
+
console.log(s);
|
52
52
|
}
|
53
53
|
}
|
54
54
|
return {
|
@@ -60,9 +60,9 @@ let $ = function() {
|
|
60
60
|
componentsWithDatasets: this.componentsWithDatasets,
|
61
61
|
title: t.label,
|
62
62
|
featureId: t.resource,
|
63
|
-
hyperlinks:
|
63
|
+
hyperlinks: i,
|
64
64
|
provenanceTaxonomy: t.provenanceTaxonomy,
|
65
|
-
provenanceTaxonomyLabel:
|
65
|
+
provenanceTaxonomyLabel: n,
|
66
66
|
connectivitySource: this.connectivitySource
|
67
67
|
};
|
68
68
|
}, this.updateTooltipData = function(e) {
|
@@ -77,109 +77,109 @@ let $ = 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 i = [];
|
81
|
+
return e.forEach((n) => {
|
82
|
+
i.push(this.createLabelFromNeuralNode(n[0]), t), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), t);
|
83
|
+
}), i;
|
84
84
|
}, this.createLabelLookup = function(e, t) {
|
85
|
-
return new Promise(async (
|
86
|
-
let
|
85
|
+
return new Promise(async (i) => {
|
86
|
+
let n = {};
|
87
87
|
this.uberons = [];
|
88
|
-
const
|
89
|
-
|
90
|
-
const { taxon: a, label: r } =
|
91
|
-
|
88
|
+
const o = await v(e, t);
|
89
|
+
o.length && (o.forEach((s) => {
|
90
|
+
const { taxon: a, label: r } = s;
|
91
|
+
n[a] = r, this.uberons.push({
|
92
92
|
id: a,
|
93
93
|
name: r
|
94
94
|
});
|
95
|
-
}), n
|
95
|
+
}), i(n));
|
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 i in e)
|
103
|
+
t += `'${e[i]}'${i >= 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 i in e)
|
111
|
+
t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
|
112
112
|
return t;
|
113
113
|
}, this.findAllIdsFromConnectivity = function(e) {
|
114
|
-
let t = e.connectivity.flat(),
|
115
|
-
return
|
116
|
-
Array.isArray(
|
117
|
-
}), [...new Set(
|
114
|
+
let t = e.connectivity.flat(), i = [...new Set(t)], n = [];
|
115
|
+
return i.forEach((o) => {
|
116
|
+
Array.isArray(o) ? n.push(o.flat()) : n.push(o);
|
117
|
+
}), [...new Set(n.flat())];
|
118
118
|
}, this.flattenConnectivity = function(e) {
|
119
|
-
let t = e.flat(),
|
120
|
-
return
|
121
|
-
Array.isArray(
|
122
|
-
}),
|
123
|
-
}, this.findComponents = function(e, t,
|
124
|
-
let
|
125
|
-
return
|
126
|
-
r = !1, y(t, l) && (r = !0),
|
119
|
+
let t = e.flat(), i = [...new Set(t)], n = [];
|
120
|
+
return i.forEach((o) => {
|
121
|
+
Array.isArray(o) ? n.push(o.flat()) : n.push(o);
|
122
|
+
}), n.flat();
|
123
|
+
}, this.findComponents = function(e, t, i, n) {
|
124
|
+
let o = e.connectivity.flat(), s = m(o), a = [], r = !1;
|
125
|
+
return s.forEach((l) => {
|
126
|
+
r = !1, y(t, l) && (r = !0), n && y(n, l) && (r = !0), y(i, 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 i = t.resource;
|
131
|
+
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !i || i.length === 0 || !i[0]) return;
|
132
|
+
let n = this.queryForConnectivityNew(e, i[0]);
|
133
|
+
return await Promise.all([n]);
|
134
|
+
}, this.queryForConnectivityNew = function(e, t, i = "sckan", n = !0) {
|
135
|
+
return this.connectivitySource = i, new Promise((o) => {
|
136
|
+
(i === "map" ? this.queryMapConnectivity(e.provenance.uuid, t) : e.queryKnowledge(t)).then((a) => {
|
137
137
|
if (this.checkConnectivityExists(a)) {
|
138
138
|
let r = a;
|
139
|
-
|
140
|
-
a.references && (this.rawURLs = [...a.references]),
|
141
|
-
}) :
|
139
|
+
n ? this.processConnectivity(e, r).then((l) => {
|
140
|
+
a.references && (this.rawURLs = [...a.references]), o(l);
|
141
|
+
}) : o(r);
|
142
142
|
} else
|
143
|
-
|
143
|
+
o(!1);
|
144
144
|
}).catch((a) => {
|
145
|
-
a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${t}.`),
|
145
|
+
a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${t}.`), o(!1);
|
146
146
|
});
|
147
147
|
});
|
148
148
|
}, this.queryMapConnectivity = async function(e, t) {
|
149
|
-
const
|
150
|
-
try {
|
151
|
-
const i = await fetch(n);
|
152
|
-
if (!i.ok)
|
153
|
-
throw new Error(`Response status: ${i.status}`);
|
154
|
-
return await i.json();
|
155
|
-
} catch (i) {
|
156
|
-
throw new Error(i);
|
157
|
-
}
|
158
|
-
}, this.queryMapPaths = async function(e) {
|
159
|
-
const t = this.flatmapAPI + `flatmap/${e}/pathways`;
|
149
|
+
const i = this.flatmapAPI + `flatmap/${e}/connectivity/${t}`;
|
160
150
|
try {
|
161
|
-
const n = await fetch(
|
151
|
+
const n = await fetch(i);
|
162
152
|
if (!n.ok)
|
163
153
|
throw new Error(`Response status: ${n.status}`);
|
164
154
|
return await n.json();
|
165
155
|
} catch (n) {
|
166
156
|
throw new Error(n);
|
167
157
|
}
|
168
|
-
}, this.
|
169
|
-
const
|
158
|
+
}, this.queryMapPaths = async function(e) {
|
159
|
+
const t = this.flatmapAPI + `flatmap/${e}/pathways`;
|
160
|
+
try {
|
161
|
+
const i = await fetch(t);
|
162
|
+
if (!i.ok)
|
163
|
+
throw new Error(`Response status: ${i.status}`);
|
164
|
+
return await i.json();
|
165
|
+
} catch (i) {
|
166
|
+
throw new Error(i);
|
167
|
+
}
|
168
|
+
}, this.queryForConnectivity = function(e, t, i, n = !0) {
|
169
|
+
const o = { sql: this.buildConnectivitySqlStatement(t) }, s = {
|
170
170
|
method: "POST",
|
171
171
|
headers: {
|
172
172
|
"Content-Type": "application/json"
|
173
173
|
},
|
174
|
-
body: JSON.stringify(
|
175
|
-
...
|
174
|
+
body: JSON.stringify(o),
|
175
|
+
...i ? { signal: i } : {}
|
176
176
|
// add signal to header if it exists
|
177
177
|
};
|
178
178
|
return new Promise((a) => {
|
179
|
-
fetch(`${this.flatmapAPI}knowledge/query/`,
|
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
|
+
n ? this.processConnectivity(e, l).then((c) => {
|
183
183
|
a(c);
|
184
184
|
}) : a(l);
|
185
185
|
} else
|
@@ -196,47 +196,47 @@ let $ = 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
|
203
|
-
return e.length === 2 && e[1].length > 0 && e[1].forEach((
|
204
|
-
t[
|
205
|
-
}),
|
206
|
-
}, this.flattenAndFindDatasets = function(e, t,
|
207
|
-
let
|
199
|
+
let i = this.findIfNodeIsSingle(e);
|
200
|
+
if (i)
|
201
|
+
return t[i];
|
202
|
+
let n = t[e[0]];
|
203
|
+
return e.length === 2 && e[1].length > 0 && e[1].forEach((o) => {
|
204
|
+
t[o] == null ? n += `, ${o}` : n += `, ${t[o]}`;
|
205
|
+
}), n;
|
206
|
+
}, this.flattenAndFindDatasets = function(e, t, i) {
|
207
|
+
let n = this.flattenConnectivity(e), o = this.flattenConnectivity(t), s = this.flattenConnectivity(i);
|
208
208
|
this.originsWithDatasets = this.uberons.filter(
|
209
|
-
(a) =>
|
209
|
+
(a) => n.indexOf(a.id) !== -1
|
210
210
|
).sort(p), this.componentsWithDatasets = this.uberons.filter(
|
211
|
-
(a) => s.indexOf(a.id) !== -1
|
212
|
-
).sort(p), this.destinationsWithDatasets = this.uberons.filter(
|
213
211
|
(a) => o.indexOf(a.id) !== -1
|
212
|
+
).sort(p), this.destinationsWithDatasets = this.uberons.filter(
|
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((i) => {
|
217
|
+
let n = [], 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
|
-
|
224
|
-
}),
|
220
|
+
l.forEach((h) => {
|
221
|
+
n.push(...t["node-phenotypes"][h]);
|
222
|
+
}), n = m(n), c.forEach((h) => {
|
223
|
+
o.push(...t["node-phenotypes"][h]);
|
224
|
+
}), o = m(o);
|
225
225
|
} else
|
226
|
-
|
227
|
-
const a = this.findComponents(t,
|
226
|
+
o = m(t.axons), t.somas && t.somas.length > 0 && n.push(...t.somas), t.dendrites && t.dendrites.length > 0 && n.push(...t.dendrites), n = m(n), s = t.somas;
|
227
|
+
const a = this.findComponents(t, o, n, s), r = this.findAllIdsFromConnectivity(t);
|
228
228
|
this.createLabelLookup(e, r).then((l) => {
|
229
|
-
this.origins =
|
229
|
+
this.origins = n.map(
|
230
230
|
(c) => this.createLabelFromNeuralNode(c, l)
|
231
231
|
).sort(p), this.components = a.map(
|
232
232
|
(c) => this.createLabelFromNeuralNode(c, l)
|
233
|
-
).sort(p), this.destinations =
|
233
|
+
).sort(p), this.destinations = o.map(
|
234
234
|
(c) => this.createLabelFromNeuralNode(c, l)
|
235
|
-
).sort(p), this.flattenAndFindDatasets(
|
235
|
+
).sort(p), this.flattenAndFindDatasets(n, a, o), i({
|
236
236
|
ids: {
|
237
|
-
dendrites:
|
237
|
+
dendrites: n,
|
238
238
|
components: a,
|
239
|
-
axons:
|
239
|
+
axons: o
|
240
240
|
},
|
241
241
|
labels: {
|
242
242
|
origins: this.origins,
|
@@ -251,8 +251,8 @@ let $ = 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 i in e)
|
255
|
+
t += `'${e[i]}'${i >= 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,53 +264,15 @@ let $ = function() {
|
|
264
264
|
"Content-Type": "application/json"
|
265
265
|
},
|
266
266
|
body: JSON.stringify(t)
|
267
|
-
}).then((
|
268
|
-
console.error("Error:",
|
267
|
+
}).then((i) => i.json()).catch((i) => {
|
268
|
+
console.error("Error:", i);
|
269
269
|
});
|
270
270
|
};
|
271
271
|
};
|
272
|
-
function v(e) {
|
273
|
-
var n;
|
274
|
-
let t = "";
|
275
|
-
if ((n = e.provenance) != null && n.connectivity) {
|
276
|
-
const i = e.provenance.connectivity;
|
277
|
-
"knowledge-source" in i ? t = i["knowledge-source"] : "npo" in i && (t = `${i.npo.release}-npo`);
|
278
|
-
}
|
279
|
-
return t;
|
280
|
-
}
|
281
|
-
async function H(e, t) {
|
282
|
-
const n = v(e), i = `select knowledge from knowledge
|
283
|
-
where source="${n}"
|
284
|
-
order by source desc`;
|
285
|
-
E();
|
286
|
-
const s = sessionStorage.getItem("flatmap-knowledge"), o = sessionStorage.getItem("flatmap-knowledge-source");
|
287
|
-
if (!s || o !== n) {
|
288
|
-
const l = (await t.flatmapQuery(i)).values.map((c) => c[0]).map((c) => JSON.parse(c));
|
289
|
-
return sessionStorage.setItem("flatmap-knowledge", JSON.stringify(l)), sessionStorage.setItem("flatmap-knowledge-source", n), N(), l;
|
290
|
-
}
|
291
|
-
return JSON.parse(s);
|
292
|
-
}
|
293
|
-
function N() {
|
294
|
-
const n = (/* @__PURE__ */ new Date()).getTime() + 864e5;
|
295
|
-
sessionStorage.setItem("flatmap-knowledge-expiry", n);
|
296
|
-
}
|
297
|
-
function T() {
|
298
|
-
[
|
299
|
-
"flatmap-knowledge",
|
300
|
-
"flatmap-knowledge-expiry",
|
301
|
-
"flatmap-knowledge-source"
|
302
|
-
].forEach((t) => {
|
303
|
-
sessionStorage.removeItem(t);
|
304
|
-
});
|
305
|
-
}
|
306
|
-
function E() {
|
307
|
-
const e = sessionStorage.getItem("flatmap-knowledge-expiry");
|
308
|
-
(/* @__PURE__ */ new Date()).getTime() > e && T();
|
309
|
-
}
|
310
272
|
function P(e) {
|
311
273
|
return e[0].toUpperCase() + e.substring(1);
|
312
274
|
}
|
313
|
-
const
|
275
|
+
const D = {
|
314
276
|
emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
|
315
277
|
props: {
|
316
278
|
/**
|
@@ -328,7 +290,7 @@ const k = {
|
|
328
290
|
}
|
329
291
|
},
|
330
292
|
computed: {
|
331
|
-
...
|
293
|
+
...H(b, I, M),
|
332
294
|
idNamePair() {
|
333
295
|
return this.splitFlowStore.idNamePair;
|
334
296
|
},
|
@@ -346,9 +308,9 @@ const k = {
|
|
346
308
|
}
|
347
309
|
},
|
348
310
|
mounted: function() {
|
349
|
-
|
311
|
+
u.on("startHelp", () => {
|
350
312
|
this.startHelp();
|
351
|
-
}), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold;
|
313
|
+
}), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
|
352
314
|
},
|
353
315
|
methods: {
|
354
316
|
toggleSyncMode: function() {
|
@@ -356,13 +318,13 @@ const k = {
|
|
356
318
|
getState: function() {
|
357
319
|
},
|
358
320
|
openMap: function(e) {
|
359
|
-
e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (
|
321
|
+
e === "SYNC" ? (this.toggleSyncMode(), this.trackOpenMap("toggle_map_sync_mode")) : (u.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`));
|
360
322
|
},
|
361
323
|
onMapmanagerLoaded: function(e) {
|
362
324
|
this.settingsStore.updateMapManager(e);
|
363
325
|
},
|
364
326
|
trackOpenMap: function(e) {
|
365
|
-
|
327
|
+
C.sendEvent({
|
366
328
|
event: "interaction_event",
|
367
329
|
event_name: "portal_maps_open_map",
|
368
330
|
category: e,
|
@@ -387,13 +349,13 @@ const k = {
|
|
387
349
|
*/
|
388
350
|
resourceSelected: function(e, t) {
|
389
351
|
var a, r, l, c;
|
390
|
-
const
|
391
|
-
if (this.resourceHasAction(
|
392
|
-
|
352
|
+
const i = t[0];
|
353
|
+
if (this.resourceHasAction(i)) {
|
354
|
+
u.emit("PopoverActionClick", i);
|
393
355
|
return;
|
394
356
|
}
|
395
|
-
let
|
396
|
-
const
|
357
|
+
let n, o = !1;
|
358
|
+
const s = {
|
397
359
|
paneIndex: this.entry.id,
|
398
360
|
type: e,
|
399
361
|
resource: t,
|
@@ -401,41 +363,41 @@ const k = {
|
|
401
363
|
eventType: void 0
|
402
364
|
};
|
403
365
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
404
|
-
if (
|
405
|
-
if (
|
406
|
-
let
|
407
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
408
|
-
|
366
|
+
if (s.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click")
|
367
|
+
if (s.eventType = "selected", i.feature.type == "marker") {
|
368
|
+
let h = s.internalName;
|
369
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
|
370
|
+
n = {
|
409
371
|
type: "Search",
|
410
|
-
term: this.settingsStore.featuredMarkerDoi(
|
372
|
+
term: this.settingsStore.featuredMarkerDoi(i.feature.id),
|
411
373
|
featuredDataset: !0
|
412
374
|
};
|
413
375
|
else {
|
414
|
-
|
376
|
+
n = {
|
415
377
|
type: "Facet",
|
416
|
-
facet:
|
378
|
+
facet: h,
|
417
379
|
facetPropPath: "anatomy.organ.category.name",
|
418
380
|
facetSubPropPath: "anatomy.organ.name",
|
419
381
|
term: "Anatomical structure"
|
420
382
|
};
|
421
|
-
let
|
422
|
-
|
423
|
-
|
424
|
-
}),
|
383
|
+
let d = /* @__PURE__ */ new Set();
|
384
|
+
i.feature["marker-terms"].forEach((f) => {
|
385
|
+
d.add(f.label);
|
386
|
+
}), d.add(h), d.size > 0 && (n = {
|
425
387
|
type: "Facets",
|
426
|
-
labels: [...
|
388
|
+
labels: [...d]
|
427
389
|
});
|
428
390
|
}
|
429
|
-
|
430
|
-
} else
|
431
|
-
else
|
432
|
-
else e == "Scaffold" && (
|
391
|
+
o = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
392
|
+
} else i.feature.type == "feature" && this.syncMode && (o = !0);
|
393
|
+
else i.eventType == "mouseenter" && (s.eventType = "highlighted", o = !0);
|
394
|
+
else e == "Scaffold" && (i && ((((r = i.data) == null ? void 0 : r.id) === void 0 || ((l = i.data) == null ? void 0 : l.id) === "") && (i.data.id = (c = i.data) == null ? void 0 : c.group), s.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
|
433
395
|
type: "Facet",
|
434
|
-
facet: P(
|
396
|
+
facet: P(i.data.id),
|
435
397
|
facetPropPath: "anatomy.organ.category.name",
|
436
398
|
term: "Anatomical structure"
|
437
|
-
})),
|
438
|
-
|
399
|
+
})), s.eventType = "selected", o = !0);
|
400
|
+
n && u.emit("PopoverActionClick", n), o && this.$emit("resource-selected", s);
|
439
401
|
},
|
440
402
|
resourceHasAction: function(e) {
|
441
403
|
return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
|
@@ -456,63 +418,63 @@ const k = {
|
|
456
418
|
getNameAndIdFromSyncData: async function(e) {
|
457
419
|
let t = e.internalName;
|
458
420
|
t === void 0 && e.resource && (t = e.resource.label);
|
459
|
-
let
|
460
|
-
if (e.resource && e.resource.resource && (
|
421
|
+
let i;
|
422
|
+
if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
461
423
|
if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
|
462
424
|
if (e.resource && e.resource.feature) {
|
463
|
-
const
|
464
|
-
if (
|
425
|
+
const s = S(e.resource.feature.models);
|
426
|
+
if (s.length > 0) return s;
|
465
427
|
}
|
466
|
-
let
|
467
|
-
if (
|
468
|
-
return
|
469
|
-
if (
|
470
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
428
|
+
let o = F(t);
|
429
|
+
if (o)
|
430
|
+
return o;
|
431
|
+
if (i && e.eventType === "selected")
|
432
|
+
return fetch(`${this.apiLocation}get-related-terms/${i}`).then((s) => s.json()).then((s) => {
|
471
433
|
var a;
|
472
|
-
if (((a =
|
473
|
-
return t =
|
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), i = s.uberon.array[0].id.toUpperCase(), { id: i, name: t };
|
474
436
|
});
|
475
437
|
}
|
476
438
|
} else if (this.entry.type === "MultiFlatmap")
|
477
439
|
if (t === "Bladder")
|
478
440
|
t = "Urinary Bladder";
|
479
441
|
else {
|
480
|
-
const
|
481
|
-
|
442
|
+
const n = S(t);
|
443
|
+
n.length > 0 && (t = n[0]);
|
482
444
|
}
|
483
|
-
return { id:
|
445
|
+
return { id: i, name: t };
|
484
446
|
},
|
485
447
|
// Get the species and andaotmy info for the featured datasets
|
486
448
|
getDatasetAnatomyInfo: function(e) {
|
487
449
|
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
|
488
|
-
const
|
489
|
-
let
|
450
|
+
const i = t.result[0];
|
451
|
+
let n;
|
490
452
|
try {
|
491
|
-
|
453
|
+
n = i.anatomy.organ[0].curie;
|
492
454
|
} catch {
|
493
|
-
|
455
|
+
n = void 0;
|
494
456
|
}
|
495
|
-
let
|
457
|
+
let o;
|
496
458
|
try {
|
497
|
-
|
459
|
+
o = i.item.curie;
|
498
460
|
} catch {
|
499
|
-
|
461
|
+
o = void 0;
|
500
462
|
}
|
501
|
-
let
|
463
|
+
let s;
|
502
464
|
try {
|
503
465
|
let a = 0, r = !1;
|
504
|
-
for (; !r && a <
|
505
|
-
const l =
|
506
|
-
l.species && (
|
466
|
+
for (; !r && a < i.organisms.subject.length; ) {
|
467
|
+
const l = i.organisms.subject[a];
|
468
|
+
l.species && (s = l.species.name, r = !0), a += 1;
|
507
469
|
}
|
508
470
|
} catch {
|
509
|
-
|
471
|
+
s = void 0;
|
510
472
|
}
|
511
473
|
this.settingsStore.updateFeaturedMarker({
|
512
474
|
identifier: e,
|
513
|
-
marker:
|
514
|
-
doi:
|
515
|
-
species:
|
475
|
+
marker: n,
|
476
|
+
doi: o,
|
477
|
+
species: s
|
516
478
|
});
|
517
479
|
});
|
518
480
|
},
|
@@ -524,7 +486,7 @@ const k = {
|
|
524
486
|
// Check if the new featured dataset api has any info
|
525
487
|
newFeaturedDatasetApiHasInfo: async function() {
|
526
488
|
let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
527
|
-
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((
|
489
|
+
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
|
528
490
|
},
|
529
491
|
/**
|
530
492
|
* Get a list of featured datasets to display.
|
@@ -533,11 +495,11 @@ const k = {
|
|
533
495
|
let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
|
534
496
|
if (t) e = t;
|
535
497
|
else {
|
536
|
-
let
|
537
|
-
|
498
|
+
let i = await this.newFeaturedDatasetApiHasInfo();
|
499
|
+
i && (e = i);
|
538
500
|
}
|
539
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
540
|
-
this.getDatasetAnatomyInfo(
|
501
|
+
this.settingsStore.updateFeatured(e), e.forEach((i) => {
|
502
|
+
this.getDatasetAnatomyInfo(i);
|
541
503
|
});
|
542
504
|
},
|
543
505
|
zoomToFeatures: function() {
|
@@ -596,84 +558,100 @@ const k = {
|
|
596
558
|
checkEndHelpMouseDown: function(e) {
|
597
559
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
598
560
|
},
|
599
|
-
flatmapHighlight: async function(e, t,
|
600
|
-
let
|
601
|
-
const
|
602
|
-
if (
|
603
|
-
const a = t.length ? t :
|
604
|
-
r &&
|
561
|
+
flatmapHighlight: async function(e, t, i, n) {
|
562
|
+
let o = [...t, ...n];
|
563
|
+
const s = this.settingsStore.globalSettings;
|
564
|
+
if (s.highlightConnectedPaths) {
|
565
|
+
const a = t.length ? t : n.length ? n : [], r = await e.retrieveConnectedPaths(a);
|
566
|
+
r && o.push(...r);
|
605
567
|
}
|
606
|
-
if (
|
607
|
-
const a = await e.searchConnectivitiesByReference(
|
608
|
-
a &&
|
568
|
+
if (s.highlightDOIPaths) {
|
569
|
+
const a = await e.searchConnectivitiesByReference(i);
|
570
|
+
a && o.push(...a);
|
609
571
|
}
|
610
|
-
return
|
572
|
+
return o = [...new Set(o)], o;
|
611
573
|
},
|
612
574
|
cardHoverHighlight: function() {
|
613
575
|
var e;
|
614
576
|
if (this.visible) {
|
615
|
-
const t = this.settingsStore.hoverAnatomies,
|
616
|
-
let
|
617
|
-
this.flatmapRef && (
|
618
|
-
(t.length ||
|
577
|
+
const t = this.settingsStore.hoverAnatomies, i = this.settingsStore.hoverOrgans, n = this.settingsStore.hoverDOI, o = this.settingsStore.hoverConnectivity;
|
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 && !i.length && !n && !o.length && ((this.multiflatmapRef || this.flatmapRef) && s ? (e = s.mapImp) == null || e.clearSearchResults() : this.scaffoldRef && a && a.changeHighlightedByName(i, "", !1)), this.highlightDelay = setTimeout(() => {
|
580
|
+
(t.length || i.length || n || o.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, n, o).then((r) => {
|
619
581
|
try {
|
620
|
-
|
582
|
+
s.zoomToFeatures(r);
|
621
583
|
} catch (l) {
|
622
|
-
console.log(l)
|
584
|
+
if (console.log(l), o.length && s.mapImp) {
|
585
|
+
const c = s.mapImp.uuid;
|
586
|
+
r.every(
|
587
|
+
(d) => this.connectivityKnowledge[c].some(
|
588
|
+
(f) => f.id === d
|
589
|
+
)
|
590
|
+
) || s.mapImp.clearSearchResults();
|
591
|
+
}
|
623
592
|
}
|
624
|
-
}) : this.scaffoldRef && a && a.changeHighlightedByName(
|
593
|
+
}) : this.scaffoldRef && a && a.changeHighlightedByName(i, "", !1));
|
625
594
|
}, 100);
|
626
595
|
}
|
627
596
|
},
|
628
597
|
onAnnotationOpen: function(e) {
|
629
|
-
|
598
|
+
u.emit("annotation-open", e);
|
630
599
|
},
|
631
600
|
onAnnotationClose: function() {
|
632
|
-
|
601
|
+
u.emit("annotation-close");
|
633
602
|
},
|
634
603
|
onConnectivityInfoOpen: function(e) {
|
635
|
-
|
604
|
+
u.emit("connectivity-info-open", e);
|
636
605
|
},
|
637
|
-
|
638
|
-
|
606
|
+
onConnectivityError: function(e) {
|
607
|
+
u.emit("connectivity-error", e);
|
639
608
|
},
|
640
609
|
loadConnectivityKnowledge: async function(e) {
|
641
|
-
const t =
|
642
|
-
|
643
|
-
const
|
644
|
-
this.connectivityKnowledge[
|
645
|
-
var
|
646
|
-
return
|
647
|
-
})
|
610
|
+
const t = A(e), i = w(new N());
|
611
|
+
i.initialise(this.flatmapAPI);
|
612
|
+
const n = await $(e, i), o = e.uuid;
|
613
|
+
if (this.connectivityKnowledge[t] || (this.connectivityKnowledge[t] = n.filter((s) => {
|
614
|
+
var a;
|
615
|
+
return s.source === t && ((a = s.connectivity) == null ? void 0 : a.length);
|
616
|
+
}).sort((s, a) => s.label.localeCompare(a.label))), !this.connectivitiesStore.globalConnectivities[o]) {
|
617
|
+
const s = await i.queryMapPaths(o), a = s ? s.paths : {};
|
618
|
+
this.connectivityKnowledge[o] = n.filter((r) => {
|
619
|
+
var l;
|
620
|
+
return r.source === t && ((l = r.connectivity) == null ? void 0 : l.length) && r.id in a;
|
621
|
+
}).sort((r, l) => r.label.localeCompare(l.label));
|
622
|
+
}
|
623
|
+
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), u.emit("species-layout-connectivity-update");
|
648
624
|
},
|
649
625
|
getSearchedId: function(e, t) {
|
650
|
-
let
|
651
|
-
const
|
652
|
-
return (
|
626
|
+
let i = [];
|
627
|
+
const n = e.mapImp.search(t);
|
628
|
+
return (n.__featureIds || n.featureIds).forEach((s) => {
|
653
629
|
var r;
|
654
|
-
const a = e.mapImp.annotation(
|
655
|
-
(r = a.label) != null && r.toLowerCase().includes(t.toLowerCase()) && a.models && !
|
656
|
-
}),
|
630
|
+
const a = e.mapImp.annotation(s);
|
631
|
+
(r = a.label) != null && r.toLowerCase().includes(t.toLowerCase()) && a.models && !i.includes(a.models) && i.push(a.models);
|
632
|
+
}), i;
|
657
633
|
},
|
658
634
|
connectivityQueryFilter: async function(e, t) {
|
659
|
-
const
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
635
|
+
const i = e.mapImp.uuid, n = this.connectivitiesStore.activeConnectivityKey || i;
|
636
|
+
if (e.$el.checkVisibility()) {
|
637
|
+
let o = {
|
638
|
+
state: "default",
|
639
|
+
data: [...this.connectivityKnowledge[n]]
|
640
|
+
};
|
641
|
+
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) {
|
642
|
+
o.state = "processed";
|
643
|
+
let s = [], a = {};
|
644
|
+
const r = this.query.split(",").map((f) => f.trim());
|
645
|
+
for (let f = 0; f < r.length; f++)
|
646
|
+
s.push(this.getSearchedId(e, r[f]));
|
647
|
+
const l = await Promise.all(s), c = [...new Set(l.flat())];
|
648
|
+
let h = await e.retrieveConnectedPaths(c, a);
|
649
|
+
h = [...c, ...h.filter((f) => !c.includes(f))];
|
650
|
+
let d = this.connectivityKnowledge[n].filter((f) => h.includes(f.id));
|
651
|
+
o.data = d;
|
652
|
+
}
|
653
|
+
u.emit("connectivity-knowledge", o);
|
675
654
|
}
|
676
|
-
h.emit("connectivity-knowledge", i);
|
677
655
|
}
|
678
656
|
},
|
679
657
|
data: function() {
|
@@ -711,5 +689,5 @@ const k = {
|
|
711
689
|
}
|
712
690
|
};
|
713
691
|
export {
|
714
|
-
|
692
|
+
D as C
|
715
693
|
};
|