@abi-software/map-side-bar 2.10.7-demo.1 → 2.11.2-acupoints.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.10.7-demo.1",
3
+ "version": "2.11.2-acupoints.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -44,7 +44,7 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@abi-software/gallery": "^1.2.0",
47
- "@abi-software/map-utilities": "1.7.4",
47
+ "@abi-software/map-utilities": "1.7.6",
48
48
  "@abi-software/svg-sprite": "^1.0.2",
49
49
  "@element-plus/icons-vue": "^2.3.1",
50
50
  "algoliasearch": "^4.10.5",
package/src/App.vue CHANGED
@@ -18,6 +18,7 @@
18
18
  <el-button @click="keywordSearch">keyword search</el-button>
19
19
  <el-button @click="getFacets">Get facets</el-button>
20
20
  <el-button @click="toggleCreateData">Create Data/Annotation</el-button>
21
+ <el-button @click="searchAcupoints">Search Acupoints</el-button>
21
22
  <el-button @click="openConnectivitySearch()">Connectivity Search</el-button>
22
23
  </div>
23
24
  <SideBar
@@ -26,14 +27,18 @@
26
27
  ref="sideBar"
27
28
  :visible="sideBarVisibility"
28
29
  :annotationEntry="annotationEntry"
30
+ :acupointsInfoList="acupoints"
29
31
  :createData="createData"
30
32
  :connectivityEntry="connectivityEntry"
31
33
  :connectivityKnowledge="connectivityKnowledge"
32
34
  :showVisibilityFilter="true"
35
+ :tabs="tabArray"
33
36
  @search-changed="searchChanged($event)"
34
37
  @hover-changed="hoverChanged($event)"
35
38
  @connectivity-hovered="onConnectivityHovered"
36
39
  @actionClick="action"
40
+ @acupoints-clicked="onAcupointsClicked"
41
+ @acupoints-hovered="onAcupointsHovered"
37
42
  @connectivity-collapse-change="onConnectivityCollapseChange"
38
43
  />
39
44
  </div>
@@ -42,6 +47,7 @@
42
47
  <script>
43
48
  /* eslint-disable no-alert, no-console */
44
49
  // optionally import default styles
50
+ import { acupointEntries } from './acupoints.js'
45
51
  import SideBar from './components/SideBar.vue'
46
52
  import EventBus from './components/EventBus.js'
47
53
  import exampleConnectivityInput from './exampleConnectivityInput.js'
@@ -121,6 +127,14 @@ export default {
121
127
  },
122
128
  data: function () {
123
129
  return {
130
+ acupoints: acupointEntries,
131
+ contextArray: [null, null],
132
+ tabArray: [
133
+ { title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
134
+ { title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
135
+ { title: 'Annotation', id: 3, type: 'annotation', closable: true },
136
+ {title: 'Acupoints', id: 4, type: 'acupoints' },
137
+ ],
124
138
  annotationEntry: [{
125
139
  featureId: "epicardium",
126
140
  resourceId: "https://mapcore-bucket1.s3-us-west-2.amazonaws.com/others/29_Jan_2020/heartICN_metadata.json",
@@ -156,6 +170,12 @@ export default {
156
170
  }
157
171
  },
158
172
  methods: {
173
+ onAcupointsClicked: function (data) {
174
+ console.log("acupoints-clicked", data)
175
+ },
176
+ onAcupointsHovered: function (data) {
177
+ console.log("acupoints-hovered", data)
178
+ },
159
179
  loadConnectivityKnowledge: async function () {
160
180
  const sql = `select knowledge from knowledge
161
181
  where source="${this.sckanVersion}"
@@ -232,6 +252,9 @@ export default {
232
252
  'http://purl.obolibrary.org/obo/UBERON_0001103'
233
253
  )
234
254
  },
255
+ searchAcupoints: function() {
256
+ this.$refs.sideBar.openAcupointsSearch("LU 1")
257
+ },
235
258
  singleFacets: function () {
236
259
  this.$refs.sideBar.addFilter({
237
260
  facet: 'Cardiovascular system',
@@ -406,4 +429,4 @@ body {
406
429
  align-items: center;
407
430
  gap: 0.5rem;
408
431
  }
409
- </style>
432
+ </style>./acupoints.js
@@ -0,0 +1,32 @@
1
+ export const acupointEntries = {
2
+ "LU 1": {
3
+ "Acupoint": "LU 1",
4
+ "Label": "LU 1",
5
+ "Synonym": "Test data",
6
+ "UMLS CUI": "",
7
+ "Meridian": "LTest data",
8
+ "Chinese Name": "Zhongfu",
9
+ "English Name": "Central Treasury",
10
+ "Location": " z zxczc.",
11
+ "Reference": "Test data",
12
+ "Indications": "Test data",
13
+ "Acupuncture Method": "Test data",
14
+ "Vasculature": "Test data",
15
+ "Innervation": "Test data"
16
+ },
17
+ "LU 2": {
18
+ "Acupoint": "LU 2",
19
+ "Label": "LU 2",
20
+ "Synonym": "Test data",
21
+ "UMLS CUI": "",
22
+ "Meridian": "LTest data",
23
+ "Chinese Name": "Yunmen",
24
+ "English Name": "Cloud Gate",
25
+ "Location": " z zxczc.",
26
+ "Reference": "Test data",
27
+ "Indications": "Test data",
28
+ "Acupuncture Method": "Test data",
29
+ "Vasculature": "Test data",
30
+ "Innervation": "Test data"
31
+ }
32
+ }
@@ -0,0 +1,187 @@
1
+ <template>
2
+ <div class="dataset-card-container" ref="container">
3
+ <div class="dataset-card" ref="card">
4
+ <div class="seperator-path"></div>
5
+ <div class="card"
6
+ @click="cardClicked(entry)"
7
+ @mouseover="cardHovered(entry)"
8
+ @mouseleave="cardHovered(undefined)"
9
+ >
10
+ <div class="card-right">
11
+ <div class="title">Acupoint: {{ entry.Acupoint }}</div>
12
+ <template v-for="field in displayFields" :key="field['name']">
13
+ <div class="details" >
14
+ <strong>{{ field['name'] }}: </strong>
15
+ <span
16
+ v-if="!field['isEditing']"
17
+ @click="field['isEditing'] = true"
18
+ >
19
+ {{ entry[field['name']] || 'Not Available' }}
20
+ </span>
21
+ <el-input
22
+ v-else
23
+ v-model="entry[field['name']]"
24
+ @blur="field['isEditing'] = false"
25
+ @keyup.enter="field['isEditing'] = false"
26
+ @vue:mounted="inputMounted"
27
+ type="textarea"
28
+ />
29
+ </div>
30
+ </template>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </template>
36
+
37
+ <script>
38
+ import EventBus from './EventBus.js'
39
+ /* eslint-disable no-alert, no-console */
40
+
41
+ export default {
42
+ data() {
43
+ return {
44
+ displayFields: [
45
+ {name: "Synonym", isEditing: false},
46
+ {name: "Chinese Name", isEditing: false},
47
+ {name: "English Name", isEditing: false},
48
+ {name: "Reference", isEditing: false},
49
+ {name: "Indications", isEditing: false},
50
+ {name: "Acupuncture Method", isEditing: false},
51
+ {name: "Vasculature", isEditing: false},
52
+ {name: "Innervation", isEditing: false},
53
+ {name: "Notes", isEditing: false},
54
+ ]
55
+ }
56
+ },
57
+ name: 'AcupointsCard',
58
+ props: {
59
+ /**
60
+ * Object containing information for
61
+ * the required viewing.
62
+ */
63
+ entry: {
64
+ type: Object,
65
+ default: () => {},
66
+ },
67
+ },
68
+ methods: {
69
+ cardClicked: function (data) {
70
+ EventBus.emit('acupoints-clicked', data);
71
+ },
72
+ cardHovered: function (data) {
73
+ EventBus.emit('acupoints-hovered', data);
74
+ },
75
+ inputMounted: function(event) {
76
+ event.el?.querySelector('textarea')?.focus();
77
+ }
78
+ }
79
+ }
80
+ </script>
81
+
82
+ <style lang="scss" scoped>
83
+ .dataset-card {
84
+ padding-left: 5px;
85
+ padding-right: 5px;
86
+ position: relative;
87
+ min-height: 17rem;
88
+ }
89
+
90
+ .title {
91
+ padding-bottom: 0.75rem;
92
+ font-family: Asap;
93
+ font-size: 14px;
94
+ font-weight: bold;
95
+ font-stretch: normal;
96
+ font-style: normal;
97
+ line-height: 1.5;
98
+ letter-spacing: 1.05px;
99
+ color: #484848;
100
+ cursor: pointer;
101
+ }
102
+ .card {
103
+ padding-top: 18px;
104
+ position: relative;
105
+ display: flex;
106
+ }
107
+
108
+ .card-left {
109
+ flex: 1;
110
+ }
111
+
112
+ .card-right {
113
+ flex: 1.3;
114
+ padding-left: 6px;
115
+ }
116
+
117
+ .button {
118
+ z-index: 10;
119
+ font-family: Asap;
120
+ font-size: 14px;
121
+ font-weight: normal;
122
+ font-stretch: normal;
123
+ font-style: normal;
124
+ line-height: normal;
125
+ letter-spacing: normal;
126
+ background-color: $app-primary-color;
127
+ border: $app-primary-color;
128
+ color: white;
129
+ cursor: pointer;
130
+ margin-top: 8px;
131
+ }
132
+
133
+ .button:hover {
134
+ background-color: $app-primary-color;
135
+ color: white;
136
+ }
137
+
138
+ .banner-img {
139
+ width: 128px;
140
+ height: 128px;
141
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
142
+ background-color: #ffffff;
143
+ cursor: pointer;
144
+ }
145
+ .details {
146
+ font-family: Asap;
147
+ font-size: 14px;
148
+ font-weight: normal;
149
+ font-stretch: normal;
150
+ font-style: normal;
151
+ line-height: 1.5;
152
+ letter-spacing: 1.05px;
153
+ color: #484848;
154
+ }
155
+
156
+ .badges-container {
157
+ margin-top: 0.75rem;
158
+ }
159
+
160
+ .loading-icon {
161
+ z-index: 20;
162
+ width: 40px;
163
+ height: 40px;
164
+ left: 80px;
165
+ }
166
+
167
+ .loading-icon :deep(.el-loading-mask) {
168
+ background-color: rgba(117, 190, 218, 0) !important;
169
+ }
170
+
171
+ .loading-icon :deep(.el-loading-spinner .path) {
172
+ stroke: $app-primary-color;
173
+ }
174
+
175
+ .float-button-container {
176
+ position: absolute;
177
+ bottom: 8px;
178
+ right: 16px;
179
+ opacity: 0;
180
+ visibility: hidden;
181
+
182
+ .card:hover & {
183
+ opacity: 1;
184
+ visibility: visible;
185
+ }
186
+ }
187
+ </style>
@@ -0,0 +1,342 @@
1
+ <template>
2
+ <div v-if="entry" class="main">
3
+ <div class="header">
4
+ <el-input
5
+ class="search-input"
6
+ placeholder="Search"
7
+ v-model="searchInput"
8
+ @keyup="search(searchInput)"
9
+ clearable
10
+ @clear="clearSearchClicked"
11
+ ></el-input>
12
+ <el-button
13
+ v-show="false"
14
+ type="primary"
15
+ class="button"
16
+ @click="search(searchInput)"
17
+ size="large"
18
+ >
19
+ Search
20
+ </el-button>
21
+ <el-button
22
+ v-show="false"
23
+ type="primary"
24
+ class="button"
25
+ @click="save()"
26
+ size="large"
27
+ >
28
+ Save
29
+ </el-button>
30
+ <el-button
31
+ v-show="false"
32
+ type="primary"
33
+ class="button"
34
+ @click="load()"
35
+ size="large"
36
+ >
37
+ Load
38
+ </el-button>
39
+
40
+ </div>
41
+ <div class="content scrollbar" ref="content">
42
+ <div v-for="result in paginatedResults" :key="result.Acupoint" class="step-item">
43
+ <AcupointsCard
44
+ class="dataset-card"
45
+ :entry="result"
46
+ @mouseenter="hoverChanged(result)"
47
+ @mouseleave="hoverChanged(undefined)"
48
+ />
49
+ </div>
50
+ <el-pagination
51
+ class="pagination"
52
+ v-model:current-page="page"
53
+ hide-on-single-page
54
+ large
55
+ layout="prev, pager, next"
56
+ :page-size="numberPerPage"
57
+ :total="numberOfHits"
58
+ @current-change="pageChange"
59
+ ></el-pagination>
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ /* eslint-disable no-alert, no-console */
66
+ import {
67
+ ElButton as Button,
68
+ ElCard as Card,
69
+ ElDrawer as Drawer,
70
+ ElIcon as Icon,
71
+ ElInput as Input,
72
+ ElPagination as Pagination,
73
+ } from 'element-plus'
74
+ import AcupointsCard from './AcupointsCard.vue'
75
+
76
+ export default {
77
+ components: {
78
+ AcupointsCard,
79
+ Button,
80
+ Card,
81
+ Drawer,
82
+ Icon,
83
+ Input,
84
+ Pagination
85
+ },
86
+ name: 'AcupointsInfoSearch',
87
+ props: {
88
+ entry: {
89
+ type: Object,
90
+ default: () => {},
91
+ },
92
+ },
93
+ data: function () {
94
+ return {
95
+ results: [],
96
+ paginatedResults: [],
97
+ searchInput: "",
98
+ lastSearch: "",
99
+ numberOfHits: 0,
100
+ numberPerPage: 10,
101
+ page: 1,
102
+ }
103
+ },
104
+ watch: {
105
+ entry: {
106
+ handler: function () {
107
+ this.search(
108
+ this.searchInput,
109
+ this.numberPerPage,
110
+ this.page
111
+ )
112
+ },
113
+ immediate: true,
114
+ deep: true,
115
+ },
116
+ },
117
+ methods: {
118
+ hoverChanged: function (data) {
119
+ this.$emit('hover-changed', data)
120
+ },
121
+ resetSearch: function () {
122
+ this.numberOfHits = 0
123
+ this.search(this.searchInput)
124
+ },
125
+ clearSearchClicked: function () {
126
+ this.searchInput = '';
127
+ this.search("");
128
+ },
129
+ search: function(input) {
130
+ this.results = []
131
+ if (input !== this.previousSearch) {
132
+ if (input === "") {
133
+ this.results = Object.values(this.entry)
134
+ } else {
135
+ const lowerCase = input.toLowerCase()
136
+ for (const value of Object.values(this.entry)) {
137
+ const searchFields = [
138
+ value["Acupoint"],
139
+ value["Synonym"],
140
+ value["Chinese Name"],
141
+ value["English Name"],
142
+ value["Reference"],
143
+ value["Indications"],
144
+ value["Acupuncture Method"],
145
+ value["Vasculature"],
146
+ value["Innervation"],
147
+ value["Note"],
148
+ ];
149
+ const allstrings = searchFields.join();
150
+ const myJSON = allstrings.toLowerCase();
151
+ if (myJSON.includes(lowerCase)) {
152
+ this.results.push(value)
153
+ }
154
+ }
155
+ }
156
+ }
157
+ const start = this.numberPerPage * (this.page - 1)
158
+ this.paginatedResults = this.results.slice(start, start + this.numberPerPage)
159
+ this.numberOfHits = this.results.length
160
+ this.searchInput = input
161
+ this.lastSearch = input
162
+ },
163
+ numberPerPageUpdate: function (val) {
164
+ this.numberPerPage = val
165
+ this.pageChange(1)
166
+ },
167
+ pageChange: function (page) {
168
+ this.page = page
169
+ this.search( this.searchInput)
170
+ },
171
+ scrollToTop: function () {
172
+ if (this.$refs.content) {
173
+ this.$refs.content.scroll({ top: 0, behavior: 'smooth' })
174
+ }
175
+ },
176
+ resetPageNavigation: function () {
177
+ this.page = 1
178
+ },
179
+ },
180
+ }
181
+ </script>
182
+
183
+ <style lang="scss" scoped>
184
+ .dataset-card {
185
+ position: relative;
186
+
187
+ &::before {
188
+ content: "";
189
+ display: block;
190
+ width: calc(100% - 15px);
191
+ height: 100%;
192
+ position: absolute;
193
+ top: 7px;
194
+ left: 7px;
195
+ border-style: solid;
196
+ border-radius: 5px;
197
+ border-color: transparent;
198
+ }
199
+
200
+ &:hover {
201
+ &::before {
202
+ border-color: var(--el-color-primary);
203
+ }
204
+ }
205
+ }
206
+
207
+ .main {
208
+ font-size: 14px;
209
+ text-align: left;
210
+ line-height: 1.5em;
211
+ font-family: Asap, sans-serif, Helvetica;
212
+ font-weight: 400;
213
+ /* outline: thin red solid; */
214
+ overflow-y: auto;
215
+ scrollbar-width: thin;
216
+ min-width: 16rem;
217
+ background-color: #f7faff;
218
+ height: 100%;
219
+ border-left: 1px solid var(--el-border-color);
220
+ border-top: 1px solid var(--el-border-color);
221
+ display: flex;
222
+ flex-direction: column;
223
+ gap: 1.75rem;
224
+ padding: 1rem;
225
+ }
226
+
227
+ .step-item {
228
+ font-size: 14px;
229
+ margin-bottom: 18px;
230
+ text-align: left;
231
+ }
232
+
233
+ .search-input {
234
+ width: 298px !important;
235
+ height: 40px;
236
+ padding-right: 14px;
237
+
238
+ :deep(.el-input__inner) {
239
+ font-family: inherit;
240
+ }
241
+ }
242
+
243
+ .header {
244
+ .el-button {
245
+ font-family: inherit;
246
+
247
+ &:hover,
248
+ &:focus {
249
+ background: $app-primary-color;
250
+ box-shadow: -3px 2px 4px #00000040;
251
+ color: #fff;
252
+ }
253
+ }
254
+ }
255
+
256
+ .pagination {
257
+ padding-bottom: 16px;
258
+ background-color: white;
259
+ padding-left: 95px;
260
+ font-weight: bold;
261
+ }
262
+
263
+ .pagination :deep(button) {
264
+ background-color: white !important;
265
+ }
266
+ .pagination :deep(li) {
267
+ background-color: white !important;
268
+ }
269
+ .pagination :deep(li.is-active) {
270
+ color: $app-primary-color;
271
+ }
272
+
273
+ .error-feedback {
274
+ font-family: Asap;
275
+ font-size: 14px;
276
+ font-style: italic;
277
+ padding-top: 15px;
278
+ }
279
+
280
+ .content-card :deep(.el-card__header) {
281
+ background-color: #292b66;
282
+ padding: 1rem;
283
+ }
284
+
285
+ .content-card :deep(.el-card__body) {
286
+ background-color: #f7faff;
287
+ overflow-y: hidden;
288
+ padding: 1rem;
289
+ }
290
+
291
+ .content {
292
+ // width: 515px;
293
+ flex: 1 1 auto;
294
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
295
+ border: solid 1px #e4e7ed;
296
+ background-color: #ffffff;
297
+ overflow-y: scroll;
298
+ scrollbar-width: thin;
299
+ border-radius: var(--el-border-radius-base);
300
+ }
301
+
302
+ .content :deep(.el-loading-spinner .path) {
303
+ stroke: $app-primary-color;
304
+ }
305
+
306
+ .content :deep(.step-item:first-child .seperator-path) {
307
+ display: none;
308
+ }
309
+
310
+ .content :deep(.step-item:not(:first-child) .seperator-path) {
311
+ width: 455px;
312
+ height: 0px;
313
+ border: solid 1px #e4e7ed;
314
+ background-color: #e4e7ed;
315
+ }
316
+
317
+ .scrollbar::-webkit-scrollbar-track {
318
+ border-radius: 10px;
319
+ background-color: #f5f5f5;
320
+ }
321
+
322
+ .scrollbar::-webkit-scrollbar {
323
+ width: 12px;
324
+ right: -12px;
325
+ background-color: #f5f5f5;
326
+ }
327
+
328
+ .scrollbar::-webkit-scrollbar-thumb {
329
+ border-radius: 4px;
330
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
331
+ background-color: #979797;
332
+ }
333
+
334
+ :deep(.el-input__suffix) {
335
+ padding-right: 0px;
336
+ }
337
+
338
+ :deep(.my-drawer) {
339
+ background: rgba(0, 0, 0, 0);
340
+ box-shadow: none;
341
+ }
342
+ </style>