@abi-software/mapintegratedvuer 1.10.2-beta.0 → 1.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentMixin-CGhcj7xh.js → ContentMixin-s7Ep3pGV.js} +184 -190
- package/dist/{Flatmap-DbgtlxmY.js → Flatmap-BoLc9V2N.js} +66 -68
- package/dist/{Iframe-BEt0VIIr.js → Iframe-DvOBuFWP.js} +2 -2
- package/dist/{MultiFlatmap-BPc3Wof9.js → MultiFlatmap-R2NBfCgt.js} +33 -36
- package/dist/{Plot-CNEgDLi2.js → Plot-DEhsJQZ8.js} +2 -2
- package/dist/{Scaffold-Cn8XyaSz.js → Scaffold-Cddb_Lnn.js} +2 -2
- package/dist/{Simulation-wF9y8sIT.js → Simulation-C7bvmX3f.js} +2 -2
- package/dist/{index-Dm85KBw6.js → index-DL73mn-k.js} +12935 -13090
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +193 -193
- package/dist/{style-DF6s1KEf.js → style-62hTn7u0.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/components/DialogToolbarContent.vue +12 -57
- package/src/components/SplitDialog.vue +5 -31
- package/src/components/SplitFlow.vue +1 -46
- package/src/components/viewers/Flatmap.vue +1 -4
- package/src/components/viewers/MultiFlatmap.vue +0 -4
- package/src/components.d.ts +0 -1
- package/src/mixins/ContentMixin.js +1 -7
- package/src/stores/settings.js +0 -1
- package/vite.config.js +0 -3
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { markRaw as F } from "vue";
|
|
2
|
-
import { u as C, c as I, d as A,
|
|
3
|
-
import { mapStores as
|
|
4
|
-
const d = function(
|
|
5
|
-
return
|
|
6
|
-
(
|
|
2
|
+
import { u as C, c as I, d as A, a as h, T as M, g as S, e as $, f as H, l as L } from "./index-DL73mn-k.js";
|
|
3
|
+
import { mapStores as N } from "pinia";
|
|
4
|
+
const d = function(t) {
|
|
5
|
+
return t ? [...new Set(t.map((e) => JSON.stringify(e)))].map(
|
|
6
|
+
(e) => JSON.parse(e)
|
|
7
7
|
) : [];
|
|
8
|
-
}, m = [], v = async function(
|
|
9
|
-
const i =
|
|
8
|
+
}, m = [], v = async function(t, e) {
|
|
9
|
+
const i = e.filter(
|
|
10
10
|
(o) => m.some((a) => a.taxon === o)
|
|
11
11
|
), n = m.filter(
|
|
12
12
|
(o) => i.includes(o.taxon)
|
|
13
|
-
), s =
|
|
13
|
+
), s = e.filter(
|
|
14
14
|
(o) => !i.includes(o)
|
|
15
15
|
);
|
|
16
16
|
if (s.length) {
|
|
17
|
-
const o = await
|
|
17
|
+
const o = await t.queryLabels(s);
|
|
18
18
|
if (o.length)
|
|
19
19
|
return o.forEach((a) => {
|
|
20
20
|
let { entity: r, label: l } = a;
|
|
@@ -24,25 +24,25 @@ const d = function(e) {
|
|
|
24
24
|
}), n;
|
|
25
25
|
} else
|
|
26
26
|
return n;
|
|
27
|
-
}, g = function(
|
|
28
|
-
if (!
|
|
29
|
-
let i = JSON.stringify(
|
|
27
|
+
}, g = function(t, e) {
|
|
28
|
+
if (!t || !e) return !1;
|
|
29
|
+
let i = JSON.stringify(t), n = JSON.stringify(e);
|
|
30
30
|
return i.indexOf(n) !== -1;
|
|
31
|
-
}, p = (
|
|
32
|
-
const i =
|
|
31
|
+
}, p = (t, e) => {
|
|
32
|
+
const i = t.name ?? t, n = e.name ?? e, s = i.toUpperCase(), o = n.toUpperCase();
|
|
33
33
|
return s < o ? -1 : s > o ? 1 : 0;
|
|
34
34
|
};
|
|
35
35
|
let P = function() {
|
|
36
|
-
this.initialise = function(
|
|
37
|
-
this.flatmapAPI =
|
|
38
|
-
}, this.createTooltipData = async function(
|
|
36
|
+
this.initialise = function(t) {
|
|
37
|
+
this.flatmapAPI = t, this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "sckan";
|
|
38
|
+
}, this.createTooltipData = async function(t, e) {
|
|
39
39
|
let i = [];
|
|
40
|
-
|
|
40
|
+
e.feature.hyperlinks && e.feature.hyperlinks.length > 0 ? i = e.feature.hyperlinks : i = this.rawURLs;
|
|
41
41
|
let n;
|
|
42
|
-
if (
|
|
42
|
+
if (e.provenanceTaxonomy) {
|
|
43
43
|
n = [];
|
|
44
44
|
try {
|
|
45
|
-
const o = await v(
|
|
45
|
+
const o = await v(t, e.provenanceTaxonomy);
|
|
46
46
|
o.length && o.forEach((a) => {
|
|
47
47
|
const { label: r } = a;
|
|
48
48
|
n.push(r);
|
|
@@ -58,16 +58,16 @@ let P = function() {
|
|
|
58
58
|
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
59
59
|
originsWithDatasets: this.originsWithDatasets,
|
|
60
60
|
componentsWithDatasets: this.componentsWithDatasets,
|
|
61
|
-
title:
|
|
62
|
-
featureId:
|
|
61
|
+
title: e.label,
|
|
62
|
+
featureId: e.resource,
|
|
63
63
|
hyperlinks: i,
|
|
64
|
-
provenanceTaxonomy:
|
|
64
|
+
provenanceTaxonomy: e.provenanceTaxonomy,
|
|
65
65
|
provenanceTaxonomyLabel: n,
|
|
66
66
|
connectivitySource: this.connectivitySource
|
|
67
67
|
};
|
|
68
|
-
}, this.updateTooltipData = function(
|
|
68
|
+
}, this.updateTooltipData = function(t) {
|
|
69
69
|
return {
|
|
70
|
-
...
|
|
70
|
+
...t,
|
|
71
71
|
origins: this.origins,
|
|
72
72
|
originsWithDatasets: this.originsWithDatasets,
|
|
73
73
|
components: this.components,
|
|
@@ -76,16 +76,16 @@ let P = function() {
|
|
|
76
76
|
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
77
77
|
connectivitySource: this.connectivitySource
|
|
78
78
|
};
|
|
79
|
-
}, this.createComponentsLabelList = function(
|
|
79
|
+
}, this.createComponentsLabelList = function(t, e) {
|
|
80
80
|
let i = [];
|
|
81
|
-
return
|
|
82
|
-
i.push(this.createLabelFromNeuralNode(n[0]),
|
|
81
|
+
return t.forEach((n) => {
|
|
82
|
+
i.push(this.createLabelFromNeuralNode(n[0]), e), n.length === 2 && i.push(this.createLabelFromNeuralNode(n[1]), e);
|
|
83
83
|
}), i;
|
|
84
|
-
}, this.createLabelLookup = function(
|
|
84
|
+
}, this.createLabelLookup = function(t, e) {
|
|
85
85
|
return new Promise(async (i) => {
|
|
86
86
|
let n = {};
|
|
87
87
|
this.uberons = [];
|
|
88
|
-
const s = await v(
|
|
88
|
+
const s = await v(t, e);
|
|
89
89
|
s.length && (s.forEach((o) => {
|
|
90
90
|
const { taxon: a, label: r } = o;
|
|
91
91
|
n[a] = r, this.uberons.push({
|
|
@@ -94,59 +94,59 @@ let P = function() {
|
|
|
94
94
|
});
|
|
95
95
|
}), i(n));
|
|
96
96
|
});
|
|
97
|
-
}, this.buildConnectivitySqlStatement = function(
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
else if (
|
|
102
|
-
for (let i in
|
|
103
|
-
|
|
104
|
-
return
|
|
105
|
-
}, this.buildLabelSqlStatement = function(
|
|
106
|
-
let
|
|
107
|
-
if (
|
|
108
|
-
|
|
109
|
-
else if (
|
|
110
|
-
for (let i in
|
|
111
|
-
|
|
112
|
-
return
|
|
113
|
-
}, this.findAllIdsFromConnectivity = function(
|
|
114
|
-
let
|
|
97
|
+
}, this.buildConnectivitySqlStatement = function(t) {
|
|
98
|
+
let e = "select knowledge from knowledge where entity in (";
|
|
99
|
+
if (t.length === 1)
|
|
100
|
+
e += `'${t[0]}')`;
|
|
101
|
+
else if (t.length > 1)
|
|
102
|
+
for (let i in t)
|
|
103
|
+
e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
|
|
104
|
+
return e;
|
|
105
|
+
}, this.buildLabelSqlStatement = function(t) {
|
|
106
|
+
let e = "select entity, label from labels where entity in (";
|
|
107
|
+
if (t.length === 1)
|
|
108
|
+
e += `'${t[0]}')`;
|
|
109
|
+
else if (t.length > 1)
|
|
110
|
+
for (let i in t)
|
|
111
|
+
e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
|
|
112
|
+
return e;
|
|
113
|
+
}, this.findAllIdsFromConnectivity = function(t) {
|
|
114
|
+
let e = t.connectivity.flat(), i = [...new Set(e)], n = [];
|
|
115
115
|
return i.forEach((s) => {
|
|
116
116
|
Array.isArray(s) ? n.push(s.flat()) : n.push(s);
|
|
117
117
|
}), [...new Set(n.flat())];
|
|
118
|
-
}, this.flattenConnectivity = function(
|
|
119
|
-
let
|
|
118
|
+
}, this.flattenConnectivity = function(t) {
|
|
119
|
+
let e = t.flat(), i = [...new Set(e)], n = [];
|
|
120
120
|
return i.forEach((s) => {
|
|
121
121
|
Array.isArray(s) ? n.push(s.flat()) : n.push(s);
|
|
122
122
|
}), n.flat();
|
|
123
|
-
}, this.findComponents = function(
|
|
124
|
-
let s =
|
|
123
|
+
}, this.findComponents = function(t, e, i, n) {
|
|
124
|
+
let s = t.connectivity.flat(), o = d(s), a = [], r = !1;
|
|
125
125
|
return o.forEach((l) => {
|
|
126
|
-
r = !1, g(
|
|
126
|
+
r = !1, g(e, l) && (r = !0), n && g(n, l) && (r = !0), g(i, l) && (r = !0), r || a.push(l);
|
|
127
127
|
}), a;
|
|
128
|
-
}, this.retrieveFlatmapKnowledgeForEvent = async function(
|
|
128
|
+
}, this.retrieveFlatmapKnowledgeForEvent = async function(t, e) {
|
|
129
129
|
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
|
|
130
|
-
const i =
|
|
130
|
+
const i = e.resource;
|
|
131
131
|
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !i || i.length === 0 || !i[0]) return;
|
|
132
|
-
let n = this.queryForConnectivityNew(
|
|
132
|
+
let n = this.queryForConnectivityNew(t, i[0]);
|
|
133
133
|
return await Promise.all([n]);
|
|
134
|
-
}, this.queryForConnectivityNew = function(
|
|
134
|
+
}, this.queryForConnectivityNew = function(t, e, i = "sckan", n = !0) {
|
|
135
135
|
return this.connectivitySource = i, new Promise((s) => {
|
|
136
|
-
(i === "map" ? this.queryMapConnectivity(
|
|
136
|
+
(i === "map" ? this.queryMapConnectivity(t.provenance.uuid, e) : t.queryKnowledge(e)).then((a) => {
|
|
137
137
|
if (this.checkConnectivityExists(a)) {
|
|
138
138
|
let r = a;
|
|
139
|
-
n ? this.processConnectivity(
|
|
139
|
+
n ? this.processConnectivity(t, r).then((l) => {
|
|
140
140
|
a.references && (this.rawURLs = [...a.references]), s(l);
|
|
141
141
|
}) : s(r);
|
|
142
142
|
} else
|
|
143
143
|
s(!1);
|
|
144
144
|
}).catch((a) => {
|
|
145
|
-
a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${
|
|
145
|
+
a.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${e}.`), s(!1);
|
|
146
146
|
});
|
|
147
147
|
});
|
|
148
|
-
}, this.queryMapConnectivity = async function(
|
|
149
|
-
const i = this.flatmapAPI + `flatmap/${
|
|
148
|
+
}, this.queryMapConnectivity = async function(t, e) {
|
|
149
|
+
const i = this.flatmapAPI + `flatmap/${t}/connectivity/${e}`;
|
|
150
150
|
try {
|
|
151
151
|
const n = await fetch(i);
|
|
152
152
|
if (!n.ok)
|
|
@@ -155,8 +155,8 @@ let P = function() {
|
|
|
155
155
|
} catch (n) {
|
|
156
156
|
throw new Error(n);
|
|
157
157
|
}
|
|
158
|
-
}, this.queryForConnectivity = function(
|
|
159
|
-
const s = { sql: this.buildConnectivitySqlStatement(
|
|
158
|
+
}, this.queryForConnectivity = function(t, e, i, n = !0) {
|
|
159
|
+
const s = { sql: this.buildConnectivitySqlStatement(e) }, o = {
|
|
160
160
|
method: "POST",
|
|
161
161
|
headers: {
|
|
162
162
|
"Content-Type": "application/json"
|
|
@@ -169,7 +169,7 @@ let P = function() {
|
|
|
169
169
|
fetch(`${this.flatmapAPI}knowledge/query/`, o).then((r) => r.json()).then((r) => {
|
|
170
170
|
if (this.connectivityExists(r)) {
|
|
171
171
|
let l = JSON.parse(r.values[0][0]);
|
|
172
|
-
n ? this.processConnectivity(
|
|
172
|
+
n ? this.processConnectivity(t, l).then((c) => {
|
|
173
173
|
a(c);
|
|
174
174
|
}) : a(l);
|
|
175
175
|
} else
|
|
@@ -178,23 +178,23 @@ let P = function() {
|
|
|
178
178
|
r.name === "AbortError" || console.error("Error:", r), a(!1);
|
|
179
179
|
});
|
|
180
180
|
});
|
|
181
|
-
}, this.checkConnectivityExists = function(
|
|
182
|
-
var
|
|
183
|
-
return
|
|
184
|
-
}, this.connectivityExists = function(
|
|
185
|
-
return !!(
|
|
186
|
-
}, this.findIfNodeIsSingle = function(
|
|
187
|
-
return
|
|
188
|
-
}, this.createLabelFromNeuralNode = function(
|
|
189
|
-
let i = this.findIfNodeIsSingle(
|
|
181
|
+
}, this.checkConnectivityExists = function(t) {
|
|
182
|
+
var e;
|
|
183
|
+
return t && ((e = t.connectivity) == null ? void 0 : e.length);
|
|
184
|
+
}, this.connectivityExists = function(t) {
|
|
185
|
+
return !!(t.values && t.values.length > 0 && JSON.parse(t.values[0][0]).connectivity && JSON.parse(t.values[0][0]).connectivity.length > 0);
|
|
186
|
+
}, this.findIfNodeIsSingle = function(t) {
|
|
187
|
+
return t.length === 1 ? (console.error("Server returns a single node", t), t[0]) : t.length === 2 && t[1].length === 0 ? t[0] : !1;
|
|
188
|
+
}, this.createLabelFromNeuralNode = function(t, e) {
|
|
189
|
+
let i = this.findIfNodeIsSingle(t);
|
|
190
190
|
if (i)
|
|
191
|
-
return
|
|
192
|
-
let n = t[
|
|
193
|
-
return
|
|
194
|
-
|
|
191
|
+
return e[i];
|
|
192
|
+
let n = e[t[0]];
|
|
193
|
+
return t.length === 2 && t[1].length > 0 && t[1].forEach((s) => {
|
|
194
|
+
e[s] == null ? n += `, ${s}` : n += `, ${e[s]}`;
|
|
195
195
|
}), n;
|
|
196
|
-
}, this.flattenAndFindDatasets = function(
|
|
197
|
-
let n = this.flattenConnectivity(
|
|
196
|
+
}, this.flattenAndFindDatasets = function(t, e, i) {
|
|
197
|
+
let n = this.flattenConnectivity(t), s = this.flattenConnectivity(e), o = this.flattenConnectivity(i);
|
|
198
198
|
this.originsWithDatasets = this.uberons.filter(
|
|
199
199
|
(a) => n.indexOf(a.id) !== -1
|
|
200
200
|
).sort(p), this.componentsWithDatasets = this.uberons.filter(
|
|
@@ -202,20 +202,20 @@ let P = function() {
|
|
|
202
202
|
).sort(p), this.destinationsWithDatasets = this.uberons.filter(
|
|
203
203
|
(a) => o.indexOf(a.id) !== -1
|
|
204
204
|
).sort(p);
|
|
205
|
-
}, this.processConnectivity = function(
|
|
205
|
+
}, this.processConnectivity = function(t, e) {
|
|
206
206
|
return new Promise((i) => {
|
|
207
207
|
let n = [], s = [], o;
|
|
208
|
-
if (
|
|
208
|
+
if (e && e["node-phenotypes"]) {
|
|
209
209
|
const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
|
210
|
-
l.forEach((
|
|
211
|
-
|
|
212
|
-
}), n = d(n), c.forEach((
|
|
213
|
-
|
|
210
|
+
l.forEach((f) => {
|
|
211
|
+
f in e["node-phenotypes"] && n.push(...e["node-phenotypes"][f]);
|
|
212
|
+
}), n = d(n), c.forEach((f) => {
|
|
213
|
+
f in e["node-phenotypes"] && s.push(...e["node-phenotypes"][f]);
|
|
214
214
|
}), s = d(s);
|
|
215
215
|
} else
|
|
216
|
-
s = d(
|
|
217
|
-
const a = this.findComponents(
|
|
218
|
-
this.createLabelLookup(
|
|
216
|
+
s = d(e.axons), e.somas && e.somas.length > 0 && n.push(...e.somas), e.dendrites && e.dendrites.length > 0 && n.push(...e.dendrites), n = d(n), o = e.somas;
|
|
217
|
+
const a = this.findComponents(e, s, n, o), r = this.findAllIdsFromConnectivity(e);
|
|
218
|
+
this.createLabelLookup(t, r).then((l) => {
|
|
219
219
|
this.origins = n.map(
|
|
220
220
|
(c) => this.createLabelFromNeuralNode(c, l)
|
|
221
221
|
).sort(p), this.components = a.map(
|
|
@@ -236,31 +236,31 @@ let P = function() {
|
|
|
236
236
|
});
|
|
237
237
|
});
|
|
238
238
|
});
|
|
239
|
-
}, this.buildPubmedSqlStatement = function(
|
|
240
|
-
let
|
|
241
|
-
if (
|
|
242
|
-
|
|
243
|
-
else if (
|
|
244
|
-
for (let i in
|
|
245
|
-
|
|
246
|
-
return
|
|
247
|
-
}, this.buildPubmedSqlStatementForModels = function(
|
|
248
|
-
return `select distinct publication from publications where entity = '${
|
|
249
|
-
}, this.flatmapQuery = function(
|
|
250
|
-
const
|
|
239
|
+
}, this.buildPubmedSqlStatement = function(t) {
|
|
240
|
+
let e = "select distinct publication from publications where entity in (";
|
|
241
|
+
if (t.length === 1)
|
|
242
|
+
e += `'${t[0]}')`;
|
|
243
|
+
else if (t.length > 1)
|
|
244
|
+
for (let i in t)
|
|
245
|
+
e += `'${t[i]}'${i >= t.length - 1 ? ")" : ","} `;
|
|
246
|
+
return e;
|
|
247
|
+
}, this.buildPubmedSqlStatementForModels = function(t) {
|
|
248
|
+
return `select distinct publication from publications where entity = '${t}'`;
|
|
249
|
+
}, this.flatmapQuery = function(t) {
|
|
250
|
+
const e = { sql: t };
|
|
251
251
|
return fetch(`${this.flatmapAPI}knowledge/query/`, {
|
|
252
252
|
method: "POST",
|
|
253
253
|
headers: {
|
|
254
254
|
"Content-Type": "application/json"
|
|
255
255
|
},
|
|
256
|
-
body: JSON.stringify(
|
|
256
|
+
body: JSON.stringify(e)
|
|
257
257
|
}).then((i) => i.json()).catch((i) => {
|
|
258
258
|
console.error("Error:", i);
|
|
259
259
|
});
|
|
260
260
|
};
|
|
261
261
|
};
|
|
262
|
-
function T(
|
|
263
|
-
return
|
|
262
|
+
function T(t) {
|
|
263
|
+
return t[0].toUpperCase() + t.substring(1);
|
|
264
264
|
}
|
|
265
265
|
const O = {
|
|
266
266
|
emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
|
|
@@ -281,7 +281,7 @@ const O = {
|
|
|
281
281
|
},
|
|
282
282
|
inject: ["showGlobalSettings", "showOpenMapButton"],
|
|
283
283
|
computed: {
|
|
284
|
-
...
|
|
284
|
+
...N(C, I, A),
|
|
285
285
|
idNamePair() {
|
|
286
286
|
return this.splitFlowStore.idNamePair;
|
|
287
287
|
},
|
|
@@ -309,25 +309,25 @@ const O = {
|
|
|
309
309
|
onConnectivityItemClose() {
|
|
310
310
|
if (this != null && this.alive) {
|
|
311
311
|
if (this.multiflatmapRef) {
|
|
312
|
-
const
|
|
313
|
-
|
|
312
|
+
const t = this.multiflatmapRef.getCurrentFlatmap();
|
|
313
|
+
t && t.closeTooltip();
|
|
314
314
|
}
|
|
315
315
|
this.flatmapRef && this.flatmapRef.closeTooltip();
|
|
316
316
|
}
|
|
317
317
|
},
|
|
318
318
|
getState: function() {
|
|
319
319
|
},
|
|
320
|
-
openMap: function(
|
|
321
|
-
|
|
320
|
+
openMap: function(t) {
|
|
321
|
+
h.emit("OpenNewMap", t), this.trackOpenMap(`open_new_${t}_map`);
|
|
322
322
|
},
|
|
323
|
-
onMapmanagerLoaded: function(
|
|
324
|
-
this.settingsStore.updateMapManager(
|
|
323
|
+
onMapmanagerLoaded: function(t) {
|
|
324
|
+
this.settingsStore.updateMapManager(t);
|
|
325
325
|
},
|
|
326
|
-
trackOpenMap: function(
|
|
326
|
+
trackOpenMap: function(t) {
|
|
327
327
|
M.sendEvent({
|
|
328
328
|
event: "interaction_event",
|
|
329
329
|
event_name: "portal_maps_open_map",
|
|
330
|
-
category:
|
|
330
|
+
category: t,
|
|
331
331
|
location: "open_new_map"
|
|
332
332
|
});
|
|
333
333
|
},
|
|
@@ -347,25 +347,25 @@ const O = {
|
|
|
347
347
|
/**
|
|
348
348
|
* Callback when the vuers emit a selected event.
|
|
349
349
|
*/
|
|
350
|
-
resourceSelected: function(
|
|
350
|
+
resourceSelected: function(t, e) {
|
|
351
351
|
var a, r, l, c;
|
|
352
|
-
const i =
|
|
352
|
+
const i = e[0];
|
|
353
353
|
if (this.resourceHasAction(i)) {
|
|
354
|
-
|
|
354
|
+
h.emit("PopoverActionClick", i);
|
|
355
355
|
return;
|
|
356
356
|
}
|
|
357
357
|
let n, s = !1;
|
|
358
358
|
const o = {
|
|
359
359
|
paneIndex: this.entry.id,
|
|
360
|
-
type:
|
|
361
|
-
resource:
|
|
360
|
+
type: t,
|
|
361
|
+
resource: e,
|
|
362
362
|
internalName: void 0,
|
|
363
363
|
eventType: void 0
|
|
364
364
|
};
|
|
365
|
-
if (
|
|
365
|
+
if (t == "MultiFlatmap" || t == "Flatmap")
|
|
366
366
|
if (o.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click") {
|
|
367
367
|
if (o.eventType = "selected", i.feature.type == "marker") {
|
|
368
|
-
let
|
|
368
|
+
let f = o.internalName;
|
|
369
369
|
if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
|
|
370
370
|
n = {
|
|
371
371
|
type: "Search",
|
|
@@ -375,7 +375,7 @@ const O = {
|
|
|
375
375
|
else {
|
|
376
376
|
n = {
|
|
377
377
|
type: "Facet",
|
|
378
|
-
facet:
|
|
378
|
+
facet: f,
|
|
379
379
|
facetPropPath: "anatomy.organ.category.name",
|
|
380
380
|
facetSubPropPath: "anatomy.organ.name",
|
|
381
381
|
term: "Anatomical structure"
|
|
@@ -383,24 +383,24 @@ const O = {
|
|
|
383
383
|
let u = /* @__PURE__ */ new Set();
|
|
384
384
|
i.feature["marker-terms"].forEach((y) => {
|
|
385
385
|
u.add(y.label);
|
|
386
|
-
}), u.add(
|
|
386
|
+
}), u.add(f), u.size > 0 && (n = {
|
|
387
387
|
type: "Facets",
|
|
388
388
|
labels: [...u]
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
s = !0,
|
|
391
|
+
s = !0, t == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
|
392
392
|
}
|
|
393
393
|
} else i.eventType == "mouseenter" && (o.eventType = "highlighted", s = !0);
|
|
394
|
-
else
|
|
394
|
+
else t == "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), o.internalName = i.data.id, i.data.lastActionOnMarker === !0 && (n = {
|
|
395
395
|
type: "Facet",
|
|
396
396
|
facet: T(i.data.id),
|
|
397
397
|
facetPropPath: "anatomy.organ.category.name",
|
|
398
398
|
term: "Anatomical structure"
|
|
399
399
|
})), o.eventType = "selected", s = !0);
|
|
400
|
-
n &&
|
|
400
|
+
n && h.emit("PopoverActionClick", n), s && this.$emit("resource-selected", o);
|
|
401
401
|
},
|
|
402
|
-
resourceHasAction: function(
|
|
403
|
-
return
|
|
402
|
+
resourceHasAction: function(t) {
|
|
403
|
+
return t && (t.type === "URL" || t.type === "Search" || t.type === "Neuron Search" || t.type == "Facet" || t.type == "Facets");
|
|
404
404
|
},
|
|
405
405
|
/**
|
|
406
406
|
* Check if this viewer is currently visible
|
|
@@ -415,39 +415,39 @@ const O = {
|
|
|
415
415
|
* if it cannot be found in the map, it will perform several
|
|
416
416
|
* calls to try to ge a valid name/id.
|
|
417
417
|
*/
|
|
418
|
-
getNameAndIdFromSyncData: async function(
|
|
419
|
-
let
|
|
420
|
-
|
|
418
|
+
getNameAndIdFromSyncData: async function(t) {
|
|
419
|
+
let e = t.internalName;
|
|
420
|
+
e === void 0 && t.resource && (e = t.resource.label);
|
|
421
421
|
let i;
|
|
422
|
-
if (
|
|
423
|
-
if (this.$refs.scaffold.findObjectsWithGroupName(
|
|
424
|
-
if (
|
|
425
|
-
const o = S(
|
|
422
|
+
if (t.resource && t.resource.resource && (i = t.resource.resource[0]), this.entry.type === "Scaffold") {
|
|
423
|
+
if (this.$refs.scaffold.findObjectsWithGroupName(e).length === 0) {
|
|
424
|
+
if (t.resource && t.resource.feature) {
|
|
425
|
+
const o = S(t.resource.feature.models);
|
|
426
426
|
if (o.length > 0) return o;
|
|
427
427
|
}
|
|
428
|
-
let s = $(
|
|
428
|
+
let s = $(e);
|
|
429
429
|
if (s)
|
|
430
430
|
return s;
|
|
431
|
-
if (i &&
|
|
431
|
+
if (i && t.eventType === "selected")
|
|
432
432
|
return fetch(`${this.apiLocation}get-related-terms/${i}`).then((o) => o.json()).then((o) => {
|
|
433
433
|
var a;
|
|
434
434
|
if (((a = o.uberon) == null ? void 0 : a.array.length) > 0)
|
|
435
|
-
return
|
|
435
|
+
return e = o.uberon.array[0].name.charAt(0).toUpperCase() + o.uberon.array[0].name.slice(1), i = o.uberon.array[0].id.toUpperCase(), { id: i, name: e };
|
|
436
436
|
});
|
|
437
437
|
}
|
|
438
438
|
} else if (this.entry.type === "MultiFlatmap")
|
|
439
|
-
if (
|
|
440
|
-
|
|
439
|
+
if (e === "Bladder")
|
|
440
|
+
e = "Urinary Bladder";
|
|
441
441
|
else {
|
|
442
|
-
const n = S(
|
|
443
|
-
n.length > 0 && (
|
|
442
|
+
const n = S(e);
|
|
443
|
+
n.length > 0 && (e = n[0]);
|
|
444
444
|
}
|
|
445
|
-
return { id: i, name:
|
|
445
|
+
return { id: i, name: e };
|
|
446
446
|
},
|
|
447
447
|
// Get the species and andaotmy info for the featured datasets
|
|
448
|
-
getDatasetAnatomyInfo: function(
|
|
449
|
-
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${
|
|
450
|
-
const i =
|
|
448
|
+
getDatasetAnatomyInfo: function(t) {
|
|
449
|
+
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${t}`).then((e) => e.json()).then((e) => {
|
|
450
|
+
const i = e.result[0];
|
|
451
451
|
let n;
|
|
452
452
|
try {
|
|
453
453
|
n = i.anatomy.organ[0].curie;
|
|
@@ -471,7 +471,7 @@ const O = {
|
|
|
471
471
|
o = void 0;
|
|
472
472
|
}
|
|
473
473
|
this.settingsStore.updateFeaturedMarker({
|
|
474
|
-
identifier:
|
|
474
|
+
identifier: t,
|
|
475
475
|
marker: n,
|
|
476
476
|
doi: s,
|
|
477
477
|
species: o
|
|
@@ -480,25 +480,25 @@ const O = {
|
|
|
480
480
|
},
|
|
481
481
|
// Check if the old featured dataset api has any info
|
|
482
482
|
oldFeaturedDatasetApiHasInfo: async function() {
|
|
483
|
-
let
|
|
484
|
-
return !
|
|
483
|
+
let e = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
|
|
484
|
+
return !e.identifiers || e.identifiers.length == 0 ? !1 : e.identifiers;
|
|
485
485
|
},
|
|
486
486
|
// Check if the new featured dataset api has any info
|
|
487
487
|
newFeaturedDatasetApiHasInfo: async function() {
|
|
488
|
-
let
|
|
489
|
-
return !
|
|
488
|
+
let e = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
|
489
|
+
return !e.datasets || e.datasets.length == 0 ? !1 : e.datasets.map((i) => i.id);
|
|
490
490
|
},
|
|
491
491
|
/**
|
|
492
492
|
* Get a list of featured datasets to display.
|
|
493
493
|
*/
|
|
494
494
|
getFeaturedDatasets: async function() {
|
|
495
|
-
let
|
|
496
|
-
if (
|
|
495
|
+
let t = [], e = await this.oldFeaturedDatasetApiHasInfo();
|
|
496
|
+
if (e) t = e;
|
|
497
497
|
else {
|
|
498
498
|
let i = await this.newFeaturedDatasetApiHasInfo();
|
|
499
|
-
i && (
|
|
499
|
+
i && (t = i);
|
|
500
500
|
}
|
|
501
|
-
this.settingsStore.updateFeatured(
|
|
501
|
+
this.settingsStore.updateFeatured(t), t.forEach((i) => {
|
|
502
502
|
this.getDatasetAnatomyInfo(i);
|
|
503
503
|
});
|
|
504
504
|
},
|
|
@@ -523,8 +523,8 @@ const O = {
|
|
|
523
523
|
onHelpModeShowNext: function() {
|
|
524
524
|
this.helpModeActiveItem += 1;
|
|
525
525
|
},
|
|
526
|
-
onHelpModeLastItem: function(
|
|
527
|
-
|
|
526
|
+
onHelpModeLastItem: function(t) {
|
|
527
|
+
t && (this.helpModeLastItem = !0);
|
|
528
528
|
},
|
|
529
529
|
onFinishHelpMode: function() {
|
|
530
530
|
this.helpMode = !1, this.helpModeActiveItem = 0, this.helpModeLastItem = !1;
|
|
@@ -538,36 +538,36 @@ const O = {
|
|
|
538
538
|
/**
|
|
539
539
|
* End help-mode only if user clicks outside of help mode dialog.
|
|
540
540
|
*/
|
|
541
|
-
checkEndHelpMouseDown: function(
|
|
542
|
-
|
|
541
|
+
checkEndHelpMouseDown: function(t) {
|
|
542
|
+
t.target.closest(".help-mode-dialog") || this.endHelp();
|
|
543
543
|
},
|
|
544
|
-
flatmapHighlight: async function(
|
|
545
|
-
let s = [...
|
|
544
|
+
flatmapHighlight: async function(t, e, i, n) {
|
|
545
|
+
let s = [...e, ...n];
|
|
546
546
|
const o = this.settingsStore.globalSettings;
|
|
547
547
|
if (o.highlightConnectedPaths) {
|
|
548
|
-
const a =
|
|
548
|
+
const a = e.length ? e : n.length ? n : [], r = await t.retrieveConnectedPaths(a);
|
|
549
549
|
r && s.push(...r);
|
|
550
550
|
}
|
|
551
551
|
if (o.highlightDOIPaths) {
|
|
552
|
-
const a = await
|
|
552
|
+
const a = await t.searchConnectivitiesByReference(i);
|
|
553
553
|
a && s.push(...a);
|
|
554
554
|
}
|
|
555
555
|
return s = [...new Set(s)], s;
|
|
556
556
|
},
|
|
557
|
-
sidebarHoverHighlight: function(
|
|
558
|
-
var
|
|
557
|
+
sidebarHoverHighlight: function(t) {
|
|
558
|
+
var e, i;
|
|
559
559
|
if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
|
|
560
560
|
const n = this.settingsStore.hoverAnatomies, s = this.settingsStore.hoverOrgans, o = this.settingsStore.hoverDOI, a = this.settingsStore.hoverConnectivity;
|
|
561
561
|
let r = null, l = null;
|
|
562
|
-
this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((
|
|
562
|
+
this.flatmapRef && (r = this.flatmapRef), this.multiflatmapRef && (r = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (l = this.scaffoldRef), clearTimeout(this.highlightDelay), !n.length && !s.length && !o && !a.length && ((this.multiflatmapRef || this.flatmapRef) && r ? ((e = r.mapImp) == null || e.clearSearchResults(), t.connectivityProcessed && ((i = r.mapImp) == null || i.setPaint({ dimmed: !0 }))) : this.scaffoldRef && l && l.changeHighlightedByName(s, "", !1)), this.highlightDelay = setTimeout(() => {
|
|
563
563
|
(n.length || s.length || o || a.length) && ((this.multiflatmapRef || this.flatmapRef) && r ? this.flatmapHighlight(r, n, o, a).then((c) => {
|
|
564
564
|
try {
|
|
565
565
|
r.showConnectivityTooltips({
|
|
566
566
|
connectivityInfo: { featureId: c },
|
|
567
567
|
data: []
|
|
568
568
|
});
|
|
569
|
-
} catch (
|
|
570
|
-
if (console.log(
|
|
569
|
+
} catch (f) {
|
|
570
|
+
if (console.log(f), a.length && r.mapImp) {
|
|
571
571
|
const u = r.mapImp.uuid;
|
|
572
572
|
c.every(
|
|
573
573
|
(w) => this.connectivityKnowledge[u].some(
|
|
@@ -580,33 +580,27 @@ const O = {
|
|
|
580
580
|
}, 100);
|
|
581
581
|
}
|
|
582
582
|
},
|
|
583
|
-
onAnnotationOpen: function(
|
|
584
|
-
|
|
583
|
+
onAnnotationOpen: function(t) {
|
|
584
|
+
h.emit("annotation-open", t);
|
|
585
585
|
},
|
|
586
586
|
onAnnotationClose: function() {
|
|
587
|
-
|
|
587
|
+
h.emit("sidebar-annotation-close");
|
|
588
588
|
},
|
|
589
|
-
updateOfflineAnnotationEnabled: function(
|
|
590
|
-
|
|
589
|
+
updateOfflineAnnotationEnabled: function(t) {
|
|
590
|
+
h.emit("update-offline-annotation-enabled", t);
|
|
591
591
|
},
|
|
592
|
-
onConnectivityInfoOpen: function(
|
|
593
|
-
|
|
592
|
+
onConnectivityInfoOpen: function(t) {
|
|
593
|
+
h.emit("connectivity-info-open", t);
|
|
594
594
|
},
|
|
595
|
-
onConnectivityError: function(
|
|
596
|
-
|
|
595
|
+
onConnectivityError: function(t) {
|
|
596
|
+
h.emit("connectivity-error", t);
|
|
597
597
|
},
|
|
598
598
|
onConnectivityInfoClose: function() {
|
|
599
|
-
|
|
599
|
+
h.emit("connectivity-info-close");
|
|
600
600
|
},
|
|
601
601
|
onSidebarAnnotationClose: function() {
|
|
602
602
|
},
|
|
603
|
-
|
|
604
|
-
f.emit("neuron-connection-click", e);
|
|
605
|
-
},
|
|
606
|
-
onNeuronConnectionFeatureClick: function(e) {
|
|
607
|
-
f.emit("neuron-connection-feature-click", e);
|
|
608
|
-
},
|
|
609
|
-
showConnectivity: function(e) {
|
|
603
|
+
showConnectivity: function() {
|
|
610
604
|
},
|
|
611
605
|
showConnectivitiesByReference: function() {
|
|
612
606
|
},
|
|
@@ -616,10 +610,10 @@ const O = {
|
|
|
616
610
|
},
|
|
617
611
|
setVisibilityFilter: function() {
|
|
618
612
|
},
|
|
619
|
-
loadConnectivityExplorerConfig: async function(
|
|
620
|
-
const
|
|
613
|
+
loadConnectivityExplorerConfig: async function(t) {
|
|
614
|
+
const e = t.mapImp, i = H(e), n = F(new P());
|
|
621
615
|
n.initialise(this.flatmapAPI);
|
|
622
|
-
const s = await
|
|
616
|
+
const s = await L(e, n), o = e.uuid, a = e.pathways;
|
|
623
617
|
if (this.connectivityKnowledge[i] || (this.connectivityKnowledge[i] = s.filter((r) => {
|
|
624
618
|
var l;
|
|
625
619
|
return r.source === i && ((l = r.connectivity) == null ? void 0 : l.length);
|
|
@@ -627,7 +621,7 @@ const O = {
|
|
|
627
621
|
const r = a ? a.paths : {};
|
|
628
622
|
this.connectivityKnowledge[o] = this.connectivityKnowledge[i].filter((l) => l.id in r);
|
|
629
623
|
}
|
|
630
|
-
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await
|
|
624
|
+
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[o] || (this.connectivityFilterOptions[o] = await t.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[o] || (this.connectivityFilterSources[o] = t.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), h.emit("species-layout-connectivity-update");
|
|
631
625
|
}
|
|
632
626
|
},
|
|
633
627
|
data: function() {
|
|
@@ -660,8 +654,8 @@ const O = {
|
|
|
660
654
|
this.flatmapAPI = void 0, this.apiLocation = void 0, this.settingsStore.flatmapAPI && (this.flatmapAPI = this.settingsStore.flatmapAPI), this.settingsStore.sparcApi && (this.apiLocation = this.settingsStore.sparcApi), this.settingsStore.mapManager && (this.mapManager = this.settingsStore.mapManager);
|
|
661
655
|
},
|
|
662
656
|
watch: {
|
|
663
|
-
helpMode: function(
|
|
664
|
-
|
|
657
|
+
helpMode: function(t) {
|
|
658
|
+
t || (this.helpModeActiveItem = 0);
|
|
665
659
|
}
|
|
666
660
|
}
|
|
667
661
|
};
|