@abi-software/map-side-bar 2.12.2 → 2.12.4-acupoint.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.
@@ -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:&nbsp;&nbsp;
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:&nbsp;&nbsp;
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:&nbsp;&nbsp;
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
+ "Both": "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>
@@ -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
  }
@@ -12,7 +12,6 @@
12
12
  :envVars="envVars"
13
13
  :label="label"
14
14
  :datasetThumbnail="thumbnail"
15
- :dataset-biolucida="biolucidaData"
16
15
  :category="currentCategory"
17
16
  @card-clicked="galleryClicked"
18
17
  @datalink-clicked="galleryDatalinkClicked"
@@ -42,7 +41,6 @@
42
41
  <div class="badges-container">
43
42
  <BadgesGroup
44
43
  :entry="entry"
45
- :dataset-biolucida="biolucidaData"
46
44
  @categoryChanged="categoryChanged"
47
45
  />
48
46
  </div>
@@ -60,7 +58,6 @@
60
58
  <script>
61
59
  /* eslint-disable no-alert, no-console */
62
60
  import { View as ElIconView } from '@element-plus/icons-vue'
63
- import { Base64 } from 'js-base64';
64
61
  import BadgesGroup from './BadgesGroup.vue'
65
62
  import {
66
63
  ElButton as Button,
@@ -109,7 +106,6 @@ export default {
109
106
  loading: true,
110
107
  version: 1,
111
108
  lastDoi: undefined,
112
- biolucidaData: undefined,
113
109
  currentCategory: 'All',
114
110
  copyContent: '',
115
111
  }
@@ -237,7 +233,6 @@ export default {
237
233
  this.discoverId = data.id
238
234
  this.version = data.version
239
235
  this.dataLocation = `https://sparc.science/datasets/${data.id}?type=dataset`
240
- this.getBiolucidaInfo()
241
236
  this.loading = false
242
237
  this.updateCopyContent();
243
238
  })
@@ -252,31 +247,6 @@ export default {
252
247
  lastName: function (fullName) {
253
248
  return fullName.split(',')[0]
254
249
  },
255
- getBiolucidaInfo: function () {
256
- const dataset_images = [];
257
- const biolucida2DItems = 'biolucida-2d' in this.entry ? this.entry['biolucida-2d'] :[];
258
- const biolucida3DItems = 'biolucida-3d' in this.entry ? this.entry['biolucida-3d'] :[];
259
- // We use information from SciCrunch to create the sharelink
260
- biolucida2DItems.concat(biolucida3DItems).forEach((bObject) => {
261
- const image_id = bObject.biolucida?.identifier;
262
- if (image_id) {
263
- const sourcepkg_id = 'identifier' in bObject ? bObject['identifier'] : "";
264
- // The encoded string is in the following format -
265
- // ${image_id}-col-${collection_id}, collection id can be any valid collection id
266
- // and 260 is used for now.
267
- const code = encodeURIComponent(Base64.encode(`${image_id}-col-260`));
268
- const share_link = `https://sparc.biolucida.net/image?c=${code}`
269
- dataset_images.push({
270
- share_link,
271
- image_id,
272
- sourcepkg_id,
273
- });
274
- }
275
- });
276
- if (dataset_images.length > 0) {
277
- this.biolucidaData = { dataset_images };
278
- }
279
- },
280
250
  updateCopyContent: function () {
281
251
  const contentArray = [];
282
252
 
@@ -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>
@@ -501,7 +499,6 @@ export default {
501
499
  element['abi-contextual-information'].length > 0
502
500
  ? element['abi-contextual-information']
503
501
  : undefined,
504
- segmentation: element['mbf-segmentation'],
505
502
  //omex format will be the preferred mimetype
506
503
  simulation: element['abi-simulation-omex-file'] ? element['abi-simulation-omex-file'] : element['abi-simulation-file'],
507
504
  flatmaps: element['abi-flatmap-file'],