@abi-software/flatmapvuer 1.6.0-beta.0 → 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 +22137 -21818
- package/dist/flatmapvuer.umd.cjs +134 -128
- package/dist/style.css +1 -1
- package/package.json +3 -3
- package/src/App.vue +8 -3
- package/src/components/FlatmapVuer.vue +176 -113
- package/src/components/MultiFlatmapVuer.vue +23 -5
- package/src/components/SelectionsGroup.vue +30 -8
- package/src/services/flatmapQueries.js +130 -47
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abi-software/flatmapvuer",
|
|
3
|
-
"version": "1.6.0
|
|
3
|
+
"version": "1.6.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": "3.
|
|
47
|
-
"@abi-software/map-utilities": "^1.2.0
|
|
46
|
+
"@abi-software/flatmap-viewer": "^3.2.5",
|
|
47
|
+
"@abi-software/map-utilities": "^1.2.0",
|
|
48
48
|
"@abi-software/sparc-annotation": "0.3.1",
|
|
49
49
|
"@abi-software/svg-sprite": "^1.0.1",
|
|
50
50
|
"@element-plus/icons-vue": "^2.3.1",
|
package/src/App.vue
CHANGED
|
@@ -176,7 +176,8 @@ export default {
|
|
|
176
176
|
const results = this.$refs.multi
|
|
177
177
|
.getCurrentFlatmap()
|
|
178
178
|
.searchSuggestions(term)
|
|
179
|
-
results.__featureIds
|
|
179
|
+
const featureIds = results.__featureIds || results.featureIds;
|
|
180
|
+
featureIds.forEach((id) => {
|
|
180
181
|
const annotation = this.$refs.multi
|
|
181
182
|
.getCurrentFlatmap()
|
|
182
183
|
.mapImp.annotation(id)
|
|
@@ -196,8 +197,12 @@ export default {
|
|
|
196
197
|
.getCurrentFlatmap()
|
|
197
198
|
.searchAndShowResult(this.searchText, true)
|
|
198
199
|
},
|
|
199
|
-
onFlatmapChanged: function () {
|
|
200
|
+
onFlatmapChanged: function (activeSpecies) {
|
|
200
201
|
this.helpMode = false;
|
|
202
|
+
// Update current flatmapImp after changing species
|
|
203
|
+
if (this.$refs.multi.$refs[activeSpecies][0].mapImp) {
|
|
204
|
+
window.flatmapImp = this.$refs.multi.$refs[activeSpecies][0].mapImp;
|
|
205
|
+
}
|
|
201
206
|
},
|
|
202
207
|
onHelpModeShowNext: function () {
|
|
203
208
|
this.helpModeActiveItem += 1;
|
|
@@ -234,7 +239,7 @@ export default {
|
|
|
234
239
|
consoleOn: true,
|
|
235
240
|
searchText: '',
|
|
236
241
|
disableUI: false,
|
|
237
|
-
minZoom:
|
|
242
|
+
minZoom: 1,
|
|
238
243
|
availableSpecies: {
|
|
239
244
|
'Human Female': {
|
|
240
245
|
taxo: 'NCBITaxon:9606',
|
|
@@ -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"
|
|
@@ -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: [],
|
|
@@ -866,18 +833,23 @@ export default {
|
|
|
866
833
|
* @arg {String} `name`
|
|
867
834
|
*/
|
|
868
835
|
toolbarEvent: function (type, name) {
|
|
836
|
+
if (this.annotationSidebar) {
|
|
837
|
+
this.$emit("annotation-close")
|
|
838
|
+
if (!this.featureAnnotationSubmitted) {
|
|
839
|
+
this.rollbackAnnotationEvent()
|
|
840
|
+
}
|
|
841
|
+
}
|
|
869
842
|
this.closeTooltip()
|
|
870
|
-
if
|
|
843
|
+
// rollback feature if not submitted
|
|
844
|
+
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
845
|
+
this.rollbackAnnotationEvent()
|
|
846
|
+
}
|
|
871
847
|
this.doubleClickedFeature = false
|
|
872
848
|
this.connectionEntry = {}
|
|
873
849
|
if (type === 'mode') {
|
|
874
850
|
// Deselect any feature when draw mode is changed
|
|
875
851
|
this.changeAnnotationDrawMode({ mode: 'simple_select' })
|
|
876
852
|
this.activeDrawMode = name
|
|
877
|
-
// rollback modified feature when exit edit/delete mode
|
|
878
|
-
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
879
|
-
this.rollbackAnnotationEvent()
|
|
880
|
-
}
|
|
881
853
|
} else if (type === 'tool') {
|
|
882
854
|
if (name) {
|
|
883
855
|
const tool = name.replace(/[A-Z]/g, letter => `_${letter.toLowerCase()}`)
|
|
@@ -1173,7 +1145,6 @@ export default {
|
|
|
1173
1145
|
if (children.length > 0) child.children = children
|
|
1174
1146
|
data.children.push(child)
|
|
1175
1147
|
})
|
|
1176
|
-
|
|
1177
1148
|
this.systems.push(data)
|
|
1178
1149
|
}
|
|
1179
1150
|
},
|
|
@@ -1184,14 +1155,22 @@ export default {
|
|
|
1184
1155
|
* @arg {String} `flatmapAPI`,
|
|
1185
1156
|
* @arg {Array} `taxonIdentifiers`
|
|
1186
1157
|
*/
|
|
1187
|
-
processTaxon: function (
|
|
1158
|
+
processTaxon: function (taxonIdentifiers, state) {
|
|
1188
1159
|
this.taxonConnectivity.length = 0
|
|
1189
|
-
taxonIdentifiers.
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
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
|
+
});
|
|
1195
1174
|
},
|
|
1196
1175
|
/**
|
|
1197
1176
|
* @public
|
|
@@ -1219,11 +1198,27 @@ export default {
|
|
|
1219
1198
|
* @arg {Boolean} `flag`
|
|
1220
1199
|
*/
|
|
1221
1200
|
setOutlines: function (flag) {
|
|
1222
|
-
this.
|
|
1201
|
+
this.outlinesRadio = flag
|
|
1223
1202
|
if (this.mapImp) {
|
|
1224
1203
|
this.mapImp.setPaint({ colour: this.colourRadio, outline: flag })
|
|
1225
1204
|
}
|
|
1226
1205
|
},
|
|
1206
|
+
setInitMapState: function () {
|
|
1207
|
+
if (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
|
+
});
|
|
1220
|
+
}
|
|
1221
|
+
},
|
|
1227
1222
|
/**
|
|
1228
1223
|
* @public
|
|
1229
1224
|
* Function to toggle paths to default.
|
|
@@ -1231,9 +1226,18 @@ export default {
|
|
|
1231
1226
|
*/
|
|
1232
1227
|
resetView: function () {
|
|
1233
1228
|
if (this.mapImp) {
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
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
|
+
});
|
|
1237
1241
|
}
|
|
1238
1242
|
if (this.$refs.skcanSelection) {
|
|
1239
1243
|
this.$refs.skcanSelection.reset()
|
|
@@ -1269,18 +1273,6 @@ export default {
|
|
|
1269
1273
|
this.mapImp.zoomOut()
|
|
1270
1274
|
}
|
|
1271
1275
|
},
|
|
1272
|
-
/**
|
|
1273
|
-
* @public
|
|
1274
|
-
* Function to show or hide centrelines and nodes.
|
|
1275
|
-
* The parameter ``payload`` is an object with a boolean property, ``value``,
|
|
1276
|
-
* ``payload.value = true/false``.
|
|
1277
|
-
* @arg {Object} `payload`
|
|
1278
|
-
*/
|
|
1279
|
-
centreLinesSelected: function (payload) {
|
|
1280
|
-
if (this.mapImp) {
|
|
1281
|
-
this.mapImp.enableCentrelines(payload.value)
|
|
1282
|
-
}
|
|
1283
|
-
},
|
|
1284
1276
|
onSelectionsDataChanged: function (data) {
|
|
1285
1277
|
this.$emit('pathway-selection-changed', data);
|
|
1286
1278
|
},
|
|
@@ -1321,7 +1313,7 @@ export default {
|
|
|
1321
1313
|
let pathFeatures = paths.map((p) => this.mapImp.featureProperties(p))
|
|
1322
1314
|
|
|
1323
1315
|
// Query the flatmap knowledge graph for connectivity, we use this to grab the origins
|
|
1324
|
-
let connectivity = await this.flatmapQueries.
|
|
1316
|
+
let connectivity = await this.flatmapQueries.queryForConnectivityNew(this.mapImp, payload)
|
|
1325
1317
|
|
|
1326
1318
|
// Check and flatten the origins node graph
|
|
1327
1319
|
let originsFlat = connectivity?.ids?.dendrites?.flat().flat()
|
|
@@ -1667,6 +1659,9 @@ export default {
|
|
|
1667
1659
|
}
|
|
1668
1660
|
if (eventType === 'click') {
|
|
1669
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
|
|
1670
1665
|
if (this.viewingMode === 'Neuron Connection') {
|
|
1671
1666
|
this.highlightConnectedPaths([data.models])
|
|
1672
1667
|
} else {
|
|
@@ -1726,6 +1721,10 @@ export default {
|
|
|
1726
1721
|
}
|
|
1727
1722
|
if (this.annotationSidebar) this.$emit("annotation-close")
|
|
1728
1723
|
this.closeTooltip()
|
|
1724
|
+
// rollback feature if not submitted
|
|
1725
|
+
if (Object.keys(this.annotationEntry).length > 0 && !this.featureAnnotationSubmitted) {
|
|
1726
|
+
this.rollbackAnnotationEvent()
|
|
1727
|
+
}
|
|
1729
1728
|
},
|
|
1730
1729
|
/**
|
|
1731
1730
|
* @public
|
|
@@ -1767,13 +1766,13 @@ export default {
|
|
|
1767
1766
|
this.annotation = {}
|
|
1768
1767
|
}
|
|
1769
1768
|
} else {
|
|
1769
|
+
//require data.resource && data.feature.source
|
|
1770
1770
|
let results =
|
|
1771
|
-
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(data)
|
|
1771
|
+
await this.flatmapQueries.retrieveFlatmapKnowledgeForEvent(this.mapImp, data)
|
|
1772
1772
|
// The line below only creates the tooltip if some data was found on the path
|
|
1773
|
-
//
|
|
1773
|
+
// the pubmed URLs are in knowledge response.references
|
|
1774
1774
|
if (
|
|
1775
|
-
results[0] ||
|
|
1776
|
-
results[1] ||
|
|
1775
|
+
(results && results[0]) ||
|
|
1777
1776
|
(data.feature.hyperlinks && data.feature.hyperlinks.length > 0)
|
|
1778
1777
|
) {
|
|
1779
1778
|
this.resourceForTooltip = data.resource[0]
|
|
@@ -1817,7 +1816,7 @@ export default {
|
|
|
1817
1816
|
* @arg {Object} `data`
|
|
1818
1817
|
*/
|
|
1819
1818
|
createTooltipFromNeuronCuration: async function (data) {
|
|
1820
|
-
this.tooltipEntry = await this.flatmapQueries.createTooltipData(data)
|
|
1819
|
+
this.tooltipEntry = await this.flatmapQueries.createTooltipData(this.mapImp, data)
|
|
1821
1820
|
this.displayTooltip(data.resource[0])
|
|
1822
1821
|
},
|
|
1823
1822
|
/**
|
|
@@ -2160,6 +2159,48 @@ export default {
|
|
|
2160
2159
|
return Array.from(new Set(labels))
|
|
2161
2160
|
}
|
|
2162
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
|
+
},
|
|
2163
2204
|
/**
|
|
2164
2205
|
* @public
|
|
2165
2206
|
* Function to get the state (object) of the map.
|
|
@@ -2175,6 +2216,13 @@ export default {
|
|
|
2175
2216
|
else if (identifier && identifier.biologicalSex)
|
|
2176
2217
|
state['biologicalSex'] = identifier.biologicalSex
|
|
2177
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)
|
|
2178
2226
|
return state
|
|
2179
2227
|
}
|
|
2180
2228
|
return undefined
|
|
@@ -2192,9 +2240,7 @@ export default {
|
|
|
2192
2240
|
this.entry == state.entry &&
|
|
2193
2241
|
(!state.biologicalSex || state.biologicalSex === this.biologicalSex)
|
|
2194
2242
|
) {
|
|
2195
|
-
|
|
2196
|
-
this.mapImp.setState(state.viewport)
|
|
2197
|
-
}
|
|
2243
|
+
this.restoreMapState(state)
|
|
2198
2244
|
} else {
|
|
2199
2245
|
this.createFlatmap(state)
|
|
2200
2246
|
}
|
|
@@ -2210,7 +2256,33 @@ export default {
|
|
|
2210
2256
|
restoreMapState: function (state) {
|
|
2211
2257
|
if (state) {
|
|
2212
2258
|
if (state.viewport) this.mapImp.setState(state.viewport)
|
|
2213
|
-
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)
|
|
2214
2286
|
}
|
|
2215
2287
|
},
|
|
2216
2288
|
/**
|
|
@@ -2303,16 +2375,13 @@ export default {
|
|
|
2303
2375
|
this.serverURL = this.mapImp.makeServerUrl('').slice(0, -1)
|
|
2304
2376
|
let mapVersion = this.mapImp.details.version
|
|
2305
2377
|
this.setFlightPathInfo(mapVersion)
|
|
2306
|
-
this.
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
this.restoreMapState(state)
|
|
2310
|
-
}
|
|
2378
|
+
const stateToSet = this._stateToBeSet ? this._stateToBeSet : state
|
|
2379
|
+
this.onFlatmapReady(stateToSet)
|
|
2380
|
+
this.$nextTick(() => this.restoreMapState(stateToSet))
|
|
2311
2381
|
})
|
|
2312
2382
|
} else if (state) {
|
|
2313
2383
|
this._stateToBeSet = {
|
|
2314
|
-
|
|
2315
|
-
searchTerm: state.searchTerm,
|
|
2384
|
+
...state
|
|
2316
2385
|
}
|
|
2317
2386
|
if (this.mapImp && !this.loading)
|
|
2318
2387
|
this.restoreMapState(this._stateToBeSet)
|
|
@@ -2354,31 +2423,28 @@ export default {
|
|
|
2354
2423
|
* @public
|
|
2355
2424
|
* This function is used for functions that need to run immediately after the flatmap is loaded.
|
|
2356
2425
|
*/
|
|
2357
|
-
onFlatmapReady: function () {
|
|
2426
|
+
onFlatmapReady: function (state) {
|
|
2358
2427
|
// onFlatmapReady is used for functions that need to run immediately after the flatmap is loaded
|
|
2359
2428
|
this.sensor = markRaw(new ResizeSensor(this.$refs.display, this.mapResize))
|
|
2360
2429
|
if (this.mapImp.options?.style === 'functional') {
|
|
2361
2430
|
this.isFC = true
|
|
2362
|
-
} else if (this.mapImp.options?.style === 'centreline') {
|
|
2363
|
-
this.isCentreLine = true
|
|
2364
2431
|
}
|
|
2365
2432
|
this.mapImp.setBackgroundOpacity(1)
|
|
2366
2433
|
this.backgroundChangeCallback(this.currentBackground)
|
|
2367
2434
|
this.pathways = this.mapImp.pathTypes()
|
|
2368
|
-
if (!this.isCentreLine) {
|
|
2369
|
-
this.mapImp.enableCentrelines(false)
|
|
2370
|
-
}
|
|
2371
2435
|
//Disable layers for now
|
|
2372
2436
|
//this.layers = this.mapImp.getLayers();
|
|
2373
2437
|
this.processSystems(this.mapImp.getSystems())
|
|
2374
|
-
|
|
2438
|
+
//Async, pass the state for checking
|
|
2439
|
+
this.processTaxon(this.mapImp.taxonIdentifiers, state ? state['taxonSelection'] : undefined)
|
|
2375
2440
|
this.containsAlert = "alert" in this.mapImp.featureFilterRanges()
|
|
2376
2441
|
this.addResizeButtonToMinimap()
|
|
2377
2442
|
this.loading = false
|
|
2378
2443
|
this.computePathControlsMaximumHeight()
|
|
2379
|
-
this.drawerOpen =
|
|
2444
|
+
this.drawerOpen = true;
|
|
2380
2445
|
this.mapResize()
|
|
2381
2446
|
this.handleMapClick();
|
|
2447
|
+
this.setInitMapState();
|
|
2382
2448
|
/**
|
|
2383
2449
|
* This is ``onFlatmapReady`` event.
|
|
2384
2450
|
* @arg ``this`` (Component Vue Instance)
|
|
@@ -2392,9 +2458,15 @@ export default {
|
|
|
2392
2458
|
*/
|
|
2393
2459
|
handleMapClick: function () {
|
|
2394
2460
|
const _map = this.mapImp._map;
|
|
2395
|
-
|
|
2396
2461
|
if (_map) {
|
|
2397
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
|
+
}
|
|
2398
2470
|
if (this.tooltipEntry.featureId) {
|
|
2399
2471
|
this.$emit('connectivity-info-close');
|
|
2400
2472
|
}
|
|
@@ -2430,6 +2502,7 @@ export default {
|
|
|
2430
2502
|
if (this.mapImp) {
|
|
2431
2503
|
if (term === undefined || term === '') {
|
|
2432
2504
|
this.mapImp.clearSearchResults()
|
|
2505
|
+
this.statesTracking.activeTerm = ""
|
|
2433
2506
|
return true
|
|
2434
2507
|
} else {
|
|
2435
2508
|
const searchResults = this.mapImp.search(term)
|
|
@@ -2438,6 +2511,7 @@ export default {
|
|
|
2438
2511
|
searchResults.results &&
|
|
2439
2512
|
searchResults.results.length > 0
|
|
2440
2513
|
) {
|
|
2514
|
+
this.statesTracking.activeTerm = term
|
|
2441
2515
|
this.mapImp.showSearchResults(searchResults)
|
|
2442
2516
|
if (
|
|
2443
2517
|
displayLabel &&
|
|
@@ -2501,7 +2575,7 @@ export default {
|
|
|
2501
2575
|
*/
|
|
2502
2576
|
minZoom: {
|
|
2503
2577
|
type: Number,
|
|
2504
|
-
default:
|
|
2578
|
+
default: 1,
|
|
2505
2579
|
},
|
|
2506
2580
|
/**
|
|
2507
2581
|
* The option to add another feature label _(`FeatureSmallSymbolLayer`)_
|
|
@@ -2687,19 +2761,13 @@ export default {
|
|
|
2687
2761
|
serverURL: undefined,
|
|
2688
2762
|
layers: [],
|
|
2689
2763
|
pathways: [],
|
|
2764
|
+
initMapState: markRaw({}),
|
|
2690
2765
|
sckanDisplay: [
|
|
2691
2766
|
{
|
|
2692
2767
|
label: 'Display Path with SCKAN',
|
|
2693
2768
|
key: 'VALID',
|
|
2694
2769
|
},
|
|
2695
2770
|
],
|
|
2696
|
-
centreLines: [
|
|
2697
|
-
{
|
|
2698
|
-
label: 'Display Nerves',
|
|
2699
|
-
key: 'centrelines',
|
|
2700
|
-
enabled: false,
|
|
2701
|
-
},
|
|
2702
|
-
],
|
|
2703
2771
|
systems: [],
|
|
2704
2772
|
taxonConnectivity: [],
|
|
2705
2773
|
pathwaysMaxHeight: 1000,
|
|
@@ -2725,7 +2793,6 @@ export default {
|
|
|
2725
2793
|
helpModeActiveIndex: this.helpModeInitialIndex,
|
|
2726
2794
|
yellowstar: yellowstar,
|
|
2727
2795
|
isFC: false,
|
|
2728
|
-
isCentreLine: false,
|
|
2729
2796
|
inHelp: false,
|
|
2730
2797
|
currentBackground: 'white',
|
|
2731
2798
|
availableBackground: ['white', 'lightskyblue', 'black'],
|
|
@@ -2791,7 +2858,11 @@ export default {
|
|
|
2791
2858
|
with: true,
|
|
2792
2859
|
without: true,
|
|
2793
2860
|
}
|
|
2794
|
-
})
|
|
2861
|
+
}),
|
|
2862
|
+
statesTracking: markRaw({
|
|
2863
|
+
activeClick: false,
|
|
2864
|
+
activeTerm: "",
|
|
2865
|
+
}),
|
|
2795
2866
|
}
|
|
2796
2867
|
},
|
|
2797
2868
|
computed: {
|
|
@@ -2939,6 +3010,11 @@ export default {
|
|
|
2939
3010
|
left: 0px;
|
|
2940
3011
|
transform: translateX(0);
|
|
2941
3012
|
transition: all var(--el-transition-duration);
|
|
3013
|
+
z-index: 99;
|
|
3014
|
+
display: flex;
|
|
3015
|
+
flex-direction: row;
|
|
3016
|
+
align-items: center;
|
|
3017
|
+
|
|
2942
3018
|
&.open {
|
|
2943
3019
|
transform: translateX(0);
|
|
2944
3020
|
}
|
|
@@ -3484,7 +3560,6 @@ export default {
|
|
|
3484
3560
|
}
|
|
3485
3561
|
}
|
|
3486
3562
|
|
|
3487
|
-
.open-drawer,
|
|
3488
3563
|
.drawer-button {
|
|
3489
3564
|
z-index: 8;
|
|
3490
3565
|
width: 20px;
|
|
@@ -3494,18 +3569,6 @@ export default {
|
|
|
3494
3569
|
vertical-align: middle;
|
|
3495
3570
|
cursor: pointer;
|
|
3496
3571
|
pointer-events: auto;
|
|
3497
|
-
}
|
|
3498
|
-
|
|
3499
|
-
.open-drawer {
|
|
3500
|
-
position: absolute;
|
|
3501
|
-
left: 0px;
|
|
3502
|
-
background-color: #f7faff;
|
|
3503
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.06);
|
|
3504
|
-
}
|
|
3505
|
-
|
|
3506
|
-
.drawer-button {
|
|
3507
|
-
float: left;
|
|
3508
|
-
margin-top: calc(50% - 36px);
|
|
3509
3572
|
background-color: #f9f2fc;
|
|
3510
3573
|
|
|
3511
3574
|
i {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="multi-container" ref="multiContainer">
|
|
3
|
-
<div style="position: absolute; z-index:
|
|
3
|
+
<div style="position: absolute; z-index: 100" v-if="!disableUI">
|
|
4
4
|
<div class="species-display-text">Species</div>
|
|
5
5
|
<el-popover
|
|
6
6
|
content="Select a species"
|
|
@@ -538,7 +538,7 @@ export default {
|
|
|
538
538
|
*/
|
|
539
539
|
minZoom: {
|
|
540
540
|
type: Number,
|
|
541
|
-
default:
|
|
541
|
+
default: 1,
|
|
542
542
|
},
|
|
543
543
|
/**
|
|
544
544
|
* The option to create map on component mounted.
|
|
@@ -768,9 +768,6 @@ export default {
|
|
|
768
768
|
}
|
|
769
769
|
|
|
770
770
|
.select-box {
|
|
771
|
-
width: 120px;
|
|
772
|
-
border-radius: 4px;
|
|
773
|
-
border: 1px solid rgb(144, 147, 153);
|
|
774
771
|
background-color: var(--white);
|
|
775
772
|
font-weight: 500;
|
|
776
773
|
color: rgb(48, 49, 51);
|
|
@@ -782,6 +779,27 @@ export default {
|
|
|
782
779
|
padding-top: 0.25em;
|
|
783
780
|
}
|
|
784
781
|
:deep() {
|
|
782
|
+
.el-select__wrapper {
|
|
783
|
+
position: relative;
|
|
784
|
+
width: fit-content;
|
|
785
|
+
box-shadow: none;
|
|
786
|
+
border-radius: 4px;
|
|
787
|
+
border: 1px solid var(--el-border-color);
|
|
788
|
+
&.is-focused {
|
|
789
|
+
border-color: $app-primary-color;
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
.el-select__selection {
|
|
793
|
+
width: fit-content;
|
|
794
|
+
position: relative;
|
|
795
|
+
}
|
|
796
|
+
.el-select__placeholder {
|
|
797
|
+
position: relative;
|
|
798
|
+
top: auto;
|
|
799
|
+
transform: none;
|
|
800
|
+
min-width: 80px;
|
|
801
|
+
width: fit-content;
|
|
802
|
+
}
|
|
785
803
|
.el-input {
|
|
786
804
|
.el-input__wrapper{
|
|
787
805
|
&is-focus,
|