@abi-software/map-utilities 0.0.0-beta.6 → 0.0.0-beta.7

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.
@@ -1,518 +1,601 @@
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" class="attribute-title-container">
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 class="attribute-title-container">
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-container">
97
- <div class="attribute-title">Components</div>
98
- </div>
99
- <div
100
- v-for="(component, i) in tooltipEntry.components"
101
- class="attribute-content"
102
- :component-item-label="component"
103
- :key="component"
104
- >
105
- {{ capitalise(component) }}
106
- <div
107
- v-if="i != tooltipEntry.components.length - 1"
108
- class="separator"
109
- ></div>
110
- </div>
111
- </div>
112
- <div
113
- v-if="tooltipEntry.destinations && tooltipEntry.destinations.length > 0"
114
- class="block"
115
- >
116
- <div class="attribute-title-container">
117
- <span class="attribute-title">Destination</span>
118
- <el-popover
119
- width="250"
120
- trigger="hover"
121
- :teleported="false"
122
- popper-class="popover-origin-help"
123
- >
124
- <template #reference>
125
- <el-icon class="info"><el-icon-warning /></el-icon>
126
- </template>
127
- <span style="word-break: keep-all">
128
- <i>Destination</i> is where the axons terminate
129
- </span>
130
- </el-popover>
131
- </div>
132
- <div
133
- v-for="(destination, i) in tooltipEntry.destinations"
134
- class="attribute-content"
135
- :destination-item-label="destination"
136
- :key="destination"
137
- >
138
- {{ capitalise(destination) }}
139
- <div
140
- v-if="i != tooltipEntry.destinations.length - 1"
141
- class="separator"
142
- ></div>
143
- </div>
144
- <el-button
145
- v-show="
146
- tooltipEntry.destinationsWithDatasets &&
147
- tooltipEntry.destinationsWithDatasets.length > 0
148
- "
149
- class="button"
150
- @click="openAxons"
151
- >
152
- Explore destination data
153
- </el-button>
154
- </div>
155
-
156
- <el-button
157
- v-show="
158
- tooltipEntry.componentsWithDatasets &&
159
- tooltipEntry.componentsWithDatasets.length > 0
160
- "
161
- class="button"
162
- @click="openAll"
163
- >
164
- Search for data on components
165
- </el-button>
166
-
167
- <external-resource-card :resources="resources"></external-resource-card>
168
- </div>
169
- </transition>
170
- </div>
171
- </template>
172
-
173
- <script>
174
- import EventBus from "../EventBus.js";
175
-
176
- const titleCase = (str) => {
177
- return str.replace(/\w\S*/g, (t) => {
178
- return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase();
179
- });
180
- };
181
-
182
- const capitalise = function (str) {
183
- if (str) return str.charAt(0).toUpperCase() + str.slice(1);
184
- return "";
185
- };
186
-
187
- export default {
188
- name: "ProvenancePopup",
189
- props: {
190
- tooltipEntry: {
191
- type: Object,
192
- default: () => ({
193
- destinations: [],
194
- origins: [],
195
- components: [],
196
- destinationsWithDatasets: [],
197
- originsWithDatasets: [],
198
- componentsWithDatasets: [],
199
- resource: undefined,
200
- }),
201
- },
202
- },
203
- inject: ["getFeaturesAlert"],
204
- data: function () {
205
- return {
206
- controller: undefined,
207
- activeSpecies: undefined,
208
- pubmedSearchUrl: "",
209
- loading: false,
210
- showToolip: false,
211
- showDetails: false,
212
- originDescriptions: {
213
- motor: "is the location of the initial cell body of the circuit",
214
- sensory: "is the location of the initial cell body in the PNS circuit",
215
- },
216
- componentsWithDatasets: [],
217
- uberons: [{ id: undefined, name: undefined }],
218
- };
219
- },
220
- computed: {
221
- featuresAlert() {
222
- return this.getFeaturesAlert();
223
- },
224
- resources: function () {
225
- let resources = [];
226
- if (this.tooltipEntry && this.tooltipEntry.hyperlinks) {
227
- resources = this.tooltipEntry.hyperlinks;
228
- }
229
- return resources;
230
- },
231
- originDescription: function () {
232
- if (
233
- this.tooltipEntry &&
234
- this.tooltipEntry.title &&
235
- this.tooltipEntry.title.toLowerCase().includes("motor")
236
- ) {
237
- return this.originDescriptions.motor;
238
- } else {
239
- return this.originDescriptions.sensory;
240
- }
241
- },
242
- provSpeciesDescription: function () {
243
- let text = "Studied in";
244
- this.tooltipEntry.provenanceTaxonomyLabel.forEach((label) => {
245
- text += ` ${label},`;
246
- });
247
- text = text.slice(0, -1); // remove last comma
248
- text += " species";
249
- return text;
250
- },
251
- },
252
- methods: {
253
- titleCase: function (title) {
254
- return titleCase(title);
255
- },
256
- capitalise: function (text) {
257
- return capitalise(text);
258
- },
259
- openUrl: function (url) {
260
- window.open(url, "_blank");
261
- },
262
- openAll: function () {
263
- EventBus.emit("onActionClick", {
264
- type: "Facets",
265
- labels: this.tooltipEntry.componentsWithDatasets.map((a) => a.name),
266
- });
267
- },
268
- openAxons: function () {
269
- EventBus.emit("onActionClick", {
270
- type: "Facets",
271
- labels: this.tooltipEntry.destinationsWithDatasets.map((a) => a.name),
272
- });
273
- },
274
- openDendrites: function () {
275
- EventBus.emit("onActionClick", {
276
- type: "Facets",
277
- labels: this.tooltipEntry.originsWithDatasets.map((a) => a.name),
278
- });
279
- },
280
- pubmedSearchUrlUpdate: function (val) {
281
- this.pubmedSearchUrl = val;
282
- },
283
- },
284
- };
285
- </script>
286
-
287
- <style lang="scss" scoped>
288
- .display {
289
- width: 44px;
290
- word-break: normal;
291
- }
292
-
293
- .title {
294
- text-align: left;
295
- // width: 16em;
296
- line-height: 1.5em !important;
297
- font-size: 18px;
298
- font-family: Helvetica;
299
- font-weight: bold;
300
- padding-bottom: 8px;
301
- color: $app-primary-color;
302
- }
303
-
304
- .block {
305
- margin-bottom: 0.5em;
306
-
307
- .main > &:first-of-type {
308
- margin-right: 1em;
309
- }
310
- }
311
-
312
- .pub {
313
- width: 16rem;
314
- }
315
-
316
- .icon {
317
- right: 0px;
318
- position: absolute;
319
- top: 10px;
320
- }
321
-
322
- .icon:hover {
323
- cursor: pointer;
324
- }
325
-
326
- :deep(.popover-origin-help.el-popover) {
327
- text-transform: none !important; // need to overide the tooltip text transform
328
- border: 1px solid $app-primary-color;
329
- .el-popper__arrow {
330
- &:before {
331
- border-color: $app-primary-color;
332
- background-color: #ffffff;
333
- }
334
- }
335
- }
336
-
337
- .info {
338
- transform: rotate(180deg);
339
- color: #8300bf;
340
- margin-left: 8px;
341
- }
342
-
343
- .separator {
344
- width: 90%;
345
- height: 1px;
346
- background-color: #bfbec2;
347
- }
348
-
349
- .hide {
350
- color: $app-primary-color;
351
- cursor: pointer;
352
- margin-right: 6px;
353
- margin-top: 3px;
354
- }
355
-
356
- .slide-fade-enter-active {
357
- transition: opacity 0.5s, transform 0.5s;
358
- }
359
- .slide-fade-leave-active {
360
- transition: opacity 0.2s, transform 0.2s;
361
- }
362
- .slide-fade-enter, .slide-fade-leave-to /* .slide-fade-leave-active in <2.1.8 */ {
363
- opacity: 0;
364
- transform: translateY(-8px);
365
- }
366
-
367
- .main {
368
- font-size: 14px;
369
- text-align: left;
370
- line-height: 1.5em;
371
- font-family: Asap, sans-serif, Helvetica;
372
- font-weight: 400;
373
- /* outline: thin red solid; */
374
- padding: 1em !important;
375
- overflow: hidden;
376
- min-width: 16rem;
377
- }
378
-
379
- .attribute-title-container {
380
- margin-bottom: 0.5em;
381
- }
382
-
383
- .attribute-title {
384
- font-size: 16px;
385
- font-weight: 600;
386
- /* font-weight: bold; */
387
- text-transform: uppercase;
388
- }
389
-
390
- .attribute-content {
391
- font-size: 14px;
392
- font-weight: 500;
393
-
394
- &:last-of-type {
395
- margin-bottom: 0.5em;
396
- }
397
- }
398
-
399
- .popover-container {
400
- height: 100%;
401
- width: 100%;
402
- }
403
-
404
- .main {
405
- .el-button.is-round {
406
- border-radius: 4px;
407
- padding: 9px 20px 10px 20px;
408
- display: flex;
409
- height: 36px;
410
- }
411
- }
412
-
413
- .button {
414
- margin-left: 0px !important;
415
- margin-top: 0px !important;
416
- font-size: 14px !important;
417
- background-color: $app-primary-color;
418
- color: #fff;
419
- & + .button {
420
- margin-top: 10px !important;
421
- }
422
- &:hover {
423
- color: #fff !important;
424
- background: #ac76c5 !important;
425
- border: 1px solid #ac76c5 !important;
426
- }
427
- }
428
-
429
- .tooltip-container {
430
- &::after,
431
- &::before {
432
- content: "";
433
- display: block;
434
- position: absolute;
435
- width: 0;
436
- height: 0;
437
- border-style: solid;
438
- flex-shrink: 0;
439
- }
440
- .tooltip {
441
- &::after {
442
- display: none;
443
- }
444
- &::before {
445
- display: none;
446
- }
447
- }
448
- }
449
-
450
- .maplibregl-popup-anchor-bottom {
451
- .tooltip-container {
452
- &::after,
453
- &::before {
454
- top: 100%;
455
- border-width: 12px;
456
- }
457
- &::after {
458
- margin-top: -1px;
459
- border-color: rgb(255, 255, 255) transparent transparent transparent;
460
- }
461
- &::before {
462
- margin: 0 auto;
463
- border-color: $app-primary-color transparent transparent transparent;
464
- }
465
- }
466
- }
467
-
468
- .maplibregl-popup-anchor-top {
469
- .tooltip-container {
470
- &::after,
471
- &::before {
472
- top: -24px;
473
- border-width: 12px;
474
- }
475
- &::after {
476
- margin-top: 1px;
477
- border-color: transparent transparent rgb(255, 255, 255) transparent;
478
- }
479
- &::before {
480
- margin: 0 auto;
481
- border-color: transparent transparent $app-primary-color transparent;
482
- }
483
- }
484
- }
485
-
486
- .content-container {
487
- overflow-y: scroll;
488
- scrollbar-width: thin !important;
489
- max-height: 240px;
490
-
491
- .block {
492
- padding-top: 0.5em;
493
- }
494
- }
495
-
496
- .scrollbar::-webkit-scrollbar-track {
497
- border-radius: 10px;
498
- background-color: #f5f5f5;
499
- }
500
-
501
- .scrollbar::-webkit-scrollbar {
502
- width: 12px;
503
- right: -12px;
504
- background-color: #f5f5f5;
505
- }
506
-
507
- .scrollbar::-webkit-scrollbar-thumb {
508
- border-radius: 4px;
509
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
510
- background-color: #979797;
511
- }
512
-
513
- /* Fix for chrome bug where under triangle pops up above one on top of it */
514
- .selector:not(*:root),
515
- .tooltip-container::after {
516
- top: 99.4%;
517
- }
518
- </style>
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" class="attribute-title-container">
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 class="block">
35
+ <el-button
36
+ class="button"
37
+ @click="showImages = !showImages"
38
+ >
39
+ <span v-if="showImages">Hide images</span>
40
+ <span v-else>View images at this location (Gallery)</span>
41
+ </el-button>
42
+ <div v-if="showImages" class="image-gallery-container">
43
+ <Gallery :items="galleryItems" />
44
+ </div>
45
+ <el-button
46
+ class="button"
47
+ @click="viewImage(imageIframeURL[this.tooltipEntry.featureId[0]])"
48
+ >
49
+ <span>View images at this location (iFrame)</span>
50
+ </el-button>
51
+ </div>
52
+ <div
53
+ v-show="showDetails"
54
+ class="hide"
55
+ id="hide-path-info"
56
+ @click="showDetails = false"
57
+ >
58
+ Hide path information
59
+ <el-icon><el-icon-arrow-up /></el-icon>
60
+ </div>
61
+ <div
62
+ v-show="!showDetails"
63
+ class="hide"
64
+ id="show-path-info"
65
+ @click="showDetails = true"
66
+ >
67
+ Show path information
68
+ <el-icon><el-icon-arrow-down /></el-icon>
69
+ </div>
70
+ <transition name="slide-fade">
71
+ <div v-show="showDetails" class="content-container scrollbar">
72
+ {{ tooltipEntry.paths }}
73
+ <div v-if="tooltipEntry.origins && tooltipEntry.origins.length > 0" class="block">
74
+ <div class="attribute-title-container">
75
+ <span class="attribute-title">Origin</span>
76
+ <el-popover
77
+ width="250"
78
+ trigger="hover"
79
+ :teleported="false"
80
+ popper-class="popover-origin-help"
81
+ >
82
+ <template #reference>
83
+ <el-icon class="info"><el-icon-warning /></el-icon>
84
+ </template>
85
+ <span style="word-break: keep-all">
86
+ <i>Origin</i> {{ originDescription }}
87
+ </span>
88
+ </el-popover>
89
+ </div>
90
+ <div
91
+ v-for="(origin, i) in tooltipEntry.origins"
92
+ class="attribute-content"
93
+ :origin-item-label="origin"
94
+ :key="origin"
95
+ >
96
+ {{ capitalise(origin) }}
97
+ <div v-if="i != tooltipEntry.origins.length - 1" class="separator"></div>
98
+ </div>
99
+ <el-button
100
+ v-show="
101
+ tooltipEntry.originsWithDatasets && tooltipEntry.originsWithDatasets.length > 0
102
+ "
103
+ class="button"
104
+ id="open-dendrites-button"
105
+ @click="openDendrites"
106
+ >
107
+ Explore origin data
108
+ </el-button>
109
+ </div>
110
+ <div
111
+ v-if="tooltipEntry.components && tooltipEntry.components.length > 0"
112
+ class="block"
113
+ >
114
+ <div class="attribute-title-container">
115
+ <div class="attribute-title">Components</div>
116
+ </div>
117
+ <div
118
+ v-for="(component, i) in tooltipEntry.components"
119
+ class="attribute-content"
120
+ :component-item-label="component"
121
+ :key="component"
122
+ >
123
+ {{ capitalise(component) }}
124
+ <div
125
+ v-if="i != tooltipEntry.components.length - 1"
126
+ class="separator"
127
+ ></div>
128
+ </div>
129
+ </div>
130
+ <div
131
+ v-if="tooltipEntry.destinations && tooltipEntry.destinations.length > 0"
132
+ class="block"
133
+ >
134
+ <div class="attribute-title-container">
135
+ <span class="attribute-title">Destination</span>
136
+ <el-popover
137
+ width="250"
138
+ trigger="hover"
139
+ :teleported="false"
140
+ popper-class="popover-origin-help"
141
+ >
142
+ <template #reference>
143
+ <el-icon class="info"><el-icon-warning /></el-icon>
144
+ </template>
145
+ <span style="word-break: keep-all">
146
+ <i>Destination</i> is where the axons terminate
147
+ </span>
148
+ </el-popover>
149
+ </div>
150
+ <div
151
+ v-for="(destination, i) in tooltipEntry.destinations"
152
+ class="attribute-content"
153
+ :destination-item-label="destination"
154
+ :key="destination"
155
+ >
156
+ {{ capitalise(destination) }}
157
+ <div
158
+ v-if="i != tooltipEntry.destinations.length - 1"
159
+ class="separator"
160
+ ></div>
161
+ </div>
162
+ <el-button
163
+ v-show="
164
+ tooltipEntry.destinationsWithDatasets &&
165
+ tooltipEntry.destinationsWithDatasets.length > 0
166
+ "
167
+ class="button"
168
+ @click="openAxons"
169
+ >
170
+ Explore destination data
171
+ </el-button>
172
+ </div>
173
+
174
+ <el-button
175
+ v-show="
176
+ tooltipEntry.componentsWithDatasets &&
177
+ tooltipEntry.componentsWithDatasets.length > 0
178
+ "
179
+ class="button"
180
+ @click="openAll"
181
+ >
182
+ Search for data on components
183
+ </el-button>
184
+
185
+ <external-resource-card :resources="resources"></external-resource-card>
186
+ </div>
187
+ </transition>
188
+ </div>
189
+ </template>
190
+
191
+ <script>
192
+ import Gallery from "@abi-software/gallery";
193
+ import "@abi-software/gallery/dist/style.css";
194
+ import {
195
+ ArrowUp as ElIconArrowUp,
196
+ ArrowDown as ElIconArrowDown,
197
+ Warning as ElIconWarning,
198
+ } from '@element-plus/icons-vue'
199
+ /* eslint-disable no-alert, no-console */
200
+ import {
201
+ ElButton as Button,
202
+ ElContainer as Container,
203
+ ElIcon as Icon,
204
+ } from 'element-plus'
205
+
206
+ import EventBus from "../EventBus.js";
207
+
208
+ const titleCase = (str) => {
209
+ return str.replace(/\w\S*/g, (t) => {
210
+ return t.charAt(0).toUpperCase() + t.substr(1).toLowerCase();
211
+ });
212
+ };
213
+
214
+ const capitalise = function (str) {
215
+ if (str) return str.charAt(0).toUpperCase() + str.slice(1);
216
+ return "";
217
+ };
218
+
219
+ // TODO: temp data for testing
220
+ const galleryItems = [
221
+ {
222
+ title: 'Title 1',
223
+ type: 'data1',
224
+ userData: 'https://sparc.science/',
225
+ },
226
+ {
227
+ title: 'Title 2',
228
+ type: 'data2',
229
+ link: 'https://sparc.science/',
230
+ },
231
+ {
232
+ title: 'Title 3',
233
+ type: 'data3',
234
+ link: 'https://sparc.science/',
235
+ },
236
+ ]
237
+ const imageIframeURL = {
238
+ 'UBERON:0000948': 'https://sparc.biolucida.net/image?c=MjIzNzItY29sLTI1NA%3D%3D',
239
+ 'UBERON:0016508': 'https://sparc.biolucida.net/image?c=MjIzNzQtY29sLTI1NA%3D%3D',
240
+ 'ILX:0793082': 'https://sparc.biolucida.net/image?c=MjIzNzUtY29sLTI1NA%3D%3D'
241
+ }
242
+
243
+ export default {
244
+ name: "ProvenancePopup",
245
+ components: {
246
+ Button,
247
+ Container,
248
+ Icon,
249
+ ElIconArrowUp,
250
+ ElIconArrowDown,
251
+ ElIconWarning,
252
+ Gallery,
253
+ },
254
+ props: {
255
+ tooltipEntry: {
256
+ type: Object,
257
+ default: () => ({
258
+ destinations: [],
259
+ origins: [],
260
+ components: [],
261
+ destinationsWithDatasets: [],
262
+ originsWithDatasets: [],
263
+ componentsWithDatasets: [],
264
+ resource: undefined,
265
+ }),
266
+ },
267
+ },
268
+ inject: ["getFeaturesAlert"],
269
+ data: function () {
270
+ return {
271
+ controller: undefined,
272
+ activeSpecies: undefined,
273
+ pubmedSearchUrl: "",
274
+ loading: false,
275
+ showToolip: false,
276
+ showDetails: false,
277
+ showImages: false,
278
+ galleryItems: galleryItems,
279
+ imageIframeURL: imageIframeURL,
280
+ originDescriptions: {
281
+ motor: "is the location of the initial cell body of the circuit",
282
+ sensory: "is the location of the initial cell body in the PNS circuit",
283
+ },
284
+ componentsWithDatasets: [],
285
+ uberons: [{ id: undefined, name: undefined }],
286
+ };
287
+ },
288
+ computed: {
289
+ featuresAlert() {
290
+ return this.getFeaturesAlert();
291
+ },
292
+ resources: function () {
293
+ let resources = [];
294
+ if (this.tooltipEntry && this.tooltipEntry.hyperlinks) {
295
+ resources = this.tooltipEntry.hyperlinks;
296
+ }
297
+ return resources;
298
+ },
299
+ originDescription: function () {
300
+ if (
301
+ this.tooltipEntry &&
302
+ this.tooltipEntry.title &&
303
+ this.tooltipEntry.title.toLowerCase().includes("motor")
304
+ ) {
305
+ return this.originDescriptions.motor;
306
+ } else {
307
+ return this.originDescriptions.sensory;
308
+ }
309
+ },
310
+ provSpeciesDescription: function () {
311
+ let text = "Studied in";
312
+ this.tooltipEntry.provenanceTaxonomyLabel.forEach((label) => {
313
+ text += ` ${label},`;
314
+ });
315
+ text = text.slice(0, -1); // remove last comma
316
+ text += " species";
317
+ return text;
318
+ },
319
+ },
320
+ methods: {
321
+ titleCase: function (title) {
322
+ return titleCase(title);
323
+ },
324
+ capitalise: function (text) {
325
+ return capitalise(text);
326
+ },
327
+ openUrl: function (url) {
328
+ window.open(url, "_blank");
329
+ },
330
+ openAll: function () {
331
+ EventBus.emit("onActionClick", {
332
+ type: "Facets",
333
+ labels: this.tooltipEntry.componentsWithDatasets.map((a) => a.name),
334
+ });
335
+ },
336
+ openAxons: function () {
337
+ EventBus.emit("onActionClick", {
338
+ type: "Facets",
339
+ labels: this.tooltipEntry.destinationsWithDatasets.map((a) => a.name),
340
+ });
341
+ },
342
+ openDendrites: function () {
343
+ EventBus.emit("onActionClick", {
344
+ type: "Facets",
345
+ labels: this.tooltipEntry.originsWithDatasets.map((a) => a.name),
346
+ });
347
+ },
348
+ pubmedSearchUrlUpdate: function (val) {
349
+ this.pubmedSearchUrl = val;
350
+ },
351
+ viewImage: function (url) {
352
+ this.$emit('view-image', url);
353
+ },
354
+ },
355
+ };
356
+ </script>
357
+
358
+ <style lang="scss" scoped>
359
+ .display {
360
+ width: 44px;
361
+ word-break: normal;
362
+ }
363
+
364
+ .title {
365
+ text-align: left;
366
+ // width: 16em;
367
+ line-height: 1.5em !important;
368
+ font-size: 18px;
369
+ font-family: Helvetica;
370
+ font-weight: bold;
371
+ padding-bottom: 8px;
372
+ color: $app-primary-color;
373
+ }
374
+
375
+ .block {
376
+ margin-bottom: 0.5em;
377
+
378
+ .main > &:first-of-type {
379
+ margin-right: 1em;
380
+ }
381
+ }
382
+
383
+ .pub {
384
+ width: 16rem;
385
+ }
386
+
387
+ .icon {
388
+ right: 0px;
389
+ position: absolute;
390
+ top: 10px;
391
+ }
392
+
393
+ .icon:hover {
394
+ cursor: pointer;
395
+ }
396
+
397
+ :deep(.popover-origin-help.el-popover) {
398
+ text-transform: none !important; // need to overide the tooltip text transform
399
+ border: 1px solid $app-primary-color;
400
+ .el-popper__arrow {
401
+ &:before {
402
+ border-color: $app-primary-color;
403
+ background-color: #ffffff;
404
+ }
405
+ }
406
+ }
407
+
408
+ .info {
409
+ transform: rotate(180deg);
410
+ color: #8300bf;
411
+ margin-left: 8px;
412
+ }
413
+
414
+ .separator {
415
+ width: 90%;
416
+ height: 1px;
417
+ background-color: #bfbec2;
418
+ }
419
+
420
+ .hide {
421
+ color: $app-primary-color;
422
+ cursor: pointer;
423
+ margin-right: 6px;
424
+ margin-top: 3px;
425
+ }
426
+
427
+ .slide-fade-enter-active {
428
+ transition: opacity 0.5s, transform 0.5s;
429
+ }
430
+ .slide-fade-leave-active {
431
+ transition: opacity 0.2s, transform 0.2s;
432
+ }
433
+ .slide-fade-enter, .slide-fade-leave-to /* .slide-fade-leave-active in <2.1.8 */ {
434
+ opacity: 0;
435
+ transform: translateY(-8px);
436
+ }
437
+
438
+ .main {
439
+ font-size: 14px;
440
+ text-align: left;
441
+ line-height: 1.5em;
442
+ font-family: Asap, sans-serif, Helvetica;
443
+ font-weight: 400;
444
+ /* outline: thin red solid; */
445
+ padding: 1em !important;
446
+ overflow: hidden;
447
+ min-width: 16rem;
448
+ }
449
+
450
+ .attribute-title-container {
451
+ margin-bottom: 0.5em;
452
+ }
453
+
454
+ .attribute-title {
455
+ font-size: 16px;
456
+ font-weight: 600;
457
+ /* font-weight: bold; */
458
+ text-transform: uppercase;
459
+ }
460
+
461
+ .attribute-content {
462
+ font-size: 14px;
463
+ font-weight: 500;
464
+
465
+ &:last-of-type {
466
+ margin-bottom: 0.5em;
467
+ }
468
+ }
469
+
470
+ .popover-container {
471
+ height: 100%;
472
+ width: 100%;
473
+ }
474
+
475
+ .main {
476
+ .el-button.is-round {
477
+ border-radius: 4px;
478
+ padding: 9px 20px 10px 20px;
479
+ display: flex;
480
+ height: 36px;
481
+ }
482
+ }
483
+
484
+ .button {
485
+ margin-left: 0px !important;
486
+ margin-top: 0px !important;
487
+ font-size: 14px !important;
488
+ background-color: $app-primary-color;
489
+ color: #fff;
490
+ & + .button {
491
+ margin-top: 10px !important;
492
+ }
493
+ &:hover {
494
+ color: #fff !important;
495
+ background: #ac76c5 !important;
496
+ border: 1px solid #ac76c5 !important;
497
+ }
498
+ }
499
+
500
+ .tooltip-container {
501
+ &::after,
502
+ &::before {
503
+ content: "";
504
+ display: block;
505
+ position: absolute;
506
+ width: 0;
507
+ height: 0;
508
+ border-style: solid;
509
+ flex-shrink: 0;
510
+ }
511
+ .tooltip {
512
+ &::after {
513
+ display: none;
514
+ }
515
+ &::before {
516
+ display: none;
517
+ }
518
+ }
519
+ }
520
+
521
+ .maplibregl-popup-anchor-bottom {
522
+ .tooltip-container {
523
+ &::after,
524
+ &::before {
525
+ top: 100%;
526
+ border-width: 12px;
527
+ }
528
+ &::after {
529
+ margin-top: -1px;
530
+ border-color: rgb(255, 255, 255) transparent transparent transparent;
531
+ }
532
+ &::before {
533
+ margin: 0 auto;
534
+ border-color: $app-primary-color transparent transparent transparent;
535
+ }
536
+ }
537
+ }
538
+
539
+ .maplibregl-popup-anchor-top {
540
+ .tooltip-container {
541
+ &::after,
542
+ &::before {
543
+ top: -24px;
544
+ border-width: 12px;
545
+ }
546
+ &::after {
547
+ margin-top: 1px;
548
+ border-color: transparent transparent rgb(255, 255, 255) transparent;
549
+ }
550
+ &::before {
551
+ margin: 0 auto;
552
+ border-color: transparent transparent $app-primary-color transparent;
553
+ }
554
+ }
555
+ }
556
+
557
+ .content-container {
558
+ overflow-y: scroll;
559
+ scrollbar-width: thin !important;
560
+ max-height: 240px;
561
+
562
+ .block {
563
+ padding-top: 0.5em;
564
+ }
565
+ }
566
+
567
+ .scrollbar::-webkit-scrollbar-track {
568
+ border-radius: 10px;
569
+ background-color: #f5f5f5;
570
+ }
571
+
572
+ .scrollbar::-webkit-scrollbar {
573
+ width: 12px;
574
+ right: -12px;
575
+ background-color: #f5f5f5;
576
+ }
577
+
578
+ .scrollbar::-webkit-scrollbar-thumb {
579
+ border-radius: 4px;
580
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.06);
581
+ background-color: #979797;
582
+ }
583
+
584
+ .image-gallery-container {
585
+ :deep(.gallery) {
586
+ .gallery-strip {
587
+ padding: 1rem 0;
588
+ }
589
+
590
+ > div {
591
+ min-height: max-content !important;
592
+ }
593
+ }
594
+ }
595
+
596
+ /* Fix for chrome bug where under triangle pops up above one on top of it */
597
+ .selector:not(*:root),
598
+ .tooltip-container::after {
599
+ top: 99.4%;
600
+ }
601
+ </style>