@abi-software/flatmapvuer 1.3.2 → 1.4.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/README.md +5 -4
- package/dist/flatmapvuer.js +64203 -56197
- package/dist/flatmapvuer.umd.cjs +815 -808
- package/dist/style.css +1 -1
- package/package.json +8 -5
- package/src/App.vue +19 -3
- package/src/components/FlatmapVuer.vue +198 -64
- package/src/components/MultiFlatmapVuer.vue +33 -17
- package/src/components.d.ts +0 -2
- package/src/icons/imageThumbnail1.js +1 -0
- package/src/icons/imageThumbnail2.js +1 -0
- package/src/icons/imageThumbnail3.js +1 -0
- package/src/main.js +1 -1
- package/src/mixins/imageMixin.js +91 -0
- package/src/services/scicrunchQueries.js +280 -0
- package/src/stores/settings.js +46 -0
- /package/src/{store → stores}/index.js +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/flatmapvuer",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1-beta.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"./src/*": "./src/*"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@abi-software/flatmap-viewer": "
|
|
47
|
-
"@abi-software/map-utilities": "1.0.
|
|
46
|
+
"@abi-software/flatmap-viewer": "3.1.4",
|
|
47
|
+
"@abi-software/map-utilities": "^1.1.0-beta.2",
|
|
48
48
|
"@abi-software/sparc-annotation": "0.3.1",
|
|
49
49
|
"@abi-software/svg-sprite": "1.0.0",
|
|
50
50
|
"@element-plus/icons-vue": "^2.3.1",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@cypress/webpack-dev-server": "^3.6.1",
|
|
60
60
|
"@vitejs/plugin-vue": "^4.6.2",
|
|
61
61
|
"@vuese/markdown-render": "^2.11.3",
|
|
62
|
-
"@vuese/parser": "^2.
|
|
62
|
+
"@vuese/parser": "^2.9.1",
|
|
63
63
|
"auto-changelog": "^2.4.0",
|
|
64
64
|
"babel-eslint": "^10.1.0",
|
|
65
65
|
"chokidar": "^3.6.0",
|
|
@@ -92,5 +92,8 @@
|
|
|
92
92
|
"browserslist": [
|
|
93
93
|
"> 1%",
|
|
94
94
|
"last 2 versions"
|
|
95
|
-
]
|
|
95
|
+
],
|
|
96
|
+
"optionalDependencies": {
|
|
97
|
+
"@rollup/rollup-linux-x64-gnu": "^4.21.1"
|
|
98
|
+
}
|
|
96
99
|
}
|
package/src/App.vue
CHANGED
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
:displayMinimap="true"
|
|
78
78
|
:enableOpenMapUI="true"
|
|
79
79
|
:flatmapAPI="flatmapAPI"
|
|
80
|
+
:sparcAPI="sparcAPI"
|
|
80
81
|
:disableUI="disableUI"
|
|
81
82
|
@open-pubmed-url="onOpenPubmedUrl"
|
|
82
83
|
@pathway-selection-changed="onPathwaySelectionChanged"
|
|
@@ -109,6 +110,9 @@ import './icons/mapicon-species-style.css'
|
|
|
109
110
|
import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue'
|
|
110
111
|
import { HelpModeDialog } from '@abi-software/map-utilities'
|
|
111
112
|
import '@abi-software/map-utilities/dist/style.css'
|
|
113
|
+
import { mapStores } from 'pinia';
|
|
114
|
+
import { useSettingsStore } from './stores/settings';
|
|
115
|
+
import { getOrganCuries } from './services/scicrunchQueries'
|
|
112
116
|
|
|
113
117
|
export default {
|
|
114
118
|
name: 'app',
|
|
@@ -145,11 +149,13 @@ export default {
|
|
|
145
149
|
if (this.consoleOn) console.log(component)
|
|
146
150
|
let taxon = component.mapImp.describes
|
|
147
151
|
let id = component.mapImp.addMarker('UBERON:0000948')
|
|
152
|
+
|
|
148
153
|
window.flatmapImp = component.mapImp
|
|
149
154
|
component.enablePanZoomEvents(true)
|
|
150
155
|
//component.showPathwaysDrawer(false);
|
|
151
156
|
if (this.consoleOn) console.log(taxon, id)
|
|
152
157
|
//component.searchAndShowResult("heart");
|
|
158
|
+
// component.changeViewingMode('Annotation')
|
|
153
159
|
},
|
|
154
160
|
panZoomcallback: function (payload) {
|
|
155
161
|
this.payload = payload
|
|
@@ -260,6 +266,10 @@ export default {
|
|
|
260
266
|
iconClass: 'mapicon-icon_cat',
|
|
261
267
|
displayWarning: true,
|
|
262
268
|
},
|
|
269
|
+
Vagus: {
|
|
270
|
+
taxo: 'UBERON:1759',
|
|
271
|
+
displayWarning: true,
|
|
272
|
+
},
|
|
263
273
|
Sample: { taxo: 'NCBITaxon:1', displayWarning: true },
|
|
264
274
|
'Functional Connectivity': {
|
|
265
275
|
taxo: 'FunctionalConnectivity',
|
|
@@ -280,18 +290,24 @@ export default {
|
|
|
280
290
|
useHelpModeDialog: true,
|
|
281
291
|
multiflatmapRef: null,
|
|
282
292
|
mapSettings: [],
|
|
293
|
+
sparcAPI: import.meta.env.VITE_SPARC_API,
|
|
283
294
|
//flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/"
|
|
284
295
|
//flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/"
|
|
285
|
-
|
|
286
|
-
flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
|
|
296
|
+
flatmapAPI: "https://mapcore-demo.org/current/flatmap/v3/",
|
|
297
|
+
//flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/',
|
|
298
|
+
//flatmapAPI: 'https://mapcore-demo.org/curation/flatmap/',
|
|
287
299
|
//flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/"
|
|
288
300
|
//flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/"
|
|
289
301
|
// flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/",
|
|
290
|
-
ElIconSetting: shallowRef(ElIconSetting)
|
|
302
|
+
ElIconSetting: shallowRef(ElIconSetting),
|
|
291
303
|
}
|
|
292
304
|
},
|
|
293
305
|
mounted: function () {
|
|
294
306
|
this.multiflatmapRef = this.$refs.multi;
|
|
307
|
+
getOrganCuries(this.sparcAPI).then((organCuries) => this.settingsStore.updateOrganCuries(organCuries))
|
|
308
|
+
},
|
|
309
|
+
computed: {
|
|
310
|
+
...mapStores(useSettingsStore),
|
|
295
311
|
},
|
|
296
312
|
watch: {
|
|
297
313
|
helpMode: function (newVal) {
|
|
@@ -54,7 +54,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
54
54
|
SCKAN </a
|
|
55
55
|
>.
|
|
56
56
|
</p>
|
|
57
|
-
<p v-else @mouseover="showTooltip(
|
|
57
|
+
<p v-else @mouseover="showTooltip(7)" @mouseout="hideTooltip(7)">
|
|
58
58
|
This map displays the connectivity of neuron populations.
|
|
59
59
|
Specifically, those from the primarily rat-based
|
|
60
60
|
<a
|
|
@@ -76,8 +76,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
76
76
|
<div
|
|
77
77
|
class="warning-icon"
|
|
78
78
|
v-if="displayWarning"
|
|
79
|
-
@mouseover="showTooltip(
|
|
80
|
-
@mouseout="hideTooltip(
|
|
79
|
+
@mouseover="showTooltip(7)"
|
|
80
|
+
@mouseout="hideTooltip(7)"
|
|
81
81
|
>
|
|
82
82
|
<el-icon><el-icon-warning-filled /></el-icon>
|
|
83
83
|
<template v-if="isLegacy">
|
|
@@ -245,7 +245,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
245
245
|
<div
|
|
246
246
|
class="pathway-location"
|
|
247
247
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
248
|
-
v-show="!disableUI"
|
|
248
|
+
v-show="!(disableUI || isCentreLine)"
|
|
249
249
|
>
|
|
250
250
|
<div
|
|
251
251
|
class="pathway-container"
|
|
@@ -363,7 +363,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
363
363
|
key="pathwaysSelection"
|
|
364
364
|
/>
|
|
365
365
|
<selections-group
|
|
366
|
-
v-if="
|
|
366
|
+
v-if="taxonConnectivity && taxonConnectivity.length > 0"
|
|
367
367
|
title="Studied in"
|
|
368
368
|
labelKey="label"
|
|
369
369
|
identifierKey="taxon"
|
|
@@ -377,7 +377,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
377
377
|
key="taxonSelection"
|
|
378
378
|
/>
|
|
379
379
|
<selections-group
|
|
380
|
-
v-if="!isFC
|
|
380
|
+
v-if="!(isCentreLine || isFC) && centreLines && centreLines.length > 0"
|
|
381
381
|
title="Nerves"
|
|
382
382
|
labelKey="label"
|
|
383
383
|
identifierKey="key"
|
|
@@ -426,7 +426,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
426
426
|
ref="backgroundPopover"
|
|
427
427
|
:virtual-ref="backgroundIconRef"
|
|
428
428
|
placement="top-start"
|
|
429
|
-
width="
|
|
429
|
+
width="330"
|
|
430
430
|
:teleported="false"
|
|
431
431
|
trigger="click"
|
|
432
432
|
popper-class="background-popper h-auto"
|
|
@@ -437,29 +437,30 @@ Please use `const` to assign meaningful names to them...
|
|
|
437
437
|
<el-row class="backgroundControl">
|
|
438
438
|
<div style="margin-bottom: 2px;">
|
|
439
439
|
<template
|
|
440
|
-
v-for="(
|
|
441
|
-
:key="
|
|
440
|
+
v-for="(value, key, index) in viewingModes"
|
|
441
|
+
:key="key"
|
|
442
442
|
>
|
|
443
|
-
<template v-if="
|
|
444
|
-
<span class="viewing-mode-title"><b >{{
|
|
443
|
+
<template v-if="key === viewingMode">
|
|
444
|
+
<span class="viewing-mode-title"><b >{{ key }}</b></span>
|
|
445
445
|
</template>
|
|
446
446
|
<template v-else>
|
|
447
|
-
<span class="viewing-mode-unselected" @click="changeViewingMode(
|
|
447
|
+
<span class="viewing-mode-unselected" @click="changeViewingMode(key)">{{ key }}</span>
|
|
448
448
|
</template>
|
|
449
449
|
</template>
|
|
450
450
|
</div>
|
|
451
451
|
<el-row class="viewing-mode-description">
|
|
452
|
-
{{ viewingModes[
|
|
452
|
+
{{ viewingModes[viewingMode] }}
|
|
453
453
|
</el-row>
|
|
454
454
|
</el-row>
|
|
455
455
|
<template v-if="viewingMode === 'Annotation' && userInformation">
|
|
456
|
+
<el-row class="backgroundSpacer"></el-row>
|
|
456
457
|
<el-row class="backgroundText">Drawn By*</el-row>
|
|
457
458
|
<el-row class="backgroundControl">
|
|
458
459
|
<el-select
|
|
459
460
|
:teleported="false"
|
|
460
461
|
v-model="drawnType"
|
|
461
462
|
placeholder="Select"
|
|
462
|
-
class="select-box"
|
|
463
|
+
class="select-box annotationSelector"
|
|
463
464
|
popper-class="flatmap_dropdown"
|
|
464
465
|
@change="setDrawnType"
|
|
465
466
|
>
|
|
@@ -475,13 +476,14 @@ Please use `const` to assign meaningful names to them...
|
|
|
475
476
|
</el-option>
|
|
476
477
|
</el-select>
|
|
477
478
|
</el-row>
|
|
479
|
+
<el-row class="backgroundSpacer"></el-row>
|
|
478
480
|
<el-row class="backgroundText">Annotated By*</el-row>
|
|
479
481
|
<el-row class="backgroundControl">
|
|
480
482
|
<el-select
|
|
481
483
|
:teleported="false"
|
|
482
484
|
v-model="annotatedType"
|
|
483
485
|
placeholder="Select"
|
|
484
|
-
class="select-box"
|
|
486
|
+
class="select-box annotationSelector"
|
|
485
487
|
popper-class="flatmap_dropdown"
|
|
486
488
|
@change="setAnnotatedType"
|
|
487
489
|
>
|
|
@@ -498,6 +500,41 @@ Please use `const` to assign meaningful names to them...
|
|
|
498
500
|
</el-select>
|
|
499
501
|
</el-row>
|
|
500
502
|
</template>
|
|
503
|
+
<el-row class="backgroundSpacer" v-if="viewingMode === 'Exploration' && !isFC"></el-row>
|
|
504
|
+
<el-row class="backgroundText" v-if="viewingMode === 'Exploration' && !isFC">Markers display</el-row>
|
|
505
|
+
<el-row class="backgroundControl" v-if="viewingMode === 'Exploration' && !isFC">
|
|
506
|
+
<el-col :span="14">
|
|
507
|
+
<el-radio-group
|
|
508
|
+
v-model="imageRadio"
|
|
509
|
+
class="flatmap-radio"
|
|
510
|
+
@change="setImage"
|
|
511
|
+
>
|
|
512
|
+
<el-radio :label="false">Standard</el-radio>
|
|
513
|
+
<el-radio :label="true">Image</el-radio>
|
|
514
|
+
</el-radio-group>
|
|
515
|
+
</el-col>
|
|
516
|
+
<el-col :span="10" v-if="imageRadio">
|
|
517
|
+
<el-select
|
|
518
|
+
:teleported="false"
|
|
519
|
+
v-model="imageType"
|
|
520
|
+
placeholder="Select"
|
|
521
|
+
class="select-box imageSelector"
|
|
522
|
+
popper-class="flatmap_dropdown"
|
|
523
|
+
@change="setImageType"
|
|
524
|
+
>
|
|
525
|
+
<el-option
|
|
526
|
+
v-for="item in imageTypes"
|
|
527
|
+
:key="item"
|
|
528
|
+
:label="item"
|
|
529
|
+
:value="item"
|
|
530
|
+
>
|
|
531
|
+
<el-row>
|
|
532
|
+
<el-col :span="12">{{ item }}</el-col>
|
|
533
|
+
</el-row>
|
|
534
|
+
</el-option>
|
|
535
|
+
</el-select>
|
|
536
|
+
</el-col>
|
|
537
|
+
</el-row>
|
|
501
538
|
<el-row class="backgroundSpacer" v-if="displayFlightPathOption"></el-row>
|
|
502
539
|
<el-row class="backgroundText" v-if="displayFlightPathOption">Flight path display</el-row>
|
|
503
540
|
<el-row class="backgroundControl" v-if="displayFlightPathOption">
|
|
@@ -602,9 +639,10 @@ Please use `const` to assign meaningful names to them...
|
|
|
602
639
|
ref="tooltip"
|
|
603
640
|
class="tooltip"
|
|
604
641
|
v-show="tooltipDisplay"
|
|
642
|
+
:tooltipType="tooltipType"
|
|
643
|
+
:provenanceEntry="provenanceEntry"
|
|
605
644
|
:annotationEntry="annotationEntry"
|
|
606
|
-
:
|
|
607
|
-
:annotationDisplay="viewingMode === 'Annotation'"
|
|
645
|
+
:imageEntry="imageEntry"
|
|
608
646
|
@annotation="commitAnnotationEvent"
|
|
609
647
|
/>
|
|
610
648
|
</div>
|
|
@@ -643,10 +681,18 @@ import yellowstar from '../icons/yellowstar'
|
|
|
643
681
|
import ResizeSensor from 'css-element-queries/src/ResizeSensor'
|
|
644
682
|
import * as flatmap from '@abi-software/flatmap-viewer'
|
|
645
683
|
import { AnnotationService } from '@abi-software/sparc-annotation'
|
|
646
|
-
import { mapState } from 'pinia'
|
|
647
|
-
import { useMainStore } from '@/
|
|
684
|
+
import { mapState, mapStores } from 'pinia'
|
|
685
|
+
import { useMainStore } from '@/stores/index'
|
|
686
|
+
import { useSettingsStore } from '@/stores/settings'
|
|
648
687
|
import { DrawToolbar, Tooltip, TreeControls } from '@abi-software/map-utilities'
|
|
649
688
|
import '@abi-software/map-utilities/dist/style.css'
|
|
689
|
+
import {
|
|
690
|
+
getBiolucidaThumbnails,
|
|
691
|
+
getSegmentationThumbnails,
|
|
692
|
+
getScaffoldThumbnails,
|
|
693
|
+
getPlotThumbnails
|
|
694
|
+
} from '../services/scicrunchQueries'
|
|
695
|
+
import imageMixin from '../mixins/imageMixin'
|
|
650
696
|
|
|
651
697
|
const centroid = (geometry) => {
|
|
652
698
|
let featureGeometry = { lng: 0, lat: 0, }
|
|
@@ -735,6 +781,7 @@ const createUnfilledTooltipData = function () {
|
|
|
735
781
|
*/
|
|
736
782
|
export default {
|
|
737
783
|
name: 'FlatmapVuer',
|
|
784
|
+
mixins:[imageMixin],
|
|
738
785
|
components: {
|
|
739
786
|
Button,
|
|
740
787
|
Col,
|
|
@@ -757,8 +804,6 @@ export default {
|
|
|
757
804
|
DrawToolbar
|
|
758
805
|
},
|
|
759
806
|
beforeCreate: function () {
|
|
760
|
-
this.mapManager = undefined
|
|
761
|
-
this.mapImp = undefined
|
|
762
807
|
//The state watcher may triggered before
|
|
763
808
|
//created causing issue, This flag will
|
|
764
809
|
//resolve this issue.
|
|
@@ -769,6 +814,68 @@ export default {
|
|
|
769
814
|
return { annotator }
|
|
770
815
|
},
|
|
771
816
|
methods: {
|
|
817
|
+
/**
|
|
818
|
+
* @vuese
|
|
819
|
+
* Function to add image thumbnails to the map.
|
|
820
|
+
*/
|
|
821
|
+
populateImageThumbnails: async function (type) {
|
|
822
|
+
if (this.mapImp) {
|
|
823
|
+
this.closeTooltip()
|
|
824
|
+
this.mapImp.clearMarkers();
|
|
825
|
+
const identifiers = this.mapImp.anatomicalIdentifiers
|
|
826
|
+
const imageThumbnails = this.settingsStore.getImageThumbnails(type, identifiers)
|
|
827
|
+
this.populateMapWithImages(this.mapImp, imageThumbnails, type)
|
|
828
|
+
}
|
|
829
|
+
},
|
|
830
|
+
/**
|
|
831
|
+
* @vuese
|
|
832
|
+
* Function to fetching image thumbnails.
|
|
833
|
+
*/
|
|
834
|
+
fetchImageThumbnails: async function (type) {
|
|
835
|
+
let thumbnails = {}
|
|
836
|
+
const organCuries = this.settingsStore.organCuries
|
|
837
|
+
if (type === 'Image') {
|
|
838
|
+
thumbnails = await getBiolucidaThumbnails(this.sparcAPI, organCuries, type)
|
|
839
|
+
} else if (type === 'Segmentation') {
|
|
840
|
+
thumbnails = await getSegmentationThumbnails(this.sparcAPI, organCuries, type)
|
|
841
|
+
} else if (type === 'Scaffold') {
|
|
842
|
+
thumbnails = await getScaffoldThumbnails(this.sparcAPI, organCuries, type)
|
|
843
|
+
} else if (type === 'Plot') {
|
|
844
|
+
thumbnails = await getPlotThumbnails(this.sparcAPI, organCuries, type)
|
|
845
|
+
}
|
|
846
|
+
this.settingsStore.updateImageThumbnails(type, thumbnails)
|
|
847
|
+
},
|
|
848
|
+
/**
|
|
849
|
+
* @vuese
|
|
850
|
+
* Function to switch the type of displayed image.
|
|
851
|
+
* @arg type
|
|
852
|
+
*/
|
|
853
|
+
setImageType: async function (type) {
|
|
854
|
+
this.imageType = type
|
|
855
|
+
if (this.mapImp) {
|
|
856
|
+
if (!this.settingsStore.imageTypeCached(type)) {
|
|
857
|
+
this.loading = true
|
|
858
|
+
await this.fetchImageThumbnails(type)
|
|
859
|
+
this.loading = false
|
|
860
|
+
}
|
|
861
|
+
this.populateImageThumbnails(type)
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
/**
|
|
865
|
+
* @vuese
|
|
866
|
+
* Function to switch show or hide images.
|
|
867
|
+
* @arg flag
|
|
868
|
+
*/
|
|
869
|
+
setImage: function (flag) {
|
|
870
|
+
this.imageRadio = flag
|
|
871
|
+
if (this.mapImp) {
|
|
872
|
+
if (flag) {
|
|
873
|
+
this.setImageType(this.imageType)
|
|
874
|
+
} else {
|
|
875
|
+
this.mapImp.clearMarkers();
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
},
|
|
772
879
|
/**
|
|
773
880
|
* @vuese
|
|
774
881
|
* Function to initialise drawing.
|
|
@@ -1671,7 +1778,6 @@ export default {
|
|
|
1671
1778
|
}
|
|
1672
1779
|
if (
|
|
1673
1780
|
data &&
|
|
1674
|
-
data.type !== 'marker' &&
|
|
1675
1781
|
eventType === 'click' &&
|
|
1676
1782
|
!(this.viewingMode === 'Neuron Connection') &&
|
|
1677
1783
|
// Disable popup when drawing
|
|
@@ -1691,13 +1797,10 @@ export default {
|
|
|
1691
1797
|
* Function triggered by viewing mode change.
|
|
1692
1798
|
* (e.g., from 'Exploration' to 'Annotation')
|
|
1693
1799
|
* All tooltips and popups currently showing on map will be closed
|
|
1694
|
-
* when this function is triggered. Optional index can be provided, this will
|
|
1695
|
-
* switch the provided view mode to the first index.
|
|
1696
1800
|
*/
|
|
1697
|
-
|
|
1698
|
-
if (
|
|
1699
|
-
|
|
1700
|
-
this.viewingModeIndex = newModeIndex
|
|
1801
|
+
changeViewingMode: function (modeName) {
|
|
1802
|
+
if (modeName) {
|
|
1803
|
+
this.viewingMode = modeName
|
|
1701
1804
|
}
|
|
1702
1805
|
this.closeTooltip()
|
|
1703
1806
|
},
|
|
@@ -1708,6 +1811,12 @@ export default {
|
|
|
1708
1811
|
* @arg data
|
|
1709
1812
|
*/
|
|
1710
1813
|
checkAndCreatePopups: async function (data) {
|
|
1814
|
+
if (data.feature.type === 'marker') {
|
|
1815
|
+
this.tooltipType = 'image'
|
|
1816
|
+
const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]])
|
|
1817
|
+
this.imageEntry = markRaw(imageThumbnails[data.resource[0]])
|
|
1818
|
+
this.displayTooltip(data.feature.models)
|
|
1819
|
+
} else {
|
|
1711
1820
|
// Call flatmap database to get the connection data
|
|
1712
1821
|
if (this.viewingMode === 'Annotation') {
|
|
1713
1822
|
if (data.feature) {
|
|
@@ -1715,6 +1824,7 @@ export default {
|
|
|
1715
1824
|
...data.feature,
|
|
1716
1825
|
resourceId: this.serverURL,
|
|
1717
1826
|
}
|
|
1827
|
+
this.tooltipType = 'annotation'
|
|
1718
1828
|
if (data.feature.featureId && data.feature.models) {
|
|
1719
1829
|
this.displayTooltip(data.feature.models)
|
|
1720
1830
|
} else if (data.feature.feature) {
|
|
@@ -1748,9 +1858,11 @@ export default {
|
|
|
1748
1858
|
results[1] ||
|
|
1749
1859
|
(data.feature.hyperlinks && data.feature.hyperlinks.length > 0)
|
|
1750
1860
|
) {
|
|
1861
|
+
this.tooltipType = 'provenance'
|
|
1751
1862
|
this.resourceForTooltip = data.resource[0]
|
|
1752
1863
|
data.resourceForTooltip = this.resourceForTooltip
|
|
1753
1864
|
this.createTooltipFromNeuronCuration(data)
|
|
1865
|
+
}
|
|
1754
1866
|
}
|
|
1755
1867
|
}
|
|
1756
1868
|
},
|
|
@@ -1789,7 +1901,7 @@ export default {
|
|
|
1789
1901
|
* @arg data
|
|
1790
1902
|
*/
|
|
1791
1903
|
createTooltipFromNeuronCuration: async function (data) {
|
|
1792
|
-
this.
|
|
1904
|
+
this.provenanceEntry = await this.flatmapQueries.createTooltipData(data)
|
|
1793
1905
|
this.displayTooltip(data.resource[0])
|
|
1794
1906
|
},
|
|
1795
1907
|
/**
|
|
@@ -2001,7 +2113,13 @@ export default {
|
|
|
2001
2113
|
// this method is moved to sidebar connectivity info
|
|
2002
2114
|
// const featureIds = [feature];
|
|
2003
2115
|
// this.moveMap(featureIds);
|
|
2004
|
-
|
|
2116
|
+
if (this.featuresAlert) {
|
|
2117
|
+
this.provenanceEntry['featuresAlert'] = this.featuresAlert;
|
|
2118
|
+
}
|
|
2119
|
+
this.$emit('connectivity-info-open', this.provenanceEntry);
|
|
2120
|
+
}
|
|
2121
|
+
if (this.imageThumbnailSidebar && this.imageEntry.length && this.viewingMode === 'Exploration') {
|
|
2122
|
+
this.$emit('image-thumbnail-open', this.imageEntry)
|
|
2005
2123
|
}
|
|
2006
2124
|
// If UI is not disabled,
|
|
2007
2125
|
// And connectivityInfoSidebar is not set (default) or set to `false`
|
|
@@ -2012,8 +2130,10 @@ export default {
|
|
|
2012
2130
|
this.viewingMode === 'Annotation' ||
|
|
2013
2131
|
(
|
|
2014
2132
|
this.viewingMode === 'Exploration' &&
|
|
2015
|
-
|
|
2016
|
-
|
|
2133
|
+
(
|
|
2134
|
+
(!this.connectivityInfoSidebar && this.hasTooltipEntry()) ||
|
|
2135
|
+
(!this.imageThumbnailSidebar && this.imageEntry.length)
|
|
2136
|
+
)
|
|
2017
2137
|
)
|
|
2018
2138
|
)
|
|
2019
2139
|
) {
|
|
@@ -2032,7 +2152,7 @@ export default {
|
|
|
2032
2152
|
origins,
|
|
2033
2153
|
provenanceTaxonomy,
|
|
2034
2154
|
provenanceTaxonomyLabel
|
|
2035
|
-
} = this.
|
|
2155
|
+
} = this.provenanceEntry;
|
|
2036
2156
|
|
|
2037
2157
|
return Boolean(
|
|
2038
2158
|
components?.length ||
|
|
@@ -2315,14 +2435,19 @@ export default {
|
|
|
2315
2435
|
*/
|
|
2316
2436
|
onFlatmapReady: function () {
|
|
2317
2437
|
// onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
|
|
2318
|
-
this.sensor = new ResizeSensor(this.$refs.display, this.mapResize)
|
|
2319
|
-
|
|
2438
|
+
this.sensor = markRaw(new ResizeSensor(this.$refs.display, this.mapResize))
|
|
2439
|
+
console.log(this.mapImp.options)
|
|
2440
|
+
if (this.mapImp.options?.style === 'functional') {
|
|
2320
2441
|
this.isFC = true
|
|
2442
|
+
} else if (this.mapImp.options?.style === 'centreline') {
|
|
2443
|
+
this.isCentreLine = true
|
|
2321
2444
|
}
|
|
2322
2445
|
this.mapImp.setBackgroundOpacity(1)
|
|
2323
2446
|
this.backgroundChangeCallback(this.currentBackground)
|
|
2324
2447
|
this.pathways = this.mapImp.pathTypes()
|
|
2325
|
-
this.
|
|
2448
|
+
if (!this.isCentreLine) {
|
|
2449
|
+
this.mapImp.enableCentrelines(false)
|
|
2450
|
+
}
|
|
2326
2451
|
//Disable layers for now
|
|
2327
2452
|
//this.layers = this.mapImp.getLayers();
|
|
2328
2453
|
this.processSystems(this.mapImp.getSystems())
|
|
@@ -2331,9 +2456,9 @@ export default {
|
|
|
2331
2456
|
this.addResizeButtonToMinimap()
|
|
2332
2457
|
this.loading = false
|
|
2333
2458
|
this.computePathControlsMaximumHeight()
|
|
2334
|
-
this.drawerOpen =
|
|
2459
|
+
this.drawerOpen = !this.isCentreLine
|
|
2335
2460
|
this.mapResize()
|
|
2336
|
-
this.handleMapClick()
|
|
2461
|
+
this.handleMapClick()
|
|
2337
2462
|
/**
|
|
2338
2463
|
* This is ``onFlatmapReady`` event.
|
|
2339
2464
|
* @arg ``this`` (Component Vue Instance)
|
|
@@ -2350,7 +2475,7 @@ export default {
|
|
|
2350
2475
|
|
|
2351
2476
|
if (_map) {
|
|
2352
2477
|
_map.on('click', (e) => {
|
|
2353
|
-
if (this.
|
|
2478
|
+
if (this.provenanceEntry.featureId) {
|
|
2354
2479
|
this.$emit('connectivity-info-close');
|
|
2355
2480
|
}
|
|
2356
2481
|
});
|
|
@@ -2597,12 +2722,12 @@ export default {
|
|
|
2597
2722
|
*/
|
|
2598
2723
|
sparcAPI: {
|
|
2599
2724
|
type: String,
|
|
2600
|
-
default: 'https://api.sparc.science
|
|
2725
|
+
default: 'https://api.sparc.science',
|
|
2601
2726
|
},
|
|
2602
2727
|
/**
|
|
2603
2728
|
* Flag to disable UIs on Map
|
|
2604
2729
|
*/
|
|
2605
|
-
|
|
2730
|
+
disableUI: {
|
|
2606
2731
|
type: Boolean,
|
|
2607
2732
|
default: false,
|
|
2608
2733
|
},
|
|
@@ -2613,11 +2738,17 @@ export default {
|
|
|
2613
2738
|
type: Boolean,
|
|
2614
2739
|
default: false,
|
|
2615
2740
|
},
|
|
2741
|
+
/**
|
|
2742
|
+
* The option to show image thumbnail in sidebar
|
|
2743
|
+
*/
|
|
2744
|
+
imageThumbnailSidebar: {
|
|
2745
|
+
type: Boolean,
|
|
2746
|
+
default: false,
|
|
2747
|
+
},
|
|
2616
2748
|
},
|
|
2617
2749
|
provide() {
|
|
2618
2750
|
return {
|
|
2619
2751
|
flatmapAPI: this.flatmapAPI,
|
|
2620
|
-
sparcAPI: this.sparcAPI,
|
|
2621
2752
|
$annotator: this.annotator,
|
|
2622
2753
|
getFeaturesAlert: () => this.featuresAlert,
|
|
2623
2754
|
userApiKey: this.userToken,
|
|
@@ -2625,6 +2756,9 @@ export default {
|
|
|
2625
2756
|
},
|
|
2626
2757
|
data: function () {
|
|
2627
2758
|
return {
|
|
2759
|
+
sensor: null,
|
|
2760
|
+
mapManager: undefined,
|
|
2761
|
+
flatmapQueries: undefined,
|
|
2628
2762
|
annotationEntry: {},
|
|
2629
2763
|
//tooltip display has to be set to false until it is rendered
|
|
2630
2764
|
//for the first time, otherwise it may display an arrow at a
|
|
@@ -2633,6 +2767,8 @@ export default {
|
|
|
2633
2767
|
serverURL: undefined,
|
|
2634
2768
|
layers: [],
|
|
2635
2769
|
pathways: [],
|
|
2770
|
+
imageEntry: markRaw([]),
|
|
2771
|
+
tooltipType: 'provenance',
|
|
2636
2772
|
sckanDisplay: [
|
|
2637
2773
|
{
|
|
2638
2774
|
label: 'Display Path with SCKAN',
|
|
@@ -2649,6 +2785,7 @@ export default {
|
|
|
2649
2785
|
systems: [],
|
|
2650
2786
|
taxonConnectivity: [],
|
|
2651
2787
|
pathwaysMaxHeight: 1000,
|
|
2788
|
+
tooltipWait: markRaw([]),
|
|
2652
2789
|
hoverVisibilities: [
|
|
2653
2790
|
{ value: false, ref: 'markerPopover' }, // 0
|
|
2654
2791
|
{ value: false, ref: 'zoomInPopover' }, // 1
|
|
@@ -2670,12 +2807,13 @@ export default {
|
|
|
2670
2807
|
helpModeActiveIndex: this.helpModeInitialIndex,
|
|
2671
2808
|
yellowstar: yellowstar,
|
|
2672
2809
|
isFC: false,
|
|
2810
|
+
isCentreLine: false,
|
|
2673
2811
|
inHelp: false,
|
|
2674
2812
|
currentBackground: 'white',
|
|
2675
2813
|
availableBackground: ['white', 'lightskyblue', 'black'],
|
|
2676
2814
|
loading: false,
|
|
2677
2815
|
flatmapMarker: flatmapMarker,
|
|
2678
|
-
|
|
2816
|
+
provenanceEntry: createUnfilledTooltipData(),
|
|
2679
2817
|
connectivityTooltipVisible: false,
|
|
2680
2818
|
drawerOpen: false,
|
|
2681
2819
|
featuresAlert: undefined,
|
|
@@ -2688,25 +2826,19 @@ export default {
|
|
|
2688
2826
|
currentActive: '',
|
|
2689
2827
|
selectedDrawnFeature: undefined, // Clicked drawn annotation
|
|
2690
2828
|
currentHover: '',
|
|
2691
|
-
|
|
2829
|
+
viewingMode: 'Exploration',
|
|
2692
2830
|
viewingModes: {
|
|
2693
|
-
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
},
|
|
2697
|
-
1: {
|
|
2698
|
-
name: 'Neuron Connection',
|
|
2699
|
-
description: 'Discover Neuron connections by selecting a neuron and viewing its associated network connections'
|
|
2700
|
-
},
|
|
2701
|
-
2: {
|
|
2702
|
-
name: 'Annotation',
|
|
2703
|
-
description: 'View internal identifiers of features'
|
|
2704
|
-
}
|
|
2831
|
+
'Exploration': 'Find relevant research and view detail of neural pathways by selecting a pathway to view its connections and data sources',
|
|
2832
|
+
'Neuron Connection': 'Discover Neuron connections by selecting a neuron and viewing its associated network connections',
|
|
2833
|
+
'Annotation': 'View internal identifiers of features'
|
|
2705
2834
|
},
|
|
2706
2835
|
drawnType: 'All tools',
|
|
2707
2836
|
drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'],
|
|
2708
2837
|
annotatedType: 'Anyone',
|
|
2709
2838
|
annotatedTypes: ['Anyone', 'Me', 'Others'],
|
|
2839
|
+
imageRadio: false,
|
|
2840
|
+
imageType: 'Image',
|
|
2841
|
+
imageTypes: ['Image', 'Segmentation', 'Scaffold', 'Plot'],
|
|
2710
2842
|
openMapRef: undefined,
|
|
2711
2843
|
backgroundIconRef: undefined,
|
|
2712
2844
|
toolbarOptions: [
|
|
@@ -2744,17 +2876,15 @@ export default {
|
|
|
2744
2876
|
with: true,
|
|
2745
2877
|
without: true,
|
|
2746
2878
|
}
|
|
2747
|
-
})
|
|
2879
|
+
}),
|
|
2748
2880
|
}
|
|
2749
2881
|
},
|
|
2750
2882
|
computed: {
|
|
2751
2883
|
...mapState(useMainStore, ['userToken']),
|
|
2884
|
+
...mapStores(useSettingsStore),
|
|
2752
2885
|
isValidDrawnCreated: function () {
|
|
2753
2886
|
return Object.keys(this.drawnCreatedEvent).length > 0
|
|
2754
2887
|
},
|
|
2755
|
-
viewingMode: function() {
|
|
2756
|
-
return this.viewingModes[this.viewingModeIndex].name
|
|
2757
|
-
},
|
|
2758
2888
|
},
|
|
2759
2889
|
watch: {
|
|
2760
2890
|
entry: function () {
|
|
@@ -2812,10 +2942,9 @@ export default {
|
|
|
2812
2942
|
mounted: function () {
|
|
2813
2943
|
this.openMapRef = shallowRef(this.$refs.openMapRef)
|
|
2814
2944
|
this.backgroundIconRef = shallowRef(this.$refs.backgroundIconRef)
|
|
2815
|
-
this.tooltipWait = []
|
|
2816
2945
|
this.tooltipWait.length = this.hoverVisibilities.length
|
|
2817
|
-
this.mapManager = new flatmap.MapManager(this.flatmapAPI)
|
|
2818
|
-
this.flatmapQueries = new FlatmapQueries()
|
|
2946
|
+
this.mapManager = markRaw(new flatmap.MapManager(this.flatmapAPI))
|
|
2947
|
+
this.flatmapQueries = markRaw(new FlatmapQueries())
|
|
2819
2948
|
this.flatmapQueries.initialise(this.flatmapAPI)
|
|
2820
2949
|
if (this.state) {
|
|
2821
2950
|
//State is set and require to set the state
|
|
@@ -3590,7 +3719,12 @@ export default {
|
|
|
3590
3719
|
background-color: var(--white);
|
|
3591
3720
|
font-weight: 500;
|
|
3592
3721
|
color: rgb(48, 49, 51);
|
|
3593
|
-
|
|
3722
|
+
&.annotationSelector {
|
|
3723
|
+
width: 150px!important;
|
|
3724
|
+
}
|
|
3725
|
+
&.imageSelector {
|
|
3726
|
+
width: 125px!important;
|
|
3727
|
+
}
|
|
3594
3728
|
}
|
|
3595
3729
|
|
|
3596
3730
|
:deep(.flatmap_dropdown) {
|