@abi-software/flatmapvuer 0.6.1-annotator.0 → 0.6.1-annotator.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/README.md +17 -4
- package/cypress.config.js +24 -0
- package/dist/flatmapvuer.js +38633 -36969
- package/dist/flatmapvuer.umd.cjs +198 -177
- package/dist/style.css +1 -1
- package/package.json +25 -15
- package/reporter-config.json +10 -0
- package/src/App.vue +2 -10
- package/src/components/AnnotationTool.vue +21 -11
- package/src/components/ExternalResourceCard.vue +1 -0
- package/src/components/FlatmapVuer.vue +830 -349
- package/src/components/MultiFlatmapVuer.vue +163 -45
- package/src/components/ProvenancePopup.vue +13 -8
- package/src/components/RelevanceDialog.vue +127 -0
- package/src/components/Tooltip.vue +2 -2
- package/src/components.d.ts +1 -1
- package/src/icons/yellowstar.js +1 -1
- package/src/main.js +16 -1
- package/src/services/flatmapQueries.js +2 -0
- package/src/store/index.js +24 -0
- package/vite.config.js +35 -28
- package/vuese-generator.js +65 -0
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
:label="key"
|
|
28
28
|
:value="key"
|
|
29
29
|
>
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
<span class="select-box-icon">
|
|
31
|
+
<i :class="item.iconClass"></i>
|
|
32
|
+
</span>
|
|
33
|
+
{{ key }}
|
|
34
34
|
</el-option>
|
|
35
35
|
</el-select>
|
|
36
36
|
</template>
|
|
@@ -40,7 +40,6 @@
|
|
|
40
40
|
<FlatmapVuer
|
|
41
41
|
v-for="(item, key) in speciesList"
|
|
42
42
|
:key="key"
|
|
43
|
-
:showLayer="showLayer"
|
|
44
43
|
v-show="activeSpecies == key"
|
|
45
44
|
:entry="item.taxo"
|
|
46
45
|
:uuid="item.uuid"
|
|
@@ -53,15 +52,17 @@
|
|
|
53
52
|
:openMapOptions="openMapOptions"
|
|
54
53
|
:disableUI="disableUI"
|
|
55
54
|
@view-latest-map="viewLatestMap"
|
|
56
|
-
@resource-selected="
|
|
55
|
+
@resource-selected="resourceSelected"
|
|
57
56
|
@ready="FlatmapReady"
|
|
58
57
|
@pan-zoom-callback="panZoomCallback"
|
|
59
|
-
@open-map="
|
|
60
|
-
|
|
58
|
+
@open-map="
|
|
59
|
+
/**
|
|
60
|
+
* This event is emitted when the user chooses a different map option
|
|
61
|
+
* from ``openMapOptions`` props.
|
|
62
|
+
* @arg $event
|
|
63
|
+
*/
|
|
64
|
+
$emit('open-map', $event)"
|
|
61
65
|
:minZoom="minZoom"
|
|
62
|
-
:pathControls="pathControls"
|
|
63
|
-
:searchable="searchable"
|
|
64
|
-
:layerControl="layerControl"
|
|
65
66
|
:helpMode="helpMode"
|
|
66
67
|
:renderAtMounted="renderAtMounted"
|
|
67
68
|
:displayMinimap="displayMinimap"
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
import { reactive } from 'vue'
|
|
79
80
|
import EventBus from './EventBus'
|
|
80
81
|
import FlatmapVuer from './FlatmapVuer.vue'
|
|
81
|
-
import * as flatmap from '
|
|
82
|
+
import * as flatmap from '@abi-software/flatmap-viewer'
|
|
82
83
|
import {
|
|
83
84
|
ElCol as Col,
|
|
84
85
|
ElOption as Option,
|
|
@@ -95,6 +96,9 @@ const TAXON_UUID = {
|
|
|
95
96
|
'NCBITaxon:9685': '73060497-46a6-52bf-b975-cac511c127cb',
|
|
96
97
|
}
|
|
97
98
|
|
|
99
|
+
/**
|
|
100
|
+
* A vue component to show a flatmap from the list of multiple flatmap data.
|
|
101
|
+
*/
|
|
98
102
|
export default {
|
|
99
103
|
name: 'MultiFlatmapVuer',
|
|
100
104
|
components: {
|
|
@@ -114,10 +118,15 @@ export default {
|
|
|
114
118
|
mounted: function () {
|
|
115
119
|
this.initialise()
|
|
116
120
|
EventBus.on('onActionClick', (action) => {
|
|
117
|
-
this.
|
|
121
|
+
this.resourceSelected(action)
|
|
118
122
|
})
|
|
119
123
|
},
|
|
120
124
|
methods: {
|
|
125
|
+
/**
|
|
126
|
+
* @vuese
|
|
127
|
+
* Function to initialise the component when mounted.
|
|
128
|
+
* It returns a promise.
|
|
129
|
+
*/
|
|
121
130
|
initialise: function () {
|
|
122
131
|
return new Promise((resolve) => {
|
|
123
132
|
if (this.requireInitialisation) {
|
|
@@ -192,37 +201,89 @@ export default {
|
|
|
192
201
|
}
|
|
193
202
|
})
|
|
194
203
|
},
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
/**
|
|
205
|
+
* @vuese
|
|
206
|
+
* Function to emit ``resource-selected`` event with provided ``resource``.
|
|
207
|
+
* @arg action
|
|
208
|
+
*/
|
|
209
|
+
resourceSelected: function (action) {
|
|
210
|
+
/**
|
|
211
|
+
* This event is emitted by ``resourceSelected`` method.
|
|
212
|
+
*/
|
|
213
|
+
this.$emit('resource-selected', action)
|
|
197
214
|
},
|
|
215
|
+
/**
|
|
216
|
+
* @vuese
|
|
217
|
+
* Function to emit ``ready`` event after the flatmap is loaded.
|
|
218
|
+
* @arg component
|
|
219
|
+
*/
|
|
198
220
|
FlatmapReady: function (component) {
|
|
221
|
+
/**
|
|
222
|
+
* This event is emitted by ``FlatmapReady`` method after the flatmap is loaded.
|
|
223
|
+
* @arg component
|
|
224
|
+
*/
|
|
199
225
|
this.$emit('ready', component)
|
|
200
226
|
},
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
return undefined
|
|
207
|
-
},
|
|
227
|
+
/**
|
|
228
|
+
* @vuese
|
|
229
|
+
* Function to get the current active map.
|
|
230
|
+
*/
|
|
208
231
|
getCurrentFlatmap: function () {
|
|
209
232
|
return this.$refs[this.activeSpecies][0]
|
|
210
233
|
},
|
|
234
|
+
/**
|
|
235
|
+
* @vuese
|
|
236
|
+
* Function to emit ``pan-zoom-callback`` event
|
|
237
|
+
* from the event emitted in ``callback`` function from ``MapManager.loadMap()``.
|
|
238
|
+
* @arg payload
|
|
239
|
+
*/
|
|
211
240
|
panZoomCallback: function (payload) {
|
|
241
|
+
/**
|
|
242
|
+
* The event emitted by ``panZoomCallback`` method.
|
|
243
|
+
* @arg payload
|
|
244
|
+
*/
|
|
212
245
|
this.$emit('pan-zoom-callback', payload)
|
|
213
246
|
},
|
|
247
|
+
/**
|
|
248
|
+
* @vuese
|
|
249
|
+
* Function to show popup on map.
|
|
250
|
+
* @arg featureId,
|
|
251
|
+
* @arg node,
|
|
252
|
+
* @arg options
|
|
253
|
+
*/
|
|
214
254
|
showPopup: function (featureId, node, options) {
|
|
215
255
|
let map = this.getCurrentFlatmap()
|
|
216
256
|
map.showPopup(featureId, node, options)
|
|
217
257
|
},
|
|
258
|
+
/**
|
|
259
|
+
* @vuese
|
|
260
|
+
* Function to show marker popup.
|
|
261
|
+
* @arg featureId,
|
|
262
|
+
* @arg node,
|
|
263
|
+
* @arg options
|
|
264
|
+
*/
|
|
218
265
|
showMarkerPopup: function (featureId, node, options) {
|
|
219
266
|
let map = this.getCurrentFlatmap()
|
|
220
267
|
map.showMarkerPopup(featureId, node, options)
|
|
221
268
|
},
|
|
269
|
+
/**
|
|
270
|
+
* @vuese
|
|
271
|
+
* Function to set species.
|
|
272
|
+
* This function is called on the first load and
|
|
273
|
+
* when user changes the species.
|
|
274
|
+
* @arg species,
|
|
275
|
+
* @arg state,
|
|
276
|
+
* @arg numberOfRetry
|
|
277
|
+
*/
|
|
222
278
|
setSpecies: function (species, state, numberOfRetry) {
|
|
223
279
|
if (this.$refs && species in this.$refs) {
|
|
224
280
|
this.activeSpecies = species
|
|
225
281
|
this.$refs[this.activeSpecies][0].createFlatmap(state)
|
|
282
|
+
/**
|
|
283
|
+
* This event is emitted by ``setSpecies`` method.
|
|
284
|
+
* Emitted on first load and when user changes species.
|
|
285
|
+
* @arg activeSpecies
|
|
286
|
+
*/
|
|
226
287
|
this.$emit('flatmapChanged', this.activeSpecies)
|
|
227
288
|
} else if (numberOfRetry) {
|
|
228
289
|
const retry = numberOfRetry - 1
|
|
@@ -234,8 +295,10 @@ export default {
|
|
|
234
295
|
}
|
|
235
296
|
},
|
|
236
297
|
/**
|
|
298
|
+
* @vuese
|
|
237
299
|
* Function to switch to the latest existing map from
|
|
238
300
|
* a legacy map of the same species.
|
|
301
|
+
* @arg state
|
|
239
302
|
*
|
|
240
303
|
* @private
|
|
241
304
|
*/
|
|
@@ -254,7 +317,11 @@ export default {
|
|
|
254
317
|
}
|
|
255
318
|
},
|
|
256
319
|
/**
|
|
320
|
+
* @vuese
|
|
257
321
|
* Create a legacy entry with the provided information
|
|
322
|
+
* @arg state,
|
|
323
|
+
* @arg taxo,
|
|
324
|
+
* @arg uuid
|
|
258
325
|
*
|
|
259
326
|
* @private
|
|
260
327
|
*/
|
|
@@ -282,8 +349,10 @@ export default {
|
|
|
282
349
|
}
|
|
283
350
|
},
|
|
284
351
|
/**
|
|
352
|
+
* @vuese
|
|
285
353
|
* Function used to translate the legacy map state to one that can be used in current
|
|
286
354
|
* flatmap if required. If it is a legacy, an Select entry will be added
|
|
355
|
+
* @arg state
|
|
287
356
|
*
|
|
288
357
|
* @private
|
|
289
358
|
*/
|
|
@@ -339,6 +408,7 @@ export default {
|
|
|
339
408
|
})
|
|
340
409
|
},
|
|
341
410
|
/**
|
|
411
|
+
* @vuese
|
|
342
412
|
* Function used for getting the current states of the scene. This exported states
|
|
343
413
|
* can be imported using the importStates method.
|
|
344
414
|
*
|
|
@@ -354,8 +424,10 @@ export default {
|
|
|
354
424
|
return state
|
|
355
425
|
},
|
|
356
426
|
/**
|
|
427
|
+
* @vuese
|
|
357
428
|
* Function used for importing the states of the scene. This exported states
|
|
358
429
|
* can be imported using the read states method.
|
|
430
|
+
* @arg state
|
|
359
431
|
*
|
|
360
432
|
* @public
|
|
361
433
|
*/
|
|
@@ -377,31 +449,8 @@ export default {
|
|
|
377
449
|
})
|
|
378
450
|
}
|
|
379
451
|
},
|
|
380
|
-
resourceSelected: function (action) {
|
|
381
|
-
this.$emit('resource-selected', action)
|
|
382
|
-
},
|
|
383
452
|
},
|
|
384
453
|
props: {
|
|
385
|
-
showLayer: {
|
|
386
|
-
type: Boolean,
|
|
387
|
-
default: false,
|
|
388
|
-
},
|
|
389
|
-
featureInfo: {
|
|
390
|
-
type: Boolean,
|
|
391
|
-
default: false,
|
|
392
|
-
},
|
|
393
|
-
pathControls: {
|
|
394
|
-
type: Boolean,
|
|
395
|
-
default: true,
|
|
396
|
-
},
|
|
397
|
-
searchable: {
|
|
398
|
-
type: Boolean,
|
|
399
|
-
default: false,
|
|
400
|
-
},
|
|
401
|
-
layerControl: {
|
|
402
|
-
type: Boolean,
|
|
403
|
-
default: false,
|
|
404
|
-
},
|
|
405
454
|
/**
|
|
406
455
|
* Initial species for the flatmap.
|
|
407
456
|
* This value will be ignored if a valid state object is provided.
|
|
@@ -410,22 +459,37 @@ export default {
|
|
|
410
459
|
type: String,
|
|
411
460
|
default: '',
|
|
412
461
|
},
|
|
462
|
+
/**
|
|
463
|
+
* The minimum zoom level of the map.
|
|
464
|
+
*/
|
|
413
465
|
minZoom: {
|
|
414
466
|
type: Number,
|
|
415
467
|
default: 4,
|
|
416
468
|
},
|
|
469
|
+
/**
|
|
470
|
+
* The option to create map on component mounted.
|
|
471
|
+
*/
|
|
417
472
|
renderAtMounted: {
|
|
418
473
|
type: Boolean,
|
|
419
474
|
default: false,
|
|
420
475
|
},
|
|
476
|
+
/**
|
|
477
|
+
* The option to show tooltips for help mode.
|
|
478
|
+
*/
|
|
421
479
|
helpMode: {
|
|
422
480
|
type: Boolean,
|
|
423
481
|
default: false,
|
|
424
482
|
},
|
|
483
|
+
/**
|
|
484
|
+
* The option to display minimap at the top-right corner of the map.
|
|
485
|
+
*/
|
|
425
486
|
displayMinimap: {
|
|
426
487
|
type: Boolean,
|
|
427
488
|
default: false,
|
|
428
489
|
},
|
|
490
|
+
/**
|
|
491
|
+
* The option to show star in legend area.
|
|
492
|
+
*/
|
|
429
493
|
showStarInLegend: {
|
|
430
494
|
type: Boolean,
|
|
431
495
|
default: false,
|
|
@@ -438,11 +502,55 @@ export default {
|
|
|
438
502
|
type: Boolean,
|
|
439
503
|
default: false,
|
|
440
504
|
},
|
|
505
|
+
/**
|
|
506
|
+
* The data to show different map options.
|
|
507
|
+
* Available at the bottom-left corner ("Open new map" tooltip).
|
|
508
|
+
*/
|
|
441
509
|
openMapOptions: {
|
|
442
510
|
type: Array,
|
|
443
511
|
},
|
|
512
|
+
/**
|
|
513
|
+
* The available species data for different maps.
|
|
514
|
+
* This data is used for multi flatmaps.
|
|
515
|
+
*/
|
|
444
516
|
availableSpecies: {
|
|
445
517
|
type: Object,
|
|
518
|
+
/**
|
|
519
|
+
* ```{
|
|
520
|
+
'Human Female': {
|
|
521
|
+
taxo: 'NCBITaxon:9606',
|
|
522
|
+
biologicalSex: 'PATO:0000383',
|
|
523
|
+
iconClass: 'mapicon-icon_human',
|
|
524
|
+
displayWarning: true,
|
|
525
|
+
},
|
|
526
|
+
'Human Male': {
|
|
527
|
+
taxo: 'NCBITaxon:9606',
|
|
528
|
+
biologicalSex: 'PATO:0000384',
|
|
529
|
+
iconClass: 'mapicon-icon_human',
|
|
530
|
+
displayWarning: true,
|
|
531
|
+
},
|
|
532
|
+
Rat: {
|
|
533
|
+
taxo: 'NCBITaxon:10114',
|
|
534
|
+
iconClass: 'mapicon-icon_rat',
|
|
535
|
+
displayLatestChanges: true,
|
|
536
|
+
},
|
|
537
|
+
Mouse: {
|
|
538
|
+
taxo: 'NCBITaxon:10090',
|
|
539
|
+
iconClass: 'mapicon-icon_mouse',
|
|
540
|
+
displayWarning: true,
|
|
541
|
+
},
|
|
542
|
+
Pig: {
|
|
543
|
+
taxo: 'NCBITaxon:9823',
|
|
544
|
+
iconClass: 'mapicon-icon_pig',
|
|
545
|
+
displayWarning: true,
|
|
546
|
+
},
|
|
547
|
+
Cat: {
|
|
548
|
+
taxo: 'NCBITaxon:9685',
|
|
549
|
+
iconClass: 'mapicon-icon_cat',
|
|
550
|
+
displayWarning: true,
|
|
551
|
+
},
|
|
552
|
+
}```
|
|
553
|
+
*/
|
|
446
554
|
default: function () {
|
|
447
555
|
return {
|
|
448
556
|
'Human Female': {
|
|
@@ -494,6 +602,9 @@ export default {
|
|
|
494
602
|
type: String,
|
|
495
603
|
default: 'https://mapcore-demo.org/current/flatmap/v3/',
|
|
496
604
|
},
|
|
605
|
+
/**
|
|
606
|
+
* Specify the endpoint of the SPARC API.
|
|
607
|
+
*/
|
|
497
608
|
sparcAPI: {
|
|
498
609
|
type: String,
|
|
499
610
|
default: 'https://api.sparc.science/',
|
|
@@ -567,6 +678,13 @@ export default {
|
|
|
567
678
|
}
|
|
568
679
|
}
|
|
569
680
|
}
|
|
681
|
+
|
|
682
|
+
.select-box-icon {
|
|
683
|
+
display: inline-block;
|
|
684
|
+
width: 24px;
|
|
685
|
+
margin-right: 5px;
|
|
686
|
+
text-align: center;
|
|
687
|
+
}
|
|
570
688
|
}
|
|
571
689
|
|
|
572
690
|
.flatmap-dropdown {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
<div class="block" v-else>
|
|
16
16
|
<span class="title">{{ entry.featureId }}</span>
|
|
17
17
|
</div>
|
|
18
|
-
<div v-show="showDetails" class="hide" @click="showDetails = false">
|
|
18
|
+
<div v-show="showDetails" class="hide" id="hide-path-info" @click="showDetails = false">
|
|
19
19
|
Hide path information
|
|
20
20
|
<el-icon><el-icon-arrow-up /></el-icon>
|
|
21
21
|
</div>
|
|
22
|
-
<div v-show="!showDetails" class="hide" @click="showDetails = true">
|
|
22
|
+
<div v-show="!showDetails" class="hide" id="show-path-info" @click="showDetails = true">
|
|
23
23
|
Show path information
|
|
24
24
|
<el-icon><el-icon-arrow-down /></el-icon>
|
|
25
25
|
</div>
|
|
@@ -37,15 +37,17 @@
|
|
|
37
37
|
>
|
|
38
38
|
<template #reference>
|
|
39
39
|
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
40
|
-
<span style="word-break: keep-all">
|
|
41
|
-
<i>Origin</i> {{ originDescription }}
|
|
42
|
-
</span>
|
|
43
40
|
</template>
|
|
41
|
+
<span style="word-break: keep-all">
|
|
42
|
+
<i>Origin</i> {{ originDescription }}
|
|
43
|
+
</span>
|
|
44
|
+
|
|
44
45
|
</el-popover>
|
|
45
46
|
</div>
|
|
46
47
|
<div
|
|
47
48
|
v-for="(origin, i) in entry.origins"
|
|
48
49
|
class="attribute-content"
|
|
50
|
+
:origin-item-label="origin"
|
|
49
51
|
:key="origin"
|
|
50
52
|
>
|
|
51
53
|
{{ capitalise(origin) }}
|
|
@@ -56,6 +58,7 @@
|
|
|
56
58
|
entry.originsWithDatasets && entry.originsWithDatasets.length > 0
|
|
57
59
|
"
|
|
58
60
|
class="button"
|
|
61
|
+
id="open-dendrites-button"
|
|
59
62
|
@click="openDendrites"
|
|
60
63
|
>
|
|
61
64
|
Explore origin data
|
|
@@ -69,6 +72,7 @@
|
|
|
69
72
|
<div
|
|
70
73
|
v-for="(component, i) in entry.components"
|
|
71
74
|
class="attribute-content"
|
|
75
|
+
:component-item-label="component"
|
|
72
76
|
:key="component"
|
|
73
77
|
>
|
|
74
78
|
{{ capitalise(component) }}
|
|
@@ -92,15 +96,16 @@
|
|
|
92
96
|
>
|
|
93
97
|
<template #reference>
|
|
94
98
|
<el-icon class="info"><el-icon-warning /></el-icon>
|
|
95
|
-
<span style="word-break: keep-all">
|
|
96
|
-
<i>Destination</i> is where the axons terminate
|
|
97
|
-
</span>
|
|
98
99
|
</template>
|
|
100
|
+
<span style="word-break: keep-all">
|
|
101
|
+
<i>Destination</i> is where the axons terminate
|
|
102
|
+
</span>
|
|
99
103
|
</el-popover>
|
|
100
104
|
</div>
|
|
101
105
|
<div
|
|
102
106
|
v-for="(destination, i) in entry.destinations"
|
|
103
107
|
class="attribute-content"
|
|
108
|
+
:destination-item-label="destination"
|
|
104
109
|
:key="destination"
|
|
105
110
|
>
|
|
106
111
|
{{ capitalise(destination) }}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="dialog-container">
|
|
3
|
+
<el-row>
|
|
4
|
+
<span class="dialog-title" v-if="drawing">Finalise drawing</span>
|
|
5
|
+
<span class="dialog-title" v-else>Visualise relevance</span>
|
|
6
|
+
<el-row v-if="drawing">
|
|
7
|
+
<el-col :span="13">
|
|
8
|
+
<el-button type="primary" plain @click="$emit('confirm', true)">
|
|
9
|
+
Confirm
|
|
10
|
+
</el-button>
|
|
11
|
+
</el-col>
|
|
12
|
+
<el-col :span="11">
|
|
13
|
+
<el-button type="primary" plain @click="$emit('cancel', true)">
|
|
14
|
+
Cancel
|
|
15
|
+
</el-button>
|
|
16
|
+
</el-col>
|
|
17
|
+
</el-row>
|
|
18
|
+
<el-row v-else>
|
|
19
|
+
<el-button type="primary" plain @click="$emit('display', false)">
|
|
20
|
+
Close
|
|
21
|
+
</el-button>
|
|
22
|
+
</el-row>
|
|
23
|
+
</el-row>
|
|
24
|
+
<el-row v-if="relevance">
|
|
25
|
+
<el-col>
|
|
26
|
+
<b><span>Related Features</span></b>
|
|
27
|
+
<el-row v-for="(value, key) in entry" :key="key">
|
|
28
|
+
<el-col :span="20">
|
|
29
|
+
<el-card shadow="hover" @click="handleTooltipOpen(value)">
|
|
30
|
+
<span>{{ capitalise(key) }}</span>
|
|
31
|
+
</el-card>
|
|
32
|
+
</el-col>
|
|
33
|
+
<el-col :span="4" v-if="value === tooltipId">
|
|
34
|
+
<el-icon><el-icon-circle-close @click="handleTooltipClose" /></el-icon>
|
|
35
|
+
</el-col>
|
|
36
|
+
</el-row>
|
|
37
|
+
</el-col>
|
|
38
|
+
</el-row>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script>
|
|
43
|
+
/* eslint-disable no-alert, no-console */
|
|
44
|
+
import { CircleClose as ElIconCircleClose } from '@element-plus/icons-vue'
|
|
45
|
+
import {
|
|
46
|
+
ElRow as Row,
|
|
47
|
+
ElCol as Col,
|
|
48
|
+
ElCard as Card
|
|
49
|
+
} from 'element-plus'
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
name: 'RelevanceDialog',
|
|
53
|
+
components: {
|
|
54
|
+
Row,
|
|
55
|
+
Col,
|
|
56
|
+
Card
|
|
57
|
+
},
|
|
58
|
+
props: {
|
|
59
|
+
entry: {
|
|
60
|
+
type: Object,
|
|
61
|
+
},
|
|
62
|
+
drawing: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false,
|
|
65
|
+
},
|
|
66
|
+
relevance: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
data: function () {
|
|
72
|
+
return {
|
|
73
|
+
tooltipId: undefined
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
watch: {
|
|
77
|
+
relevance: function () {
|
|
78
|
+
this.tooltipId = undefined
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
methods: {
|
|
82
|
+
capitalise: function (label) {
|
|
83
|
+
return label[0].toUpperCase() + label.slice(1);
|
|
84
|
+
},
|
|
85
|
+
handleTooltipOpen: function (value) {
|
|
86
|
+
this.tooltipId = value
|
|
87
|
+
this.$emit('tooltip', value)
|
|
88
|
+
},
|
|
89
|
+
handleTooltipClose: function () {
|
|
90
|
+
this.tooltipId = undefined
|
|
91
|
+
this.$emit('popup', true)
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
</script>
|
|
96
|
+
|
|
97
|
+
<style lang="scss" scoped>
|
|
98
|
+
.dialog-container {
|
|
99
|
+
width: 200px;
|
|
100
|
+
height: fit-content;
|
|
101
|
+
text-align: justify;
|
|
102
|
+
border-radius: 4px;
|
|
103
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
|
|
104
|
+
pointer-events: auto;
|
|
105
|
+
background: #fff;
|
|
106
|
+
border: 1px solid $app-primary-color;
|
|
107
|
+
display: flex;
|
|
108
|
+
flex-direction: column;
|
|
109
|
+
padding: .8em;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.dialog-title {
|
|
113
|
+
font-size: 18px;
|
|
114
|
+
font-weight: bold;
|
|
115
|
+
color: rgb(131, 0, 191);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.el-icon {
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
:deep(.el-card) {
|
|
123
|
+
--el-card-padding: 8px;
|
|
124
|
+
border: 0;
|
|
125
|
+
cursor: pointer;
|
|
126
|
+
}
|
|
127
|
+
</style>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="tooltip-container">
|
|
2
|
+
<div class="tooltip-container" id="tooltip-container">
|
|
3
3
|
<template v-if="annotationDisplay">
|
|
4
4
|
<annotation-tool :annotationEntry="annotationEntry" @annotation="$emit('annotation', $event)" />
|
|
5
5
|
</template>
|
|
@@ -30,7 +30,7 @@ export default {
|
|
|
30
30
|
},
|
|
31
31
|
annotationEntry: {
|
|
32
32
|
type: Object,
|
|
33
|
-
}
|
|
33
|
+
}
|
|
34
34
|
},
|
|
35
35
|
}
|
|
36
36
|
</script>
|
package/src/components.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ declare module 'vue' {
|
|
|
14
14
|
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
15
15
|
ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
|
|
16
16
|
ElCol: typeof import('element-plus/es')['ElCol']
|
|
17
|
-
ElDialog: typeof import('element-plus/es')['ElDialog']
|
|
18
17
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
19
18
|
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
|
|
20
19
|
ElIconArrowLeft: typeof import('@element-plus/icons-vue')['ArrowLeft']
|
|
@@ -39,6 +38,7 @@ declare module 'vue' {
|
|
|
39
38
|
FlatmapVuer: typeof import('./components/FlatmapVuer.vue')['default']
|
|
40
39
|
MultiFlatmapVuer: typeof import('./components/MultiFlatmapVuer.vue')['default']
|
|
41
40
|
ProvenancePopup: typeof import('./components/ProvenancePopup.vue')['default']
|
|
41
|
+
RelevanceDialog: typeof import('./components/RelevanceDialog.vue')['default']
|
|
42
42
|
SelectionsGroup: typeof import('./components/SelectionsGroup.vue')['default']
|
|
43
43
|
SvgLegends: typeof import('./components/legends/SvgLegends.vue')['default']
|
|
44
44
|
Tooltip: typeof import('./components/Tooltip.vue')['default']
|
package/src/icons/yellowstar.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export default '<svg width="195px" height="24px" viewBox="0 0
|
|
1
|
+
export default '<svg width="195px" height="24px" viewBox="0 0 200 24" fill="yellow">' +
|
|
2
2
|
'<path d="M22.0748 3.25583C22.4141 2.42845 23.5859 2.42845 23.9252 3.25583L25.6493 7.45955C25.793 7.80979 26.1221 8.04889 26.4995 8.07727L31.0303 8.41798C31.922 8.48504 32.2841 9.59942 31.6021 10.1778L28.1369 13.1166C27.8482 13.3614 27.7225 13.7483 27.8122 14.1161L28.8882 18.5304C29.1 19.3992 28.152 20.0879 27.3912 19.618L23.5255 17.2305C23.2034 17.0316 22.7966 17.0316 22.4745 17.2305L18.60881 19.618C17.84796 20.0879 16.9 19.3992 17.1118 18.5304L18.18785 14.1161C18.2775 13.7483 18.1518 13.3614 17.86309 13.1166L14.3979 10.1778C13.71588 9.59942 14.07796 8.48504 14.96971 8.41798L19.50046 8.07727C19.87794 8.04889 20.20704 7.80979 20.35068 7.45955L22.0748 3.25583Z" stroke="#000000" stroke-width="2"/>' +
|
|
3
3
|
// Adjusting the x attribute and adding padding for the text element
|
|
4
4
|
'<text x="42" y="50%" dominant-baseline="middle" text-anchor="start" font-family="Asap, sans-serif" font-size="12" fill="#000000">Featured dataset marker</text>' +
|
package/src/main.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { createApp } from 'vue'
|
|
2
|
+
import { createPinia } from 'pinia'
|
|
2
3
|
import App from './App.vue'
|
|
4
|
+
import { useMainStore } from '@/store/index'
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
const pinia = createPinia()
|
|
7
|
+
const app = createApp(App)
|
|
8
|
+
|
|
9
|
+
app.use(pinia)
|
|
10
|
+
|
|
11
|
+
const mainStore = useMainStore()
|
|
12
|
+
const token = document.cookie
|
|
13
|
+
.split("; ")
|
|
14
|
+
.find((row) => row.startsWith("user-token"))
|
|
15
|
+
if (mainStore && token) {
|
|
16
|
+
mainStore.setUserToken(token.split("=")[1])
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
app.mount('#app')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable no-alert, no-console */
|
|
2
2
|
// remove duplicates by stringifying the objects
|
|
3
3
|
const removeDuplicates = function (arrayOfAnything) {
|
|
4
|
+
if (!arrayOfAnything) return []
|
|
4
5
|
return [...new Set(arrayOfAnything.map((e) => JSON.stringify(e)))].map((e) =>
|
|
5
6
|
JSON.parse(e)
|
|
6
7
|
)
|
|
@@ -35,6 +36,7 @@ const findTaxonomyLabel = async function (flatmapAPI, taxonomy) {
|
|
|
35
36
|
}
|
|
36
37
|
|
|
37
38
|
const inArray = function (ar1, ar2) {
|
|
39
|
+
if (!ar1 || !ar2) return false
|
|
38
40
|
let as1 = JSON.stringify(ar1)
|
|
39
41
|
let as2 = JSON.stringify(ar2)
|
|
40
42
|
return as1.indexOf(as2) !== -1
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { defineStore } from 'pinia'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Activate the store when run the application individually.
|
|
5
|
+
* If the store exist in parent application,
|
|
6
|
+
* instead of creating a new store it will access the parent main store.
|
|
7
|
+
*/
|
|
8
|
+
export const useMainStore = defineStore('main', {
|
|
9
|
+
state: () => ({
|
|
10
|
+
userProfile: {
|
|
11
|
+
token: ''
|
|
12
|
+
},
|
|
13
|
+
}),
|
|
14
|
+
getters: {
|
|
15
|
+
userToken(state) {
|
|
16
|
+
return state.userProfile.token
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
actions: {
|
|
20
|
+
setUserToken(value) {
|
|
21
|
+
this.userProfile.token = value
|
|
22
|
+
},
|
|
23
|
+
}
|
|
24
|
+
})
|