@abi-software/mapintegratedvuer 1.16.3 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ConnectivityGraph-DbqPx-8k.js +125 -0
- package/dist/{ContentMixin-RE4Jc7WG.js → ContentMixin-R9Bw7Ou4.js} +402 -358
- package/dist/{Flatmap-DXXR61vl.js → Flatmap-BYUfDJ9B.js} +3 -3
- package/dist/{Iframe-D5fwyEe9.js → Iframe-2ofJ9NJW.js} +2 -2
- package/dist/{MultiFlatmap-8hwvr8gU.js → MultiFlatmap-CYxpB20e.js} +14 -7
- package/dist/{Plot-CuWj6dHZ.js → Plot-DmQzP7lz.js} +2 -2
- package/dist/{Scaffold-1on4AB8o.js → Scaffold-C8x1IHb9.js} +2 -2
- package/dist/{Simulation-lAoTO-cv.js → Simulation-D9pblkqI.js} +2 -2
- package/dist/{index-E1q0fbBZ.js → index-raNlNgsS.js} +29221 -27701
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +194 -186
- package/dist/{style-D61YTVwL.js → style-QpNSY6to.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/src/App.vue +6 -0
- package/src/components/ContentVuer.vue +5 -1
- package/src/components/MapContent.vue +5 -0
- package/src/components/SplitDialog.vue +5 -6
- package/src/components/SplitFlow.vue +55 -1
- package/src/components/scripts/utilities.js +15 -0
- package/src/components/viewers/ConnectivityGraph.vue +146 -0
- package/src/components/viewers/MultiFlatmap.vue +8 -4
- package/src/components.d.ts +1 -0
- package/src/mixins/ContentMixin.js +1 -1
- package/src/stores/connectivities.js +6 -1
- package/src/stores/splitFlow.js +9 -5
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { markRaw as y } from "vue";
|
|
2
|
-
import { c as
|
|
3
|
-
import { mapStores as
|
|
4
|
-
const
|
|
5
|
-
return e ? [...new Set(e.map((
|
|
6
|
-
(
|
|
2
|
+
import { G as _, c as E, u as O, d as N, e as x, E as m, T as M, f as R, h as P, i as w, l as B, j as X, k as U } from "./index-raNlNgsS.js";
|
|
3
|
+
import { mapStores as k } from "pinia";
|
|
4
|
+
const b = function(e) {
|
|
5
|
+
return e ? [...new Set(e.map((n) => JSON.stringify(n)))].map(
|
|
6
|
+
(n) => JSON.parse(n)
|
|
7
7
|
) : [];
|
|
8
|
-
}, d = [], T = async function(e,
|
|
9
|
-
const
|
|
10
|
-
(i) => d.some((
|
|
11
|
-
),
|
|
12
|
-
(i) =>
|
|
13
|
-
), a =
|
|
14
|
-
(i) => !
|
|
8
|
+
}, d = [], T = async function(e, n) {
|
|
9
|
+
const r = n.filter(
|
|
10
|
+
(i) => d.some((l) => l.taxon === i)
|
|
11
|
+
), t = d.filter(
|
|
12
|
+
(i) => r.includes(i.taxon)
|
|
13
|
+
), a = n.filter(
|
|
14
|
+
(i) => !r.includes(i)
|
|
15
15
|
);
|
|
16
16
|
if (a.length) {
|
|
17
17
|
const i = await e.queryLabels(a);
|
|
18
18
|
if (i.length)
|
|
19
|
-
return i.forEach((
|
|
20
|
-
let { entity:
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
}),
|
|
19
|
+
return i.forEach((l) => {
|
|
20
|
+
let { entity: s, label: h } = l;
|
|
21
|
+
h === "Mammalia" && (h = "Mammalia not otherwise specified");
|
|
22
|
+
const o = { taxon: s, label: h };
|
|
23
|
+
t.push(o), d.push(o);
|
|
24
|
+
}), t;
|
|
25
25
|
} else
|
|
26
|
-
return
|
|
27
|
-
}, L = function(e,
|
|
28
|
-
if (!e || !
|
|
29
|
-
let
|
|
30
|
-
return
|
|
31
|
-
}, A = (e,
|
|
32
|
-
const
|
|
26
|
+
return t;
|
|
27
|
+
}, L = function(e, n) {
|
|
28
|
+
if (!e || !n) return !1;
|
|
29
|
+
let r = JSON.stringify(e), t = JSON.stringify(n);
|
|
30
|
+
return r.indexOf(t) !== -1;
|
|
31
|
+
}, A = (e, n) => {
|
|
32
|
+
const r = e.name ?? e, t = n.name ?? n, a = r.toUpperCase(), i = t.toUpperCase();
|
|
33
33
|
return a < i ? -1 : a > i ? 1 : 0;
|
|
34
34
|
};
|
|
35
35
|
let S = function() {
|
|
36
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,
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
let
|
|
42
|
-
if (
|
|
43
|
-
|
|
37
|
+
this.flatmapAPI = e, this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.hasSingleConnectivityList = !1, this.rawURLs = [], this.controller = void 0, this.uberons = [], this.lookUp = [], this.connectivitySource = "map", this.noMapConnectivity = !1;
|
|
38
|
+
}, this.createTooltipData = async function(e, n) {
|
|
39
|
+
let r = [];
|
|
40
|
+
n.feature.hyperlinks && n.feature.hyperlinks.length > 0 ? r = n.feature.hyperlinks : r = this.rawURLs;
|
|
41
|
+
let t;
|
|
42
|
+
if (n.provenanceTaxonomy) {
|
|
43
|
+
t = [];
|
|
44
44
|
try {
|
|
45
|
-
const i = await T(e,
|
|
46
|
-
i.length && i.forEach((
|
|
47
|
-
const { label:
|
|
48
|
-
|
|
45
|
+
const i = await T(e, n.provenanceTaxonomy);
|
|
46
|
+
i.length && i.forEach((l) => {
|
|
47
|
+
const { label: s } = l;
|
|
48
|
+
t.push(s);
|
|
49
49
|
});
|
|
50
50
|
} catch (i) {
|
|
51
51
|
console.log(i);
|
|
@@ -58,11 +58,15 @@ let S = function() {
|
|
|
58
58
|
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
59
59
|
originsWithDatasets: this.originsWithDatasets,
|
|
60
60
|
componentsWithDatasets: this.componentsWithDatasets,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
destinationsCombinations: this.destinationsCombinations,
|
|
62
|
+
originsCombinations: this.originsCombinations,
|
|
63
|
+
componentsCombinations: this.componentsCombinations,
|
|
64
|
+
hasSingleConnectivityList: this.singleConnectivityList.length > 0,
|
|
65
|
+
title: n.label,
|
|
66
|
+
featureId: n.resource,
|
|
67
|
+
hyperlinks: r,
|
|
68
|
+
provenanceTaxonomy: n.provenanceTaxonomy,
|
|
69
|
+
provenanceTaxonomyLabel: t,
|
|
66
70
|
connectivitySource: this.connectivitySource,
|
|
67
71
|
noMapConnectivity: this.noMapConnectivity
|
|
68
72
|
};
|
|
@@ -75,167 +79,207 @@ let S = function() {
|
|
|
75
79
|
componentsWithDatasets: this.componentsWithDatasets,
|
|
76
80
|
destinations: this.destinations,
|
|
77
81
|
destinationsWithDatasets: this.destinationsWithDatasets,
|
|
82
|
+
destinationsCombinations: this.destinationsCombinations,
|
|
83
|
+
originsCombinations: this.originsCombinations,
|
|
84
|
+
componentsCombinations: this.componentsCombinations,
|
|
78
85
|
connectivitySource: this.connectivitySource,
|
|
79
86
|
noMapConnectivity: this.noMapConnectivity
|
|
80
87
|
};
|
|
81
|
-
}, this.createComponentsLabelList = function(e,
|
|
82
|
-
let
|
|
83
|
-
return e.forEach((
|
|
84
|
-
|
|
85
|
-
}),
|
|
86
|
-
}, this.createLabelLookup = function(e,
|
|
87
|
-
return new Promise(async (
|
|
88
|
-
let
|
|
88
|
+
}, this.createComponentsLabelList = function(e, n) {
|
|
89
|
+
let r = [];
|
|
90
|
+
return e.forEach((t) => {
|
|
91
|
+
r.push(this.createLabelFromNeuralNode(t[0]), n), t.length === 2 && r.push(this.createLabelFromNeuralNode(t[1]), n);
|
|
92
|
+
}), r;
|
|
93
|
+
}, this.createLabelLookup = function(e, n) {
|
|
94
|
+
return new Promise(async (r) => {
|
|
95
|
+
let t = {};
|
|
89
96
|
this.uberons = [];
|
|
90
|
-
const a = await T(e,
|
|
97
|
+
const a = await T(e, n);
|
|
91
98
|
a.length && (a.forEach((i) => {
|
|
92
|
-
const { taxon:
|
|
93
|
-
|
|
94
|
-
id:
|
|
95
|
-
name:
|
|
99
|
+
const { taxon: l, label: s } = i;
|
|
100
|
+
t[l] = s, this.uberons.push({
|
|
101
|
+
id: l,
|
|
102
|
+
name: s
|
|
96
103
|
});
|
|
97
|
-
}), t
|
|
104
|
+
}), r(t));
|
|
98
105
|
});
|
|
99
106
|
}, this.buildConnectivitySqlStatement = function(e) {
|
|
100
|
-
let
|
|
107
|
+
let n = "select knowledge from knowledge where entity in (";
|
|
101
108
|
if (e.length === 1)
|
|
102
|
-
|
|
109
|
+
n += `'${e[0]}')`;
|
|
103
110
|
else if (e.length > 1)
|
|
104
|
-
for (let
|
|
105
|
-
|
|
106
|
-
return
|
|
111
|
+
for (let r in e)
|
|
112
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
113
|
+
return n;
|
|
107
114
|
}, this.buildLabelSqlStatement = function(e) {
|
|
108
|
-
let
|
|
115
|
+
let n = "select entity, label from labels where entity in (";
|
|
109
116
|
if (e.length === 1)
|
|
110
|
-
|
|
117
|
+
n += `'${e[0]}')`;
|
|
111
118
|
else if (e.length > 1)
|
|
112
|
-
for (let
|
|
113
|
-
|
|
114
|
-
return
|
|
119
|
+
for (let r in e)
|
|
120
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
121
|
+
return n;
|
|
115
122
|
}, this.findAllIdsFromConnectivity = function(e) {
|
|
116
|
-
let
|
|
117
|
-
return
|
|
118
|
-
Array.isArray(a) ?
|
|
119
|
-
}), [...new Set(
|
|
123
|
+
let n = e.connectivity.flat(), r = [...new Set(n)], t = [];
|
|
124
|
+
return r.forEach((a) => {
|
|
125
|
+
Array.isArray(a) ? t.push(a.flat()) : t.push(a);
|
|
126
|
+
}), [...new Set(t.flat())];
|
|
120
127
|
}, this.flattenConnectivity = function(e) {
|
|
121
|
-
let
|
|
122
|
-
return
|
|
123
|
-
Array.isArray(a) ?
|
|
124
|
-
}),
|
|
125
|
-
}, this.findComponents = function(e, r, t
|
|
126
|
-
let a = e.connectivity.flat(), i =
|
|
127
|
-
return i.forEach((
|
|
128
|
-
|
|
129
|
-
}),
|
|
130
|
-
}, this.retrieveFlatmapKnowledgeForEvent = async function(e,
|
|
128
|
+
let n = e.flat(), r = [...new Set(n)], t = [];
|
|
129
|
+
return r.forEach((a) => {
|
|
130
|
+
Array.isArray(a) ? t.push(a.flat()) : t.push(a);
|
|
131
|
+
}), t.flat();
|
|
132
|
+
}, this.findComponents = function(e, n, r, t) {
|
|
133
|
+
let a = e.connectivity.flat(), i = b(a), l = [], s = !1;
|
|
134
|
+
return i.forEach((h) => {
|
|
135
|
+
s = !1, L(n, h) && (s = !0), t && L(t, h) && (s = !0), L(r, h) && (s = !0), s || l.push(h);
|
|
136
|
+
}), l;
|
|
137
|
+
}, this.retrieveFlatmapKnowledgeForEvent = async function(e, n) {
|
|
131
138
|
this.controller && this.controller.abort(), this.controller = new AbortController(), this.controller.signal;
|
|
132
|
-
const
|
|
133
|
-
if (this.destinations = [], this.origins = [], this.components = [], this.rawURLs = [], !
|
|
134
|
-
let
|
|
135
|
-
return await Promise.all([
|
|
136
|
-
}, this.queryForConnectivityNew = function(e,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
139
|
+
const r = n.resource;
|
|
140
|
+
if (this.destinations = [], this.origins = [], this.components = [], this.destinationsWithDatasets = [], this.originsWithDatasets = [], this.componentsWithDatasets = [], this.destinationsCombinations = [], this.originsCombinations = [], this.componentsCombinations = [], this.singleConnectivityList = [], this.rawURLs = [], !r || r.length === 0 || !r[0]) return;
|
|
141
|
+
let t = await this.queryForConnectivityNew(e, r[0]);
|
|
142
|
+
return await Promise.all([t]);
|
|
143
|
+
}, this.queryForConnectivityNew = async function(e, n, r = "map", t = !0) {
|
|
144
|
+
const a = /^sckan-(\d{4})/.exec(e.knowledgeSource || ""), l = (a ? Number(a[1]) : 0) >= 2026, s = e.mapMetadata.uuid, h = this.flatmapAPI;
|
|
145
|
+
return this.connectivitySource = l ? "sckan" : r, l && (this.singleConnectivityList = await _(h, s, n)), new Promise((o) => {
|
|
146
|
+
(this.connectivitySource === "map" ? this.queryMapConnectivity(e.mapMetadata.uuid, n) : e.queryKnowledge(n)).then((c) => {
|
|
147
|
+
if (this.checkConnectivityExists(c)) {
|
|
148
|
+
this.connectivitySource === "map" && (this.noMapConnectivity = !1);
|
|
149
|
+
let v = c;
|
|
150
|
+
t ? this.processConnectivity(e, v).then((f) => {
|
|
151
|
+
c.references && (this.rawURLs = [...c.references]), o(f);
|
|
152
|
+
}) : o(v);
|
|
153
|
+
} else this.connectivitySource === "map" ? (this.connectivitySource = "sckan", this.noMapConnectivity = !0, e.queryKnowledge(n).then((v) => {
|
|
154
|
+
if (this.checkConnectivityExists(v)) {
|
|
155
|
+
let f = v;
|
|
156
|
+
t ? this.processConnectivity(e, f).then((p) => {
|
|
157
|
+
v.references && (this.rawURLs = [...v.references]), o(p);
|
|
158
|
+
}) : o(f);
|
|
151
159
|
} else
|
|
152
|
-
|
|
153
|
-
}).catch(() =>
|
|
154
|
-
}).catch((
|
|
155
|
-
|
|
160
|
+
o(!1);
|
|
161
|
+
}).catch(() => o(!1))) : o(!1);
|
|
162
|
+
}).catch((c) => {
|
|
163
|
+
c.name === "AbortError" || console.warn(`Unable to get the knowledge for the entity ${n}.`), o(!1);
|
|
156
164
|
});
|
|
157
165
|
});
|
|
158
|
-
}, this.queryMapConnectivity = async function(e,
|
|
159
|
-
const
|
|
166
|
+
}, this.queryMapConnectivity = async function(e, n) {
|
|
167
|
+
const r = this.flatmapAPI + `flatmap/${e}/connectivity/${n}`;
|
|
160
168
|
try {
|
|
161
|
-
const
|
|
162
|
-
if (!
|
|
163
|
-
throw new Error(`Response status: ${
|
|
164
|
-
return await
|
|
165
|
-
} catch (
|
|
166
|
-
throw new Error(
|
|
169
|
+
const t = await fetch(r);
|
|
170
|
+
if (!t.ok)
|
|
171
|
+
throw new Error(`Response status: ${t.status}`);
|
|
172
|
+
return await t.json();
|
|
173
|
+
} catch (t) {
|
|
174
|
+
throw new Error(t);
|
|
167
175
|
}
|
|
168
|
-
}, this.queryForConnectivity = function(e, r, t
|
|
169
|
-
const a = { sql: this.buildConnectivitySqlStatement(
|
|
176
|
+
}, this.queryForConnectivity = function(e, n, r, t = !0) {
|
|
177
|
+
const a = { sql: this.buildConnectivitySqlStatement(n) }, i = {
|
|
170
178
|
method: "POST",
|
|
171
179
|
headers: {
|
|
172
180
|
"Content-Type": "application/json"
|
|
173
181
|
},
|
|
174
182
|
body: JSON.stringify(a),
|
|
175
|
-
...
|
|
183
|
+
...r ? { signal: r } : {}
|
|
176
184
|
// add signal to header if it exists
|
|
177
185
|
};
|
|
178
|
-
return new Promise((
|
|
179
|
-
fetch(`${this.flatmapAPI}knowledge/query/`, i).then((
|
|
180
|
-
if (this.connectivityExists(
|
|
181
|
-
let
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}) :
|
|
186
|
+
return new Promise((l) => {
|
|
187
|
+
fetch(`${this.flatmapAPI}knowledge/query/`, i).then((s) => s.json()).then((s) => {
|
|
188
|
+
if (this.connectivityExists(s)) {
|
|
189
|
+
let h = JSON.parse(s.values[0][0]);
|
|
190
|
+
t ? this.processConnectivity(e, h).then((o) => {
|
|
191
|
+
l(o);
|
|
192
|
+
}) : l(h);
|
|
185
193
|
} else
|
|
186
|
-
|
|
187
|
-
}).catch((
|
|
188
|
-
|
|
194
|
+
l(!1);
|
|
195
|
+
}).catch((s) => {
|
|
196
|
+
s.name === "AbortError" || console.error("Error:", s), l(!1);
|
|
189
197
|
});
|
|
190
198
|
});
|
|
191
199
|
}, this.checkConnectivityExists = function(e) {
|
|
192
|
-
var
|
|
193
|
-
return e && ((
|
|
200
|
+
var n;
|
|
201
|
+
return e && ((n = e.connectivity) == null ? void 0 : n.length);
|
|
194
202
|
}, this.connectivityExists = function(e) {
|
|
195
203
|
return !!(e.values && e.values.length > 0 && JSON.parse(e.values[0][0]).connectivity && JSON.parse(e.values[0][0]).connectivity.length > 0);
|
|
196
204
|
}, this.findIfNodeIsSingle = function(e) {
|
|
197
205
|
return e.length === 1 ? (console.error("Server returns a single node", e), e[0]) : e.length === 2 && e[1].length === 0 ? e[0] : !1;
|
|
198
|
-
}, this.createLabelFromNeuralNode = function(e,
|
|
199
|
-
let
|
|
200
|
-
if (
|
|
201
|
-
return r
|
|
202
|
-
let
|
|
206
|
+
}, this.createLabelFromNeuralNode = function(e, n) {
|
|
207
|
+
let r = this.findIfNodeIsSingle(e);
|
|
208
|
+
if (r)
|
|
209
|
+
return n[r];
|
|
210
|
+
let t = n[e[0]];
|
|
203
211
|
return e.length === 2 && e[1].length > 0 && e[1].forEach((a) => {
|
|
204
|
-
|
|
205
|
-
}),
|
|
206
|
-
}, this.flattenAndFindDatasets = function(e,
|
|
207
|
-
let
|
|
212
|
+
n[a] == null ? t += `, ${a}` : t += `, ${n[a]}`;
|
|
213
|
+
}), t;
|
|
214
|
+
}, this.flattenAndFindDatasets = function(e, n, r) {
|
|
215
|
+
let t = this.flattenConnectivity(e), a = this.flattenConnectivity(n), i = this.flattenConnectivity(r);
|
|
208
216
|
this.originsWithDatasets = this.uberons.filter(
|
|
209
|
-
(
|
|
217
|
+
(l) => t.indexOf(l.id) !== -1
|
|
210
218
|
).sort(A), this.componentsWithDatasets = this.uberons.filter(
|
|
211
|
-
(
|
|
219
|
+
(l) => a.indexOf(l.id) !== -1
|
|
212
220
|
).sort(A), this.destinationsWithDatasets = this.uberons.filter(
|
|
213
|
-
(
|
|
214
|
-
).sort(A)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
221
|
+
(l) => i.indexOf(l.id) !== -1
|
|
222
|
+
).sort(A), this.singleConnectivityList.length > 0 && this.singleConnectivityList.forEach((l) => {
|
|
223
|
+
const { sckanNodeId: s, sckanNodeLabel: h, mapNodeId: o, mapNodeLabel: u } = l;
|
|
224
|
+
r.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.destinationsCombinations.push({
|
|
225
|
+
sckanId: s,
|
|
226
|
+
sckanLabel: h,
|
|
227
|
+
mapId: o,
|
|
228
|
+
mapLabel: u
|
|
229
|
+
}), o.forEach((c, v) => {
|
|
230
|
+
const f = typeof c == "string" ? c : c[0];
|
|
231
|
+
f && this.destinationsWithDatasets.push({
|
|
232
|
+
id: f,
|
|
233
|
+
name: u.split(",")[v]
|
|
234
|
+
});
|
|
235
|
+
})), e.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.originsCombinations.push({
|
|
236
|
+
sckanId: s,
|
|
237
|
+
sckanLabel: h,
|
|
238
|
+
mapId: o,
|
|
239
|
+
mapLabel: u
|
|
240
|
+
}), o.forEach((c, v) => {
|
|
241
|
+
const f = typeof c == "string" ? c : c[0];
|
|
242
|
+
f && this.originsWithDatasets.push({
|
|
243
|
+
id: f,
|
|
244
|
+
name: u.split(",")[v]
|
|
245
|
+
});
|
|
246
|
+
})), n.find((c) => JSON.stringify(c) === JSON.stringify(s)) && (this.componentsCombinations.push({
|
|
247
|
+
sckanId: s,
|
|
248
|
+
sckanLabel: h,
|
|
249
|
+
mapId: o,
|
|
250
|
+
mapLabel: u
|
|
251
|
+
}), o.forEach((c, v) => {
|
|
252
|
+
const f = typeof c == "string" ? c : c[0];
|
|
253
|
+
f && this.componentsWithDatasets.push({
|
|
254
|
+
id: f,
|
|
255
|
+
name: u.split(",")[v]
|
|
256
|
+
});
|
|
257
|
+
}));
|
|
258
|
+
});
|
|
259
|
+
}, this.processConnectivity = function(e, n) {
|
|
260
|
+
return new Promise((r) => {
|
|
261
|
+
let t = [], a = [], i;
|
|
262
|
+
if (n && n["node-phenotypes"]) {
|
|
263
|
+
const h = ["ilxtr:hasSomaLocatedIn"], o = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
|
264
|
+
h.forEach((u) => {
|
|
265
|
+
u in n["node-phenotypes"] && t.push(...n["node-phenotypes"][u]);
|
|
266
|
+
}), t = b(t), o.forEach((u) => {
|
|
267
|
+
u in n["node-phenotypes"] && a.push(...n["node-phenotypes"][u]);
|
|
268
|
+
}), a = b(a);
|
|
225
269
|
} else
|
|
226
|
-
a =
|
|
227
|
-
const
|
|
228
|
-
this.createLabelLookup(e,
|
|
229
|
-
this.origins =
|
|
230
|
-
(
|
|
231
|
-
).sort(A), this.components =
|
|
232
|
-
(
|
|
270
|
+
a = b(n.axons), n.somas && n.somas.length > 0 && t.push(...n.somas), n.dendrites && n.dendrites.length > 0 && t.push(...n.dendrites), t = b(t), i = n.somas;
|
|
271
|
+
const l = this.findComponents(n, a, t, i), s = this.findAllIdsFromConnectivity(n);
|
|
272
|
+
this.createLabelLookup(e, s).then((h) => {
|
|
273
|
+
this.origins = t.map(
|
|
274
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
275
|
+
).sort(A), this.components = l.map(
|
|
276
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
233
277
|
).sort(A), this.destinations = a.map(
|
|
234
|
-
(
|
|
235
|
-
).sort(A), this.flattenAndFindDatasets(
|
|
278
|
+
(o) => this.createLabelFromNeuralNode(o, h)
|
|
279
|
+
).sort(A), this.flattenAndFindDatasets(t, l, a), r({
|
|
236
280
|
ids: {
|
|
237
|
-
dendrites:
|
|
238
|
-
components:
|
|
281
|
+
dendrites: t,
|
|
282
|
+
components: l,
|
|
239
283
|
axons: a
|
|
240
284
|
},
|
|
241
285
|
labels: {
|
|
@@ -247,25 +291,25 @@ let S = function() {
|
|
|
247
291
|
});
|
|
248
292
|
});
|
|
249
293
|
}, this.buildPubmedSqlStatement = function(e) {
|
|
250
|
-
let
|
|
294
|
+
let n = "select distinct publication from publications where entity in (";
|
|
251
295
|
if (e.length === 1)
|
|
252
|
-
|
|
296
|
+
n += `'${e[0]}')`;
|
|
253
297
|
else if (e.length > 1)
|
|
254
|
-
for (let
|
|
255
|
-
|
|
256
|
-
return
|
|
298
|
+
for (let r in e)
|
|
299
|
+
n += `'${e[r]}'${r >= e.length - 1 ? ")" : ","} `;
|
|
300
|
+
return n;
|
|
257
301
|
}, this.buildPubmedSqlStatementForModels = function(e) {
|
|
258
302
|
return `select distinct publication from publications where entity = '${e}'`;
|
|
259
|
-
}, this.queryKnowledge = async (e,
|
|
260
|
-
const
|
|
303
|
+
}, this.queryKnowledge = async (e, n) => {
|
|
304
|
+
const r = `${this.flatmapAPI}knowledge/query/`, a = await fetch(r, {
|
|
261
305
|
method: "POST",
|
|
262
306
|
headers: {
|
|
263
307
|
Accept: "application/json"
|
|
264
308
|
},
|
|
265
|
-
body: JSON.stringify({ sql: e, params:
|
|
309
|
+
body: JSON.stringify({ sql: e, params: n })
|
|
266
310
|
});
|
|
267
311
|
if (!a.ok)
|
|
268
|
-
throw new Error(`Cannot access ${
|
|
312
|
+
throw new Error(`Cannot access ${r}`);
|
|
269
313
|
const i = await a.json();
|
|
270
314
|
if ("error" in i)
|
|
271
315
|
throw new TypeError(i.error);
|
|
@@ -1085,50 +1129,50 @@ const I = [
|
|
|
1085
1129
|
"FMA subclasses (in human nerves)": ["FMA:6892", "FMA:6893"],
|
|
1086
1130
|
"subclass labels": ["Right T9 grey ramus communicans", "Left T9 grey ramus communicans"]
|
|
1087
1131
|
}
|
|
1088
|
-
],
|
|
1132
|
+
], D = () => {
|
|
1089
1133
|
const e = {};
|
|
1090
|
-
return I.forEach((
|
|
1091
|
-
const
|
|
1092
|
-
if (
|
|
1134
|
+
return I.forEach((n) => {
|
|
1135
|
+
const r = n.nerve_id, t = n.label.toLowerCase(), a = n["subclass labels"];
|
|
1136
|
+
if (r && t !== "nerve") {
|
|
1093
1137
|
if (!a.length)
|
|
1094
1138
|
return;
|
|
1095
|
-
|
|
1096
|
-
const i = a.map((
|
|
1097
|
-
e[
|
|
1098
|
-
nerve:
|
|
1139
|
+
r in e || (e[r] = {});
|
|
1140
|
+
const i = a.map((l) => l.toLowerCase()).sort();
|
|
1141
|
+
e[r] = {
|
|
1142
|
+
nerve: t,
|
|
1099
1143
|
subNerves: i
|
|
1100
1144
|
};
|
|
1101
1145
|
}
|
|
1102
1146
|
}), e;
|
|
1103
|
-
},
|
|
1104
|
-
let e = [],
|
|
1147
|
+
}, $ = () => {
|
|
1148
|
+
let e = [], n = {
|
|
1105
1149
|
key: "scaffold.connectivity.nerve",
|
|
1106
1150
|
label: "Nerves",
|
|
1107
1151
|
children: []
|
|
1108
|
-
},
|
|
1109
|
-
for (const
|
|
1110
|
-
if (
|
|
1152
|
+
}, r = [];
|
|
1153
|
+
for (const t of I) {
|
|
1154
|
+
if (t.label === "nerve")
|
|
1111
1155
|
continue;
|
|
1112
1156
|
let a = {
|
|
1113
1157
|
facetPropPath: "scaffold.connectivity.nerve",
|
|
1114
1158
|
label: "",
|
|
1115
1159
|
children: []
|
|
1116
1160
|
}, i = [];
|
|
1117
|
-
for (const [
|
|
1118
|
-
if (
|
|
1119
|
-
for (const
|
|
1161
|
+
for (const [l, s] of Object.entries(t))
|
|
1162
|
+
if (l === "label" && (a.label = s), l === "subclass labels")
|
|
1163
|
+
for (const h of s)
|
|
1120
1164
|
i.push({
|
|
1121
1165
|
facetPropPath: "scaffold.connectivity.subnerve",
|
|
1122
|
-
label:
|
|
1166
|
+
label: h
|
|
1123
1167
|
});
|
|
1124
|
-
i.length && (a.children = i.sort((
|
|
1168
|
+
i.length && (a.children = i.sort((l, s) => l.label.localeCompare(s.label)), r.push(a));
|
|
1125
1169
|
}
|
|
1126
|
-
return
|
|
1170
|
+
return r.length && (n.children = r.sort((t, a) => t.label.localeCompare(a.label)), e.push(n)), e;
|
|
1127
1171
|
};
|
|
1128
|
-
function
|
|
1172
|
+
function H(e) {
|
|
1129
1173
|
return e[0].toUpperCase() + e.substring(1);
|
|
1130
1174
|
}
|
|
1131
|
-
const
|
|
1175
|
+
const K = {
|
|
1132
1176
|
emits: ["flatmap-provenance-ready", "resource-selected", "species-changed"],
|
|
1133
1177
|
props: {
|
|
1134
1178
|
/**
|
|
@@ -1147,7 +1191,7 @@ const J = {
|
|
|
1147
1191
|
},
|
|
1148
1192
|
inject: ["showGlobalSettings", "showOpenMapButton"],
|
|
1149
1193
|
computed: {
|
|
1150
|
-
...
|
|
1194
|
+
...k(E, O, N, x),
|
|
1151
1195
|
idNamePair() {
|
|
1152
1196
|
return this.splitFlowStore.idNamePair;
|
|
1153
1197
|
},
|
|
@@ -1172,15 +1216,15 @@ const J = {
|
|
|
1172
1216
|
this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.iframeRef = this.$refs.iframe, this.plotRef = this.$refs.plot, this.simulationRef = this.$refs.simulation, (this.scaffoldRef || this.iframeRef || this.plotRef || this.simulationRef) && this.loadExplorerConfig(), this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
|
|
1173
1217
|
},
|
|
1174
1218
|
methods: {
|
|
1175
|
-
toggleMinimap: function(e,
|
|
1176
|
-
var
|
|
1177
|
-
if (this.multiflatmapRef) {
|
|
1178
|
-
const
|
|
1219
|
+
toggleMinimap: function(e, n) {
|
|
1220
|
+
var r;
|
|
1221
|
+
if (this.multiflatmapRef && this.flatmapIsReady()) {
|
|
1222
|
+
const t = this.multiflatmapRef.getCurrentFlatmap(), a = t == null ? void 0 : t.mapImp;
|
|
1179
1223
|
if (a)
|
|
1180
1224
|
if (e === !0) {
|
|
1181
|
-
if (
|
|
1182
|
-
const i = ((
|
|
1183
|
-
a.createMinimap(i),
|
|
1225
|
+
if (n === !1) {
|
|
1226
|
+
const i = ((r = a.options) == null ? void 0 : r.minimap) || { position: "top-right" };
|
|
1227
|
+
a.createMinimap(i), t.addResizeButtonToMinimap(), t.minimapSmall = !1;
|
|
1184
1228
|
}
|
|
1185
1229
|
} else
|
|
1186
1230
|
a.closeMinimap();
|
|
@@ -1198,13 +1242,13 @@ const J = {
|
|
|
1198
1242
|
getState: function() {
|
|
1199
1243
|
},
|
|
1200
1244
|
openMap: function(e) {
|
|
1201
|
-
|
|
1245
|
+
m.emit("OpenNewMap", e), this.trackOpenMap(`open_new_${e}_map`);
|
|
1202
1246
|
},
|
|
1203
1247
|
onMapmanagerLoaded: function(e) {
|
|
1204
1248
|
this.settingsStore.updateMapManager(e);
|
|
1205
1249
|
},
|
|
1206
1250
|
trackOpenMap: function(e) {
|
|
1207
|
-
|
|
1251
|
+
M.sendEvent({
|
|
1208
1252
|
event: "interaction_event",
|
|
1209
1253
|
event_name: "portal_maps_open_map",
|
|
1210
1254
|
category: e,
|
|
@@ -1233,60 +1277,60 @@ const J = {
|
|
|
1233
1277
|
/**
|
|
1234
1278
|
* Callback when the vuers emit a selected event.
|
|
1235
1279
|
*/
|
|
1236
|
-
resourceSelected: function(e,
|
|
1237
|
-
var s,
|
|
1238
|
-
const
|
|
1239
|
-
if (this.resourceHasAction(
|
|
1240
|
-
|
|
1280
|
+
resourceSelected: function(e, n) {
|
|
1281
|
+
var l, s, h, o;
|
|
1282
|
+
const r = n[0];
|
|
1283
|
+
if (this.resourceHasAction(r)) {
|
|
1284
|
+
m.emit("PopoverActionClick", r);
|
|
1241
1285
|
return;
|
|
1242
1286
|
}
|
|
1243
|
-
let
|
|
1287
|
+
let t, a = !1;
|
|
1244
1288
|
const i = {
|
|
1245
1289
|
paneIndex: this.entry.id,
|
|
1246
1290
|
type: e,
|
|
1247
|
-
resource:
|
|
1291
|
+
resource: n,
|
|
1248
1292
|
internalName: void 0,
|
|
1249
1293
|
eventType: void 0
|
|
1250
1294
|
};
|
|
1251
1295
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
|
1252
|
-
if (i.internalName = (
|
|
1253
|
-
if (i.eventType = "selected",
|
|
1296
|
+
if (i.internalName = (l = r == null ? void 0 : r.feature) != null && l.label ? r.feature.label : this.idNamePair[r.feature.models], r.eventType == "click") {
|
|
1297
|
+
if (i.eventType = "selected", r.feature.type == "marker") {
|
|
1254
1298
|
let u = i.internalName;
|
|
1255
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
|
1256
|
-
|
|
1299
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(r.feature.id))
|
|
1300
|
+
t = {
|
|
1257
1301
|
type: "Search",
|
|
1258
|
-
term: this.settingsStore.featuredMarkerDoi(
|
|
1302
|
+
term: this.settingsStore.featuredMarkerDoi(r.feature.id),
|
|
1259
1303
|
featuredDataset: !0
|
|
1260
1304
|
};
|
|
1261
1305
|
else {
|
|
1262
|
-
|
|
1306
|
+
t = {
|
|
1263
1307
|
type: "Facet",
|
|
1264
1308
|
facets: [u]
|
|
1265
1309
|
};
|
|
1266
|
-
let
|
|
1267
|
-
if (
|
|
1268
|
-
|
|
1269
|
-
}),
|
|
1310
|
+
let c = /* @__PURE__ */ new Set();
|
|
1311
|
+
if (r.feature["dataset-terms"].forEach((v) => {
|
|
1312
|
+
c.add(v.label ? v.label : v.term);
|
|
1313
|
+
}), c.size === 0 && c.add(u), t.facets = [...c], this.settingsStore.hasAppliedFacets(c) && this.settingsStore.appliedFacets.length <= c.size)
|
|
1270
1314
|
return;
|
|
1271
1315
|
if (this.settingsStore.appliedFacets.length) {
|
|
1272
|
-
if (!this.settingsStore.hasAppliedFacets(
|
|
1273
|
-
const
|
|
1316
|
+
if (!this.settingsStore.hasAppliedFacets(c)) {
|
|
1317
|
+
const v = [.../* @__PURE__ */ new Set([
|
|
1274
1318
|
...this.settingsStore.appliedFacets,
|
|
1275
|
-
...
|
|
1319
|
+
...c
|
|
1276
1320
|
])];
|
|
1277
|
-
this.settingsStore.updateAppliedFacets(
|
|
1321
|
+
this.settingsStore.updateAppliedFacets(v);
|
|
1278
1322
|
}
|
|
1279
1323
|
} else
|
|
1280
|
-
|
|
1324
|
+
c.size > 1 && (t.type = "Facets"), this.settingsStore.updateAppliedFacets(t.facets);
|
|
1281
1325
|
}
|
|
1282
1326
|
a = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
|
1283
1327
|
}
|
|
1284
|
-
} else
|
|
1285
|
-
else e == "Scaffold" && (
|
|
1328
|
+
} else r.eventType == "mouseenter" && (i.eventType = "highlighted", a = !0);
|
|
1329
|
+
else e == "Scaffold" && (r && ((((s = r.data) == null ? void 0 : s.id) === void 0 || ((h = r.data) == null ? void 0 : h.id) === "") && (r.data.id = (o = r.data) == null ? void 0 : o.group), i.internalName = r.data.id, r.data.lastActionOnMarker === !0 && (t = {
|
|
1286
1330
|
type: "Facet",
|
|
1287
|
-
facets: [
|
|
1331
|
+
facets: [H(r.data.id)]
|
|
1288
1332
|
})), i.eventType = "selected", a = !0);
|
|
1289
|
-
|
|
1333
|
+
t && m.emit("PopoverActionClick", t), a && this.$emit("resource-selected", i);
|
|
1290
1334
|
},
|
|
1291
1335
|
resourceHasAction: function(e) {
|
|
1292
1336
|
return e && (e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets");
|
|
@@ -1297,63 +1341,63 @@ const J = {
|
|
|
1297
1341
|
* calls to try to ge a valid name/id.
|
|
1298
1342
|
*/
|
|
1299
1343
|
getNameAndIdFromSyncData: async function(e) {
|
|
1300
|
-
let
|
|
1301
|
-
|
|
1302
|
-
let
|
|
1303
|
-
if (e.resource && e.resource.resource && (
|
|
1304
|
-
if (this.$refs.scaffold.findObjectsWithGroupName(
|
|
1344
|
+
let n = e.internalName;
|
|
1345
|
+
n === void 0 && e.resource && (n = e.resource.label);
|
|
1346
|
+
let r;
|
|
1347
|
+
if (e.resource && e.resource.resource && (r = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
|
1348
|
+
if (this.$refs.scaffold.findObjectsWithGroupName(n).length === 0) {
|
|
1305
1349
|
if (e.resource && e.resource.feature) {
|
|
1306
1350
|
const i = R(e.resource.feature.models);
|
|
1307
1351
|
if (i.length > 0) return i;
|
|
1308
1352
|
}
|
|
1309
|
-
let a =
|
|
1353
|
+
let a = P(n);
|
|
1310
1354
|
if (a)
|
|
1311
1355
|
return a;
|
|
1312
|
-
if (
|
|
1313
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
|
1314
|
-
var
|
|
1315
|
-
if (((
|
|
1316
|
-
return
|
|
1356
|
+
if (r && e.eventType === "selected")
|
|
1357
|
+
return fetch(`${this.apiLocation}get-related-terms/${r}`).then((i) => i.json()).then((i) => {
|
|
1358
|
+
var l;
|
|
1359
|
+
if (((l = i.uberon) == null ? void 0 : l.array.length) > 0)
|
|
1360
|
+
return n = i.uberon.array[0].name.charAt(0).toUpperCase() + i.uberon.array[0].name.slice(1), r = i.uberon.array[0].id.toUpperCase(), { id: r, name: n };
|
|
1317
1361
|
});
|
|
1318
1362
|
}
|
|
1319
1363
|
} else if (this.entry.type === "MultiFlatmap")
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
1364
|
+
if (n === "Bladder")
|
|
1365
|
+
n = "Urinary Bladder";
|
|
1322
1366
|
else {
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1367
|
+
const t = R(n);
|
|
1368
|
+
t.length > 0 && (n = t[0]);
|
|
1325
1369
|
}
|
|
1326
|
-
return { id:
|
|
1370
|
+
return { id: r, name: n };
|
|
1327
1371
|
},
|
|
1328
1372
|
// Get the species and andaotmy info for the featured datasets
|
|
1329
1373
|
getDatasetAnatomyInfo: function(e) {
|
|
1330
|
-
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((
|
|
1331
|
-
const
|
|
1332
|
-
let
|
|
1374
|
+
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((n) => n.json()).then((n) => {
|
|
1375
|
+
const r = n.result[0];
|
|
1376
|
+
let t;
|
|
1333
1377
|
try {
|
|
1334
|
-
|
|
1378
|
+
t = r.anatomy.organ[0].curie;
|
|
1335
1379
|
} catch {
|
|
1336
|
-
|
|
1380
|
+
t = void 0;
|
|
1337
1381
|
}
|
|
1338
1382
|
let a;
|
|
1339
1383
|
try {
|
|
1340
|
-
a =
|
|
1384
|
+
a = r.item.curie;
|
|
1341
1385
|
} catch {
|
|
1342
1386
|
a = void 0;
|
|
1343
1387
|
}
|
|
1344
1388
|
let i;
|
|
1345
1389
|
try {
|
|
1346
|
-
let
|
|
1347
|
-
for (; !
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1390
|
+
let l = 0, s = !1;
|
|
1391
|
+
for (; !s && l < r.organisms.subject.length; ) {
|
|
1392
|
+
const h = r.organisms.subject[l];
|
|
1393
|
+
h.species && (i = h.species.name, s = !0), l += 1;
|
|
1350
1394
|
}
|
|
1351
1395
|
} catch {
|
|
1352
1396
|
i = void 0;
|
|
1353
1397
|
}
|
|
1354
1398
|
this.settingsStore.updateFeaturedMarker({
|
|
1355
1399
|
identifier: e,
|
|
1356
|
-
marker:
|
|
1400
|
+
marker: t,
|
|
1357
1401
|
doi: a,
|
|
1358
1402
|
species: i
|
|
1359
1403
|
});
|
|
@@ -1361,27 +1405,27 @@ const J = {
|
|
|
1361
1405
|
},
|
|
1362
1406
|
// Check if the old featured dataset api has any info
|
|
1363
1407
|
oldFeaturedDatasetApiHasInfo: async function() {
|
|
1364
|
-
let
|
|
1365
|
-
return !
|
|
1408
|
+
let n = await (await fetch(`${this.apiLocation}get_featured_datasets_identifiers`)).json();
|
|
1409
|
+
return !n.identifiers || n.identifiers.length == 0 ? !1 : n.identifiers;
|
|
1366
1410
|
},
|
|
1367
1411
|
// Check if the new featured dataset api has any info
|
|
1368
1412
|
newFeaturedDatasetApiHasInfo: async function() {
|
|
1369
|
-
let
|
|
1370
|
-
return !
|
|
1413
|
+
let n = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
|
1414
|
+
return !n.datasets || n.datasets.length == 0 ? !1 : n.datasets.map((r) => r.id);
|
|
1371
1415
|
},
|
|
1372
|
-
flatmapResourceSelected: function(e,
|
|
1373
|
-
var
|
|
1374
|
-
this.resourceSelected(e,
|
|
1375
|
-
const
|
|
1376
|
-
if (
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1379
|
-
const { models:
|
|
1380
|
-
|
|
1381
|
-
}),
|
|
1416
|
+
flatmapResourceSelected: function(e, n) {
|
|
1417
|
+
var l;
|
|
1418
|
+
this.resourceSelected(e, n);
|
|
1419
|
+
const r = n[0], { eventType: t, feature: a } = r, { viewingMode: i } = this.settingsStore.globalSettings;
|
|
1420
|
+
if (t === "click" && a.type === "feature" && ((l = a.models) != null && l.startsWith("ilxtr:"))) {
|
|
1421
|
+
const s = [];
|
|
1422
|
+
n.forEach((h) => {
|
|
1423
|
+
const { models: o } = h.feature;
|
|
1424
|
+
s.push(o);
|
|
1425
|
+
}), M.sendEvent({
|
|
1382
1426
|
event: "interaction_event",
|
|
1383
1427
|
event_name: "portal_maps_connectivity",
|
|
1384
|
-
category:
|
|
1428
|
+
category: s.join(", "),
|
|
1385
1429
|
location: e + " " + i
|
|
1386
1430
|
});
|
|
1387
1431
|
}
|
|
@@ -1390,14 +1434,14 @@ const J = {
|
|
|
1390
1434
|
* Get a list of featured datasets to display.
|
|
1391
1435
|
*/
|
|
1392
1436
|
getFeaturedDatasets: async function() {
|
|
1393
|
-
let e = [],
|
|
1394
|
-
if (
|
|
1437
|
+
let e = [], n = await this.oldFeaturedDatasetApiHasInfo();
|
|
1438
|
+
if (n) e = n;
|
|
1395
1439
|
else {
|
|
1396
|
-
let
|
|
1397
|
-
|
|
1440
|
+
let r = await this.newFeaturedDatasetApiHasInfo();
|
|
1441
|
+
r && (e = r);
|
|
1398
1442
|
}
|
|
1399
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
|
1400
|
-
this.getDatasetAnatomyInfo(
|
|
1443
|
+
this.settingsStore.updateFeatured(e), e.forEach((r) => {
|
|
1444
|
+
this.getDatasetAnatomyInfo(r);
|
|
1401
1445
|
});
|
|
1402
1446
|
},
|
|
1403
1447
|
flatmapMarkerUpdate() {
|
|
@@ -1435,67 +1479,67 @@ const J = {
|
|
|
1435
1479
|
checkEndHelpMouseDown: function(e) {
|
|
1436
1480
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
|
1437
1481
|
},
|
|
1438
|
-
flatmapHighlight: async function(e, r, t
|
|
1439
|
-
let a = [...
|
|
1482
|
+
flatmapHighlight: async function(e, n, r, t) {
|
|
1483
|
+
let a = [...n, ...t];
|
|
1440
1484
|
const i = this.settingsStore.globalSettings;
|
|
1441
1485
|
if (i.highlightConnectedPaths) {
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1486
|
+
const l = n.length ? n : t.length ? t : [], s = await e.retrieveConnectedPaths(l);
|
|
1487
|
+
s && a.push(...s);
|
|
1444
1488
|
}
|
|
1445
1489
|
if (i.highlightDOIPaths) {
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1490
|
+
const l = await e.searchConnectivitiesByReference(r);
|
|
1491
|
+
l && a.push(...l);
|
|
1448
1492
|
}
|
|
1449
1493
|
return a = [...new Set(a)], a;
|
|
1450
1494
|
},
|
|
1451
1495
|
sidebarHoverHighlight: function(e) {
|
|
1452
|
-
var
|
|
1496
|
+
var n, r;
|
|
1453
1497
|
if (this.visible && ((this.flatmapRef || this.multiflatmapRef) && this.flatmapReady || this.scaffoldRef && this.scaffoldLoaded)) {
|
|
1454
|
-
const
|
|
1455
|
-
let
|
|
1456
|
-
this.flatmapRef && (
|
|
1457
|
-
(
|
|
1498
|
+
const t = this.settingsStore.hoverAnatomies, a = this.settingsStore.hoverOrgans, i = this.settingsStore.hoverDOI, l = this.settingsStore.hoverConnectivity;
|
|
1499
|
+
let s = null, h = null;
|
|
1500
|
+
this.flatmapRef && (s = this.flatmapRef), this.multiflatmapRef && (s = this.multiflatmapRef.getCurrentFlatmap()), this.scaffoldRef && (h = this.scaffoldRef), clearTimeout(this.highlightDelay), !t.length && !a.length && !i && !l.length && ((this.multiflatmapRef || this.flatmapRef) && s ? s.mapImp && !s.mapImp.contextLost && ((n = s.mapImp) == null || n.clearSearchResults(), e.connectivityProcessed && ((r = s.mapImp) == null || r.setPaint({ dimmed: !0 }))) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1)), this.highlightDelay = setTimeout(() => {
|
|
1501
|
+
(t.length || a.length || i || l.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, i, l).then((o) => {
|
|
1458
1502
|
try {
|
|
1459
|
-
|
|
1460
|
-
connectivityInfo: { featureId:
|
|
1503
|
+
s.showConnectivityTooltips({
|
|
1504
|
+
connectivityInfo: { featureId: o },
|
|
1461
1505
|
data: []
|
|
1462
1506
|
});
|
|
1463
1507
|
} catch (u) {
|
|
1464
|
-
if (console.log(u),
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1467
|
-
(
|
|
1468
|
-
(p) => p.id ===
|
|
1508
|
+
if (console.log(u), l.length && s.mapImp) {
|
|
1509
|
+
const c = s.mapImp.uuid;
|
|
1510
|
+
o.every(
|
|
1511
|
+
(f) => this.connectivityKnowledge[c].some(
|
|
1512
|
+
(p) => p.id === f
|
|
1469
1513
|
)
|
|
1470
|
-
) ||
|
|
1514
|
+
) || s.mapImp && !s.mapImp.contextLost && s.mapImp.clearSearchResults();
|
|
1471
1515
|
}
|
|
1472
1516
|
}
|
|
1473
|
-
}) : this.scaffoldRef &&
|
|
1517
|
+
}) : this.scaffoldRef && h && h.changeHighlightedByName(a, "", !1));
|
|
1474
1518
|
}, 100);
|
|
1475
1519
|
}
|
|
1476
1520
|
},
|
|
1477
1521
|
onAnnotationOpen: function(e) {
|
|
1478
|
-
|
|
1522
|
+
m.emit("annotation-open", e);
|
|
1479
1523
|
},
|
|
1480
1524
|
onAnnotationClose: function() {
|
|
1481
|
-
|
|
1525
|
+
m.emit("sidebar-annotation-close");
|
|
1482
1526
|
},
|
|
1483
1527
|
updateOfflineAnnotationEnabled: function(e) {
|
|
1484
|
-
|
|
1528
|
+
m.emit("update-offline-annotation-enabled", e);
|
|
1485
1529
|
},
|
|
1486
1530
|
onConnectivityInfoOpen: function(e) {
|
|
1487
|
-
|
|
1531
|
+
m.emit("connectivity-info-open", e);
|
|
1488
1532
|
},
|
|
1489
1533
|
onConnectivityError: function(e) {
|
|
1490
|
-
|
|
1534
|
+
m.emit("connectivity-error", e);
|
|
1491
1535
|
},
|
|
1492
1536
|
onConnectivityInfoClose: function() {
|
|
1493
|
-
|
|
1537
|
+
m.emit("connectivity-info-close");
|
|
1494
1538
|
},
|
|
1495
1539
|
onSidebarAnnotationClose: function() {
|
|
1496
1540
|
},
|
|
1497
1541
|
onNeuronConnectionFeatureClick: function(e) {
|
|
1498
|
-
|
|
1542
|
+
m.emit("neuron-connection-feature-click", e);
|
|
1499
1543
|
},
|
|
1500
1544
|
showConnectivity: function() {
|
|
1501
1545
|
},
|
|
@@ -1507,115 +1551,115 @@ const J = {
|
|
|
1507
1551
|
this.flatmapService = await this.mockUpFlatmapService(), this.loadConnectivityExplorerConfig(this.flatmapService);
|
|
1508
1552
|
},
|
|
1509
1553
|
mockUpFlatmapService: async function() {
|
|
1510
|
-
const
|
|
1554
|
+
const r = (await (await fetch(this.flatmapAPI)).json()).filter((u) => u.id === "human-flatmap_male").sort((u, c) => c.created.localeCompare(u.created))[0], t = r.uuid, a = r.sckan["knowledge-source"], l = await (await fetch(`${this.flatmapAPI}/flatmap/${t}/pathways`)).json();
|
|
1511
1555
|
this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1512
|
-
const
|
|
1556
|
+
const s = {
|
|
1513
1557
|
mapMetadata: {
|
|
1514
|
-
uuid:
|
|
1558
|
+
uuid: t,
|
|
1515
1559
|
connectivity: {
|
|
1516
|
-
...
|
|
1560
|
+
...r.sckan
|
|
1517
1561
|
}
|
|
1518
1562
|
},
|
|
1519
|
-
pathways:
|
|
1563
|
+
pathways: l,
|
|
1520
1564
|
resource: this.entry.resource,
|
|
1521
1565
|
knowledgeSource: a,
|
|
1522
1566
|
queryKnowledge: async (u) => {
|
|
1523
|
-
const
|
|
1524
|
-
return JSON.parse(
|
|
1567
|
+
const c = "select knowledge from knowledge where (source=? or source is null) and entity=? order by source desc", v = [a, u], f = await this.flatmapQueries.queryKnowledge(c, v);
|
|
1568
|
+
return JSON.parse(f);
|
|
1525
1569
|
},
|
|
1526
1570
|
queryLabels: async (u) => {
|
|
1527
|
-
const
|
|
1571
|
+
const c = `select source, entity, knowledge from knowledge where (source=? or source is null) and entity in (?${", ?".repeat(u.length - 1)}) order by entity, source desc`, v = [a, ...u], f = await this.flatmapQueries.queryKnowledge(c, v), p = [];
|
|
1528
1572
|
let g;
|
|
1529
|
-
for (const F of
|
|
1573
|
+
for (const F of f)
|
|
1530
1574
|
if (F[1] !== g) {
|
|
1531
|
-
const
|
|
1575
|
+
const C = JSON.parse(F[2]);
|
|
1532
1576
|
p.push({
|
|
1533
1577
|
entity: F[1],
|
|
1534
|
-
label:
|
|
1578
|
+
label: C.label || F[1]
|
|
1535
1579
|
}), g = F[1];
|
|
1536
1580
|
}
|
|
1537
1581
|
return p;
|
|
1538
1582
|
}
|
|
1539
|
-
},
|
|
1583
|
+
}, h = $();
|
|
1540
1584
|
return {
|
|
1541
1585
|
mockup: !0,
|
|
1542
|
-
getFilterOptions: async (u,
|
|
1543
|
-
const
|
|
1544
|
-
return [...
|
|
1586
|
+
getFilterOptions: async (u, c) => {
|
|
1587
|
+
const f = await U(this.flatmapAPI, u, c, void 0);
|
|
1588
|
+
return [...h, ...f];
|
|
1545
1589
|
},
|
|
1546
|
-
getTermNerveMaps:
|
|
1547
|
-
mapImp:
|
|
1590
|
+
getTermNerveMaps: D,
|
|
1591
|
+
mapImp: s
|
|
1548
1592
|
};
|
|
1549
1593
|
},
|
|
1550
1594
|
loadConnectivityExplorerConfig: async function(e) {
|
|
1551
1595
|
var i;
|
|
1552
|
-
const
|
|
1596
|
+
const n = e.mapImp, r = w(n), t = e.mockup ? n.resource : n.uuid;
|
|
1553
1597
|
let a = [];
|
|
1554
|
-
if (!this.connectivityKnowledge[
|
|
1598
|
+
if (!this.connectivityKnowledge[r]) {
|
|
1555
1599
|
this.flatmapQueries = y(new S()), this.flatmapQueries.initialise(this.flatmapAPI);
|
|
1556
|
-
const
|
|
1557
|
-
this.connectivityKnowledge[
|
|
1558
|
-
var
|
|
1559
|
-
return (
|
|
1560
|
-
}).sort((
|
|
1600
|
+
const l = await B(n, this.flatmapQueries);
|
|
1601
|
+
this.connectivityKnowledge[r] = l.filter((s) => {
|
|
1602
|
+
var h;
|
|
1603
|
+
return (h = s.connectivity) == null ? void 0 : h.length;
|
|
1604
|
+
}).sort((s, h) => s.label.localeCompare(h.label));
|
|
1561
1605
|
}
|
|
1562
|
-
if (!this.connectivityKnowledge[
|
|
1563
|
-
const
|
|
1564
|
-
this.connectivityKnowledge[
|
|
1606
|
+
if (!this.connectivityKnowledge[t]) {
|
|
1607
|
+
const l = ((i = n.pathways) == null ? void 0 : i.paths) || {};
|
|
1608
|
+
this.connectivityKnowledge[t] = this.connectivityKnowledge[r].filter((s) => s.id in l);
|
|
1565
1609
|
}
|
|
1566
|
-
if (!this.connectivityFilterOptions[
|
|
1567
|
-
const
|
|
1568
|
-
this.connectivityKnowledge[
|
|
1569
|
-
var
|
|
1570
|
-
let u =
|
|
1571
|
-
if ((
|
|
1572
|
-
const
|
|
1573
|
-
|
|
1610
|
+
if (!this.connectivityFilterOptions[t] && !e.mockup && (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), e.mockup) {
|
|
1611
|
+
const l = e.getTermNerveMaps() || {}, s = JSON.parse(JSON.stringify(this.connectivityKnowledge[t]));
|
|
1612
|
+
this.connectivityKnowledge[t] = s.map((o) => {
|
|
1613
|
+
var c;
|
|
1614
|
+
let u = o;
|
|
1615
|
+
if ((c = o.nerves) != null && c.length) {
|
|
1616
|
+
const f = o.nerves.flat(1 / 0).reduce((p, g) => (g in l && p.push(l[g]), p), []);
|
|
1617
|
+
f != null && f.length && (a.push(...f), u["nerve-label"] = f.sort((p, g) => p.nerve.localeCompare(g.nerve)));
|
|
1574
1618
|
}
|
|
1575
1619
|
return u;
|
|
1576
|
-
}).filter((
|
|
1577
|
-
const
|
|
1578
|
-
this.connectivityFilterOptions[
|
|
1579
|
-
if (
|
|
1580
|
-
const u =
|
|
1581
|
-
return { ...
|
|
1620
|
+
}).filter((o) => o["nerve-label"]), this.connectivityFilterOptions[t] || (this.connectivityFilterOptions[t] = await e.getFilterOptions(n, this.connectivityKnowledge[t])), a = a.map((o) => o.nerve.toLowerCase());
|
|
1621
|
+
const h = JSON.parse(JSON.stringify(this.connectivityFilterOptions[t]));
|
|
1622
|
+
this.connectivityFilterOptions[t] = h.map((o) => {
|
|
1623
|
+
if (o.key === "scaffold.connectivity.nerve") {
|
|
1624
|
+
const u = o.children.filter((c) => a.includes(c.label.toLowerCase()));
|
|
1625
|
+
return { ...o, children: u };
|
|
1582
1626
|
} else
|
|
1583
|
-
return
|
|
1627
|
+
return o;
|
|
1584
1628
|
});
|
|
1585
1629
|
} else
|
|
1586
|
-
this.connectivityFilterSources[
|
|
1587
|
-
this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge),
|
|
1630
|
+
this.connectivityFilterSources[t] || (this.connectivityFilterSources[t] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
|
|
1631
|
+
this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), m.emit("species-layout-connectivity-update");
|
|
1588
1632
|
},
|
|
1589
1633
|
knowledgeTooltipQuery: async function(e) {
|
|
1590
1634
|
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.flatmapService.mapImp, { resource: [e.id] });
|
|
1591
|
-
let
|
|
1635
|
+
let n = await this.flatmapQueries.createTooltipData(this.flatmapService.mapImp, {
|
|
1592
1636
|
resource: [e.id],
|
|
1593
1637
|
label: e.label,
|
|
1594
1638
|
provenanceTaxonomy: e.taxons,
|
|
1595
1639
|
feature: []
|
|
1596
1640
|
});
|
|
1597
|
-
return
|
|
1641
|
+
return n.knowledgeSource = w(this.flatmapService.mapImp), n.mapId = this.flatmapService.mapImp.mapMetadata.id, n.mapuuid = this.flatmapService.mapImp.mapMetadata.uuid, n["nerve-label"] = e["nerve-label"], n.ready = !0, n;
|
|
1598
1642
|
},
|
|
1599
1643
|
getKnowledgeTooltip: async function(e) {
|
|
1600
|
-
this.tooltipEntry = [], e.data.forEach((
|
|
1601
|
-
let
|
|
1602
|
-
for (let
|
|
1603
|
-
|
|
1604
|
-
this.tooltipEntry = await Promise.all(
|
|
1644
|
+
this.tooltipEntry = [], e.data.forEach((t) => this.tooltipEntry.push({ title: t.label, featureId: [t.id], ready: !1 })), m.emit("connectivity-info-open", this.tooltipEntry);
|
|
1645
|
+
let n = [];
|
|
1646
|
+
for (let t = 0; t < e.data.length; t++)
|
|
1647
|
+
n.push(await this.knowledgeTooltipQuery(e.data[t]));
|
|
1648
|
+
this.tooltipEntry = await Promise.all(n), this.tooltipEntry.map((t) => t.featureId[0]).length > 0 && m.emit("connectivity-info-open", this.tooltipEntry);
|
|
1605
1649
|
},
|
|
1606
|
-
changeConnectivitySource: async function(e,
|
|
1607
|
-
var i,
|
|
1608
|
-
const { entry:
|
|
1609
|
-
|
|
1650
|
+
changeConnectivitySource: async function(e, n) {
|
|
1651
|
+
var i, l;
|
|
1652
|
+
const { entry: r, connectivitySource: t } = e, a = (l = (i = this == null ? void 0 : this.flatmapService) == null ? void 0 : i.mapImp) == null ? void 0 : l.mapMetadata.uuid;
|
|
1653
|
+
n.includes(a) || (n.push(a), await this.flatmapQueries.queryForConnectivityNew(this.flatmapService.mapImp, r.featureId[0], t), this.tooltipEntry = this.tooltipEntry.map((s) => s.featureId[0] === r.featureId[0] ? this.flatmapQueries.updateTooltipData(s) : s), m.emit("connectivity-info-open", this.tooltipEntry));
|
|
1610
1654
|
},
|
|
1611
1655
|
trackEvent: function(e) {
|
|
1612
|
-
|
|
1656
|
+
M.sendEvent(e);
|
|
1613
1657
|
}
|
|
1614
1658
|
},
|
|
1615
1659
|
data: function() {
|
|
1616
1660
|
return {
|
|
1617
1661
|
apiLocation: void 0,
|
|
1618
|
-
activeSpecies:
|
|
1662
|
+
activeSpecies: X,
|
|
1619
1663
|
scaffoldCamera: void 0,
|
|
1620
1664
|
mainStyle: {
|
|
1621
1665
|
height: this.entry.datasetTitle ? "calc(100% - 30px)" : "100%",
|
|
@@ -1651,5 +1695,5 @@ const J = {
|
|
|
1651
1695
|
}
|
|
1652
1696
|
};
|
|
1653
1697
|
export {
|
|
1654
|
-
|
|
1698
|
+
K as C
|
|
1655
1699
|
};
|