@abi-software/map-side-bar 2.10.2 → 2.10.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/dist/map-side-bar.js +881 -850
- package/dist/map-side-bar.umd.cjs +25 -25
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/algolia/algolia.js +8 -14
- package/src/components/BadgesGroup.vue +2 -1
- package/src/components/DatasetExplorer.vue +2 -0
- package/src/components/ImageGallery.vue +46 -0
- package/src/components/index.js +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/*",
|
|
6
6
|
"src/*",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@abi-software/gallery": "^1.2.0",
|
|
42
|
-
"@abi-software/map-utilities": "
|
|
42
|
+
"@abi-software/map-utilities": "1.7.2",
|
|
43
43
|
"@abi-software/svg-sprite": "^1.0.2",
|
|
44
44
|
"@element-plus/icons-vue": "^2.3.1",
|
|
45
45
|
"algoliasearch": "^4.10.5",
|
package/src/algolia/algolia.js
CHANGED
|
@@ -292,33 +292,27 @@ export class AlgoliaClient {
|
|
|
292
292
|
const anatomyOrganCategoryNames = anatomyOrganCategoryName ? Object.keys(anatomyOrganCategoryName) : []
|
|
293
293
|
const anatomyOrganSubcategoryNames = anatomyOrganSubcategoryName ? Object.keys(anatomyOrganSubcategoryName) : []
|
|
294
294
|
const anatomyOrganSubsubcategoryNames = anatomyOrganSubsubcategoryName ? Object.keys(anatomyOrganSubsubcategoryName) : []
|
|
295
|
-
|
|
296
|
-
|
|
295
|
+
const filteredOrganNames = []
|
|
296
|
+
|
|
297
297
|
anatomyOrganCategoryNames.forEach((_categoryName) => {
|
|
298
298
|
const categoryName = _categoryName.toLowerCase();
|
|
299
299
|
anatomyOrganNames.forEach((_organName) => {
|
|
300
300
|
const organName = _organName.toLowerCase();
|
|
301
|
+
//This will be incorrect for subsubcategory
|
|
301
302
|
const fullName = `${categoryName}.${organName}`
|
|
302
303
|
const foundNamesInSubsub = []
|
|
303
|
-
|
|
304
304
|
const found = anatomyOrganSubcategoryNames.some((_subcategoryName) => {
|
|
305
305
|
const subcategoryName = _subcategoryName.toLowerCase();
|
|
306
306
|
if (subcategoryName === fullName) {
|
|
307
|
-
const foundNameInSubsub = anatomyOrganSubsubcategoryNames.find((name) => name.toLocaleLowerCase().includes(subcategoryName))
|
|
308
|
-
if (foundNameInSubsub) {
|
|
309
|
-
const subsubOrganName = foundNameInSubsub.replace(`${subcategoryName}.`, '');
|
|
310
|
-
if (anatomyOrganNames.map((name) => name.toLowerCase()).includes(subsubOrganName)) {
|
|
311
|
-
foundNamesInSubsub.push(subsubOrganName)
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
307
|
return true
|
|
308
|
+
} else {
|
|
309
|
+
return anatomyOrganSubsubcategoryNames.find((name) => {
|
|
310
|
+
const fullsubsubname = `${subcategoryName}.${organName}`
|
|
311
|
+
return (fullsubsubname === name)
|
|
312
|
+
})
|
|
315
313
|
}
|
|
316
314
|
});
|
|
317
315
|
|
|
318
|
-
if (foundNamesInSubsub.length) {
|
|
319
|
-
filteredOrganNames.push(...foundNamesInSubsub.map(name => name.toLowerCase()))
|
|
320
|
-
}
|
|
321
|
-
|
|
322
316
|
if (found) {
|
|
323
317
|
filteredOrganNames.push(organName);
|
|
324
318
|
}
|
|
@@ -85,9 +85,10 @@ export default {
|
|
|
85
85
|
deep: true,
|
|
86
86
|
immediate: true,
|
|
87
87
|
handler: function () {
|
|
88
|
+
this.addToCategories(this.entry.flatmaps, 'Flatmaps')
|
|
89
|
+
this.addToCategories(this.entry.plots, 'Plots')
|
|
88
90
|
this.addToCategories(this.entry.scaffolds, 'Scaffolds')
|
|
89
91
|
this.addToCategories(this.entry.segmentation, 'Segmentations')
|
|
90
|
-
this.addToCategories(this.entry.plots, 'Plots')
|
|
91
92
|
this.addSimulationsToCategories(this.entry.simulation)
|
|
92
93
|
/** disable the following
|
|
93
94
|
this.addToCategories(this.entry.images, 'Images');
|
|
@@ -462,7 +462,9 @@ export default {
|
|
|
462
462
|
? element['abi-contextual-information']
|
|
463
463
|
: undefined,
|
|
464
464
|
segmentation: element['mbf-segmentation'],
|
|
465
|
+
//omex format will be the preferred mimetype
|
|
465
466
|
simulation: element['abi-simulation-omex-file'] ? element['abi-simulation-omex-file'] : element['abi-simulation-file'],
|
|
467
|
+
flatmaps: element['abi-flatmap-file'],
|
|
466
468
|
additionalLinks: element.additionalLinks,
|
|
467
469
|
detailsReady: true,
|
|
468
470
|
})
|
|
@@ -92,6 +92,7 @@ export default {
|
|
|
92
92
|
//Use the Images instead for Biolucida Images
|
|
93
93
|
//"Biolucida Images": [],
|
|
94
94
|
Dataset: [],
|
|
95
|
+
Flatmaps:[],
|
|
95
96
|
Images: [],
|
|
96
97
|
Scaffolds: [],
|
|
97
98
|
Segmentations: [],
|
|
@@ -123,6 +124,7 @@ export default {
|
|
|
123
124
|
createSciCurnchItems: function () {
|
|
124
125
|
this.updateS3Bucket(this.entry.s3uri)
|
|
125
126
|
this.createDatasetItem()
|
|
127
|
+
this.createFlatmapItems()
|
|
126
128
|
this.createScaffoldItems()
|
|
127
129
|
this.createSimulationItems()
|
|
128
130
|
this.createPlotItems()
|
|
@@ -147,6 +149,48 @@ export default {
|
|
|
147
149
|
})
|
|
148
150
|
}
|
|
149
151
|
},
|
|
152
|
+
createFlatmapItems: function () {
|
|
153
|
+
if (this.entry.flatmaps) {
|
|
154
|
+
this.entry.flatmaps.forEach((flatmap) => {
|
|
155
|
+
if (flatmap.associated_flatmap?.identifier) {
|
|
156
|
+
const filePath = flatmap.dataset.path
|
|
157
|
+
const id = flatmap.identifier
|
|
158
|
+
const thumbnail = this.getThumbnailForPlot(
|
|
159
|
+
flatmap,
|
|
160
|
+
this.entry.thumbnails
|
|
161
|
+
)
|
|
162
|
+
let thumbnailURL = undefined
|
|
163
|
+
let mimetype = ''
|
|
164
|
+
if (thumbnail) {
|
|
165
|
+
thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
|
|
166
|
+
id,
|
|
167
|
+
prefix: this.getS3Prefix(),
|
|
168
|
+
file_path: thumbnail.dataset.path,
|
|
169
|
+
s3Bucket: this.s3Bucket,
|
|
170
|
+
})
|
|
171
|
+
mimetype = thumbnail.mimetype.name
|
|
172
|
+
}
|
|
173
|
+
let action = {
|
|
174
|
+
label: capitalise(this.label),
|
|
175
|
+
resource: flatmap.associated_flatmap.identifier,
|
|
176
|
+
title: 'View Flatmap',
|
|
177
|
+
type: 'Flatmap',
|
|
178
|
+
discoverId: this.datasetId,
|
|
179
|
+
version: this.datasetVersion,
|
|
180
|
+
}
|
|
181
|
+
this.items['Flatmaps'].push({
|
|
182
|
+
id,
|
|
183
|
+
title: baseName(filePath),
|
|
184
|
+
type: 'Flatmap',
|
|
185
|
+
thumbnail: thumbnailURL,
|
|
186
|
+
userData: action,
|
|
187
|
+
hideType: true,
|
|
188
|
+
mimetype,
|
|
189
|
+
})
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
},
|
|
150
194
|
createImageItems: function () {
|
|
151
195
|
if (this.entry.images) {
|
|
152
196
|
this.entry.images.forEach((image) => {
|
|
@@ -348,6 +392,8 @@ export default {
|
|
|
348
392
|
} else {
|
|
349
393
|
const filePath = simulation.dataset.path
|
|
350
394
|
const id = simulation.identifier
|
|
395
|
+
//Despite of the name, this method can be used to retreive
|
|
396
|
+
//the thumbnail information for any none scaffold type thumbnail
|
|
351
397
|
const thumbnail = this.getThumbnailForPlot(
|
|
352
398
|
simulation,
|
|
353
399
|
this.entry.thumbnails
|