@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.
@@ -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.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 entity, 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
- const entity = payload.keys.indexOf("entity");
221
- const label = payload.keys.indexOf("label");
222
- if (entity > -1 && label > -1) {
223
- payload.values.forEach(pair => {
224
- uberonMap[pair[entity]] = pair[label];
225
- });
226
- }
227
- resolve(uberonMap)
228
- })
229
- })
230
- },
231
- pathwayQuery: function(keastIds){
232
- this.axons = []
233
- this.dendrites = []
234
- this.components = []
235
- this.loading = true
236
- if (!keastIds || keastIds.length == 0) return
237
- const data = { sql: this.buildConnectivitySqlStatement(keastIds)};
238
- fetch(`${this.flatmapAPI}knowledge/query/`, {
239
- method: 'POST',
240
- headers: {
241
- 'Content-Type': 'application/json',
242
- },
243
- body: JSON.stringify(data),
244
- })
245
- .then(response => response.json())
246
- .then(data => {
247
- let connectivity = JSON.parse(data.values[0][0])
248
- let components = this.findComponents(connectivity)
249
-
250
- // Create list of ids to get labels for
251
- let conIds = connectivity.axons.concat(connectivity.dendrites.concat(components))
252
- this.createLabelLookup(conIds).then(lookUp=>{
253
- this.axons = connectivity.axons.map(a=>lookUp[a])
254
- this.dendrites = connectivity.dendrites.map(d=>lookUp[d])
255
- this.components = components.map(c=>lookUp[c])
256
- })
257
-
258
- // Filter for the anatomy which is annotated on datasets
259
- this.axonsWithDatasets = this.uberons.filter(ub => connectivity.axons.indexOf(ub.id) !== -1)
260
- this.dendritesWithDatasets = this.uberons.filter(ub => connectivity.dendrites.indexOf(ub.id) !== -1)
261
- this.loading = false
262
- })
263
- .catch((error) => {
264
- console.error('Error:', error);
265
- })
266
- }
267
- }
268
- };
269
- </script>
270
-
271
- <style scoped lang="scss">
272
- @import "~element-ui/packages/theme-chalk/src/button";
273
- @import "~element-ui/packages/theme-chalk/src/container";
274
- @import "~element-ui/packages/theme-chalk/src/header";
275
- @import "~element-ui/packages/theme-chalk/src/main";
276
-
277
- .tooltip-container {
278
- text-align:justify;
279
- border-radius: 4px;
280
- box-shadow: 0 1px 2px rgba(0,0,0,.1);
281
- pointer-events: auto;
282
- background: #fff;
283
- border: 1px solid $app-primary-color;
284
- display: flex;
285
- justify-content: center;
286
- align-items: center;
287
- }
288
-
289
- .display {
290
- width: 44px;
291
- word-break: normal;
292
- }
293
-
294
- .title {
295
- text-align: left;
296
- width: 16em;
297
- line-height: 1.5em !important;
298
- font-size: 1em;
299
- font-family: Helvetica;
300
- font-weight: 500;
301
- /* font-weight: bold; */
302
- padding-bottom: 8px;
303
- }
304
-
305
- .block {
306
- margin-bottom: 1.5em;
307
- }
308
-
309
- .pub {
310
- width: 16rem;
311
- }
312
-
313
- .icon {
314
- right: 0px;
315
- position: absolute;
316
- top: 10px;
317
- }
318
-
319
- .icon:hover {
320
- cursor: pointer;
321
- }
322
-
323
- .main {
324
- font-size: 14px;
325
- text-align: left;
326
- line-height: 1.5em;
327
- font-family: Helvetica;
328
- font-weight: 400;
329
- /* outline: thin red solid; */
330
- padding: 1em !important;
331
- overflow: hidden;
332
- min-width: 16rem;
333
- }
334
-
335
- .title{
336
- font-size: 18px;
337
- font-weight: 500;
338
- font-weight: bold;
339
- padding-bottom: 8px;
340
- color: rgb(131, 0, 191);
341
-
342
- }
343
-
344
- .attribute-title{
345
- font-size: 16px;
346
- font-weight: 600;
347
- /* font-weight: bold; */
348
- text-transform: uppercase;
349
- }
350
-
351
- .attribute-content{
352
- font-size: 14px;
353
- font-weight: 500;
354
- }
355
-
356
- .popover-container {
357
- height: 100%;
358
- width: 100%;
359
- }
360
-
361
- .main {
362
- .el-button.is-round{
363
- border-radius: 4px;
364
- padding: 9px 20px 10px 20px;
365
- display: flex;
366
- height: 36px;
367
- }
368
- }
369
-
370
- .button {
371
- margin-left: 0px !important;
372
- margin-top: 0px !important;
373
- font-size: 14px !important;
374
- background-color: $app-primary-color;
375
- color: #fff;
376
- &+.button {
377
- margin-top: 10px !important;
378
- }
379
- &:hover {
380
- color: #fff !important;
381
- background: #ac76c5 !important;
382
- border: 1px solid #ac76c5 !important;
383
- }
384
- }
385
-
386
- .tooltip-container{
387
- &::after, &::before {
388
- content: '';
389
- display: block;
390
- position: absolute;
391
- width: 0;
392
- height: 0;
393
- border-style: solid;
394
- flex-shrink: 0;
395
- }
396
- }
397
-
398
- .mapboxgl-popup-anchor-bottom {
399
- .tooltip-container {
400
- &::after, &::before {
401
- top: 100%;
402
- border-width: 12px;
403
- }
404
- &::after {
405
- margin-top:-1px;
406
- border-color: rgb(255, 255, 255) transparent transparent transparent ;
407
- }
408
- &::before {
409
- margin: 0 auto;
410
- border-color: $app-primary-color transparent transparent transparent ;
411
- }
412
- }
413
- }
414
-
415
- .mapboxgl-popup-anchor-top {
416
- .tooltip-container {
417
- &::after, &::before {
418
- top: -24px;
419
- border-width: 12px;
420
- }
421
- &::after {
422
- margin-top: 1px;
423
- border-color: transparent transparent rgb(255, 255, 255) transparent ;
424
- }
425
- &::before {
426
- margin: 0 auto;
427
- border-color: transparent transparent $app-primary-color transparent ;
428
- }
429
- }
430
- }
431
-
432
-
433
- /* Fix for chrome bug where under triangle pops up above one on top of it */
434
- .selector:not(*:root), .tooltip-container::after{
435
- top: 99.4%;
436
- }
437
- </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.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>