@abi-software/map-side-bar 1.3.12 → 1.3.14
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/dist/map-side-bar.common.js +76 -49
- package/dist/map-side-bar.common.js.map +1 -1
- package/dist/map-side-bar.css +1 -1
- package/dist/map-side-bar.umd.js +76 -49
- package/dist/map-side-bar.umd.js.map +1 -1
- package/dist/map-side-bar.umd.min.js +1 -1
- package/dist/map-side-bar.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/App.vue +2 -2
- package/src/algolia/algolia.js +2 -2
- package/src/components/ContextCard.vue +18 -0
- package/src/components/SearchFilters.vue +7 -7
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -107,7 +107,7 @@ export default {
|
|
|
107
107
|
console.log("action fired: ", val)
|
|
108
108
|
},
|
|
109
109
|
openSearch: function(){
|
|
110
|
-
this.$refs.sideBar.openSearch([], '
|
|
110
|
+
this.$refs.sideBar.openSearch([], 'http://purl.obolibrary.org/obo/UBERON_0001103')
|
|
111
111
|
},
|
|
112
112
|
singleFacets: function(){
|
|
113
113
|
this.$refs.sideBar.addFilter({facet: 'Heart', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name', AND: true})
|
|
@@ -119,7 +119,7 @@ export default {
|
|
|
119
119
|
this.$refs.sideBar.openSearch([{facet: 'Male', term:'Sex', facetPropPath:'attributes.subject.sex.value'}, {facet: 'Heart', term:'Anatomical structure', facetPropPath: 'anatomy.organ.name'}], '')
|
|
120
120
|
},
|
|
121
121
|
keywordSearch: function(){
|
|
122
|
-
this.$refs.sideBar.
|
|
122
|
+
this.$refs.sideBar.addFilter({type: 'Facet', label: undefined, facet: '3d model', facetPropPath: 'item.keywords.keyword', term: 'Keywords', AND: true})
|
|
123
123
|
},
|
|
124
124
|
markerFromFlatmap: function(){
|
|
125
125
|
this.$refs.sideBar.openSearch([{facet: 'http://purl.obolibrary.org/obo/UBERON_0001103', term:'Keywords', facetPropPath:'item.keywords.keyword'}])
|
package/src/algolia/algolia.js
CHANGED
|
@@ -98,8 +98,8 @@ export class AlgoliaClient {
|
|
|
98
98
|
hits.forEach(hit => {
|
|
99
99
|
if (hit.item && hit.item.keywords) {
|
|
100
100
|
hit.item.keywords.forEach(keywordObj => {
|
|
101
|
-
let keyword = keywordObj.keyword
|
|
102
|
-
if (keyword.includes('UBERON') || keyword.includes('
|
|
101
|
+
let keyword = keywordObj.keyword.toUpperCase()
|
|
102
|
+
if (keyword.includes('UBERON') || keyword.includes('ILX')) {
|
|
103
103
|
foundKeyWords.push(this._processUberonURL(keyword))
|
|
104
104
|
}
|
|
105
105
|
})
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<div class="title">{{contextData.heading}}</div>
|
|
12
12
|
<div v-html="contextData.description"/>
|
|
13
13
|
<br/>
|
|
14
|
+
sample under views: {{samplesUnderViews}}
|
|
14
15
|
<div v-if="contextData.views && contextData.views.length > 0" class="subtitle">Scaffold Views</div>
|
|
15
16
|
<template v-for="(view, i) in contextData.views">
|
|
16
17
|
<div v-bind:key="i+'_1'" @click="openViewFile(view)" class="context-card-view">
|
|
@@ -95,6 +96,23 @@ export default {
|
|
|
95
96
|
immediate: true
|
|
96
97
|
}
|
|
97
98
|
},
|
|
99
|
+
computed: {
|
|
100
|
+
samplesUnderViews: function(){
|
|
101
|
+
if (this.contextData){
|
|
102
|
+
let viewDescriptions = this.contextData.views.map(v=>v.description)
|
|
103
|
+
let samplesHeadings = this.contextData.samples.map(s=>s.heading)
|
|
104
|
+
|
|
105
|
+
// get matching values
|
|
106
|
+
let matching = viewDescriptions.filter(v=>samplesHeadings.includes(v))
|
|
107
|
+
|
|
108
|
+
// check all arrays have the same length (which means all values are in all three)
|
|
109
|
+
if ( viewDescriptions.length === matching.length && matching.length === samplesHeadings.length){
|
|
110
|
+
return true
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
return false
|
|
114
|
+
}
|
|
115
|
+
},
|
|
98
116
|
methods: {
|
|
99
117
|
getContextFile: function (contextFileUrl) {
|
|
100
118
|
this.loading = true
|
|
@@ -72,7 +72,7 @@ import speciesMap from "./species-map";
|
|
|
72
72
|
import { MapSvgIcon, MapSvgSpriteColor } from "@abi-software/svg-sprite";
|
|
73
73
|
|
|
74
74
|
import {AlgoliaClient} from "../algolia/algolia.js";
|
|
75
|
-
import {
|
|
75
|
+
import {facetPropPathMapping} from "../algolia/utils.js";
|
|
76
76
|
|
|
77
77
|
locale.use(lang);
|
|
78
78
|
Vue.use(Option);
|
|
@@ -144,13 +144,13 @@ export default {
|
|
|
144
144
|
},
|
|
145
145
|
methods: {
|
|
146
146
|
createCascaderItemValue: function (term, facet) {
|
|
147
|
-
if (facet) return term + "
|
|
147
|
+
if (facet) return term + ">" + facet;
|
|
148
148
|
else return term;
|
|
149
149
|
},
|
|
150
150
|
populateCascader: function () {
|
|
151
151
|
return new Promise((resolve) => {
|
|
152
152
|
// Algolia facet serach
|
|
153
|
-
this.algoliaClient.getAlgoliaFacets(
|
|
153
|
+
this.algoliaClient.getAlgoliaFacets(facetPropPathMapping)
|
|
154
154
|
.then((data) => {
|
|
155
155
|
this.facets = data;
|
|
156
156
|
this.options = data;
|
|
@@ -201,8 +201,8 @@ export default {
|
|
|
201
201
|
// Create results for the filter update
|
|
202
202
|
let filterKeys = event.filter( selection => selection !== undefined).map( fs => ({
|
|
203
203
|
facetPropPath: fs[0],
|
|
204
|
-
facet: fs[1].split("
|
|
205
|
-
term: fs[1].split("
|
|
204
|
+
facet: fs[1].split(">")[1],
|
|
205
|
+
term: fs[1].split(">")[0],
|
|
206
206
|
AND: fs[2] // for setting the boolean
|
|
207
207
|
}))
|
|
208
208
|
|
|
@@ -211,8 +211,8 @@ export default {
|
|
|
211
211
|
let propPath = fs[0].includes('duplicate') ? fs[0].split('duplicate')[0] : fs[0]
|
|
212
212
|
return {
|
|
213
213
|
facetPropPath: propPath,
|
|
214
|
-
facet: fs[1].split("
|
|
215
|
-
term: fs[1].split("
|
|
214
|
+
facet: fs[1].split(">")[1],
|
|
215
|
+
term: fs[1].split(">")[0],
|
|
216
216
|
AND: fs[2] // for setting the boolean
|
|
217
217
|
}
|
|
218
218
|
})
|