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