@abi-software/map-side-bar 2.12.4 → 2.13.0-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.
@@ -0,0 +1,624 @@
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
+ </div>
24
+ <SearchFilters
25
+ v-if="filterEntry.options"
26
+ class="filters"
27
+ ref="filtersRef"
28
+ :entry="filterEntry"
29
+ @filterResults="filterUpdate"
30
+ @numberPerPage="numberPerPageUpdate"
31
+ @cascaderReady="cascaderReady"
32
+ ></SearchFilters>
33
+ <div class="content scrollbar" ref="content">
34
+ <div v-if="paginatedResults.length > 0" v-for="result in paginatedResults" :key="result.Acupoint" class="step-item">
35
+ <AcupointsCard
36
+ class="dataset-card"
37
+ :entry="result"
38
+ @mouseenter="hoverChanged(result)"
39
+ @mouseleave="hoverChanged(undefined)"
40
+ />
41
+ </div>
42
+ <div v-else class="error-feedback">
43
+ No results found - Please change your search / filter criteria.
44
+ </div>
45
+ <el-pagination
46
+ class="pagination"
47
+ v-model:current-page="page"
48
+ hide-on-single-page
49
+ large
50
+ layout="prev, pager, next"
51
+ :page-size="numberPerPage"
52
+ :total="numberOfHits"
53
+ @current-change="pageChange"
54
+ ></el-pagination>
55
+ </div>
56
+ </div>
57
+ </template>
58
+
59
+ <script>
60
+ /* eslint-disable no-alert, no-console */
61
+ import { markRaw } from 'vue';
62
+ import {
63
+ ElButton as Button,
64
+ ElCard as Card,
65
+ ElCol as Col,
66
+ ElRadioButton as RadioButton,
67
+ ElRadioGroup as RadioGroup,
68
+ ElDrawer as Drawer,
69
+ ElIcon as Icon,
70
+ ElInput as Input,
71
+ ElPagination as Pagination,
72
+ ElRow as Row,
73
+ } from 'element-plus'
74
+ import AcupointsCard from './AcupointsCard.vue'
75
+ import SearchFilters from "./SearchFilters.vue"
76
+
77
+ export default {
78
+ components: {
79
+ AcupointsCard,
80
+ Button,
81
+ Card,
82
+ Col,
83
+ RadioButton,
84
+ RadioGroup,
85
+ SearchFilters,
86
+ Drawer,
87
+ Icon,
88
+ Input,
89
+ Pagination,
90
+ Row
91
+ },
92
+ name: 'AcupointsInfoSearch',
93
+ props: {
94
+ entry: {
95
+ type: Object,
96
+ default: () => {},
97
+ },
98
+ },
99
+ created: function() {
100
+ if (this.entry) {
101
+ let entries = Object.values(this.entry)
102
+ const meridians = []
103
+ let others = false
104
+ entries.forEach((acupoint) => {
105
+ let meridian = acupoint.Meridian
106
+ if (!meridian) {
107
+ others = true
108
+ } else if (!(meridians.includes(meridian))) {
109
+ meridians.push(meridian)
110
+ }
111
+ });
112
+ meridians.sort();
113
+ if (others) {
114
+ meridians.push("Others")
115
+ }
116
+ if (meridians.length > 1) {
117
+ const filterOption = {
118
+ "key": "acupoints.meridian",
119
+ "label": "Meridian",
120
+ "children": [
121
+ ],
122
+ }
123
+ meridians.forEach(meridian => {
124
+ const entry = {
125
+ "key": `acupoints.meridian.${meridian}`,
126
+ "label": meridian,
127
+ "value": meridian,
128
+ }
129
+ filterOption.children.push(entry)
130
+ })
131
+ this.filterOptions.unshift(filterOption)
132
+ this.filters.unshift({
133
+ "facetPropPath": "acupoints.meridian",
134
+ "facet": "Show all",
135
+ "term": "Meridian"
136
+ })
137
+ }
138
+ }
139
+ },
140
+ computed: {
141
+ // This computed property populates filter data's entry object with $data from this sidebar
142
+ filterEntry: function () {
143
+ return {
144
+ numberOfHits: this.numberOfHits,
145
+ filterFacets: this.filters,
146
+ options: this.filterOptions,
147
+ showFilters: true,
148
+ };
149
+ },
150
+ },
151
+ data: function () {
152
+ return {
153
+ filters: [
154
+ {
155
+ "facetPropPath": "acupoints.WHO",
156
+ "facet": "WHO",
157
+ "term": "WHO",
158
+ "tagLabel": "WHO"
159
+ },
160
+ {
161
+ "facetPropPath": "acupoints.visualized",
162
+ "facet": "Show all",
163
+ "term": "Visualized"
164
+ },
165
+ {
166
+ "facetPropPath": "acupoints.implied",
167
+ "facet": "Show all",
168
+ "term": "Implied"
169
+ },
170
+ {
171
+ "facetPropPath": "acupoints.userDefined",
172
+ "facet": "Show all",
173
+ "term": "user"
174
+ }
175
+ ],
176
+ filterOptions: [
177
+ {
178
+ "key": "acupoints.visualized",
179
+ "label": "Visualized",
180
+ "children": [
181
+ {
182
+ "key": "acupoints.visualized.yes",
183
+ "label": "Visualized",
184
+ "value": "Visualized>Yes"
185
+ },
186
+ {
187
+ "key": "acupoints.visualized.no",
188
+ "label": "Non visualized",
189
+ "value": "Visualized>No"
190
+ },
191
+ ],
192
+ },
193
+ {
194
+ "key": "acupoints.implied",
195
+ "label": "Implied",
196
+ "children": [
197
+ {
198
+ "key": "acupoints.implied.yes",
199
+ "label": "Implied",
200
+ "value": "Implied>Yes"
201
+ },
202
+ {
203
+ "key": "acupoints.implied.no",
204
+ "label": "Non Implied",
205
+ "value": "Implied>No"
206
+ },
207
+ ],
208
+ },
209
+ {
210
+ "key": "acupoints.WHO",
211
+ "label": "WHO",
212
+ "children": [
213
+ {
214
+ "key": "acupoints.WHO.yes",
215
+ "label": "WHO",
216
+ "value": "WHO>Yes"
217
+ },
218
+ {
219
+ "key": "acupoints.WHO.no",
220
+ "label": "Non WHO",
221
+ "value": "WHO>No"
222
+ },
223
+ ],
224
+ },
225
+ {
226
+ "key": "acupoints.userDefined",
227
+ "label": "User Defined",
228
+ "children": [
229
+ {
230
+ "key": "acupoints.userDefined.yes",
231
+ "label": "User data",
232
+ "value": "userDefined>Yes"
233
+ },
234
+ {
235
+ "key": "acupoints.userDefined.no",
236
+ "label": "Official data",
237
+ "value": "userDefined>No"
238
+ },
239
+ ],
240
+ },
241
+ ],
242
+ currentFilters: markRaw({
243
+ curated: "Both",
244
+ mri: "Both",
245
+ who: "Both",
246
+ userDefined: "Both",
247
+ meridian: {
248
+ showAll: true,
249
+ list: []
250
+ },
251
+ }),
252
+ results: [],
253
+ paginatedResults: [],
254
+ searchInput: "",
255
+ lastSearch: "",
256
+ numberOfHits: 0,
257
+ numberPerPage: 10,
258
+ page: 1,
259
+ }
260
+ },
261
+ watch: {
262
+ entry: {
263
+ handler: function () {
264
+ this.filterUpdate(this.filters)
265
+ },
266
+ immediate: true,
267
+ deep: true,
268
+ },
269
+ },
270
+ methods: {
271
+ cascaderReady: function () {
272
+ this.cascaderIsReady = true;
273
+ this.search(this.searchInput);
274
+ },
275
+ filterUpdate: function (filters) {
276
+ this.filters = [...filters]
277
+ this.currentFilters['meridian']['list'] = []
278
+ this.filters.forEach((filter) => {
279
+ if (filter.facetPropPath === "acupoints.visualized") {
280
+ if (filter.facet === "Visualized") {
281
+ this.currentFilters['curated'] = 'Curated'
282
+ } else if (filter.facet === 'Non visualized') {
283
+ this.currentFilters['curated'] = 'Uncurated'
284
+ } else {
285
+ this.currentFilters['curated'] = 'Both'
286
+ }
287
+ }
288
+ if (filter.facetPropPath === "acupoints.implied") {
289
+ if (filter.facet === "Implied") {
290
+ this.currentFilters['mri'] = 'Off'
291
+ } else if (filter.facet === 'Non Implied') {
292
+ this.currentFilters['mri'] = 'On'
293
+ } else {
294
+ this.currentFilters['mri'] = 'Both'
295
+ }
296
+ }
297
+ if (filter.facetPropPath === "acupoints.WHO") {
298
+ if (filter.facet === "WHO") {
299
+ this.currentFilters['who'] = 'Yes'
300
+ } else if (filter.facet === 'Non who') {
301
+ this.currentFilters['who'] = 'No'
302
+ } else {
303
+ this.currentFilters['who'] = 'Both'
304
+ }
305
+ }
306
+ if (filter.facetPropPath === "acupoints.userDefined") {
307
+ if (filter.facet === "User data") {
308
+ this.currentFilters['userDefined'] = 'Yes'
309
+ } else if (filter.facet === 'Official data') {
310
+ this.currentFilters['userDefined'] = 'No'
311
+ } else {
312
+ this.currentFilters['userDefined'] = 'Both'
313
+ }
314
+ }
315
+ if (filter.facetPropPath === "acupoints.meridian") {
316
+ if (filter.facet === "Show all") {
317
+ this.currentFilters['meridian']['showAll'] = true
318
+ } else {
319
+ this.currentFilters['meridian']['showAll'] = false
320
+ this.currentFilters['meridian']['list'].push(filter.facet.toLowerCase())
321
+ }
322
+ }
323
+ });
324
+
325
+ this.search( this.searchInput)
326
+
327
+ //this.search();
328
+ // this.$emit("search-changed", {
329
+ // value: filters,
330
+ // tabType: "connectivity",
331
+ // type: "filter-update",
332
+ // });
333
+ },
334
+ numberPerPageUpdate: function (val) {
335
+ this.numberPerPage = val;
336
+ this.pageChange(1);
337
+ },
338
+ hoverChanged: function (data) {
339
+ this.$emit('hover-changed', data)
340
+ },
341
+ resetSearch: function () {
342
+ this.numberOfHits = 0
343
+ this.search(this.searchInput)
344
+ },
345
+ clearSearchClicked: function () {
346
+ this.searchInput = '';
347
+ this.search("");
348
+ },
349
+ getFilteredList: function() {
350
+ let filteredList = Object.values(this.entry)
351
+ if (this.currentFilters['curated'] !== "Both") {
352
+ const curated = this.currentFilters['curated'] === "Curated" ? true : false
353
+ filteredList = filteredList.filter(
354
+ item => (item.Curated ? true : false) === curated)
355
+ }
356
+ if (this.currentFilters['mri'] !== "Both") {
357
+ const mri = this.currentFilters['mri'] === "On" ? true : false
358
+ filteredList = filteredList.filter(
359
+ item => (item.onMRI ? true : false) === mri)
360
+ }
361
+ if (this.currentFilters['who'] !== "Both") {
362
+ const who = this.currentFilters['who'] === "Yes" ? true : false
363
+ filteredList = filteredList.filter(
364
+ item => (item["Meridian Point"] ? true : false) === who)
365
+ }
366
+ if (this.currentFilters['userDefined'] !== "Both") {
367
+ const user = this.currentFilters['userDefined'] === "Yes" ? true : false
368
+ filteredList = filteredList.filter(
369
+ item => (item["userDefined"] ? true : false) === user)
370
+ }
371
+ if (!this.currentFilters['meridian']['showAll']) {
372
+ filteredList = filteredList.filter((item) => {
373
+ let meridian = "others"
374
+ if (item.Meridian) {
375
+ meridian = item.Meridian.toLowerCase()
376
+ }
377
+ return this.currentFilters['meridian']['list'].includes(meridian)
378
+ })
379
+ }
380
+ return filteredList;
381
+ },
382
+ search: function(input) {
383
+ this.results = []
384
+ let filteredList = this.getFilteredList()
385
+ if (input === "") {
386
+ this.results = filteredList
387
+ } else {
388
+ const lowerCase = input.toLowerCase()
389
+ for (const value of filteredList) {
390
+ const searchFields = [
391
+ value["Acupoint"],
392
+ value["Synonym"],
393
+ value["Chinese Name"],
394
+ value["English Name"],
395
+ value["Reference"],
396
+ value["Indications"],
397
+ value["Acupuncture Method"],
398
+ value["Vasculature"],
399
+ value["Innervation"],
400
+ value["Note"],
401
+ ];
402
+ const allstrings = searchFields.join();
403
+ const myJSON = allstrings.toLowerCase();
404
+ if (myJSON.includes(lowerCase)) {
405
+ this.results.push(value)
406
+ }
407
+ }
408
+ }
409
+ this.results.sort((a, b) => {
410
+ if (a["Meridian Point"] == b["Meridian Point"]) {
411
+ return 0
412
+ } else if (a["Meridian Point"]) {
413
+ return -1
414
+ } else {
415
+ return 1
416
+ }
417
+ })
418
+
419
+ const start = this.numberPerPage * (this.page - 1)
420
+ this.paginatedResults = this.results.slice(start, start + this.numberPerPage)
421
+ this.numberOfHits = this.results.length
422
+ this.searchInput = input
423
+ this.lastSearch = input
424
+ this.$emit("acupoints-result", {
425
+ list: this.results
426
+ });
427
+ },
428
+ numberPerPageUpdate: function (val) {
429
+ this.numberPerPage = val
430
+ this.pageChange(1)
431
+ },
432
+ pageChange: function (page) {
433
+ this.page = page
434
+ this.search( this.searchInput)
435
+ },
436
+ scrollToTop: function () {
437
+ if (this.$refs.content) {
438
+ this.$refs.content.scroll({ top: 0, behavior: 'smooth' })
439
+ }
440
+ },
441
+ resetPageNavigation: function () {
442
+ this.page = 1
443
+ },
444
+ },
445
+ }
446
+ </script>
447
+
448
+ <style lang="scss" scoped>
449
+
450
+ .acuRadioGroup {
451
+ padding-top: 8px;
452
+ }
453
+
454
+ .dataset-card {
455
+ position: relative;
456
+
457
+ &::before {
458
+ content: "";
459
+ display: block;
460
+ width: calc(100% - 15px);
461
+ height: 100%;
462
+ position: absolute;
463
+ top: 7px;
464
+ left: 7px;
465
+ border-style: solid;
466
+ border-radius: 5px;
467
+ border-color: transparent;
468
+ }
469
+
470
+ &:hover {
471
+ &::before {
472
+ border-color: var(--el-color-primary);
473
+ }
474
+ }
475
+ }
476
+
477
+ .main {
478
+ font-size: 14px;
479
+ text-align: left;
480
+ line-height: 1.5em;
481
+ font-family: Asap, sans-serif, Helvetica;
482
+ font-weight: 400;
483
+ /* outline: thin red solid; */
484
+ overflow-y: auto;
485
+ scrollbar-width: thin;
486
+ min-width: 16rem;
487
+ background-color: #f7faff;
488
+ height: 100%;
489
+ border-left: 1px solid var(--el-border-color);
490
+ border-top: 1px solid var(--el-border-color);
491
+ display: flex;
492
+ flex-direction: column;
493
+ gap: 1rem;
494
+ padding: 1rem;
495
+ }
496
+
497
+ .step-item {
498
+ font-size: 14px;
499
+ margin-bottom: 8px;
500
+ text-align: left;
501
+ }
502
+
503
+ .search-input {
504
+ width: 298px !important;
505
+ height: 40px;
506
+ padding-right: 14px;
507
+
508
+ :deep(.el-input__inner) {
509
+ font-family: inherit;
510
+ }
511
+ }
512
+
513
+ .header {
514
+ .el-button {
515
+ font-family: inherit;
516
+
517
+ &:hover,
518
+ &:focus {
519
+ background: $app-primary-color;
520
+ box-shadow: -3px 2px 4px #00000040;
521
+ color: #fff;
522
+ }
523
+ }
524
+ }
525
+
526
+ .pagination {
527
+ padding-bottom: 16px;
528
+ background-color: white;
529
+ padding-left: 95px;
530
+ font-weight: bold;
531
+ }
532
+
533
+ .pagination :deep(button) {
534
+ background-color: white !important;
535
+ }
536
+ .pagination :deep(li) {
537
+ background-color: white !important;
538
+ }
539
+ .pagination :deep(li.is-active) {
540
+ color: $app-primary-color;
541
+ }
542
+
543
+ .error-feedback {
544
+ font-family: Asap;
545
+ font-size: 14px;
546
+ font-style: italic;
547
+ padding-top: 15px;
548
+ }
549
+
550
+ .content-card :deep(.el-card__header) {
551
+ background-color: #292b66;
552
+ padding: 1rem;
553
+ }
554
+
555
+ .content-card :deep(.el-card__body) {
556
+ background-color: #f7faff;
557
+ overflow-y: hidden;
558
+ padding: 1rem;
559
+ }
560
+
561
+ .content {
562
+ // width: 515px;
563
+ flex: 1 1 auto;
564
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
565
+ border: solid 1px #e4e7ed;
566
+ background-color: #ffffff;
567
+ overflow-y: scroll;
568
+ scrollbar-width: thin;
569
+ border-radius: var(--el-border-radius-base);
570
+ }
571
+
572
+ .content :deep(.el-loading-spinner .path) {
573
+ stroke: $app-primary-color;
574
+ }
575
+
576
+ .content :deep(.step-item:first-child .seperator-path) {
577
+ display: none;
578
+ }
579
+
580
+ .content :deep(.step-item:not(:first-child) .seperator-path) {
581
+ width: 455px;
582
+ height: 0px;
583
+ border: solid 1px #e4e7ed;
584
+ background-color: #e4e7ed;
585
+ }
586
+
587
+ .filter-text {
588
+ top:4px;
589
+ position:relative;
590
+ }
591
+
592
+ .scrollbar::-webkit-scrollbar-track {
593
+ border-radius: 10px;
594
+ background-color: #f5f5f5;
595
+ }
596
+
597
+ .scrollbar::-webkit-scrollbar {
598
+ width: 12px;
599
+ right: -12px;
600
+ background-color: #f5f5f5;
601
+ }
602
+
603
+ .scrollbar::-webkit-scrollbar-thumb {
604
+ border-radius: 4px;
605
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
606
+ background-color: #979797;
607
+ }
608
+
609
+ :deep(.el-input__suffix) {
610
+ padding-right: 0px;
611
+ }
612
+
613
+ :deep(.my-drawer) {
614
+ background: rgba(0, 0, 0, 0);
615
+ box-shadow: none;
616
+ }
617
+
618
+ .error-feedback {
619
+ font-family: Asap;
620
+ font-size: 14px;
621
+ font-style: italic;
622
+ padding-top: 15px;
623
+ }
624
+ </style>
@@ -32,12 +32,6 @@ export default {
32
32
  return []
33
33
  },
34
34
  },
35
- datasetBiolucida: {
36
- type: Object,
37
- default: () => {
38
- return {}
39
- },
40
- },
41
35
  entry: {
42
36
  type: Object,
43
37
  default: () => {
@@ -72,15 +66,6 @@ export default {
72
66
  },
73
67
  },
74
68
  watch: {
75
- datasetBiolucida: {
76
- deep: true,
77
- immediate: true,
78
- handler: function (biolucidaData) {
79
- if ('dataset_images' in biolucidaData) {
80
- this.addToCategories(biolucidaData['dataset_images'], 'Images')
81
- }
82
- },
83
- },
84
69
  entry: {
85
70
  deep: true,
86
71
  immediate: true,
@@ -88,7 +73,6 @@ export default {
88
73
  this.addToCategories(this.entry.flatmaps, 'Flatmaps')
89
74
  this.addToCategories(this.entry.plots, 'Plots')
90
75
  this.addToCategories(this.entry.scaffolds, 'Scaffolds')
91
- this.addToCategories(this.entry.segmentation, 'Segmentations')
92
76
  this.addSimulationsToCategories(this.entry.simulation)
93
77
  /** disable the following
94
78
  this.addToCategories(this.entry.images, 'Images');
@@ -117,7 +101,7 @@ export default {
117
101
  color: #fff!important;
118
102
  }
119
103
  }
120
-
104
+
121
105
  .tag-button + .tag-button {
122
106
  margin-left: 0!important;
123
107
  }