@abi-software/map-utilities 0.0.0-beta.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/LICENSE +201 -0
- package/README.md +28 -0
- package/index.html +13 -0
- package/jsconfig.json +8 -0
- package/package.json +23 -0
- package/public/favicon.ico +0 -0
- package/src/App.vue +506 -0
- package/src/assets/_variables.scss +43 -0
- package/src/assets/styles.scss +5 -0
- package/src/components/DrawToolbar/ConnectionDialog.vue +118 -0
- package/src/components/DrawToolbar/DrawToolbar.vue +627 -0
- package/src/components/EventBus.js +3 -0
- package/src/components/HelpModeDialog/HelpModeDialog.vue +394 -0
- package/src/components/Tooltip/AnnotationPopup.vue +467 -0
- package/src/components/Tooltip/ExternalResourceCard.vue +104 -0
- package/src/components/Tooltip/ProvenancePopup.vue +516 -0
- package/src/components/Tooltip/Tooltip.vue +45 -0
- package/src/components/TreeControls/TreeControls.vue +345 -0
- package/src/components/index.js +6 -0
- package/src/components.d.ts +42 -0
- package/src/main.js +5 -0
- package/static/FlatmapTreeData.json +4213 -0
- package/static/ScaffoldTreeData.json +89 -0
- package/vite.config.js +56 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div v-if="tooltipEntry" class="main" v-loading="loading">
|
|
3
|
+
<div class="block" v-if="tooltipEntry.title">
|
|
4
|
+
<div class="title">{{ capitalise(tooltipEntry.title) }}</div>
|
|
5
|
+
<div
|
|
6
|
+
v-if="
|
|
7
|
+
tooltipEntry.provenanceTaxonomyLabel &&
|
|
8
|
+
tooltipEntry.provenanceTaxonomyLabel.length > 0
|
|
9
|
+
"
|
|
10
|
+
class="subtitle"
|
|
11
|
+
>
|
|
12
|
+
{{ provSpeciesDescription }}
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
<div class="block" v-else>
|
|
16
|
+
<div class="title">{{ tooltipEntry.featureId }}</div>
|
|
17
|
+
</div>
|
|
18
|
+
<div v-if="featuresAlert">
|
|
19
|
+
<span class="attribute-title">Alert</span>
|
|
20
|
+
<el-popover
|
|
21
|
+
width="250"
|
|
22
|
+
trigger="hover"
|
|
23
|
+
:teleported="false"
|
|
24
|
+
popper-class="popover-origin-help"
|
|
25
|
+
>
|
|
26
|
+
<template #reference>
|
|
27
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
28
|
+
</template>
|
|
29
|
+
<span style="word-break: keep-all">
|
|
30
|
+
{{ featuresAlert }}
|
|
31
|
+
</span>
|
|
32
|
+
</el-popover>
|
|
33
|
+
</div>
|
|
34
|
+
<div
|
|
35
|
+
v-show="showDetails"
|
|
36
|
+
class="hide"
|
|
37
|
+
id="hide-path-info"
|
|
38
|
+
@click="showDetails = false"
|
|
39
|
+
>
|
|
40
|
+
Hide path information
|
|
41
|
+
<el-icon><el-icon-arrow-up /></el-icon>
|
|
42
|
+
</div>
|
|
43
|
+
<div
|
|
44
|
+
v-show="!showDetails"
|
|
45
|
+
class="hide"
|
|
46
|
+
id="show-path-info"
|
|
47
|
+
@click="showDetails = true"
|
|
48
|
+
>
|
|
49
|
+
Show path information
|
|
50
|
+
<el-icon><el-icon-arrow-down /></el-icon>
|
|
51
|
+
</div>
|
|
52
|
+
<transition name="slide-fade">
|
|
53
|
+
<div v-show="showDetails" class="content-container scrollbar">
|
|
54
|
+
{{ tooltipEntry.paths }}
|
|
55
|
+
<div v-if="tooltipEntry.origins && tooltipEntry.origins.length > 0" class="block">
|
|
56
|
+
<div>
|
|
57
|
+
<span class="attribute-title">Origin</span>
|
|
58
|
+
<el-popover
|
|
59
|
+
width="250"
|
|
60
|
+
trigger="hover"
|
|
61
|
+
:teleported="false"
|
|
62
|
+
popper-class="popover-origin-help"
|
|
63
|
+
>
|
|
64
|
+
<template #reference>
|
|
65
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
66
|
+
</template>
|
|
67
|
+
<span style="word-break: keep-all">
|
|
68
|
+
<i>Origin</i> {{ originDescription }}
|
|
69
|
+
</span>
|
|
70
|
+
</el-popover>
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
v-for="(origin, i) in tooltipEntry.origins"
|
|
74
|
+
class="attribute-content"
|
|
75
|
+
:origin-item-label="origin"
|
|
76
|
+
:key="origin"
|
|
77
|
+
>
|
|
78
|
+
{{ capitalise(origin) }}
|
|
79
|
+
<div v-if="i != tooltipEntry.origins.length - 1" class="separator"></div>
|
|
80
|
+
</div>
|
|
81
|
+
<el-button
|
|
82
|
+
v-show="
|
|
83
|
+
tooltipEntry.originsWithDatasets && tooltipEntry.originsWithDatasets.length > 0
|
|
84
|
+
"
|
|
85
|
+
class="button"
|
|
86
|
+
id="open-dendrites-button"
|
|
87
|
+
@click="openDendrites"
|
|
88
|
+
>
|
|
89
|
+
Explore origin data
|
|
90
|
+
</el-button>
|
|
91
|
+
</div>
|
|
92
|
+
<div
|
|
93
|
+
v-if="tooltipEntry.components && tooltipEntry.components.length > 0"
|
|
94
|
+
class="block"
|
|
95
|
+
>
|
|
96
|
+
<div class="attribute-title">Components</div>
|
|
97
|
+
<div
|
|
98
|
+
v-for="(component, i) in tooltipEntry.components"
|
|
99
|
+
class="attribute-content"
|
|
100
|
+
:component-item-label="component"
|
|
101
|
+
:key="component"
|
|
102
|
+
>
|
|
103
|
+
{{ capitalise(component) }}
|
|
104
|
+
<div
|
|
105
|
+
v-if="i != tooltipEntry.components.length - 1"
|
|
106
|
+
class="separator"
|
|
107
|
+
></div>
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
<div
|
|
111
|
+
v-if="tooltipEntry.destinations && tooltipEntry.destinations.length > 0"
|
|
112
|
+
class="block"
|
|
113
|
+
>
|
|
114
|
+
<div>
|
|
115
|
+
<span class="attribute-title">Destination</span>
|
|
116
|
+
<el-popover
|
|
117
|
+
width="250"
|
|
118
|
+
trigger="hover"
|
|
119
|
+
:teleported="false"
|
|
120
|
+
popper-class="popover-origin-help"
|
|
121
|
+
>
|
|
122
|
+
<template #reference>
|
|
123
|
+
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
124
|
+
</template>
|
|
125
|
+
<span style="word-break: keep-all">
|
|
126
|
+
<i>Destination</i> is where the axons terminate
|
|
127
|
+
</span>
|
|
128
|
+
</el-popover>
|
|
129
|
+
</div>
|
|
130
|
+
<div
|
|
131
|
+
v-for="(destination, i) in tooltipEntry.destinations"
|
|
132
|
+
class="attribute-content"
|
|
133
|
+
:destination-item-label="destination"
|
|
134
|
+
:key="destination"
|
|
135
|
+
>
|
|
136
|
+
{{ capitalise(destination) }}
|
|
137
|
+
<div
|
|
138
|
+
v-if="i != tooltipEntry.destinations.length - 1"
|
|
139
|
+
class="separator"
|
|
140
|
+
></div>
|
|
141
|
+
</div>
|
|
142
|
+
<el-button
|
|
143
|
+
v-show="
|
|
144
|
+
tooltipEntry.destinationsWithDatasets &&
|
|
145
|
+
tooltipEntry.destinationsWithDatasets.length > 0
|
|
146
|
+
"
|
|
147
|
+
class="button"
|
|
148
|
+
@click="openAxons"
|
|
149
|
+
>
|
|
150
|
+
Explore destination data
|
|
151
|
+
</el-button>
|
|
152
|
+
</div>
|
|
153
|
+
|
|
154
|
+
<el-button
|
|
155
|
+
v-show="
|
|
156
|
+
tooltipEntry.componentsWithDatasets &&
|
|
157
|
+
tooltipEntry.componentsWithDatasets.length > 0
|
|
158
|
+
"
|
|
159
|
+
class="button"
|
|
160
|
+
@click="openAll"
|
|
161
|
+
>
|
|
162
|
+
Search for data on components
|
|
163
|
+
</el-button>
|
|
164
|
+
|
|
165
|
+
<external-resource-card :resources="resources"></external-resource-card>
|
|
166
|
+
</div>
|
|
167
|
+
</transition>
|
|
168
|
+
</div>
|
|
169
|
+
</template>
|
|
170
|
+
|
|
171
|
+
<script>
|
|
172
|
+
import EventBus from "../EventBus";
|
|
173
|
+
|
|
174
|
+
const titleCase = (str) => {
|
|
175
|
+
return str.replace(/\w\S*/g, (t) => {
|
|
176
|
+
return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase();
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const capitalise = function (str) {
|
|
181
|
+
if (str) return str.charAt(0).toUpperCase() + str.slice(1);
|
|
182
|
+
return "";
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
export default {
|
|
186
|
+
name: "ProvenancePopup",
|
|
187
|
+
props: {
|
|
188
|
+
tooltipEntry: {
|
|
189
|
+
type: Object,
|
|
190
|
+
default: () => ({
|
|
191
|
+
destinations: [],
|
|
192
|
+
origins: [],
|
|
193
|
+
components: [],
|
|
194
|
+
destinationsWithDatasets: [],
|
|
195
|
+
originsWithDatasets: [],
|
|
196
|
+
componentsWithDatasets: [],
|
|
197
|
+
resource: undefined,
|
|
198
|
+
}),
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
inject: ["getFeaturesAlert"],
|
|
202
|
+
data: function () {
|
|
203
|
+
return {
|
|
204
|
+
controller: undefined,
|
|
205
|
+
activeSpecies: undefined,
|
|
206
|
+
pubmedSearchUrl: "",
|
|
207
|
+
loading: false,
|
|
208
|
+
showToolip: false,
|
|
209
|
+
showDetails: false,
|
|
210
|
+
originDescriptions: {
|
|
211
|
+
motor: "is the location of the initial cell body of the circuit",
|
|
212
|
+
sensory: "is the location of the initial cell body in the PNS circuit",
|
|
213
|
+
},
|
|
214
|
+
componentsWithDatasets: [],
|
|
215
|
+
uberons: [{ id: undefined, name: undefined }],
|
|
216
|
+
};
|
|
217
|
+
},
|
|
218
|
+
computed: {
|
|
219
|
+
featuresAlert() {
|
|
220
|
+
return this.getFeaturesAlert();
|
|
221
|
+
},
|
|
222
|
+
resources: function () {
|
|
223
|
+
let resources = [];
|
|
224
|
+
if (this.tooltipEntry && this.tooltipEntry.hyperlinks) {
|
|
225
|
+
resources = this.tooltipEntry.hyperlinks;
|
|
226
|
+
}
|
|
227
|
+
return resources;
|
|
228
|
+
},
|
|
229
|
+
originDescription: function () {
|
|
230
|
+
if (
|
|
231
|
+
this.tooltipEntry &&
|
|
232
|
+
this.tooltipEntry.title &&
|
|
233
|
+
this.tooltipEntry.title.toLowerCase().includes("motor")
|
|
234
|
+
) {
|
|
235
|
+
return this.originDescriptions.motor;
|
|
236
|
+
} else {
|
|
237
|
+
return this.originDescriptions.sensory;
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
provSpeciesDescription: function () {
|
|
241
|
+
let text = "Studied in";
|
|
242
|
+
this.tooltipEntry.provenanceTaxonomyLabel.forEach((label) => {
|
|
243
|
+
text += ` ${label},`;
|
|
244
|
+
});
|
|
245
|
+
text = text.slice(0, -1); // remove last comma
|
|
246
|
+
text += " species";
|
|
247
|
+
return text;
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
methods: {
|
|
251
|
+
titleCase: function (title) {
|
|
252
|
+
return titleCase(title);
|
|
253
|
+
},
|
|
254
|
+
capitalise: function (text) {
|
|
255
|
+
return capitalise(text);
|
|
256
|
+
},
|
|
257
|
+
openUrl: function (url) {
|
|
258
|
+
window.open(url, "_blank");
|
|
259
|
+
},
|
|
260
|
+
openAll: function () {
|
|
261
|
+
EventBus.emit("onActionClick", {
|
|
262
|
+
type: "Facets",
|
|
263
|
+
labels: this.tooltipEntry.componentsWithDatasets.map((a) => a.name),
|
|
264
|
+
});
|
|
265
|
+
},
|
|
266
|
+
openAxons: function () {
|
|
267
|
+
EventBus.emit("onActionClick", {
|
|
268
|
+
type: "Facets",
|
|
269
|
+
labels: this.tooltipEntry.destinationsWithDatasets.map((a) => a.name),
|
|
270
|
+
});
|
|
271
|
+
},
|
|
272
|
+
openDendrites: function () {
|
|
273
|
+
EventBus.emit("onActionClick", {
|
|
274
|
+
type: "Facets",
|
|
275
|
+
labels: this.tooltipEntry.originsWithDatasets.map((a) => a.name),
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
pubmedSearchUrlUpdate: function (val) {
|
|
279
|
+
this.pubmedSearchUrl = val;
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
</script>
|
|
284
|
+
|
|
285
|
+
<style lang="scss" scoped>
|
|
286
|
+
.display {
|
|
287
|
+
width: 44px;
|
|
288
|
+
word-break: normal;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.title {
|
|
292
|
+
text-align: left;
|
|
293
|
+
// width: 16em;
|
|
294
|
+
line-height: 1.5em !important;
|
|
295
|
+
font-size: 1em;
|
|
296
|
+
font-family: Helvetica;
|
|
297
|
+
font-weight: 500;
|
|
298
|
+
/* font-weight: bold; */
|
|
299
|
+
padding-bottom: 8px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.block {
|
|
303
|
+
margin-bottom: 0.5em;
|
|
304
|
+
|
|
305
|
+
.main > &:first-of-type {
|
|
306
|
+
margin-right: 0.5em;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.pub {
|
|
311
|
+
width: 16rem;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.icon {
|
|
315
|
+
right: 0px;
|
|
316
|
+
position: absolute;
|
|
317
|
+
top: 10px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.icon:hover {
|
|
321
|
+
cursor: pointer;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
:deep(.popover-origin-help.el-popover) {
|
|
325
|
+
text-transform: none !important; // need to overide the tooltip text transform
|
|
326
|
+
border: 1px solid $app-primary-color;
|
|
327
|
+
.el-popper__arrow {
|
|
328
|
+
&:before {
|
|
329
|
+
border-color: $app-primary-color;
|
|
330
|
+
background-color: #ffffff;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
.info {
|
|
336
|
+
transform: rotate(180deg);
|
|
337
|
+
color: #8300bf;
|
|
338
|
+
margin-left: 8px;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
.separator {
|
|
342
|
+
width: 90%;
|
|
343
|
+
height: 1px;
|
|
344
|
+
background-color: #bfbec2;
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.hide {
|
|
348
|
+
color: $app-primary-color;
|
|
349
|
+
cursor: pointer;
|
|
350
|
+
margin-right: 6px;
|
|
351
|
+
margin-top: 3px;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.slide-fade-enter-active {
|
|
355
|
+
transition: opacity 0.5s, transform 0.5s;
|
|
356
|
+
}
|
|
357
|
+
.slide-fade-leave-active {
|
|
358
|
+
transition: opacity 0.2s, transform 0.2s;
|
|
359
|
+
}
|
|
360
|
+
.slide-fade-enter, .slide-fade-leave-to /* .slide-fade-leave-active in <2.1.8 */ {
|
|
361
|
+
opacity: 0;
|
|
362
|
+
transform: translateY(-8px);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
.main {
|
|
366
|
+
font-size: 14px;
|
|
367
|
+
text-align: left;
|
|
368
|
+
line-height: 1.5em;
|
|
369
|
+
font-family: Asap, sans-serif, Helvetica;
|
|
370
|
+
font-weight: 400;
|
|
371
|
+
/* outline: thin red solid; */
|
|
372
|
+
padding: 1em !important;
|
|
373
|
+
overflow: hidden;
|
|
374
|
+
min-width: 16rem;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.title {
|
|
378
|
+
font-size: 18px;
|
|
379
|
+
font-weight: 500;
|
|
380
|
+
font-weight: bold;
|
|
381
|
+
padding-bottom: 8px;
|
|
382
|
+
color: rgb(131, 0, 191);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.attribute-title {
|
|
386
|
+
font-size: 16px;
|
|
387
|
+
font-weight: 600;
|
|
388
|
+
/* font-weight: bold; */
|
|
389
|
+
text-transform: uppercase;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.attribute-content {
|
|
393
|
+
font-size: 14px;
|
|
394
|
+
font-weight: 500;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.popover-container {
|
|
398
|
+
height: 100%;
|
|
399
|
+
width: 100%;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
.main {
|
|
403
|
+
.el-button.is-round {
|
|
404
|
+
border-radius: 4px;
|
|
405
|
+
padding: 9px 20px 10px 20px;
|
|
406
|
+
display: flex;
|
|
407
|
+
height: 36px;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
.button {
|
|
412
|
+
margin-left: 0px !important;
|
|
413
|
+
margin-top: 0px !important;
|
|
414
|
+
font-size: 14px !important;
|
|
415
|
+
background-color: $app-primary-color;
|
|
416
|
+
color: #fff;
|
|
417
|
+
& + .button {
|
|
418
|
+
margin-top: 10px !important;
|
|
419
|
+
}
|
|
420
|
+
&:hover {
|
|
421
|
+
color: #fff !important;
|
|
422
|
+
background: #ac76c5 !important;
|
|
423
|
+
border: 1px solid #ac76c5 !important;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.tooltip-container {
|
|
428
|
+
&::after,
|
|
429
|
+
&::before {
|
|
430
|
+
content: "";
|
|
431
|
+
display: block;
|
|
432
|
+
position: absolute;
|
|
433
|
+
width: 0;
|
|
434
|
+
height: 0;
|
|
435
|
+
border-style: solid;
|
|
436
|
+
flex-shrink: 0;
|
|
437
|
+
}
|
|
438
|
+
.tooltip {
|
|
439
|
+
&::after {
|
|
440
|
+
display: none;
|
|
441
|
+
}
|
|
442
|
+
&::before {
|
|
443
|
+
display: none;
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.maplibregl-popup-anchor-bottom {
|
|
449
|
+
.tooltip-container {
|
|
450
|
+
&::after,
|
|
451
|
+
&::before {
|
|
452
|
+
top: 100%;
|
|
453
|
+
border-width: 12px;
|
|
454
|
+
}
|
|
455
|
+
&::after {
|
|
456
|
+
margin-top: -1px;
|
|
457
|
+
border-color: rgb(255, 255, 255) transparent transparent transparent;
|
|
458
|
+
}
|
|
459
|
+
&::before {
|
|
460
|
+
margin: 0 auto;
|
|
461
|
+
border-color: $app-primary-color transparent transparent transparent;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.maplibregl-popup-anchor-top {
|
|
467
|
+
.tooltip-container {
|
|
468
|
+
&::after,
|
|
469
|
+
&::before {
|
|
470
|
+
top: -24px;
|
|
471
|
+
border-width: 12px;
|
|
472
|
+
}
|
|
473
|
+
&::after {
|
|
474
|
+
margin-top: 1px;
|
|
475
|
+
border-color: transparent transparent rgb(255, 255, 255) transparent;
|
|
476
|
+
}
|
|
477
|
+
&::before {
|
|
478
|
+
margin: 0 auto;
|
|
479
|
+
border-color: transparent transparent $app-primary-color transparent;
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.content-container {
|
|
485
|
+
overflow-y: scroll;
|
|
486
|
+
scrollbar-width: thin !important;
|
|
487
|
+
max-height: 240px;
|
|
488
|
+
|
|
489
|
+
.block {
|
|
490
|
+
padding-top: 0.5em;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.scrollbar::-webkit-scrollbar-track {
|
|
495
|
+
border-radius: 10px;
|
|
496
|
+
background-color: #f5f5f5;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.scrollbar::-webkit-scrollbar {
|
|
500
|
+
width: 12px;
|
|
501
|
+
right: -12px;
|
|
502
|
+
background-color: #f5f5f5;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
.scrollbar::-webkit-scrollbar-thumb {
|
|
506
|
+
border-radius: 4px;
|
|
507
|
+
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
|
|
508
|
+
background-color: #979797;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
/* Fix for chrome bug where under triangle pops up above one on top of it */
|
|
512
|
+
.selector:not(*:root),
|
|
513
|
+
.tooltip-container::after {
|
|
514
|
+
top: 99.4%;
|
|
515
|
+
}
|
|
516
|
+
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="tooltip-container" id="tooltip-container">
|
|
3
|
+
<template v-if="annotationDisplay">
|
|
4
|
+
<annotation-popup
|
|
5
|
+
:annotationEntry="annotationEntry"
|
|
6
|
+
@annotation="$emit('annotation', $event)"
|
|
7
|
+
/>
|
|
8
|
+
</template>
|
|
9
|
+
<template v-else>
|
|
10
|
+
<provenance-popup :tooltipEntry="tooltipEntry" />
|
|
11
|
+
</template>
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
export default {
|
|
17
|
+
name: "Tooltip",
|
|
18
|
+
props: {
|
|
19
|
+
tooltipEntry: {
|
|
20
|
+
type: Object,
|
|
21
|
+
},
|
|
22
|
+
annotationDisplay: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false,
|
|
25
|
+
},
|
|
26
|
+
annotationEntry: {
|
|
27
|
+
type: Object,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style lang="scss" scoped>
|
|
34
|
+
.tooltip-container {
|
|
35
|
+
text-align: justify;
|
|
36
|
+
border-radius: 4px;
|
|
37
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
38
|
+
pointer-events: auto;
|
|
39
|
+
background: #fff;
|
|
40
|
+
border: 1px solid $app-primary-color;
|
|
41
|
+
display: flex;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
align-items: center;
|
|
44
|
+
}
|
|
45
|
+
</style>
|