@abi-software/map-side-bar 1.4.1-beta.2 → 1.4.1-beta.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "1.4.1-beta.2",
3
+ "version": "1.4.1-beta.4",
4
4
  "main": "./dist/map-side-bar.common.js",
5
5
  "files": [
6
6
  "dist/*",
package/src/App.vue CHANGED
@@ -21,6 +21,7 @@
21
21
  /* eslint-disable no-alert, no-console */
22
22
  // optionally import default styles
23
23
  import SideBar from './components/SideBar'
24
+ import EventBus from './components/EventBus'
24
25
 
25
26
  // let testContext = {
26
27
  // "description": "3D digital tracings of the enteric plexus obtained from seven subjects (M11, M16, M162, M163, M164, M168) are mapped randomly on mouse proximal colon. The data depicts individual neural wiring patterns in enteric microcircuits, and revealed both neuron and fiber units wired in a complex organization.",
@@ -140,6 +141,9 @@ export default {
140
141
  },
141
142
  mounted: function() {
142
143
  console.log("mounted app")
144
+ EventBus.$on("contextUpdate", (payLoad) => {
145
+ console.log("contextUpdate", payLoad)
146
+ })
143
147
  },
144
148
  }
145
149
  </script>
@@ -9,6 +9,7 @@ export class AlgoliaClient {
9
9
  algoliaKey
10
10
  )
11
11
  this.PENNSIEVE_API_LOCATION = PENNSIEVE_API_LOCATION
12
+ this.anatomyFacetLabels = []
12
13
  }
13
14
  initIndex(ALGOLIA_INDEX) {
14
15
  this.index = this.client.initIndex(ALGOLIA_INDEX);
@@ -93,6 +94,8 @@ export class AlgoliaClient {
93
94
 
94
95
  _processAnatomy(hits) {
95
96
  let foundKeyWords = []
97
+ let foundLabels = []
98
+ let uniqueLabels = []
96
99
  let uniqueKeywords = []
97
100
  hits.forEach(hit => {
98
101
  if (hit.item && hit.item.keywords) {
@@ -107,11 +110,14 @@ export class AlgoliaClient {
107
110
  hit.anatomy.organ.forEach(anatomy => {
108
111
  if (anatomy.curie) {
109
112
  foundKeyWords.push(anatomy.curie)
113
+ foundLabels.push(anatomy.name)
110
114
  }
111
115
  })
112
116
  }
113
117
  })
114
- uniqueKeywords = [...new Set(foundKeyWords)]
118
+ uniqueKeywords = [...new Set(foundKeyWords) ]
119
+ uniqueLabels = [...new Set(foundLabels) ]
120
+ this.anatomyFacetLabels = uniqueLabels
115
121
  return uniqueKeywords
116
122
  }
117
123
 
@@ -168,6 +168,7 @@ export default {
168
168
  propogateCardAction: function(action){
169
169
  EventBus.$emit("PopoverActionClick", action)
170
170
  this.$emit('contextUpdate', action)
171
+ EventBus.$emit("contextUpdate", action) // Pass to mapintegratedvuer
171
172
  },
172
173
  splitDOI: function(doi){
173
174
  return [doi.split('/')[doi.split('/').length-2], doi.split('/')[doi.split('/').length-1]]
@@ -129,6 +129,15 @@ export default {
129
129
  value: payLoad
130
130
  })
131
131
  })
132
+ EventBus.$on('anatomyFound', (payLoad)=> {
133
+ this.$emit('search-changed', {
134
+ type: 'filter-label-update',
135
+ value: payLoad
136
+ })
137
+ })
138
+ EventBus.$on('contextUpdate', (payLoad)=> {
139
+ this.$emit('contextUpdate', payLoad)
140
+ })
132
141
  }
133
142
  };
134
143
  </script>
@@ -241,6 +241,7 @@ export default {
241
241
  .anatomyInSearch(getFilters(filters), query)
242
242
  .then((anatomy) => {
243
243
  EventBus.$emit("anatomyFound", anatomy);
244
+ EventBus.$emit("labelsFound", this.algoliaClient.anatomyFacetLabels);
244
245
  });
245
246
  this.algoliaClient
246
247
  .search(getFilters(filters), query, this.numberPerPage, this.page)
package/delte.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "description": "This dataset contains single cell scale anatomical map of the rat intrinsic cardiac nervous system (ICNS) across four male and three female hearts. These cell clusters can be seen by the yellow data points on the image as well as spherical markers on the 3D heart scaffold. The dataset provides an integrative framework to visualise the spatial distribution of ICNS across different hearts.",
3
- "heading": "Mapped ICN samples",
4
- "id": "sparc.science.context_data",
5
- "samples": [
6
- {
7
- "annotation": "",
8
- "description": "Spatial location of isolated ICNS mapped onto a generic heart scaffold",
9
- "doi": "",
10
- "heading": "ICNS from subject M54-8",
11
- "id": "Sample 1",
12
- "path": "",
13
- "view": "View 1",
14
- "color": "#FFFF00",
15
- "thumbnail": "https://raw.githubusercontent.com/ABI-Software/map-sidebar/main/assets/temp-pics/orange.png"
16
- },
17
- {
18
- "annotation": "",
19
- "description": "Spatial location of isolated ICNS mapped onto a generic heart scaffold",
20
- "doi": "",
21
- "heading": "ICNS from subject M54-5",
22
- "id": "Sample 2",
23
- "path": "",
24
- "view": "View 2",
25
- "color": "#FFA500",
26
- "thumbnail": "https://raw.githubusercontent.com/ABI-Software/map-sidebar/main/assets/temp-pics/teal.png"
27
- }
28
- ],
29
- "version": "0.1.0"
30
- }