@abi-software/map-side-bar 2.11.3 → 2.11.4-acupoints.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abi-software/map-side-bar",
3
- "version": "2.11.3",
3
+ "version": "2.11.4-acupoints.1",
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.6",
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",
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,49 @@
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
+ },
18
+ "LU 2": {
19
+ "Acupoint": "LU 2",
20
+ "Label": "LU 2",
21
+ "Synonym": "Test data",
22
+ "UMLS CUI": "",
23
+ "Meridian": "LTest data",
24
+ "Chinese Name": "Yunmen",
25
+ "English Name": "Cloud Gate",
26
+ "Location": " z zxczc.",
27
+ "Reference": "Test data",
28
+ "Indications": "Test data",
29
+ "Acupuncture Method": "Test data",
30
+ "Vasculature": "Test data",
31
+ "Innervation": "Test data",
32
+ "Curated": true,
33
+ },
34
+ "ST 3": {
35
+ "Acupoint": "ST 3",
36
+ "Label": "ST 3",
37
+ "Synonym": "Test data",
38
+ "UMLS CUI": "",
39
+ "Meridian": "STest data",
40
+ "Chinese Name": "Cheng Qi",
41
+ "English Name": "Not Available",
42
+ "Location": " z zxcxadadadzc.",
43
+ "Reference": "Test data",
44
+ "Indications": "Test data",
45
+ "Acupuncture Method": "Test data",
46
+ "Vasculature": "Test data",
47
+ "Innervation": "Test data"
48
+ }
49
+ }
@@ -0,0 +1,212 @@
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">{{ entry.Acupoint }}</div>
12
+ <el-collapse class="collapse-card" v-model="expanded" @change="expandedChanged">
13
+ <el-collapse-item :title="showDetailsText" name="1" class="collapse-card">
14
+ <template v-for="field in displayFields" :key="field['name']">
15
+ <div class="details" >
16
+ <strong>{{ field['name'] }}: </strong>
17
+ <span
18
+ v-if="!field['isEditing']"
19
+ @click="field['isEditing'] = true"
20
+ >
21
+ {{ entry[field['name']] || 'Not Available' }}
22
+ </span>
23
+ <el-input
24
+ v-else
25
+ v-model="entry[field['name']]"
26
+ @blur="field['isEditing'] = false"
27
+ @keyup.enter="field['isEditing'] = false"
28
+ @vue:mounted="inputMounted"
29
+ type="textarea"
30
+ />
31
+ </div>
32
+ </template>
33
+ </el-collapse-item>
34
+ </el-collapse>
35
+ </div>
36
+ </div>
37
+ </div>
38
+ </div>
39
+ </template>
40
+
41
+ <script>
42
+ import EventBus from './EventBus.js'
43
+ /* eslint-disable no-alert, no-console */
44
+
45
+ export default {
46
+ data() {
47
+ return {
48
+ expanded: [],
49
+ displayFields: [
50
+ {name: "Synonym", isEditing: false},
51
+ {name: "Chinese Name", isEditing: false},
52
+ {name: "English Name", isEditing: false},
53
+ {name: "Reference", isEditing: false},
54
+ {name: "Indications", isEditing: false},
55
+ {name: "Acupuncture Method", isEditing: false},
56
+ {name: "Vasculature", isEditing: false},
57
+ {name: "Innervation", isEditing: false},
58
+ {name: "Notes", isEditing: false},
59
+ ]
60
+ }
61
+ },
62
+ name: 'AcupointsCard',
63
+ computed: {
64
+ showDetailsText: function() {
65
+ if (this.expanded.length > 0) {
66
+ return "Click here to hide information"
67
+ } else {
68
+ return "Click here to show more information"
69
+ }
70
+ }
71
+ },
72
+ props: {
73
+ /**
74
+ * Object containing information for
75
+ * the required viewing.
76
+ */
77
+ entry: {
78
+ type: Object,
79
+ default: () => {},
80
+ },
81
+ },
82
+ methods: {
83
+ expandedChanged: function() {
84
+ if (this.expanded.length > 0) {
85
+ EventBus.emit('acupoints-clicked', this.entry);
86
+ }
87
+ },
88
+ cardClicked: function (data) {
89
+ EventBus.emit('acupoints-clicked', data);
90
+ },
91
+ cardHovered: function (data) {
92
+ EventBus.emit('acupoints-hovered', data);
93
+ },
94
+ inputMounted: function(event) {
95
+ event.el?.querySelector('textarea')?.focus();
96
+ }
97
+ }
98
+ }
99
+ </script>
100
+
101
+ <style lang="scss" scoped>
102
+ .collapse-card {
103
+ border-top: none;
104
+ :deep(.el-collapse-item__header) {
105
+ border-bottom: none;
106
+ }
107
+ }
108
+
109
+ .dataset-card {
110
+ padding-left: 5px;
111
+ padding-right: 5px;
112
+ position: relative;
113
+ }
114
+
115
+ .title {
116
+ padding-bottom: 0.75rem;
117
+ font-family: Asap;
118
+ font-size: 14px;
119
+ font-weight: bold;
120
+ font-stretch: normal;
121
+ font-style: normal;
122
+ line-height: 1.5;
123
+ letter-spacing: 1.05px;
124
+ color: #484848;
125
+ cursor: pointer;
126
+ }
127
+ .card {
128
+ padding-top: 18px;
129
+ position: relative;
130
+ display: flex;
131
+ }
132
+
133
+ .card-left {
134
+ flex: 1;
135
+ }
136
+
137
+ .card-right {
138
+ flex: 1.3;
139
+ padding-left: 6px;
140
+ }
141
+
142
+ .button {
143
+ z-index: 10;
144
+ font-family: Asap;
145
+ font-size: 14px;
146
+ font-weight: normal;
147
+ font-stretch: normal;
148
+ font-style: normal;
149
+ line-height: normal;
150
+ letter-spacing: normal;
151
+ background-color: $app-primary-color;
152
+ border: $app-primary-color;
153
+ color: white;
154
+ cursor: pointer;
155
+ margin-top: 8px;
156
+ }
157
+
158
+ .button:hover {
159
+ background-color: $app-primary-color;
160
+ color: white;
161
+ }
162
+
163
+ .banner-img {
164
+ width: 128px;
165
+ height: 128px;
166
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.25);
167
+ background-color: #ffffff;
168
+ cursor: pointer;
169
+ }
170
+ .details {
171
+ font-family: Asap;
172
+ font-size: 14px;
173
+ font-weight: normal;
174
+ font-stretch: normal;
175
+ font-style: normal;
176
+ line-height: 1.5;
177
+ letter-spacing: 1.05px;
178
+ color: #484848;
179
+ }
180
+
181
+ .badges-container {
182
+ margin-top: 0.75rem;
183
+ }
184
+
185
+ .loading-icon {
186
+ z-index: 20;
187
+ width: 40px;
188
+ height: 40px;
189
+ left: 80px;
190
+ }
191
+
192
+ .loading-icon :deep(.el-loading-mask) {
193
+ background-color: rgba(117, 190, 218, 0) !important;
194
+ }
195
+
196
+ .loading-icon :deep(.el-loading-spinner .path) {
197
+ stroke: $app-primary-color;
198
+ }
199
+
200
+ .float-button-container {
201
+ position: absolute;
202
+ bottom: 8px;
203
+ right: 16px;
204
+ opacity: 0;
205
+ visibility: hidden;
206
+
207
+ .card:hover & {
208
+ opacity: 1;
209
+ visibility: visible;
210
+ }
211
+ }
212
+ </style>