@abi-software/map-side-bar 2.12.2 → 2.12.4-acupoint.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 +8986 -8301
- package/dist/map-side-bar.umd.cjs +63 -63
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/App.vue +24 -1
- package/src/acupoints.js +78 -0
- package/src/components/AcupointsCard.vue +234 -0
- package/src/components/AcupointsInfoSearch.vue +468 -0
- package/src/components/DatasetExplorer.vue +0 -2
- package/src/components/SideBar.vue +46 -3
- package/src/components.d.ts +5 -0
- package/src/services/flatmapKnowledge.js +94 -0
- package/src/services/flatmapQueries.js +498 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="entry" class="main">
|
|
3
|
+
<div class="header">
|
|
4
|
+
<el-row>
|
|
5
|
+
<el-input
|
|
6
|
+
class="search-input"
|
|
7
|
+
placeholder="Search"
|
|
8
|
+
v-model="searchInput"
|
|
9
|
+
@keyup="search(searchInput)"
|
|
10
|
+
clearable
|
|
11
|
+
@clear="clearSearchClicked"
|
|
12
|
+
></el-input>
|
|
13
|
+
<el-button
|
|
14
|
+
v-show="false"
|
|
15
|
+
type="primary"
|
|
16
|
+
class="button"
|
|
17
|
+
@click="search(searchInput)"
|
|
18
|
+
size="large"
|
|
19
|
+
>
|
|
20
|
+
Search
|
|
21
|
+
</el-button>
|
|
22
|
+
</el-row>
|
|
23
|
+
<el-row>
|
|
24
|
+
<el-col :span="12">
|
|
25
|
+
<span class="filter-text">
|
|
26
|
+
Curated:
|
|
27
|
+
</span>
|
|
28
|
+
<el-radio-group v-model="currentFilters['curated']" size="small" class="acuRadioGroup">
|
|
29
|
+
<el-radio-button
|
|
30
|
+
v-for="(value, key) in curatedFilters"
|
|
31
|
+
:key="key"
|
|
32
|
+
:label="key"
|
|
33
|
+
:value="value"
|
|
34
|
+
/>
|
|
35
|
+
</el-radio-group>
|
|
36
|
+
</el-col>
|
|
37
|
+
<el-col :span="12">
|
|
38
|
+
<span class="filter-text">
|
|
39
|
+
On MRI:
|
|
40
|
+
</span>
|
|
41
|
+
<el-radio-group v-model="currentFilters['mri']" size="small" class="acuRadioGroup">
|
|
42
|
+
<el-radio-button
|
|
43
|
+
v-for="(value, key) in mriFilters"
|
|
44
|
+
:key="key"
|
|
45
|
+
:label="key"
|
|
46
|
+
:value="value"
|
|
47
|
+
/>
|
|
48
|
+
</el-radio-group>
|
|
49
|
+
</el-col>
|
|
50
|
+
</el-row>
|
|
51
|
+
<el-row>
|
|
52
|
+
<el-col :span="12">
|
|
53
|
+
<span class="filter-text">
|
|
54
|
+
WHO approved:
|
|
55
|
+
</span>
|
|
56
|
+
<el-radio-group v-model="currentFilters['who']" size="small" class="acuRadioGroup">
|
|
57
|
+
<el-radio-button
|
|
58
|
+
v-for="(value, key) in whoFilters"
|
|
59
|
+
:key="key"
|
|
60
|
+
:label="key"
|
|
61
|
+
:value="value"
|
|
62
|
+
/>
|
|
63
|
+
</el-radio-group>
|
|
64
|
+
</el-col>
|
|
65
|
+
</el-row>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="content scrollbar" ref="content">
|
|
68
|
+
<div v-if="paginatedResults.length > 0" v-for="result in paginatedResults" :key="result.Acupoint" class="step-item">
|
|
69
|
+
<AcupointsCard
|
|
70
|
+
class="dataset-card"
|
|
71
|
+
:entry="result"
|
|
72
|
+
@mouseenter="hoverChanged(result)"
|
|
73
|
+
@mouseleave="hoverChanged(undefined)"
|
|
74
|
+
/>
|
|
75
|
+
</div>
|
|
76
|
+
<div v-else class="error-feedback">
|
|
77
|
+
No results found - Please change your search / filter criteria.
|
|
78
|
+
</div>
|
|
79
|
+
<el-pagination
|
|
80
|
+
class="pagination"
|
|
81
|
+
v-model:current-page="page"
|
|
82
|
+
hide-on-single-page
|
|
83
|
+
large
|
|
84
|
+
layout="prev, pager, next"
|
|
85
|
+
:page-size="numberPerPage"
|
|
86
|
+
:total="numberOfHits"
|
|
87
|
+
@current-change="pageChange"
|
|
88
|
+
></el-pagination>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
</template>
|
|
92
|
+
|
|
93
|
+
<script>
|
|
94
|
+
/* eslint-disable no-alert, no-console */
|
|
95
|
+
import {
|
|
96
|
+
ElButton as Button,
|
|
97
|
+
ElCard as Card,
|
|
98
|
+
ElCol as Col,
|
|
99
|
+
ElRadioButton as RadioButton,
|
|
100
|
+
ElRadioGroup as RadioGroup,
|
|
101
|
+
ElDrawer as Drawer,
|
|
102
|
+
ElIcon as Icon,
|
|
103
|
+
ElInput as Input,
|
|
104
|
+
ElPagination as Pagination,
|
|
105
|
+
ElRow as Row,
|
|
106
|
+
} from 'element-plus'
|
|
107
|
+
import AcupointsCard from './AcupointsCard.vue'
|
|
108
|
+
|
|
109
|
+
export default {
|
|
110
|
+
components: {
|
|
111
|
+
AcupointsCard,
|
|
112
|
+
Button,
|
|
113
|
+
Card,
|
|
114
|
+
Col,
|
|
115
|
+
RadioButton,
|
|
116
|
+
RadioGroup,
|
|
117
|
+
Drawer,
|
|
118
|
+
Icon,
|
|
119
|
+
Input,
|
|
120
|
+
Pagination,
|
|
121
|
+
Row
|
|
122
|
+
},
|
|
123
|
+
name: 'AcupointsInfoSearch',
|
|
124
|
+
props: {
|
|
125
|
+
entry: {
|
|
126
|
+
type: Object,
|
|
127
|
+
default: () => {},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
data: function () {
|
|
131
|
+
return {
|
|
132
|
+
curatedFilters: {
|
|
133
|
+
"Yes": "Curated",
|
|
134
|
+
"No": "Uncurated",
|
|
135
|
+
"Both": "Both"
|
|
136
|
+
},
|
|
137
|
+
mriFilters: {
|
|
138
|
+
"Yes": "On",
|
|
139
|
+
"No": "Off",
|
|
140
|
+
"Both": "Both"
|
|
141
|
+
},
|
|
142
|
+
whoFilters: {
|
|
143
|
+
"Yes": "Yes",
|
|
144
|
+
"No": "No",
|
|
145
|
+
"Either": "Both"
|
|
146
|
+
},
|
|
147
|
+
currentFilters: {
|
|
148
|
+
curated: "Both",
|
|
149
|
+
mri: "Both",
|
|
150
|
+
who: "Yes",
|
|
151
|
+
},
|
|
152
|
+
previousFilters: {
|
|
153
|
+
curated: "Both",
|
|
154
|
+
mri: "Both",
|
|
155
|
+
who: "Both",
|
|
156
|
+
},
|
|
157
|
+
previousInput: undefined,
|
|
158
|
+
results: [],
|
|
159
|
+
paginatedResults: [],
|
|
160
|
+
searchInput: "",
|
|
161
|
+
lastSearch: "",
|
|
162
|
+
numberOfHits: 0,
|
|
163
|
+
numberPerPage: 10,
|
|
164
|
+
page: 1,
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
watch: {
|
|
168
|
+
currentFilters: {
|
|
169
|
+
handler: function () {
|
|
170
|
+
this.search(
|
|
171
|
+
this.searchInput,
|
|
172
|
+
this.numberPerPage,
|
|
173
|
+
this.page
|
|
174
|
+
)
|
|
175
|
+
},
|
|
176
|
+
immediate: true,
|
|
177
|
+
deep: true,
|
|
178
|
+
},
|
|
179
|
+
entry: {
|
|
180
|
+
handler: function () {
|
|
181
|
+
this.search(
|
|
182
|
+
this.searchInput,
|
|
183
|
+
this.numberPerPage,
|
|
184
|
+
this.page
|
|
185
|
+
)
|
|
186
|
+
},
|
|
187
|
+
immediate: true,
|
|
188
|
+
deep: true,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
methods: {
|
|
192
|
+
hoverChanged: function (data) {
|
|
193
|
+
this.$emit('hover-changed', data)
|
|
194
|
+
},
|
|
195
|
+
resetSearch: function () {
|
|
196
|
+
this.numberOfHits = 0
|
|
197
|
+
this.search(this.searchInput)
|
|
198
|
+
},
|
|
199
|
+
clearSearchClicked: function () {
|
|
200
|
+
this.searchInput = '';
|
|
201
|
+
this.search("");
|
|
202
|
+
},
|
|
203
|
+
searchUpdatedRequired: function(input) {
|
|
204
|
+
if (input !== this.previousInput) {
|
|
205
|
+
return true
|
|
206
|
+
}
|
|
207
|
+
for (const [key, value] of Object.entries(this.currentFilters)) {
|
|
208
|
+
if (value !== this.previousFilters[key]) {
|
|
209
|
+
return true
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
return false
|
|
213
|
+
},
|
|
214
|
+
getFilteredList: function() {
|
|
215
|
+
this.previousFilters['curated'] = this.currentFilters['curated']
|
|
216
|
+
this.previousFilters['mri'] = this.currentFilters['mri']
|
|
217
|
+
this.previousFilters['who'] = this.currentFilters['who']
|
|
218
|
+
let filteredList = Object.values(this.entry)
|
|
219
|
+
if (this.currentFilters['curated'] !== "Both") {
|
|
220
|
+
const curated = this.currentFilters['curated'] === "Curated" ? true : false
|
|
221
|
+
filteredList = filteredList.filter(
|
|
222
|
+
item => (item.Curated ? true : false) === curated)
|
|
223
|
+
}
|
|
224
|
+
if (this.currentFilters['mri'] !== "Both") {
|
|
225
|
+
const curated = this.currentFilters['mri'] === "On" ? true : false
|
|
226
|
+
filteredList = filteredList.filter(
|
|
227
|
+
item => (item.onMRI ? true : false) === curated)
|
|
228
|
+
}
|
|
229
|
+
if (this.currentFilters['who'] !== "Both") {
|
|
230
|
+
const who = this.currentFilters['who'] === "Yes" ? true : false
|
|
231
|
+
filteredList = filteredList.filter(
|
|
232
|
+
item => (item["Meridian Point"] ? true : false) === who)
|
|
233
|
+
}
|
|
234
|
+
return filteredList;
|
|
235
|
+
},
|
|
236
|
+
search: function(input) {
|
|
237
|
+
this.results = []
|
|
238
|
+
if (this.searchUpdatedRequired(input)) {
|
|
239
|
+
let filteredList = this.getFilteredList()
|
|
240
|
+
this.previousInput = this.input
|
|
241
|
+
if (input === "") {
|
|
242
|
+
this.results = filteredList
|
|
243
|
+
} else {
|
|
244
|
+
const lowerCase = input.toLowerCase()
|
|
245
|
+
for (const value of filteredList) {
|
|
246
|
+
const searchFields = [
|
|
247
|
+
value["Acupoint"],
|
|
248
|
+
value["Synonym"],
|
|
249
|
+
value["Chinese Name"],
|
|
250
|
+
value["English Name"],
|
|
251
|
+
value["Reference"],
|
|
252
|
+
value["Indications"],
|
|
253
|
+
value["Acupuncture Method"],
|
|
254
|
+
value["Vasculature"],
|
|
255
|
+
value["Innervation"],
|
|
256
|
+
value["Note"],
|
|
257
|
+
];
|
|
258
|
+
const allstrings = searchFields.join();
|
|
259
|
+
const myJSON = allstrings.toLowerCase();
|
|
260
|
+
if (myJSON.includes(lowerCase)) {
|
|
261
|
+
this.results.push(value)
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const start = this.numberPerPage * (this.page - 1)
|
|
267
|
+
this.paginatedResults = this.results.slice(start, start + this.numberPerPage)
|
|
268
|
+
this.numberOfHits = this.results.length
|
|
269
|
+
this.searchInput = input
|
|
270
|
+
this.lastSearch = input
|
|
271
|
+
},
|
|
272
|
+
numberPerPageUpdate: function (val) {
|
|
273
|
+
this.numberPerPage = val
|
|
274
|
+
this.pageChange(1)
|
|
275
|
+
},
|
|
276
|
+
pageChange: function (page) {
|
|
277
|
+
this.page = page
|
|
278
|
+
this.search( this.searchInput)
|
|
279
|
+
},
|
|
280
|
+
scrollToTop: function () {
|
|
281
|
+
if (this.$refs.content) {
|
|
282
|
+
this.$refs.content.scroll({ top: 0, behavior: 'smooth' })
|
|
283
|
+
}
|
|
284
|
+
},
|
|
285
|
+
resetPageNavigation: function () {
|
|
286
|
+
this.page = 1
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
}
|
|
290
|
+
</script>
|
|
291
|
+
|
|
292
|
+
<style lang="scss" scoped>
|
|
293
|
+
|
|
294
|
+
.acuRadioGroup {
|
|
295
|
+
padding-top: 8px;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.dataset-card {
|
|
299
|
+
position: relative;
|
|
300
|
+
|
|
301
|
+
&::before {
|
|
302
|
+
content: "";
|
|
303
|
+
display: block;
|
|
304
|
+
width: calc(100% - 15px);
|
|
305
|
+
height: 100%;
|
|
306
|
+
position: absolute;
|
|
307
|
+
top: 7px;
|
|
308
|
+
left: 7px;
|
|
309
|
+
border-style: solid;
|
|
310
|
+
border-radius: 5px;
|
|
311
|
+
border-color: transparent;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
&:hover {
|
|
315
|
+
&::before {
|
|
316
|
+
border-color: var(--el-color-primary);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.main {
|
|
322
|
+
font-size: 14px;
|
|
323
|
+
text-align: left;
|
|
324
|
+
line-height: 1.5em;
|
|
325
|
+
font-family: Asap, sans-serif, Helvetica;
|
|
326
|
+
font-weight: 400;
|
|
327
|
+
/* outline: thin red solid; */
|
|
328
|
+
overflow-y: auto;
|
|
329
|
+
scrollbar-width: thin;
|
|
330
|
+
min-width: 16rem;
|
|
331
|
+
background-color: #f7faff;
|
|
332
|
+
height: 100%;
|
|
333
|
+
border-left: 1px solid var(--el-border-color);
|
|
334
|
+
border-top: 1px solid var(--el-border-color);
|
|
335
|
+
display: flex;
|
|
336
|
+
flex-direction: column;
|
|
337
|
+
gap: 1rem;
|
|
338
|
+
padding: 1rem;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.step-item {
|
|
342
|
+
font-size: 14px;
|
|
343
|
+
margin-bottom: 8px;
|
|
344
|
+
text-align: left;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.search-input {
|
|
348
|
+
width: 298px !important;
|
|
349
|
+
height: 40px;
|
|
350
|
+
padding-right: 14px;
|
|
351
|
+
|
|
352
|
+
:deep(.el-input__inner) {
|
|
353
|
+
font-family: inherit;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
.header {
|
|
358
|
+
.el-button {
|
|
359
|
+
font-family: inherit;
|
|
360
|
+
|
|
361
|
+
&:hover,
|
|
362
|
+
&:focus {
|
|
363
|
+
background: $app-primary-color;
|
|
364
|
+
box-shadow: -3px 2px 4px #00000040;
|
|
365
|
+
color: #fff;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.pagination {
|
|
371
|
+
padding-bottom: 16px;
|
|
372
|
+
background-color: white;
|
|
373
|
+
padding-left: 95px;
|
|
374
|
+
font-weight: bold;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.pagination :deep(button) {
|
|
378
|
+
background-color: white !important;
|
|
379
|
+
}
|
|
380
|
+
.pagination :deep(li) {
|
|
381
|
+
background-color: white !important;
|
|
382
|
+
}
|
|
383
|
+
.pagination :deep(li.is-active) {
|
|
384
|
+
color: $app-primary-color;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.error-feedback {
|
|
388
|
+
font-family: Asap;
|
|
389
|
+
font-size: 14px;
|
|
390
|
+
font-style: italic;
|
|
391
|
+
padding-top: 15px;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
.content-card :deep(.el-card__header) {
|
|
395
|
+
background-color: #292b66;
|
|
396
|
+
padding: 1rem;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
.content-card :deep(.el-card__body) {
|
|
400
|
+
background-color: #f7faff;
|
|
401
|
+
overflow-y: hidden;
|
|
402
|
+
padding: 1rem;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
.content {
|
|
406
|
+
// width: 515px;
|
|
407
|
+
flex: 1 1 auto;
|
|
408
|
+
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
|
409
|
+
border: solid 1px #e4e7ed;
|
|
410
|
+
background-color: #ffffff;
|
|
411
|
+
overflow-y: scroll;
|
|
412
|
+
scrollbar-width: thin;
|
|
413
|
+
border-radius: var(--el-border-radius-base);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.content :deep(.el-loading-spinner .path) {
|
|
417
|
+
stroke: $app-primary-color;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
.content :deep(.step-item:first-child .seperator-path) {
|
|
421
|
+
display: none;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.content :deep(.step-item:not(:first-child) .seperator-path) {
|
|
425
|
+
width: 455px;
|
|
426
|
+
height: 0px;
|
|
427
|
+
border: solid 1px #e4e7ed;
|
|
428
|
+
background-color: #e4e7ed;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.filter-text {
|
|
432
|
+
top:4px;
|
|
433
|
+
position:relative;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
.scrollbar::-webkit-scrollbar-track {
|
|
437
|
+
border-radius: 10px;
|
|
438
|
+
background-color: #f5f5f5;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
.scrollbar::-webkit-scrollbar {
|
|
442
|
+
width: 12px;
|
|
443
|
+
right: -12px;
|
|
444
|
+
background-color: #f5f5f5;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
.scrollbar::-webkit-scrollbar-thumb {
|
|
448
|
+
border-radius: 4px;
|
|
449
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
450
|
+
background-color: #979797;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
:deep(.el-input__suffix) {
|
|
454
|
+
padding-right: 0px;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
:deep(.my-drawer) {
|
|
458
|
+
background: rgba(0, 0, 0, 0);
|
|
459
|
+
box-shadow: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.error-feedback {
|
|
463
|
+
font-family: Asap;
|
|
464
|
+
font-size: 14px;
|
|
465
|
+
font-style: italic;
|
|
466
|
+
padding-top: 15px;
|
|
467
|
+
}
|
|
468
|
+
</style>
|
|
@@ -40,8 +40,6 @@
|
|
|
40
40
|
<li>
|
|
41
41
|
<strong>To find by multiple terms:</strong>
|
|
42
42
|
Searching for <code>nerve, vagus</code> will find data that contains either <code>nerve</code> OR <code>vagus</code>.
|
|
43
|
-
<br/>
|
|
44
|
-
Due to the limitation of the search engine, space between words in a comma block will be treated as comma when multiple terms search is active.
|
|
45
43
|
</li>
|
|
46
44
|
</ul>
|
|
47
45
|
</div>
|
|
@@ -64,6 +64,14 @@
|
|
|
64
64
|
@connectivity-item-close="onConnectivityItemClose"
|
|
65
65
|
/>
|
|
66
66
|
</template>
|
|
67
|
+
<template v-else-if="tab.type === 'acupoints' && acupointsInfoList">
|
|
68
|
+
<acupoints-info-search
|
|
69
|
+
:ref="'acupointsTab_' + tab.id"
|
|
70
|
+
:entry="acupointsInfoList"
|
|
71
|
+
@on-acupoints-click="acupointClicked"
|
|
72
|
+
v-show="tab.id === activeTabId"
|
|
73
|
+
/>
|
|
74
|
+
</template>
|
|
67
75
|
<template v-else>
|
|
68
76
|
<DatasetExplorer
|
|
69
77
|
class="sidebar-content-container"
|
|
@@ -92,6 +100,7 @@ import { ElDrawer as Drawer, ElIcon as Icon } from 'element-plus'
|
|
|
92
100
|
import DatasetExplorer from './DatasetExplorer.vue'
|
|
93
101
|
import EventBus from './EventBus.js'
|
|
94
102
|
import Tabs from './Tabs.vue'
|
|
103
|
+
import AcupointsInfoSearch from './AcupointsInfoSearch.vue'
|
|
95
104
|
import AnnotationTool from './AnnotationTool.vue'
|
|
96
105
|
import ConnectivityExplorer from './ConnectivityExplorer.vue'
|
|
97
106
|
import { removeShowAllFacets } from '../algolia/utils.js'
|
|
@@ -151,6 +160,13 @@ export default {
|
|
|
151
160
|
type: Array,
|
|
152
161
|
default: [],
|
|
153
162
|
},
|
|
163
|
+
/**
|
|
164
|
+
* The acupoints info to show in sidebar.
|
|
165
|
+
*/
|
|
166
|
+
acupointsInfoList: {
|
|
167
|
+
type: Object,
|
|
168
|
+
default: null,
|
|
169
|
+
},
|
|
154
170
|
/**
|
|
155
171
|
* The annotation data to show in sidebar.
|
|
156
172
|
*/
|
|
@@ -204,6 +220,13 @@ export default {
|
|
|
204
220
|
}
|
|
205
221
|
},
|
|
206
222
|
methods: {
|
|
223
|
+
/**
|
|
224
|
+
* This event is emitted with a mouse click on acupoint card
|
|
225
|
+
* @arg data
|
|
226
|
+
*/
|
|
227
|
+
acupointClicked: function (data) {
|
|
228
|
+
this.$emit('acupoints-clicked', data)
|
|
229
|
+
},
|
|
207
230
|
onConnectivityCollapseChange: function (data) {
|
|
208
231
|
this.$emit('connectivity-collapse-change', data)
|
|
209
232
|
},
|
|
@@ -295,9 +318,6 @@ export default {
|
|
|
295
318
|
datasetExplorerTabRef.openSearch(facets, query);
|
|
296
319
|
})
|
|
297
320
|
},
|
|
298
|
-
/**
|
|
299
|
-
* Get the ref id of the tab by id and type.
|
|
300
|
-
*/
|
|
301
321
|
getTabRef: function (id, type, switchTab = false) {
|
|
302
322
|
const matchedTab = this.tabEntries.filter((tabEntry) => {
|
|
303
323
|
return (id === undefined || tabEntry.id === id) &&
|
|
@@ -407,6 +427,14 @@ export default {
|
|
|
407
427
|
updateConnectivityError: function (errorInfo) {
|
|
408
428
|
EventBus.emit('connectivity-error', errorInfo);
|
|
409
429
|
},
|
|
430
|
+
openAcupointsSearch: function (term) {
|
|
431
|
+
this.drawerOpen = true
|
|
432
|
+
// Because refs are in v-for, nextTick is needed here
|
|
433
|
+
this.$nextTick(() => {
|
|
434
|
+
const tabRef = this.getTabRef(undefined, 'acupoints', true);
|
|
435
|
+
tabRef.search(term);
|
|
436
|
+
})
|
|
437
|
+
},
|
|
410
438
|
/**
|
|
411
439
|
* Store available anatomy facets data for connectivity list component
|
|
412
440
|
*/
|
|
@@ -503,6 +531,11 @@ export default {
|
|
|
503
531
|
// This should respect the information provided by the property
|
|
504
532
|
tabEntries: function () {
|
|
505
533
|
return this.tabs.filter((tab) =>
|
|
534
|
+
(tab.type === "acupoints" &&
|
|
535
|
+
(
|
|
536
|
+
this.acupointsInfoList &&
|
|
537
|
+
Object.keys(this.acupointsInfoList).length > 0
|
|
538
|
+
)) ||
|
|
506
539
|
tab.type === "datasetExplorer" ||
|
|
507
540
|
tab.type === "connectivityExplorer" ||
|
|
508
541
|
(
|
|
@@ -565,6 +598,16 @@ export default {
|
|
|
565
598
|
this.$emit('connectivity-source-change', payLoad);
|
|
566
599
|
})
|
|
567
600
|
|
|
601
|
+
// Emit acupoints clicked event
|
|
602
|
+
EventBus.on('acupoints-clicked', (payLoad) => {
|
|
603
|
+
this.$emit('acupoints-clicked', payLoad);
|
|
604
|
+
})
|
|
605
|
+
|
|
606
|
+
// Emit acupoints hovered event
|
|
607
|
+
EventBus.on('acupoints-hovered', (payLoad) => {
|
|
608
|
+
this.$emit('acupoints-hovered', payLoad);
|
|
609
|
+
})
|
|
610
|
+
|
|
568
611
|
// Get available anatomy facets for the connectivity info
|
|
569
612
|
EventBus.on('available-facets', (payLoad) => {
|
|
570
613
|
this.availableAnatomyFacets = payLoad.find((facet) => facet.label === 'Anatomical Structure').children
|
package/src/components.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export {}
|
|
|
7
7
|
|
|
8
8
|
declare module 'vue' {
|
|
9
9
|
export interface GlobalComponents {
|
|
10
|
+
AcupointsCard: typeof import('./components/AcupointsCard.vue')['default']
|
|
11
|
+
AcupointsInfoSearch: typeof import('./components/AcupointsInfoSearch.vue')['default']
|
|
10
12
|
AnnotationTool: typeof import('./components/AnnotationTool.vue')['default']
|
|
11
13
|
BadgesGroup: typeof import('./components/BadgesGroup.vue')['default']
|
|
12
14
|
ConnectivityCard: typeof import('./components/ConnectivityCard.vue')['default']
|
|
@@ -19,6 +21,8 @@ declare module 'vue' {
|
|
|
19
21
|
ElCascader: typeof import('element-plus/es')['ElCascader']
|
|
20
22
|
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
21
23
|
ElCol: typeof import('element-plus/es')['ElCol']
|
|
24
|
+
ElCollapse: typeof import('element-plus/es')['ElCollapse']
|
|
25
|
+
ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
|
|
22
26
|
ElDrawer: typeof import('element-plus/es')['ElDrawer']
|
|
23
27
|
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
|
24
28
|
ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
|
|
@@ -38,6 +42,7 @@ declare module 'vue' {
|
|
|
38
42
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
|
39
43
|
ElPopover: typeof import('element-plus/es')['ElPopover']
|
|
40
44
|
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
45
|
+
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
|
41
46
|
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
42
47
|
ElRow: typeof import('element-plus/es')['ElRow']
|
|
43
48
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
async function getReferenceConnectivitiesFromStorage(resource) {
|
|
2
|
+
const flatmapKnowledgeRaw = sessionStorage.getItem('flatmap-knowledge');
|
|
3
|
+
|
|
4
|
+
if (flatmapKnowledgeRaw) {
|
|
5
|
+
const flatmapKnowledge = JSON.parse(flatmapKnowledgeRaw);
|
|
6
|
+
const dataWithRefs = flatmapKnowledge.filter((x) => x.references && x.references.length);
|
|
7
|
+
const foundData = dataWithRefs.filter((x) => x.references.includes(resource));
|
|
8
|
+
|
|
9
|
+
if (foundData.length) {
|
|
10
|
+
const featureIds = foundData.map((x) => x.id);
|
|
11
|
+
return featureIds;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async function getReferenceConnectivitiesByAPI(mapImp, resource, flatmapQueries) {
|
|
18
|
+
const knowledgeSource = getKnowledgeSource(mapImp);
|
|
19
|
+
const sql = `select knowledge from knowledge
|
|
20
|
+
where source="${knowledgeSource}" and
|
|
21
|
+
knowledge like "%${resource}%" order by source desc`;
|
|
22
|
+
console.log(sql)
|
|
23
|
+
const response = await flatmapQueries.flatmapQuery(sql);
|
|
24
|
+
const mappedData = response.values.map((x) => x[0]);
|
|
25
|
+
const parsedData = mappedData.map((x) => JSON.parse(x));
|
|
26
|
+
const featureIds = parsedData.map((x) => x.id);
|
|
27
|
+
return featureIds;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getKnowledgeSource(mapImp) {
|
|
31
|
+
let mapKnowledgeSource = '';
|
|
32
|
+
if (mapImp.provenance?.connectivity) {
|
|
33
|
+
const sckanProvenance = mapImp.provenance.connectivity;
|
|
34
|
+
if ('knowledge-source' in sckanProvenance) {
|
|
35
|
+
mapKnowledgeSource = sckanProvenance['knowledge-source'];
|
|
36
|
+
} else if ('npo' in sckanProvenance) {
|
|
37
|
+
mapKnowledgeSource = `${sckanProvenance.npo.release}-npo`;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return mapKnowledgeSource;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function loadAndStoreKnowledge(mapImp, flatmapQueries) {
|
|
45
|
+
const knowledgeSource = getKnowledgeSource(mapImp);
|
|
46
|
+
const sql = `select knowledge from knowledge
|
|
47
|
+
where source="${knowledgeSource}"
|
|
48
|
+
order by source desc`;
|
|
49
|
+
const flatmapKnowledge = sessionStorage.getItem('flatmap-knowledge');
|
|
50
|
+
|
|
51
|
+
if (!flatmapKnowledge) {
|
|
52
|
+
flatmapQueries.flatmapQuery(sql).then((response) => {
|
|
53
|
+
const mappedData = response.values.map(x => x[0]);
|
|
54
|
+
const parsedData = mappedData.map(x => JSON.parse(x));
|
|
55
|
+
sessionStorage.setItem('flatmap-knowledge', JSON.stringify(parsedData));
|
|
56
|
+
updateFlatmapKnowledgeCache();
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function updateFlatmapKnowledgeCache() {
|
|
62
|
+
const CACHE_LIFETIME = 24 * 60 * 60 * 1000; // One day
|
|
63
|
+
const now = new Date();
|
|
64
|
+
const expiry = now.getTime() + CACHE_LIFETIME;
|
|
65
|
+
|
|
66
|
+
sessionStorage.setItem('flatmap-knowledge-expiry', expiry);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function removeFlatmapKnowledgeCache() {
|
|
70
|
+
const keys = [
|
|
71
|
+
'flatmap-knowledge',
|
|
72
|
+
'flatmap-knowledge-expiry',
|
|
73
|
+
];
|
|
74
|
+
keys.forEach((key) => {
|
|
75
|
+
sessionStorage.removeItem(key);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function refreshFlatmapKnowledgeCache() {
|
|
80
|
+
const expiry = sessionStorage.getItem('flatmap-knowledge-expiry');
|
|
81
|
+
const now = new Date();
|
|
82
|
+
|
|
83
|
+
if (now.getTime() > expiry) {
|
|
84
|
+
removeFlatmapKnowledgeCache();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
getReferenceConnectivitiesFromStorage,
|
|
90
|
+
getReferenceConnectivitiesByAPI,
|
|
91
|
+
loadAndStoreKnowledge,
|
|
92
|
+
getKnowledgeSource,
|
|
93
|
+
refreshFlatmapKnowledgeCache,
|
|
94
|
+
}
|