@abi-software/mapintegratedvuer 1.16.3-simulation.1 → 1.17.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/ConnectivityGraph-DbqPx-8k.js +125 -0
- package/dist/{ContentMixin-CN4E1Tcm.js → ContentMixin-R9Bw7Ou4.js} +545 -270
- package/dist/Flatmap-BYUfDJ9B.js +202 -0
- package/dist/{Iframe-NY9zAQZz.js → Iframe-2ofJ9NJW.js} +2 -2
- package/dist/{MultiFlatmap-C8gAg-MI.js → MultiFlatmap-CYxpB20e.js} +25 -18
- package/dist/{Plot-DH_Px9IB.js → Plot-DmQzP7lz.js} +2 -2
- package/dist/{Scaffold-C6XY3IQb.js → Scaffold-C8x1IHb9.js} +53 -79
- package/dist/Simulation-D9pblkqI.js +28 -0
- package/dist/{index-DaB85Tpy.js → index-raNlNgsS.js} +30069 -28444
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +238 -4270
- package/dist/{DynamicMarkerMixin-ToiTtIcj.js → style-QpNSY6to.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +6 -11
- package/src/App.vue +265 -283
- package/src/assets/styles.scss +1 -1
- package/src/components/ContentVuer.vue +5 -1
- package/src/components/ContextCard.vue +1 -0
- package/src/components/EventBus.js +3 -0
- package/src/components/MapContent.vue +9 -8
- package/src/components/SplitDialog.vue +5 -6
- package/src/components/SplitFlow.vue +491 -469
- package/src/components/scripts/utilities.js +16 -1
- package/src/components/viewers/ConnectivityGraph.vue +146 -0
- package/src/components/viewers/Flatmap.vue +84 -136
- package/src/components/viewers/MultiFlatmap.vue +9 -5
- package/src/components/viewers/Simulation.vue +15 -66
- package/src/components.d.ts +1 -3
- package/src/main.js +3 -9
- package/src/mixins/ContentMixin.js +391 -420
- package/src/stores/connectivities.js +6 -1
- package/src/stores/entries.js +1 -1
- package/src/stores/splitFlow.js +366 -427
- package/dist/Flatmap-D7eEw_Q5.js +0 -103398
- package/dist/Simulation-Bb3HbeD4.js +0 -72
- package/src/components/DummyRouteComponent.vue +0 -1
- package/src/components/EventBus.ts +0 -13
- package/src/components/FloatingWindow.vue +0 -125
- package/src/components/PlotComponent.vue +0 -56
- package/src/services/mapping.js +0 -69
- package/src/stores/mapping.js +0 -29
- package/src/stores/simulationPlotStore.js +0 -104
- package/src/types/simulation.js +0 -18
|
@@ -6,7 +6,7 @@ const initialDefaultState = () => {
|
|
|
6
6
|
{
|
|
7
7
|
resource: defaultSpecies,
|
|
8
8
|
type: "MultiFlatmap",
|
|
9
|
-
|
|
9
|
+
mode: "main",
|
|
10
10
|
id: 1,
|
|
11
11
|
state: undefined,
|
|
12
12
|
label: "",
|
|
@@ -50,6 +50,15 @@ const getNewMapEntry = async (type, sparcApi) => {
|
|
|
50
50
|
version: data.datasetInfo.version,
|
|
51
51
|
isBodyScaffold: true,
|
|
52
52
|
};
|
|
53
|
+
} else if (type === "CG") {
|
|
54
|
+
entry = {
|
|
55
|
+
resource: "ConnectivityGraph",
|
|
56
|
+
type: "ConnectivityGraph",
|
|
57
|
+
mode: "main",
|
|
58
|
+
state: undefined,
|
|
59
|
+
label: "Connectivity Graph",
|
|
60
|
+
discoverId: undefined
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
return entry;
|
|
@@ -190,7 +199,13 @@ const transformStringToObj = (str) => {
|
|
|
190
199
|
return obj;
|
|
191
200
|
};
|
|
192
201
|
|
|
202
|
+
const listsAreEqual = (a, b) => {
|
|
203
|
+
if (a.length !== b.length) return false;
|
|
204
|
+
return JSON.stringify([...a].sort()) === JSON.stringify([...b].sort());
|
|
205
|
+
};
|
|
206
|
+
|
|
193
207
|
export {
|
|
208
|
+
listsAreEqual,
|
|
194
209
|
availableSpecies,
|
|
195
210
|
capitalise,
|
|
196
211
|
findSpeciesKey,
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="viewer-container">
|
|
3
|
+
<MapUtilitiesConnectivityGraph
|
|
4
|
+
:entry="graphEntry"
|
|
5
|
+
:mapServer="mapServer"
|
|
6
|
+
:sckanVersion="sckanVersion"
|
|
7
|
+
:connectivityFromMap="connectivityFromMap"
|
|
8
|
+
:connectivityError="connectivityError"
|
|
9
|
+
:origins="origins"
|
|
10
|
+
:components="components"
|
|
11
|
+
:destinations="destinations"
|
|
12
|
+
:originsWithDatasets="originsWithDatasets"
|
|
13
|
+
:componentsWithDatasets="componentsWithDatasets"
|
|
14
|
+
:destinationsWithDatasets="destinationsWithDatasets"
|
|
15
|
+
:hasSingleConnectivityList="hasSingleConnectivityList"
|
|
16
|
+
:originsCombinations="originsCombinations"
|
|
17
|
+
:componentsCombinations="componentsCombinations"
|
|
18
|
+
:destinationsCombinations="destinationsCombinations"
|
|
19
|
+
@tap-node="onTapNode"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
/* eslint-disable no-alert, no-console */
|
|
26
|
+
import {
|
|
27
|
+
ConnectivityGraph as MapUtilitiesConnectivityGraph,
|
|
28
|
+
} from '@abi-software/map-utilities';
|
|
29
|
+
import ContentMixin from "../../mixins/ContentMixin";
|
|
30
|
+
import EventBus from '../EventBus';
|
|
31
|
+
|
|
32
|
+
export default {
|
|
33
|
+
name: "ConnectivityGraph",
|
|
34
|
+
mixins: [ ContentMixin ],
|
|
35
|
+
components: {
|
|
36
|
+
MapUtilitiesConnectivityGraph,
|
|
37
|
+
},
|
|
38
|
+
computed: {
|
|
39
|
+
graphEntry() {
|
|
40
|
+
return this.entry.resource;
|
|
41
|
+
},
|
|
42
|
+
connectivityError() {
|
|
43
|
+
return {};
|
|
44
|
+
},
|
|
45
|
+
connectivityFromMap() {
|
|
46
|
+
return this.entry.graphPayload?.connectivityFromMap || null;
|
|
47
|
+
},
|
|
48
|
+
origins() {
|
|
49
|
+
return this.entry.graphPayload?.origins || [];
|
|
50
|
+
},
|
|
51
|
+
components() {
|
|
52
|
+
return this.entry.graphPayload?.components || [];
|
|
53
|
+
},
|
|
54
|
+
destinations() {
|
|
55
|
+
return this.entry.graphPayload?.destinations || [];
|
|
56
|
+
},
|
|
57
|
+
originsWithDatasets() {
|
|
58
|
+
return this.entry.graphPayload?.originsWithDatasets || [];
|
|
59
|
+
},
|
|
60
|
+
componentsWithDatasets() {
|
|
61
|
+
return this.entry.graphPayload?.componentsWithDatasets || [];
|
|
62
|
+
},
|
|
63
|
+
destinationsWithDatasets() {
|
|
64
|
+
return this.entry.graphPayload?.destinationsWithDatasets || [];
|
|
65
|
+
},
|
|
66
|
+
hasSingleConnectivityList() {
|
|
67
|
+
return this.entry.graphPayload?.hasSingleConnectivityList || false;
|
|
68
|
+
},
|
|
69
|
+
originsCombinations() {
|
|
70
|
+
return this.entry.graphPayload?.originsCombinations || [];
|
|
71
|
+
},
|
|
72
|
+
componentsCombinations() {
|
|
73
|
+
return this.entry.graphPayload?.componentsCombinations || [];
|
|
74
|
+
},
|
|
75
|
+
destinationsCombinations() {
|
|
76
|
+
return this.entry.graphPayload?.destinationsCombinations || [];
|
|
77
|
+
},
|
|
78
|
+
mapServer() {
|
|
79
|
+
return this.entry.mapServer || null;
|
|
80
|
+
},
|
|
81
|
+
sckanVersion() {
|
|
82
|
+
return this.entry.sckanVersion || null;
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
methods: {
|
|
86
|
+
onTapNode: function (data) {
|
|
87
|
+
const name = data.map(t => t.label).join(', ');
|
|
88
|
+
this.onConnectivityHovered(name);
|
|
89
|
+
|
|
90
|
+
// Hover outside of node area
|
|
91
|
+
if (!name) {
|
|
92
|
+
EventBus.emit('show-connectivity', {
|
|
93
|
+
featureIds: [this.entry.resource]
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
},
|
|
98
|
+
onConnectivityHovered: function (label) {
|
|
99
|
+
const payload = {
|
|
100
|
+
connectivityInfo: this.graphEntry,
|
|
101
|
+
label: label,
|
|
102
|
+
data: label ? this.getConnectivityDatasets(label) : [],
|
|
103
|
+
};
|
|
104
|
+
EventBus.emit('connectivity-hovered', payload);
|
|
105
|
+
},
|
|
106
|
+
getConnectivityDatasets: function (label) {
|
|
107
|
+
const allWithDatasets = this.entry.graphPayload?.allWithDatasets || [];
|
|
108
|
+
const names = label.split(',');
|
|
109
|
+
let data = [];
|
|
110
|
+
names.forEach((n) => {
|
|
111
|
+
const foundData = allWithDatasets.find((a) =>
|
|
112
|
+
a.name.toLowerCase().trim() === n.toLowerCase().trim()
|
|
113
|
+
);
|
|
114
|
+
if (foundData) {
|
|
115
|
+
data.push({
|
|
116
|
+
id: foundData.id,
|
|
117
|
+
label: foundData.name
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
return data
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
</script>
|
|
126
|
+
|
|
127
|
+
<style scoped lang="scss">
|
|
128
|
+
.viewer-container {
|
|
129
|
+
width: 100%;
|
|
130
|
+
height: 100%;
|
|
131
|
+
box-sizing: border-box;
|
|
132
|
+
|
|
133
|
+
.connectivity-graph {
|
|
134
|
+
width: 100%;
|
|
135
|
+
height: 100%;
|
|
136
|
+
box-shadow: none;
|
|
137
|
+
border: none;
|
|
138
|
+
border-radius: 0;
|
|
139
|
+
|
|
140
|
+
:deep(.graph-canvas) {
|
|
141
|
+
width: 100%;
|
|
142
|
+
height: 100%;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</style>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="viewer-container"
|
|
3
|
-
<resize-sensor @resize="calculateOffset()"> </resize-sensor>
|
|
2
|
+
<div class="viewer-container">
|
|
4
3
|
<FlatmapVuer
|
|
5
4
|
:state="entry.state"
|
|
6
5
|
:entry="entry.resource"
|
|
@@ -43,7 +42,6 @@
|
|
|
43
42
|
@mapmanager-loaded="onMapmanagerLoaded"
|
|
44
43
|
:showPathwayFilter="false"
|
|
45
44
|
@trackEvent="trackEvent"
|
|
46
|
-
@open-simulation="onSimulationOpen"
|
|
47
45
|
/>
|
|
48
46
|
|
|
49
47
|
<HelpModeDialog
|
|
@@ -54,118 +52,83 @@
|
|
|
54
52
|
@show-next="onHelpModeShowNext"
|
|
55
53
|
@finish-help-mode="onFinishHelpMode"
|
|
56
54
|
/>
|
|
57
|
-
|
|
58
|
-
<FloatingWindow
|
|
59
|
-
v-for="win in plotWindows"
|
|
60
|
-
:key="win.id"
|
|
61
|
-
:windowData="win"
|
|
62
|
-
:offsetX="left"
|
|
63
|
-
:offsetY="top"
|
|
64
|
-
@closeWindow="handleClosePlotWindow"
|
|
65
|
-
@mouseDown="bringToFront"
|
|
66
|
-
>
|
|
67
|
-
<PlotComponent :data="win.data" />
|
|
68
|
-
</FloatingWindow>
|
|
69
55
|
</div>
|
|
70
56
|
</template>
|
|
71
57
|
|
|
72
58
|
<script>
|
|
73
|
-
import { ref } from 'vue'
|
|
74
|
-
import { useMouseInElement } from '@vueuse/core'
|
|
75
|
-
|
|
76
59
|
/* eslint-disable no-alert, no-console */
|
|
77
|
-
import Tagging from '../../services/tagging.js'
|
|
78
|
-
import EventBus from
|
|
79
|
-
import ContentMixin from
|
|
80
|
-
import DynamicMarkerMixin from
|
|
81
|
-
|
|
82
|
-
import { FlatmapVuer } from
|
|
83
|
-
import
|
|
60
|
+
import Tagging from '../../services/tagging.js';
|
|
61
|
+
import EventBus from "../EventBus";
|
|
62
|
+
import ContentMixin from "../../mixins/ContentMixin";
|
|
63
|
+
import DynamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
|
|
64
|
+
|
|
65
|
+
import { FlatmapVuer } from "@abi-software/flatmapvuer";
|
|
66
|
+
import "@abi-software/flatmapvuer/dist/style.css";
|
|
84
67
|
import { HelpModeDialog } from '@abi-software/map-utilities'
|
|
85
68
|
import '@abi-software/map-utilities/dist/style.css'
|
|
86
|
-
import { useSimulationPlotStore } from '../../stores/simulationPlotStore'
|
|
87
|
-
|
|
88
|
-
import PlotComponent from '../PlotComponent.vue'
|
|
89
|
-
import FloatingWindow from '../FloatingWindow.vue'
|
|
90
|
-
import { useMappingStore } from '../../stores/mapping'
|
|
91
|
-
|
|
92
|
-
const BASE_Z_INDEX = 100
|
|
93
69
|
|
|
94
70
|
export default {
|
|
95
|
-
name:
|
|
96
|
-
mixins: [ContentMixin, DynamicMarkerMixin],
|
|
71
|
+
name: "Flatmap",
|
|
72
|
+
mixins: [ ContentMixin, DynamicMarkerMixin ],
|
|
97
73
|
components: {
|
|
98
74
|
FlatmapVuer,
|
|
99
75
|
HelpModeDialog,
|
|
100
|
-
ResizeSensor,
|
|
101
|
-
},
|
|
102
|
-
setup() {
|
|
103
|
-
// const flatmap = ref(null)
|
|
104
|
-
const container = ref(null)
|
|
105
|
-
const simulationPlotStore = useSimulationPlotStore()
|
|
106
|
-
const mappingStore = useMappingStore()
|
|
107
|
-
mappingStore.initializeMapping()
|
|
108
|
-
const { elementX, elementY } = useMouseInElement(container)
|
|
109
|
-
return { container, elementX, elementY, mappingStore, simulationPlotStore }
|
|
110
76
|
},
|
|
111
77
|
data: function () {
|
|
112
78
|
return {
|
|
113
79
|
flatmapReady: false,
|
|
114
80
|
displayMinimap: false,
|
|
115
|
-
zStack: [],
|
|
116
|
-
left: 0,
|
|
117
|
-
top: 0,
|
|
118
81
|
}
|
|
119
82
|
},
|
|
120
83
|
methods: {
|
|
121
84
|
getState: function () {
|
|
122
|
-
return this.$refs.flatmap.getState()
|
|
85
|
+
return this.$refs.flatmap.getState();
|
|
123
86
|
},
|
|
124
87
|
/**
|
|
125
88
|
* Perform a local search on this contentvuer
|
|
126
89
|
* This is similar to directly clicking onthe map
|
|
127
90
|
*/
|
|
128
91
|
search: function (term) {
|
|
129
|
-
return this.$refs.flatmap.searchAndShowResult(term, true, true)
|
|
92
|
+
return this.$refs.flatmap.searchAndShowResult(term, true, true);
|
|
130
93
|
},
|
|
131
94
|
getFlatmapImp() {
|
|
132
|
-
return this.$refs.flatmap?.mapImp
|
|
95
|
+
return this.$refs.flatmap?.mapImp;
|
|
133
96
|
},
|
|
134
97
|
contextRestored(flatmap) {
|
|
135
|
-
this.flatmapReadyForMarkerUpdates(flatmap)
|
|
136
|
-
this.updateViewerSettings()
|
|
98
|
+
this.flatmapReadyForMarkerUpdates(flatmap);
|
|
99
|
+
this.updateViewerSettings();
|
|
137
100
|
},
|
|
138
101
|
flatmapReadyCall: function (flatmap) {
|
|
139
|
-
this.flatmapReady = true
|
|
140
|
-
const mapImp = this.getFlatmapImp()
|
|
102
|
+
this.flatmapReady = true;
|
|
103
|
+
const mapImp = this.getFlatmapImp();
|
|
141
104
|
if (mapImp?.mapMetadata?.name) {
|
|
142
|
-
this.updateEntryLabel(mapImp?.mapMetadata?.name)
|
|
143
|
-
this.updateEntryTitle(mapImp?.mapMetadata?.name)
|
|
105
|
+
this.updateEntryLabel(mapImp?.mapMetadata?.name);
|
|
106
|
+
this.updateEntryTitle(mapImp?.mapMetadata?.name);
|
|
144
107
|
}
|
|
145
|
-
let provClone = {
|
|
146
|
-
EventBus.emit(
|
|
147
|
-
this.$emit(
|
|
148
|
-
this.flatmapReadyForMarkerUpdates(flatmap)
|
|
149
|
-
this.updateViewerSettings()
|
|
108
|
+
let provClone = {id: this.entry.id, prov: mapImp.mapMetadata}; //create clone of provenance and add id
|
|
109
|
+
EventBus.emit("mapImpProv", provClone); // send clone to context card
|
|
110
|
+
this.$emit("flatmap-provenance-ready", provClone);
|
|
111
|
+
this.flatmapReadyForMarkerUpdates(flatmap);
|
|
112
|
+
this.updateViewerSettings();
|
|
150
113
|
// Wait for flatmap's connectivity to load before emitting mapLoaded
|
|
151
114
|
this.loadConnectivityExplorerConfig(flatmap).then(() => {
|
|
152
|
-
EventBus.emit(
|
|
153
|
-
})
|
|
115
|
+
EventBus.emit("mapLoaded", flatmap);
|
|
116
|
+
});
|
|
154
117
|
},
|
|
155
118
|
onPathwaySelectionChanged: function (data) {
|
|
156
|
-
const { label, property, checked, selectionsTitle } = data
|
|
119
|
+
const { label, property, checked, selectionsTitle } = data;
|
|
157
120
|
// GA Tagging
|
|
158
121
|
// Event tracking for maps' pathway selection change
|
|
159
122
|
Tagging.sendEvent({
|
|
160
|
-
event: 'interaction_event',
|
|
161
|
-
event_name: 'portal_maps_pathway_change',
|
|
162
|
-
category: label + ' [' + property + '] ' + checked,
|
|
163
|
-
location: selectionsTitle
|
|
164
|
-
})
|
|
123
|
+
'event': 'interaction_event',
|
|
124
|
+
'event_name': 'portal_maps_pathway_change',
|
|
125
|
+
'category': label + ' [' + property + '] ' + checked,
|
|
126
|
+
'location': selectionsTitle
|
|
127
|
+
});
|
|
165
128
|
},
|
|
166
|
-
onSidebarAnnotationClose: function
|
|
129
|
+
onSidebarAnnotationClose: function() {
|
|
167
130
|
if (this.flatmapReady) {
|
|
168
|
-
const currentFlatmap = this.$refs.flatmap
|
|
131
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
169
132
|
if (currentFlatmap) {
|
|
170
133
|
this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
|
|
171
134
|
}
|
|
@@ -176,132 +139,117 @@ export default {
|
|
|
176
139
|
*/
|
|
177
140
|
searchSuggestions: function (term, suggestions) {
|
|
178
141
|
if (term && this.$refs.flatmap.mapImp) {
|
|
179
|
-
const results = this.$refs.flatmap.mapImp.search(term)
|
|
180
|
-
const featureIds = results.__featureIds || results.featureIds
|
|
181
|
-
featureIds.forEach(
|
|
182
|
-
const annotation = this.$refs.flatmap.mapImp.annotation(id)
|
|
183
|
-
if (annotation && annotation.label)
|
|
184
|
-
|
|
142
|
+
const results = this.$refs.flatmap.mapImp.search(term);
|
|
143
|
+
const featureIds = results.__featureIds || results.featureIds;
|
|
144
|
+
featureIds.forEach(id => {
|
|
145
|
+
const annotation = this.$refs.flatmap.mapImp.annotation(id);
|
|
146
|
+
if (annotation && annotation.label)
|
|
147
|
+
suggestions.push(annotation.label);
|
|
148
|
+
});
|
|
185
149
|
}
|
|
186
150
|
},
|
|
187
151
|
showConnectivity: function (payload) {
|
|
188
152
|
if (this?.alive) {
|
|
189
|
-
const { featureIds, offset } = payload
|
|
190
|
-
const currentFlatmap = this.$refs.flatmap
|
|
153
|
+
const { featureIds, offset } = payload;
|
|
154
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
191
155
|
if (currentFlatmap) {
|
|
192
156
|
currentFlatmap.moveMap(featureIds, {
|
|
193
157
|
offsetX: offset ? -150 : 0,
|
|
194
158
|
zoom: 4,
|
|
195
|
-
})
|
|
159
|
+
});
|
|
196
160
|
}
|
|
197
161
|
}
|
|
198
162
|
},
|
|
199
163
|
showConnectivityTooltips: function (payload) {
|
|
200
164
|
if (this?.alive && this.flatmapReady) {
|
|
201
|
-
const flatmap = this.$refs.multiflatmap.getCurrentFlatmap()
|
|
202
|
-
flatmap.showConnectivityTooltips(payload)
|
|
165
|
+
const flatmap = this.$refs.multiflatmap.getCurrentFlatmap();
|
|
166
|
+
flatmap.showConnectivityTooltips(payload);
|
|
203
167
|
}
|
|
204
168
|
},
|
|
205
169
|
showConnectivitiesByReference: function (payload) {
|
|
206
170
|
if (this?.alive) {
|
|
207
|
-
const currentFlatmap = this.$refs.flatmap
|
|
171
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
208
172
|
if (currentFlatmap) {
|
|
209
|
-
currentFlatmap.showConnectivitiesByReference(payload)
|
|
173
|
+
currentFlatmap.showConnectivitiesByReference(payload);
|
|
210
174
|
}
|
|
211
175
|
}
|
|
212
176
|
},
|
|
213
177
|
changeConnectivitySource: function (payload, ongoingSource) {
|
|
214
178
|
if (this?.alive && this.flatmapReady) {
|
|
215
|
-
const flatmap = this.$refs.flatmap
|
|
216
|
-
const flatmapUUID = flatmap.mapImp.mapMetadata.uuid
|
|
179
|
+
const flatmap = this.$refs.flatmap;
|
|
180
|
+
const flatmapUUID = flatmap.mapImp.mapMetadata.uuid;
|
|
217
181
|
if (!ongoingSource.includes(flatmapUUID)) {
|
|
218
|
-
ongoingSource.push(flatmapUUID)
|
|
219
|
-
flatmap.changeConnectivitySource(payload)
|
|
182
|
+
ongoingSource.push(flatmapUUID);
|
|
183
|
+
flatmap.changeConnectivitySource(payload);
|
|
220
184
|
}
|
|
221
185
|
}
|
|
222
186
|
},
|
|
223
|
-
zoomToFeatures: function
|
|
224
|
-
let name = info.name
|
|
225
|
-
const flatmap = this.$refs.flatmap.mapImp
|
|
187
|
+
zoomToFeatures: function(info, forceSelect) {
|
|
188
|
+
let name = info.name;
|
|
189
|
+
const flatmap = this.$refs.flatmap.mapImp;
|
|
226
190
|
if (name) {
|
|
227
|
-
const results = flatmap.search(name)
|
|
191
|
+
const results = flatmap.search(name);
|
|
228
192
|
if (results.featureIds.length) {
|
|
229
|
-
let externalId = flatmap.modelForFeature(results.featureIds[0])
|
|
193
|
+
let externalId = flatmap.modelForFeature(results.featureIds[0]);
|
|
230
194
|
if (externalId) {
|
|
231
195
|
if (forceSelect) {
|
|
232
|
-
flatmap.selectFeatures(externalId)
|
|
196
|
+
flatmap.selectFeatures(externalId);
|
|
233
197
|
}
|
|
234
|
-
flatmap.zoomToFeatures(externalId)
|
|
235
|
-
} else flatmap.clearSearchResults()
|
|
198
|
+
flatmap.zoomToFeatures(externalId);
|
|
199
|
+
} else flatmap.clearSearchResults();
|
|
236
200
|
}
|
|
237
201
|
} else {
|
|
238
|
-
flatmap.clearSearchResults()
|
|
202
|
+
flatmap.clearSearchResults();
|
|
239
203
|
}
|
|
240
204
|
},
|
|
241
205
|
changeViewingMode: function (modeName) {
|
|
242
|
-
this.$refs.flatmap.changeViewingMode(modeName)
|
|
206
|
+
this.$refs.flatmap.changeViewingMode(modeName);
|
|
243
207
|
},
|
|
244
208
|
updateViewerSettings: function () {
|
|
245
|
-
const {
|
|
246
|
-
|
|
209
|
+
const {
|
|
210
|
+
backgroundDisplay,
|
|
211
|
+
viewingMode,
|
|
212
|
+
flightPathDisplay,
|
|
213
|
+
organsDisplay,
|
|
214
|
+
outlinesDisplay,
|
|
215
|
+
connectionType,
|
|
216
|
+
} = this.settingsStore.globalSettings;
|
|
247
217
|
|
|
248
|
-
const currentFlatmap = this.$refs.flatmap
|
|
218
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
249
219
|
|
|
250
|
-
currentFlatmap.changeViewingMode(viewingMode)
|
|
251
|
-
currentFlatmap.setFlightPath3D(flightPathDisplay)
|
|
252
|
-
currentFlatmap.setColour(organsDisplay)
|
|
253
|
-
currentFlatmap.setOutlines(outlinesDisplay)
|
|
254
|
-
currentFlatmap.backgroundChangeCallback(backgroundDisplay)
|
|
255
|
-
currentFlatmap.setConnectionType(connectionType)
|
|
220
|
+
currentFlatmap.changeViewingMode(viewingMode);
|
|
221
|
+
currentFlatmap.setFlightPath3D(flightPathDisplay);
|
|
222
|
+
currentFlatmap.setColour(organsDisplay);
|
|
223
|
+
currentFlatmap.setOutlines(outlinesDisplay);
|
|
224
|
+
currentFlatmap.backgroundChangeCallback(backgroundDisplay);
|
|
225
|
+
currentFlatmap.setConnectionType(connectionType);
|
|
256
226
|
},
|
|
257
227
|
setVisibilityFilter: function (payload) {
|
|
258
228
|
if (this?.alive) {
|
|
259
|
-
const currentFlatmap = this.$refs.flatmap
|
|
229
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
260
230
|
if (currentFlatmap) {
|
|
261
|
-
currentFlatmap.setVisibilityFilter(payload)
|
|
231
|
+
currentFlatmap.setVisibilityFilter(payload);
|
|
262
232
|
}
|
|
263
233
|
}
|
|
264
234
|
},
|
|
265
235
|
getKnowledgeTooltip: async function (payload) {
|
|
266
236
|
if (this?.alive) {
|
|
267
|
-
const currentFlatmap = this.$refs.flatmap
|
|
237
|
+
const currentFlatmap = this.$refs.flatmap;
|
|
268
238
|
if (currentFlatmap) {
|
|
269
239
|
// This is for expanding connectivity card
|
|
270
240
|
// The length of payload.data should always be 1
|
|
271
|
-
const data = payload.data[0]
|
|
272
|
-
currentFlatmap.searchAndShowResult(data.id, true, false)
|
|
241
|
+
const data = payload.data[0];
|
|
242
|
+
currentFlatmap.searchAndShowResult(data.id, true, false);
|
|
273
243
|
}
|
|
274
244
|
}
|
|
275
245
|
},
|
|
276
|
-
onSimulationOpen: function (simulation) {
|
|
277
|
-
EventBus.emit('simulation-open-clicked', {...simulation, requesterEntryId: this.entry.id})
|
|
278
|
-
},
|
|
279
|
-
handleClosePlotWindow: function (windowId) {
|
|
280
|
-
this.simulationPlotStore.removeWindow(windowId)
|
|
281
|
-
},
|
|
282
|
-
bringToFront: function (windowId) {
|
|
283
|
-
this.simulationPlotStore.bringToFront(windowId, this.calculateOffset())
|
|
284
|
-
},
|
|
285
|
-
calculateOffset: function () {
|
|
286
|
-
const element = this.$refs.container
|
|
287
|
-
if (!element) return
|
|
288
|
-
const rect = element.getBoundingClientRect()
|
|
289
|
-
this.top = rect.top
|
|
290
|
-
this.left = rect.left
|
|
291
|
-
},
|
|
292
|
-
onResize: function () {
|
|
293
|
-
this.calculateOffset()
|
|
294
|
-
},
|
|
295
246
|
},
|
|
296
247
|
computed: {
|
|
297
248
|
facetSpecies() {
|
|
298
|
-
return this.settingsStore.facets.species
|
|
299
|
-
},
|
|
300
|
-
plotWindows() {
|
|
301
|
-
return this.simulationPlotStore.windows.filter((win) => win.ownerId === this.entry.id)
|
|
249
|
+
return this.settingsStore.facets.species;
|
|
302
250
|
},
|
|
303
251
|
},
|
|
304
|
-
}
|
|
252
|
+
};
|
|
305
253
|
</script>
|
|
306
254
|
|
|
307
255
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
|
@@ -70,7 +70,7 @@ import DyncamicMarkerMixin from "../../mixins/DynamicMarkerMixin";
|
|
|
70
70
|
import YellowStar from "../../icons/yellowstar";
|
|
71
71
|
|
|
72
72
|
import { MultiFlatmapVuer } from "@abi-software/flatmapvuer";
|
|
73
|
-
|
|
73
|
+
import "@abi-software/flatmapvuer/dist/style.css";
|
|
74
74
|
import { HelpModeDialog } from '@abi-software/map-utilities'
|
|
75
75
|
import '@abi-software/map-utilities/dist/style.css'
|
|
76
76
|
|
|
@@ -88,6 +88,10 @@ const getOpenMapOptions = (species) => {
|
|
|
88
88
|
display: "Open 3D Human Map",
|
|
89
89
|
key: "3D"
|
|
90
90
|
},
|
|
91
|
+
{
|
|
92
|
+
display: "Open Connectivity Graph",
|
|
93
|
+
key: "CG"
|
|
94
|
+
},
|
|
91
95
|
]
|
|
92
96
|
return options;
|
|
93
97
|
}
|
|
@@ -228,9 +232,6 @@ export default {
|
|
|
228
232
|
this.speciesHasChanged = true;
|
|
229
233
|
}
|
|
230
234
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
235
|
// GA Tagging
|
|
235
236
|
// Event tracking for maps' species change
|
|
236
237
|
Tagging.sendEvent({
|
|
@@ -270,6 +271,9 @@ export default {
|
|
|
270
271
|
};
|
|
271
272
|
EventBus.emit("PopoverActionClick", returnedAction);
|
|
272
273
|
},
|
|
274
|
+
flatmapIsReady() {
|
|
275
|
+
return this.flatmapReady;
|
|
276
|
+
},
|
|
273
277
|
restoreFeaturedMarkers: function (flatmap) {
|
|
274
278
|
|
|
275
279
|
this.settingsStore.resetFeaturedMarkerIdentifier();
|
|
@@ -464,4 +468,4 @@ export default {
|
|
|
464
468
|
|
|
465
469
|
</style>
|
|
466
470
|
|
|
467
|
-
<style src="../../assets/mapicon-species-style.css"></style>
|
|
471
|
+
<style src="../../assets/mapicon-species-style.css"></style>
|
|
@@ -1,80 +1,29 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<SimulationVuer
|
|
2
|
+
<SimulationVuer
|
|
3
|
+
:apiLocation="apiLocation"
|
|
4
|
+
:id="id"
|
|
5
|
+
ref="simulation"
|
|
6
|
+
/>
|
|
3
7
|
</template>
|
|
4
8
|
|
|
5
9
|
<script>
|
|
6
10
|
/* eslint-disable no-alert, no-console */
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import '@abi-software/simulationvuer/dist/style.css'
|
|
11
|
+
import ContentMixin from "../../mixins/ContentMixin";
|
|
12
|
+
import { SimulationVuer } from "@abi-software/simulationvuer";
|
|
13
|
+
import "@abi-software/simulationvuer/dist/style.css";
|
|
11
14
|
|
|
12
15
|
export default {
|
|
13
|
-
name:
|
|
14
|
-
mixins: [ContentMixin],
|
|
16
|
+
name: "Simulation",
|
|
17
|
+
mixins: [ ContentMixin ],
|
|
15
18
|
components: {
|
|
16
19
|
SimulationVuer,
|
|
17
20
|
},
|
|
18
21
|
computed: {
|
|
19
|
-
id: function
|
|
22
|
+
id: function() {
|
|
20
23
|
//resource field is only available for simulation omex file and it will run locally.
|
|
21
24
|
//discoverId field is used for simulations running on O2SPARC.
|
|
22
|
-
return this.entry.resource ? this.entry.resource
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
handleDataNotification: function (update) {
|
|
27
|
-
EventBus.emit('simulation-response', update)
|
|
28
|
-
},
|
|
29
|
-
handleDataRequest(payload) {
|
|
30
|
-
this.processRequest(payload);
|
|
31
|
-
},
|
|
32
|
-
handleWindowClosed(payload) {
|
|
33
|
-
this.$refs.simulation?.removeDataSubscription(payload.id);
|
|
34
|
-
},
|
|
35
|
-
processRequest: function (req) {
|
|
36
|
-
// strict check against the literal type
|
|
37
|
-
if (req.id !== 'nz.ac.auckland.simulation-data-request') return
|
|
38
|
-
|
|
39
|
-
const requestMajorVersion = parseInt(req.version.split('.')[0])
|
|
40
|
-
if (requestMajorVersion !== 0) {
|
|
41
|
-
console.warn('Unsupported simulation request version:', req.version)
|
|
42
|
-
return
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (req.payload.protocol?.resource !== this.id) {
|
|
46
|
-
return
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
this.$refs.simulation?.addDataSubscription({
|
|
50
|
-
id: req.id,
|
|
51
|
-
version: req.version,
|
|
52
|
-
payload: {
|
|
53
|
-
windowId: req.payload.windowId,
|
|
54
|
-
ownerId: req.payload.ownerId,
|
|
55
|
-
component: req.payload.component,
|
|
56
|
-
variable: req.payload.variable,
|
|
57
|
-
withVOI: true,
|
|
58
|
-
},
|
|
59
|
-
})
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
mounted: function () {
|
|
63
|
-
EventBus.on('simulation-data-request', this.handleDataRequest)
|
|
64
|
-
EventBus.on('plot-window-closed', this.handleWindowClosed)
|
|
65
|
-
|
|
66
|
-
EventBus.emit('simulation-ready', {
|
|
67
|
-
resourceId: this.id,
|
|
68
|
-
ready: true,
|
|
69
|
-
})
|
|
70
|
-
},
|
|
71
|
-
beforeUnmount: function () {
|
|
72
|
-
EventBus.emit('simulation-ready', {
|
|
73
|
-
resourceId: this.id,
|
|
74
|
-
ready: false,
|
|
75
|
-
})
|
|
76
|
-
EventBus.off('simulation-data-request', this.handleDataRequest)
|
|
77
|
-
EventBus.off('plot-window-closed', this.handleWindowClosed)
|
|
78
|
-
},
|
|
79
|
-
}
|
|
25
|
+
return this.entry.resource ? this.entry.resource: this.entry.discoverId;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
80
29
|
</script>
|