@abi-software/mapintegratedvuer 1.9.2 → 1.9.3-beta.1
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-DO6jlHIh.js → ContentMixin-DXXhWj3L.js} +172 -161
- package/dist/{Flatmap-CY9MPW7I.js → Flatmap-DTJJHOZJ.js} +67 -40
- package/dist/{Iframe-XTSWvVQw.js → Iframe-BvIYJdxM.js} +2 -2
- package/dist/{MultiFlatmap-B7e2d6WK.js → MultiFlatmap-DYUAs7aa.js} +87 -59
- package/dist/{Plot-D3lEgm6I.js → Plot-B3waT3eW.js} +2 -2
- package/dist/Scaffold-D1SvYdhM.js +194 -0
- package/dist/{Simulation-CrPJ4_pw.js → Simulation-DEcCnsZ0.js} +2 -2
- package/dist/{index-BcpVBq1h.js → index-_BTFPzpV.js} +19889 -19974
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +226 -6059
- package/dist/style-DqJAtv3f.js +66 -0
- package/dist/style.css +1 -1
- package/package.json +7 -6
- package/src/App.vue +2 -0
- package/src/assets/header-icon.scss +2 -2
- package/src/components/ContentBar.vue +3 -0
- package/src/components/DialogToolbarContent.vue +434 -18
- package/src/components/MapContent.vue +24 -2
- package/src/components/SplitDialog.vue +71 -31
- package/src/components/SplitFlow.vue +140 -60
- package/src/components/viewers/Flatmap.vue +58 -16
- package/src/components/viewers/MultiFlatmap.vue +62 -8
- package/src/components/viewers/Scaffold.vue +24 -1
- package/src/components.d.ts +9 -0
- package/src/mixins/ContentMixin.js +58 -32
- package/src/stores/connectivities.js +59 -11
- package/src/stores/settings.js +15 -4
- package/src/stores/splitFlow.js +6 -6
- package/vite.bundle-build.js +5 -2
- package/dist/Scaffold-2Zg19azr.js +0 -43337
- package/dist/style-CIceSTeY.js +0 -104700
@@ -1,17 +1,17 @@
|
|
1
|
-
import { markRaw as
|
2
|
-
import { u as b,
|
3
|
-
import { mapStores as
|
1
|
+
import { markRaw as w } from "vue";
|
2
|
+
import { u as b, c as F, d as C, a as f, T as M, e as S, f as I, h as A, l as H } from "./index-_BTFPzpV.js";
|
3
|
+
import { mapStores as N } from "pinia";
|
4
4
|
const d = 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
|
8
|
+
}, g = [], v = async function(e, t) {
|
9
|
+
const i = t.filter(
|
10
10
|
(s) => g.some((a) => a.taxon === s)
|
11
|
-
),
|
12
|
-
(s) =>
|
11
|
+
), n = g.filter(
|
12
|
+
(s) => i.includes(s.taxon)
|
13
13
|
), o = t.filter(
|
14
|
-
(s) => !
|
14
|
+
(s) => !i.includes(s)
|
15
15
|
);
|
16
16
|
if (o.length) {
|
17
17
|
const s = await e.queryLabels(o);
|
@@ -20,32 +20,32 @@ const d = function(e) {
|
|
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
|
32
|
+
const i = e.name ?? e, n = t.name ?? t, o = i.toUpperCase(), s = n.toUpperCase();
|
33
33
|
return o < s ? -1 : o > s ? 1 : 0;
|
34
34
|
};
|
35
|
-
let
|
35
|
+
let $ = 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 s = await
|
45
|
+
const s = await v(e, t.provenanceTaxonomy);
|
46
46
|
s.length && s.forEach((a) => {
|
47
47
|
const { label: r } = a;
|
48
|
-
|
48
|
+
n.push(r);
|
49
49
|
});
|
50
50
|
} catch (s) {
|
51
51
|
console.log(s);
|
@@ -60,9 +60,9 @@ let N = 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,66 +77,66 @@ let N = 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 o = await
|
88
|
+
const o = await v(e, t);
|
89
89
|
o.length && (o.forEach((s) => {
|
90
90
|
const { taxon: a, label: r } = s;
|
91
|
-
|
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(o) ?
|
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(o) ?
|
122
|
-
}),
|
123
|
-
}, this.findComponents = function(e, t,
|
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
124
|
let o = e.connectivity.flat(), s = d(o), a = [], r = !1;
|
125
125
|
return s.forEach((l) => {
|
126
|
-
r = !1, y(t, l) && (r = !0),
|
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
|
-
|
139
|
+
n ? this.processConnectivity(e, r).then((l) => {
|
140
140
|
a.references && (this.rawURLs = [...a.references]), o(l);
|
141
141
|
}) : o(r);
|
142
142
|
} else
|
@@ -146,40 +146,30 @@ let N = function() {
|
|
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.queryForConnectivity = function(e, t,
|
158
|
+
}, this.queryForConnectivity = function(e, t, i, n = !0) {
|
169
159
|
const o = { sql: this.buildConnectivitySqlStatement(t) }, s = {
|
170
160
|
method: "POST",
|
171
161
|
headers: {
|
172
162
|
"Content-Type": "application/json"
|
173
163
|
},
|
174
164
|
body: JSON.stringify(o),
|
175
|
-
...
|
165
|
+
...i ? { signal: i } : {}
|
176
166
|
// add signal to header if it exists
|
177
167
|
};
|
178
168
|
return new Promise((a) => {
|
179
169
|
fetch(`${this.flatmapAPI}knowledge/query/`, s).then((r) => r.json()).then((r) => {
|
180
170
|
if (this.connectivityExists(r)) {
|
181
171
|
let l = JSON.parse(r.values[0][0]);
|
182
|
-
|
172
|
+
n ? this.processConnectivity(e, l).then((c) => {
|
183
173
|
a(c);
|
184
174
|
}) : a(l);
|
185
175
|
} else
|
@@ -196,45 +186,45 @@ let N = function() {
|
|
196
186
|
}, this.findIfNodeIsSingle = function(e) {
|
197
187
|
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
188
|
}, this.createLabelFromNeuralNode = function(e, t) {
|
199
|
-
let
|
200
|
-
if (
|
201
|
-
return t[
|
202
|
-
let
|
189
|
+
let i = this.findIfNodeIsSingle(e);
|
190
|
+
if (i)
|
191
|
+
return t[i];
|
192
|
+
let n = t[e[0]];
|
203
193
|
return e.length === 2 && e[1].length > 0 && e[1].forEach((o) => {
|
204
|
-
t[o] == null ?
|
205
|
-
}),
|
206
|
-
}, this.flattenAndFindDatasets = function(e, t,
|
207
|
-
let
|
194
|
+
t[o] == null ? n += `, ${o}` : n += `, ${t[o]}`;
|
195
|
+
}), n;
|
196
|
+
}, this.flattenAndFindDatasets = function(e, t, i) {
|
197
|
+
let n = this.flattenConnectivity(e), o = this.flattenConnectivity(t), s = this.flattenConnectivity(i);
|
208
198
|
this.originsWithDatasets = this.uberons.filter(
|
209
|
-
(a) =>
|
199
|
+
(a) => n.indexOf(a.id) !== -1
|
210
200
|
).sort(p), this.componentsWithDatasets = this.uberons.filter(
|
211
201
|
(a) => o.indexOf(a.id) !== -1
|
212
202
|
).sort(p), this.destinationsWithDatasets = this.uberons.filter(
|
213
203
|
(a) => s.indexOf(a.id) !== -1
|
214
204
|
).sort(p);
|
215
205
|
}, this.processConnectivity = function(e, t) {
|
216
|
-
return new Promise((
|
217
|
-
let
|
206
|
+
return new Promise((i) => {
|
207
|
+
let n = [], o = [], s;
|
218
208
|
if (t && t["node-phenotypes"]) {
|
219
209
|
const l = ["ilxtr:hasSomaLocatedIn"], c = ["ilxtr:hasAxonPresynapticElementIn", "ilxtr:hasAxonSensorySubcellularElementIn"];
|
220
210
|
l.forEach((h) => {
|
221
|
-
|
222
|
-
}),
|
223
|
-
o.push(...t["node-phenotypes"][h]);
|
211
|
+
h in t["node-phenotypes"] && n.push(...t["node-phenotypes"][h]);
|
212
|
+
}), n = d(n), c.forEach((h) => {
|
213
|
+
h in t["node-phenotypes"] && o.push(...t["node-phenotypes"][h]);
|
224
214
|
}), o = d(o);
|
225
215
|
} else
|
226
|
-
o = d(t.axons), t.somas && t.somas.length > 0 &&
|
227
|
-
const a = this.findComponents(t, o,
|
216
|
+
o = d(t.axons), t.somas && t.somas.length > 0 && n.push(...t.somas), t.dendrites && t.dendrites.length > 0 && n.push(...t.dendrites), n = d(n), s = t.somas;
|
217
|
+
const a = this.findComponents(t, o, n, s), r = this.findAllIdsFromConnectivity(t);
|
228
218
|
this.createLabelLookup(e, r).then((l) => {
|
229
|
-
this.origins =
|
219
|
+
this.origins = n.map(
|
230
220
|
(c) => this.createLabelFromNeuralNode(c, l)
|
231
221
|
).sort(p), this.components = a.map(
|
232
222
|
(c) => this.createLabelFromNeuralNode(c, l)
|
233
223
|
).sort(p), this.destinations = o.map(
|
234
224
|
(c) => this.createLabelFromNeuralNode(c, l)
|
235
|
-
).sort(p), this.flattenAndFindDatasets(
|
225
|
+
).sort(p), this.flattenAndFindDatasets(n, a, o), i({
|
236
226
|
ids: {
|
237
|
-
dendrites:
|
227
|
+
dendrites: n,
|
238
228
|
components: a,
|
239
229
|
axons: o
|
240
230
|
},
|
@@ -251,8 +241,8 @@ let N = function() {
|
|
251
241
|
if (e.length === 1)
|
252
242
|
t += `'${e[0]}')`;
|
253
243
|
else if (e.length > 1)
|
254
|
-
for (let
|
255
|
-
t += `'${e[
|
244
|
+
for (let i in e)
|
245
|
+
t += `'${e[i]}'${i >= e.length - 1 ? ")" : ","} `;
|
256
246
|
return t;
|
257
247
|
}, this.buildPubmedSqlStatementForModels = function(e) {
|
258
248
|
return `select distinct publication from publications where entity = '${e}'`;
|
@@ -264,12 +254,12 @@ let N = function() {
|
|
264
254
|
"Content-Type": "application/json"
|
265
255
|
},
|
266
256
|
body: JSON.stringify(t)
|
267
|
-
}).then((
|
268
|
-
console.error("Error:",
|
257
|
+
}).then((i) => i.json()).catch((i) => {
|
258
|
+
console.error("Error:", i);
|
269
259
|
});
|
270
260
|
};
|
271
261
|
};
|
272
|
-
function
|
262
|
+
function T(e) {
|
273
263
|
return e[0].toUpperCase() + e.substring(1);
|
274
264
|
}
|
275
265
|
const D = {
|
@@ -289,8 +279,9 @@ const D = {
|
|
289
279
|
default: !1
|
290
280
|
}
|
291
281
|
},
|
282
|
+
inject: ["showGlobalSettings", "showOpenMapButton"],
|
292
283
|
computed: {
|
293
|
-
...
|
284
|
+
...N(b, F, C),
|
294
285
|
idNamePair() {
|
295
286
|
return this.splitFlowStore.idNamePair;
|
296
287
|
},
|
@@ -305,14 +296,28 @@ const D = {
|
|
305
296
|
},
|
306
297
|
annotationSidebar() {
|
307
298
|
return this.settingsStore.annotationSidebar;
|
299
|
+
},
|
300
|
+
// Hide local settings if global settings are shown
|
301
|
+
showLocalSettings() {
|
302
|
+
return !this.showGlobalSettings;
|
308
303
|
}
|
309
304
|
},
|
305
|
+
beforeUnmount: function() {
|
306
|
+
this.alive = !1;
|
307
|
+
},
|
310
308
|
mounted: function() {
|
311
|
-
f.on("startHelp", ()
|
312
|
-
this.startHelp();
|
313
|
-
}), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
|
309
|
+
f.on("startHelp", this.startHelp), f.on("connectivity-item-close", this.onConnectivityItemClose), this.multiflatmapRef = this.$refs.multiflatmap, this.flatmapRef = this.$refs.flatmap, this.scaffoldRef = this.$refs.scaffold, this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities, this.connectivityFilterOptions = this.connectivitiesStore.filterOptions, this.connectivityFilterSources = this.connectivitiesStore.filterSources;
|
314
310
|
},
|
315
311
|
methods: {
|
312
|
+
onConnectivityItemClose() {
|
313
|
+
if (this != null && this.alive) {
|
314
|
+
if (this.multiflatmapRef) {
|
315
|
+
const e = this.multiflatmapRef.getCurrentFlatmap();
|
316
|
+
e && e.closeTooltip();
|
317
|
+
}
|
318
|
+
this.flatmapRef && this.flatmapRef.closeTooltip();
|
319
|
+
}
|
320
|
+
},
|
316
321
|
toggleSyncMode: function() {
|
317
322
|
},
|
318
323
|
getState: function() {
|
@@ -324,7 +329,7 @@ const D = {
|
|
324
329
|
this.settingsStore.updateMapManager(e);
|
325
330
|
},
|
326
331
|
trackOpenMap: function(e) {
|
327
|
-
|
332
|
+
M.sendEvent({
|
328
333
|
event: "interaction_event",
|
329
334
|
event_name: "portal_maps_open_map",
|
330
335
|
category: e,
|
@@ -349,12 +354,12 @@ const D = {
|
|
349
354
|
*/
|
350
355
|
resourceSelected: function(e, t) {
|
351
356
|
var a, r, l, c;
|
352
|
-
const
|
353
|
-
if (this.resourceHasAction(
|
354
|
-
f.emit("PopoverActionClick",
|
357
|
+
const i = t[0];
|
358
|
+
if (this.resourceHasAction(i)) {
|
359
|
+
f.emit("PopoverActionClick", i);
|
355
360
|
return;
|
356
361
|
}
|
357
|
-
let
|
362
|
+
let n, o = !1;
|
358
363
|
const s = {
|
359
364
|
paneIndex: this.entry.id,
|
360
365
|
type: e,
|
@@ -363,17 +368,17 @@ const D = {
|
|
363
368
|
eventType: void 0
|
364
369
|
};
|
365
370
|
if (e == "MultiFlatmap" || e == "Flatmap")
|
366
|
-
if (s.internalName = (a =
|
367
|
-
if (s.eventType = "selected",
|
371
|
+
if (s.internalName = (a = i == null ? void 0 : i.feature) != null && a.label ? i.feature.label : this.idNamePair[i.feature.models], i.eventType == "click")
|
372
|
+
if (s.eventType = "selected", i.feature.type == "marker") {
|
368
373
|
let h = s.internalName;
|
369
|
-
if (this.settingsStore.isFeaturedMarkerIdentifier(
|
370
|
-
|
374
|
+
if (this.settingsStore.isFeaturedMarkerIdentifier(i.feature.id))
|
375
|
+
n = {
|
371
376
|
type: "Search",
|
372
|
-
term: this.settingsStore.featuredMarkerDoi(
|
377
|
+
term: this.settingsStore.featuredMarkerDoi(i.feature.id),
|
373
378
|
featuredDataset: !0
|
374
379
|
};
|
375
380
|
else {
|
376
|
-
|
381
|
+
n = {
|
377
382
|
type: "Facet",
|
378
383
|
facet: h,
|
379
384
|
facetPropPath: "anatomy.organ.category.name",
|
@@ -381,23 +386,23 @@ const D = {
|
|
381
386
|
term: "Anatomical structure"
|
382
387
|
};
|
383
388
|
let u = /* @__PURE__ */ new Set();
|
384
|
-
|
389
|
+
i.feature["marker-terms"].forEach((m) => {
|
385
390
|
u.add(m.label);
|
386
|
-
}), u.add(h), u.size > 0 && (
|
391
|
+
}), u.add(h), u.size > 0 && (n = {
|
387
392
|
type: "Facets",
|
388
393
|
labels: [...u]
|
389
394
|
});
|
390
395
|
}
|
391
396
|
o = !0, e == "MultiFlatmap" && this.$refs.multiflatmap.getCurrentFlatmap().mapImp.clearSearchResults();
|
392
|
-
} else
|
393
|
-
else
|
394
|
-
else e == "Scaffold" && (
|
397
|
+
} else i.feature.type == "feature" && this.syncMode && (o = !0);
|
398
|
+
else i.eventType == "mouseenter" && (s.eventType = "highlighted", o = !0);
|
399
|
+
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 = {
|
395
400
|
type: "Facet",
|
396
|
-
facet:
|
401
|
+
facet: T(i.data.id),
|
397
402
|
facetPropPath: "anatomy.organ.category.name",
|
398
403
|
term: "Anatomical structure"
|
399
404
|
})), s.eventType = "selected", o = !0);
|
400
|
-
|
405
|
+
n && f.emit("PopoverActionClick", n), o && this.$emit("resource-selected", s);
|
401
406
|
},
|
402
407
|
resourceHasAction: function(e) {
|
403
408
|
return e.type === "URL" || e.type === "Search" || e.type === "Neuron Search" || e.type == "Facet" || e.type == "Facets";
|
@@ -418,53 +423,53 @@ const D = {
|
|
418
423
|
getNameAndIdFromSyncData: async function(e) {
|
419
424
|
let t = e.internalName;
|
420
425
|
t === void 0 && e.resource && (t = e.resource.label);
|
421
|
-
let
|
422
|
-
if (e.resource && e.resource.resource && (
|
426
|
+
let i;
|
427
|
+
if (e.resource && e.resource.resource && (i = e.resource.resource[0]), this.entry.type === "Scaffold") {
|
423
428
|
if (this.$refs.scaffold.findObjectsWithGroupName(t).length === 0) {
|
424
429
|
if (e.resource && e.resource.feature) {
|
425
430
|
const s = S(e.resource.feature.models);
|
426
431
|
if (s.length > 0) return s;
|
427
432
|
}
|
428
|
-
let o =
|
433
|
+
let o = I(t);
|
429
434
|
if (o)
|
430
435
|
return o;
|
431
|
-
if (
|
432
|
-
return fetch(`${this.apiLocation}get-related-terms/${
|
436
|
+
if (i && e.eventType === "selected")
|
437
|
+
return fetch(`${this.apiLocation}get-related-terms/${i}`).then((s) => s.json()).then((s) => {
|
433
438
|
var a;
|
434
439
|
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),
|
440
|
+
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 };
|
436
441
|
});
|
437
442
|
}
|
438
443
|
} else if (this.entry.type === "MultiFlatmap")
|
439
444
|
if (t === "Bladder")
|
440
445
|
t = "Urinary Bladder";
|
441
446
|
else {
|
442
|
-
const
|
443
|
-
|
447
|
+
const n = S(t);
|
448
|
+
n.length > 0 && (t = n[0]);
|
444
449
|
}
|
445
|
-
return { id:
|
450
|
+
return { id: i, name: t };
|
446
451
|
},
|
447
452
|
// Get the species and andaotmy info for the featured datasets
|
448
453
|
getDatasetAnatomyInfo: function(e) {
|
449
454
|
fetch(`${this.apiLocation}dataset_info/anatomy?identifier=${e}`).then((t) => t.json()).then((t) => {
|
450
|
-
const
|
451
|
-
let
|
455
|
+
const i = t.result[0];
|
456
|
+
let n;
|
452
457
|
try {
|
453
|
-
|
458
|
+
n = i.anatomy.organ[0].curie;
|
454
459
|
} catch {
|
455
|
-
|
460
|
+
n = void 0;
|
456
461
|
}
|
457
462
|
let o;
|
458
463
|
try {
|
459
|
-
o =
|
464
|
+
o = i.item.curie;
|
460
465
|
} catch {
|
461
466
|
o = void 0;
|
462
467
|
}
|
463
468
|
let s;
|
464
469
|
try {
|
465
470
|
let a = 0, r = !1;
|
466
|
-
for (; !r && a <
|
467
|
-
const l =
|
471
|
+
for (; !r && a < i.organisms.subject.length; ) {
|
472
|
+
const l = i.organisms.subject[a];
|
468
473
|
l.species && (s = l.species.name, r = !0), a += 1;
|
469
474
|
}
|
470
475
|
} catch {
|
@@ -472,7 +477,7 @@ const D = {
|
|
472
477
|
}
|
473
478
|
this.settingsStore.updateFeaturedMarker({
|
474
479
|
identifier: e,
|
475
|
-
marker:
|
480
|
+
marker: n,
|
476
481
|
doi: o,
|
477
482
|
species: s
|
478
483
|
});
|
@@ -486,7 +491,7 @@ const D = {
|
|
486
491
|
// Check if the new featured dataset api has any info
|
487
492
|
newFeaturedDatasetApiHasInfo: async function() {
|
488
493
|
let t = await (await fetch(`${this.apiLocation}get_featured_dataset`)).json();
|
489
|
-
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((
|
494
|
+
return !t.datasets || t.datasets.length == 0 ? !1 : t.datasets.map((i) => i.id);
|
490
495
|
},
|
491
496
|
/**
|
492
497
|
* Get a list of featured datasets to display.
|
@@ -495,11 +500,11 @@ const D = {
|
|
495
500
|
let e = [], t = await this.oldFeaturedDatasetApiHasInfo();
|
496
501
|
if (t) e = t;
|
497
502
|
else {
|
498
|
-
let
|
499
|
-
|
503
|
+
let i = await this.newFeaturedDatasetApiHasInfo();
|
504
|
+
i && (e = i);
|
500
505
|
}
|
501
|
-
this.settingsStore.updateFeatured(e), e.forEach((
|
502
|
-
this.getDatasetAnatomyInfo(
|
506
|
+
this.settingsStore.updateFeatured(e), e.forEach((i) => {
|
507
|
+
this.getDatasetAnatomyInfo(i);
|
503
508
|
});
|
504
509
|
},
|
505
510
|
zoomToFeatures: function() {
|
@@ -530,7 +535,7 @@ const D = {
|
|
530
535
|
onResize: function() {
|
531
536
|
},
|
532
537
|
startHelp: function() {
|
533
|
-
this.isInHelp === !1 && (this.helpMode = !0, window.addEventListener("mousedown", this.checkEndHelpMouseDown), this.isInHelp = !0);
|
538
|
+
this != null && this.alive && this.isInHelp === !1 && (this.helpMode = !0, window.addEventListener("mousedown", this.checkEndHelpMouseDown), this.isInHelp = !0);
|
534
539
|
},
|
535
540
|
endHelp: function() {
|
536
541
|
window.removeEventListener("mousedown", this.checkEndHelpMouseDown), this.helpMode = !1, setTimeout(() => {
|
@@ -558,15 +563,15 @@ const D = {
|
|
558
563
|
checkEndHelpMouseDown: function(e) {
|
559
564
|
e.target.closest(".help-mode-dialog") || this.endHelp();
|
560
565
|
},
|
561
|
-
flatmapHighlight: async function(e, t,
|
562
|
-
let o = [...t, ...
|
566
|
+
flatmapHighlight: async function(e, t, i, n) {
|
567
|
+
let o = [...t, ...n];
|
563
568
|
const s = this.settingsStore.globalSettings;
|
564
569
|
if (s.highlightConnectedPaths) {
|
565
|
-
const a = t.length ? t :
|
570
|
+
const a = t.length ? t : n.length ? n : [], r = await e.retrieveConnectedPaths(a);
|
566
571
|
r && o.push(...r);
|
567
572
|
}
|
568
573
|
if (s.highlightDOIPaths) {
|
569
|
-
const a = await e.searchConnectivitiesByReference(
|
574
|
+
const a = await e.searchConnectivitiesByReference(i);
|
570
575
|
a && o.push(...a);
|
571
576
|
}
|
572
577
|
return o = [...new Set(o)], o;
|
@@ -574,12 +579,15 @@ const D = {
|
|
574
579
|
cardHoverHighlight: function() {
|
575
580
|
var e;
|
576
581
|
if (this.visible) {
|
577
|
-
const t = this.settingsStore.hoverAnatomies,
|
582
|
+
const t = this.settingsStore.hoverAnatomies, i = this.settingsStore.hoverOrgans, n = this.settingsStore.hoverDOI, o = this.settingsStore.hoverConnectivity;
|
578
583
|
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 && !
|
580
|
-
(t.length ||
|
584
|
+
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(() => {
|
585
|
+
(t.length || i.length || n || o.length) && ((this.multiflatmapRef || this.flatmapRef) && s ? this.flatmapHighlight(s, t, n, o).then((r) => {
|
581
586
|
try {
|
582
|
-
s.
|
587
|
+
s.showConnectivityTooltips({
|
588
|
+
connectivityInfo: { featureId: r },
|
589
|
+
data: []
|
590
|
+
});
|
583
591
|
} catch (l) {
|
584
592
|
if (console.log(l), o.length && s.mapImp) {
|
585
593
|
const c = s.mapImp.uuid;
|
@@ -590,7 +598,7 @@ const D = {
|
|
590
598
|
) || s.mapImp.clearSearchResults();
|
591
599
|
}
|
592
600
|
}
|
593
|
-
}) : this.scaffoldRef && a && a.changeHighlightedByName(
|
601
|
+
}) : this.scaffoldRef && a && a.changeHighlightedByName(i, "", !1));
|
594
602
|
}, 100);
|
595
603
|
}
|
596
604
|
},
|
@@ -600,6 +608,9 @@ const D = {
|
|
600
608
|
onAnnotationClose: function() {
|
601
609
|
f.emit("annotation-close");
|
602
610
|
},
|
611
|
+
updateOfflineAnnotationEnabled: function(e) {
|
612
|
+
f.emit("update-offline-annotation-enabled", e);
|
613
|
+
},
|
603
614
|
onConnectivityInfoOpen: function(e) {
|
604
615
|
f.emit("connectivity-info-open", e);
|
605
616
|
},
|
@@ -609,21 +620,18 @@ const D = {
|
|
609
620
|
onConnectivityInfoClose: function() {
|
610
621
|
f.emit("connectivity-info-close");
|
611
622
|
},
|
612
|
-
|
613
|
-
const t =
|
623
|
+
loadConnectivityExplorerConfig: async function(e) {
|
624
|
+
const t = e.mapImp, i = A(t), n = w(new $());
|
614
625
|
n.initialise(this.flatmapAPI);
|
615
|
-
const
|
616
|
-
if (this.connectivityKnowledge[
|
617
|
-
var
|
618
|
-
return
|
619
|
-
}).sort((
|
620
|
-
const
|
621
|
-
this.connectivityKnowledge[
|
622
|
-
var l;
|
623
|
-
return r.source === t && ((l = r.connectivity) == null ? void 0 : l.length) && r.id in a;
|
624
|
-
}).sort((r, l) => r.label.localeCompare(l.label));
|
626
|
+
const o = await H(t, n), s = t.uuid, a = t.pathways;
|
627
|
+
if (this.connectivityKnowledge[i] || (this.connectivityKnowledge[i] = o.filter((r) => {
|
628
|
+
var l;
|
629
|
+
return r.source === i && ((l = r.connectivity) == null ? void 0 : l.length);
|
630
|
+
}).sort((r, l) => r.label.localeCompare(l.label))), !this.connectivityKnowledge[s]) {
|
631
|
+
const r = a ? a.paths : {};
|
632
|
+
this.connectivityKnowledge[s] = this.connectivityKnowledge[i].filter((l) => l.id in r);
|
625
633
|
}
|
626
|
-
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), f.emit("species-layout-connectivity-update");
|
634
|
+
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge), this.connectivityFilterOptions[s] || (this.connectivityFilterOptions[s] = await e.getFilterOptions()), this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions), this.connectivityFilterSources[s] || (this.connectivityFilterSources[s] = e.getFilterSources()), this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources), f.emit("species-layout-connectivity-update");
|
627
635
|
}
|
628
636
|
},
|
629
637
|
data: function() {
|
@@ -646,7 +654,10 @@ const D = {
|
|
646
654
|
isInHelp: !1,
|
647
655
|
mapManager: void 0,
|
648
656
|
connectivityKnowledge: {},
|
649
|
-
|
657
|
+
connectivityFilterOptions: {},
|
658
|
+
connectivityFilterSources: {},
|
659
|
+
highlightDelay: void 0,
|
660
|
+
alive: !0
|
650
661
|
};
|
651
662
|
},
|
652
663
|
created: function() {
|