@abi-software/flatmapvuer 1.2.0 → 1.3.1-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/dist/flatmapvuer.js +25060 -28716
- package/dist/flatmapvuer.umd.cjs +164 -164
- package/dist/style.css +1 -1
- package/package.json +3 -2
- package/src/App.vue +5 -6
- package/src/components/FlatmapVuer.vue +233 -103
- package/src/components/MultiFlatmapVuer.vue +17 -1
- package/src/components/index.js +3 -5
- package/src/components.d.ts +0 -18
- package/src/services/flatmapQueries.js +6 -5
- package/vite.config.js +3 -2
- package/src/components/AnnotationTool.vue +0 -501
- package/src/components/ConnectionDialog.vue +0 -134
- package/src/components/DrawTool.vue +0 -502
- package/src/components/ExternalResourceCard.vue +0 -109
- package/src/components/HelpModeDialog.vue +0 -360
- package/src/components/ProvenancePopup.vue +0 -530
- package/src/components/Tooltip.vue +0 -50
- package/src/components/TreeControls.vue +0 -236
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
placement="right"
|
|
18
18
|
popper-class="warning-popper flatmap-popper"
|
|
19
19
|
:teleported="false"
|
|
20
|
-
:visible="hoverVisibilities[
|
|
20
|
+
:visible="hoverVisibilities[7].value"
|
|
21
21
|
ref="warningPopover"
|
|
22
22
|
>
|
|
23
23
|
<!--
|
|
@@ -27,15 +27,15 @@ Please use `const` to assign meaningful names to them...
|
|
|
27
27
|
-->
|
|
28
28
|
<p
|
|
29
29
|
v-if="isLegacy"
|
|
30
|
-
@mouseover="showTooltip(
|
|
31
|
-
@mouseout="hideTooltip(
|
|
30
|
+
@mouseover="showTooltip(7)"
|
|
31
|
+
@mouseout="hideTooltip(7)"
|
|
32
32
|
>
|
|
33
33
|
This is a legacy map, you may view the latest map instead.
|
|
34
34
|
</p>
|
|
35
35
|
<p
|
|
36
36
|
v-else-if="isFC"
|
|
37
|
-
@mouseover="showTooltip(
|
|
38
|
-
@mouseout="hideTooltip(
|
|
37
|
+
@mouseover="showTooltip(7)"
|
|
38
|
+
@mouseout="hideTooltip(7)"
|
|
39
39
|
>
|
|
40
40
|
This map displays the connectivity of individual neurons.
|
|
41
41
|
Specifically, those which align with (parts of) the neuron
|
|
@@ -99,15 +99,15 @@ Please use `const` to assign meaningful names to them...
|
|
|
99
99
|
:teleported="false"
|
|
100
100
|
trigger="manual"
|
|
101
101
|
popper-class="warning-popper flatmap-popper"
|
|
102
|
-
:visible="hoverVisibilities[
|
|
102
|
+
:visible="hoverVisibilities[8].value"
|
|
103
103
|
ref="whatsNewPopover"
|
|
104
104
|
>
|
|
105
105
|
<template #reference>
|
|
106
106
|
<div
|
|
107
107
|
class="latest-changesicon"
|
|
108
108
|
v-if="displayLatestChanges"
|
|
109
|
-
@mouseover="showTooltip(
|
|
110
|
-
@mouseout="hideTooltip(
|
|
109
|
+
@mouseover="showTooltip(8)"
|
|
110
|
+
@mouseout="hideTooltip(8)"
|
|
111
111
|
>
|
|
112
112
|
<el-icon><el-icon-warning-filled /></el-icon>
|
|
113
113
|
<span class="warning-text">What's new?</span>
|
|
@@ -142,23 +142,26 @@ Please use `const` to assign meaningful names to them...
|
|
|
142
142
|
<el-icon-arrow-down />
|
|
143
143
|
</el-icon>
|
|
144
144
|
|
|
145
|
-
<
|
|
145
|
+
<DrawToolbar
|
|
146
146
|
v-if="viewingMode === 'Annotation' && userInformation && !disableUI"
|
|
147
|
-
:
|
|
148
|
-
|
|
149
|
-
|
|
147
|
+
:mapCanvas="{
|
|
148
|
+
containerHTML: this.$el,
|
|
149
|
+
class: '.maplibregl-canvas',
|
|
150
|
+
}"
|
|
151
|
+
:toolbarOptions="toolbarOptions"
|
|
150
152
|
:drawnType="drawnType"
|
|
151
153
|
:activeDrawTool="activeDrawTool"
|
|
152
154
|
:activeDrawMode="activeDrawMode"
|
|
153
|
-
:
|
|
155
|
+
:newlyDrawnEntry="drawnCreatedEvent"
|
|
154
156
|
:connectionEntry="connectionEntry"
|
|
155
|
-
|
|
157
|
+
:hoverVisibilities="hoverVisibilities"
|
|
158
|
+
@clickToolbar="toolbarEvent"
|
|
159
|
+
@featureTooltip="connectedFeatureTooltip"
|
|
156
160
|
@confirmDrawn="confirmDrawnFeature"
|
|
157
161
|
@cancelDrawn="cancelDrawnFeature"
|
|
158
|
-
@featureTooltip="connectedFeatureTooltip"
|
|
159
162
|
@showTooltip="showTooltip"
|
|
160
163
|
@hideTooltip="hideTooltip"
|
|
161
|
-
ref="
|
|
164
|
+
ref="toolbarPopover"
|
|
162
165
|
/>
|
|
163
166
|
|
|
164
167
|
<div class="bottom-right-control" v-show="!disableUI">
|
|
@@ -169,7 +172,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
169
172
|
trigger="manual"
|
|
170
173
|
width="70"
|
|
171
174
|
popper-class="flatmap-popper"
|
|
172
|
-
:visible="hoverVisibilities[
|
|
175
|
+
:visible="hoverVisibilities[1].value"
|
|
173
176
|
ref="zoomInPopover"
|
|
174
177
|
>
|
|
175
178
|
<template #reference>
|
|
@@ -177,8 +180,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
177
180
|
icon="zoomIn"
|
|
178
181
|
class="icon-button zoomIn"
|
|
179
182
|
@click="zoomIn()"
|
|
180
|
-
@mouseover="showTooltip(
|
|
181
|
-
@mouseout="hideTooltip(
|
|
183
|
+
@mouseover="showTooltip(1)"
|
|
184
|
+
@mouseout="hideTooltip(1)"
|
|
182
185
|
/>
|
|
183
186
|
</template>
|
|
184
187
|
</el-popover>
|
|
@@ -189,7 +192,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
189
192
|
trigger="manual"
|
|
190
193
|
width="70"
|
|
191
194
|
popper-class="flatmap-popper"
|
|
192
|
-
:visible="hoverVisibilities[
|
|
195
|
+
:visible="hoverVisibilities[2].value"
|
|
193
196
|
ref="zoomOutPopover"
|
|
194
197
|
>
|
|
195
198
|
<template #reference>
|
|
@@ -197,8 +200,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
197
200
|
icon="zoomOut"
|
|
198
201
|
class="icon-button zoomOut"
|
|
199
202
|
@click="zoomOut()"
|
|
200
|
-
@mouseover="showTooltip(
|
|
201
|
-
@mouseout="hideTooltip(
|
|
203
|
+
@mouseover="showTooltip(2)"
|
|
204
|
+
@mouseout="hideTooltip(2)"
|
|
202
205
|
/>
|
|
203
206
|
</template>
|
|
204
207
|
</el-popover>
|
|
@@ -209,7 +212,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
209
212
|
trigger="manual"
|
|
210
213
|
width="70"
|
|
211
214
|
popper-class="flatmap-popper"
|
|
212
|
-
:visible="hoverVisibilities[
|
|
215
|
+
:visible="hoverVisibilities[3].value"
|
|
213
216
|
ref="zoomFitPopover"
|
|
214
217
|
>
|
|
215
218
|
<div>
|
|
@@ -222,8 +225,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
222
225
|
icon="fitWindow"
|
|
223
226
|
class="icon-button fitWindow"
|
|
224
227
|
@click="resetView()"
|
|
225
|
-
@mouseover="showTooltip(
|
|
226
|
-
@mouseout="hideTooltip(
|
|
228
|
+
@mouseover="showTooltip(3)"
|
|
229
|
+
@mouseout="hideTooltip(3)"
|
|
227
230
|
/>
|
|
228
231
|
</template>
|
|
229
232
|
</el-popover>
|
|
@@ -235,7 +238,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
235
238
|
trigger="manual"
|
|
236
239
|
:offset="-18"
|
|
237
240
|
popper-class="flatmap-popper"
|
|
238
|
-
:visible="hoverVisibilities[
|
|
241
|
+
:visible="hoverVisibilities[6].value"
|
|
239
242
|
ref="checkBoxPopover"
|
|
240
243
|
>
|
|
241
244
|
<template #reference>
|
|
@@ -287,7 +290,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
287
290
|
>
|
|
288
291
|
<template #reference>
|
|
289
292
|
<div
|
|
290
|
-
v-show="hoverVisibilities[
|
|
293
|
+
v-show="hoverVisibilities[0].value"
|
|
291
294
|
class="flatmap-marker-help"
|
|
292
295
|
v-html="flatmapMarker"
|
|
293
296
|
v-popover:markerPopover
|
|
@@ -296,13 +299,16 @@ Please use `const` to assign meaningful names to them...
|
|
|
296
299
|
</el-popover>
|
|
297
300
|
<tree-controls
|
|
298
301
|
v-if="isFC && systems && systems.length > 0"
|
|
302
|
+
class="treeControls"
|
|
303
|
+
mapType="flatmap"
|
|
304
|
+
title="Systems"
|
|
305
|
+
:treeData="systems"
|
|
299
306
|
:active="currentActive"
|
|
300
307
|
:hover="currentHover"
|
|
301
|
-
|
|
302
|
-
ref="treeControls"
|
|
303
|
-
@changed="systemSelected"
|
|
308
|
+
@checkChanged="systemSelected"
|
|
304
309
|
@checkAll="checkAllSystems"
|
|
305
|
-
@
|
|
310
|
+
@changeActive="ftuSelected"
|
|
311
|
+
ref="treeControls"
|
|
306
312
|
/>
|
|
307
313
|
<selections-group
|
|
308
314
|
v-if="containsAlert && alertOptions"
|
|
@@ -551,7 +557,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
551
557
|
>
|
|
552
558
|
<el-row>
|
|
553
559
|
<el-popover
|
|
554
|
-
:visible="hoverVisibilities[
|
|
560
|
+
:visible="hoverVisibilities[4].value"
|
|
555
561
|
content="Open new map"
|
|
556
562
|
placement="right"
|
|
557
563
|
:teleported="false"
|
|
@@ -564,8 +570,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
564
570
|
ref="openMapRef"
|
|
565
571
|
icon="openMap"
|
|
566
572
|
class="icon-button open-map-button"
|
|
567
|
-
@mouseover="showTooltip(
|
|
568
|
-
@mouseout="hideTooltip(
|
|
573
|
+
@mouseover="showTooltip(4)"
|
|
574
|
+
@mouseout="hideTooltip(4)"
|
|
569
575
|
/>
|
|
570
576
|
</template>
|
|
571
577
|
</el-popover>
|
|
@@ -574,7 +580,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
574
580
|
<el-popover
|
|
575
581
|
content="Change settings"
|
|
576
582
|
placement="right"
|
|
577
|
-
:visible="hoverVisibilities[
|
|
583
|
+
:visible="hoverVisibilities[5].value"
|
|
578
584
|
:teleported="false"
|
|
579
585
|
trigger="manual"
|
|
580
586
|
popper-class="flatmap-popper"
|
|
@@ -585,8 +591,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
585
591
|
ref="backgroundIconRef"
|
|
586
592
|
icon="changeBckgd"
|
|
587
593
|
class="icon-button"
|
|
588
|
-
@mouseover="showTooltip(
|
|
589
|
-
@mouseout="hideTooltip(
|
|
594
|
+
@mouseover="showTooltip(5)"
|
|
595
|
+
@mouseout="hideTooltip(5)"
|
|
590
596
|
/>
|
|
591
597
|
</template>
|
|
592
598
|
</el-popover>
|
|
@@ -597,7 +603,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
597
603
|
class="tooltip"
|
|
598
604
|
v-show="tooltipDisplay"
|
|
599
605
|
:annotationEntry="annotationEntry"
|
|
600
|
-
:
|
|
606
|
+
:tooltipEntry="tooltipEntry"
|
|
601
607
|
:annotationDisplay="viewingMode === 'Annotation'"
|
|
602
608
|
@annotation="commitAnnotationEvent"
|
|
603
609
|
/>
|
|
@@ -613,9 +619,7 @@ import {
|
|
|
613
619
|
ArrowDown as ElIconArrowDown,
|
|
614
620
|
ArrowLeft as ElIconArrowLeft,
|
|
615
621
|
} from '@element-plus/icons-vue'
|
|
616
|
-
import Tooltip from './Tooltip.vue'
|
|
617
622
|
import SelectionsGroup from './SelectionsGroup.vue'
|
|
618
|
-
import TreeControls from './TreeControls.vue'
|
|
619
623
|
import { MapSvgIcon, MapSvgSpriteColor } from '@abi-software/svg-sprite'
|
|
620
624
|
import '@abi-software/svg-sprite/dist/style.css'
|
|
621
625
|
import SvgLegends from './legends/SvgLegends.vue'
|
|
@@ -641,7 +645,8 @@ import * as flatmap from '@abi-software/flatmap-viewer'
|
|
|
641
645
|
import { AnnotationService } from '@abi-software/sparc-annotation'
|
|
642
646
|
import { mapState } from 'pinia'
|
|
643
647
|
import { useMainStore } from '@/store/index'
|
|
644
|
-
import
|
|
648
|
+
import { DrawToolbar, Tooltip, TreeControls } from '@abi-software/map-utilities'
|
|
649
|
+
import '@abi-software/map-utilities/dist/style.css'
|
|
645
650
|
|
|
646
651
|
const centroid = (geometry) => {
|
|
647
652
|
let featureGeometry = { lng: 0, lat: 0, }
|
|
@@ -749,7 +754,7 @@ export default {
|
|
|
749
754
|
ElIconWarningFilled,
|
|
750
755
|
ElIconArrowDown,
|
|
751
756
|
ElIconArrowLeft,
|
|
752
|
-
|
|
757
|
+
DrawToolbar
|
|
753
758
|
},
|
|
754
759
|
beforeCreate: function () {
|
|
755
760
|
this.mapManager = undefined
|
|
@@ -772,14 +777,14 @@ export default {
|
|
|
772
777
|
this.connectionEntry = {}
|
|
773
778
|
this.activeDrawTool = undefined
|
|
774
779
|
this.activeDrawMode = undefined
|
|
775
|
-
this.drawnCreatedEvent =
|
|
780
|
+
this.drawnCreatedEvent = {}
|
|
776
781
|
},
|
|
777
782
|
/**
|
|
778
783
|
* @vuese
|
|
779
784
|
* Function to cancel a newly drawn feature.
|
|
780
785
|
*/
|
|
781
786
|
cancelDrawnFeature: function () {
|
|
782
|
-
if (this.
|
|
787
|
+
if (this.isValidDrawnCreated) {
|
|
783
788
|
this.closeTooltip()
|
|
784
789
|
this.annotationEntry = {
|
|
785
790
|
...this.drawnCreatedEvent.feature,
|
|
@@ -819,7 +824,7 @@ export default {
|
|
|
819
824
|
* Function to confirm a newly drawn feature.
|
|
820
825
|
*/
|
|
821
826
|
confirmDrawnFeature: function () {
|
|
822
|
-
if (this.
|
|
827
|
+
if (this.isValidDrawnCreated) {
|
|
823
828
|
this.checkAndCreatePopups(this.drawnCreatedEvent)
|
|
824
829
|
// Add connection if exist to annotationEntry
|
|
825
830
|
// Connection will only be added in creating new drawn feature annotation
|
|
@@ -835,27 +840,37 @@ export default {
|
|
|
835
840
|
* Function to process the annotation toolbar click events.
|
|
836
841
|
* @arg type
|
|
837
842
|
*/
|
|
838
|
-
|
|
843
|
+
toolbarEvent: function (type, name) {
|
|
839
844
|
this.closeTooltip()
|
|
840
845
|
this.doubleClickedFeature = false
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
this.
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
846
|
+
this.connectionEntry = {}
|
|
847
|
+
if (type === 'mode') {
|
|
848
|
+
// Deselect any feature when draw mode is changed
|
|
849
|
+
this.changeAnnotationDrawMode({ mode: 'simple_select' })
|
|
850
|
+
this.activeDrawMode = name
|
|
851
|
+
// rollback modified feature when exit edit/delete mode
|
|
852
|
+
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
853
|
+
this.rollbackAnnotationEvent()
|
|
854
|
+
}
|
|
855
|
+
} else if (type === 'tool') {
|
|
856
|
+
if (name) {
|
|
857
|
+
const tool = name.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`)
|
|
858
|
+
this.changeAnnotationDrawMode({ mode: `draw${tool}` })
|
|
859
|
+
this.initialiseDrawing()
|
|
860
|
+
} else {
|
|
861
|
+
this.changeAnnotationDrawMode({ mode: 'simple_select' })
|
|
862
|
+
this.cancelDrawnFeature()
|
|
863
|
+
}
|
|
864
|
+
this.activeDrawTool = name
|
|
850
865
|
}
|
|
851
866
|
},
|
|
852
|
-
|
|
867
|
+
/**
|
|
853
868
|
* @vuese
|
|
854
869
|
* Function to fire annotation event based on the provided ``data``.
|
|
855
|
-
* Either edit or delete
|
|
870
|
+
* Either edit or delete action.
|
|
856
871
|
* @arg data
|
|
857
872
|
*/
|
|
858
|
-
|
|
873
|
+
annotationDrawModeEvent: function (data) {
|
|
859
874
|
if (this.activeDrawMode === 'Edit') {
|
|
860
875
|
if (this.doubleClickedFeature) {
|
|
861
876
|
if (data.feature.feature.geometry.type !== 'Point') {
|
|
@@ -954,8 +969,13 @@ export default {
|
|
|
954
969
|
) {
|
|
955
970
|
this.featureAnnotationSubmitted = true
|
|
956
971
|
this.mapImp.commitAnnotationEvent(this.annotationEntry)
|
|
957
|
-
if (this.annotationEntry.type === 'deleted')
|
|
958
|
-
|
|
972
|
+
if (this.annotationEntry.type === 'deleted') {
|
|
973
|
+
this.closeTooltip()
|
|
974
|
+
this.annotationEntry = {}
|
|
975
|
+
} else {
|
|
976
|
+
// Update 'existDrawnFeatures' when created or updated event
|
|
977
|
+
this.addAnnotationFeature()
|
|
978
|
+
}
|
|
959
979
|
}
|
|
960
980
|
},
|
|
961
981
|
/**
|
|
@@ -1284,8 +1304,8 @@ export default {
|
|
|
1284
1304
|
|
|
1285
1305
|
// Loop through the path features and check if we have origin nodes
|
|
1286
1306
|
pathFeatures.forEach((p) => {
|
|
1287
|
-
|
|
1288
|
-
// Get the nodes from each path feature
|
|
1307
|
+
|
|
1308
|
+
// Get the nodes from each path feature
|
|
1289
1309
|
this.mapImp.nodePathModels(p.featureId).forEach((f) => {
|
|
1290
1310
|
highlight = true
|
|
1291
1311
|
// s2 here is the second level paths
|
|
@@ -1297,7 +1317,7 @@ export default {
|
|
|
1297
1317
|
return
|
|
1298
1318
|
}
|
|
1299
1319
|
})
|
|
1300
|
-
|
|
1320
|
+
|
|
1301
1321
|
if (highlight) {
|
|
1302
1322
|
toHighlight.push(f)
|
|
1303
1323
|
}
|
|
@@ -1471,11 +1491,11 @@ export default {
|
|
|
1471
1491
|
taxonMouseEnterEmitted: function (payload) {
|
|
1472
1492
|
if (this.mapImp) {
|
|
1473
1493
|
if (payload.value) {
|
|
1474
|
-
let gid = this.mapImp.taxonFeatureIds(payload.key)
|
|
1494
|
+
let gid = this.mapImp.taxonFeatureIds(payload.key)
|
|
1475
1495
|
this.mapImp.enableConnectivityByTaxonIds(payload.key, payload.value) // make sure path is visible
|
|
1476
1496
|
this.mapImp.zoomToGeoJSONFeatures(gid, {noZoomIn: true})
|
|
1477
1497
|
} else {
|
|
1478
|
-
// reset visibility of paths
|
|
1498
|
+
// reset visibility of paths
|
|
1479
1499
|
this.mapImp.selectGeoJSONFeatures("-1")
|
|
1480
1500
|
payload.selections.forEach((item) => {
|
|
1481
1501
|
let show = payload.checked.includes(item.taxon)
|
|
@@ -1543,11 +1563,7 @@ export default {
|
|
|
1543
1563
|
if (!this.featureAnnotationSubmitted) this.rollbackAnnotationEvent()
|
|
1544
1564
|
else this.featureAnnotationSubmitted = false
|
|
1545
1565
|
} else if (data.type === 'modeChanged') {
|
|
1546
|
-
if (data.feature.mode === '
|
|
1547
|
-
if (!this.drawnCreatedEvent) this.initialiseDrawing() // Reset if invalid linestring or polygon
|
|
1548
|
-
} else if (data.feature.mode === 'direct_select') {
|
|
1549
|
-
this.doubleClickedFeature = true
|
|
1550
|
-
}
|
|
1566
|
+
if (data.feature.mode === 'direct_select') this.doubleClickedFeature = true
|
|
1551
1567
|
} else if (data.type === 'selectionChanged') {
|
|
1552
1568
|
this.selectedDrawnFeature = data.feature.features.length === 0 ?
|
|
1553
1569
|
undefined : data.feature.features[0]
|
|
@@ -1562,7 +1578,7 @@ export default {
|
|
|
1562
1578
|
if (drawnFeature && drawnFeature.connection) {
|
|
1563
1579
|
this.connectionEntry = drawnFeature.connection
|
|
1564
1580
|
}
|
|
1565
|
-
this.
|
|
1581
|
+
this.annotationDrawModeEvent(payload)
|
|
1566
1582
|
}
|
|
1567
1583
|
}
|
|
1568
1584
|
} else {
|
|
@@ -1629,7 +1645,7 @@ export default {
|
|
|
1629
1645
|
} else {
|
|
1630
1646
|
this.currentActive = data.models ? data.models : ''
|
|
1631
1647
|
// Drawing connectivity between features
|
|
1632
|
-
if (this.activeDrawTool && !this.
|
|
1648
|
+
if (this.activeDrawTool && !this.isValidDrawnCreated) {
|
|
1633
1649
|
// Check if flatmap features or existing drawn features
|
|
1634
1650
|
const validDrawnFeature = data.featureId || this.existDrawnFeatures.find(
|
|
1635
1651
|
(feature) => feature.id === data.id
|
|
@@ -1749,6 +1765,11 @@ export default {
|
|
|
1749
1765
|
popupCloseButton.style.display = 'block'
|
|
1750
1766
|
this.$refs.tooltip.$el.style.display = 'flex'
|
|
1751
1767
|
popupCloseButton.onclick = () => {
|
|
1768
|
+
/**
|
|
1769
|
+
* This event is emitted
|
|
1770
|
+
* when a connectivity info (provenance popup) is closed.
|
|
1771
|
+
*/
|
|
1772
|
+
this.$emit('connectivity-info-close');
|
|
1752
1773
|
if (ftooltip) ftooltip.style.display = 'block'
|
|
1753
1774
|
}
|
|
1754
1775
|
},
|
|
@@ -1962,7 +1983,6 @@ export default {
|
|
|
1962
1983
|
* @arg feature
|
|
1963
1984
|
*/
|
|
1964
1985
|
displayTooltip: function (feature, geometry = undefined) {
|
|
1965
|
-
this.tooltipDisplay = true
|
|
1966
1986
|
let featureId = undefined
|
|
1967
1987
|
let options = { className: 'flatmapvuer-popover' }
|
|
1968
1988
|
if (geometry) {
|
|
@@ -1974,11 +1994,84 @@ export default {
|
|
|
1974
1994
|
options.positionAtLastClick = true
|
|
1975
1995
|
}
|
|
1976
1996
|
}
|
|
1977
|
-
|
|
1997
|
+
// If connectivityInfoSidebar is set to `true`
|
|
1998
|
+
// Connectivity info will show in sidebar
|
|
1999
|
+
if ((this.connectivityInfoSidebar && this.isTooltipEntry()) && this.viewingMode !== 'Annotation') {
|
|
2000
|
+
// move the map center to highlighted area
|
|
2001
|
+
// this method is moved to sidebar connectivity info
|
|
2002
|
+
// const featureIds = [feature];
|
|
2003
|
+
// this.moveMap(featureIds);
|
|
2004
|
+
this.$emit('connectivity-info-open', this.tooltipEntry);
|
|
2005
|
+
}
|
|
2006
|
+
// If UI is not disabled,
|
|
2007
|
+
// And connectivityInfoSidebar is not set (default) or set to `false`
|
|
2008
|
+
// Provenance popup will be shown on map
|
|
2009
|
+
// Tooltip will be shown for Annotation view
|
|
2010
|
+
if (
|
|
2011
|
+
!this.disableUI && (
|
|
2012
|
+
this.viewingMode === 'Annotation' ||
|
|
2013
|
+
(
|
|
2014
|
+
this.viewingMode === 'Exploration' &&
|
|
2015
|
+
!this.connectivityInfoSidebar &&
|
|
2016
|
+
this.isTooltipEntry()
|
|
2017
|
+
)
|
|
2018
|
+
)
|
|
2019
|
+
) {
|
|
2020
|
+
this.tooltipDisplay = true;
|
|
1978
2021
|
this.$nextTick(() => {
|
|
1979
|
-
this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options)
|
|
1980
|
-
this.popUpCssHacks()
|
|
1981
|
-
})
|
|
2022
|
+
this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options);
|
|
2023
|
+
this.popUpCssHacks();
|
|
2024
|
+
});
|
|
2025
|
+
|
|
2026
|
+
}
|
|
2027
|
+
},
|
|
2028
|
+
isTooltipEntry: function () {
|
|
2029
|
+
const {
|
|
2030
|
+
components,
|
|
2031
|
+
destinations,
|
|
2032
|
+
origins,
|
|
2033
|
+
provenanceTaxonomy,
|
|
2034
|
+
provenanceTaxonomyLabel
|
|
2035
|
+
} = this.tooltipEntry;
|
|
2036
|
+
|
|
2037
|
+
return Boolean(
|
|
2038
|
+
components?.length &&
|
|
2039
|
+
destinations?.length &&
|
|
2040
|
+
origins?.length &&
|
|
2041
|
+
provenanceTaxonomy?.length &&
|
|
2042
|
+
provenanceTaxonomyLabel?.length
|
|
2043
|
+
);
|
|
2044
|
+
},
|
|
2045
|
+
/**
|
|
2046
|
+
* Move the map to the left side
|
|
2047
|
+
* to the visible area of the feature IDs
|
|
2048
|
+
* because the sidebar is opened
|
|
2049
|
+
* @arg featureIds
|
|
2050
|
+
*/
|
|
2051
|
+
moveMap: function (featureIds, options = {}) {
|
|
2052
|
+
if (this.mapImp) {
|
|
2053
|
+
const { offsetX = 0, offsetY = 0, zoom = 4 } = options;
|
|
2054
|
+
const Map = this.mapImp._map;
|
|
2055
|
+
const bbox = this.mapImp._bounds.toArray();
|
|
2056
|
+
|
|
2057
|
+
// Zoom the map to features first
|
|
2058
|
+
this.mapImp.zoomToFeatures(featureIds, { noZoomIn: true });
|
|
2059
|
+
|
|
2060
|
+
// Hide the left pathway drawer
|
|
2061
|
+
// to get more space for the map
|
|
2062
|
+
this.showPathwaysDrawer(false);
|
|
2063
|
+
|
|
2064
|
+
// Move the map to left side
|
|
2065
|
+
// since the sidebar is taking space on the right
|
|
2066
|
+
if (bbox?.length) {
|
|
2067
|
+
setTimeout(() => {
|
|
2068
|
+
Map.fitBounds(bbox, {
|
|
2069
|
+
offset: [offsetX, offsetY],
|
|
2070
|
+
zoom: zoom,
|
|
2071
|
+
animate: true
|
|
2072
|
+
});
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
1982
2075
|
}
|
|
1983
2076
|
},
|
|
1984
2077
|
/**
|
|
@@ -2161,6 +2254,7 @@ export default {
|
|
|
2161
2254
|
minZoom: this.minZoom,
|
|
2162
2255
|
tooltips: this.tooltips,
|
|
2163
2256
|
minimap: minimap,
|
|
2257
|
+
// tooltipDelay: 15, // new feature to delay tooltips showing
|
|
2164
2258
|
}
|
|
2165
2259
|
)
|
|
2166
2260
|
promise1.then((returnedObject) => {
|
|
@@ -2239,12 +2333,29 @@ export default {
|
|
|
2239
2333
|
this.computePathControlsMaximumHeight()
|
|
2240
2334
|
this.drawerOpen = true
|
|
2241
2335
|
this.mapResize()
|
|
2336
|
+
this.handleMapClick();
|
|
2242
2337
|
/**
|
|
2243
2338
|
* This is ``onFlatmapReady`` event.
|
|
2244
2339
|
* @arg ``this`` (Component Vue Instance)
|
|
2245
2340
|
*/
|
|
2246
2341
|
this.$emit('ready', this)
|
|
2247
2342
|
},
|
|
2343
|
+
/**
|
|
2344
|
+
* @vuese
|
|
2345
|
+
* Function to handle mouse click on map area
|
|
2346
|
+
* after the map is loaded.
|
|
2347
|
+
*/
|
|
2348
|
+
handleMapClick: function () {
|
|
2349
|
+
const _map = this.mapImp._map;
|
|
2350
|
+
|
|
2351
|
+
if (_map) {
|
|
2352
|
+
_map.on('click', (e) => {
|
|
2353
|
+
if (this.tooltipEntry.featureId) {
|
|
2354
|
+
this.$emit('connectivity-info-close');
|
|
2355
|
+
}
|
|
2356
|
+
});
|
|
2357
|
+
}
|
|
2358
|
+
},
|
|
2248
2359
|
/**
|
|
2249
2360
|
* @vuese
|
|
2250
2361
|
* Function to show or hide the minimap
|
|
@@ -2494,7 +2605,14 @@ export default {
|
|
|
2494
2605
|
disableUI: {
|
|
2495
2606
|
type: Boolean,
|
|
2496
2607
|
default: false,
|
|
2497
|
-
}
|
|
2608
|
+
},
|
|
2609
|
+
/**
|
|
2610
|
+
* The option to show connectivity information in sidebar
|
|
2611
|
+
*/
|
|
2612
|
+
connectivityInfoSidebar: {
|
|
2613
|
+
type: Boolean,
|
|
2614
|
+
default: false,
|
|
2615
|
+
},
|
|
2498
2616
|
},
|
|
2499
2617
|
provide() {
|
|
2500
2618
|
return {
|
|
@@ -2532,22 +2650,22 @@ export default {
|
|
|
2532
2650
|
taxonConnectivity: [],
|
|
2533
2651
|
pathwaysMaxHeight: 1000,
|
|
2534
2652
|
hoverVisibilities: [
|
|
2535
|
-
{ value: false, ref: '
|
|
2536
|
-
{ value: false, ref: '
|
|
2537
|
-
{ value: false, ref: '
|
|
2538
|
-
{ value: false, ref: '
|
|
2539
|
-
{ value: false, ref: '
|
|
2540
|
-
{ value: false, ref: '
|
|
2541
|
-
{ value: false, ref: '
|
|
2542
|
-
{ value: false, ref: '
|
|
2543
|
-
{ value: false, ref: '
|
|
2653
|
+
{ value: false, ref: 'markerPopover' }, // 0
|
|
2654
|
+
{ value: false, ref: 'zoomInPopover' }, // 1
|
|
2655
|
+
{ value: false, ref: 'zoomOutPopover' }, // 2
|
|
2656
|
+
{ value: false, ref: 'zoomFitPopover' }, // 3
|
|
2657
|
+
{ value: false, ref: 'openMapPopover' }, // 4
|
|
2658
|
+
{ value: false, ref: 'settingsPopover' }, // 5
|
|
2659
|
+
{ value: false, ref: 'checkBoxPopover' }, // 6
|
|
2660
|
+
{ value: false, ref: 'warningPopover' }, // 7
|
|
2661
|
+
{ value: false, ref: 'whatsNewPopover' }, // 8
|
|
2544
2662
|
{ value: false, ref: 'featuredMarkerPopover' }, // 9
|
|
2545
|
-
{ value: false, refs:
|
|
2546
|
-
{ value: false, refs:
|
|
2547
|
-
{ value: false, refs:
|
|
2548
|
-
{ value: false, refs:
|
|
2549
|
-
{ value: false, refs:
|
|
2550
|
-
{ value: false, refs:
|
|
2663
|
+
{ value: false, refs: "toolbarPopover", ref: "editPopover" }, // 10
|
|
2664
|
+
{ value: false, refs: "toolbarPopover", ref: "deletePopover" }, // 11
|
|
2665
|
+
{ value: false, refs: "toolbarPopover", ref: "pointPopover" }, // 12
|
|
2666
|
+
{ value: false, refs: "toolbarPopover", ref: "lineStringPopover" }, // 13
|
|
2667
|
+
{ value: false, refs: "toolbarPopover", ref: "polygonPopover" }, // 14
|
|
2668
|
+
{ value: false, refs: "toolbarPopover", ref: "connectionPopover" }, // 15
|
|
2551
2669
|
],
|
|
2552
2670
|
helpModeActiveIndex: this.helpModeInitialIndex,
|
|
2553
2671
|
yellowstar: yellowstar,
|
|
@@ -2573,7 +2691,7 @@ export default {
|
|
|
2573
2691
|
viewingModeIndex: 0,
|
|
2574
2692
|
viewingModes: {
|
|
2575
2693
|
0: {
|
|
2576
|
-
name: 'Exploration',
|
|
2694
|
+
name: 'Exploration',
|
|
2577
2695
|
description:'Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources'
|
|
2578
2696
|
},
|
|
2579
2697
|
1: {
|
|
@@ -2591,16 +2709,23 @@ export default {
|
|
|
2591
2709
|
annotatedTypes: ['Anyone', 'Me', 'Others'],
|
|
2592
2710
|
openMapRef: undefined,
|
|
2593
2711
|
backgroundIconRef: undefined,
|
|
2712
|
+
toolbarOptions: [
|
|
2713
|
+
"Edit",
|
|
2714
|
+
"Delete",
|
|
2715
|
+
"Point",
|
|
2716
|
+
"LineString",
|
|
2717
|
+
"Polygon",
|
|
2718
|
+
"Connection",
|
|
2719
|
+
],
|
|
2594
2720
|
annotator: undefined,
|
|
2595
2721
|
userInformation: undefined,
|
|
2722
|
+
activeDrawMode: undefined,
|
|
2596
2723
|
activeDrawTool: undefined,
|
|
2597
|
-
drawnCreatedEvent: undefined,
|
|
2598
2724
|
featureAnnotationSubmitted: false,
|
|
2725
|
+
drawnCreatedEvent: {},
|
|
2599
2726
|
connectionEntry: {},
|
|
2600
2727
|
existDrawnFeatures: [], // Store all exist drawn features
|
|
2601
2728
|
doubleClickedFeature: false,
|
|
2602
|
-
activeDrawMode: undefined,
|
|
2603
|
-
drawModes: ['Delete', 'Edit'],
|
|
2604
2729
|
containsAlert: false,
|
|
2605
2730
|
alertOptions: [
|
|
2606
2731
|
{
|
|
@@ -2624,9 +2749,12 @@ export default {
|
|
|
2624
2749
|
},
|
|
2625
2750
|
computed: {
|
|
2626
2751
|
...mapState(useMainStore, ['userToken']),
|
|
2752
|
+
isValidDrawnCreated: function () {
|
|
2753
|
+
return Object.keys(this.drawnCreatedEvent).length > 0
|
|
2754
|
+
},
|
|
2627
2755
|
viewingMode: function() {
|
|
2628
2756
|
return this.viewingModes[this.viewingModeIndex].name
|
|
2629
|
-
}
|
|
2757
|
+
},
|
|
2630
2758
|
},
|
|
2631
2759
|
watch: {
|
|
2632
2760
|
entry: function () {
|
|
@@ -2675,11 +2803,6 @@ export default {
|
|
|
2675
2803
|
})
|
|
2676
2804
|
} else this.showAnnotator(false)
|
|
2677
2805
|
},
|
|
2678
|
-
activeDrawMode: function () {
|
|
2679
|
-
// Deselect any feature when draw mode is changed
|
|
2680
|
-
this.changeAnnotationDrawMode({ mode: 'simple_select' })
|
|
2681
|
-
this.connectionEntry = {}
|
|
2682
|
-
},
|
|
2683
2806
|
disableUI: function (isUIDisabled) {
|
|
2684
2807
|
if (isUIDisabled) {
|
|
2685
2808
|
this.closeTooltip()
|
|
@@ -3481,6 +3604,13 @@ export default {
|
|
|
3481
3604
|
}
|
|
3482
3605
|
}
|
|
3483
3606
|
}
|
|
3607
|
+
.treeControls {
|
|
3608
|
+
text-align: left;
|
|
3609
|
+
overflow: none;
|
|
3610
|
+
padding-top: 7px;
|
|
3611
|
+
padding-bottom: 16px;
|
|
3612
|
+
background: #ffffff;
|
|
3613
|
+
}
|
|
3484
3614
|
</style>
|
|
3485
3615
|
|
|
3486
3616
|
<style lang="scss">
|