@abi-software/map-utilities 1.2.2-beta.2 → 1.2.2-beta.3
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 +2993 -2944
- package/dist/map-utilities.umd.cjs +63 -55
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/ConnectivityGraph/graph.js +1 -1
- package/src/components/DrawToolbar/ConnectionDialog.vue +34 -20
- package/src/components/DrawToolbar/DrawToolbar.vue +13 -12
- package/src/components/Tooltip/AnnotationPopup.vue +116 -22
- package/src/components.d.ts +0 -1
package/package.json
CHANGED
|
@@ -3,22 +3,16 @@
|
|
|
3
3
|
<el-row>
|
|
4
4
|
<el-col>
|
|
5
5
|
<el-row v-if="inDrawing">
|
|
6
|
-
<span class="dialog-title">
|
|
7
|
-
<el-button
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Confirm
|
|
14
|
-
</el-button>
|
|
15
|
-
<el-button type="primary" plain @click="$emit('cancelDrawn', true)">
|
|
16
|
-
Cancel
|
|
17
|
-
</el-button>
|
|
18
|
-
</el-button-group>
|
|
6
|
+
<span class="dialog-title">Finalize drawing</span>
|
|
7
|
+
<el-button type="primary" plain @click="$emit('confirmDrawn', true)">
|
|
8
|
+
Confirm
|
|
9
|
+
</el-button>
|
|
10
|
+
<el-button type="primary" plain @click="$emit('cancelDrawn', true)">
|
|
11
|
+
Cancel
|
|
12
|
+
</el-button>
|
|
19
13
|
</el-row>
|
|
20
14
|
<el-row v-else>
|
|
21
|
-
<span class="dialog-title">
|
|
15
|
+
<span class="dialog-title">Visualize connection</span>
|
|
22
16
|
<el-button
|
|
23
17
|
type="primary"
|
|
24
18
|
plain
|
|
@@ -34,7 +28,18 @@
|
|
|
34
28
|
<b><span>Related Features</span></b>
|
|
35
29
|
<el-row v-for="(value, key) in connectionEntry" :key="key">
|
|
36
30
|
<el-card :shadow="shadowDisplay(key)" @click="handleTooltip(key)">
|
|
37
|
-
<
|
|
31
|
+
<el-popover
|
|
32
|
+
trigger="hover"
|
|
33
|
+
:disabled="value.label.length < 20"
|
|
34
|
+
:width="200"
|
|
35
|
+
:content="capitalize(value.label)"
|
|
36
|
+
>
|
|
37
|
+
<template #reference>
|
|
38
|
+
<span class="connection-label">
|
|
39
|
+
{{ capitalize(value.label) }}
|
|
40
|
+
</span>
|
|
41
|
+
</template>
|
|
42
|
+
</el-popover>
|
|
38
43
|
</el-card>
|
|
39
44
|
</el-row>
|
|
40
45
|
</el-col>
|
|
@@ -43,7 +48,7 @@
|
|
|
43
48
|
</template>
|
|
44
49
|
|
|
45
50
|
<script>
|
|
46
|
-
const
|
|
51
|
+
const capitalize = function (str) {
|
|
47
52
|
if (str) return str.charAt(0).toUpperCase() + str.slice(1);
|
|
48
53
|
return "";
|
|
49
54
|
};
|
|
@@ -73,8 +78,8 @@ export default {
|
|
|
73
78
|
shadowDisplay: function (value) {
|
|
74
79
|
return this.tooltipId === value ? "always" : "hover";
|
|
75
80
|
},
|
|
76
|
-
|
|
77
|
-
return
|
|
81
|
+
capitalize: function (label) {
|
|
82
|
+
return capitalize(label);
|
|
78
83
|
},
|
|
79
84
|
handleTooltip: function (value) {
|
|
80
85
|
this.tooltipId = this.tooltipId === value ? undefined : value;
|
|
@@ -100,13 +105,13 @@ export default {
|
|
|
100
105
|
}
|
|
101
106
|
|
|
102
107
|
.dialog-title {
|
|
103
|
-
font-size:
|
|
108
|
+
font-size: 16px;
|
|
104
109
|
font-weight: bold;
|
|
105
110
|
color: rgb(131, 0, 191);
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
.el-button {
|
|
109
|
-
margin: 5px
|
|
114
|
+
margin: 5px 5px 5px 0;
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
:deep(.el-card) {
|
|
@@ -115,4 +120,13 @@ export default {
|
|
|
115
120
|
border: 0;
|
|
116
121
|
cursor: pointer;
|
|
117
122
|
}
|
|
123
|
+
|
|
124
|
+
.connection-label {
|
|
125
|
+
white-space: nowrap;
|
|
126
|
+
display: block;
|
|
127
|
+
width: 200px;
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
text-overflow: ellipsis;
|
|
130
|
+
font-size: 14px;
|
|
131
|
+
}
|
|
118
132
|
</style>
|
|
@@ -308,12 +308,12 @@ export default {
|
|
|
308
308
|
data: function () {
|
|
309
309
|
return {
|
|
310
310
|
toolbarIcons: [
|
|
311
|
-
{ name: "Edit", active: false, disabled: false },
|
|
312
|
-
{ name: "Delete", active: false, disabled: false },
|
|
313
|
-
{ name: "Point", active: false, disabled: false },
|
|
314
|
-
{ name: "LineString", active: false, disabled: false },
|
|
315
|
-
{ name: "Polygon", active: false, disabled: false },
|
|
316
|
-
{ name: "Connection", active: false, disabled: true },
|
|
311
|
+
{ name: "Edit", active: false, disabled: false, type: "mode" },
|
|
312
|
+
{ name: "Delete", active: false, disabled: false, type: "mode" },
|
|
313
|
+
{ name: "Point", active: false, disabled: false, type: "tool" },
|
|
314
|
+
{ name: "LineString", active: false, disabled: false, type: "tool" },
|
|
315
|
+
{ name: "Polygon", active: false, disabled: false, type: "tool" },
|
|
316
|
+
{ name: "Connection", active: false, disabled: true, type: "conn" },
|
|
317
317
|
],
|
|
318
318
|
connectionDisplay: false,
|
|
319
319
|
dialogPosition: {
|
|
@@ -374,13 +374,13 @@ export default {
|
|
|
374
374
|
this.disabledToolbarConnectionIcon(true);
|
|
375
375
|
},
|
|
376
376
|
activeDrawMode: function (value) {
|
|
377
|
-
this.updateToolbarIcons(value);
|
|
377
|
+
this.updateToolbarIcons(value, "mode");
|
|
378
378
|
if (value === "Delete") {
|
|
379
379
|
this.connectionDisplay = false;
|
|
380
380
|
}
|
|
381
381
|
},
|
|
382
382
|
activeDrawTool: function (value) {
|
|
383
|
-
this.updateToolbarIcons(value);
|
|
383
|
+
this.updateToolbarIcons(value, "tool");
|
|
384
384
|
if (!value) {
|
|
385
385
|
this.connectionDisplay = false;
|
|
386
386
|
}
|
|
@@ -435,7 +435,7 @@ export default {
|
|
|
435
435
|
this.connectionDisplay = !this.connectionDisplay;
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
|
-
updateToolbarIcons: function (value) {
|
|
438
|
+
updateToolbarIcons: function (value, type) {
|
|
439
439
|
this.toolbarIcons.map((icon) => {
|
|
440
440
|
if (icon.name === value) {
|
|
441
441
|
icon.active = true;
|
|
@@ -444,7 +444,8 @@ export default {
|
|
|
444
444
|
}
|
|
445
445
|
});
|
|
446
446
|
this.toolbarIcons
|
|
447
|
-
.filter((icon) => icon.
|
|
447
|
+
.filter((icon) => icon.type !== "conn")
|
|
448
|
+
.filter((icon) => icon.type !== type)
|
|
448
449
|
.map((icon) => {
|
|
449
450
|
if (value) {
|
|
450
451
|
icon.disabled = true;
|
|
@@ -456,7 +457,7 @@ export default {
|
|
|
456
457
|
},
|
|
457
458
|
disabledToolbarConnectionIcon: function (value) {
|
|
458
459
|
this.toolbarIcons
|
|
459
|
-
.filter((icon) => icon.
|
|
460
|
+
.filter((icon) => icon.type === "conn")
|
|
460
461
|
.map((icon) => {
|
|
461
462
|
if (value) {
|
|
462
463
|
icon.disabled = true;
|
|
@@ -472,7 +473,7 @@ export default {
|
|
|
472
473
|
},
|
|
473
474
|
activeToolbarConnectionIcon: function (value) {
|
|
474
475
|
this.toolbarIcons
|
|
475
|
-
.filter((icon) => icon.
|
|
476
|
+
.filter((icon) => icon.type === "conn")
|
|
476
477
|
.map((icon) => {
|
|
477
478
|
if (value) {
|
|
478
479
|
icon.active = true;
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
<div class="block">
|
|
4
4
|
<el-row class="info-field">
|
|
5
5
|
<div class="title">Feature Annotations</div>
|
|
6
|
+
<div class="title-buttons">
|
|
7
|
+
<copy-to-clipboard :content="updatedCopyContent" />
|
|
8
|
+
</div>
|
|
6
9
|
</el-row>
|
|
7
10
|
<template v-if="annotationEntry">
|
|
8
11
|
<el-row
|
|
@@ -11,7 +14,9 @@
|
|
|
11
14
|
class="dialog-text"
|
|
12
15
|
:key="key"
|
|
13
16
|
>
|
|
14
|
-
<strong>{{ label }}: </strong>
|
|
17
|
+
<strong>{{ label }}: </strong>
|
|
18
|
+
<span v-if="label !== 'Ontology'">{{ annotationEntry[key] }}</span>
|
|
19
|
+
<a v-else :href="ontologyLink" target="_blank">{{ annotationEntry[key] }}</a>
|
|
15
20
|
</el-row>
|
|
16
21
|
<template v-if="prevSubs.length > 0">
|
|
17
22
|
<div
|
|
@@ -43,11 +48,15 @@
|
|
|
43
48
|
<el-row class="dialog-text">
|
|
44
49
|
<strong>Evidence: </strong>
|
|
45
50
|
<el-row
|
|
46
|
-
v-for="evidence in sub.body.evidence"
|
|
51
|
+
v-for="(evidence, index) in sub.body.evidence"
|
|
47
52
|
:key="evidence"
|
|
48
53
|
class="dialog-text"
|
|
49
|
-
>
|
|
50
|
-
<a :href="evidence" target="_blank">
|
|
54
|
+
>
|
|
55
|
+
<a v-if="typeof evidence === 'object' ":href="Object.values(evidence)[0]" target="_blank">
|
|
56
|
+
{{ Object.keys(evidence)[0] }}
|
|
57
|
+
</a>
|
|
58
|
+
<span v-else> {{ evidence }}</span>
|
|
59
|
+
<span v-if="index !== sub.body.evidence.length - 1">, </span>
|
|
51
60
|
</el-row>
|
|
52
61
|
</el-row>
|
|
53
62
|
<el-row class="dialog-text">
|
|
@@ -99,18 +108,17 @@
|
|
|
99
108
|
<el-select
|
|
100
109
|
:teleported="false"
|
|
101
110
|
v-model="evidencePrefix"
|
|
102
|
-
placeholder="
|
|
111
|
+
placeholder="Other:"
|
|
103
112
|
class="select-box"
|
|
104
113
|
popper-class="flatmap_dropdown"
|
|
105
114
|
>
|
|
106
115
|
<el-option
|
|
107
116
|
v-for="item in evidencePrefixes"
|
|
108
|
-
:key="item"
|
|
109
|
-
:
|
|
110
|
-
:value="item"
|
|
117
|
+
:key="item.label"
|
|
118
|
+
:value="item.value"
|
|
111
119
|
>
|
|
112
120
|
<el-row>
|
|
113
|
-
<el-col :span="12">{{ item }}</el-col>
|
|
121
|
+
<el-col :span="12">{{ item.label }}</el-col>
|
|
114
122
|
</el-row>
|
|
115
123
|
</el-option>
|
|
116
124
|
</el-select>
|
|
@@ -158,14 +166,18 @@ export default {
|
|
|
158
166
|
return {
|
|
159
167
|
displayPair: {
|
|
160
168
|
"Feature ID": "featureId",
|
|
161
|
-
|
|
162
|
-
|
|
169
|
+
Label: "label",
|
|
170
|
+
Ontology: "models",
|
|
163
171
|
Name: "name",
|
|
164
172
|
Resource: "resourceId",
|
|
165
173
|
},
|
|
166
174
|
editing: false,
|
|
167
|
-
evidencePrefixes: [
|
|
168
|
-
|
|
175
|
+
evidencePrefixes: [
|
|
176
|
+
{ value: "DOI:", label: "DOI:" },
|
|
177
|
+
{ value: "PMID:", label: "PMID:" },
|
|
178
|
+
{ value: "", label: "Other:" },
|
|
179
|
+
],
|
|
180
|
+
evidencePrefix: "DOI:",
|
|
169
181
|
evidence: [],
|
|
170
182
|
authenticated: false,
|
|
171
183
|
newEvidence: "",
|
|
@@ -174,6 +186,7 @@ export default {
|
|
|
174
186
|
showSubmissions: true,
|
|
175
187
|
errorMessage: "",
|
|
176
188
|
creator: undefined,
|
|
189
|
+
copyContent: '',
|
|
177
190
|
};
|
|
178
191
|
},
|
|
179
192
|
computed: {
|
|
@@ -195,6 +208,15 @@ export default {
|
|
|
195
208
|
this.annotationEntry["type"] === "deleted"
|
|
196
209
|
);
|
|
197
210
|
},
|
|
211
|
+
ontologyLink: function () {
|
|
212
|
+
const models = this.annotationEntry['models'];
|
|
213
|
+
if (models && models.startsWith("UBERON")) {
|
|
214
|
+
return `http://purl.obolibrary.org/obo/${this.annotationEntry.models.replace(":", "_")}`;
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
updatedCopyContent: function () {
|
|
218
|
+
return this.getUpdateCopyContent();
|
|
219
|
+
},
|
|
198
220
|
},
|
|
199
221
|
methods: {
|
|
200
222
|
evidenceEntered: function (value) {
|
|
@@ -257,18 +279,20 @@ export default {
|
|
|
257
279
|
this.annotationEntry["featureId"]
|
|
258
280
|
) {
|
|
259
281
|
const evidenceURLs = [];
|
|
260
|
-
this.evidence.forEach((
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
} else if (
|
|
265
|
-
|
|
282
|
+
this.evidence.forEach((evi) => {
|
|
283
|
+
let eviObject = {}
|
|
284
|
+
if (evi.includes("DOI:")) {
|
|
285
|
+
eviObject[evi] = evi.replace("DOI:", "https://doi.org/");
|
|
286
|
+
} else if (evi.includes("PMID:")) {
|
|
287
|
+
eviObject[evi] = evi.replace(
|
|
266
288
|
"PMID:",
|
|
267
289
|
"https://pubmed.ncbi.nlm.nih.gov/"
|
|
268
290
|
);
|
|
269
|
-
|
|
291
|
+
}
|
|
292
|
+
if (evi in eviObject) {
|
|
293
|
+
evidenceURLs.push(eviObject);
|
|
270
294
|
} else {
|
|
271
|
-
evidenceURLs.push(
|
|
295
|
+
evidenceURLs.push(evi);
|
|
272
296
|
}
|
|
273
297
|
});
|
|
274
298
|
const userAnnotation = {
|
|
@@ -316,6 +340,57 @@ export default {
|
|
|
316
340
|
this.newFeature = "";
|
|
317
341
|
this.comment = "";
|
|
318
342
|
},
|
|
343
|
+
getUpdateCopyContent: function () {
|
|
344
|
+
if (!this.annotationEntry) {
|
|
345
|
+
return '';
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
const contentArray = [];
|
|
349
|
+
|
|
350
|
+
// featureId
|
|
351
|
+
if (this.annotationEntry.featureId) {
|
|
352
|
+
contentArray.push(`<div><strong>Feature ID:</strong>${this.annotationEntry.featureId}</div>`);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// label
|
|
356
|
+
if (this.annotationEntry.label) {
|
|
357
|
+
contentArray.push(`<div><strong>Label:</strong>${this.annotationEntry.label}</div>`);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
// models
|
|
361
|
+
if (this.annotationEntry.models) {
|
|
362
|
+
contentArray.push(`<div><strong>Ontology:</strong>${this.annotationEntry.models}</div>`);
|
|
363
|
+
if (this.ontologyLink) {
|
|
364
|
+
contentArray.push(`<div><strong>Ontology Link:</strong>${this.ontologyLink}</div>`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
// resourceId
|
|
369
|
+
if (this.annotationEntry.resourceId) {
|
|
370
|
+
contentArray.push(`<div><strong>Resource:</strong>${this.annotationEntry.resourceId}</div>`);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
if (this.prevSubs.length) {
|
|
374
|
+
let annotationContent = '<div><strong>Annotations:</strong></div>\n<br>';
|
|
375
|
+
this.prevSubs.map((sub, index) => {
|
|
376
|
+
annotationContent += `<div><strong>Created:</strong>${this.formatTime(sub.created)}</div>\n<br>`;
|
|
377
|
+
annotationContent += `<div><strong>Creator:</strong>${sub.creator.name}</div>\n<br>`;
|
|
378
|
+
annotationContent += `<div><strong>Email:</strong>${sub.creator.email}</div>\n<br>`;
|
|
379
|
+
if (sub.body.evidence.length) {
|
|
380
|
+
let evidenceContent = '';
|
|
381
|
+
sub.body.evidence.forEach((evi, index) => {
|
|
382
|
+
evidenceContent += `${typeof evi === 'object' ? Object.values(evi)[0] : evi}`;
|
|
383
|
+
if (index !== sub.body.evidence.length - 1) evidenceContent += ', ';
|
|
384
|
+
})
|
|
385
|
+
annotationContent += `<div><strong>Evidence:</strong>${evidenceContent}</div>\n<br>`;
|
|
386
|
+
}
|
|
387
|
+
annotationContent += `<div><strong>Comment:</strong>${sub.body.comment}</div>\n<br>`;
|
|
388
|
+
})
|
|
389
|
+
contentArray.push(`<div>${annotationContent}</div>`);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return contentArray.join('\n\n<br>');
|
|
393
|
+
},
|
|
319
394
|
},
|
|
320
395
|
watch: {
|
|
321
396
|
annotationEntry: {
|
|
@@ -346,7 +421,11 @@ export default {
|
|
|
346
421
|
|
|
347
422
|
<style lang="scss" scoped>
|
|
348
423
|
.info-field {
|
|
424
|
+
padding: 0;
|
|
349
425
|
display: flex;
|
|
426
|
+
flex-direction: row;
|
|
427
|
+
justify-content: space-between;
|
|
428
|
+
gap: 1rem;
|
|
350
429
|
}
|
|
351
430
|
|
|
352
431
|
.block {
|
|
@@ -405,7 +484,22 @@ export default {
|
|
|
405
484
|
font-weight: 500;
|
|
406
485
|
font-weight: bold;
|
|
407
486
|
padding-bottom: 8px;
|
|
408
|
-
color:
|
|
487
|
+
color: $app-primary-color;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.title-buttons {
|
|
491
|
+
display: flex;
|
|
492
|
+
flex-direction: row;
|
|
493
|
+
gap: 0.5rem;
|
|
494
|
+
|
|
495
|
+
:deep(.copy-clipboard-button) {
|
|
496
|
+
&,
|
|
497
|
+
&:hover,
|
|
498
|
+
&:focus {
|
|
499
|
+
border-color: $app-primary-color !important;
|
|
500
|
+
border-radius: 50%;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
409
503
|
}
|
|
410
504
|
|
|
411
505
|
.sub-title {
|
package/src/components.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ declare module 'vue' {
|
|
|
14
14
|
CreateTooltipContent: typeof import('./components/Tooltip/CreateTooltipContent.vue')['default']
|
|
15
15
|
DrawToolbar: typeof import('./components/DrawToolbar/DrawToolbar.vue')['default']
|
|
16
16
|
ElButton: typeof import('element-plus/es')['ElButton']
|
|
17
|
-
ElButtonGroup: typeof import('element-plus/es')['ElButtonGroup']
|
|
18
17
|
ElCard: typeof import('element-plus/es')['ElCard']
|
|
19
18
|
ElCol: typeof import('element-plus/es')['ElCol']
|
|
20
19
|
ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
|