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