@abi-software/map-side-bar 2.14.8-demo.6 → 2.15.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/dist/map-side-bar.js +8573 -9630
- package/dist/map-side-bar.umd.cjs +75 -80
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +4 -11
- package/src/components/ConnectivityCard.vue +2 -2
- package/src/components/ConnectivityExplorer.vue +2 -2
- package/src/components/ConnectivityInfo.vue +205 -60
- package/src/components/SearchFilters.vue +9 -10
- package/src/components/SearchHistory.vue +15 -3
- package/src/components/SideBar.vue +7 -108
- package/src/components/Tabs.vue +6 -15
- package/src/components.d.ts +0 -3
- package/src/components/CellCard.vue +0 -994
- package/src/components/CellCardExplorer.vue +0 -882
- package/src/components/icons/IconOpenExternal.vue +0 -28
- package/src/utils/common.js +0 -71
|
@@ -65,20 +65,6 @@
|
|
|
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>
|
|
82
68
|
<template v-else>
|
|
83
69
|
<DatasetExplorer
|
|
84
70
|
class="sidebar-content-container"
|
|
@@ -109,7 +95,6 @@ import EventBus from './EventBus.js'
|
|
|
109
95
|
import Tabs from './Tabs.vue'
|
|
110
96
|
import AnnotationTool from './AnnotationTool.vue'
|
|
111
97
|
import ConnectivityExplorer from './ConnectivityExplorer.vue'
|
|
112
|
-
import CellCardExplorer from './CellCardExplorer.vue'
|
|
113
98
|
import { removeShowAllFacets } from '../algolia/utils.js'
|
|
114
99
|
|
|
115
100
|
/**
|
|
@@ -125,7 +110,6 @@ export default {
|
|
|
125
110
|
Icon,
|
|
126
111
|
AnnotationTool,
|
|
127
112
|
ConnectivityExplorer,
|
|
128
|
-
CellCardExplorer,
|
|
129
113
|
},
|
|
130
114
|
name: 'SideBar',
|
|
131
115
|
props: {
|
|
@@ -135,7 +119,6 @@ export default {
|
|
|
135
119
|
{ title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
|
|
136
120
|
{ title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
|
|
137
121
|
{ title: 'Annotation', id: 3, type: 'annotation', closable: true },
|
|
138
|
-
{ title: 'Cell Card Explorer', id: 4, type: 'cellCardExplorer', closable: false },
|
|
139
122
|
],
|
|
140
123
|
},
|
|
141
124
|
/**
|
|
@@ -201,10 +184,6 @@ export default {
|
|
|
201
184
|
type: Boolean,
|
|
202
185
|
default: false,
|
|
203
186
|
},
|
|
204
|
-
showCellCards: {
|
|
205
|
-
type: Boolean,
|
|
206
|
-
default: false,
|
|
207
|
-
},
|
|
208
187
|
},
|
|
209
188
|
data: function () {
|
|
210
189
|
return {
|
|
@@ -213,17 +192,12 @@ export default {
|
|
|
213
192
|
activeTabId: 1,
|
|
214
193
|
activeAnnotationData: { tabType: "annotation" },
|
|
215
194
|
activeConnectivityData: { tabType: "connectivity" },
|
|
216
|
-
activeSpeciesForEntries: [],
|
|
217
195
|
state: {
|
|
218
196
|
dataset: {
|
|
219
197
|
search: '',
|
|
220
198
|
filters: [],
|
|
221
199
|
},
|
|
222
|
-
connectivity:
|
|
223
|
-
search: '',
|
|
224
|
-
filters: [],
|
|
225
|
-
},
|
|
226
|
-
cellCards: {
|
|
200
|
+
connectivity: {
|
|
227
201
|
search: '',
|
|
228
202
|
filters: [],
|
|
229
203
|
},
|
|
@@ -261,16 +235,6 @@ export default {
|
|
|
261
235
|
this.activeAnnotationData = data;
|
|
262
236
|
}
|
|
263
237
|
},
|
|
264
|
-
/**
|
|
265
|
-
* This event is emitted when the mouse hover on or off a soma location in cell card explorer.
|
|
266
|
-
* @param name Soma location
|
|
267
|
-
*/
|
|
268
|
-
showSomaLocation: function (name) {
|
|
269
|
-
this.$emit('soma-location-hovered', name);
|
|
270
|
-
},
|
|
271
|
-
onSomaLocationsReady: function (somaLocations) {
|
|
272
|
-
this.$emit('soma-locations-ready', somaLocations);
|
|
273
|
-
},
|
|
274
238
|
/**
|
|
275
239
|
* This event is emitted when the show connectivity button is clicked.
|
|
276
240
|
* @arg featureIds
|
|
@@ -335,42 +299,6 @@ export default {
|
|
|
335
299
|
datasetExplorerTabRef.openSearch(facets, query);
|
|
336
300
|
})
|
|
337
301
|
},
|
|
338
|
-
openCellCardExplorerSearch: function (filters, query) {
|
|
339
|
-
this.drawerOpen = true
|
|
340
|
-
// Because refs are in v-for, nextTick is needed here
|
|
341
|
-
this.$nextTick(() => {
|
|
342
|
-
const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer', true);
|
|
343
|
-
if (cellCardExplorerTabRef && typeof cellCardExplorerTabRef.openSearch === 'function') {
|
|
344
|
-
cellCardExplorerTabRef.openSearch(filters, query);
|
|
345
|
-
}
|
|
346
|
-
})
|
|
347
|
-
},
|
|
348
|
-
openDatasetSearchFromCellCard: function (payload) {
|
|
349
|
-
if (!payload || typeof payload !== 'object') {
|
|
350
|
-
this.openSearch([], payload);
|
|
351
|
-
return;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const facets = [];
|
|
355
|
-
if (payload.species) {
|
|
356
|
-
facets.push({
|
|
357
|
-
facet: payload.species,
|
|
358
|
-
term: 'Species',
|
|
359
|
-
facetPropPath: 'organisms.primary.species.name',
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (payload.location) {
|
|
364
|
-
facets.push({
|
|
365
|
-
facet: payload.location,
|
|
366
|
-
term: 'Anatomical structure',
|
|
367
|
-
facetPropPath: 'anatomy.organ.category.name',
|
|
368
|
-
AND: true,
|
|
369
|
-
});
|
|
370
|
-
}
|
|
371
|
-
|
|
372
|
-
this.openSearch(facets, '');
|
|
373
|
-
},
|
|
374
302
|
/**
|
|
375
303
|
* Get the ref id of the tab by id and type.
|
|
376
304
|
*/
|
|
@@ -509,13 +437,6 @@ export default {
|
|
|
509
437
|
this.state.connectivity.filters = connectivityExplorerTabRef.getFilters();
|
|
510
438
|
}
|
|
511
439
|
|
|
512
|
-
// Update cell card explorer state if available
|
|
513
|
-
const cellCardExplorerTabRef = this.getTabRef(undefined, 'cellCardExplorer');
|
|
514
|
-
if (cellCardExplorerTabRef) {
|
|
515
|
-
this.state.cellCards.search = cellCardExplorerTabRef.getSearch();
|
|
516
|
-
this.state.cellCards.filters = cellCardExplorerTabRef.getFilters();
|
|
517
|
-
}
|
|
518
|
-
|
|
519
440
|
// Update connectivity entries if available
|
|
520
441
|
if (this.connectivityEntry && this.connectivityEntry.length > 0) {
|
|
521
442
|
this.state.connectivityEntries = this.connectivityEntry.map((entry) => entry.id);
|
|
@@ -545,15 +466,11 @@ export default {
|
|
|
545
466
|
setState: function (state) {
|
|
546
467
|
// if state is not provided or formatted incorrectly, do nothing
|
|
547
468
|
if (!state || !state.dataset || !state.connectivity) return;
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
const
|
|
553
|
-
const datasetSearch = this.state.dataset.search;
|
|
554
|
-
const connectivitySearch = this.state.connectivity.search;
|
|
555
|
-
const cellCardFilters = this.state.cellCards.filters || [];
|
|
556
|
-
const cellCardSearch = this.state.cellCards.search || '';
|
|
469
|
+
this.state = JSON.parse(JSON.stringify(state)); // deep copy to avoid reference issues
|
|
470
|
+
const datasetFilters = state.dataset.filters;
|
|
471
|
+
const connectivityFilters = state.connectivity.filters;
|
|
472
|
+
const datasetSearch = state.dataset.search;
|
|
473
|
+
const connectivitySearch = state.connectivity.search;
|
|
557
474
|
|
|
558
475
|
if (datasetFilters.length || datasetSearch) {
|
|
559
476
|
this.openSearch(datasetFilters, datasetSearch);
|
|
@@ -563,10 +480,6 @@ export default {
|
|
|
563
480
|
this.openConnectivitySearch(connectivityFilters, connectivitySearch);
|
|
564
481
|
}
|
|
565
482
|
|
|
566
|
-
if (cellCardFilters.length || cellCardSearch) {
|
|
567
|
-
this.openCellCardExplorerSearch(cellCardFilters, cellCardSearch);
|
|
568
|
-
}
|
|
569
|
-
|
|
570
483
|
if (state.activeTabId) {
|
|
571
484
|
this.$nextTick(() => {
|
|
572
485
|
const hasTab = this.tabEntries.find((t) => t.id === state.activeTabId);
|
|
@@ -588,17 +501,7 @@ export default {
|
|
|
588
501
|
...data,
|
|
589
502
|
};
|
|
590
503
|
this.$emit('trackEvent', taggingData);
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* @public
|
|
594
|
-
* Update the active species to use in filters.
|
|
595
|
-
* Used by SplitFlow component.
|
|
596
|
-
* @param activeSpecies
|
|
597
|
-
*/
|
|
598
|
-
updateActiveSpeciesForEntries: function (activeSpecies) {
|
|
599
|
-
const speciesEntries = Array.isArray(activeSpecies) ? activeSpecies : [activeSpecies];
|
|
600
|
-
this.activeSpeciesForEntries = [...new Set(speciesEntries.filter(Boolean))];
|
|
601
|
-
},
|
|
504
|
+
}
|
|
602
505
|
},
|
|
603
506
|
computed: {
|
|
604
507
|
// This should respect the information provided by the property
|
|
@@ -610,10 +513,6 @@ export default {
|
|
|
610
513
|
tab.type === "annotation" &&
|
|
611
514
|
this.annotationEntry &&
|
|
612
515
|
this.annotationEntry.length > 0
|
|
613
|
-
) ||
|
|
614
|
-
(
|
|
615
|
-
tab.type === "cellCardExplorer" &&
|
|
616
|
-
this.showCellCards
|
|
617
516
|
)
|
|
618
517
|
);
|
|
619
518
|
},
|
package/src/components/Tabs.vue
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
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 }"
|
|
8
8
|
@click="tabClicked(tab)"
|
|
9
9
|
>
|
|
10
10
|
<span class="tab-title">{{ tab.title }} </span>
|
|
@@ -103,23 +103,14 @@ export default {
|
|
|
103
103
|
.tab-title {
|
|
104
104
|
text-align: center;
|
|
105
105
|
font-size: 14px;
|
|
106
|
-
padding: 0
|
|
107
|
-
|
|
108
|
-
.closable-tab & {
|
|
109
|
-
padding-right: 0.25rem;
|
|
110
|
-
}
|
|
106
|
+
padding: 0 1rem;
|
|
111
107
|
}
|
|
112
108
|
|
|
113
109
|
.tab-close-icon {
|
|
114
|
-
width:
|
|
115
|
-
height:
|
|
116
|
-
font-size:
|
|
117
|
-
|
|
110
|
+
width: 20px !important;
|
|
111
|
+
height: 20px !important;
|
|
112
|
+
font-size: 20px !important;
|
|
113
|
+
padding-right: 4px !important;
|
|
118
114
|
color: $app-primary-color !important;
|
|
119
|
-
border-radius: 2px;
|
|
120
|
-
|
|
121
|
-
&:hover {
|
|
122
|
-
background-color: rgba($app-primary-color, 0.15) !important;
|
|
123
|
-
}
|
|
124
115
|
}
|
|
125
116
|
</style>
|
package/src/components.d.ts
CHANGED
|
@@ -9,8 +9,6 @@ declare module 'vue' {
|
|
|
9
9
|
export interface GlobalComponents {
|
|
10
10
|
AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
|
|
11
11
|
BadgesGroup: typeof import('./components/BadgesGroup.vue')['default']
|
|
12
|
-
CellCard: typeof import('./components/CellCard.vue')['default']
|
|
13
|
-
CellCardExplorer: typeof import('./components/CellCardExplorer.vue')['default']
|
|
14
12
|
ConnectivityCard: typeof import('./components/ConnectivityCard.vue')['default']
|
|
15
13
|
ConnectivityExplorer: typeof import('./components/ConnectivityExplorer.vue')['default']
|
|
16
14
|
ConnectivityInfo: typeof import('./components/ConnectivityInfo.vue')['default']
|
|
@@ -46,7 +44,6 @@ declare module 'vue' {
|
|
|
46
44
|
ElRow: typeof import('element-plus/es')['ElRow']
|
|
47
45
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
48
46
|
ElTag: typeof import('element-plus/es')['ElTag']
|
|
49
|
-
IconOpenExternal: typeof import('./components/icons/IconOpenExternal.vue')['default']
|
|
50
47
|
ImageGallery: typeof import('./components/ImageGallery.vue')['default']
|
|
51
48
|
SearchFilters: typeof import('./components/SearchFilters.vue')['default']
|
|
52
49
|
SearchHistory: typeof import('./components/SearchHistory.vue')['default']
|