@abi-software/map-side-bar 2.18.0 → 2.19.1-demo.0
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/.postcssrc.json +5 -5
- package/README.md +8 -9
- package/cypress.config.js +6 -7
- package/dist/map-side-bar.js +6890 -6026
- package/dist/map-side-bar.umd.cjs +65 -62
- package/dist/style.css +1 -1
- package/eslint.config.js +44 -9
- package/package.json +10 -3
- package/reporter-config.json +1 -1
- package/src/App.vue +89 -80
- package/src/algolia/algolia.js +173 -167
- package/src/algolia/utils.js +34 -38
- package/src/assets/_variables.scss +12 -10
- package/src/assets/connectivity-explorer.scss +1 -1
- package/src/assets/fonts.scss +0 -1
- package/src/assets/searchPopover.scss +1 -2
- package/src/components/AnnotationTool.vue +9 -32
- package/src/components/BadgesGroup.vue +29 -32
- package/src/components/CellCard.vue +992 -0
- package/src/components/CellCardExplorer.vue +879 -0
- package/src/components/ConnectivityCard.vue +22 -19
- package/src/components/ConnectivityExplorer.vue +109 -130
- package/src/components/ConnectivityInfo.vue +142 -171
- package/src/components/ContributorItem.vue +15 -11
- package/src/components/DatasetCard.vue +166 -201
- package/src/components/DatasetExplorer.vue +160 -201
- package/src/components/ImageGallery.vue +35 -36
- package/src/components/SearchFilters.vue +384 -407
- package/src/components/SearchHistory.vue +69 -103
- package/src/components/SideBar.vue +186 -94
- package/src/components/Tabs.vue +25 -21
- package/src/components/icons/IconOpenExternal.vue +23 -0
- package/src/components/index.js +3 -5
- package/src/components/species-map.js +7 -7
- package/src/components.d.ts +3 -0
- package/src/exampleConnectivityInput.js +310 -318
- package/src/main.js +6 -6
- package/src/mixins/S3Bucket.vue +10 -13
- package/src/utils/common.js +59 -0
- package/vite.config.js +62 -61
- package/vuese-generator.js +47 -55
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
@tabClosed="tabClosed"
|
|
30
30
|
@trackEvent="trackEvent"
|
|
31
31
|
/>
|
|
32
|
-
<template v-for="tab in tabs" key="tab.id">
|
|
32
|
+
<template v-for="tab in tabs" :key="tab.id">
|
|
33
33
|
<template v-if="tab.type === 'annotation'">
|
|
34
34
|
<AnnotationTool
|
|
35
35
|
:ref="'annotationTab_' + tab.id"
|
|
@@ -65,6 +65,20 @@
|
|
|
65
65
|
@connectivity-item-close="onConnectivityItemClose"
|
|
66
66
|
/>
|
|
67
67
|
</template>
|
|
68
|
+
<template v-else-if="tab.type === 'cellCardExplorer' && showCellCards">
|
|
69
|
+
<CellCardExplorer
|
|
70
|
+
:ref="'cellCardExplorerTab_' + tab.id"
|
|
71
|
+
class="sidebar-content-container"
|
|
72
|
+
v-show="tab.id === activeTabId"
|
|
73
|
+
:envVars="envVars"
|
|
74
|
+
:activeSpecies="activeSpeciesForEntries"
|
|
75
|
+
@search-changed="searchChanged(tab.id, $event)"
|
|
76
|
+
@dataset-search="openDatasetSearchFromCellCard($event)"
|
|
77
|
+
@connectivity-search="openConnectivitySearch($event.facets, $event.query)"
|
|
78
|
+
@soma-location-hovered="showSomaLocation"
|
|
79
|
+
@soma-locations-ready="onSomaLocationsReady"
|
|
80
|
+
/>
|
|
81
|
+
</template>
|
|
68
82
|
<template v-else>
|
|
69
83
|
<DatasetExplorer
|
|
70
84
|
class="sidebar-content-container"
|
|
@@ -87,15 +101,14 @@
|
|
|
87
101
|
import {
|
|
88
102
|
ArrowLeft as ElIconArrowLeft,
|
|
89
103
|
ArrowRight as ElIconArrowRight,
|
|
90
|
-
} from '@element-plus/icons-vue'
|
|
91
|
-
|
|
92
|
-
import
|
|
93
|
-
import
|
|
94
|
-
import
|
|
95
|
-
import
|
|
96
|
-
import
|
|
97
|
-
import
|
|
98
|
-
import { removeShowAllFacets } from '../algolia/utils.js'
|
|
104
|
+
} from '@element-plus/icons-vue';
|
|
105
|
+
import DatasetExplorer from './DatasetExplorer.vue';
|
|
106
|
+
import EventBus from './EventBus.js';
|
|
107
|
+
import Tabs from './Tabs.vue';
|
|
108
|
+
import AnnotationTool from './AnnotationTool.vue';
|
|
109
|
+
import ConnectivityExplorer from './ConnectivityExplorer.vue';
|
|
110
|
+
import CellCardExplorer from './CellCardExplorer.vue';
|
|
111
|
+
import { removeShowAllFacets } from '../algolia/utils.js';
|
|
99
112
|
|
|
100
113
|
/**
|
|
101
114
|
* Aims to provide a sidebar for searching capability for SPARC portal.
|
|
@@ -106,19 +119,19 @@ export default {
|
|
|
106
119
|
Tabs,
|
|
107
120
|
ElIconArrowLeft,
|
|
108
121
|
ElIconArrowRight,
|
|
109
|
-
Drawer,
|
|
110
|
-
Icon,
|
|
111
122
|
AnnotationTool,
|
|
112
123
|
ConnectivityExplorer,
|
|
124
|
+
CellCardExplorer,
|
|
113
125
|
},
|
|
114
126
|
name: 'SideBar',
|
|
115
127
|
props: {
|
|
116
128
|
tabs: {
|
|
117
129
|
type: Array,
|
|
118
|
-
default: [
|
|
130
|
+
default: () => [
|
|
119
131
|
{ title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
|
|
120
132
|
{ title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
|
|
121
133
|
{ title: 'Annotation', id: 3, type: 'annotation', closable: true },
|
|
134
|
+
{ title: 'Cell Card Explorer', id: 4, type: 'cellCardExplorer', closable: false },
|
|
122
135
|
],
|
|
123
136
|
},
|
|
124
137
|
/**
|
|
@@ -149,32 +162,32 @@ export default {
|
|
|
149
162
|
*/
|
|
150
163
|
connectivityEntry: {
|
|
151
164
|
type: Array,
|
|
152
|
-
default: [],
|
|
165
|
+
default: () => [],
|
|
153
166
|
},
|
|
154
167
|
/**
|
|
155
168
|
* The annotation data to show in sidebar.
|
|
156
169
|
*/
|
|
157
170
|
annotationEntry: {
|
|
158
171
|
type: Array,
|
|
159
|
-
default: [],
|
|
172
|
+
default: () => [],
|
|
160
173
|
},
|
|
161
174
|
createData: {
|
|
162
175
|
type: Object,
|
|
163
|
-
default: {
|
|
176
|
+
default: () => ({
|
|
164
177
|
toBeConfirmed: false,
|
|
165
178
|
points: [],
|
|
166
|
-
shape:
|
|
179
|
+
shape: '',
|
|
167
180
|
x: 0,
|
|
168
181
|
y: 0,
|
|
169
|
-
},
|
|
182
|
+
}),
|
|
170
183
|
},
|
|
171
184
|
connectivityKnowledge: {
|
|
172
185
|
type: Array,
|
|
173
|
-
default: [],
|
|
186
|
+
default: () => [],
|
|
174
187
|
},
|
|
175
188
|
filterOptions: {
|
|
176
189
|
type: Array,
|
|
177
|
-
default: [],
|
|
190
|
+
default: () => [],
|
|
178
191
|
},
|
|
179
192
|
showVisibilityFilter: {
|
|
180
193
|
type: Boolean,
|
|
@@ -184,20 +197,29 @@ export default {
|
|
|
184
197
|
type: Boolean,
|
|
185
198
|
default: false,
|
|
186
199
|
},
|
|
200
|
+
showCellCards: {
|
|
201
|
+
type: Boolean,
|
|
202
|
+
default: false,
|
|
203
|
+
},
|
|
187
204
|
},
|
|
188
205
|
data: function () {
|
|
189
206
|
return {
|
|
190
207
|
drawerOpen: false,
|
|
191
208
|
availableAnatomyFacets: [],
|
|
192
209
|
activeTabId: 1,
|
|
193
|
-
activeAnnotationData: { tabType:
|
|
194
|
-
activeConnectivityData: { tabType:
|
|
210
|
+
activeAnnotationData: { tabType: 'annotation' },
|
|
211
|
+
activeConnectivityData: { tabType: 'connectivity' },
|
|
212
|
+
activeSpeciesForEntries: [],
|
|
195
213
|
state: {
|
|
196
214
|
dataset: {
|
|
197
215
|
search: '',
|
|
198
216
|
filters: [],
|
|
199
217
|
},
|
|
200
|
-
connectivity:
|
|
218
|
+
connectivity: {
|
|
219
|
+
search: '',
|
|
220
|
+
filters: [],
|
|
221
|
+
},
|
|
222
|
+
cellCards: {
|
|
201
223
|
search: '',
|
|
202
224
|
filters: [],
|
|
203
225
|
},
|
|
@@ -205,11 +227,11 @@ export default {
|
|
|
205
227
|
annotationEntries: [],
|
|
206
228
|
activeTabId: this.activeTabId,
|
|
207
229
|
},
|
|
208
|
-
}
|
|
230
|
+
};
|
|
209
231
|
},
|
|
210
232
|
methods: {
|
|
211
233
|
onConnectivityCollapseChange: function (data) {
|
|
212
|
-
this.$emit('connectivity-collapse-change', data)
|
|
234
|
+
this.$emit('connectivity-collapse-change', data);
|
|
213
235
|
},
|
|
214
236
|
/**
|
|
215
237
|
* This event is emitted when
|
|
@@ -224,7 +246,7 @@ export default {
|
|
|
224
246
|
* @arg data
|
|
225
247
|
*/
|
|
226
248
|
hoverChanged: function (id, data) {
|
|
227
|
-
this.$emit('hover-changed', {...data,
|
|
249
|
+
this.$emit('hover-changed', { ...data, tabId: id });
|
|
228
250
|
|
|
229
251
|
const activeTabType = this.getActiveTabTypeById(id);
|
|
230
252
|
// save the last highlighted data for connectivity and annotation tabs
|
|
@@ -235,6 +257,16 @@ export default {
|
|
|
235
257
|
this.activeAnnotationData = data;
|
|
236
258
|
}
|
|
237
259
|
},
|
|
260
|
+
/**
|
|
261
|
+
* This event is emitted when the mouse hover on or off a soma location in cell card explorer.
|
|
262
|
+
* @param name Soma location
|
|
263
|
+
*/
|
|
264
|
+
showSomaLocation: function (name) {
|
|
265
|
+
this.$emit('soma-location-hovered', name);
|
|
266
|
+
},
|
|
267
|
+
onSomaLocationsReady: function (somaLocations) {
|
|
268
|
+
this.$emit('soma-locations-ready', somaLocations);
|
|
269
|
+
},
|
|
238
270
|
/**
|
|
239
271
|
* This event is emitted when the show connectivity button is clicked.
|
|
240
272
|
* @arg featureIds
|
|
@@ -261,21 +293,21 @@ export default {
|
|
|
261
293
|
* @arg `obj` {data, id}
|
|
262
294
|
*/
|
|
263
295
|
searchChanged: function (id, data) {
|
|
264
|
-
this.$emit('search-changed', { ...data, tabId: id })
|
|
296
|
+
this.$emit('search-changed', { ...data, tabId: id });
|
|
265
297
|
},
|
|
266
298
|
/**
|
|
267
299
|
* The function to close sidebar.
|
|
268
300
|
* @public
|
|
269
301
|
*/
|
|
270
302
|
close: function () {
|
|
271
|
-
this.drawerOpen = false
|
|
303
|
+
this.drawerOpen = false;
|
|
272
304
|
},
|
|
273
305
|
/**
|
|
274
306
|
* The function to toggle (open and close) sidebar.
|
|
275
307
|
* @public
|
|
276
308
|
*/
|
|
277
309
|
toggleDrawer: function () {
|
|
278
|
-
this.drawerOpen = !this.drawerOpen
|
|
310
|
+
this.drawerOpen = !this.drawerOpen;
|
|
279
311
|
},
|
|
280
312
|
openConnectivitySearch: function (facets, query) {
|
|
281
313
|
this.drawerOpen = true;
|
|
@@ -283,29 +315,66 @@ export default {
|
|
|
283
315
|
this.$nextTick(() => {
|
|
284
316
|
const connectivityExplorerTabRef = this.getTabRef(undefined, 'connectivityExplorer', true);
|
|
285
317
|
connectivityExplorerTabRef.openSearch(facets, query);
|
|
286
|
-
})
|
|
318
|
+
});
|
|
287
319
|
},
|
|
288
320
|
resetConnectivitySearch: function () {
|
|
289
321
|
this.$nextTick(() => {
|
|
290
322
|
const connectivityExplorerTabRef = this.getTabRef(undefined, 'connectivityExplorer', false);
|
|
291
323
|
connectivityExplorerTabRef.resetSearchIfNoActiveSearch();
|
|
292
|
-
})
|
|
324
|
+
});
|
|
293
325
|
},
|
|
294
326
|
openSearch: function (facets, query) {
|
|
295
|
-
this.drawerOpen = true
|
|
327
|
+
this.drawerOpen = true;
|
|
296
328
|
// Because refs are in v-for, nextTick is needed here
|
|
297
329
|
this.$nextTick(() => {
|
|
298
330
|
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
299
331
|
datasetExplorerTabRef.openSearch(facets, query);
|
|
300
|
-
})
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
openCellCardExplorerSearch: function (filters, query) {
|
|
335
|
+
this.drawerOpen = true;
|
|
336
|
+
// Because refs are in v-for, nextTick is needed here
|
|
337
|
+
this.$nextTick(() => {
|
|
338
|
+
const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer', true);
|
|
339
|
+
if (cellCardExplorerTabRef && typeof cellCardExplorerTabRef.openSearch === 'function') {
|
|
340
|
+
cellCardExplorerTabRef.openSearch(filters, query);
|
|
341
|
+
}
|
|
342
|
+
});
|
|
343
|
+
},
|
|
344
|
+
openDatasetSearchFromCellCard: function (payload) {
|
|
345
|
+
if (!payload || typeof payload !== 'object') {
|
|
346
|
+
this.openSearch([], payload);
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
const facets = [];
|
|
351
|
+
if (payload.species) {
|
|
352
|
+
facets.push({
|
|
353
|
+
facet: payload.species,
|
|
354
|
+
term: 'Species',
|
|
355
|
+
facetPropPath: 'organisms.primary.species.name',
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (payload.location) {
|
|
360
|
+
facets.push({
|
|
361
|
+
facet: payload.location,
|
|
362
|
+
term: 'Anatomical structure',
|
|
363
|
+
facetPropPath: 'anatomy.organ.category.name',
|
|
364
|
+
AND: true,
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
this.openSearch(facets, '');
|
|
301
369
|
},
|
|
302
370
|
/**
|
|
303
371
|
* Get the ref id of the tab by id and type.
|
|
304
372
|
*/
|
|
305
373
|
getTabRef: function (id, type, switchTab = false) {
|
|
306
374
|
const matchedTab = this.tabEntries.filter((tabEntry) => {
|
|
307
|
-
return (
|
|
308
|
-
(type === undefined || tabEntry.type === type)
|
|
375
|
+
return (
|
|
376
|
+
(id === undefined || tabEntry.id === id) && (type === undefined || tabEntry.type === type)
|
|
377
|
+
);
|
|
309
378
|
});
|
|
310
379
|
const tabInfo = matchedTab.length ? matchedTab : this.tabEntries;
|
|
311
380
|
const tabRef = tabInfo[0].type + 'Tab_' + tabInfo[0].id;
|
|
@@ -323,40 +392,38 @@ export default {
|
|
|
323
392
|
*/
|
|
324
393
|
addFilter: function (filter) {
|
|
325
394
|
if (filter) {
|
|
326
|
-
this.drawerOpen = true
|
|
395
|
+
this.drawerOpen = true;
|
|
327
396
|
let filterToAdd = filter;
|
|
328
397
|
if (Array.isArray(filter)) {
|
|
329
|
-
filterToAdd.forEach(item => item.AND = true);
|
|
398
|
+
filterToAdd.forEach((item) => (item.AND = true));
|
|
330
399
|
} else {
|
|
331
|
-
filter.AND = true // When we add a filter external, it is currently only with an AND boolean
|
|
332
|
-
filterToAdd = [filter]
|
|
400
|
+
filter.AND = true; // When we add a filter external, it is currently only with an AND boolean
|
|
401
|
+
filterToAdd = [filter];
|
|
333
402
|
}
|
|
334
403
|
// Because refs are in v-for, nextTick is needed here
|
|
335
404
|
this.$nextTick(() => {
|
|
336
405
|
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
337
|
-
datasetExplorerTabRef.addFilter(filterToAdd)
|
|
338
|
-
})
|
|
406
|
+
datasetExplorerTabRef.addFilter(filterToAdd);
|
|
407
|
+
});
|
|
339
408
|
}
|
|
340
409
|
},
|
|
341
410
|
openNeuronSearch: function (neuron) {
|
|
342
|
-
this.drawerOpen = true
|
|
411
|
+
this.drawerOpen = true;
|
|
343
412
|
// Because refs are in v-for, nextTick is needed here
|
|
344
413
|
this.$nextTick(() => {
|
|
345
414
|
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer', true);
|
|
346
|
-
datasetExplorerTabRef.openSearch(
|
|
347
|
-
'',
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
)
|
|
352
|
-
})
|
|
415
|
+
datasetExplorerTabRef.openSearch('', undefined, 'scicrunch-query-string/', {
|
|
416
|
+
field: '*organ.curie',
|
|
417
|
+
curie: neuron,
|
|
418
|
+
});
|
|
419
|
+
});
|
|
353
420
|
},
|
|
354
421
|
getAlgoliaFacets: async function () {
|
|
355
422
|
const datasetExplorerTabRef = this.getTabRef(undefined, 'datasetExplorer');
|
|
356
|
-
return await datasetExplorerTabRef.getAlgoliaFacets()
|
|
423
|
+
return await datasetExplorerTabRef.getAlgoliaFacets();
|
|
357
424
|
},
|
|
358
425
|
setDrawerOpen: function (value = true) {
|
|
359
|
-
this.drawerOpen = value
|
|
426
|
+
this.drawerOpen = value;
|
|
360
427
|
},
|
|
361
428
|
setActiveTab: function (tab) {
|
|
362
429
|
const matchedTab = this.tabs.filter((tabEntry) => {
|
|
@@ -382,10 +449,10 @@ export default {
|
|
|
382
449
|
if (connectivityExplorerTabRef && !connectivityExplorerTabRef.expanded) {
|
|
383
450
|
data = { tabType: 'connectivity' };
|
|
384
451
|
} else {
|
|
385
|
-
data = {...this.activeConnectivityData};
|
|
452
|
+
data = { ...this.activeConnectivityData };
|
|
386
453
|
}
|
|
387
454
|
} else if (tab.type === 'annotation') {
|
|
388
|
-
data = {...this.activeAnnotationData};
|
|
455
|
+
data = { ...this.activeAnnotationData };
|
|
389
456
|
} else {
|
|
390
457
|
// switching to dataset explorer tab will not highlight
|
|
391
458
|
// the highlight is from the last tab
|
|
@@ -393,7 +460,7 @@ export default {
|
|
|
393
460
|
}
|
|
394
461
|
|
|
395
462
|
if (data) {
|
|
396
|
-
this.$emit('hover-changed', {...data,
|
|
463
|
+
this.$emit('hover-changed', { ...data, tabId: tab.id });
|
|
397
464
|
}
|
|
398
465
|
},
|
|
399
466
|
tabClicked: function (tab) {
|
|
@@ -415,7 +482,7 @@ export default {
|
|
|
415
482
|
* Store available anatomy facets data for connectivity list component
|
|
416
483
|
*/
|
|
417
484
|
storeAvailableAnatomyFacets: function (availableAnatomyFacets) {
|
|
418
|
-
localStorage.setItem('available-anatomy-facets', JSON.stringify(availableAnatomyFacets))
|
|
485
|
+
localStorage.setItem('available-anatomy-facets', JSON.stringify(availableAnatomyFacets));
|
|
419
486
|
},
|
|
420
487
|
closeConnectivity: function () {
|
|
421
488
|
EventBus.emit('close-connectivity');
|
|
@@ -437,6 +504,13 @@ export default {
|
|
|
437
504
|
this.state.connectivity.filters = connectivityExplorerTabRef.getFilters();
|
|
438
505
|
}
|
|
439
506
|
|
|
507
|
+
// Update cell card explorer state if available
|
|
508
|
+
const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer');
|
|
509
|
+
if (cellCardExplorerTabRef) {
|
|
510
|
+
this.state.cellCards.search = cellCardExplorerTabRef.getSearch();
|
|
511
|
+
this.state.cellCards.filters = cellCardExplorerTabRef.getFilters();
|
|
512
|
+
}
|
|
513
|
+
|
|
440
514
|
// Update connectivity entries if available
|
|
441
515
|
if (this.connectivityEntry && this.connectivityEntry.length > 0) {
|
|
442
516
|
this.state.connectivityEntries = this.connectivityEntry.map((entry) => entry.id);
|
|
@@ -466,11 +540,15 @@ export default {
|
|
|
466
540
|
setState: function (state) {
|
|
467
541
|
// if state is not provided or formatted incorrectly, do nothing
|
|
468
542
|
if (!state || !state.dataset || !state.connectivity) return;
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
const
|
|
473
|
-
const
|
|
543
|
+
// Create a deep copy while preserving the original state structure for future extensibility
|
|
544
|
+
const newState = JSON.parse(JSON.stringify(state));
|
|
545
|
+
this.state = { ...this.state, ...newState };
|
|
546
|
+
const datasetFilters = this.state.dataset.filters;
|
|
547
|
+
const connectivityFilters = this.state.connectivity.filters;
|
|
548
|
+
const datasetSearch = this.state.dataset.search;
|
|
549
|
+
const connectivitySearch = this.state.connectivity.search;
|
|
550
|
+
const cellCardFilters = this.state.cellCards.filters || [];
|
|
551
|
+
const cellCardSearch = this.state.cellCards.search || '';
|
|
474
552
|
|
|
475
553
|
if (datasetFilters.length || datasetSearch) {
|
|
476
554
|
this.openSearch(datasetFilters, datasetSearch);
|
|
@@ -480,6 +558,10 @@ export default {
|
|
|
480
558
|
this.openConnectivitySearch(connectivityFilters, connectivitySearch);
|
|
481
559
|
}
|
|
482
560
|
|
|
561
|
+
if (cellCardFilters.length || cellCardSearch) {
|
|
562
|
+
this.openCellCardExplorerSearch(cellCardFilters, cellCardSearch);
|
|
563
|
+
}
|
|
564
|
+
|
|
483
565
|
if (state.activeTabId) {
|
|
484
566
|
this.$nextTick(() => {
|
|
485
567
|
const hasTab = this.tabEntries.find((t) => t.id === state.activeTabId);
|
|
@@ -496,29 +578,37 @@ export default {
|
|
|
496
578
|
*/
|
|
497
579
|
trackEvent: function (data) {
|
|
498
580
|
const taggingData = {
|
|
499
|
-
|
|
500
|
-
|
|
581
|
+
event: 'interaction_event',
|
|
582
|
+
location: 'map_sidebar',
|
|
501
583
|
...data,
|
|
502
584
|
};
|
|
503
585
|
this.$emit('trackEvent', taggingData);
|
|
504
|
-
}
|
|
586
|
+
},
|
|
587
|
+
/**
|
|
588
|
+
* @public
|
|
589
|
+
* Update the active species to use in filters.
|
|
590
|
+
* Used by SplitFlow component.
|
|
591
|
+
* @param activeSpecies
|
|
592
|
+
*/
|
|
593
|
+
updateActiveSpeciesForEntries: function (activeSpecies) {
|
|
594
|
+
const speciesEntries = Array.isArray(activeSpecies) ? activeSpecies : [activeSpecies];
|
|
595
|
+
this.activeSpeciesForEntries = [...new Set(speciesEntries.filter(Boolean))];
|
|
596
|
+
},
|
|
505
597
|
},
|
|
506
598
|
computed: {
|
|
507
599
|
// This should respect the information provided by the property
|
|
508
600
|
tabEntries: function () {
|
|
509
|
-
return this.tabs.filter(
|
|
510
|
-
tab
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
tab.type ===
|
|
514
|
-
|
|
515
|
-
this.annotationEntry.length > 0
|
|
516
|
-
)
|
|
601
|
+
return this.tabs.filter(
|
|
602
|
+
(tab) =>
|
|
603
|
+
tab.type === 'datasetExplorer' ||
|
|
604
|
+
tab.type === 'connectivityExplorer' ||
|
|
605
|
+
(tab.type === 'annotation' && this.annotationEntry && this.annotationEntry.length > 0) ||
|
|
606
|
+
(tab.type === 'cellCardExplorer' && this.showCellCards),
|
|
517
607
|
);
|
|
518
608
|
},
|
|
519
609
|
},
|
|
520
610
|
created: function () {
|
|
521
|
-
this.drawerOpen = this.openAtStart
|
|
611
|
+
this.drawerOpen = this.openAtStart;
|
|
522
612
|
},
|
|
523
613
|
mounted: function () {
|
|
524
614
|
EventBus.on('PopoverActionClick', (payLoad) => {
|
|
@@ -526,22 +616,22 @@ export default {
|
|
|
526
616
|
* This event is emitted when the image is clicked on or the button below the image is clicked on.
|
|
527
617
|
* @arg payLoad
|
|
528
618
|
*/
|
|
529
|
-
this.$emit('actionClick', payLoad)
|
|
530
|
-
})
|
|
619
|
+
this.$emit('actionClick', payLoad);
|
|
620
|
+
});
|
|
531
621
|
EventBus.on('number-of-datasets-for-anatomies', (payLoad) => {
|
|
532
622
|
/**
|
|
533
623
|
* This emits a object with keys as anatomy and values as number of datasets for that anatomy.
|
|
534
624
|
* @arg payload
|
|
535
625
|
*/
|
|
536
|
-
this.$emit('number-of-datasets-for-anatomies', payLoad)
|
|
537
|
-
})
|
|
626
|
+
this.$emit('number-of-datasets-for-anatomies', payLoad);
|
|
627
|
+
});
|
|
538
628
|
EventBus.on('anatomy-in-datasets', (payLoad) => {
|
|
539
|
-
|
|
629
|
+
/**
|
|
540
630
|
* This emits a lis of datasets, with the anatomy for each one. Used by flatmap for markers
|
|
541
631
|
* @arg payload
|
|
542
632
|
*/
|
|
543
|
-
this.$emit('anatomy-in-datasets', payLoad)
|
|
544
|
-
})
|
|
633
|
+
this.$emit('anatomy-in-datasets', payLoad);
|
|
634
|
+
});
|
|
545
635
|
|
|
546
636
|
EventBus.on('contextUpdate', (payLoad) => {
|
|
547
637
|
/**
|
|
@@ -549,8 +639,8 @@ export default {
|
|
|
549
639
|
* Example, context card update on first load.
|
|
550
640
|
* @arg payload
|
|
551
641
|
*/
|
|
552
|
-
this.$emit('contextUpdate', payLoad)
|
|
553
|
-
})
|
|
642
|
+
this.$emit('contextUpdate', payLoad);
|
|
643
|
+
});
|
|
554
644
|
EventBus.on('datalink-clicked', (payLoad) => {
|
|
555
645
|
/**
|
|
556
646
|
* This event is emitted
|
|
@@ -559,31 +649,33 @@ export default {
|
|
|
559
649
|
* @arg payload
|
|
560
650
|
*/
|
|
561
651
|
this.$emit('datalink-clicked', payLoad);
|
|
562
|
-
})
|
|
652
|
+
});
|
|
563
653
|
EventBus.on('onConnectivityActionClick', (payLoad) => {
|
|
564
654
|
// switch to search tab with tab id: 1
|
|
565
|
-
this.tabClicked({id: 1, type: 'datasetExplorer'});
|
|
655
|
+
this.tabClicked({ id: 1, type: 'datasetExplorer' });
|
|
566
656
|
this.$emit('actionClick', payLoad);
|
|
567
|
-
})
|
|
657
|
+
});
|
|
568
658
|
EventBus.on('connectivity-source-change', (payLoad) => {
|
|
569
659
|
this.$emit('connectivity-source-change', payLoad);
|
|
570
|
-
})
|
|
660
|
+
});
|
|
571
661
|
EventBus.on('show-connectivity-graph', (payLoad) => {
|
|
572
662
|
this.$emit('show-connectivity-graph', payLoad);
|
|
573
|
-
})
|
|
663
|
+
});
|
|
574
664
|
|
|
575
665
|
// Get available anatomy facets for the connectivity info
|
|
576
666
|
EventBus.on('available-facets', (payLoad) => {
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
667
|
+
this.availableAnatomyFacets = payLoad.find(
|
|
668
|
+
(facet) => facet.label === 'Anatomical Structure',
|
|
669
|
+
).children;
|
|
670
|
+
this.storeAvailableAnatomyFacets(this.availableAnatomyFacets);
|
|
671
|
+
});
|
|
580
672
|
|
|
581
673
|
// Event tracking
|
|
582
674
|
EventBus.on('trackEvent', (data) => {
|
|
583
675
|
this.trackEvent(data);
|
|
584
676
|
});
|
|
585
677
|
},
|
|
586
|
-
}
|
|
678
|
+
};
|
|
587
679
|
</script>
|
|
588
680
|
|
|
589
681
|
<style lang="scss" scoped>
|
|
@@ -598,7 +690,7 @@ export default {
|
|
|
598
690
|
position: relative;
|
|
599
691
|
height: 100%;
|
|
600
692
|
pointer-events: none;
|
|
601
|
-
width:600px;
|
|
693
|
+
width: 600px;
|
|
602
694
|
float: right;
|
|
603
695
|
}
|
|
604
696
|
|
|
@@ -685,12 +777,12 @@ export default {
|
|
|
685
777
|
|
|
686
778
|
<style lang="scss">
|
|
687
779
|
.side-bar {
|
|
688
|
-
--el-color-primary: #
|
|
689
|
-
--el-color-primary-light-7: #
|
|
780
|
+
--el-color-primary: #8300bf;
|
|
781
|
+
--el-color-primary-light-7: #dab3ec;
|
|
690
782
|
--el-color-primary-light-8: #e6ccf2;
|
|
691
783
|
--el-color-primary-light-9: #f3e6f9;
|
|
692
784
|
--el-color-primary-light-3: #f3e6f9;
|
|
693
|
-
--el-color-primary-dark-2: #
|
|
785
|
+
--el-color-primary-dark-2: #7600ac;
|
|
694
786
|
}
|
|
695
787
|
.el-button--primary {
|
|
696
788
|
--el-button-hover-text-color: var(--el-color-primary);
|
package/src/components/Tabs.vue
CHANGED
|
@@ -4,15 +4,11 @@
|
|
|
4
4
|
class="tab"
|
|
5
5
|
v-for="tab in tabs"
|
|
6
6
|
:key="tab.id"
|
|
7
|
-
:class="{ 'active-tab': tab.id == activeId }"
|
|
7
|
+
:class="{ 'active-tab': tab.id == activeId, 'closable-tab': tab.closable }"
|
|
8
8
|
@click="tabClicked(tab)"
|
|
9
9
|
>
|
|
10
|
-
<span class="tab-title">{{ tab.title }}
|
|
11
|
-
<el-icon
|
|
12
|
-
v-if="tab.closable"
|
|
13
|
-
@click.stop="tabClosed(tab)"
|
|
14
|
-
class="tab-close-icon"
|
|
15
|
-
>
|
|
10
|
+
<span class="tab-title">{{ tab.title }}</span>
|
|
11
|
+
<el-icon v-if="tab.closable" @click.stop="tabClosed(tab)" class="tab-close-icon">
|
|
16
12
|
<el-icon-close />
|
|
17
13
|
</el-icon>
|
|
18
14
|
</div>
|
|
@@ -20,11 +16,10 @@
|
|
|
20
16
|
</template>
|
|
21
17
|
|
|
22
18
|
<script>
|
|
23
|
-
|
|
24
|
-
import { Close as ElIconClose } from "@element-plus/icons-vue";
|
|
19
|
+
import { Close as ElIconClose } from '@element-plus/icons-vue';
|
|
25
20
|
|
|
26
21
|
export default {
|
|
27
|
-
name:
|
|
22
|
+
name: 'Tabs',
|
|
28
23
|
components: {
|
|
29
24
|
ElIconClose,
|
|
30
25
|
},
|
|
@@ -58,18 +53,18 @@ export default {
|
|
|
58
53
|
},
|
|
59
54
|
methods: {
|
|
60
55
|
tabClicked: function (tab) {
|
|
61
|
-
this.$emit(
|
|
56
|
+
this.$emit('tabClicked', { id: tab.id, type: tab.type });
|
|
62
57
|
|
|
63
58
|
// To track only direct tab click events
|
|
64
59
|
this.$emit('trackEvent', {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
60
|
+
event: 'interaction_event',
|
|
61
|
+
event_name: 'portal_maps_sidebar_open_tab',
|
|
62
|
+
category: tab.type,
|
|
63
|
+
location: 'map_sidebar_tabs',
|
|
69
64
|
});
|
|
70
65
|
},
|
|
71
66
|
tabClosed: function (tab) {
|
|
72
|
-
this.$emit(
|
|
67
|
+
this.$emit('tabClosed', { id: tab.id, type: tab.type });
|
|
73
68
|
},
|
|
74
69
|
},
|
|
75
70
|
};
|
|
@@ -103,14 +98,23 @@ export default {
|
|
|
103
98
|
.tab-title {
|
|
104
99
|
text-align: center;
|
|
105
100
|
font-size: 14px;
|
|
106
|
-
padding: 0
|
|
101
|
+
padding: 0 0.75rem;
|
|
102
|
+
|
|
103
|
+
.closable-tab & {
|
|
104
|
+
padding-right: 0.25rem;
|
|
105
|
+
}
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
.tab-close-icon {
|
|
110
|
-
width:
|
|
111
|
-
height:
|
|
112
|
-
font-size:
|
|
113
|
-
|
|
109
|
+
width: 18px !important;
|
|
110
|
+
height: 18px !important;
|
|
111
|
+
font-size: 18px !important;
|
|
112
|
+
margin-right: 4px !important;
|
|
114
113
|
color: $app-primary-color !important;
|
|
114
|
+
border-radius: 2px;
|
|
115
|
+
|
|
116
|
+
&:hover {
|
|
117
|
+
background-color: rgba($app-primary-color, 0.15) !important;
|
|
118
|
+
}
|
|
115
119
|
}
|
|
116
120
|
</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false">
|
|
3
|
+
<g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
4
|
+
<polygon
|
|
5
|
+
fill="currentColor"
|
|
6
|
+
fill-rule="nonzero"
|
|
7
|
+
transform="translate(15.500000, 8.878680) rotate(225.000000) translate(-15.500000, -8.878680)"
|
|
8
|
+
points="16.25 4.12867966 16.25 13.6286797 14.75 13.6286797 14.75 4.12867966"
|
|
9
|
+
/>
|
|
10
|
+
<polygon
|
|
11
|
+
fill="currentColor"
|
|
12
|
+
fill-rule="nonzero"
|
|
13
|
+
transform="translate(17.500000, 6.918996) rotate(225.000000) translate(-17.500000, -6.918996)"
|
|
14
|
+
points="20.9294459 3.82036868 22.058311 4.80812559 17.5 10.0176239 12.941689 4.80812559 14.0705541 3.82036868 17.5 7.739"
|
|
15
|
+
/>
|
|
16
|
+
<polygon
|
|
17
|
+
fill="currentColor"
|
|
18
|
+
fill-rule="nonzero"
|
|
19
|
+
points="11.6570511 7.25 11.6570511 8.75 5.75 8.75 5.75 16.25 15.25 16.25 15.25 11.2267933 16.75 11.2267933 16.75 17.75 4.25 17.75 4.25 7.25"
|
|
20
|
+
/>
|
|
21
|
+
</g>
|
|
22
|
+
</svg>
|
|
23
|
+
</template>
|