@abi-software/flatmapvuer 1.5.6 → 1.6.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 +22228 -21885
- package/dist/flatmapvuer.umd.cjs +132 -126
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/App.vue +19 -7
- package/src/components/FlatmapVuer.vue +208 -126
- package/src/components/MultiFlatmapVuer.vue +39 -5
- package/src/components/SelectionsGroup.vue +31 -8
- package/src/services/flatmapQueries.js +130 -47
|
@@ -257,7 +257,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
257
257
|
<div
|
|
258
258
|
class="pathway-location"
|
|
259
259
|
:class="{ open: drawerOpen, close: !drawerOpen }"
|
|
260
|
-
v-show="!
|
|
260
|
+
v-show="!disableUI"
|
|
261
261
|
>
|
|
262
262
|
<div
|
|
263
263
|
class="pathway-container"
|
|
@@ -388,17 +388,6 @@ Please use `const` to assign meaningful names to them...
|
|
|
388
388
|
ref="taxonSelection"
|
|
389
389
|
key="taxonSelection"
|
|
390
390
|
/>
|
|
391
|
-
<selections-group
|
|
392
|
-
v-if="!(isCentreLine || isFC) && centreLines && centreLines.length > 0"
|
|
393
|
-
title="Nerves"
|
|
394
|
-
labelKey="label"
|
|
395
|
-
identifierKey="key"
|
|
396
|
-
:selections="centreLines"
|
|
397
|
-
@changed="centreLinesSelected"
|
|
398
|
-
@selections-data-changed="onSelectionsDataChanged"
|
|
399
|
-
ref="centrelinesSelection"
|
|
400
|
-
key="centrelinesSelection"
|
|
401
|
-
/>
|
|
402
391
|
</div>
|
|
403
392
|
<div
|
|
404
393
|
@click="toggleDrawer"
|
|
@@ -519,8 +508,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
519
508
|
class="flatmap-radio"
|
|
520
509
|
@change="setFlightPath3D"
|
|
521
510
|
>
|
|
522
|
-
<el-radio :
|
|
523
|
-
<el-radio :
|
|
511
|
+
<el-radio :value="false">2D</el-radio>
|
|
512
|
+
<el-radio :value="true">3D</el-radio>
|
|
524
513
|
</el-radio-group>
|
|
525
514
|
</el-row>
|
|
526
515
|
<el-row class="backgroundSpacer"></el-row>
|
|
@@ -531,8 +520,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
531
520
|
class="flatmap-radio"
|
|
532
521
|
@change="setColour"
|
|
533
522
|
>
|
|
534
|
-
<el-radio :
|
|
535
|
-
<el-radio :
|
|
523
|
+
<el-radio :value="true">Colour</el-radio>
|
|
524
|
+
<el-radio :value="false">Greyscale</el-radio>
|
|
536
525
|
</el-radio-group>
|
|
537
526
|
</el-row>
|
|
538
527
|
<el-row class="backgroundSpacer"></el-row>
|
|
@@ -543,8 +532,8 @@ Please use `const` to assign meaningful names to them...
|
|
|
543
532
|
class="flatmap-radio"
|
|
544
533
|
@change="setOutlines"
|
|
545
534
|
>
|
|
546
|
-
<el-radio :
|
|
547
|
-
<el-radio :
|
|
535
|
+
<el-radio :value="true">Show</el-radio>
|
|
536
|
+
<el-radio :value="false">Hide</el-radio>
|
|
548
537
|
</el-radio-group>
|
|
549
538
|
</el-row>
|
|
550
539
|
<el-row class="backgroundSpacer"></el-row>
|
|
@@ -634,7 +623,7 @@ Please use `const` to assign meaningful names to them...
|
|
|
634
623
|
|
|
635
624
|
<script>
|
|
636
625
|
/* eslint-disable no-alert, no-console */
|
|
637
|
-
import { shallowRef, markRaw } from 'vue'
|
|
626
|
+
import { inject, provide, shallowRef, markRaw } from 'vue'
|
|
638
627
|
import {
|
|
639
628
|
WarningFilled as ElIconWarningFilled,
|
|
640
629
|
ArrowDown as ElIconArrowDown,
|
|
@@ -658,7 +647,7 @@ import {
|
|
|
658
647
|
import flatmapMarker from '../icons/flatmap-marker'
|
|
659
648
|
import {
|
|
660
649
|
FlatmapQueries,
|
|
661
|
-
|
|
650
|
+
findTaxonomyLabels,
|
|
662
651
|
} from '../services/flatmapQueries.js'
|
|
663
652
|
import yellowstar from '../icons/yellowstar'
|
|
664
653
|
import ResizeSensor from 'css-element-queries/src/ResizeSensor'
|
|
@@ -717,28 +706,6 @@ const processFTUs = (parent, key) => {
|
|
|
717
706
|
return ftus
|
|
718
707
|
}
|
|
719
708
|
|
|
720
|
-
const processSystems = (systems) => {
|
|
721
|
-
const allSystems = []
|
|
722
|
-
if (systems && systems.length > 0) {
|
|
723
|
-
const data = { label: 'All', key: 'All', children: [] }
|
|
724
|
-
systems.forEach((system) => {
|
|
725
|
-
const child = {
|
|
726
|
-
colour: system.colour,
|
|
727
|
-
enabled: system.enabled,
|
|
728
|
-
label: system.id,
|
|
729
|
-
key: system.id,
|
|
730
|
-
}
|
|
731
|
-
const children = processFTUs(system, child.key)
|
|
732
|
-
if (children.length > 0) child.children = children
|
|
733
|
-
data.children.push(child)
|
|
734
|
-
})
|
|
735
|
-
|
|
736
|
-
allSystems.push(data)
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
return allSystems
|
|
740
|
-
}
|
|
741
|
-
|
|
742
709
|
const createUnfilledTooltipData = function () {
|
|
743
710
|
return {
|
|
744
711
|
destinations: [],
|
|
@@ -784,7 +751,11 @@ export default {
|
|
|
784
751
|
this.setStateRequired = false
|
|
785
752
|
},
|
|
786
753
|
setup(props) {
|
|
787
|
-
|
|
754
|
+
let annotator = inject('$annotator')
|
|
755
|
+
if (!annotator) {
|
|
756
|
+
annotator = markRaw(new AnnotationService(`${props.flatmapAPI}annotator`));
|
|
757
|
+
provide('$annotator', annotator)
|
|
758
|
+
}
|
|
788
759
|
return { annotator }
|
|
789
760
|
},
|
|
790
761
|
methods: {
|
|
@@ -798,12 +769,13 @@ export default {
|
|
|
798
769
|
this.activeDrawMode = undefined
|
|
799
770
|
this.drawnCreatedEvent = {}
|
|
800
771
|
},
|
|
801
|
-
/**
|
|
772
|
+
/**
|
|
802
773
|
* @public
|
|
803
774
|
* Function to cancel a newly drawn feature.
|
|
804
775
|
*/
|
|
805
776
|
cancelDrawnFeature: function () {
|
|
806
777
|
if (this.isValidDrawnCreated) {
|
|
778
|
+
if (this.annotationSidebar) this.$emit("annotation-close")
|
|
807
779
|
this.closeTooltip()
|
|
808
780
|
this.annotationEntry = {
|
|
809
781
|
...this.drawnCreatedEvent.feature,
|
|
@@ -861,17 +833,23 @@ export default {
|
|
|
861
833
|
* @arg {String} `name`
|
|
862
834
|
*/
|
|
863
835
|
toolbarEvent: function (type, name) {
|
|
836
|
+
if (this.annotationSidebar) {
|
|
837
|
+
this.$emit("annotation-close")
|
|
838
|
+
if (!this.featureAnnotationSubmitted) {
|
|
839
|
+
this.rollbackAnnotationEvent()
|
|
840
|
+
}
|
|
841
|
+
}
|
|
864
842
|
this.closeTooltip()
|
|
843
|
+
// rollback feature if not submitted
|
|
844
|
+
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
845
|
+
this.rollbackAnnotationEvent()
|
|
846
|
+
}
|
|
865
847
|
this.doubleClickedFeature = false
|
|
866
848
|
this.connectionEntry = {}
|
|
867
849
|
if (type === 'mode') {
|
|
868
850
|
// Deselect any feature when draw mode is changed
|
|
869
851
|
this.changeAnnotationDrawMode({ mode: 'simple_select' })
|
|
870
852
|
this.activeDrawMode = name
|
|
871
|
-
// rollback modified feature when exit edit/delete mode
|
|
872
|
-
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
873
|
-
this.rollbackAnnotationEvent()
|
|
874
|
-
}
|
|
875
853
|
} else if (type === 'tool') {
|
|
876
854
|
if (name) {
|
|
877
855
|
const tool = name.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`)
|
|
@@ -990,6 +968,7 @@ export default {
|
|
|
990
968
|
this.featureAnnotationSubmitted = true
|
|
991
969
|
this.mapImp.commitAnnotationEvent(this.annotationEntry)
|
|
992
970
|
if (this.annotationEntry.type === 'deleted') {
|
|
971
|
+
if (this.annotationSidebar) this.$emit("annotation-close")
|
|
993
972
|
this.closeTooltip()
|
|
994
973
|
this.annotationEntry = {}
|
|
995
974
|
} else {
|
|
@@ -1166,7 +1145,6 @@ export default {
|
|
|
1166
1145
|
if (children.length > 0) child.children = children
|
|
1167
1146
|
data.children.push(child)
|
|
1168
1147
|
})
|
|
1169
|
-
|
|
1170
1148
|
this.systems.push(data)
|
|
1171
1149
|
}
|
|
1172
1150
|
},
|
|
@@ -1177,14 +1155,22 @@ export default {
|
|
|
1177
1155
|
* @arg {String} `flatmapAPI`,
|
|
1178
1156
|
* @arg {Array} `taxonIdentifiers`
|
|
1179
1157
|
*/
|
|
1180
|
-
processTaxon: function (
|
|
1158
|
+
processTaxon: function (taxonIdentifiers, state) {
|
|
1181
1159
|
this.taxonConnectivity.length = 0
|
|
1182
|
-
taxonIdentifiers.
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1160
|
+
findTaxonomyLabels(this.mapImp, taxonIdentifiers).then((entityLabels) => {
|
|
1161
|
+
if (entityLabels.length) {
|
|
1162
|
+
entityLabels.forEach((entityLabel) => {
|
|
1163
|
+
let enabled = true
|
|
1164
|
+
if (state) {
|
|
1165
|
+
enabled = state.checkAll ? true : state.checked.includes(entityLabel.taxon)
|
|
1166
|
+
}
|
|
1167
|
+
this.taxonConnectivity.push({...entityLabel, enabled});
|
|
1168
|
+
if (this.mapImp) {
|
|
1169
|
+
this.mapImp.enableConnectivityByTaxonIds(entityLabel.taxon, enabled)
|
|
1170
|
+
}
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1188
1174
|
},
|
|
1189
1175
|
/**
|
|
1190
1176
|
* @public
|
|
@@ -1202,7 +1188,7 @@ export default {
|
|
|
1202
1188
|
setColour: function (flag) {
|
|
1203
1189
|
this.colourRadio = flag
|
|
1204
1190
|
if (this.mapImp) {
|
|
1205
|
-
this.mapImp.
|
|
1191
|
+
this.mapImp.setPaint({ colour: flag, outline: this.outlinesRadio })
|
|
1206
1192
|
}
|
|
1207
1193
|
},
|
|
1208
1194
|
/**
|
|
@@ -1212,9 +1198,25 @@ export default {
|
|
|
1212
1198
|
* @arg {Boolean} `flag`
|
|
1213
1199
|
*/
|
|
1214
1200
|
setOutlines: function (flag) {
|
|
1215
|
-
this.
|
|
1201
|
+
this.outlinesRadio = flag
|
|
1202
|
+
if (this.mapImp) {
|
|
1203
|
+
this.mapImp.setPaint({ colour: this.colourRadio, outline: flag })
|
|
1204
|
+
}
|
|
1205
|
+
},
|
|
1206
|
+
setInitMapState: function () {
|
|
1216
1207
|
if (this.mapImp) {
|
|
1217
|
-
this.mapImp.
|
|
1208
|
+
const map = this.mapImp._map;
|
|
1209
|
+
const bounds = this.mapImp.options.bounds;
|
|
1210
|
+
const initBounds = [
|
|
1211
|
+
[bounds[0], bounds[1]],
|
|
1212
|
+
[bounds[2], bounds[3]]
|
|
1213
|
+
];
|
|
1214
|
+
|
|
1215
|
+
map.setMaxBounds(null); // override default
|
|
1216
|
+
|
|
1217
|
+
this.initMapState = markRaw({
|
|
1218
|
+
initBounds,
|
|
1219
|
+
});
|
|
1218
1220
|
}
|
|
1219
1221
|
},
|
|
1220
1222
|
/**
|
|
@@ -1224,9 +1226,18 @@ export default {
|
|
|
1224
1226
|
*/
|
|
1225
1227
|
resetView: function () {
|
|
1226
1228
|
if (this.mapImp) {
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1229
|
+
// fit to window
|
|
1230
|
+
const map = this.mapImp._map;
|
|
1231
|
+
const { initBounds } = this.initMapState;
|
|
1232
|
+
// reset rotation
|
|
1233
|
+
map.resetNorthPitch({
|
|
1234
|
+
animate: false,
|
|
1235
|
+
});
|
|
1236
|
+
if (initBounds) {
|
|
1237
|
+
// reset zoom and position
|
|
1238
|
+
map.fitBounds(initBounds, {
|
|
1239
|
+
animate: false
|
|
1240
|
+
});
|
|
1230
1241
|
}
|
|
1231
1242
|
if (this.$refs.skcanSelection) {
|
|
1232
1243
|
this.$refs.skcanSelection.reset()
|
|
@@ -1262,18 +1273,6 @@ export default {
|
|
|
1262
1273
|
this.mapImp.zoomOut()
|
|
1263
1274
|
}
|
|
1264
1275
|
},
|
|
1265
|
-
/**
|
|
1266
|
-
* @public
|
|
1267
|
-
* Function to show or hide centrelines and nodes.
|
|
1268
|
-
* The parameter ``payload`` is an object with a boolean property, ``value``,
|
|
1269
|
-
* ``payload.value = true/false``.
|
|
1270
|
-
* @arg {Object} `payload`
|
|
1271
|
-
*/
|
|
1272
|
-
centreLinesSelected: function (payload) {
|
|
1273
|
-
if (this.mapImp) {
|
|
1274
|
-
this.mapImp.enableCentrelines(payload.value)
|
|
1275
|
-
}
|
|
1276
|
-
},
|
|
1277
1276
|
onSelectionsDataChanged: function (data) {
|
|
1278
1277
|
this.$emit('pathway-selection-changed', data);
|
|
1279
1278
|
},
|
|
@@ -1314,7 +1313,7 @@ export default {
|
|
|
1314
1313
|
let pathFeatures = paths.map((p) => this.mapImp.featureProperties(p))
|
|
1315
1314
|
|
|
1316
1315
|
// Query the flatmap knowledge graph for connectivity, we use this to grab the origins
|
|
1317
|
-
let connectivity = await this.flatmapQueries.
|
|
1316
|
+
let connectivity = await this.flatmapQueries.queryForConnectivityNew(this.mapImp, payload)
|
|
1318
1317
|
|
|
1319
1318
|
// Check and flatten the origins node graph
|
|
1320
1319
|
let originsFlat = connectivity?.ids?.dendrites?.flat().flat()
|
|
@@ -1660,6 +1659,9 @@ export default {
|
|
|
1660
1659
|
}
|
|
1661
1660
|
if (eventType === 'click') {
|
|
1662
1661
|
this.featuresAlert = data.alert
|
|
1662
|
+
//The following will be used to track either a feature is selected
|
|
1663
|
+
this.statesTracking.activeClick = true
|
|
1664
|
+
this.statesTracking.activeTerm = data?.models
|
|
1663
1665
|
if (this.viewingMode === 'Neuron Connection') {
|
|
1664
1666
|
this.highlightConnectedPaths([data.models])
|
|
1665
1667
|
} else {
|
|
@@ -1717,7 +1719,12 @@ export default {
|
|
|
1717
1719
|
if (modeName) {
|
|
1718
1720
|
this.viewingMode = modeName
|
|
1719
1721
|
}
|
|
1722
|
+
if (this.annotationSidebar) this.$emit("annotation-close")
|
|
1720
1723
|
this.closeTooltip()
|
|
1724
|
+
// rollback feature if not submitted
|
|
1725
|
+
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
1726
|
+
this.rollbackAnnotationEvent()
|
|
1727
|
+
}
|
|
1721
1728
|
},
|
|
1722
1729
|
/**
|
|
1723
1730
|
* @public
|
|
@@ -1744,7 +1751,9 @@ export default {
|
|
|
1744
1751
|
) {
|
|
1745
1752
|
this.featureAnnotationSubmitted = false
|
|
1746
1753
|
this.annotationEntry.featureId = data.feature.feature.id
|
|
1747
|
-
if (this.activeDrawTool)
|
|
1754
|
+
if (this.activeDrawTool) {
|
|
1755
|
+
this.createConnectivityBody()
|
|
1756
|
+
}
|
|
1748
1757
|
this.displayTooltip(
|
|
1749
1758
|
data.feature.feature.id,
|
|
1750
1759
|
centroid(data.feature.feature.geometry)
|
|
@@ -1757,13 +1766,13 @@ export default {
|
|
|
1757
1766
|
this.annotation = {}
|
|
1758
1767
|
}
|
|
1759
1768
|
} else {
|
|
1769
|
+
//require data.resource && data.feature.source
|
|
1760
1770
|
let results =
|
|
1761
|
-
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(data)
|
|
1771
|
+
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, data)
|
|
1762
1772
|
// The line below only creates the tooltip if some data was found on the path
|
|
1763
|
-
//
|
|
1773
|
+
// the pubmed URLs are in knowledge response.references
|
|
1764
1774
|
if (
|
|
1765
|
-
results[0] ||
|
|
1766
|
-
results[1] ||
|
|
1775
|
+
(results && results[0]) ||
|
|
1767
1776
|
(data.feature.hyperlinks && data.feature.hyperlinks.length > 0)
|
|
1768
1777
|
) {
|
|
1769
1778
|
this.resourceForTooltip = data.resource[0]
|
|
@@ -1807,7 +1816,7 @@ export default {
|
|
|
1807
1816
|
* @arg {Object} `data`
|
|
1808
1817
|
*/
|
|
1809
1818
|
createTooltipFromNeuronCuration: async function (data) {
|
|
1810
|
-
this.tooltipEntry = await this.flatmapQueries.createTooltipData(data)
|
|
1819
|
+
this.tooltipEntry = await this.flatmapQueries.createTooltipData(this.mapImp, data)
|
|
1811
1820
|
this.displayTooltip(data.resource[0])
|
|
1812
1821
|
},
|
|
1813
1822
|
/**
|
|
@@ -2027,6 +2036,9 @@ export default {
|
|
|
2027
2036
|
}
|
|
2028
2037
|
this.$emit('connectivity-info-open', this.tooltipEntry);
|
|
2029
2038
|
}
|
|
2039
|
+
if (this.annotationSidebar && this.viewingMode === 'Annotation') {
|
|
2040
|
+
this.$emit('annotation-open', {annotationEntry: this.annotationEntry, commitCallback: this.commitAnnotationEvent});
|
|
2041
|
+
}
|
|
2030
2042
|
// If UI is not disabled,
|
|
2031
2043
|
// And connectivityInfoSidebar is not set (default) or set to `false`
|
|
2032
2044
|
// Provenance popup will be shown on map
|
|
@@ -2035,6 +2047,7 @@ export default {
|
|
|
2035
2047
|
!this.disableUI && (
|
|
2036
2048
|
(
|
|
2037
2049
|
this.viewingMode === 'Annotation' &&
|
|
2050
|
+
!this.annotationSidebar &&
|
|
2038
2051
|
this.userInformation
|
|
2039
2052
|
) ||
|
|
2040
2053
|
(
|
|
@@ -2146,6 +2159,48 @@ export default {
|
|
|
2146
2159
|
return Array.from(new Set(labels))
|
|
2147
2160
|
}
|
|
2148
2161
|
},
|
|
2162
|
+
/**
|
|
2163
|
+
* Function to get and store the state (object) of the map in
|
|
2164
|
+
* the provided argument
|
|
2165
|
+
*/
|
|
2166
|
+
getVisibilityState: function (state) {
|
|
2167
|
+
const refs = ['alertSelection', 'pathwaysSelection', 'taxonSelection']
|
|
2168
|
+
refs.forEach(ref => {
|
|
2169
|
+
let comp = this.$refs[ref]
|
|
2170
|
+
if (comp) {
|
|
2171
|
+
state[ref] = comp.getState()
|
|
2172
|
+
}
|
|
2173
|
+
})
|
|
2174
|
+
if (this.$refs.treeControls) {
|
|
2175
|
+
const checkedKeys = this.$refs.treeControls.$refs.regionTree.getCheckedKeys();
|
|
2176
|
+
//Only store first level systems (terms without .)
|
|
2177
|
+
state['systemsSelection'] = checkedKeys.filter(term => !term.includes('.'))
|
|
2178
|
+
}
|
|
2179
|
+
},
|
|
2180
|
+
/**
|
|
2181
|
+
* Function to set and restore the visibility state (object) of
|
|
2182
|
+
* the map with the provided argument
|
|
2183
|
+
*/
|
|
2184
|
+
setVisibilityState: function (state) {
|
|
2185
|
+
const refs = ['alertSelection', 'pathwaysSelection', 'taxonSelection']
|
|
2186
|
+
refs.forEach(ref => {
|
|
2187
|
+
const settings = state[ref]
|
|
2188
|
+
if (settings) {
|
|
2189
|
+
const comp = this.$refs[ref]
|
|
2190
|
+
if (comp) {
|
|
2191
|
+
comp.setState(settings)
|
|
2192
|
+
}
|
|
2193
|
+
}
|
|
2194
|
+
})
|
|
2195
|
+
if ('systemsSelection' in state) {
|
|
2196
|
+
if (this.$refs.treeControls) {
|
|
2197
|
+
this.$refs.treeControls.$refs.regionTree.setCheckedKeys(state['systemsSelection']);
|
|
2198
|
+
this.systems[0].children.forEach((item) => {
|
|
2199
|
+
this.mapImp.enableSystem(item.key, state['systemsSelection'].includes(item.key))
|
|
2200
|
+
})
|
|
2201
|
+
}
|
|
2202
|
+
}
|
|
2203
|
+
},
|
|
2149
2204
|
/**
|
|
2150
2205
|
* @public
|
|
2151
2206
|
* Function to get the state (object) of the map.
|
|
@@ -2161,6 +2216,13 @@ export default {
|
|
|
2161
2216
|
else if (identifier && identifier.biologicalSex)
|
|
2162
2217
|
state['biologicalSex'] = identifier.biologicalSex
|
|
2163
2218
|
if (identifier && identifier.uuid) state['uuid'] = identifier.uuid
|
|
2219
|
+
state['viewingMode'] = this.viewingMode
|
|
2220
|
+
state['searchTerm'] = this.statesTracking.activeTerm
|
|
2221
|
+
state['flightPath3D'] = this.flightPath3DRadio
|
|
2222
|
+
state['colour'] = this.colourRadio
|
|
2223
|
+
state['outlinesRadio'] = this.outlinesRadio
|
|
2224
|
+
state['background'] = this.currentBackground
|
|
2225
|
+
this.getVisibilityState(state)
|
|
2164
2226
|
return state
|
|
2165
2227
|
}
|
|
2166
2228
|
return undefined
|
|
@@ -2178,9 +2240,7 @@ export default {
|
|
|
2178
2240
|
this.entry == state.entry &&
|
|
2179
2241
|
(!state.biologicalSex || state.biologicalSex === this.biologicalSex)
|
|
2180
2242
|
) {
|
|
2181
|
-
|
|
2182
|
-
this.mapImp.setState(state.viewport)
|
|
2183
|
-
}
|
|
2243
|
+
this.restoreMapState(state)
|
|
2184
2244
|
} else {
|
|
2185
2245
|
this.createFlatmap(state)
|
|
2186
2246
|
}
|
|
@@ -2196,7 +2256,33 @@ export default {
|
|
|
2196
2256
|
restoreMapState: function (state) {
|
|
2197
2257
|
if (state) {
|
|
2198
2258
|
if (state.viewport) this.mapImp.setState(state.viewport)
|
|
2199
|
-
if (state.
|
|
2259
|
+
if (state.viewingMode) this.changeViewingMode(state.viewingMode)
|
|
2260
|
+
//The following three are boolean
|
|
2261
|
+
if ('flightPath3D' in state) this.setFlightPath3D(state.flightPath3D)
|
|
2262
|
+
if ('colour' in state) this.setColour(state.colour)
|
|
2263
|
+
if ('outlines' in state) this.setOutlines(state.outlines)
|
|
2264
|
+
if (state.background) this.backgroundChangeCallback(state.background)
|
|
2265
|
+
if (state.searchTerm) {
|
|
2266
|
+
const searchTerm = state.searchTerm
|
|
2267
|
+
this.searchAndShowResult(searchTerm, true)
|
|
2268
|
+
if (state.viewingMode === "Neuron Connection") {
|
|
2269
|
+
this.highlightConnectedPaths([searchTerm])
|
|
2270
|
+
} else {
|
|
2271
|
+
const geoID = this.mapImp.modelFeatureIds(searchTerm)
|
|
2272
|
+
if (geoID.length > 0) {
|
|
2273
|
+
const feature = this.mapImp.featureProperties(geoID[0])
|
|
2274
|
+
this.searchAndShowResult(searchTerm, true)
|
|
2275
|
+
const data = {
|
|
2276
|
+
resource: [feature.source],
|
|
2277
|
+
feature,
|
|
2278
|
+
label: feature.label,
|
|
2279
|
+
provenanceTaxonomy: feature.taxons
|
|
2280
|
+
}
|
|
2281
|
+
this.checkAndCreatePopups(data)
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
}
|
|
2285
|
+
this.setVisibilityState(state)
|
|
2200
2286
|
}
|
|
2201
2287
|
},
|
|
2202
2288
|
/**
|
|
@@ -2289,16 +2375,13 @@ export default {
|
|
|
2289
2375
|
this.serverURL = this.mapImp.makeServerUrl('').slice(0, -1)
|
|
2290
2376
|
let mapVersion = this.mapImp.details.version
|
|
2291
2377
|
this.setFlightPathInfo(mapVersion)
|
|
2292
|
-
this.
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
this.restoreMapState(state)
|
|
2296
|
-
}
|
|
2378
|
+
const stateToSet = this._stateToBeSet ? this._stateToBeSet : state
|
|
2379
|
+
this.onFlatmapReady(stateToSet)
|
|
2380
|
+
this.$nextTick(() => this.restoreMapState(stateToSet))
|
|
2297
2381
|
})
|
|
2298
2382
|
} else if (state) {
|
|
2299
2383
|
this._stateToBeSet = {
|
|
2300
|
-
|
|
2301
|
-
searchTerm: state.searchTerm,
|
|
2384
|
+
...state
|
|
2302
2385
|
}
|
|
2303
2386
|
if (this.mapImp && !this.loading)
|
|
2304
2387
|
this.restoreMapState(this._stateToBeSet)
|
|
@@ -2340,32 +2423,28 @@ export default {
|
|
|
2340
2423
|
* @public
|
|
2341
2424
|
* This function is used for functions that need to run immediately after the flatmap is loaded.
|
|
2342
2425
|
*/
|
|
2343
|
-
onFlatmapReady: function () {
|
|
2426
|
+
onFlatmapReady: function (state) {
|
|
2344
2427
|
// onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
|
|
2345
2428
|
this.sensor = markRaw(new ResizeSensor(this.$refs.display, this.mapResize))
|
|
2346
|
-
console.log(this.mapImp.options)
|
|
2347
2429
|
if (this.mapImp.options?.style === 'functional') {
|
|
2348
2430
|
this.isFC = true
|
|
2349
|
-
} else if (this.mapImp.options?.style === 'centreline') {
|
|
2350
|
-
this.isCentreLine = true
|
|
2351
2431
|
}
|
|
2352
2432
|
this.mapImp.setBackgroundOpacity(1)
|
|
2353
2433
|
this.backgroundChangeCallback(this.currentBackground)
|
|
2354
2434
|
this.pathways = this.mapImp.pathTypes()
|
|
2355
|
-
if (!this.isCentreLine) {
|
|
2356
|
-
this.mapImp.enableCentrelines(false)
|
|
2357
|
-
}
|
|
2358
2435
|
//Disable layers for now
|
|
2359
2436
|
//this.layers = this.mapImp.getLayers();
|
|
2360
2437
|
this.processSystems(this.mapImp.getSystems())
|
|
2361
|
-
|
|
2438
|
+
//Async, pass the state for checking
|
|
2439
|
+
this.processTaxon(this.mapImp.taxonIdentifiers, state ? state['taxonSelection'] : undefined)
|
|
2362
2440
|
this.containsAlert = "alert" in this.mapImp.featureFilterRanges()
|
|
2363
2441
|
this.addResizeButtonToMinimap()
|
|
2364
2442
|
this.loading = false
|
|
2365
2443
|
this.computePathControlsMaximumHeight()
|
|
2366
|
-
this.drawerOpen =
|
|
2444
|
+
this.drawerOpen = true;
|
|
2367
2445
|
this.mapResize()
|
|
2368
2446
|
this.handleMapClick();
|
|
2447
|
+
this.setInitMapState();
|
|
2369
2448
|
/**
|
|
2370
2449
|
* This is ``onFlatmapReady`` event.
|
|
2371
2450
|
* @arg ``this`` (Component Vue Instance)
|
|
@@ -2379,9 +2458,15 @@ export default {
|
|
|
2379
2458
|
*/
|
|
2380
2459
|
handleMapClick: function () {
|
|
2381
2460
|
const _map = this.mapImp._map;
|
|
2382
|
-
|
|
2383
2461
|
if (_map) {
|
|
2384
2462
|
_map.on('click', (e) => {
|
|
2463
|
+
//A little logic to make sure we are keeping track
|
|
2464
|
+
//of selected term
|
|
2465
|
+
if (this.statesTracking.activeClick) {
|
|
2466
|
+
this.statesTracking.activeClick = false
|
|
2467
|
+
} else {
|
|
2468
|
+
this.statesTracking.activeTerm = ""
|
|
2469
|
+
}
|
|
2385
2470
|
if (this.tooltipEntry.featureId) {
|
|
2386
2471
|
this.$emit('connectivity-info-close');
|
|
2387
2472
|
}
|
|
@@ -2417,6 +2502,7 @@ export default {
|
|
|
2417
2502
|
if (this.mapImp) {
|
|
2418
2503
|
if (term === undefined || term === '') {
|
|
2419
2504
|
this.mapImp.clearSearchResults()
|
|
2505
|
+
this.statesTracking.activeTerm = ""
|
|
2420
2506
|
return true
|
|
2421
2507
|
} else {
|
|
2422
2508
|
const searchResults = this.mapImp.search(term)
|
|
@@ -2425,6 +2511,7 @@ export default {
|
|
|
2425
2511
|
searchResults.results &&
|
|
2426
2512
|
searchResults.results.length > 0
|
|
2427
2513
|
) {
|
|
2514
|
+
this.statesTracking.activeTerm = term
|
|
2428
2515
|
this.mapImp.showSearchResults(searchResults)
|
|
2429
2516
|
if (
|
|
2430
2517
|
displayLabel &&
|
|
@@ -2488,7 +2575,7 @@ export default {
|
|
|
2488
2575
|
*/
|
|
2489
2576
|
minZoom: {
|
|
2490
2577
|
type: Number,
|
|
2491
|
-
default:
|
|
2578
|
+
default: 1,
|
|
2492
2579
|
},
|
|
2493
2580
|
/**
|
|
2494
2581
|
* The option to add another feature label _(`FeatureSmallSymbolLayer`)_
|
|
@@ -2645,12 +2732,18 @@ export default {
|
|
|
2645
2732
|
type: Boolean,
|
|
2646
2733
|
default: false,
|
|
2647
2734
|
},
|
|
2735
|
+
/**
|
|
2736
|
+
* The option to show annotation in sidebar
|
|
2737
|
+
*/
|
|
2738
|
+
annotationSidebar: {
|
|
2739
|
+
type: Boolean,
|
|
2740
|
+
default: false,
|
|
2741
|
+
},
|
|
2648
2742
|
},
|
|
2649
2743
|
provide() {
|
|
2650
2744
|
return {
|
|
2651
2745
|
flatmapAPI: this.flatmapAPI,
|
|
2652
2746
|
sparcAPI: this.sparcAPI,
|
|
2653
|
-
$annotator: this.annotator,
|
|
2654
2747
|
getFeaturesAlert: () => this.featuresAlert,
|
|
2655
2748
|
userApiKey: this.userToken,
|
|
2656
2749
|
}
|
|
@@ -2668,19 +2761,13 @@ export default {
|
|
|
2668
2761
|
serverURL: undefined,
|
|
2669
2762
|
layers: [],
|
|
2670
2763
|
pathways: [],
|
|
2764
|
+
initMapState: markRaw({}),
|
|
2671
2765
|
sckanDisplay: [
|
|
2672
2766
|
{
|
|
2673
2767
|
label: 'Display Path with SCKAN',
|
|
2674
2768
|
key: 'VALID',
|
|
2675
2769
|
},
|
|
2676
2770
|
],
|
|
2677
|
-
centreLines: [
|
|
2678
|
-
{
|
|
2679
|
-
label: 'Display Nerves',
|
|
2680
|
-
key: 'centrelines',
|
|
2681
|
-
enabled: false,
|
|
2682
|
-
},
|
|
2683
|
-
],
|
|
2684
2771
|
systems: [],
|
|
2685
2772
|
taxonConnectivity: [],
|
|
2686
2773
|
pathwaysMaxHeight: 1000,
|
|
@@ -2706,7 +2793,6 @@ export default {
|
|
|
2706
2793
|
helpModeActiveIndex: this.helpModeInitialIndex,
|
|
2707
2794
|
yellowstar: yellowstar,
|
|
2708
2795
|
isFC: false,
|
|
2709
|
-
isCentreLine: false,
|
|
2710
2796
|
inHelp: false,
|
|
2711
2797
|
currentBackground: 'white',
|
|
2712
2798
|
availableBackground: ['white', 'lightskyblue', 'black'],
|
|
@@ -2772,7 +2858,11 @@ export default {
|
|
|
2772
2858
|
with: true,
|
|
2773
2859
|
without: true,
|
|
2774
2860
|
}
|
|
2775
|
-
})
|
|
2861
|
+
}),
|
|
2862
|
+
statesTracking: markRaw({
|
|
2863
|
+
activeClick: false,
|
|
2864
|
+
activeTerm: "",
|
|
2865
|
+
}),
|
|
2776
2866
|
}
|
|
2777
2867
|
},
|
|
2778
2868
|
computed: {
|
|
@@ -2920,6 +3010,11 @@ export default {
|
|
|
2920
3010
|
left: 0px;
|
|
2921
3011
|
transform: translateX(0);
|
|
2922
3012
|
transition: all var(--el-transition-duration);
|
|
3013
|
+
z-index: 99;
|
|
3014
|
+
display: flex;
|
|
3015
|
+
flex-direction: row;
|
|
3016
|
+
align-items: center;
|
|
3017
|
+
|
|
2923
3018
|
&.open {
|
|
2924
3019
|
transform: translateX(0);
|
|
2925
3020
|
}
|
|
@@ -3465,7 +3560,6 @@ export default {
|
|
|
3465
3560
|
}
|
|
3466
3561
|
}
|
|
3467
3562
|
|
|
3468
|
-
.open-drawer,
|
|
3469
3563
|
.drawer-button {
|
|
3470
3564
|
z-index: 8;
|
|
3471
3565
|
width: 20px;
|
|
@@ -3475,18 +3569,6 @@ export default {
|
|
|
3475
3569
|
vertical-align: middle;
|
|
3476
3570
|
cursor: pointer;
|
|
3477
3571
|
pointer-events: auto;
|
|
3478
|
-
}
|
|
3479
|
-
|
|
3480
|
-
.open-drawer {
|
|
3481
|
-
position: absolute;
|
|
3482
|
-
left: 0px;
|
|
3483
|
-
background-color: #f7faff;
|
|
3484
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
|
3485
|
-
}
|
|
3486
|
-
|
|
3487
|
-
.drawer-button {
|
|
3488
|
-
float: left;
|
|
3489
|
-
margin-top: calc(50% - 36px);
|
|
3490
3572
|
background-color: #f9f2fc;
|
|
3491
3573
|
|
|
3492
3574
|
i {
|