@abi-software/map-utilities 1.0.1-beta.2 → 1.1.0-beta.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/dist/map-utilities.js +10879 -5032
- package/dist/map-utilities.umd.cjs +54 -41
- package/dist/style.css +1 -1
- package/package.json +2 -1
- package/src/App.vue +145 -26
- package/src/components/CopyToClipboard/CopyToClipboard.vue +4 -3
- package/src/components/Tooltip/ImageGalleryPopup.vue +174 -0
- package/src/components/Tooltip/ProvenancePopup.vue +31 -31
- package/src/components/Tooltip/Tooltip.vue +19 -10
- package/src/components.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/map-utilities",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0-beta.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist/*",
|
|
6
6
|
"src/*",
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
"./src/*": "./src/*"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@abi-software/gallery": "^1.1.0",
|
|
32
33
|
"@abi-software/svg-sprite": "^1.0.0",
|
|
33
34
|
"@element-plus/icons-vue": "^2.3.1",
|
|
34
35
|
"element-plus": "^2.7.3",
|
package/src/App.vue
CHANGED
|
@@ -124,19 +124,19 @@ function onActionClick(value) {
|
|
|
124
124
|
/**
|
|
125
125
|
* Tooltip
|
|
126
126
|
*/
|
|
127
|
-
const
|
|
128
|
-
const
|
|
127
|
+
const tooltipType = ref("");
|
|
128
|
+
const provenanceEntry = ref({});
|
|
129
129
|
const featuresAlert = ref(undefined);
|
|
130
|
-
const annotationDisplay = ref(false);
|
|
131
130
|
const annotationEntry = ref({});
|
|
131
|
+
const imageEntry = ref([]);
|
|
132
132
|
|
|
133
133
|
provide(/* key */ "getFeaturesAlert", /* value */ () => featuresAlert.value);
|
|
134
134
|
provide(/* key */ "$annotator", /* value */ undefined);
|
|
135
135
|
provide(/* key */ "userApiKey", /* value */ undefined);
|
|
136
136
|
|
|
137
|
-
function
|
|
138
|
-
|
|
139
|
-
|
|
137
|
+
function addProvenanceEntry() {
|
|
138
|
+
tooltipType.value = "provenance";
|
|
139
|
+
provenanceEntry.value = {
|
|
140
140
|
destinations: [null],
|
|
141
141
|
origins: [null],
|
|
142
142
|
components: ["pudendal nerve"],
|
|
@@ -160,13 +160,12 @@ function addTooltipEntry() {
|
|
|
160
160
|
provenanceTaxonomyLabel: ["Homo sapiens"],
|
|
161
161
|
};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
function removeProvenanceEntry() {
|
|
164
|
+
tooltipType.value = "";
|
|
165
|
+
provenanceEntry.value = {};
|
|
166
166
|
}
|
|
167
167
|
function addAnnotationEntry() {
|
|
168
|
-
|
|
169
|
-
annotationDisplay.value = true;
|
|
168
|
+
tooltipType.value = "annotation";
|
|
170
169
|
annotationEntry.value = {
|
|
171
170
|
id: "digestive_8-1",
|
|
172
171
|
featureId: 4958,
|
|
@@ -179,13 +178,97 @@ function addAnnotationEntry() {
|
|
|
179
178
|
};
|
|
180
179
|
}
|
|
181
180
|
function removeAnnotationEntry() {
|
|
182
|
-
|
|
183
|
-
annotationDisplay.value = false;
|
|
181
|
+
tooltipType.value = "";
|
|
184
182
|
annotationEntry.value = {};
|
|
185
183
|
}
|
|
186
184
|
function commitAnnotationEvent(value) {
|
|
187
185
|
console.log("🚀 ~ commitAnnotationEvent ~ value:", value);
|
|
188
186
|
}
|
|
187
|
+
function addImageEntry() {
|
|
188
|
+
tooltipType.value = "image";
|
|
189
|
+
imageEntry.value = [
|
|
190
|
+
{
|
|
191
|
+
anatomy: [
|
|
192
|
+
{
|
|
193
|
+
curie: "",
|
|
194
|
+
matchingStatus: "Exact Match",
|
|
195
|
+
name: "stomach",
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
datasetId: "22",
|
|
199
|
+
datasetVersion: "2",
|
|
200
|
+
link: "https://sparc.biolucida.net/image?c=Mzg3Ny1jb2wtMTUw",
|
|
201
|
+
resource: {
|
|
202
|
+
share_link: "https://sparc.biolucida.net/image?c=Mzg3Ny1jb2wtMTUw",
|
|
203
|
+
},
|
|
204
|
+
s3uri: "s3://prd-sparc-discover50-use1/22/",
|
|
205
|
+
species: [
|
|
206
|
+
{
|
|
207
|
+
species: {
|
|
208
|
+
curie: "NCBITaxon:9825",
|
|
209
|
+
matchingStatus: "approved",
|
|
210
|
+
name: "Pig",
|
|
211
|
+
originalName: "Domestic Pig",
|
|
212
|
+
parents: [
|
|
213
|
+
{
|
|
214
|
+
curie: "ilx:0739765",
|
|
215
|
+
name: "Pig",
|
|
216
|
+
},
|
|
217
|
+
],
|
|
218
|
+
},
|
|
219
|
+
strain: {
|
|
220
|
+
name: "Large White / Landrace crossbred pig",
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
],
|
|
224
|
+
thumbnail: "https://sparc.biolucida.net/api/v1/thumbnail/3877",
|
|
225
|
+
title: "SPARC Image 1",
|
|
226
|
+
type: "image",
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
anatomy: [
|
|
230
|
+
{
|
|
231
|
+
curie: "",
|
|
232
|
+
matchingStatus: "Exact Match",
|
|
233
|
+
name: "stomach",
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
datasetId: "22",
|
|
237
|
+
datasetVersion: "2",
|
|
238
|
+
link: "https://sparc.biolucida.net/image?c=Mzg3Ny1jb2wtMTUw",
|
|
239
|
+
resource: {
|
|
240
|
+
share_link: "https://sparc.biolucida.net/image?c=Mzg3Ny1jb2wtMTUw",
|
|
241
|
+
},
|
|
242
|
+
s3uri: "s3://prd-sparc-discover50-use1/22/",
|
|
243
|
+
species: [
|
|
244
|
+
{
|
|
245
|
+
species: {
|
|
246
|
+
curie: "NCBITaxon:9825",
|
|
247
|
+
matchingStatus: "approved",
|
|
248
|
+
name: "Pig",
|
|
249
|
+
originalName: "Domestic Pig",
|
|
250
|
+
parents: [
|
|
251
|
+
{
|
|
252
|
+
curie: "ilx:0739765",
|
|
253
|
+
name: "Pig",
|
|
254
|
+
},
|
|
255
|
+
],
|
|
256
|
+
},
|
|
257
|
+
strain: {
|
|
258
|
+
name: "Large White / Landrace crossbred pig",
|
|
259
|
+
},
|
|
260
|
+
},
|
|
261
|
+
],
|
|
262
|
+
thumbnail: "https://sparc.biolucida.net/api/v1/thumbnail/3877",
|
|
263
|
+
title: "SPARC Image 2",
|
|
264
|
+
type: "image",
|
|
265
|
+
},
|
|
266
|
+
];
|
|
267
|
+
}
|
|
268
|
+
function removeImageEntry() {
|
|
269
|
+
tooltipType.value = "";
|
|
270
|
+
imageEntry.value = [];
|
|
271
|
+
}
|
|
189
272
|
/**
|
|
190
273
|
* TreeControls
|
|
191
274
|
*/
|
|
@@ -229,7 +312,7 @@ function setColourField(treeData, nodeData, activeColour) {
|
|
|
229
312
|
function setColour(nodeData, value) {
|
|
230
313
|
if (nodeData && nodeData.isPrimitives) {
|
|
231
314
|
const activeColour = value ? value : nodeData.defaultColour;
|
|
232
|
-
setColourField(treeDataEntry.value, nodeData, activeColour)
|
|
315
|
+
setColourField(treeDataEntry.value, nodeData, activeColour);
|
|
233
316
|
}
|
|
234
317
|
}
|
|
235
318
|
function checkAll(value) {
|
|
@@ -380,21 +463,29 @@ function changeHover(value) {
|
|
|
380
463
|
</el-col>
|
|
381
464
|
<el-col>
|
|
382
465
|
<el-button
|
|
383
|
-
v-show="
|
|
384
|
-
|
|
466
|
+
v-show="
|
|
467
|
+
tooltipType === '' ||
|
|
468
|
+
(tooltipType === 'provenance' &&
|
|
469
|
+
Object.keys(provenanceEntry).length === 0)
|
|
470
|
+
"
|
|
471
|
+
@click="addProvenanceEntry"
|
|
385
472
|
size="small"
|
|
386
473
|
>
|
|
387
|
-
Add
|
|
474
|
+
Add Provenance Entry
|
|
388
475
|
</el-button>
|
|
389
476
|
<el-button
|
|
390
|
-
v-show="Object.keys(
|
|
391
|
-
@click="
|
|
477
|
+
v-show="Object.keys(provenanceEntry).length > 0"
|
|
478
|
+
@click="removeProvenanceEntry"
|
|
392
479
|
size="small"
|
|
393
480
|
>
|
|
394
|
-
Remove
|
|
481
|
+
Remove Provenance Entry
|
|
395
482
|
</el-button>
|
|
396
483
|
<el-button
|
|
397
|
-
v-show="
|
|
484
|
+
v-show="
|
|
485
|
+
tooltipType === '' ||
|
|
486
|
+
(tooltipType === 'annotation' &&
|
|
487
|
+
Object.keys(annotationEntry).length === 0)
|
|
488
|
+
"
|
|
398
489
|
@click="addAnnotationEntry"
|
|
399
490
|
size="small"
|
|
400
491
|
>
|
|
@@ -407,6 +498,23 @@ function changeHover(value) {
|
|
|
407
498
|
>
|
|
408
499
|
Remove Annotation Entry
|
|
409
500
|
</el-button>
|
|
501
|
+
<el-button
|
|
502
|
+
v-show="
|
|
503
|
+
tooltipType === '' ||
|
|
504
|
+
(tooltipType === 'image' && Object.keys(imageEntry).length === 0)
|
|
505
|
+
"
|
|
506
|
+
@click="addImageEntry"
|
|
507
|
+
size="small"
|
|
508
|
+
>
|
|
509
|
+
Add Image Entry
|
|
510
|
+
</el-button>
|
|
511
|
+
<el-button
|
|
512
|
+
v-show="Object.keys(imageEntry).length > 0"
|
|
513
|
+
@click="removeImageEntry"
|
|
514
|
+
size="small"
|
|
515
|
+
>
|
|
516
|
+
Remove Image Entry
|
|
517
|
+
</el-button>
|
|
410
518
|
</el-col>
|
|
411
519
|
</el-row>
|
|
412
520
|
<el-row>
|
|
@@ -414,10 +522,18 @@ function changeHover(value) {
|
|
|
414
522
|
<h3>TreeControls - {{ mapType }}</h3>
|
|
415
523
|
</el-col>
|
|
416
524
|
<el-col>
|
|
417
|
-
<el-button
|
|
525
|
+
<el-button
|
|
526
|
+
v-show="mapType === 'scaffold'"
|
|
527
|
+
@click="switchTreeEntry('flatmap')"
|
|
528
|
+
size="small"
|
|
529
|
+
>
|
|
418
530
|
Display Flatmap Tree
|
|
419
531
|
</el-button>
|
|
420
|
-
<el-button
|
|
532
|
+
<el-button
|
|
533
|
+
v-show="mapType === 'flatmap'"
|
|
534
|
+
@click="switchTreeEntry('scaffold')"
|
|
535
|
+
size="small"
|
|
536
|
+
>
|
|
421
537
|
Display Scaffold Tree
|
|
422
538
|
</el-button>
|
|
423
539
|
</el-col>
|
|
@@ -459,11 +575,12 @@ function changeHover(value) {
|
|
|
459
575
|
@finish-help-mode="onFinishHelpMode"
|
|
460
576
|
/>
|
|
461
577
|
<Tooltip
|
|
462
|
-
v-show="
|
|
578
|
+
v-show="tooltipType"
|
|
463
579
|
class="tooltip"
|
|
464
|
-
:
|
|
465
|
-
:
|
|
580
|
+
:tooltipType="tooltipType"
|
|
581
|
+
:provenanceEntry="provenanceEntry"
|
|
466
582
|
:annotationEntry="annotationEntry"
|
|
583
|
+
:imageEntry="imageEntry"
|
|
467
584
|
@annotation="commitAnnotationEvent"
|
|
468
585
|
@onActionClick="onActionClick"
|
|
469
586
|
/>
|
|
@@ -498,10 +615,12 @@ function changeHover(value) {
|
|
|
498
615
|
.options-container {
|
|
499
616
|
text-align: center;
|
|
500
617
|
}
|
|
618
|
+
|
|
501
619
|
.help-mode-dialog {
|
|
502
620
|
position: absolute;
|
|
503
621
|
top: 50%;
|
|
504
622
|
}
|
|
623
|
+
|
|
505
624
|
.tooltip {
|
|
506
625
|
width: 400px;
|
|
507
626
|
position: absolute;
|
|
@@ -95,7 +95,7 @@ export default {
|
|
|
95
95
|
.copy-clipboard-button {
|
|
96
96
|
margin-left: 0px !important;
|
|
97
97
|
margin-top: 0px !important;
|
|
98
|
-
padding: 0.25rem;
|
|
98
|
+
padding: 0.25rem !important;
|
|
99
99
|
font-size: 14px !important;
|
|
100
100
|
transition: all 0.25s ease;
|
|
101
101
|
|
|
@@ -103,15 +103,16 @@ export default {
|
|
|
103
103
|
&:focus,
|
|
104
104
|
&:active {
|
|
105
105
|
color: $app-primary-color !important;
|
|
106
|
-
background: transparent;
|
|
106
|
+
background: transparent !important;
|
|
107
107
|
border-color: transparent !important;
|
|
108
|
+
box-shadow: none !important;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
&.light {
|
|
111
112
|
&,
|
|
112
113
|
&:focus,
|
|
113
114
|
&:active {
|
|
114
|
-
background: #fff;
|
|
115
|
+
background: #fff !important;
|
|
115
116
|
border-color: #fff !important;
|
|
116
117
|
}
|
|
117
118
|
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="main">
|
|
3
|
+
<div v-if="imageEntry">
|
|
4
|
+
<el-tag
|
|
5
|
+
v-for="(species, index) in speciesFilterTags"
|
|
6
|
+
:key="index"
|
|
7
|
+
type="info"
|
|
8
|
+
class="tag"
|
|
9
|
+
:class="{ 'active-tag': species.taxon === activeSpecies.taxon }"
|
|
10
|
+
:closable="species.taxon === activeSpecies.taxon"
|
|
11
|
+
@close="removeSpeciesFilterTag"
|
|
12
|
+
@click="filterBySpecies(species)"
|
|
13
|
+
>
|
|
14
|
+
{{ species.name }} ({{ species.count }})
|
|
15
|
+
</el-tag>
|
|
16
|
+
<div class="gallery-container">
|
|
17
|
+
<Gallery :items="filteredImages" :imageStyle="imageStyle" />
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script>
|
|
24
|
+
/* eslint-disable no-alert, no-console */
|
|
25
|
+
import { ElTag as Tag } from "element-plus";
|
|
26
|
+
|
|
27
|
+
import Gallery from "@abi-software/gallery";
|
|
28
|
+
import "@abi-software/gallery/dist/style.css";
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
name: "ImagePopup",
|
|
32
|
+
components: {
|
|
33
|
+
Tag,
|
|
34
|
+
Gallery,
|
|
35
|
+
},
|
|
36
|
+
props: {
|
|
37
|
+
imageEntry: {
|
|
38
|
+
type: Array,
|
|
39
|
+
default: [],
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
data: function () {
|
|
43
|
+
return {
|
|
44
|
+
activeSpecies: { taxon: "", name: "" },
|
|
45
|
+
speciesFilterTags: [],
|
|
46
|
+
filteredImages: [],
|
|
47
|
+
showImageGallery: false,
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
computed: {
|
|
51
|
+
imageStyle() {
|
|
52
|
+
return {
|
|
53
|
+
width: "180px",
|
|
54
|
+
height: "135px",
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
watch: {
|
|
59
|
+
imageEntry: {
|
|
60
|
+
handler: function (value) {
|
|
61
|
+
if (value) {
|
|
62
|
+
this.populateFilterTags();
|
|
63
|
+
this.filteredImages = this.imageEntry;
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
deep: true,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
removeSpeciesFilterTag: function () {
|
|
71
|
+
this.activeSpecies = { taxon: "", name: "" };
|
|
72
|
+
this.filteredImages = this.imageEntry;
|
|
73
|
+
},
|
|
74
|
+
filterBySpecies: function (tagInfo) {
|
|
75
|
+
this.activeSpecies = tagInfo;
|
|
76
|
+
let imageList = [];
|
|
77
|
+
this.imageEntry.forEach((image) => {
|
|
78
|
+
if (image.species && image.species.length > 0) {
|
|
79
|
+
image.species.forEach((species) => {
|
|
80
|
+
if (species.species && species.species.curie === tagInfo.taxon) {
|
|
81
|
+
imageList.push(image);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
this.filteredImages = imageList;
|
|
87
|
+
},
|
|
88
|
+
populateFilterTags: function () {
|
|
89
|
+
let imageObjects = {};
|
|
90
|
+
this.imageEntry.forEach((image) => {
|
|
91
|
+
if (image.species && image.species.length > 0) {
|
|
92
|
+
image.species.forEach((species) => {
|
|
93
|
+
if (species.species) {
|
|
94
|
+
const speciesInfo = species.species;
|
|
95
|
+
if (!(speciesInfo.curie in imageObjects)) {
|
|
96
|
+
imageObjects[speciesInfo.curie] = {
|
|
97
|
+
taxon: speciesInfo.curie,
|
|
98
|
+
name: speciesInfo.name,
|
|
99
|
+
count: 0,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
imageObjects[speciesInfo.curie].count++;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
this.speciesFilterTags = Object.values(imageObjects);
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
mounted: function () {
|
|
111
|
+
this.populateFilterTags();
|
|
112
|
+
this.filteredImages = this.imageEntry;
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
</script>
|
|
116
|
+
|
|
117
|
+
<style lang="scss" scoped>
|
|
118
|
+
.block {
|
|
119
|
+
margin-bottom: 0.5em;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.tag {
|
|
123
|
+
margin-right: 5px;
|
|
124
|
+
margin-bottom: 5px;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.active-tag {
|
|
129
|
+
background-color: $app-primary-color;
|
|
130
|
+
color: #fff;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.main {
|
|
134
|
+
font-size: 14px;
|
|
135
|
+
text-align: left;
|
|
136
|
+
line-height: 1.5em;
|
|
137
|
+
font-family: Asap, sans-serif, Helvetica;
|
|
138
|
+
font-weight: 400;
|
|
139
|
+
/* outline: thin red solid; */
|
|
140
|
+
padding: 1em !important;
|
|
141
|
+
overflow: hidden;
|
|
142
|
+
min-width: 18rem;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.button {
|
|
146
|
+
margin-left: 0px !important;
|
|
147
|
+
margin-top: 0px !important;
|
|
148
|
+
font-size: 14px !important;
|
|
149
|
+
background-color: $app-primary-color;
|
|
150
|
+
color: #fff;
|
|
151
|
+
|
|
152
|
+
& + .button {
|
|
153
|
+
margin-top: 10px !important;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
&:hover {
|
|
157
|
+
color: #fff !important;
|
|
158
|
+
background: #ac76c5 !important;
|
|
159
|
+
border: 1px solid #ac76c5 !important;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.gallery-container {
|
|
164
|
+
:deep(.gallery) {
|
|
165
|
+
.gallery-strip {
|
|
166
|
+
padding: 1rem 0;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
> div {
|
|
170
|
+
min-height: max-content !important;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
</style>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-if="
|
|
3
|
-
<div class="block" v-if="
|
|
4
|
-
<div class="title">{{ capitalise(
|
|
2
|
+
<div v-if="provenanceEntry" class="main" v-loading="loading">
|
|
3
|
+
<div class="block" v-if="provenanceEntry.title">
|
|
4
|
+
<div class="title">{{ capitalise(provenanceEntry.title) }}</div>
|
|
5
5
|
<div
|
|
6
6
|
v-if="
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
provenanceEntry.provenanceTaxonomyLabel &&
|
|
8
|
+
provenanceEntry.provenanceTaxonomyLabel.length > 0
|
|
9
9
|
"
|
|
10
10
|
class="subtitle"
|
|
11
11
|
>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
</div>
|
|
14
14
|
</div>
|
|
15
15
|
<div class="block" v-else>
|
|
16
|
-
<div class="title">{{
|
|
16
|
+
<div class="title">{{ provenanceEntry.featureId }}</div>
|
|
17
17
|
</div>
|
|
18
18
|
<div v-if="featuresAlert" class="attribute-title-container">
|
|
19
19
|
<span class="attribute-title">Alert</span>
|
|
@@ -51,8 +51,8 @@
|
|
|
51
51
|
</div>
|
|
52
52
|
<transition name="slide-fade">
|
|
53
53
|
<div v-show="showDetails" class="content-container scrollbar">
|
|
54
|
-
{{
|
|
55
|
-
<div v-if="
|
|
54
|
+
{{ provenanceEntry.paths }}
|
|
55
|
+
<div v-if="provenanceEntry.origins && provenanceEntry.origins.length > 0" class="block">
|
|
56
56
|
<div class="attribute-title-container">
|
|
57
57
|
<span class="attribute-title">Origin</span>
|
|
58
58
|
<el-popover
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
</el-popover>
|
|
71
71
|
</div>
|
|
72
72
|
<div
|
|
73
|
-
v-for="(origin, i) in
|
|
73
|
+
v-for="(origin, i) in provenanceEntry.origins"
|
|
74
74
|
class="attribute-content"
|
|
75
75
|
:origin-item-label="origin"
|
|
76
76
|
:key="origin"
|
|
77
77
|
>
|
|
78
78
|
{{ capitalise(origin) }}
|
|
79
|
-
<div v-if="i !=
|
|
79
|
+
<div v-if="i != provenanceEntry.origins.length - 1" class="separator"></div>
|
|
80
80
|
</div>
|
|
81
81
|
<el-button
|
|
82
82
|
v-show="
|
|
83
|
-
|
|
83
|
+
provenanceEntry.originsWithDatasets && provenanceEntry.originsWithDatasets.length > 0
|
|
84
84
|
"
|
|
85
85
|
class="button"
|
|
86
86
|
id="open-dendrites-button"
|
|
@@ -90,27 +90,27 @@
|
|
|
90
90
|
</el-button>
|
|
91
91
|
</div>
|
|
92
92
|
<div
|
|
93
|
-
v-if="
|
|
93
|
+
v-if="provenanceEntry.components && provenanceEntry.components.length > 0"
|
|
94
94
|
class="block"
|
|
95
95
|
>
|
|
96
96
|
<div class="attribute-title-container">
|
|
97
97
|
<div class="attribute-title">Components</div>
|
|
98
98
|
</div>
|
|
99
99
|
<div
|
|
100
|
-
v-for="(component, i) in
|
|
100
|
+
v-for="(component, i) in provenanceEntry.components"
|
|
101
101
|
class="attribute-content"
|
|
102
102
|
:component-item-label="component"
|
|
103
103
|
:key="component"
|
|
104
104
|
>
|
|
105
105
|
{{ capitalise(component) }}
|
|
106
106
|
<div
|
|
107
|
-
v-if="i !=
|
|
107
|
+
v-if="i != provenanceEntry.components.length - 1"
|
|
108
108
|
class="separator"
|
|
109
109
|
></div>
|
|
110
110
|
</div>
|
|
111
111
|
</div>
|
|
112
112
|
<div
|
|
113
|
-
v-if="
|
|
113
|
+
v-if="provenanceEntry.destinations && provenanceEntry.destinations.length > 0"
|
|
114
114
|
class="block"
|
|
115
115
|
>
|
|
116
116
|
<div class="attribute-title-container">
|
|
@@ -130,21 +130,21 @@
|
|
|
130
130
|
</el-popover>
|
|
131
131
|
</div>
|
|
132
132
|
<div
|
|
133
|
-
v-for="(destination, i) in
|
|
133
|
+
v-for="(destination, i) in provenanceEntry.destinations"
|
|
134
134
|
class="attribute-content"
|
|
135
135
|
:destination-item-label="destination"
|
|
136
136
|
:key="destination"
|
|
137
137
|
>
|
|
138
138
|
{{ capitalise(destination) }}
|
|
139
139
|
<div
|
|
140
|
-
v-if="i !=
|
|
140
|
+
v-if="i != provenanceEntry.destinations.length - 1"
|
|
141
141
|
class="separator"
|
|
142
142
|
></div>
|
|
143
143
|
</div>
|
|
144
144
|
<el-button
|
|
145
145
|
v-show="
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
provenanceEntry.destinationsWithDatasets &&
|
|
147
|
+
provenanceEntry.destinationsWithDatasets.length > 0
|
|
148
148
|
"
|
|
149
149
|
class="button"
|
|
150
150
|
@click="openAxons"
|
|
@@ -155,8 +155,8 @@
|
|
|
155
155
|
|
|
156
156
|
<el-button
|
|
157
157
|
v-show="
|
|
158
|
-
|
|
159
|
-
|
|
158
|
+
provenanceEntry.componentsWithDatasets &&
|
|
159
|
+
provenanceEntry.componentsWithDatasets.length > 0
|
|
160
160
|
"
|
|
161
161
|
class="button"
|
|
162
162
|
@click="openAll"
|
|
@@ -187,7 +187,7 @@ const capitalise = function (str) {
|
|
|
187
187
|
export default {
|
|
188
188
|
name: "ProvenancePopup",
|
|
189
189
|
props: {
|
|
190
|
-
|
|
190
|
+
provenanceEntry: {
|
|
191
191
|
type: Object,
|
|
192
192
|
default: () => ({
|
|
193
193
|
destinations: [],
|
|
@@ -223,16 +223,16 @@ export default {
|
|
|
223
223
|
},
|
|
224
224
|
resources: function () {
|
|
225
225
|
let resources = [];
|
|
226
|
-
if (this.
|
|
227
|
-
resources = this.
|
|
226
|
+
if (this.provenanceEntry && this.provenanceEntry.hyperlinks) {
|
|
227
|
+
resources = this.provenanceEntry.hyperlinks;
|
|
228
228
|
}
|
|
229
229
|
return resources;
|
|
230
230
|
},
|
|
231
231
|
originDescription: function () {
|
|
232
232
|
if (
|
|
233
|
-
this.
|
|
234
|
-
this.
|
|
235
|
-
this.
|
|
233
|
+
this.provenanceEntry &&
|
|
234
|
+
this.provenanceEntry.title &&
|
|
235
|
+
this.provenanceEntry.title.toLowerCase().includes("motor")
|
|
236
236
|
) {
|
|
237
237
|
return this.originDescriptions.motor;
|
|
238
238
|
} else {
|
|
@@ -241,7 +241,7 @@ export default {
|
|
|
241
241
|
},
|
|
242
242
|
provSpeciesDescription: function () {
|
|
243
243
|
let text = "Studied in";
|
|
244
|
-
this.
|
|
244
|
+
this.provenanceEntry.provenanceTaxonomyLabel.forEach((label) => {
|
|
245
245
|
text += ` ${label},`;
|
|
246
246
|
});
|
|
247
247
|
text = text.slice(0, -1); // remove last comma
|
|
@@ -262,19 +262,19 @@ export default {
|
|
|
262
262
|
openAll: function () {
|
|
263
263
|
EventBus.emit("onActionClick", {
|
|
264
264
|
type: "Facets",
|
|
265
|
-
labels: this.
|
|
265
|
+
labels: this.provenanceEntry.componentsWithDatasets.map((a) => a.name),
|
|
266
266
|
});
|
|
267
267
|
},
|
|
268
268
|
openAxons: function () {
|
|
269
269
|
EventBus.emit("onActionClick", {
|
|
270
270
|
type: "Facets",
|
|
271
|
-
labels: this.
|
|
271
|
+
labels: this.provenanceEntry.destinationsWithDatasets.map((a) => a.name),
|
|
272
272
|
});
|
|
273
273
|
},
|
|
274
274
|
openDendrites: function () {
|
|
275
275
|
EventBus.emit("onActionClick", {
|
|
276
276
|
type: "Facets",
|
|
277
|
-
labels: this.
|
|
277
|
+
labels: this.provenanceEntry.originsWithDatasets.map((a) => a.name),
|
|
278
278
|
});
|
|
279
279
|
},
|
|
280
280
|
pubmedSearchUrlUpdate: function (val) {
|