@abi-software/map-utilities 1.3.3-beta.3 → 1.3.3-beta.5

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-utilities",
3
- "version": "1.3.3-beta.3",
3
+ "version": "1.3.3-beta.5",
4
4
  "files": [
5
5
  "dist/*",
6
6
  "src/*",
package/src/App.vue CHANGED
@@ -42,6 +42,7 @@ const showConnectivityGraph = ref(false);
42
42
  const connectivityGraphEntry = "ilxtr:neuron-type-aacar-13";
43
43
  // const connectivityGraphEntry = "ilxtr:sparc-nlp/kidney/134";
44
44
  const mapServer = "https://mapcore-demo.org/curation/flatmap/";
45
+ const sckanVersion = "sckan-2024-09-21-npo";
45
46
 
46
47
  onMounted(() => {
47
48
  console.log("🚀 ~ onMounted ~ appRef:", appRef.value);
@@ -548,6 +549,7 @@ function confirmCreate(value) {
548
549
  v-if="showConnectivityGraph"
549
550
  :entry="connectivityGraphEntry"
550
551
  :map-server="mapServer"
552
+ :sckanVersion="sckanVersion"
551
553
  />
552
554
  </div>
553
555
  </template>
@@ -252,8 +252,6 @@ const GRAPH_STYLE = [
252
252
  'style': {
253
253
  'width': 1,
254
254
  'line-color': 'dimgray',
255
- 'target-arrow-color': 'dimgray',
256
- 'target-arrow-shape': 'triangle',
257
255
  'curve-style': 'bezier'
258
256
  }
259
257
  },
@@ -49,6 +49,17 @@
49
49
 
50
50
  <template v-else>
51
51
  <span v-html="reference.citation[citationType]"></span>
52
+
53
+ <div class="reference-button-container">
54
+ <el-button
55
+ class="reference-icon-button"
56
+ size="small"
57
+ @click="showRelatedConnectivities(reference.resource)"
58
+ >
59
+ Show related connectivities
60
+ </el-button>
61
+ </div>
62
+
52
63
  <CopyToClipboard :content="reference.citation[citationType]" />
53
64
  </template>
54
65
  </template>
@@ -56,11 +67,33 @@
56
67
 
57
68
  <li v-for="reference of openLibReferences">
58
69
  <div v-html="formatCopyReference(reference)"></div>
70
+
71
+ <div class="reference-button-container">
72
+ <el-button
73
+ class="reference-icon-button"
74
+ size="small"
75
+ @click="showRelatedConnectivities(reference.resource)"
76
+ >
77
+ Show related connectivities
78
+ </el-button>
79
+ </div>
80
+
59
81
  <CopyToClipboard :content="formatCopyReference(reference)" />
60
82
  </li>
61
83
 
62
84
  <li v-for="reference of isbnDBReferences">
63
85
  <a :href="reference.url" target="_blank">{{ reference.url }}</a>
86
+
87
+ <div class="reference-button-container">
88
+ <el-button
89
+ class="reference-icon-button"
90
+ size="small"
91
+ @click="showRelatedConnectivities(reference.resource)"
92
+ >
93
+ Show related connectivities
94
+ </el-button>
95
+ </div>
96
+
64
97
  <CopyToClipboard :content="reference.url" />
65
98
  </li>
66
99
  </ul>
@@ -136,6 +169,9 @@ export default {
136
169
  this.getCitationText(CITATION_DEFAULT);
137
170
  },
138
171
  methods: {
172
+ showRelatedConnectivities: function (resource) {
173
+ this.$emit('show-reference-connectivities', resource);
174
+ },
139
175
  formatReferences: function (references) {
140
176
  const nonPubMedReferences = this.extractNonPubMedReferences(references);
141
177
  const pubMedReferences = references.filter((reference) => !nonPubMedReferences.includes(reference));
@@ -188,6 +224,7 @@ export default {
188
224
  formatNonPubMedReferences: async function (references) {
189
225
  const transformedReferences = [];
190
226
  const filteredReferences = references.filter((referenceURL) => referenceURL.indexOf('isbn') !== -1);
227
+
191
228
  const isbnIDs = filteredReferences.map((url) => {
192
229
  const isbnId = url.split('/').pop();
193
230
  return 'ISBN:' + isbnId;
@@ -195,6 +232,10 @@ export default {
195
232
  const isbnIDsKey = isbnIDs.join(',');
196
233
  const failedIDs = isbnIDs.slice();
197
234
 
235
+ const getOriginalURL = (id) => {
236
+ return filteredReferences.find((url) => url.includes(id));
237
+ };
238
+
198
239
  const openlibAPI = `https://openlibrary.org/api/books?bibkeys=${isbnIDsKey}&format=json`;
199
240
  const data = await this.fetchData(openlibAPI);
200
241
 
@@ -206,12 +247,15 @@ export default {
206
247
  const urlSegments = url.split('/');
207
248
  const endpointIndex = urlSegments.indexOf('books');
208
249
  const bookId = urlSegments[endpointIndex + 1];
250
+ const id = key.split(':')[1]; // Key => "ISBN:1234"
251
+ const resource = getOriginalURL(id);
209
252
 
210
253
  transformedReferences.push({
211
- id: key.split(':')[1], // Key => "ISBN:1234"
254
+ id: id,
212
255
  type: 'openlib',
213
256
  url: url,
214
257
  bookId: bookId,
258
+ resource: resource,
215
259
  });
216
260
  }
217
261
 
@@ -220,10 +264,13 @@ export default {
220
264
  // Data does not exist in OpenLibrary
221
265
  // Provide ISBNDB link for reference
222
266
  const url = `https://isbndb.com/book/${id}`;
267
+ const resource = getOriginalURL(id);
268
+
223
269
  transformedReferences.push({
224
270
  id: id,
225
271
  url: url,
226
- type: 'isbndb'
272
+ type: 'isbndb',
273
+ resource: resource,
227
274
  });
228
275
  });
229
276
 
@@ -234,7 +281,7 @@ export default {
234
281
 
235
282
  const str = decodeURIComponent(urlStr)
236
283
 
237
- let term = {id: '', type: '', citation: {}}
284
+ let term = {id: '', type: '', citation: {}, resource: urlStr}
238
285
 
239
286
  const names = this.getPubMedDomains()
240
287
 
@@ -674,6 +721,20 @@ export default {
674
721
  cursor: pointer;
675
722
  }
676
723
 
724
+ .reference-button-container {
725
+ margin-top: 0.5rem;
726
+ }
727
+
728
+ .reference-icon-button {
729
+ color: $app-primary-color !important;
730
+ background-color: #f9f2fc !important;
731
+ border-color: $app-primary-color !important;
732
+
733
+ &:hover {
734
+ background-color: transparent !important;
735
+ }
736
+ }
737
+
677
738
  @keyframes loadingAnimation {
678
739
  0% {
679
740
  background-position: -30vw 0;