@abi-software/flatmapvuer 0.3.0-beta-2 → 0.3.0-beta-2-upstream-downstream
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/LICENSE +201 -201
- package/README.md +105 -105
- package/babel.config.js +14 -14
- package/dist/flatmapvuer.common.js +175 -117
- package/dist/flatmapvuer.common.js.map +1 -1
- package/dist/flatmapvuer.css +1 -1
- package/dist/flatmapvuer.umd.js +175 -117
- package/dist/flatmapvuer.umd.js.map +1 -1
- package/dist/flatmapvuer.umd.min.js +1 -1
- package/dist/flatmapvuer.umd.min.js.map +1 -1
- package/package-lock.json +13923 -13916
- package/package.json +66 -66
- package/public/index.html +17 -17
- package/src/App.vue +161 -161
- package/src/assets/_variables.scss +43 -43
- package/src/assets/styles.scss +7 -7
- package/src/components/EventBus.js +2 -2
- package/src/components/FlatmapVuer.vue +1326 -1311
- package/src/components/MultiFlatmapVuer.vue +349 -349
- package/src/components/PubmedViewer.vue +194 -194
- package/src/components/Tooltip.vue +481 -437
- package/src/components/index.js +9 -9
- package/src/icons/fonts/mapicon-species.eot +0 -0
- package/src/icons/fonts/mapicon-species.svg +14 -14
- package/src/icons/fonts/mapicon-species.ttf +0 -0
- package/src/icons/fonts/mapicon-species.woff +0 -0
- package/src/icons/mapicon-species-style.css +42 -42
- package/src/main.js +8 -8
- package/src/nerve-map.js +99 -0
- package/vue.config.js +31 -31
|
@@ -1,437 +1,481 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="tooltip-container">
|
|
3
|
-
<el-main v-if="content" class="main" v-loading="loading">
|
|
4
|
-
<div class="block" v-if="content.title">
|
|
5
|
-
<span class="title">{{capitalise(content.title)}}</span>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="block" v-else>
|
|
8
|
-
<span class="title">{{content.featureId}}</span>
|
|
9
|
-
</div>
|
|
10
|
-
<!-- Currently we don't show the pubmed viewer, will remove once we are certain it won't be used -->
|
|
11
|
-
<pubmed-viewer v-if="content.featureIds" v-show="false" class="block" :entry="content" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
|
|
12
|
-
{{content.paths}}
|
|
13
|
-
<div v-if="this.components" class="block">
|
|
14
|
-
<div class="attribute-title">Components</div>
|
|
15
|
-
<div v-for="component in components" class="attribute-content" :key="component">
|
|
16
|
-
{{ capitalise(component) }}
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
<div v-if="this.
|
|
20
|
-
<div
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</div>
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
})
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
.
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
.
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
.
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tooltip-container">
|
|
3
|
+
<el-main v-if="content" class="main" v-loading="loading">
|
|
4
|
+
<div class="block" v-if="content.title">
|
|
5
|
+
<span class="title">{{capitalise(content.title)}}</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="block" v-else>
|
|
8
|
+
<span class="title">{{content.featureId}}</span>
|
|
9
|
+
</div>
|
|
10
|
+
<!-- Currently we don't show the pubmed viewer, will remove once we are certain it won't be used -->
|
|
11
|
+
<pubmed-viewer v-if="content.featureIds" v-show="false" class="block" :entry="content" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
|
|
12
|
+
{{content.paths}}
|
|
13
|
+
<div v-if="this.components" class="block">
|
|
14
|
+
<div class="attribute-title">Components</div>
|
|
15
|
+
<div v-for="component in components" class="attribute-content" :key="component">
|
|
16
|
+
{{ capitalise(component) }}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div v-if="this.origins" class="block">
|
|
20
|
+
<div>
|
|
21
|
+
<span class="attribute-title">Origin</span>
|
|
22
|
+
<el-popover
|
|
23
|
+
width="250"
|
|
24
|
+
trigger="hover"
|
|
25
|
+
:append-to-body=false
|
|
26
|
+
popper-class="popover-origin-help"
|
|
27
|
+
>
|
|
28
|
+
<i slot="reference" class="el-icon-warning-outline info"/>
|
|
29
|
+
<span style="word-break: keep-all;">
|
|
30
|
+
<i>Origin</i> is where the dendrites stem from
|
|
31
|
+
</span>
|
|
32
|
+
</el-popover>
|
|
33
|
+
</div>
|
|
34
|
+
<div v-for="origin in origins" class="attribute-content" :key="origin">
|
|
35
|
+
{{ capitalise(origin) }}
|
|
36
|
+
</div>
|
|
37
|
+
<el-button v-show="originsWithDatasets.length > 0" class="button" @click="openDendrites">
|
|
38
|
+
Explore origin data
|
|
39
|
+
</el-button>
|
|
40
|
+
</div>
|
|
41
|
+
<div v-if="this.destinations" class="block">
|
|
42
|
+
<div>
|
|
43
|
+
<span class="attribute-title">Destination</span>
|
|
44
|
+
<el-popover
|
|
45
|
+
width="250"
|
|
46
|
+
trigger="hover"
|
|
47
|
+
:append-to-body=false
|
|
48
|
+
popper-class="popover-origin-help"
|
|
49
|
+
>
|
|
50
|
+
<i slot="reference" class="el-icon-warning-outline info"/>
|
|
51
|
+
<span style="word-break: keep-all;">
|
|
52
|
+
<i>Destination</i> is where the axons terminate (& in the cases of some psuedoinunipolar neurons, where their dendritic "terminals" are)
|
|
53
|
+
</span>
|
|
54
|
+
</el-popover>
|
|
55
|
+
</div>
|
|
56
|
+
<div v-for="destination in destinations" class="attribute-content" :key="destination">
|
|
57
|
+
{{ capitalise(destination) }}
|
|
58
|
+
</div>
|
|
59
|
+
<el-button v-show="destinationsWithDatasets.length > 0" class="button" @click="openAxons">
|
|
60
|
+
Explore destination data
|
|
61
|
+
</el-button>
|
|
62
|
+
</div>
|
|
63
|
+
|
|
64
|
+
<!-- We will serach on components until we can search on neurons -->
|
|
65
|
+
<el-button v-show="components.length > 0" class="button" @click="openAll">
|
|
66
|
+
Search for data on components
|
|
67
|
+
</el-button>
|
|
68
|
+
|
|
69
|
+
<!-- Disable neuron search until it is ready -->
|
|
70
|
+
<!-- <el-button v-for="action in content.actions" round :key="action.title"
|
|
71
|
+
class="button" @click="resourceSelected(action)">
|
|
72
|
+
<i v-if="action.title === 'Search for datasets' || action.title === 'View Dataset' " class="el-icon-coin"></i>
|
|
73
|
+
{{action.title}}
|
|
74
|
+
</el-button> -->
|
|
75
|
+
<el-button v-if="pubmedSearchUrl" class="button" icon="el-icon-notebook-2" @click="openUrl(pubmedSearchUrl)">
|
|
76
|
+
Open publications in pubmed
|
|
77
|
+
</el-button>
|
|
78
|
+
</el-main>
|
|
79
|
+
</div>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
/* eslint-disable no-alert, no-console */
|
|
85
|
+
import Vue from "vue";
|
|
86
|
+
import {
|
|
87
|
+
Button,
|
|
88
|
+
Container,
|
|
89
|
+
Header,
|
|
90
|
+
Icon,
|
|
91
|
+
Main
|
|
92
|
+
} from "element-ui";
|
|
93
|
+
import lang from "element-ui/lib/locale/lang/en";
|
|
94
|
+
import locale from "element-ui/lib/locale";
|
|
95
|
+
locale.use(lang);
|
|
96
|
+
Vue.use(Button);
|
|
97
|
+
Vue.use(Container);
|
|
98
|
+
Vue.use(Header);
|
|
99
|
+
Vue.use(Icon);
|
|
100
|
+
Vue.use(Main);
|
|
101
|
+
|
|
102
|
+
// pubmedviewer is currently not in use, but still under review so not ready to delete yet
|
|
103
|
+
import PubmedViewer from './PubmedViewer.vue'
|
|
104
|
+
import EventBus from './EventBus'
|
|
105
|
+
|
|
106
|
+
const titleCase = (str) => {
|
|
107
|
+
return str.replace(/\w\S*/g, (t) => { return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase() });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const capitalise = function(str){
|
|
111
|
+
if (str)
|
|
112
|
+
return str.charAt(0).toUpperCase() + str.slice(1)
|
|
113
|
+
return ""
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default {
|
|
117
|
+
components: { PubmedViewer },
|
|
118
|
+
name: "Tooltip",
|
|
119
|
+
props: {
|
|
120
|
+
visible: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: false
|
|
123
|
+
},
|
|
124
|
+
content: {
|
|
125
|
+
type: Object,
|
|
126
|
+
default: undefined
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
data: function() {
|
|
130
|
+
return {
|
|
131
|
+
activeSpecies: undefined,
|
|
132
|
+
appendToBody: false,
|
|
133
|
+
pubmedSearchUrl: '',
|
|
134
|
+
loading: false,
|
|
135
|
+
destinations: [],
|
|
136
|
+
origins: [],
|
|
137
|
+
components: [],
|
|
138
|
+
destinationsWithDatasets: [],
|
|
139
|
+
originsWithDatasets: [],
|
|
140
|
+
componentsWithDatasets: [],
|
|
141
|
+
uberons: [{id: undefined, name: undefined}]
|
|
142
|
+
};
|
|
143
|
+
},
|
|
144
|
+
inject: ['sparcAPI', 'flatmapAPI'],
|
|
145
|
+
watch: {
|
|
146
|
+
'content.featureIds': {
|
|
147
|
+
handler: function(){
|
|
148
|
+
this.pathwayQuery(this.content.featureIds)
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
mounted: function(){
|
|
153
|
+
this.getOrganCuries()
|
|
154
|
+
},
|
|
155
|
+
methods: {
|
|
156
|
+
resourceSelected: function(action) {
|
|
157
|
+
this.$emit("resource-selected", action);
|
|
158
|
+
},
|
|
159
|
+
titleCase: function(title){
|
|
160
|
+
return titleCase(title)
|
|
161
|
+
},
|
|
162
|
+
capitalise: function(text){
|
|
163
|
+
return capitalise(text)
|
|
164
|
+
},
|
|
165
|
+
onClose: function() {
|
|
166
|
+
this.$emit("onClose")
|
|
167
|
+
},
|
|
168
|
+
openUrl: function(url){
|
|
169
|
+
window.open(url, '_blank')
|
|
170
|
+
},
|
|
171
|
+
openAll: function(){
|
|
172
|
+
EventBus.$emit('onActionClick', {type:'Facets', labels: this.components})
|
|
173
|
+
},
|
|
174
|
+
openAxons: function(){
|
|
175
|
+
EventBus.$emit('onActionClick', {type:'Facets', labels: this.destinationsWithDatasets.map(a=>a.name)})
|
|
176
|
+
},
|
|
177
|
+
openDendrites: function(){
|
|
178
|
+
EventBus.$emit('onActionClick', {type:'Facets', labels: this.originsWithDatasets.map(a=>a.name)})
|
|
179
|
+
},
|
|
180
|
+
pubmedSearchUrlUpdate: function (val){
|
|
181
|
+
this.pubmedSearchUrl = val
|
|
182
|
+
},
|
|
183
|
+
findComponents: function(connectivity){
|
|
184
|
+
let dnodes = connectivity.connectivity.flat() // get nodes from edgelist
|
|
185
|
+
let nodes = [...new Set(dnodes)] // remove duplicates
|
|
186
|
+
|
|
187
|
+
let found = []
|
|
188
|
+
let terminal = false
|
|
189
|
+
nodes.forEach(node=>{
|
|
190
|
+
let n = node.flat() // Find all terms on the node
|
|
191
|
+
terminal = false
|
|
192
|
+
|
|
193
|
+
// Check if the node is an destination or origin (note that they are labelled dendrite and axon as opposed to origin and destination)
|
|
194
|
+
n.forEach(s=>{
|
|
195
|
+
if(connectivity.axons.includes(s)){
|
|
196
|
+
terminal = true
|
|
197
|
+
}
|
|
198
|
+
if(connectivity.dendrites.includes(s)){
|
|
199
|
+
terminal = true
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
if (!terminal){
|
|
203
|
+
found.push(node)
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
|
|
207
|
+
// remove duplicates
|
|
208
|
+
let foundUnique = [...new Set(found.map(n=>n[0]))]
|
|
209
|
+
return foundUnique
|
|
210
|
+
},
|
|
211
|
+
getOrganCuries: function(){
|
|
212
|
+
fetch(`${this.sparcAPI}get-organ-curies/`)
|
|
213
|
+
.then(response=>response.json())
|
|
214
|
+
.then(data=>{
|
|
215
|
+
this.uberons = data.uberon.array
|
|
216
|
+
})
|
|
217
|
+
},
|
|
218
|
+
buildConnectivitySqlStatement: function(keastIds) {
|
|
219
|
+
let sql = 'select knowledge from knowledge where entity in ('
|
|
220
|
+
if (keastIds.length === 1) {
|
|
221
|
+
sql += `'${keastIds[0]}')`
|
|
222
|
+
} else if (keastIds.length > 1) {
|
|
223
|
+
for (let i in keastIds) {
|
|
224
|
+
sql += `'${keastIds[i]}'${i >= keastIds.length - 1 ? ')' : ','} `
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return sql
|
|
228
|
+
},
|
|
229
|
+
buildLabelSqlStatement: function(uberons) {
|
|
230
|
+
let sql = 'select entity, label from labels where entity in ('
|
|
231
|
+
if (uberons.length === 1) {
|
|
232
|
+
sql += `'${uberons[0]}')`
|
|
233
|
+
} else if (uberons.length > 1) {
|
|
234
|
+
for (let i in uberons) {
|
|
235
|
+
sql += `'${uberons[i]}'${i >= uberons.length - 1 ? ')' : ','} `
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
return sql
|
|
239
|
+
},
|
|
240
|
+
createLabelLookup: function(uberons) {
|
|
241
|
+
return new Promise(resolve=> {
|
|
242
|
+
let uberonMap = {}
|
|
243
|
+
const data = { sql: this.buildLabelSqlStatement(uberons)}
|
|
244
|
+
fetch(`${this.flatmapAPI}knowledge/query/`, {
|
|
245
|
+
method: 'POST',
|
|
246
|
+
headers: {
|
|
247
|
+
'Content-Type': 'application/json',
|
|
248
|
+
},
|
|
249
|
+
body: JSON.stringify(data),
|
|
250
|
+
})
|
|
251
|
+
.then(response => response.json())
|
|
252
|
+
.then(payload => {
|
|
253
|
+
const entity = payload.keys.indexOf("entity");
|
|
254
|
+
const label = payload.keys.indexOf("label");
|
|
255
|
+
if (entity > -1 && label > -1) {
|
|
256
|
+
payload.values.forEach(pair => {
|
|
257
|
+
uberonMap[pair[entity]] = pair[label];
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
resolve(uberonMap)
|
|
261
|
+
})
|
|
262
|
+
})
|
|
263
|
+
},
|
|
264
|
+
pathwayQuery: function(keastIds){
|
|
265
|
+
this.destinations = []
|
|
266
|
+
this.origins = []
|
|
267
|
+
this.components = []
|
|
268
|
+
this.loading = true
|
|
269
|
+
if (!keastIds || keastIds.length == 0) return
|
|
270
|
+
const data = { sql: this.buildConnectivitySqlStatement(keastIds)};
|
|
271
|
+
fetch(`${this.flatmapAPI}knowledge/query/`, {
|
|
272
|
+
method: 'POST',
|
|
273
|
+
headers: {
|
|
274
|
+
'Content-Type': 'application/json',
|
|
275
|
+
},
|
|
276
|
+
body: JSON.stringify(data),
|
|
277
|
+
})
|
|
278
|
+
.then(response => response.json())
|
|
279
|
+
.then(data => {
|
|
280
|
+
let connectivity = JSON.parse(data.values[0][0])
|
|
281
|
+
let components = this.findComponents(connectivity)
|
|
282
|
+
|
|
283
|
+
// Create list of ids to get labels for
|
|
284
|
+
let conIds = connectivity.axons.concat(connectivity.dendrites.concat(components))
|
|
285
|
+
this.createLabelLookup(conIds).then(lookUp=>{
|
|
286
|
+
this.destinations = connectivity.axons.map(a=>lookUp[a])
|
|
287
|
+
this.origins = connectivity.dendrites.map(d=>lookUp[d])
|
|
288
|
+
this.components = components.map(c=>lookUp[c])
|
|
289
|
+
})
|
|
290
|
+
|
|
291
|
+
// Filter for the anatomy which is annotated on datasets
|
|
292
|
+
this.destinationsWithDatasets = this.uberons.filter(ub => connectivity.axons.indexOf(ub.id) !== -1)
|
|
293
|
+
this.originsWithDatasets = this.uberons.filter(ub => connectivity.dendrites.indexOf(ub.id) !== -1)
|
|
294
|
+
this.componentsWithDatasets = this.uberons.filter(ub => connectivity.dendrites.indexOf(ub.id) !== -1)
|
|
295
|
+
this.loading = false
|
|
296
|
+
})
|
|
297
|
+
.catch((error) => {
|
|
298
|
+
console.error('Error:', error);
|
|
299
|
+
})
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
};
|
|
303
|
+
</script>
|
|
304
|
+
|
|
305
|
+
<style scoped lang="scss">
|
|
306
|
+
@import "~element-ui/packages/theme-chalk/src/button";
|
|
307
|
+
@import "~element-ui/packages/theme-chalk/src/container";
|
|
308
|
+
@import "~element-ui/packages/theme-chalk/src/header";
|
|
309
|
+
@import "~element-ui/packages/theme-chalk/src/main";
|
|
310
|
+
|
|
311
|
+
.tooltip-container {
|
|
312
|
+
text-align:justify;
|
|
313
|
+
border-radius: 4px;
|
|
314
|
+
box-shadow: 0 1px 2px rgba(0,0,0,.1);
|
|
315
|
+
pointer-events: auto;
|
|
316
|
+
background: #fff;
|
|
317
|
+
border: 1px solid $app-primary-color;
|
|
318
|
+
display: flex;
|
|
319
|
+
justify-content: center;
|
|
320
|
+
align-items: center;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.display {
|
|
324
|
+
width: 44px;
|
|
325
|
+
word-break: normal;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.title {
|
|
329
|
+
text-align: left;
|
|
330
|
+
width: 16em;
|
|
331
|
+
line-height: 1.5em !important;
|
|
332
|
+
font-size: 1em;
|
|
333
|
+
font-family: Helvetica;
|
|
334
|
+
font-weight: 500;
|
|
335
|
+
/* font-weight: bold; */
|
|
336
|
+
padding-bottom: 8px;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
.block {
|
|
340
|
+
margin-bottom: 1.5em;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.pub {
|
|
344
|
+
width: 16rem;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.icon {
|
|
348
|
+
right: 0px;
|
|
349
|
+
position: absolute;
|
|
350
|
+
top: 10px;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.icon:hover {
|
|
354
|
+
cursor: pointer;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.popover-origin-help {
|
|
358
|
+
text-transform: none !important; // need to overide the tooltip text transform
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
.info{
|
|
362
|
+
transform: rotate(180deg);
|
|
363
|
+
color: #8300bf;
|
|
364
|
+
margin-left: 8px;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
.main {
|
|
368
|
+
font-size: 14px;
|
|
369
|
+
text-align: left;
|
|
370
|
+
line-height: 1.5em;
|
|
371
|
+
font-family: Helvetica;
|
|
372
|
+
font-weight: 400;
|
|
373
|
+
/* outline: thin red solid; */
|
|
374
|
+
padding: 1em !important;
|
|
375
|
+
overflow: hidden;
|
|
376
|
+
min-width: 16rem;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.title{
|
|
380
|
+
font-size: 18px;
|
|
381
|
+
font-weight: 500;
|
|
382
|
+
font-weight: bold;
|
|
383
|
+
padding-bottom: 8px;
|
|
384
|
+
color: rgb(131, 0, 191);
|
|
385
|
+
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.attribute-title{
|
|
389
|
+
font-size: 16px;
|
|
390
|
+
font-weight: 600;
|
|
391
|
+
/* font-weight: bold; */
|
|
392
|
+
text-transform: uppercase;
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.attribute-content{
|
|
396
|
+
font-size: 14px;
|
|
397
|
+
font-weight: 500;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.popover-container {
|
|
401
|
+
height: 100%;
|
|
402
|
+
width: 100%;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.main {
|
|
406
|
+
.el-button.is-round{
|
|
407
|
+
border-radius: 4px;
|
|
408
|
+
padding: 9px 20px 10px 20px;
|
|
409
|
+
display: flex;
|
|
410
|
+
height: 36px;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
.button {
|
|
415
|
+
margin-left: 0px !important;
|
|
416
|
+
margin-top: 0px !important;
|
|
417
|
+
font-size: 14px !important;
|
|
418
|
+
background-color: $app-primary-color;
|
|
419
|
+
color: #fff;
|
|
420
|
+
&+.button {
|
|
421
|
+
margin-top: 10px !important;
|
|
422
|
+
}
|
|
423
|
+
&:hover {
|
|
424
|
+
color: #fff !important;
|
|
425
|
+
background: #ac76c5 !important;
|
|
426
|
+
border: 1px solid #ac76c5 !important;
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
.tooltip-container{
|
|
431
|
+
&::after, &::before {
|
|
432
|
+
content: '';
|
|
433
|
+
display: block;
|
|
434
|
+
position: absolute;
|
|
435
|
+
width: 0;
|
|
436
|
+
height: 0;
|
|
437
|
+
border-style: solid;
|
|
438
|
+
flex-shrink: 0;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.mapboxgl-popup-anchor-bottom {
|
|
443
|
+
.tooltip-container {
|
|
444
|
+
&::after, &::before {
|
|
445
|
+
top: 100%;
|
|
446
|
+
border-width: 12px;
|
|
447
|
+
}
|
|
448
|
+
&::after {
|
|
449
|
+
margin-top:-1px;
|
|
450
|
+
border-color: rgb(255, 255, 255) transparent transparent transparent ;
|
|
451
|
+
}
|
|
452
|
+
&::before {
|
|
453
|
+
margin: 0 auto;
|
|
454
|
+
border-color: $app-primary-color transparent transparent transparent ;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
.mapboxgl-popup-anchor-top {
|
|
460
|
+
.tooltip-container {
|
|
461
|
+
&::after, &::before {
|
|
462
|
+
top: -24px;
|
|
463
|
+
border-width: 12px;
|
|
464
|
+
}
|
|
465
|
+
&::after {
|
|
466
|
+
margin-top: 1px;
|
|
467
|
+
border-color: transparent transparent rgb(255, 255, 255) transparent ;
|
|
468
|
+
}
|
|
469
|
+
&::before {
|
|
470
|
+
margin: 0 auto;
|
|
471
|
+
border-color: transparent transparent $app-primary-color transparent ;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
|
|
477
|
+
/* Fix for chrome bug where under triangle pops up above one on top of it */
|
|
478
|
+
.selector:not(*:root), .tooltip-container::after{
|
|
479
|
+
top: 99.4%;
|
|
480
|
+
}
|
|
481
|
+
</style>
|