@abi-software/map-side-bar 2.4.2 → 2.5.0-beta.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 +10521 -9586
- package/dist/map-side-bar.umd.cjs +101 -101
- package/dist/style.css +1 -1
- package/package.json +2 -2
- package/src/App.vue +30 -1
- package/src/components/AnnotationTool.vue +145 -0
- package/src/components/SideBar.vue +46 -4
- package/src/components/Tabs.vue +1 -1
- package/src/components.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-side-bar",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0-beta.1",
|
|
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.
|
|
42
|
+
"@abi-software/map-utilities": "^1.2.0-beta.4",
|
|
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
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<el-button @click="neuronSearch">open neuron search</el-button>
|
|
15
15
|
<el-button @click="keywordSearch">keyword search</el-button>
|
|
16
16
|
<el-button @click="getFacets">Get facets</el-button>
|
|
17
|
+
<el-button @click="toggleCreateData">Create Data/Annotation</el-button>
|
|
17
18
|
</div>
|
|
18
19
|
<SideBar
|
|
19
20
|
:envVars="envVars"
|
|
@@ -22,6 +23,8 @@
|
|
|
22
23
|
:visible="sideBarVisibility"
|
|
23
24
|
:tabs="tabs"
|
|
24
25
|
:activeTabId="activeId"
|
|
26
|
+
:annotationEntry="annotationEntry"
|
|
27
|
+
:createData="createData"
|
|
25
28
|
:connectivityInfo="connectivityInput"
|
|
26
29
|
@tabClicked="tabClicked"
|
|
27
30
|
@search-changed="searchChanged($event)"
|
|
@@ -100,8 +103,16 @@ export default {
|
|
|
100
103
|
},
|
|
101
104
|
data: function () {
|
|
102
105
|
return {
|
|
106
|
+
annotationEntry: {
|
|
107
|
+
featureId :"epicardium",
|
|
108
|
+
resourceId: "https://mapcore-bucket1.s3-us-west-2.amazonaws.com/others/29_Jan_2020/heartICN_metadata.json","resource":"https://mapcore-bucket1.s3-us-west-2.amazonaws.com/others/29_Jan_2020/heartICN_metadata.json"
|
|
109
|
+
},
|
|
103
110
|
contextArray: [null, null],
|
|
104
|
-
tabArray: [
|
|
111
|
+
tabArray: [
|
|
112
|
+
{ title: 'Flatmap', id: 1, type: 'search'},
|
|
113
|
+
{ title: 'Connectivity', id: 2, type: 'connectivity' },
|
|
114
|
+
{ title: 'Annotation', id: 3, type: 'annotation' },
|
|
115
|
+
],
|
|
105
116
|
sideBarVisibility: true,
|
|
106
117
|
envVars: {
|
|
107
118
|
API_LOCATION: import.meta.env.VITE_APP_API_LOCATION,
|
|
@@ -115,6 +126,7 @@ export default {
|
|
|
115
126
|
},
|
|
116
127
|
connectivityInput: exampleConnectivityInput,
|
|
117
128
|
activeId: 1,
|
|
129
|
+
createData: null,
|
|
118
130
|
}
|
|
119
131
|
},
|
|
120
132
|
methods: {
|
|
@@ -224,6 +236,23 @@ export default {
|
|
|
224
236
|
let facets = await this.$refs.sideBar.getAlgoliaFacets()
|
|
225
237
|
console.log('Algolia facets:', facets)
|
|
226
238
|
},
|
|
239
|
+
toggleCreateData : function() {
|
|
240
|
+
if (!this.createData) {
|
|
241
|
+
this.createData = {
|
|
242
|
+
drawingBox: false,
|
|
243
|
+
toBeConfirmed: true,
|
|
244
|
+
points: [[1.0, 1.0, 1.0]],
|
|
245
|
+
shape: "Lines",
|
|
246
|
+
x: 0,
|
|
247
|
+
y: 0,
|
|
248
|
+
editingIndex: -1,
|
|
249
|
+
faceIndex: -1,
|
|
250
|
+
toBeDeleted: false,
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
this.createData = null
|
|
254
|
+
}
|
|
255
|
+
}
|
|
227
256
|
},
|
|
228
257
|
mounted: function () {
|
|
229
258
|
console.log('mounted app')
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="annotation-tool scrollbar">
|
|
3
|
+
<CreateTooltipContent
|
|
4
|
+
v-show="createData && createData.toBeConfirmed"
|
|
5
|
+
:createData="createData"
|
|
6
|
+
@confirm-create="$emit('confirm-create', $event)"
|
|
7
|
+
@cancel-create="$emit('cancel-create')"
|
|
8
|
+
class="create-tooltip-content"
|
|
9
|
+
/>
|
|
10
|
+
<annotation-popup
|
|
11
|
+
v-if="annotationEntry && (!createData || !createData.toBeConfirmed)"
|
|
12
|
+
class="annotation-popup"
|
|
13
|
+
:annotationEntry="annotationEntry"
|
|
14
|
+
@annotation="$emit('annotation', $event)"
|
|
15
|
+
/>
|
|
16
|
+
<div v-if="createData && createData.toBeDeleted" class="delete-container">
|
|
17
|
+
<el-row>
|
|
18
|
+
<el-col :offset="1" :span="6">Delete this feature?</el-col>
|
|
19
|
+
<el-col :offset="1" :span="3">
|
|
20
|
+
<el-button
|
|
21
|
+
class="delete-button"
|
|
22
|
+
:icon="ElIconDelete"
|
|
23
|
+
@click="$emit('confirm-delete')"
|
|
24
|
+
>
|
|
25
|
+
Delete
|
|
26
|
+
</el-button>
|
|
27
|
+
</el-col>
|
|
28
|
+
<el-col :offset="1" :span="2">
|
|
29
|
+
<el-button
|
|
30
|
+
class="delete-button"
|
|
31
|
+
@click="$emit('cancel-create')"
|
|
32
|
+
>
|
|
33
|
+
Dismiss
|
|
34
|
+
</el-button>
|
|
35
|
+
</el-col>
|
|
36
|
+
</el-row>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import { shallowRef } from 'vue';
|
|
43
|
+
import { AnnotationPopup, CreateTooltipContent } from '@abi-software/map-utilities';
|
|
44
|
+
import '@abi-software/map-utilities/dist/style.css';
|
|
45
|
+
import {
|
|
46
|
+
ElButton as Button,
|
|
47
|
+
ElCol as Col,
|
|
48
|
+
ElRow as Row,
|
|
49
|
+
ElIcon as Icon,
|
|
50
|
+
} from 'element-plus'
|
|
51
|
+
import {
|
|
52
|
+
Delete as ElIconDelete,
|
|
53
|
+
} from '@element-plus/icons-vue'
|
|
54
|
+
|
|
55
|
+
export default {
|
|
56
|
+
name: 'AnnotationTool',
|
|
57
|
+
components: {
|
|
58
|
+
AnnotationPopup,
|
|
59
|
+
Button,
|
|
60
|
+
CreateTooltipContent,
|
|
61
|
+
Col,
|
|
62
|
+
ElIconDelete,
|
|
63
|
+
Icon,
|
|
64
|
+
Row,
|
|
65
|
+
},
|
|
66
|
+
props: {
|
|
67
|
+
annotationEntry: {
|
|
68
|
+
type: Object,
|
|
69
|
+
},
|
|
70
|
+
createData: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default: {},
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
data: function () {
|
|
76
|
+
return {
|
|
77
|
+
ElIconDelete: shallowRef(ElIconDelete),
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<style scoped lang="scss">
|
|
84
|
+
.annotation-tool {
|
|
85
|
+
background-color: #f7faff;
|
|
86
|
+
height: 100%;
|
|
87
|
+
overflow-y: auto;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.scrollbar::-webkit-scrollbar-track {
|
|
91
|
+
border-radius: 10px;
|
|
92
|
+
background-color: #f5f5f5;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.scrollbar::-webkit-scrollbar {
|
|
96
|
+
width: 12px;
|
|
97
|
+
right: -12px;
|
|
98
|
+
background-color: #f5f5f5;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.scrollbar::-webkit-scrollbar-thumb {
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
104
|
+
background-color: #979797;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.annotation-popup.main {
|
|
108
|
+
font-size: 14px;
|
|
109
|
+
text-align: left;
|
|
110
|
+
line-height: 1.5em;
|
|
111
|
+
font-family: Asap, sans-serif, Helvetica;
|
|
112
|
+
font-weight: 400;
|
|
113
|
+
/* outline: thin red solid; */
|
|
114
|
+
overflow-y: auto;
|
|
115
|
+
scrollbar-width: thin;
|
|
116
|
+
min-width: 16rem;
|
|
117
|
+
max-height: unset;
|
|
118
|
+
background-color: #f7faff;
|
|
119
|
+
border-left: 1px solid var(--el-border-color);
|
|
120
|
+
border-top: 1px solid var(--el-border-color);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.delete-container {
|
|
124
|
+
margin-top: 12px;
|
|
125
|
+
margin-bottom: 12px;
|
|
126
|
+
font-size: 14px;
|
|
127
|
+
.delete-button {
|
|
128
|
+
pointer-events: auto;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
margin-left:8px;
|
|
131
|
+
padding-left: 8px;
|
|
132
|
+
padding-right: 8px;
|
|
133
|
+
height: 24px !important;
|
|
134
|
+
color: $app-primary-color;
|
|
135
|
+
&:hover {
|
|
136
|
+
background-color: var(--el-color-primary-light-9);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.create-container.create-tooltip-content {
|
|
142
|
+
background-color: #f7faff;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
</style>
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
</div>
|
|
23
23
|
<div class="sidebar-container">
|
|
24
24
|
<Tabs
|
|
25
|
-
v-if="
|
|
26
|
-
:tabTitles="
|
|
25
|
+
v-if="activeTabs.length > 1"
|
|
26
|
+
:tabTitles="activeTabs"
|
|
27
27
|
:activeId="activeTabId"
|
|
28
28
|
@titleClicked="tabClicked"
|
|
29
29
|
@tab-close="tabClose"
|
|
@@ -39,6 +39,18 @@
|
|
|
39
39
|
@show-connectivity="showConnectivity"
|
|
40
40
|
/>
|
|
41
41
|
</template>
|
|
42
|
+
<template v-else-if="tab.type === 'annotation'">
|
|
43
|
+
<annotation-tool
|
|
44
|
+
:ref="'annotationTab_' + tab.id"
|
|
45
|
+
v-show="tab.id === activeTabId"
|
|
46
|
+
:annotationEntry="annotationEntry"
|
|
47
|
+
:createData="createData"
|
|
48
|
+
@annotation="$emit('annotation-submitted', $event)"
|
|
49
|
+
@confirm-create="$emit('confirm-create', $event)"
|
|
50
|
+
@cancel-create="$emit('cancel-create')"
|
|
51
|
+
@confirm-delete="$emit('confirm-delete', $event)"
|
|
52
|
+
/>
|
|
53
|
+
</template>
|
|
42
54
|
<template v-else>
|
|
43
55
|
<SidebarContent
|
|
44
56
|
class="sidebar-content-container"
|
|
@@ -67,6 +79,7 @@ import { ElDrawer as Drawer, ElIcon as Icon } from 'element-plus'
|
|
|
67
79
|
import SidebarContent from './SidebarContent.vue'
|
|
68
80
|
import EventBus from './EventBus.js'
|
|
69
81
|
import Tabs from './Tabs.vue'
|
|
82
|
+
import AnnotationTool from './AnnotationTool.vue'
|
|
70
83
|
import ConnectivityInfo from './ConnectivityInfo.vue'
|
|
71
84
|
|
|
72
85
|
/**
|
|
@@ -81,6 +94,7 @@ export default {
|
|
|
81
94
|
Drawer,
|
|
82
95
|
Icon,
|
|
83
96
|
ConnectivityInfo,
|
|
97
|
+
AnnotationTool,
|
|
84
98
|
},
|
|
85
99
|
name: 'SideBar',
|
|
86
100
|
props: {
|
|
@@ -108,7 +122,8 @@ export default {
|
|
|
108
122
|
type: Array,
|
|
109
123
|
default: () => [
|
|
110
124
|
{ id: 1, title: 'Search', type: 'search' },
|
|
111
|
-
{ id: 2, title: 'Connectivity', type: 'connectivity' }
|
|
125
|
+
{ id: 2, title: 'Connectivity', type: 'connectivity' },
|
|
126
|
+
{ id: 3, title: 'Annotation', type: 'annotation' }
|
|
112
127
|
],
|
|
113
128
|
},
|
|
114
129
|
/**
|
|
@@ -132,6 +147,17 @@ export default {
|
|
|
132
147
|
type: Object,
|
|
133
148
|
default: null,
|
|
134
149
|
},
|
|
150
|
+
/**
|
|
151
|
+
* The annotation data to show in sidebar.
|
|
152
|
+
*/
|
|
153
|
+
annotationEntry: {
|
|
154
|
+
type: Object,
|
|
155
|
+
default: null,
|
|
156
|
+
},
|
|
157
|
+
createData: {
|
|
158
|
+
type: Object,
|
|
159
|
+
default: null,
|
|
160
|
+
}
|
|
135
161
|
},
|
|
136
162
|
data: function () {
|
|
137
163
|
return {
|
|
@@ -201,6 +227,8 @@ export default {
|
|
|
201
227
|
let refIdPrefix = 'searchTab_'; // default to search tab
|
|
202
228
|
if (type === 'connectivity') {
|
|
203
229
|
refIdPrefix = 'connectivityTab_';
|
|
230
|
+
} else if (type === 'annotation') {
|
|
231
|
+
refIdPrefix = 'annotationTab_';
|
|
204
232
|
}
|
|
205
233
|
const tabObj = this.getTabByIdAndType(id, type);
|
|
206
234
|
const tabRefId = refIdPrefix + tabObj.id;
|
|
@@ -261,7 +289,21 @@ export default {
|
|
|
261
289
|
this.$emit('tabClicked', {id, type});
|
|
262
290
|
},
|
|
263
291
|
tabClose: function (id) {
|
|
264
|
-
this.$emit('
|
|
292
|
+
this.$emit('tab-close', id);
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
computed: {
|
|
296
|
+
activeTabs: function() {
|
|
297
|
+
const tabs = [
|
|
298
|
+
{ id: 1, title: 'Search', type: 'search' }
|
|
299
|
+
];
|
|
300
|
+
if (this.connectivityInfo) {
|
|
301
|
+
tabs.push({ id: 2, title: 'Connectivity', type: 'connectivity' });
|
|
302
|
+
}
|
|
303
|
+
if (this.annotationEntry && Object.keys(this.annotationEntry).length > 0) {
|
|
304
|
+
tabs.push({ id: 3, title: 'Annotation', type: 'annotation' });
|
|
305
|
+
}
|
|
306
|
+
return tabs;
|
|
265
307
|
},
|
|
266
308
|
},
|
|
267
309
|
created: function () {
|
package/src/components/Tabs.vue
CHANGED
package/src/components.d.ts
CHANGED
|
@@ -7,12 +7,14 @@ export {}
|
|
|
7
7
|
|
|
8
8
|
declare module 'vue' {
|
|
9
9
|
export interface GlobalComponents {
|
|
10
|
+
AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
|
|
10
11
|
BadgesGroup: typeof import('./components/BadgesGroup.vue')['default']
|
|
11
12
|
ConnectivityInfo: typeof import('./components/ConnectivityInfo.vue')['default']
|
|
12
13
|
DatasetCard: typeof import('./components/DatasetCard.vue')['default']
|
|
13
14
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
14
15
|
ElCard: typeof import('element-plus/es')['ElCard']
|
|
15
16
|
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
17
|
+
ElCol: typeof import('element-plus/es')['ElCol']
|
|
16
18
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
|
17
19
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
18
20
|
ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
|
|
@@ -24,6 +26,7 @@ declare module 'vue' {
|
|
|
24
26
|
ElOption: typeof import('element-plus/es')['ElOption']
|
|
25
27
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
26
28
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
|
29
|
+
ElRow: typeof import('element-plus/es')['ElRow']
|
|
27
30
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
28
31
|
ElTag: typeof import('element-plus/es')['ElTag']
|
|
29
32
|
ExternalResourceCard: typeof import('./components/ExternalResourceCard.vue')['default']
|