@abi-software/map-side-bar 2.9.2-beta.2 → 2.9.2-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/dist/map-side-bar.js +594 -553
- package/dist/map-side-bar.umd.cjs +22 -22
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +10 -8
- package/src/components/ConnectivityExplorer.vue +18 -6
- package/src/components/{SidebarContent.vue → DatasetExplorer.vue} +2 -2
- package/src/components/ImageGallery.vue +61 -20
- package/src/components/SearchFilters.vue +11 -1
- package/src/components/SideBar.vue +3 -3
- package/src/components.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "2.9.2-beta.
|
|
3
|
+
"version": "2.9.2-beta.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.1.2",
|
|
42
|
-
"@abi-software/map-utilities": "^1.6.1-beta.
|
|
42
|
+
"@abi-software/map-utilities": "^1.6.1-beta.5",
|
|
43
43
|
"@abi-software/svg-sprite": "^1.0.1",
|
|
44
44
|
"@element-plus/icons-vue": "^2.3.1",
|
|
45
45
|
"algoliasearch": "^4.10.5",
|
package/src/App.vue
CHANGED
|
@@ -210,14 +210,16 @@ export default {
|
|
|
210
210
|
action: function (action) {
|
|
211
211
|
console.log('action fired: ', action)
|
|
212
212
|
let facets = [];
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
213
|
+
if (action.labels) {
|
|
214
|
+
facets.push(
|
|
215
|
+
...action.labels.map(val => ({
|
|
216
|
+
facet: capitalise(val),
|
|
217
|
+
term: "Anatomical structure",
|
|
218
|
+
facetPropPath: "anatomy.organ.category.name",
|
|
219
|
+
}))
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
if (this.$refs.sideBar && facets?.length) {
|
|
221
223
|
console.log('openSearch', facets)
|
|
222
224
|
this.$refs.sideBar.openSearch(facets, "");
|
|
223
225
|
}
|
|
@@ -246,9 +246,6 @@ export default {
|
|
|
246
246
|
this.initLoading = false;
|
|
247
247
|
this.numberOfHits = this.results.length;
|
|
248
248
|
// knowledge is from the neuron click if there is 'ready' property
|
|
249
|
-
if (this.numberOfHits === 1 && !('ready' in this.results[0])) {
|
|
250
|
-
this.onConnectivityCollapseChange(this.results[0]);
|
|
251
|
-
}
|
|
252
249
|
if (this.numberOfHits > 0 && ('ready' in this.results[0])) {
|
|
253
250
|
this.$refs.filtersRef.checkShowAllBoxes();
|
|
254
251
|
this.searchInput = '';
|
|
@@ -263,9 +260,12 @@ export default {
|
|
|
263
260
|
JSON.stringify(newVal) !== JSON.stringify(oldVal) &&
|
|
264
261
|
newVal.length === 1 && newVal[0].ready
|
|
265
262
|
) {
|
|
266
|
-
|
|
267
|
-
// or two different maps in split view, do not collapse
|
|
263
|
+
const hasValidFacet = this.filter.some(f => f.facet !== "Show all");
|
|
268
264
|
if (
|
|
265
|
+
// card should not be expanded if only one entry and from neuron click
|
|
266
|
+
(this.numberOfHits === 1 && !this.searchInput && !hasValidFacet)||
|
|
267
|
+
// if the changed property is connectivity source,
|
|
268
|
+
// or two different maps in split view, do not collapse
|
|
269
269
|
(
|
|
270
270
|
newVal[0].connectivitySource !== oldVal[0].connectivitySource ||
|
|
271
271
|
newVal[0].mapId !== oldVal[0].mapId
|
|
@@ -381,8 +381,20 @@ export default {
|
|
|
381
381
|
// Show not found filter items warning message
|
|
382
382
|
notFoundItems.forEach((notFoundItem) => {
|
|
383
383
|
const itemLabel = notFoundItem.tagLabel || notFoundItem.facet;
|
|
384
|
+
const itemLabelLowerCase = itemLabel.charAt(0).toLowerCase() + itemLabel.slice(1);
|
|
385
|
+
let message = '';
|
|
386
|
+
if (notFoundItem.term.toLowerCase() === 'origin') {
|
|
387
|
+
message = `There are no neuron populations beginning at <strong>${itemLabelLowerCase}</strong>.`;
|
|
388
|
+
} else if (notFoundItem.term.toLowerCase() === 'via') {
|
|
389
|
+
message = `There are no neuron populations that run through <strong>${itemLabelLowerCase}</strong>.`;
|
|
390
|
+
} else if (notFoundItem.term.toLowerCase() === 'destination') {
|
|
391
|
+
message = `There are no neuron populations terminating at <strong>${itemLabelLowerCase}</strong>.`;
|
|
392
|
+
} else {
|
|
393
|
+
message = `There are no neuron populations beginning, terminating, or running through <strong>${itemLabelLowerCase}</strong>.`
|
|
394
|
+
}
|
|
384
395
|
Message({
|
|
385
|
-
|
|
396
|
+
dangerouslyUseHTMLString: true,
|
|
397
|
+
message: message,
|
|
386
398
|
appendTo: this.$el,
|
|
387
399
|
showClose: true,
|
|
388
400
|
offset: 113,
|
|
@@ -132,7 +132,7 @@ export default {
|
|
|
132
132
|
Input,
|
|
133
133
|
Pagination
|
|
134
134
|
},
|
|
135
|
-
name: '
|
|
135
|
+
name: 'DatasetExplorer',
|
|
136
136
|
props: {
|
|
137
137
|
visible: {
|
|
138
138
|
type: Boolean,
|
|
@@ -430,7 +430,7 @@ export default {
|
|
|
430
430
|
? element['abi-contextual-information']
|
|
431
431
|
: undefined,
|
|
432
432
|
segmentation: element['mbf-segmentation'],
|
|
433
|
-
simulation: element['abi-simulation-file'],
|
|
433
|
+
simulation: element['abi-simulation-omex-file'] ? element['abi-simulation-omex-file'] : element['abi-simulation-file'],
|
|
434
434
|
additionalLinks: element.additionalLinks,
|
|
435
435
|
detailsReady: true,
|
|
436
436
|
})
|
|
@@ -322,26 +322,67 @@ export default {
|
|
|
322
322
|
}
|
|
323
323
|
},
|
|
324
324
|
createSimulationItems: function () {
|
|
325
|
-
if (this.entry.simulation
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
325
|
+
if (this.entry.simulation) {
|
|
326
|
+
this.entry.simulation.forEach((simulation) => {
|
|
327
|
+
if (simulation.additional_mimetype.name === "application/x.vnd.abi.simulation+json") {
|
|
328
|
+
let action = {
|
|
329
|
+
label: undefined,
|
|
330
|
+
apiLocation: this.envVars.API_LOCATION,
|
|
331
|
+
s3uri: this.entry.s3uri,
|
|
332
|
+
version: this.datasetVersion,
|
|
333
|
+
title: 'View simulation',
|
|
334
|
+
type: 'Simulation',
|
|
335
|
+
name: this.entry.name,
|
|
336
|
+
description: this.entry.description,
|
|
337
|
+
discoverId: this.datasetId,
|
|
338
|
+
dataset: `${this.envVars.ROOT_URL}/datasets/${this.datasetId}?type=dataset`,
|
|
339
|
+
}
|
|
340
|
+
this.items['Simulations'].push({
|
|
341
|
+
id: 'simulation',
|
|
342
|
+
title: ' ',
|
|
343
|
+
type: 'Simulation',
|
|
344
|
+
hideType: true,
|
|
345
|
+
hideTitle: true,
|
|
346
|
+
userData: action,
|
|
347
|
+
})
|
|
348
|
+
} else {
|
|
349
|
+
const filePath = simulation.dataset.path
|
|
350
|
+
const id = simulation.identifier
|
|
351
|
+
const thumbnail = this.getThumbnailForPlot(
|
|
352
|
+
simulation,
|
|
353
|
+
this.entry.thumbnails
|
|
354
|
+
)
|
|
355
|
+
let thumbnailURL = undefined
|
|
356
|
+
let mimetype = ''
|
|
357
|
+
if (thumbnail) {
|
|
358
|
+
thumbnailURL = this.getImageURL(this.envVars.API_LOCATION, {
|
|
359
|
+
id,
|
|
360
|
+
prefix: this.getS3Prefix(),
|
|
361
|
+
file_path: thumbnail.dataset.path,
|
|
362
|
+
s3Bucket: this.s3Bucket,
|
|
363
|
+
})
|
|
364
|
+
mimetype = thumbnail.mimetype.name
|
|
365
|
+
}
|
|
366
|
+
const resource = `${this.envVars.API_LOCATION}s3-resource/${this.getS3Prefix()}files/${filePath}${this.getS3Args()}`
|
|
367
|
+
let action = {
|
|
368
|
+
label: capitalise(this.label),
|
|
369
|
+
resource: resource,
|
|
370
|
+
s3uri: this.entry.s3uri,
|
|
371
|
+
title: 'View simulation',
|
|
372
|
+
type: 'Simulation',
|
|
373
|
+
discoverId: this.discoverId,
|
|
374
|
+
version: this.datasetVersion,
|
|
375
|
+
}
|
|
376
|
+
this.items['Simulations'].push({
|
|
377
|
+
id,
|
|
378
|
+
title: baseName(filePath),
|
|
379
|
+
type: 'Simulation',
|
|
380
|
+
thumbnail: thumbnailURL,
|
|
381
|
+
userData: action,
|
|
382
|
+
hideType: true,
|
|
383
|
+
mimetype,
|
|
384
|
+
})
|
|
385
|
+
}
|
|
345
386
|
})
|
|
346
387
|
}
|
|
347
388
|
},
|
|
@@ -662,7 +662,7 @@ export default {
|
|
|
662
662
|
clearTimeout(this.filterTimeout);
|
|
663
663
|
}
|
|
664
664
|
|
|
665
|
-
this.$emit('loading', true) // let
|
|
665
|
+
this.$emit('loading', true) // let dataset explorer wait for the requests
|
|
666
666
|
this.setCascader(filterKeys) //update our cascader v-model if we modified the event
|
|
667
667
|
|
|
668
668
|
this.filterTimeout = setTimeout(() => {
|
|
@@ -1152,6 +1152,7 @@ export default {
|
|
|
1152
1152
|
white-space: nowrap;
|
|
1153
1153
|
overflow: hidden;
|
|
1154
1154
|
text-overflow: ellipsis;
|
|
1155
|
+
line-height: 1.2;
|
|
1155
1156
|
}
|
|
1156
1157
|
|
|
1157
1158
|
.connectivity-tag::first-letter,
|
|
@@ -1172,6 +1173,12 @@ export default {
|
|
|
1172
1173
|
gap: 4px;
|
|
1173
1174
|
}
|
|
1174
1175
|
|
|
1176
|
+
:deep(.connectivity-tag .el-tag__content) {
|
|
1177
|
+
max-width: 100%;
|
|
1178
|
+
overflow: hidden;
|
|
1179
|
+
text-overflow: ellipsis;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1175
1182
|
.el-tag {
|
|
1176
1183
|
.cascader-tag &,
|
|
1177
1184
|
.el-tags-container & {
|
|
@@ -1180,6 +1187,9 @@ export default {
|
|
|
1180
1187
|
color: #303133 !important;
|
|
1181
1188
|
background-color: #fff;
|
|
1182
1189
|
border-color: #dcdfe6 !important;
|
|
1190
|
+
width: auto;
|
|
1191
|
+
max-width: 100%;
|
|
1192
|
+
justify-content: flex-start;
|
|
1183
1193
|
}
|
|
1184
1194
|
}
|
|
1185
1195
|
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
/>
|
|
65
65
|
</template>
|
|
66
66
|
<template v-else>
|
|
67
|
-
<
|
|
67
|
+
<DatasetExplorer
|
|
68
68
|
class="sidebar-content-container"
|
|
69
69
|
v-show="tab.id === activeTabId"
|
|
70
70
|
:contextCardEntry="tab.contextCard"
|
|
@@ -88,7 +88,7 @@ import {
|
|
|
88
88
|
} from '@element-plus/icons-vue'
|
|
89
89
|
/* eslint-disable no-alert, no-console */
|
|
90
90
|
import { ElDrawer as Drawer, ElIcon as Icon } from 'element-plus'
|
|
91
|
-
import
|
|
91
|
+
import DatasetExplorer from './DatasetExplorer.vue'
|
|
92
92
|
import EventBus from './EventBus.js'
|
|
93
93
|
import Tabs from './Tabs.vue'
|
|
94
94
|
import AnnotationTool from './AnnotationTool.vue'
|
|
@@ -99,7 +99,7 @@ import ConnectivityExplorer from './ConnectivityExplorer.vue'
|
|
|
99
99
|
*/
|
|
100
100
|
export default {
|
|
101
101
|
components: {
|
|
102
|
-
|
|
102
|
+
DatasetExplorer,
|
|
103
103
|
Tabs,
|
|
104
104
|
ElIconArrowLeft,
|
|
105
105
|
ElIconArrowRight,
|
package/src/components.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ declare module 'vue' {
|
|
|
13
13
|
ConnectivityExplorer: typeof import('./components/ConnectivityExplorer.vue')['default']
|
|
14
14
|
ConnectivityInfo: typeof import('./components/ConnectivityInfo.vue')['default']
|
|
15
15
|
DatasetCard: typeof import('./components/DatasetCard.vue')['default']
|
|
16
|
+
DatasetExplorer: typeof import('./components/DatasetExplorer.vue')['default']
|
|
16
17
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
17
18
|
ElCard: typeof import('element-plus/es')['ElCard']
|
|
18
19
|
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
@@ -44,7 +45,6 @@ declare module 'vue' {
|
|
|
44
45
|
SearchFilters: typeof import('./components/SearchFilters.vue')['default']
|
|
45
46
|
SearchHistory: typeof import('./components/SearchHistory.vue')['default']
|
|
46
47
|
SideBar: typeof import('./components/SideBar.vue')['default']
|
|
47
|
-
SidebarContent: typeof import('./components/SidebarContent.vue')['default']
|
|
48
48
|
Tabs: typeof import('./components/Tabs.vue')['default']
|
|
49
49
|
}
|
|
50
50
|
export interface ComponentCustomProperties {
|