@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.12.4",
3
+ "version": "2.13.0-acupoint.0",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,7 +43,7 @@
43
43
  "./src/*": "./src/*"
44
44
  },
45
45
  "dependencies": {
46
- "@abi-software/gallery": "^1.2.0",
46
+ "@abi-software/gallery": "1.3.0",
47
47
  "@abi-software/map-utilities": "1.7.7",
48
48
  "@abi-software/svg-sprite": "^1.0.2",
49
49
  "@element-plus/icons-vue": "^2.3.1",
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,19 @@
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"
42
+ @acupoints-result="onAcupointsResult"
37
43
  @connectivity-collapse-change="onConnectivityCollapseChange"
38
44
  />
39
45
  </div>
@@ -42,6 +48,7 @@
42
48
  <script>
43
49
  /* eslint-disable no-alert, no-console */
44
50
  // optionally import default styles
51
+ import { acupointEntries } from './acupoints.js'
45
52
  import SideBar from './components/SideBar.vue'
46
53
  import EventBus from './components/EventBus.js'
47
54
  import exampleConnectivityInput from './exampleConnectivityInput.js'
@@ -121,6 +128,14 @@ export default {
121
128
  },
122
129
  data: function () {
123
130
  return {
131
+ acupoints: acupointEntries,
132
+ contextArray: [null, null],
133
+ tabArray: [
134
+ { title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false },
135
+ { title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false },
136
+ { title: 'Annotation', id: 3, type: 'annotation', closable: true },
137
+ {title: 'Acupoints', id: 4, type: 'acupoints' },
138
+ ],
124
139
  annotationEntry: [{
125
140
  featureId: "epicardium",
126
141
  resourceId: "https://mapcore-bucket1.s3-us-west-2.amazonaws.com/others/29_Jan_2020/heartICN_metadata.json",
@@ -134,7 +149,6 @@ export default {
134
149
  ALGOLIA_INDEX: import.meta.env.VITE_APP_ALGOLIA_INDEX,
135
150
  PENNSIEVE_API_LOCATION: import.meta.env.VITE_APP_PENNSIEVE_API_LOCATION,
136
151
  BL_SERVER_URL: import.meta.env.VITE_APP_BL_SERVER_URL,
137
- NL_LINK_PREFIX: import.meta.env.VITE_APP_NL_LINK_PREFIX,
138
152
  ROOT_URL: import.meta.env.VITE_APP_ROOT_URL,
139
153
  FLATMAPAPI_LOCATION: import.meta.env.VITE_FLATMAPAPI_LOCATION,
140
154
  },
@@ -156,6 +170,15 @@ 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
+ },
179
+ onAcupointsResult: function (data) {
180
+ console.log("acupoints-result", data)
181
+ },
159
182
  loadConnectivityKnowledge: async function () {
160
183
  const sql = `select knowledge from knowledge
161
184
  where source="${this.sckanVersion}"
@@ -232,6 +255,9 @@ export default {
232
255
  'http://purl.obolibrary.org/obo/UBERON_0001103'
233
256
  )
234
257
  },
258
+ searchAcupoints: function() {
259
+ this.$refs.sideBar.openAcupointsSearch("LU 1")
260
+ },
235
261
  singleFacets: function () {
236
262
  this.$refs.sideBar.addFilter({
237
263
  facet: 'Cardiovascular system',
@@ -406,4 +432,4 @@ body {
406
432
  align-items: center;
407
433
  gap: 0.5rem;
408
434
  }
409
- </style>
435
+ </style>./acupoints.js
@@ -0,0 +1,78 @@
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
+ "Curated": false,
17
+ "onMRI": true,
18
+ "Meridian Point": true,
19
+ "Link": "https://tara-repository.mgb.org/term_resolution/tara.html"
20
+ },
21
+ "LU 2": {
22
+ "Acupoint": "LU 2",
23
+ "Label": "LU 2",
24
+ "Synonym": "Test data",
25
+ "UMLS CUI": "",
26
+ "Meridian": "LTest data",
27
+ "Chinese Name": "Yunmen",
28
+ "English Name": "Cloud Gate",
29
+ "Location": " z zxczc.",
30
+ "Reference": "Test data",
31
+ "Indications": "Test data",
32
+ "Acupuncture Method": "Test data",
33
+ "Vasculature": "Test data",
34
+ "Innervation": "Test data",
35
+ "Curated": true,
36
+ "onMRI": true,
37
+ "Meridian Point": false,
38
+ "Link": "https://tara-repository.mgb.org/term_resolution/tara.html"
39
+ },
40
+ "ST 3": {
41
+ "Acupoint": "ST 3",
42
+ "Label": "ST 3",
43
+ "Synonym": "Test data",
44
+ "UMLS CUI": "",
45
+ "Meridian": "STest data",
46
+ "Chinese Name": "Cheng Qi",
47
+ "English Name": "Not Available",
48
+ "Location": " z zxcxadadadzc.",
49
+ "Reference": "Test data",
50
+ "Indications": "Test data",
51
+ "Acupuncture Method": "Test data",
52
+ "Vasculature": "Test data",
53
+ "Innervation": "Test data",
54
+ "Curated": true,
55
+ "onMRI": false,
56
+ "Meridian Point": false,
57
+ "Link": "https://tara-repository.mgb.org/term_resolution/tara.html"
58
+ },
59
+ "LR 4": {
60
+ "Acupoint": "LR 4",
61
+ "Label": "LR 4",
62
+ "Synonym": "Test data",
63
+ "UMLS CUI": "",
64
+ "Meridian": "STest data",
65
+ "Chinese Name": "Zhongfeng",
66
+ "English Name": "Not Available",
67
+ "Location": " z zxcxadadadzc.",
68
+ "Reference": "Test data",
69
+ "Indications": "Test data",
70
+ "Acupuncture Method": "Test data",
71
+ "Vasculature": "Test data",
72
+ "Innervation": "Test data",
73
+ "Curated": false,
74
+ "onMRI": false,
75
+ "Meridian Point": true,
76
+ "Link": "https://tara-repository.mgb.org/term_resolution/tara.html"
77
+ }
78
+ }
@@ -0,0 +1,286 @@
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
+ <el-collapse class="collapse-card" v-model="expanded" @change="expandedChanged">
12
+ <el-collapse-item :title="entry.Acupoint" name="1" class="collapse-card">
13
+ <template #title>
14
+ <div>
15
+ <span class="title">{{ entry.Acupoint }}</span>
16
+ <el-tag
17
+ v-for="tag in tags"
18
+ :key="tag.name"
19
+ :type="tag.type"
20
+ effect="plain"
21
+ class="acupointTags"
22
+ size="small"
23
+ >
24
+ {{ tag.name }}
25
+ </el-tag>
26
+ </div>
27
+ </template>
28
+ <template v-for="field in displayFields" :key="field['name']">
29
+ <div class="details" >
30
+ <strong>{{ field['name'] }}: </strong>
31
+ <template v-if="field['name'] === 'Link'">
32
+ <a :href="entry['Link']" target="_blank">
33
+ <span>
34
+ Click here for more information
35
+ </span>
36
+ </a>
37
+ </template>
38
+ <template v-else>
39
+ <span
40
+ v-if="!field['isEditing']"
41
+ @click="setFieldToEditing(field)"
42
+ >
43
+ {{ entry[field['name']] || 'Not Available' }}
44
+ </span>
45
+ <el-input
46
+ v-else
47
+ v-model="entry[field['name']]"
48
+ @blur="field['isEditing'] = false"
49
+ @keyup.enter="field['isEditing'] = false"
50
+ @vue:mounted="inputMounted"
51
+ type="textarea"
52
+ />
53
+ </template>
54
+ </div>
55
+ </template>
56
+ </el-collapse-item>
57
+ </el-collapse>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ </div>
62
+ </template>
63
+
64
+ <script>
65
+ import EventBus from './EventBus.js'
66
+ import {
67
+ ElCollapse as Collapse,
68
+ ElCollapseItem as CollapseItem,
69
+ ElTag as Tag
70
+ } from 'element-plus'
71
+ /* eslint-disable no-alert, no-console */
72
+
73
+ export default {
74
+ components: {
75
+ Collapse,
76
+ CollapseItem,
77
+ Tag
78
+ },
79
+ data() {
80
+ return {
81
+ expanded: [],
82
+ tags: [],
83
+ displayFields: [
84
+ {name: "Synonym", isEditing: false},
85
+ {name: "Chinese Name", isEditing: false},
86
+ {name: "English Name", isEditing: false},
87
+ {name: "Meridian", isEditing: false},
88
+ {name: "Reference", isEditing: false},
89
+ {name: "Indications", isEditing: false},
90
+ {name: "Acupuncture Method", isEditing: false},
91
+ {name: "Vasculature", isEditing: false},
92
+ {name: "Innervation", isEditing: false},
93
+ {name: "Link", isEditing: false},
94
+ //{name: "Notes", isEditing: false},
95
+ ]
96
+ }
97
+ },
98
+ name: 'AcupointsCard',
99
+ props: {
100
+ /**
101
+ * Object containing information for
102
+ * the required viewing.
103
+ */
104
+ entry: {
105
+ type: Object,
106
+ default: () => {},
107
+ },
108
+ allowEditing: {
109
+ type: Boolean,
110
+ default: false,
111
+ },
112
+ },
113
+ created: function () {
114
+ if (this.entry["Meridian Point"]) {
115
+ this.tags.push({ name: 'WHO', type: 'success' })
116
+ }
117
+ if (this.entry.Meridian) {
118
+ this.tags.push({ name: this.entry.Meridian, type: 'info' })
119
+ }
120
+ if (!this.entry.onMRI) {
121
+ this.tags.push({ name: 'Implied', type: 'info' })
122
+ }
123
+ if (this.entry.userDefined) {
124
+ this.tags.push({ name: 'User Defined', type: 'warning' })
125
+ }
126
+ },
127
+ methods: {
128
+ expandedChanged: function() {
129
+ if (this.expanded.length > 0) {
130
+ EventBus.emit('acupoints-clicked', this.entry);
131
+ }
132
+ },
133
+ cardClicked: function (data) {
134
+ EventBus.emit('acupoints-clicked', data);
135
+ },
136
+ cardHovered: function (data) {
137
+ EventBus.emit('acupoints-hovered', data);
138
+ },
139
+ inputMounted: function(event) {
140
+ event.el?.querySelector('textarea')?.focus();
141
+ },
142
+ setFieldToEditing: function(field) {
143
+ if (this.allowEditing) {
144
+ field['isEditing'] = true;
145
+ }
146
+ }
147
+ },
148
+ }
149
+ </script>
150
+
151
+ <style lang="scss" scoped>
152
+
153
+ :deep(.el-collapse-item__header) {
154
+ font-weight: bold;
155
+ }
156
+
157
+ :deep(.el-collapse-item__content) {
158
+ padding-bottom: 4px;
159
+ }
160
+
161
+ :deep(.el-collapse-item__wrap) {
162
+ border: none;
163
+ }
164
+
165
+ .collapse-card {
166
+ border-top: none;
167
+ :deep(.el-collapse-item__header) {
168
+ border-bottom: none;
169
+ }
170
+ }
171
+
172
+ .dataset-card {
173
+ padding-left: 5px;
174
+ padding-right: 5px;
175
+ position: relative;
176
+ }
177
+
178
+ .title {
179
+ padding-bottom: 0.75rem;
180
+ font-family: Asap;
181
+ font-size: 14px;
182
+ font-weight: bold;
183
+ font-stretch: normal;
184
+ font-style: normal;
185
+ line-height: 1.5;
186
+ letter-spacing: 1.05px;
187
+ color: #484848;
188
+ cursor: pointer;
189
+ }
190
+ .card {
191
+ padding-top: 12px;
192
+ position: relative;
193
+ display: flex;
194
+ }
195
+
196
+ .card-left {
197
+ flex: 1;
198
+ }
199
+
200
+ .card-right {
201
+ flex: 1.3;
202
+ padding-left: 6px;
203
+ }
204
+
205
+ .button {
206
+ z-index: 10;
207
+ font-family: Asap;
208
+ font-size: 14px;
209
+ font-weight: normal;
210
+ font-stretch: normal;
211
+ font-style: normal;
212
+ line-height: normal;
213
+ letter-spacing: normal;
214
+ background-color: $app-primary-color;
215
+ border: $app-primary-color;
216
+ color: white;
217
+ cursor: pointer;
218
+ margin-top: 8px;
219
+ }
220
+
221
+ .button:hover {
222
+ background-color: $app-primary-color;
223
+ color: white;
224
+ }
225
+
226
+ .banner-img {
227
+ width: 128px;
228
+ height: 128px;
229
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
230
+ background-color: #ffffff;
231
+ cursor: pointer;
232
+ }
233
+ .details {
234
+ font-family: Asap;
235
+ font-size: 14px;
236
+ font-weight: normal;
237
+ font-stretch: normal;
238
+ font-style: normal;
239
+ line-height: 1.5;
240
+ letter-spacing: 1.05px;
241
+ color: #484848;
242
+ }
243
+
244
+ .badges-container {
245
+ margin-top: 0.75rem;
246
+ }
247
+
248
+ .loading-icon {
249
+ z-index: 20;
250
+ width: 40px;
251
+ height: 40px;
252
+ left: 80px;
253
+ }
254
+
255
+ .loading-icon :deep(.el-loading-mask) {
256
+ background-color: rgba(117, 190, 218, 0) !important;
257
+ }
258
+
259
+ .loading-icon :deep(.el-loading-spinner .path) {
260
+ stroke: $app-primary-color;
261
+ }
262
+
263
+ .title {
264
+ font: inherit;
265
+ margin-top:4px;
266
+ padding-right:30px;
267
+ vertical-align:middle;
268
+ }
269
+
270
+ .acupointTags {
271
+ margin-right:4px;
272
+ }
273
+
274
+ .float-button-container {
275
+ position: absolute;
276
+ bottom: 8px;
277
+ right: 16px;
278
+ opacity: 0;
279
+ visibility: hidden;
280
+
281
+ .card:hover & {
282
+ opacity: 1;
283
+ visibility: visible;
284
+ }
285
+ }
286
+ </style>