@abi-software/map-side-bar 2.14.8-demo.0 → 2.14.8-demo.1
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.js +931 -928
- package/dist/map-side-bar.umd.cjs +36 -36
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/CellCard.vue +1 -1
- package/src/components/CellCardExplorer.vue +20 -0
package/package.json
CHANGED
|
@@ -340,11 +340,13 @@ export default {
|
|
|
340
340
|
this.$refs.searchHistory.selectValue = 'Search history';
|
|
341
341
|
}
|
|
342
342
|
this.applyFilters(this.activeFilters);
|
|
343
|
+
this.emitSomaLocations(this.filterOptions);
|
|
343
344
|
},
|
|
344
345
|
searchAndFilterUpdate: function() {
|
|
345
346
|
this.page = 1;
|
|
346
347
|
this.start = 0;
|
|
347
348
|
this.applyFilters(this.activeFilters);
|
|
349
|
+
this.emitSomaLocations(this.filterOptions);
|
|
348
350
|
this.searchHistoryUpdate(this.activeFilters, this.searchInput);
|
|
349
351
|
},
|
|
350
352
|
filterUpdate: function(filters) {
|
|
@@ -405,6 +407,14 @@ export default {
|
|
|
405
407
|
normalizeFacetValue: function(value) {
|
|
406
408
|
return String(value || '').trim().toLowerCase();
|
|
407
409
|
},
|
|
410
|
+
getSelectedSomaLocationFilters: function() {
|
|
411
|
+
return (this.activeFilters || [])
|
|
412
|
+
.filter((filter) => {
|
|
413
|
+
return this.normalizeFacetValue(filter?.term) === 'soma location';
|
|
414
|
+
})
|
|
415
|
+
.map((filter) => this.normalizeFacetValue(filter?.facet))
|
|
416
|
+
.filter(Boolean);
|
|
417
|
+
},
|
|
408
418
|
getAvailableSpeciesSet: function() {
|
|
409
419
|
const availableSpecies = new Set();
|
|
410
420
|
|
|
@@ -559,6 +569,9 @@ export default {
|
|
|
559
569
|
const somaLocationOption = (filterOptions || []).find((option) => option.key === 'somaLocations');
|
|
560
570
|
const availableDataRaw = localStorage.getItem('available-name-curie-mapping');
|
|
561
571
|
const availableData = availableDataRaw ? JSON.parse(availableDataRaw) : {};
|
|
572
|
+
const selectedSomaLocationFilters = this.getSelectedSomaLocationFilters();
|
|
573
|
+
const shouldFilterBySelectedSomaLocations = (this.activeFilters || []).length > 0 && selectedSomaLocationFilters.length > 0;
|
|
574
|
+
const selectedSomaLocationSet = new Set(selectedSomaLocationFilters);
|
|
562
575
|
const scopedCellTypes = this.getCellTypesForActiveSpecies();
|
|
563
576
|
const somaLocationCounts = scopedCellTypes.reduce((counts, cellType) => {
|
|
564
577
|
(Array.isArray(cellType?.somaLocations) ? cellType.somaLocations : []).forEach((location) => {
|
|
@@ -571,6 +584,13 @@ export default {
|
|
|
571
584
|
const somaLocations = (somaLocationOption?.children || [])
|
|
572
585
|
.map((child) => String(child?.label || '').trim())
|
|
573
586
|
.filter(Boolean)
|
|
587
|
+
.filter((label) => {
|
|
588
|
+
if (!shouldFilterBySelectedSomaLocations) {
|
|
589
|
+
return true;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return selectedSomaLocationSet.has(label.toLowerCase());
|
|
593
|
+
})
|
|
574
594
|
.map((label) => {
|
|
575
595
|
const curie = Object.keys(availableData).find(
|
|
576
596
|
(curie) => String(availableData[curie] || '').toLowerCase() === label.toLowerCase()
|