@abi-software/mapintegratedvuer 1.9.0-externalise.1 → 1.9.1
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/{ContentMixin-DuzUGOr7.js → ContentMixin-c9DvlJVP.js} +247 -266
- package/dist/{Flatmap-Jg0vHppG.js → Flatmap-D66Ygegj.js} +67 -64
- package/dist/{Iframe-CqziSD47.js → Iframe-DFAzMMSw.js} +2 -2
- package/dist/{MultiFlatmap-DNzWD23i.js → MultiFlatmap-BOOSKitQ.js} +14 -14
- package/dist/{Plot-CsgxeskY.js → Plot-DPxSQnwg.js} +2 -2
- package/dist/Scaffold-DRQEE-j_.js +43337 -0
- package/dist/{Simulation-dnK_Gz6i.js → Simulation-BVcaSVmW.js} +2 -2
- package/dist/{index-DXbdAVdH.js → index-qckfB1dl.js} +23336 -21809
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +6059 -226
- package/dist/style-C6pIyWak.js +104700 -0
- package/dist/style.css +1 -1
- package/package.json +7 -7
- package/src/components/ContentVuer.vue +3 -2
- package/src/components/DialogToolbarContent.vue +24 -35
- package/src/components/SplitDialog.vue +80 -2
- package/src/components/SplitFlow.vue +22 -11
- package/src/components/viewers/Flatmap.vue +11 -3
- package/src/components/viewers/MultiFlatmap.vue +2 -1
- package/src/components.d.ts +1 -0
- package/src/mixins/ContentMixin.js +82 -42
- package/src/stores/connectivities.js +35 -0
- package/src/stores/entries.js +8 -1
- package/src/stores/splitFlow.js +14 -7
- package/vite.bundle-build.js +2 -5
- package/dist/Scaffold-D8WQMKgt.js +0 -180
- package/dist/style-D2AYtXeS.js +0 -66
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abi-software/mapintegratedvuer",
|
3
|
-
"version": "1.9.
|
3
|
+
"version": "1.9.1",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vite --host --force",
|
@@ -50,12 +50,12 @@
|
|
50
50
|
"*.js"
|
51
51
|
],
|
52
52
|
"dependencies": {
|
53
|
-
"@abi-software/flatmapvuer": "^1.9.
|
54
|
-
"@abi-software/map-side-bar": "^2.
|
55
|
-
"@abi-software/map-utilities": "^1.5.0
|
56
|
-
"@abi-software/plotvuer": "
|
57
|
-
"@abi-software/scaffoldvuer": "^1.9.0
|
58
|
-
"@abi-software/simulationvuer": "1.0.
|
53
|
+
"@abi-software/flatmapvuer": "^1.9.1",
|
54
|
+
"@abi-software/map-side-bar": "^2.8.1",
|
55
|
+
"@abi-software/map-utilities": "^1.5.0",
|
56
|
+
"@abi-software/plotvuer": "1.0.4",
|
57
|
+
"@abi-software/scaffoldvuer": "^1.9.0",
|
58
|
+
"@abi-software/simulationvuer": "1.0.2",
|
59
59
|
"@abi-software/sparc-annotation": "0.3.2",
|
60
60
|
"@abi-software/svg-sprite": "^1.0.1",
|
61
61
|
"@element-plus/icons-vue": "^2.3.1",
|
@@ -28,7 +28,7 @@
|
|
28
28
|
:visible="visible"
|
29
29
|
:lazy="true"
|
30
30
|
ref="viewer"
|
31
|
-
@flatmap-provenance-ready="
|
31
|
+
@flatmap-provenance-ready="flatmapProvenanceReady"
|
32
32
|
@resource-selected="resourceSelected"
|
33
33
|
@species-changed="speciesChanged"
|
34
34
|
/>
|
@@ -78,8 +78,9 @@ export default {
|
|
78
78
|
Simulation,
|
79
79
|
},
|
80
80
|
methods: {
|
81
|
-
|
81
|
+
flatmapProvenanceReady: function(prov) {
|
82
82
|
this.$refs.contentBar?.setupFlatmapContextCard(prov);
|
83
|
+
this.entriesStore.updateMapForEntry(this.entry, prov);
|
83
84
|
},
|
84
85
|
/**
|
85
86
|
* Toggle sync mode on/off depending on species and current state
|
@@ -113,46 +113,32 @@
|
|
113
113
|
>
|
114
114
|
<template v-if="displayShareOptions">
|
115
115
|
<el-row>
|
116
|
-
<el-col :span="8">
|
117
|
-
<el-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
116
|
+
<el-col :offset="3" :span="8">
|
117
|
+
<el-button
|
118
|
+
type="primary"
|
119
|
+
size="small"
|
120
|
+
@click="getShareLink(exportAnnotation)"
|
121
|
+
class="share-options"
|
122
122
|
>
|
123
|
-
|
124
|
-
|
125
|
-
type="primary"
|
126
|
-
size="small"
|
127
|
-
@click="getShareLink(false)"
|
128
|
-
class="share-options"
|
129
|
-
>
|
130
|
-
Settings Only
|
131
|
-
</el-button>
|
132
|
-
</template>
|
133
|
-
</el-popover>
|
123
|
+
Create Permalink
|
124
|
+
</el-button>
|
134
125
|
</el-col>
|
135
|
-
<el-col :span="
|
126
|
+
<el-col :span="10">
|
136
127
|
<el-popover class="tooltip"
|
137
128
|
placement="bottom-end"
|
138
129
|
:show-after="helpDelay" :teleported=false trigger="hover"
|
139
130
|
popper-class="header-popper"
|
140
131
|
>
|
141
132
|
<template #reference>
|
142
|
-
<el-
|
143
|
-
|
133
|
+
<el-checkbox
|
134
|
+
v-model="exportAnnotation"
|
144
135
|
size="small"
|
145
|
-
@click="getShareLink(true)"
|
146
|
-
class="share-options"
|
147
136
|
>
|
148
|
-
|
149
|
-
|
150
|
-
</el-button>
|
137
|
+
Export Annotations
|
138
|
+
</el-checkbox>
|
151
139
|
</template>
|
152
140
|
<template #default>
|
153
|
-
Create a
|
154
|
-
<br>
|
155
|
-
and anonymous annotations.
|
141
|
+
Create a permalink with anonymous annotations.
|
156
142
|
<br>
|
157
143
|
NOTE: Annotations will only be stored for
|
158
144
|
<br>
|
@@ -286,6 +272,7 @@ import {
|
|
286
272
|
} from '@element-plus/icons-vue';
|
287
273
|
import {
|
288
274
|
ElButton as Button,
|
275
|
+
ElCheckbox as Checkbox,
|
289
276
|
ElCol as Col,
|
290
277
|
ElIcon as Icon,
|
291
278
|
ElInput as Input,
|
@@ -303,6 +290,7 @@ export default {
|
|
303
290
|
name: "DialogToolbarContent",
|
304
291
|
components: {
|
305
292
|
Button,
|
293
|
+
Checkbox,
|
306
294
|
Col,
|
307
295
|
Icon,
|
308
296
|
Input,
|
@@ -371,16 +359,17 @@ export default {
|
|
371
359
|
},
|
372
360
|
data: function() {
|
373
361
|
return {
|
374
|
-
isFullscreen: false,
|
375
|
-
loadingLink: true,
|
376
|
-
displayShareOptions: false,
|
377
|
-
independent: true,
|
378
|
-
failedSearch: undefined,
|
379
362
|
activeViewRef: undefined,
|
380
|
-
|
381
|
-
globalSettingRef: undefined,
|
363
|
+
displayShareOptions: false,
|
382
364
|
ElIconCopyDocument: shallowRef(ElIconCopyDocument),
|
365
|
+
exportAnnotation: false,
|
366
|
+
failedSearch: undefined,
|
383
367
|
globalSettings: {},
|
368
|
+
globalSettingRef: undefined,
|
369
|
+
independent: true,
|
370
|
+
isFullscreen: false,
|
371
|
+
loadingLink: true,
|
372
|
+
permalinkRef: undefined,
|
384
373
|
}
|
385
374
|
},
|
386
375
|
methods: {
|
@@ -30,6 +30,7 @@ import CustomSplitter from "./CustomSplitter.vue";
|
|
30
30
|
import EventBus from './EventBus';
|
31
31
|
import { mapStores } from 'pinia';
|
32
32
|
import { useSplitFlowStore } from '../stores/splitFlow';
|
33
|
+
import { useConnectivitiesStore } from '../stores/connectivities';
|
33
34
|
|
34
35
|
export default {
|
35
36
|
name: "SplitDialog",
|
@@ -157,13 +158,87 @@ export default {
|
|
157
158
|
});
|
158
159
|
}
|
159
160
|
this.__userResize__ = false;
|
160
|
-
}
|
161
|
+
},
|
162
|
+
onSpeciesLayoutConnectivityUpdate: function () {
|
163
|
+
let activePaneIDs = [];
|
164
|
+
let availablePaneIDs = [];
|
165
|
+
let combinedConnectivities = [];
|
166
|
+
let sckanVersion = '';
|
167
|
+
let uuid = '';
|
168
|
+
|
169
|
+
for (const key in this.customLayout) {
|
170
|
+
if (this.customLayout[key].id) {
|
171
|
+
availablePaneIDs.push(this.customLayout[key].id);
|
172
|
+
}
|
173
|
+
}
|
174
|
+
|
175
|
+
switch (this.activeView) {
|
176
|
+
case 'singlepanel': {
|
177
|
+
activePaneIDs = availablePaneIDs.slice(0, 1);
|
178
|
+
} break;
|
179
|
+
case '2horpanel':
|
180
|
+
case '2vertpanel': {
|
181
|
+
activePaneIDs = availablePaneIDs.slice(0, 2);
|
182
|
+
} break;
|
183
|
+
case '3panel': {
|
184
|
+
activePaneIDs = availablePaneIDs.slice(0, 3);
|
185
|
+
} break;
|
186
|
+
case '4panel': {
|
187
|
+
activePaneIDs = availablePaneIDs.slice(0, 4);
|
188
|
+
} break;
|
189
|
+
case '5panel': {
|
190
|
+
activePaneIDs = availablePaneIDs.slice(0, 5);
|
191
|
+
} break;
|
192
|
+
case '6panelVertical':
|
193
|
+
case '6panel': {
|
194
|
+
activePaneIDs = availablePaneIDs.slice(0, 6);
|
195
|
+
} break;
|
196
|
+
default:
|
197
|
+
break;
|
198
|
+
}
|
199
|
+
|
200
|
+
const uuids = Array.from(
|
201
|
+
new Set(
|
202
|
+
this.entries
|
203
|
+
.filter(entry => activePaneIDs.includes(entry.id) && entry.uuid)
|
204
|
+
.map(entry => entry.uuid)
|
205
|
+
)
|
206
|
+
);
|
207
|
+
|
208
|
+
this.entries.forEach((entry) => {
|
209
|
+
if (entry.sckanVersion in this.connectivitiesStore.globalConnectivities) {
|
210
|
+
sckanVersion = entry.sckanVersion;
|
211
|
+
}
|
212
|
+
});
|
213
|
+
|
214
|
+
// mix connectivites of available maps
|
215
|
+
if (uuids.length) {
|
216
|
+
this.connectivitiesStore.updateActiveConnectivityKeys(uuids);
|
217
|
+
const uniqueConnectivities = this.connectivitiesStore.getUniqueConnectivitiesByKeys;
|
218
|
+
|
219
|
+
EventBus.emit("connectivity-knowledge", {
|
220
|
+
data: uniqueConnectivities
|
221
|
+
});
|
222
|
+
} else {
|
223
|
+
if (sckanVersion) {
|
224
|
+
EventBus.emit("connectivity-knowledge", {
|
225
|
+
data: this.connectivitiesStore.globalConnectivities[sckanVersion]
|
226
|
+
});
|
227
|
+
this.connectivitiesStore.updateActiveConnectivityKeys([sckanVersion]);
|
228
|
+
} else {
|
229
|
+
console.warn(`There has no connectivity to show!`);
|
230
|
+
}
|
231
|
+
}
|
232
|
+
},
|
161
233
|
},
|
162
234
|
computed: {
|
163
|
-
...mapStores(useSplitFlowStore),
|
235
|
+
...mapStores(useSplitFlowStore, useConnectivitiesStore),
|
164
236
|
activeView: function() {
|
165
237
|
return this.splitFlowStore.activeView;
|
166
238
|
},
|
239
|
+
customLayout: function() {
|
240
|
+
return this.splitFlowStore.customLayout;
|
241
|
+
},
|
167
242
|
horizontal() {
|
168
243
|
if (this.splitFlowStore.activeView === "2horpanel") {
|
169
244
|
return true;
|
@@ -209,6 +284,9 @@ export default {
|
|
209
284
|
EventBus.on("PaneUnmounted", payload => {
|
210
285
|
this.hidePane(payload.refName);
|
211
286
|
});
|
287
|
+
EventBus.on('species-layout-connectivity-update', () => {
|
288
|
+
this.onSpeciesLayoutConnectivityUpdate();
|
289
|
+
})
|
212
290
|
},
|
213
291
|
};
|
214
292
|
</script>
|
@@ -130,7 +130,7 @@ export default {
|
|
130
130
|
createData: {},
|
131
131
|
connectivityHighlight: [],
|
132
132
|
connectivityKnowledge: [],
|
133
|
-
connectivityExplorerClicked:
|
133
|
+
connectivityExplorerClicked: [], // to support multi views
|
134
134
|
}
|
135
135
|
},
|
136
136
|
watch: {
|
@@ -146,8 +146,7 @@ export default {
|
|
146
146
|
},
|
147
147
|
methods: {
|
148
148
|
onConnectivityExplorerClicked: function (payload) {
|
149
|
-
this.
|
150
|
-
this.onDisplaySearch({ term: payload.id }, false);
|
149
|
+
this.onDisplaySearch({ term: payload.id }, false, true);
|
151
150
|
},
|
152
151
|
/**
|
153
152
|
* Callback when an action is performed (open new dialogs).
|
@@ -249,13 +248,16 @@ export default {
|
|
249
248
|
'file_path': filePath,
|
250
249
|
});
|
251
250
|
},
|
252
|
-
onDisplaySearch: function (payload, tracking = true) {
|
251
|
+
onDisplaySearch: function (payload, tracking = true, connectivityExplorerClicked = false) {
|
253
252
|
let searchFound = false;
|
254
253
|
//Search all active viewers when global callback is on
|
255
254
|
let splitdialog = this.$refs.splitdialog;
|
256
255
|
if (splitdialog) {
|
257
256
|
const activeContents = splitdialog.getActiveContents();
|
258
257
|
activeContents.forEach(content => {
|
258
|
+
if (connectivityExplorerClicked) {
|
259
|
+
this.connectivityExplorerClicked.push(true);
|
260
|
+
}
|
259
261
|
if (content.search(payload.term)) {
|
260
262
|
searchFound = true;
|
261
263
|
}
|
@@ -314,7 +316,7 @@ export default {
|
|
314
316
|
EventBus.emit('connectivity-hovered', data);
|
315
317
|
},
|
316
318
|
onConnectivitySourceChange: function (data) {
|
317
|
-
this.connectivityExplorerClicked
|
319
|
+
this.connectivityExplorerClicked.push(true);
|
318
320
|
EventBus.emit('connectivity-source-change', data);
|
319
321
|
},
|
320
322
|
hoverChanged: function (data) {
|
@@ -511,8 +513,12 @@ export default {
|
|
511
513
|
speciesChanged: function (species) {
|
512
514
|
if (this.$refs.sideBar) {
|
513
515
|
// Use to update the connectivity when switch species
|
514
|
-
|
515
|
-
this.$
|
516
|
+
// Wait for provenance info with uuid update
|
517
|
+
this.$nextTick(() => {
|
518
|
+
// EventBus.emit("connectivity-query-filter");
|
519
|
+
EventBus.emit('species-layout-connectivity-update');
|
520
|
+
this.$refs.sideBar.close();
|
521
|
+
})
|
516
522
|
}
|
517
523
|
},
|
518
524
|
toggleSyncMode: function (payload) {
|
@@ -632,7 +638,7 @@ export default {
|
|
632
638
|
this.connectivityEntry = payload;
|
633
639
|
// click on the flatmap paths/features directly
|
634
640
|
// or onDisplaySearch is performed
|
635
|
-
if (!this.connectivityExplorerClicked) {
|
641
|
+
if (!this.connectivityExplorerClicked.length) {
|
636
642
|
this.connectivityKnowledge = payload.map((entry) => {
|
637
643
|
return { label: entry.title, id: entry.featureId[0], detailsReady: entry.ready }
|
638
644
|
});
|
@@ -645,11 +651,16 @@ export default {
|
|
645
651
|
this.$refs.sideBar.setDrawerOpen(true);
|
646
652
|
}
|
647
653
|
}
|
648
|
-
this.connectivityExplorerClicked
|
654
|
+
this.connectivityExplorerClicked.pop();
|
655
|
+
});
|
656
|
+
EventBus.on('connectivity-info-close', payload => {
|
657
|
+
if (this.$refs.sideBar) {
|
658
|
+
this.$refs.sideBar.resetConnectivitySearch();
|
659
|
+
}
|
649
660
|
});
|
650
|
-
EventBus.on('connectivity-
|
661
|
+
EventBus.on('connectivity-error', payload => {
|
651
662
|
if (this.$refs.sideBar) {
|
652
|
-
this.$refs.sideBar.
|
663
|
+
this.$refs.sideBar.updateConnectivityError(payload.data);
|
653
664
|
}
|
654
665
|
});
|
655
666
|
EventBus.on("OpenNewMap", type => {
|
@@ -20,8 +20,8 @@
|
|
20
20
|
@annotation-close="onAnnotationClose"
|
21
21
|
:annotationSidebar="annotationSidebar"
|
22
22
|
@connectivity-info-open="onConnectivityInfoOpen"
|
23
|
-
@connectivity-
|
24
|
-
|
23
|
+
@connectivity-error="onConnectivityError"
|
24
|
+
@connectivity-info-close="onConnectivityInfoClose"
|
25
25
|
:pathControls="true"
|
26
26
|
ref="flatmap"
|
27
27
|
@ready="flatmapReadyCall"
|
@@ -74,7 +74,7 @@ export default {
|
|
74
74
|
* Perform a local search on this contentvuer
|
75
75
|
*/
|
76
76
|
search: function (term) {
|
77
|
-
return this.$refs.flatmap.searchAndShowResult(term);
|
77
|
+
return this.$refs.flatmap.searchAndShowResult(term, true);
|
78
78
|
},
|
79
79
|
getFlatmapImp() {
|
80
80
|
return this.$refs.flatmap?.mapImp;
|
@@ -102,9 +102,11 @@ export default {
|
|
102
102
|
},
|
103
103
|
flatmapReadyCall: function (flatmap) {
|
104
104
|
let provClone = {id: this.entry.id, prov: this.getFlatmapImp().provenance}; //create clone of provenance and add id
|
105
|
+
const flatmapImp = flatmap.mapImp;
|
105
106
|
EventBus.emit("mapImpProv", provClone); // send clone to context card
|
106
107
|
this.$emit("flatmap-provenance-ready", provClone);
|
107
108
|
this.flatmapReadyForMarkerUpdates(flatmap);
|
109
|
+
this.loadConnectivityKnowledge(flatmapImp);
|
108
110
|
EventBus.emit("mapLoaded", flatmap);
|
109
111
|
},
|
110
112
|
onPathwaySelectionChanged: function (data) {
|
@@ -200,6 +202,12 @@ export default {
|
|
200
202
|
currentFlatmap.showConnectivitiesByReference(payload);
|
201
203
|
}
|
202
204
|
});
|
205
|
+
EventBus.on("connectivity-query-filter", (payload) => {
|
206
|
+
const currentFlatmap = this.$refs.flatmap;
|
207
|
+
if (currentFlatmap && currentFlatmap.mapImp) {
|
208
|
+
this.connectivityQueryFilter(currentFlatmap, payload)
|
209
|
+
}
|
210
|
+
});
|
203
211
|
},
|
204
212
|
};
|
205
213
|
</script>
|
@@ -19,7 +19,8 @@
|
|
19
19
|
@annotation-close="onAnnotationClose"
|
20
20
|
:annotationSidebar="annotationSidebar"
|
21
21
|
@connectivity-info-open="onConnectivityInfoOpen"
|
22
|
-
@connectivity-
|
22
|
+
@connectivity-error="onConnectivityError"
|
23
|
+
@connectivity-info-close="onConnectivityInfoClose"
|
23
24
|
:connectivityInfoSidebar="connectivityInfoSidebar"
|
24
25
|
ref="multiflatmap"
|
25
26
|
:displayMinimap="true"
|
package/src/components.d.ts
CHANGED
@@ -16,6 +16,7 @@ declare module 'vue' {
|
|
16
16
|
DialogToolbarContent: typeof import('./components/DialogToolbarContent.vue')['default']
|
17
17
|
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
|
18
18
|
ElButton: typeof import('element-plus/es')['ElButton']
|
19
|
+
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
19
20
|
ElCol: typeof import('element-plus/es')['ElCol']
|
20
21
|
ElContainer: typeof import('element-plus/es')['ElContainer']
|
21
22
|
ElHeader: typeof import('element-plus/es')['ElHeader']
|
@@ -7,6 +7,7 @@ import EventBus from "../components/EventBus";
|
|
7
7
|
import { mapStores } from 'pinia';
|
8
8
|
import { useSettingsStore } from '../stores/settings';
|
9
9
|
import { useSplitFlowStore } from '../stores/splitFlow';
|
10
|
+
import { useConnectivitiesStore } from '../stores/connectivities';
|
10
11
|
import Tagging from '../services/tagging.js';
|
11
12
|
|
12
13
|
import { FlatmapQueries } from "@abi-software/flatmapvuer/src/services/flatmapQueries.js";
|
@@ -35,7 +36,7 @@ export default {
|
|
35
36
|
},
|
36
37
|
},
|
37
38
|
computed: {
|
38
|
-
...mapStores(useSettingsStore, useSplitFlowStore),
|
39
|
+
...mapStores(useSettingsStore, useSplitFlowStore, useConnectivitiesStore),
|
39
40
|
idNamePair() {
|
40
41
|
return this.splitFlowStore.idNamePair;
|
41
42
|
},
|
@@ -60,6 +61,7 @@ export default {
|
|
60
61
|
this.multiflatmapRef = this.$refs.multiflatmap;
|
61
62
|
this.flatmapRef = this.$refs.flatmap;
|
62
63
|
this.scaffoldRef = this.$refs.scaffold;
|
64
|
+
this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
|
63
65
|
},
|
64
66
|
methods: {
|
65
67
|
toggleSyncMode: function () {
|
@@ -521,6 +523,18 @@ export default {
|
|
521
523
|
flatmap.zoomToFeatures(paths);
|
522
524
|
} catch (error) {
|
523
525
|
console.log(error)
|
526
|
+
// only for connectivity hover highlight
|
527
|
+
if (hoverConnectivity.length && flatmap.mapImp) {
|
528
|
+
const uuid = flatmap.mapImp.uuid;
|
529
|
+
const found = paths.every((path) =>
|
530
|
+
this.connectivityKnowledge[uuid].some((connectivity) =>
|
531
|
+
connectivity.id === path
|
532
|
+
)
|
533
|
+
);
|
534
|
+
if (!found) {
|
535
|
+
flatmap.mapImp.clearSearchResults();
|
536
|
+
}
|
537
|
+
}
|
524
538
|
}
|
525
539
|
});
|
526
540
|
} else if (this.scaffoldRef && scaffold) {
|
@@ -539,25 +553,49 @@ export default {
|
|
539
553
|
onConnectivityInfoOpen: function (connectivityInfoData) {
|
540
554
|
EventBus.emit('connectivity-info-open', connectivityInfoData);
|
541
555
|
},
|
542
|
-
|
543
|
-
EventBus.emit('connectivity-
|
556
|
+
onConnectivityError: function (errorInfo) {
|
557
|
+
EventBus.emit('connectivity-error', errorInfo);
|
544
558
|
},
|
545
|
-
|
546
|
-
|
559
|
+
onConnectivityInfoClose: function () {
|
560
|
+
EventBus.emit('connectivity-info-close');
|
561
|
+
},
|
562
|
+
loadConnectivityKnowledge: async function (flatmapImp) {
|
563
|
+
const sckanVersion = getKnowledgeSource(flatmapImp);
|
547
564
|
const flatmapQueries = markRaw(new FlatmapQueries());
|
548
565
|
flatmapQueries.initialise(this.flatmapAPI);
|
549
|
-
const knowledge = await loadAndStoreKnowledge(
|
550
|
-
const uuid =
|
551
|
-
const mapPathsData = await flatmapQueries.queryMapPaths(uuid);
|
552
|
-
const pathsFromMap = mapPathsData ? mapPathsData.paths : {};
|
566
|
+
const knowledge = await loadAndStoreKnowledge(flatmapImp, flatmapQueries);
|
567
|
+
const uuid = flatmapImp.uuid;
|
553
568
|
|
554
|
-
this.connectivityKnowledge[
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
569
|
+
if (!this.connectivityKnowledge[sckanVersion]) {
|
570
|
+
this.connectivityKnowledge[sckanVersion] = knowledge
|
571
|
+
.filter((item) => {
|
572
|
+
return (
|
573
|
+
item.source === sckanVersion &&
|
574
|
+
item.connectivity?.length
|
575
|
+
);
|
576
|
+
})
|
577
|
+
.sort((a, b) => a.label.localeCompare(b.label));
|
578
|
+
}
|
579
|
+
|
580
|
+
if (!this.connectivitiesStore.globalConnectivities[uuid]) {
|
581
|
+
const mapPathsData = await flatmapQueries.queryMapPaths(uuid);
|
582
|
+
const pathsFromMap = mapPathsData ? mapPathsData.paths : {};
|
583
|
+
|
584
|
+
this.connectivityKnowledge[uuid] = knowledge
|
585
|
+
.filter((item) => {
|
586
|
+
return (
|
587
|
+
item.source === sckanVersion &&
|
588
|
+
item.connectivity?.length &&
|
589
|
+
item.id in pathsFromMap
|
590
|
+
);
|
591
|
+
})
|
592
|
+
.sort((a, b) => a.label.localeCompare(b.label));
|
593
|
+
}
|
594
|
+
|
595
|
+
this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge);
|
596
|
+
|
597
|
+
// EventBus.emit("connectivity-knowledge", { data: this.connectivityKnowledge[uuid] });
|
598
|
+
EventBus.emit('species-layout-connectivity-update');
|
561
599
|
},
|
562
600
|
getSearchedId: function (flatmap, term) {
|
563
601
|
let ids = [];
|
@@ -575,35 +613,37 @@ export default {
|
|
575
613
|
return ids;
|
576
614
|
},
|
577
615
|
connectivityQueryFilter: async function (flatmap, data) {
|
578
|
-
const
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
616
|
+
const uniqueConnectivities = this.connectivitiesStore.getUniqueConnectivitiesByKeys;
|
617
|
+
// only for those flatmaps that are shown on the split screen
|
618
|
+
if (flatmap.$el.checkVisibility()) {
|
619
|
+
let payload = {
|
620
|
+
state: "default",
|
621
|
+
data: [...uniqueConnectivities],
|
622
|
+
};
|
623
|
+
if (data) {
|
624
|
+
if (data.type === "query-update") {
|
625
|
+
if (this.query !== data.value) this.target = [];
|
626
|
+
this.query = data.value;
|
627
|
+
} else if (data.type === "filter-update") {
|
628
|
+
this.filter = data.value;
|
629
|
+
}
|
589
630
|
}
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
631
|
+
if (this.query) {
|
632
|
+
payload.state = "processed";
|
633
|
+
let prom1 = [], options = {};
|
634
|
+
const searchTerms = this.query.split(",").map((term) => term.trim());
|
635
|
+
for (let index = 0; index < searchTerms.length; index++) {
|
636
|
+
prom1.push(this.getSearchedId(flatmap, searchTerms[index]));
|
637
|
+
}
|
638
|
+
const nestedIds = await Promise.all(prom1);
|
639
|
+
const ids = [...new Set(nestedIds.flat())];
|
640
|
+
let paths = await flatmap.retrieveConnectedPaths(ids, options);
|
641
|
+
paths = [...ids, ...paths.filter((path) => !ids.includes(path))];
|
642
|
+
let results = uniqueConnectivities.filter((item) => paths.includes(item.id));
|
643
|
+
payload.data = results;
|
597
644
|
}
|
598
|
-
|
599
|
-
const ids = [...new Set(nestedIds.flat())];
|
600
|
-
let paths = await flatmap.retrieveConnectedPaths(ids, options);
|
601
|
-
paths = [...ids, ...paths.filter((path) => !ids.includes(path))];
|
602
|
-
let results = this.connectivityKnowledge[uuid].filter((item) => paths.includes(item.id));
|
603
|
-
results.sort((a, b) => paths.indexOf(a.id) - paths.indexOf(b.id));
|
604
|
-
payload.data = results;
|
645
|
+
EventBus.emit("connectivity-knowledge", payload);
|
605
646
|
}
|
606
|
-
EventBus.emit("connectivity-knowledge", payload);
|
607
647
|
}
|
608
648
|
},
|
609
649
|
data: function () {
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import { defineStore } from 'pinia';
|
2
|
+
|
3
|
+
export const useConnectivitiesStore = defineStore('connectivities', {
|
4
|
+
state: () => {
|
5
|
+
return {
|
6
|
+
globalConnectivities: {},
|
7
|
+
activeConnectivityKeys: [],
|
8
|
+
}
|
9
|
+
},
|
10
|
+
getters: {
|
11
|
+
getUniqueConnectivitiesByKeys: (state) => {
|
12
|
+
let combinedConnectivities = [];
|
13
|
+
state.activeConnectivityKeys.forEach((uuid) => {
|
14
|
+
if (uuid in state.globalConnectivities) {
|
15
|
+
const connectivity = state.globalConnectivities[uuid];
|
16
|
+
combinedConnectivities.push(...connectivity);
|
17
|
+
}
|
18
|
+
});
|
19
|
+
|
20
|
+
const uniqueConnectivities = Array.from(
|
21
|
+
new Map(combinedConnectivities.map((item) => [item.id, item])).values()
|
22
|
+
);
|
23
|
+
|
24
|
+
return uniqueConnectivities;
|
25
|
+
},
|
26
|
+
},
|
27
|
+
actions: {
|
28
|
+
updateGlobalConnectivities(globalConnectivities) {
|
29
|
+
this.globalConnectivities = globalConnectivities;
|
30
|
+
},
|
31
|
+
updateActiveConnectivityKeys(activeConnectivityKeys) {
|
32
|
+
this.activeConnectivityKeys = activeConnectivityKeys;
|
33
|
+
},
|
34
|
+
}
|
35
|
+
});
|
package/src/stores/entries.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import { defineStore } from 'pinia';
|
2
2
|
import { initialDefaultState } from "../components/scripts/utilities";
|
3
|
+
import { getKnowledgeSourceFromProvenance } from '@abi-software/flatmapvuer/src/services/flatmapKnowledge.js';
|
3
4
|
|
4
5
|
/* eslint-disable no-alert, no-console */
|
5
6
|
|
@@ -35,6 +36,12 @@ export const useEntriesStore = defineStore('entries', {
|
|
35
36
|
const entry = this.entries.find(entry => entry.id === id);
|
36
37
|
entry.viewUrl = viewUrl;
|
37
38
|
},
|
38
|
-
|
39
|
+
updateMapForEntry(entry, prov) {
|
40
|
+
if (entry.id === prov.id) {
|
41
|
+
const sckanVersion = getKnowledgeSourceFromProvenance(prov.prov);
|
42
|
+
entry['uuid'] = prov.prov.uuid;
|
43
|
+
entry['sckanVersion'] = sckanVersion;
|
44
|
+
}
|
45
|
+
},
|
39
46
|
}
|
40
47
|
});
|