@abi-software/map-utilities 1.4.3-beta.1 → 1.4.3-isan.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/dist/map-utilities.js +17535 -34359
- package/dist/map-utilities.umd.cjs +67 -246
- package/dist/style.css +1 -1
- package/package.json +1 -6
- package/src/App.vue +100 -41
- package/src/components/ConnectivityList/ConnectivityList.vue +0 -14
- package/src/components/Tooltip/ExternalResourceCard.vue +39 -69
- package/src/components/Tooltip/ProvenancePopup.vue +109 -149
- package/src/components/Tooltip/Tooltip.vue +1 -1
- package/src/components/utilities.js +0 -40
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-utilities",
|
|
3
|
-
"version": "1.4.3-
|
|
3
|
+
"version": "1.4.3-isan.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/*",
|
|
6
6
|
"src/*",
|
|
@@ -30,11 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@abi-software/svg-sprite": "^1.0.1",
|
|
33
|
-
"@citation-js/core": "^0.7.14",
|
|
34
|
-
"@citation-js/plugin-bibtex": "^0.7.17",
|
|
35
|
-
"@citation-js/plugin-csl": "^0.7.14",
|
|
36
|
-
"@citation-js/plugin-doi": "^0.7.16",
|
|
37
|
-
"@citation-js/plugin-pubmed": "^0.3.0",
|
|
38
33
|
"@element-plus/icons-vue": "^2.3.1",
|
|
39
34
|
"cytoscape": "^3.30.2",
|
|
40
35
|
"element-plus": "2.8.4",
|
package/src/App.vue
CHANGED
|
@@ -130,7 +130,7 @@ function onActionClick(value) {
|
|
|
130
130
|
* Tooltip
|
|
131
131
|
*/
|
|
132
132
|
const tooltipDisplay = ref(false);
|
|
133
|
-
const tooltipEntry = ref(
|
|
133
|
+
const tooltipEntry = ref([]);
|
|
134
134
|
const featuresAlert = ref(undefined);
|
|
135
135
|
const annotationDisplay = ref(false);
|
|
136
136
|
const annotationEntry = ref({});
|
|
@@ -141,33 +141,90 @@ provide(/* key */ "userApiKey", /* value */ undefined);
|
|
|
141
141
|
|
|
142
142
|
function addTooltipEntry() {
|
|
143
143
|
tooltipDisplay.value = true;
|
|
144
|
-
tooltipEntry.value =
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
144
|
+
tooltipEntry.value = [
|
|
145
|
+
{
|
|
146
|
+
destinations: ["eccrine sweat gland of the trunk"],
|
|
147
|
+
origins: [
|
|
148
|
+
"Sixth thoracic ganglion",
|
|
149
|
+
"Twelfth thoracic ganglion",
|
|
150
|
+
"Fifth thoracic ganglion",
|
|
151
|
+
"Ninth thoracic ganglion",
|
|
152
|
+
"Seventh thoracic ganglion",
|
|
153
|
+
"Eighth thoracic ganglion",
|
|
154
|
+
"Fourth thoracic ganglion",
|
|
155
|
+
"Tenth thoracic ganglion",
|
|
156
|
+
"Eleventh thoracic ganglion",
|
|
157
|
+
],
|
|
158
|
+
components: ["nerve"],
|
|
159
|
+
destinationsWithDatasets: [
|
|
160
|
+
{ id: "ILX:0795061", name: "eccrine sweat gland of the trunk" },
|
|
161
|
+
],
|
|
162
|
+
originsWithDatasets: [
|
|
163
|
+
{ id: "ILX:0784378", name: "Ninth thoracic ganglion" },
|
|
164
|
+
{ id: "ILX:0784569", name: "Tenth thoracic ganglion" },
|
|
165
|
+
{ id: "ILX:0784721", name: "Eighth thoracic ganglion" },
|
|
166
|
+
{ id: "ILX:0786141", name: "Fifth thoracic ganglion" },
|
|
167
|
+
{ id: "ILX:0786272", name: "Fourth thoracic ganglion" },
|
|
168
|
+
{ id: "ILX:0787009", name: "Twelfth thoracic ganglion" },
|
|
169
|
+
{ id: "ILX:0787015", name: "Eleventh thoracic ganglion" },
|
|
170
|
+
{ id: "ILX:0789947", name: "Sixth thoracic ganglion" },
|
|
171
|
+
{ id: "ILX:0790482", name: "Seventh thoracic ganglion" },
|
|
172
|
+
],
|
|
173
|
+
componentsWithDatasets: [{ id: "UBERON:0001021", name: "nerve" }],
|
|
174
|
+
title: "neuron type swglnd 161",
|
|
175
|
+
featureId: ["ilxtr:sparc-nlp/swglnd/161"],
|
|
176
|
+
hyperlinks: [
|
|
177
|
+
"https://doi.org/10.1007/s10286-015-0282-1",
|
|
178
|
+
"https://doi.org/10.1111/bjd.15808",
|
|
179
|
+
"https://doi.org/10.1159/000060678",
|
|
180
|
+
],
|
|
181
|
+
provenanceTaxonomy: ["NCBITaxon:9606"],
|
|
182
|
+
provenanceTaxonomyLabel: ["Homo sapiens"],
|
|
183
|
+
knowledgeSource: "sckan-2024-09-21-npo",
|
|
184
|
+
mapId: "rat-flatmap",
|
|
185
|
+
mapuuid: "b4ae1699-5690-5640-97b7-d711ae02dcb9",
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
destinations: ["intramural ganglion of the kidney"],
|
|
189
|
+
origins: ["dorsal motor nucleus of vagus nerve"],
|
|
190
|
+
components: [
|
|
191
|
+
"renal nerve plexus",
|
|
192
|
+
"aortic plexus",
|
|
193
|
+
"esophageal vagus trunk",
|
|
194
|
+
"vagus X nerve trunk",
|
|
195
|
+
"vagus nerve",
|
|
196
|
+
],
|
|
197
|
+
destinationsWithDatasets: [
|
|
198
|
+
{ id: "ILX:0795056", name: "intramural ganglion of the kidney" },
|
|
199
|
+
],
|
|
200
|
+
originsWithDatasets: [
|
|
201
|
+
{ id: "UBERON:0002870", name: "dorsal motor nucleus of vagus nerve" },
|
|
202
|
+
],
|
|
203
|
+
componentsWithDatasets: [
|
|
204
|
+
{ id: "ILX:0794853", name: "esophageal vagus trunk" },
|
|
205
|
+
{ id: "UBERON:0001759", name: "vagus nerve" },
|
|
206
|
+
{ id: "UBERON:0003535", name: "vagus X nerve trunk" },
|
|
207
|
+
{ id: "UBERON:0018676", name: "renal nerve plexus" },
|
|
208
|
+
{ id: "UBERON:0035772", name: "aortic plexus" },
|
|
209
|
+
],
|
|
210
|
+
title:
|
|
211
|
+
"dorsal motor nucleus of vagus nerve to intramural ganglia of the kidney via vagus nerve via esophageal vagus trunk via vagal trunks via aortic plexus via renal plexus",
|
|
212
|
+
featureId: ["ilxtr:sparc-nlp/kidney/135"],
|
|
213
|
+
hyperlinks: [
|
|
214
|
+
"https://uilx.org/tgbugs/u/r/isbn-13/978-0323680424",
|
|
215
|
+
"https://doi.org/10.1016/j.aanat.2015.11.004",
|
|
216
|
+
],
|
|
217
|
+
provenanceTaxonomy: ["NCBITaxon:9606"],
|
|
218
|
+
provenanceTaxonomyLabel: ["Homo sapiens"],
|
|
219
|
+
knowledgeSource: "sckan-2024-09-21-npo",
|
|
220
|
+
mapId: "rat-flatmap",
|
|
221
|
+
mapuuid: "b4ae1699-5690-5640-97b7-d711ae02dcb9",
|
|
222
|
+
},
|
|
223
|
+
];
|
|
167
224
|
}
|
|
168
225
|
function removeTooltipEntry() {
|
|
169
226
|
tooltipDisplay.value = false;
|
|
170
|
-
tooltipEntry.value =
|
|
227
|
+
tooltipEntry.value = [];
|
|
171
228
|
}
|
|
172
229
|
function addAnnotationEntry() {
|
|
173
230
|
tooltipDisplay.value = true;
|
|
@@ -234,7 +291,7 @@ function setColourField(treeData, nodeData, activeColour) {
|
|
|
234
291
|
function setColour(nodeData, value) {
|
|
235
292
|
if (nodeData && nodeData.isPrimitives) {
|
|
236
293
|
const activeColour = value ? value : nodeData.defaultColour;
|
|
237
|
-
setColourField(treeDataEntry.value, nodeData, activeColour)
|
|
294
|
+
setColourField(treeDataEntry.value, nodeData, activeColour);
|
|
238
295
|
}
|
|
239
296
|
}
|
|
240
297
|
function checkAll(value) {
|
|
@@ -263,7 +320,7 @@ const createData = ref({
|
|
|
263
320
|
editingIndex: -1,
|
|
264
321
|
faceIndex: -1,
|
|
265
322
|
toBeDeleted: false,
|
|
266
|
-
})
|
|
323
|
+
});
|
|
267
324
|
function cancelCreate() {
|
|
268
325
|
console.log("🚀 ~ CreateTooltipContent : cancelCreate");
|
|
269
326
|
}
|
|
@@ -422,14 +479,14 @@ function confirmCreate(value) {
|
|
|
422
479
|
Add Tooltip Entry
|
|
423
480
|
</el-button>
|
|
424
481
|
<el-button
|
|
425
|
-
v-show="
|
|
482
|
+
v-show="tooltipEntry.length > 0"
|
|
426
483
|
@click="removeTooltipEntry"
|
|
427
484
|
size="small"
|
|
428
485
|
>
|
|
429
486
|
Remove Tooltip Entry
|
|
430
487
|
</el-button>
|
|
431
488
|
<el-button
|
|
432
|
-
v-show="
|
|
489
|
+
v-show="tooltipEntry.length === 0"
|
|
433
490
|
@click="addAnnotationEntry"
|
|
434
491
|
size="small"
|
|
435
492
|
>
|
|
@@ -449,10 +506,18 @@ function confirmCreate(value) {
|
|
|
449
506
|
<h3>TreeControls - {{ mapType }}</h3>
|
|
450
507
|
</el-col>
|
|
451
508
|
<el-col>
|
|
452
|
-
<el-button
|
|
509
|
+
<el-button
|
|
510
|
+
v-show="mapType === 'scaffold'"
|
|
511
|
+
@click="switchTreeEntry('flatmap')"
|
|
512
|
+
size="small"
|
|
513
|
+
>
|
|
453
514
|
Display Flatmap Tree
|
|
454
515
|
</el-button>
|
|
455
|
-
<el-button
|
|
516
|
+
<el-button
|
|
517
|
+
v-show="mapType === 'flatmap'"
|
|
518
|
+
@click="switchTreeEntry('scaffold')"
|
|
519
|
+
size="small"
|
|
520
|
+
>
|
|
456
521
|
Display Scaffold Tree
|
|
457
522
|
</el-button>
|
|
458
523
|
</el-col>
|
|
@@ -462,16 +527,10 @@ function confirmCreate(value) {
|
|
|
462
527
|
<h3>Connectivity Graph</h3>
|
|
463
528
|
</el-col>
|
|
464
529
|
<el-col>
|
|
465
|
-
<el-button
|
|
466
|
-
@click="showConnectivityGraph = true"
|
|
467
|
-
size="small"
|
|
468
|
-
>
|
|
530
|
+
<el-button @click="showConnectivityGraph = true" size="small">
|
|
469
531
|
Show connectivity graph
|
|
470
532
|
</el-button>
|
|
471
|
-
<el-button
|
|
472
|
-
@click="showConnectivityGraph = false"
|
|
473
|
-
size="small"
|
|
474
|
-
>
|
|
533
|
+
<el-button @click="showConnectivityGraph = false" size="small">
|
|
475
534
|
Hide connectivity graph
|
|
476
535
|
</el-button>
|
|
477
536
|
</el-col>
|
|
@@ -568,9 +627,9 @@ function confirmCreate(value) {
|
|
|
568
627
|
top: calc(50% - 100px);
|
|
569
628
|
left: calc(50% - 200px);
|
|
570
629
|
}
|
|
571
|
-
.annotation-popup{
|
|
630
|
+
.annotation-popup {
|
|
572
631
|
margin-top: 8px;
|
|
573
|
-
width:400px;
|
|
632
|
+
width: 400px;
|
|
574
633
|
border-style: solid;
|
|
575
634
|
border-width: 1px;
|
|
576
635
|
border-color: black;
|
|
@@ -46,20 +46,6 @@
|
|
|
46
46
|
>
|
|
47
47
|
<div class="attribute-title-container">
|
|
48
48
|
<span class="attribute-title">Components</span>
|
|
49
|
-
<el-popover
|
|
50
|
-
width="250"
|
|
51
|
-
trigger="hover"
|
|
52
|
-
:teleported="false"
|
|
53
|
-
popper-class="popover-origin-help"
|
|
54
|
-
>
|
|
55
|
-
<template #reference>
|
|
56
|
-
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
57
|
-
</template>
|
|
58
|
-
<span style="word-break: keep-all">
|
|
59
|
-
The list is not in any specific order.<br>
|
|
60
|
-
Specific paths can be viewed using Graph View.
|
|
61
|
-
</span>
|
|
62
|
-
</el-popover>
|
|
63
49
|
</div>
|
|
64
50
|
<div
|
|
65
51
|
v-for="(component, i) in components"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<CopyToClipboard label="Copy list to clipboard" :content="referecesListContent" />
|
|
7
7
|
</div>
|
|
8
8
|
</div>
|
|
9
|
-
<div class="citation-tabs" v-if="
|
|
9
|
+
<div class="citation-tabs" v-if="referencesWithDOI">
|
|
10
10
|
<el-button
|
|
11
11
|
link
|
|
12
12
|
v-for="citationOption of citationOptions"
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
|
|
103
103
|
<script>
|
|
104
104
|
import CopyToClipboard from '../CopyToClipboard/CopyToClipboard.vue';
|
|
105
|
-
import { delay
|
|
105
|
+
import { delay } from '../utilities';
|
|
106
106
|
|
|
107
107
|
const CROSSCITE_API_HOST = 'https://citation.doi.org';
|
|
108
108
|
const CITATION_OPTIONS = [
|
|
@@ -128,18 +128,11 @@ const LOADING_DELAY = 600;
|
|
|
128
128
|
|
|
129
129
|
export default {
|
|
130
130
|
name: "ExternalResourceCard",
|
|
131
|
-
components: {
|
|
132
|
-
CopyToClipboard,
|
|
133
|
-
},
|
|
134
131
|
props: {
|
|
135
132
|
resources: {
|
|
136
133
|
type: Array,
|
|
137
134
|
default: () => [],
|
|
138
135
|
},
|
|
139
|
-
useDOIFormatter: {
|
|
140
|
-
type: Boolean,
|
|
141
|
-
default: true,
|
|
142
|
-
}
|
|
143
136
|
},
|
|
144
137
|
data: function () {
|
|
145
138
|
return {
|
|
@@ -345,14 +338,7 @@ export default {
|
|
|
345
338
|
|
|
346
339
|
if (type === 'doi' || doi) {
|
|
347
340
|
const doiID = type === 'doi' ? id : doi;
|
|
348
|
-
|
|
349
|
-
this.getCitationTextByDOI(doiID) :
|
|
350
|
-
getCitationById(doiID, {
|
|
351
|
-
type: 'doi',
|
|
352
|
-
format: citationType
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
fetchCitationFromAPI.then((text) => {
|
|
341
|
+
this.getCitationTextByDOI(doiID).then((text) => {
|
|
356
342
|
const formattedText = this.replaceLinkInText(text);
|
|
357
343
|
reference.citation[citationType] = formattedText;
|
|
358
344
|
this.updateCopyContents();
|
|
@@ -363,61 +349,45 @@ export default {
|
|
|
363
349
|
};
|
|
364
350
|
});
|
|
365
351
|
} else if (type === 'pmid') {
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
this.
|
|
377
|
-
const formattedText = this.replaceLinkInText(text);
|
|
378
|
-
reference.citation[citationType] = formattedText;
|
|
379
|
-
this.updateCopyContents();
|
|
380
|
-
}).catch((error) => {
|
|
381
|
-
reference.citation['error'] = {
|
|
382
|
-
type: citationType,
|
|
383
|
-
ref: 'doi',
|
|
384
|
-
};
|
|
385
|
-
});
|
|
386
|
-
} else {
|
|
387
|
-
// If there has no doi in PubMed
|
|
388
|
-
const { title, pubdate, authors } = resultObj;
|
|
389
|
-
const authorNames = authors ? authors.map((author) => author.name) : [];
|
|
390
|
-
const formattedText = this.formatCopyReference({
|
|
391
|
-
title: title || '',
|
|
392
|
-
date: pubdate || '',
|
|
393
|
-
authors: authorNames,
|
|
394
|
-
url: `https://pubmed.ncbi.nlm.nih.gov/${id}`,
|
|
395
|
-
});
|
|
352
|
+
this.getDOIFromPubMedID(id).then((data) => {
|
|
353
|
+
if (data?.result) {
|
|
354
|
+
const resultObj = data.result[id];
|
|
355
|
+
const articleIDs = resultObj?.articleids || [];
|
|
356
|
+
const doiObj = articleIDs.find((item) => item.idtype === 'doi');
|
|
357
|
+
const doiID = doiObj?.value;
|
|
358
|
+
|
|
359
|
+
if (doiID) {
|
|
360
|
+
reference['doi'] = doiID;
|
|
361
|
+
this.getCitationTextByDOI(doiID).then((text) => {
|
|
362
|
+
const formattedText = this.replaceLinkInText(text);
|
|
396
363
|
reference.citation[citationType] = formattedText;
|
|
397
364
|
this.updateCopyContents();
|
|
398
|
-
}
|
|
365
|
+
}).catch((error) => {
|
|
366
|
+
reference.citation['error'] = {
|
|
367
|
+
type: citationType,
|
|
368
|
+
ref: 'doi',
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
} else {
|
|
372
|
+
// If there has no doi in PubMed
|
|
373
|
+
const { title, pubdate, authors } = resultObj;
|
|
374
|
+
const authorNames = authors ? authors.map((author) => author.name) : [];
|
|
375
|
+
const formattedText = this.formatCopyReference({
|
|
376
|
+
title: title || '',
|
|
377
|
+
date: pubdate || '',
|
|
378
|
+
authors: authorNames,
|
|
379
|
+
url: `https://pubmed.ncbi.nlm.nih.gov/${id}`,
|
|
380
|
+
});
|
|
381
|
+
reference.citation[citationType] = formattedText;
|
|
382
|
+
this.updateCopyContents();
|
|
399
383
|
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
getCitationById(id, {
|
|
408
|
-
type: 'pmid',
|
|
409
|
-
format: citationType
|
|
410
|
-
}).then((text) => {
|
|
411
|
-
const formattedText = this.replaceLinkInText(text);
|
|
412
|
-
reference.citation[citationType] = formattedText;
|
|
413
|
-
this.updateCopyContents();
|
|
414
|
-
}).catch((error) => {
|
|
415
|
-
reference.citation['error'] = {
|
|
416
|
-
type: citationType,
|
|
417
|
-
ref: 'pubmed',
|
|
418
|
-
};
|
|
419
|
-
});
|
|
420
|
-
}
|
|
384
|
+
}
|
|
385
|
+
}).catch((error) => {
|
|
386
|
+
reference.citation['error'] = {
|
|
387
|
+
type: citationType,
|
|
388
|
+
ref: 'pubmed',
|
|
389
|
+
};
|
|
390
|
+
});
|
|
421
391
|
}
|
|
422
392
|
}
|
|
423
393
|
},
|