@abi-software/flatmapvuer 0.3.10 → 0.3.12-beta-0

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.
@@ -8,8 +8,6 @@
8
8
  <span class="title">{{content.featureId}}</span>
9
9
  </div>
10
10
  <div class="content-container scrollbar">
11
- <!-- Currently we don't show the pubmed viewer, will remove once we are certain it won't be used -->
12
- <pubmed-viewer v-if="content.featureIds" v-show="false" class="block" :entry="content" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
13
11
  {{content.paths}}
14
12
  <div v-if="this.origins" class="block">
15
13
  <div>
@@ -65,17 +63,12 @@
65
63
  </el-button>
66
64
  </div>
67
65
 
68
- <!-- We will serach on components until we can search on neurons -->
69
66
  <el-button v-show="components.length > 0" class="button" @click="openAll">
70
67
  Search for data on components
71
68
  </el-button>
72
69
 
73
- <!-- Disable neuron search until it is ready -->
74
- <!-- <el-button v-for="action in content.actions" round :key="action.title"
75
- class="button" @click="resourceSelected(action)">
76
- <i v-if="action.title === 'Search for datasets' || action.title === 'View Dataset' " class="el-icon-coin"></i>
77
- {{action.title}}
78
- </el-button> -->
70
+ <!-- pubmed-viewer is just used for processing pubmed requests (no display) -->
71
+ <pubmed-viewer v-if="content.featureIds" v-show="false" :entry="content" @pubmedSearchUrl="pubmedSearchUrlUpdate"/>
79
72
  <el-button v-if="pubmedSearchUrl != ''" class="button" icon="el-icon-notebook-2" @click="openUrl(pubmedSearchUrl)">
80
73
  Open publications in pubmed
81
74
  </el-button>
@@ -333,6 +326,38 @@ export default {
333
326
  }
334
327
  return label
335
328
  },
329
+ processConnectivity(connectivity){
330
+ // Filter the origin and destinations from components
331
+ let components = this.findComponents(connectivity)
332
+
333
+ // Remove duplicates
334
+ let axons = removeDuplicates(connectivity.axons)
335
+ let dendrites = removeDuplicates(connectivity.dendrites)
336
+
337
+ // Create list of ids to get labels for
338
+ let conIds = this.findAllIdsFromConnectivity(connectivity)
339
+
340
+ // Create readable labels from the nodes. Setting this to 'this.origins' updates the display
341
+ this.createLabelLookup(conIds).then(lookUp=>{
342
+ this.destinations = axons.map(a=>this.createLabelFromNeuralNode(a,lookUp))
343
+ this.origins = dendrites.map(d=>this.createLabelFromNeuralNode(d,lookUp))
344
+ this.components = components.map(c=>this.createLabelFromNeuralNode(c, lookUp))
345
+ })
346
+
347
+ this.flattenAndFindDatasets(components, axons, dendrites)
348
+ },
349
+ flattenAndFindDatasets(components, axons, dendrites){
350
+
351
+ // process the nodes for finding datasets (Note this is not critical to the tooltip, only for the 'search on components' button)
352
+ let componentsFlat = this.flattenConntectivity(components)
353
+ let axonsFlat = this.flattenConntectivity(axons)
354
+ let dendritesFlat = this.flattenConntectivity(dendrites)
355
+
356
+ // Filter for the anatomy which is annotated on datasets
357
+ this.destinationsWithDatasets = this.uberons.filter(ub => axonsFlat.indexOf(ub.id) !== -1)
358
+ this.originsWithDatasets = this.uberons.filter(ub => dendritesFlat.indexOf(ub.id) !== -1)
359
+ this.componentsWithDatasets = this.uberons.filter(ub => componentsFlat.indexOf(ub.id) !== -1)
360
+ },
336
361
  pathwayQuery: function(keastIds){
337
362
  this.destinations = []
338
363
  this.origins = []
@@ -350,29 +375,7 @@ export default {
350
375
  .then(response => response.json())
351
376
  .then(data => {
352
377
  let connectivity = JSON.parse(data.values[0][0])
353
- // Filter the origin and destinations from components
354
- let components = this.findComponents(connectivity)
355
-
356
- // process the nodes for finding datasets
357
- let componentsFlat = this.flattenConntectivity(components)
358
- let axons = removeDuplicates(connectivity.axons)
359
- let dendrites = removeDuplicates(connectivity.dendrites)
360
- let axonsFlat = this.flattenConntectivity(axons)
361
- let dendritesFlat = this.flattenConntectivity(dendrites)
362
-
363
- let conIds = this.findAllIdsFromConnectivity(connectivity) // Create list of ids to get labels for
364
-
365
- // Create readable labels from the nodes. Setting this to 'this.origins' updates the display
366
- this.createLabelLookup(conIds).then(lookUp=>{
367
- this.destinations = axons.map(a=>this.createLabelFromNeuralNode(a,lookUp))
368
- this.origins = dendrites.map(d=>this.createLabelFromNeuralNode(d,lookUp))
369
- this.components = components.map(c=>this.createLabelFromNeuralNode(c, lookUp))
370
- })
371
-
372
- // Filter for the anatomy which is annotated on datasets
373
- this.destinationsWithDatasets = this.uberons.filter(ub => axonsFlat.indexOf(ub.id) !== -1)
374
- this.originsWithDatasets = this.uberons.filter(ub => dendritesFlat.indexOf(ub.id) !== -1)
375
- this.componentsWithDatasets = this.uberons.filter(ub => componentsFlat.indexOf(ub.id) !== -1)
378
+ this.processConnectivity(connectivity)
376
379
  this.loading = false
377
380
  })
378
381
  .catch((error) => {