@abi-software/mapintegratedvuer 1.10.1-beta.0 → 1.10.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/cypress.config.js +5 -2
- package/dist/{ContentMixin-DXXhWj3L.js → ContentMixin-BjWQ5hyW.js} +146 -134
- package/dist/{Flatmap-DTJJHOZJ.js → Flatmap-CRBl8Mce.js} +68 -76
- package/dist/{Iframe-BvIYJdxM.js → Iframe-Oiu2HnRZ.js} +2 -2
- package/dist/{MultiFlatmap-DYUAs7aa.js → MultiFlatmap-vWte5WUA.js} +70 -86
- package/dist/{Plot-B3waT3eW.js → Plot-CEBNX8B0.js} +2 -2
- package/dist/{Scaffold-D1SvYdhM.js → Scaffold-Ckfm9HCl.js} +38 -44
- package/dist/{Simulation-DEcCnsZ0.js → Simulation-DCqdDHl8.js} +2 -2
- package/dist/{index-_BTFPzpV.js → index-Dg5B_ClS.js} +6224 -6128
- package/dist/mapintegratedvuer.js +1 -1
- package/dist/mapintegratedvuer.umd.cjs +130 -130
- package/dist/{style-DqJAtv3f.js → style-B7PIw3HT.js} +1 -1
- package/dist/style.css +1 -1
- package/package.json +9 -7
- package/src/components/ContentVuer.vue +31 -0
- package/src/components/DialogToolbarContent.vue +30 -41
- package/src/components/SplitDialog.vue +110 -40
- package/src/components/SplitFlow.vue +17 -27
- package/src/components/viewers/Flatmap.vue +38 -55
- package/src/components/viewers/MultiFlatmap.vue +30 -82
- package/src/components/viewers/Scaffold.vue +6 -21
- package/src/mixins/ContentMixin.js +35 -10
- package/src/stores/settings.js +7 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abi-software/mapintegratedvuer",
|
3
|
-
"version": "1.10.1
|
3
|
+
"version": "1.10.1",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"scripts": {
|
6
6
|
"serve": "vite --host --force",
|
@@ -10,8 +10,10 @@
|
|
10
10
|
"start": "vite build && vite preview",
|
11
11
|
"test-unit": "mochapack --webpack-config test/unit/webpack.config.js --require test/unit/setup.js test/unit/**/*.spec.js",
|
12
12
|
"test": "vitest --dom",
|
13
|
+
"cypress-prepare": "node cypress/support/fileUtils.js",
|
13
14
|
"cypress": "cypress",
|
14
|
-
"cypress-
|
15
|
+
"cypress-open": "npm run cypress-prepare && cypress open",
|
16
|
+
"cypress-component": "npm run cypress-prepare && cypress run --component",
|
15
17
|
"report:merge": "mochawesome-merge cypress/results/json/*json > cypress/results/mochawesome-bundle.json",
|
16
18
|
"report:generate": "marge cypress/results/mochawesome-bundle.json -o cypress/reports/html",
|
17
19
|
"changelog": "auto-changelog -p --output CHANGELOG.md --template keepachangelog",
|
@@ -50,12 +52,12 @@
|
|
50
52
|
"*.js"
|
51
53
|
],
|
52
54
|
"dependencies": {
|
53
|
-
"@abi-software/flatmapvuer": "^1.
|
54
|
-
"@abi-software/map-side-bar": "^2.
|
55
|
-
"@abi-software/map-utilities": "^1.6.0
|
55
|
+
"@abi-software/flatmapvuer": "^1.10.0",
|
56
|
+
"@abi-software/map-side-bar": "^2.9.0",
|
57
|
+
"@abi-software/map-utilities": "^1.6.0",
|
56
58
|
"@abi-software/plotvuer": "1.0.4",
|
57
|
-
"@abi-software/scaffoldvuer": "^1.10.0
|
58
|
-
"@abi-software/simulationvuer": "^2.0.11
|
59
|
+
"@abi-software/scaffoldvuer": "^1.10.0",
|
60
|
+
"@abi-software/simulationvuer": "^2.0.11",
|
59
61
|
"@abi-software/sparc-annotation": "0.3.2",
|
60
62
|
"@abi-software/svg-sprite": "^1.0.1",
|
61
63
|
"@element-plus/icons-vue": "^2.3.1",
|
@@ -140,6 +140,37 @@ export default {
|
|
140
140
|
onResize: function () {
|
141
141
|
this.$refs.viewer?.onResize();
|
142
142
|
},
|
143
|
+
//The following handle EventBus.on from SplitDialog
|
144
|
+
onConnectivityItemClose: function() {
|
145
|
+
this.$refs.viewer?.onConnectivityItemClose();
|
146
|
+
},
|
147
|
+
onConnectivitySourceChange: function(payload) {
|
148
|
+
this.$refs.viewer?.changeConnectivitySource(payload);
|
149
|
+
},
|
150
|
+
onFlatmapMarkerUpdate: function() {
|
151
|
+
this.$refs.viewer?.flatmapMarkerUpdate();
|
152
|
+
},
|
153
|
+
onGlobalViewerSettingsUpdate: function() {
|
154
|
+
this.$refs.viewer?.updateViewerSettings();
|
155
|
+
},
|
156
|
+
onHoverUpdate: function(payload) {
|
157
|
+
this.$refs.viewer?.sidebarHoverHighlight(payload);
|
158
|
+
},
|
159
|
+
onShowConnectivity: function(payload) {
|
160
|
+
this.$refs.viewer?.showConnectivity(payload);
|
161
|
+
},
|
162
|
+
onShowConnectivityTooltips: function(payload) {
|
163
|
+
this.$refs.viewer?.showConnectivityTooltips(payload);
|
164
|
+
},
|
165
|
+
onShowReferenceConnectivity: function(payload) {
|
166
|
+
this.$refs.viewer?.showConnectivitiesByReference(payload);
|
167
|
+
},
|
168
|
+
onSidebarAnnotationClose: function() {
|
169
|
+
this.$refs.viewer?.onSidebarAnnotationClose();
|
170
|
+
},
|
171
|
+
onStartHelp: function() {
|
172
|
+
this.$refs.viewer?.startHelp();
|
173
|
+
},
|
143
174
|
},
|
144
175
|
data: function () {
|
145
176
|
return {
|
@@ -290,7 +290,7 @@
|
|
290
290
|
:virtual-ref="globalSettingRef"
|
291
291
|
ref="settingPopover"
|
292
292
|
placement="bottom"
|
293
|
-
width="
|
293
|
+
width="230"
|
294
294
|
:teleported=false
|
295
295
|
trigger="click"
|
296
296
|
popper-class="setting-popover"
|
@@ -298,6 +298,7 @@
|
|
298
298
|
:disabled="!mapLoaded"
|
299
299
|
>
|
300
300
|
<div class="setting-popover-inner">
|
301
|
+
<h4>Display options:</h4>
|
301
302
|
<!-- <div class="setting-popover-block" v-if="'displayMarkers' in globalSettings">
|
302
303
|
<el-checkbox
|
303
304
|
v-model="globalSettings.displayMarkers"
|
@@ -336,7 +337,7 @@
|
|
336
337
|
</div> -->
|
337
338
|
|
338
339
|
<div class="setting-popover-block" v-if="'flightPathDisplay' in globalSettings">
|
339
|
-
<h5>Flight path
|
340
|
+
<h5>Flight path</h5>
|
340
341
|
<el-radio-group
|
341
342
|
v-model="globalSettings.flightPathDisplay"
|
342
343
|
@change="updateGlobalSettings"
|
@@ -346,7 +347,7 @@
|
|
346
347
|
</el-radio-group>
|
347
348
|
</div>
|
348
349
|
<div class="setting-popover-block" v-if="'organsDisplay' in globalSettings">
|
349
|
-
<h5>Organs
|
350
|
+
<h5>Organs</h5>
|
350
351
|
<el-radio-group
|
351
352
|
v-model="globalSettings.organsDisplay"
|
352
353
|
@change="updateGlobalSettings"
|
@@ -356,7 +357,7 @@
|
|
356
357
|
</el-radio-group>
|
357
358
|
</div>
|
358
359
|
<div class="setting-popover-block" v-if="'outlinesDisplay' in globalSettings">
|
359
|
-
<h5>
|
360
|
+
<h5>Apply outlines</h5>
|
360
361
|
<el-radio-group
|
361
362
|
v-model="globalSettings.outlinesDisplay"
|
362
363
|
@change="updateGlobalSettings"
|
@@ -366,7 +367,7 @@
|
|
366
367
|
</el-radio-group>
|
367
368
|
</div>
|
368
369
|
<div class="setting-popover-block" v-if="'backgroundDisplay' in globalSettings">
|
369
|
-
<h5>
|
370
|
+
<h5>Background color</h5>
|
370
371
|
<el-radio-group
|
371
372
|
class="bg-color-radio-group"
|
372
373
|
v-model="globalSettings.backgroundDisplay"
|
@@ -580,24 +581,12 @@ export default {
|
|
580
581
|
EventBus.emit('modeUpdate', this.globalSettings.interactiveMode);
|
581
582
|
}
|
582
583
|
// viewing mode update
|
583
|
-
if (updatedSettings.includes('viewingMode')
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
EventBus.emit('
|
589
|
-
}
|
590
|
-
// organs display update
|
591
|
-
if (updatedSettings.includes('organsDisplay')) {
|
592
|
-
EventBus.emit('organsDisplayUpdate', this.globalSettings.organsDisplay);
|
593
|
-
}
|
594
|
-
// outlines display update
|
595
|
-
if (updatedSettings.includes('outlinesDisplay')) {
|
596
|
-
EventBus.emit('outlinesDisplayUpdate', this.globalSettings.outlinesDisplay);
|
597
|
-
}
|
598
|
-
// background display update
|
599
|
-
if (updatedSettings.includes('backgroundDisplay')) {
|
600
|
-
EventBus.emit('backgroundDisplayUpdate', this.globalSettings.backgroundDisplay);
|
584
|
+
if (updatedSettings.includes('viewingMode') ||
|
585
|
+
updatedSettings.includes('flightPathDisplay') ||
|
586
|
+
updatedSettings.includes('organsDisplay') ||
|
587
|
+
updatedSettings.includes('outlinesDisplay') ||
|
588
|
+
updatedSettings.includes('backgroundDisplay')) {
|
589
|
+
EventBus.emit('globalViewerSettingsUpdate');
|
601
590
|
}
|
602
591
|
},
|
603
592
|
titleClicked: function(id) {
|
@@ -806,7 +795,7 @@ export default {
|
|
806
795
|
}
|
807
796
|
|
808
797
|
:deep(.setting-popover.el-popper) {
|
809
|
-
min-width:
|
798
|
+
min-width: 230px !important;
|
810
799
|
}
|
811
800
|
|
812
801
|
.viewing-mode-selector {
|
@@ -906,31 +895,28 @@ export default {
|
|
906
895
|
}
|
907
896
|
|
908
897
|
.setting-popover-inner {
|
909
|
-
padding:
|
898
|
+
padding: 0.5rem 0.75rem;
|
910
899
|
max-height: calc(100vh - 135px);
|
911
900
|
overflow-y: auto;
|
912
901
|
border-radius: var(--el-popover-border-radius);
|
913
902
|
scrollbar-width: thin;
|
914
903
|
display: flex;
|
915
904
|
flex-direction: column;
|
916
|
-
gap:
|
905
|
+
gap: 0.5rem;
|
906
|
+
|
907
|
+
> h4 {
|
908
|
+
margin: 0;
|
909
|
+
padding: 0;
|
910
|
+
font-size: 16px;
|
911
|
+
color: $app-primary-color;
|
912
|
+
text-align: center;
|
913
|
+
}
|
917
914
|
}
|
918
915
|
|
919
916
|
.setting-popover-block {
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
&:before {
|
924
|
-
content: "";
|
925
|
-
display: block;
|
926
|
-
width: 100%;
|
927
|
-
height: 0;
|
928
|
-
border-top: 1px solid var(--el-border-color);
|
929
|
-
position: absolute;
|
930
|
-
top: -0.5rem;
|
931
|
-
left: 0;
|
932
|
-
}
|
933
|
-
}
|
917
|
+
background-color: rgba(0, 0, 0, 0.05);
|
918
|
+
padding: 0.5rem 0.75rem;
|
919
|
+
border-radius: 4px;
|
934
920
|
|
935
921
|
h5 {
|
936
922
|
margin: 0;
|
@@ -938,6 +924,7 @@ export default {
|
|
938
924
|
font-size: 14px;
|
939
925
|
font-weight: 500;
|
940
926
|
line-height: 32px;
|
927
|
+
color: #303133;
|
941
928
|
}
|
942
929
|
}
|
943
930
|
|
@@ -979,7 +966,9 @@ export default {
|
|
979
966
|
}
|
980
967
|
|
981
968
|
.bg-color-radio-group {
|
969
|
+
display: flex;
|
982
970
|
gap: 0.5rem;
|
971
|
+
margin-top: 0.25rem;
|
983
972
|
|
984
973
|
.el-radio {
|
985
974
|
margin-right: 0;
|
@@ -1000,7 +989,7 @@ export default {
|
|
1000
989
|
padding: 4px;
|
1001
990
|
|
1002
991
|
> span {
|
1003
|
-
display:
|
992
|
+
display: block;
|
1004
993
|
width: 20px;
|
1005
994
|
height: 20px;
|
1006
995
|
background-color: var(--bg-color);
|
@@ -236,7 +236,7 @@ export default {
|
|
236
236
|
}
|
237
237
|
},
|
238
238
|
getSearchedId: function (flatmap, term) {
|
239
|
-
|
239
|
+
const ids = [];
|
240
240
|
const searchResult = flatmap.mapImp.search(term);
|
241
241
|
const featureIds = searchResult.__featureIds || searchResult.featureIds;
|
242
242
|
featureIds.forEach((id) => {
|
@@ -259,7 +259,8 @@ export default {
|
|
259
259
|
},
|
260
260
|
connectivityQueryFilter: async function (data) {
|
261
261
|
const activeContents = this.getActiveContents();
|
262
|
-
|
262
|
+
const searchOrders = [], searchHighlights = [], searchResults = [];
|
263
|
+
let processed = false;
|
263
264
|
|
264
265
|
for (const activeContent of activeContents) {
|
265
266
|
const viewer = activeContent.$refs.viewer;
|
@@ -283,59 +284,66 @@ export default {
|
|
283
284
|
const uniqueFilterSources = this.connectivitiesStore.getUniqueFilterSourcesByKeys;
|
284
285
|
if (currentFlatmap && currentFlatmap.$el.checkVisibility()) {
|
285
286
|
let results = this.connectivitiesStore.getUniqueConnectivitiesByKeys;
|
287
|
+
|
288
|
+
const filters = {};
|
289
|
+
let queryIds = [], facetIds = [];
|
286
290
|
if (data) {
|
287
291
|
this.query = data.query;
|
288
|
-
|
292
|
+
// get query search result ids and order
|
293
|
+
if (data.query) {
|
294
|
+
const searchTerms = this.query
|
295
|
+
.replace(/["']/g, "")
|
296
|
+
.split(",")
|
297
|
+
.map(term => term.trim())
|
298
|
+
.filter(term => term);
|
299
|
+
const nestedIds = [];
|
300
|
+
for (let index = 0; index < searchTerms.length; index++) {
|
301
|
+
nestedIds.push(this.getSearchedId(currentFlatmap, searchTerms[index]));
|
302
|
+
}
|
303
|
+
// within query search (split terms by comma) -> OR
|
304
|
+
const flatIds = [...new Set(nestedIds.flat())];
|
305
|
+
searchOrders.push(...flatIds);
|
306
|
+
queryIds = await currentFlatmap.retrieveConnectedPaths(flatIds);
|
307
|
+
}
|
308
|
+
|
309
|
+
// get facet search result ids
|
289
310
|
data.filter.forEach((item) => {
|
290
311
|
const facetKey = item.facetPropPath.split('.').pop();;
|
291
|
-
if (!(facetKey in filters)) {
|
292
|
-
filters[facetKey] = [];
|
293
|
-
}
|
294
312
|
const matchedFilter = uniqueFilters.find(filter => filter.key.includes(facetKey));
|
295
313
|
if (matchedFilter) {
|
296
314
|
matchedFilter.children.forEach((child) => {
|
297
315
|
if (child.label === item.facet && child.key) {
|
298
316
|
const childKey = child.key.split('.').pop();
|
299
|
-
filters
|
317
|
+
if (!(facetKey in filters)) {
|
318
|
+
filters[facetKey] = [];
|
319
|
+
}
|
320
|
+
// within facet search category -> OR
|
321
|
+
filters[facetKey].push(...uniqueFilterSources[facetKey][childKey]);
|
300
322
|
}
|
301
323
|
});
|
302
324
|
}
|
303
325
|
});
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
// within AND
|
309
|
-
value.forEach((v) => valueToIds.push(...uniqueFilterSources[key][v]));
|
310
|
-
ids.push(valueToIds);
|
311
|
-
}
|
312
|
-
}
|
313
|
-
// between AND
|
314
|
-
this.filter = ids.length ?
|
315
|
-
[...new Set(ids.reduce((acc, curr) => acc.filter(id => curr.includes(id))))] :
|
326
|
+
this.filter = Object.values(filters);
|
327
|
+
// between facet search categories -> AND
|
328
|
+
facetIds = this.filter.length ?
|
329
|
+
this.filter.reduce((acc, curr) => acc.filter(id => curr.includes(id))) :
|
316
330
|
[];
|
317
|
-
if (data.type === "query-update") {
|
318
|
-
this.query = data.value;
|
319
|
-
} else if (data.type === "filter-update") {
|
320
|
-
this.filter = data.value;
|
321
|
-
}
|
322
331
|
}
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
const paths = await currentFlatmap.retrieveConnectedPaths(ids, options);
|
333
|
-
searchHighlights.push(...paths);
|
334
|
-
results = results.filter((item) => paths.includes(item.id));
|
332
|
+
|
333
|
+
let target;
|
334
|
+
if (this.query && !this.filter.length) { // pure query search
|
335
|
+
target = queryIds;
|
336
|
+
} else if (!this.query && this.filter.length) { // pure facet search
|
337
|
+
target = facetIds;
|
338
|
+
} else if (this.query && this.filter.length) { // combined query and facet search
|
339
|
+
// between query search and facet search -> AND
|
340
|
+
target = queryIds.filter(id => facetIds.includes(id));
|
335
341
|
}
|
336
|
-
|
337
|
-
|
338
|
-
|
342
|
+
// This can be empty array due to the AND operation
|
343
|
+
if (target) {
|
344
|
+
searchHighlights.push(...target);
|
345
|
+
results = results.filter((item) => target.includes(item.id));
|
346
|
+
processed = true;
|
339
347
|
}
|
340
348
|
searchResults.push(...results);
|
341
349
|
}
|
@@ -355,8 +363,9 @@ export default {
|
|
355
363
|
];
|
356
364
|
|
357
365
|
const connectivitiesPayload = {
|
358
|
-
highlight: uniqueHighlights,
|
359
366
|
data: uniqueResults,
|
367
|
+
highlight: uniqueHighlights,
|
368
|
+
processed: processed
|
360
369
|
};
|
361
370
|
|
362
371
|
EventBus.emit("connectivity-knowledge", connectivitiesPayload);
|
@@ -421,6 +430,67 @@ export default {
|
|
421
430
|
EventBus.on("connectivity-query-filter", (payload) => {
|
422
431
|
this.connectivityQueryFilter(payload);
|
423
432
|
});
|
433
|
+
//The followings are migrated from ContentVuer and its child components to here
|
434
|
+
EventBus.on("hoverUpdate", (payload) => {
|
435
|
+
const contents = this.getActiveContents();
|
436
|
+
contents.forEach((content) => {
|
437
|
+
content.onHoverUpdate(payload);
|
438
|
+
});
|
439
|
+
});
|
440
|
+
EventBus.on("startHelp", () => {
|
441
|
+
const contents = this.getActiveContents();
|
442
|
+
contents.forEach((content) => {
|
443
|
+
content.onStartHelp();
|
444
|
+
});
|
445
|
+
});
|
446
|
+
EventBus.on('connectivity-item-close', () => {
|
447
|
+
const contents = this.getActiveContents();
|
448
|
+
contents.forEach((content) => {
|
449
|
+
content.onConnectivityItemClose();
|
450
|
+
});
|
451
|
+
});
|
452
|
+
EventBus.on('sidebar-annotation-close', () => {
|
453
|
+
const contents = this.getActiveContents();
|
454
|
+
contents.forEach((content) => {
|
455
|
+
content.onSidebarAnnotationClose();
|
456
|
+
});
|
457
|
+
});
|
458
|
+
EventBus.on('globalViewerSettingsUpdate', () => {
|
459
|
+
const contents = this.$refs['content'];
|
460
|
+
contents.forEach((content) => {
|
461
|
+
content.onGlobalViewerSettingsUpdate();
|
462
|
+
});
|
463
|
+
});
|
464
|
+
EventBus.on("markerUpdate", () => {
|
465
|
+
const contents = this.$refs['content'];
|
466
|
+
contents.forEach((content) => {
|
467
|
+
content.onFlatmapMarkerUpdate();
|
468
|
+
});
|
469
|
+
});
|
470
|
+
EventBus.on('connectivity-hovered', (payload) => {
|
471
|
+
const contents = this.getActiveContents();
|
472
|
+
contents.forEach((content) => {
|
473
|
+
content.onShowConnectivityTooltips(payload);
|
474
|
+
});
|
475
|
+
});
|
476
|
+
EventBus.on('connectivity-source-change', (payload) => {
|
477
|
+
const contents = this.getActiveContents();
|
478
|
+
contents.forEach((content) => {
|
479
|
+
content.onConnectivitySourceChange(payload);
|
480
|
+
});
|
481
|
+
});
|
482
|
+
EventBus.on('show-connectivity', (payload) => {
|
483
|
+
const contents = this.getActiveContents();
|
484
|
+
contents.forEach((content) => {
|
485
|
+
content.onShowConnectivity(payload);
|
486
|
+
});
|
487
|
+
});
|
488
|
+
EventBus.on('show-reference-connectivities', (payload) => {
|
489
|
+
const contents = this.getActiveContents();
|
490
|
+
contents.forEach((content) => {
|
491
|
+
content.onShowReferenceConnectivity(payload);
|
492
|
+
});
|
493
|
+
});
|
424
494
|
},
|
425
495
|
};
|
426
496
|
</script>
|
@@ -131,6 +131,7 @@ export default {
|
|
131
131
|
confirmDeleteCallback: undefined,
|
132
132
|
confirmCommentCallback: undefined,
|
133
133
|
createData: {},
|
134
|
+
connectivitySearch: false,
|
134
135
|
connectivityHighlight: [],
|
135
136
|
connectivityKnowledge: [],
|
136
137
|
connectivityExplorerClicked: [], // to support multi views
|
@@ -353,7 +354,7 @@ export default {
|
|
353
354
|
hoverConnectivity = data.models ? [data.models] : this.annotationHighlight;
|
354
355
|
}
|
355
356
|
this.settingsStore.updateHoverFeatures(hoverAnatomies, hoverOrgans, hoverDOI, hoverConnectivity);
|
356
|
-
EventBus.emit("hoverUpdate");
|
357
|
+
EventBus.emit("hoverUpdate", { connectivitySearch: this.connectivitySearch });
|
357
358
|
},
|
358
359
|
searchChanged: function (data) {
|
359
360
|
if (data.tabType === 'dataset') {
|
@@ -493,8 +494,13 @@ export default {
|
|
493
494
|
setState: function (state) {
|
494
495
|
this.entriesStore.setAll(state.entries);
|
495
496
|
//Support both old and new permalink.
|
496
|
-
if (state.splitFlow)
|
497
|
-
|
497
|
+
if (state.splitFlow) {
|
498
|
+
this.splitFlowStore.setState(state.splitFlow);
|
499
|
+
}
|
500
|
+
else {
|
501
|
+
this.entries.forEach(entry => this.splitFlowStore.setIdToPrimaryPane(entry.id));
|
502
|
+
}
|
503
|
+
this.updateGlobalSettingsFromState(state);
|
498
504
|
},
|
499
505
|
getState: function (anonymousAnnotations = false) {
|
500
506
|
let state = JSON.parse(JSON.stringify(this.entriesStore.$state));
|
@@ -519,6 +525,7 @@ export default {
|
|
519
525
|
}
|
520
526
|
}
|
521
527
|
state.splitFlow = this.splitFlowStore.getState();
|
528
|
+
state.globalSettings = this.settingsStore.getGlobalSettings();
|
522
529
|
return state;
|
523
530
|
},
|
524
531
|
removeEntry: function (id) {
|
@@ -616,7 +623,9 @@ export default {
|
|
616
623
|
this.$refs.dialogToolbar.loadGlobalSettings();
|
617
624
|
},
|
618
625
|
onSidebarTabClosed: function (tab) {
|
619
|
-
if (tab.id === 3 && tab.type === "annotation")
|
626
|
+
if (tab.id === 3 && tab.type === "annotation") {
|
627
|
+
EventBus.emit('sidebar-annotation-close');
|
628
|
+
}
|
620
629
|
},
|
621
630
|
updateGlobalSettingsFromStorage: function () {
|
622
631
|
const globalSettingsFromStorage = localStorage.getItem('mapviewer.globalSettings');
|
@@ -625,28 +634,8 @@ export default {
|
|
625
634
|
}
|
626
635
|
},
|
627
636
|
updateGlobalSettingsFromState: function (state) {
|
628
|
-
|
629
|
-
|
630
|
-
if (entry.state?.state) {
|
631
|
-
const {
|
632
|
-
background,
|
633
|
-
colour,
|
634
|
-
flightPath3D,
|
635
|
-
outlines,
|
636
|
-
viewingMode
|
637
|
-
} = entry.state.state;
|
638
|
-
|
639
|
-
mappedSettings = {
|
640
|
-
viewingMode: viewingMode,
|
641
|
-
flightPathDisplay: flightPath3D,
|
642
|
-
organsDisplay: colour,
|
643
|
-
outlinesDisplay: outlines,
|
644
|
-
backgroundDisplay: background,
|
645
|
-
};
|
646
|
-
}
|
647
|
-
})
|
648
|
-
if (mappedSettings) {
|
649
|
-
this.settingsStore.updateGlobalSettings(mappedSettings);
|
637
|
+
if (state?.globalSettings) {
|
638
|
+
this.settingsStore.updateGlobalSettings(state.globalSettings);
|
650
639
|
}
|
651
640
|
},
|
652
641
|
},
|
@@ -690,7 +679,7 @@ export default {
|
|
690
679
|
this.$refs.sideBar.setDrawerOpen(true);
|
691
680
|
}
|
692
681
|
});
|
693
|
-
EventBus.on('annotation-close', () => {
|
682
|
+
EventBus.on('sidebar-annotation-close', () => {
|
694
683
|
const globalSettings = { ...this.settingsStore.globalSettings };
|
695
684
|
const { interactiveMode, viewingMode } = globalSettings;
|
696
685
|
|
@@ -766,6 +755,7 @@ export default {
|
|
766
755
|
EventBus.on("connectivity-knowledge", payload => {
|
767
756
|
this.connectivityKnowledge = payload.data;
|
768
757
|
this.connectivityHighlight = payload.highlight || [];
|
758
|
+
this.connectivitySearch = payload.processed;
|
769
759
|
})
|
770
760
|
EventBus.on("modeUpdate", payload => {
|
771
761
|
if (payload === "dataset") {
|
@@ -70,6 +70,11 @@ export default {
|
|
70
70
|
FlatmapVuer,
|
71
71
|
HelpModeDialog,
|
72
72
|
},
|
73
|
+
data: function () {
|
74
|
+
return {
|
75
|
+
flatmapReady: false,
|
76
|
+
}
|
77
|
+
},
|
73
78
|
methods: {
|
74
79
|
getState: function () {
|
75
80
|
return this.$refs.flatmap.getState();
|
@@ -105,12 +110,13 @@ export default {
|
|
105
110
|
}
|
106
111
|
},
|
107
112
|
flatmapReadyCall: function (flatmap) {
|
113
|
+
this.flatmapReady = true;
|
108
114
|
let provClone = {id: this.entry.id, prov: this.getFlatmapImp().provenance}; //create clone of provenance and add id
|
109
115
|
const flatmapImp = flatmap.mapImp;
|
110
116
|
EventBus.emit("mapImpProv", provClone); // send clone to context card
|
111
117
|
this.$emit("flatmap-provenance-ready", provClone);
|
112
118
|
this.flatmapReadyForMarkerUpdates(flatmap);
|
113
|
-
this.
|
119
|
+
this.updateViewerSettings();
|
114
120
|
this.loadConnectivityExplorerConfig(flatmap);
|
115
121
|
EventBus.emit("mapLoaded", flatmap);
|
116
122
|
},
|
@@ -125,6 +131,14 @@ export default {
|
|
125
131
|
'location': selectionsTitle
|
126
132
|
});
|
127
133
|
},
|
134
|
+
onSidebarAnnotationClose: function() {
|
135
|
+
if (this.flatmapReady) {
|
136
|
+
const currentFlatmap = this.$refs.flatmap;
|
137
|
+
if (currentFlatmap) {
|
138
|
+
this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
|
139
|
+
}
|
140
|
+
}
|
141
|
+
},
|
128
142
|
highlightFeatures: function(info) {
|
129
143
|
let name = info.name;
|
130
144
|
const flatmap = this.$refs.flatmap.mapImp;
|
@@ -151,6 +165,26 @@ export default {
|
|
151
165
|
});
|
152
166
|
}
|
153
167
|
},
|
168
|
+
showConnectivity: function (payload) {
|
169
|
+
if (this?.alive) {
|
170
|
+
const { featureIds, offset } = payload;
|
171
|
+
const currentFlatmap = this.$refs.flatmap;
|
172
|
+
if (currentFlatmap) {
|
173
|
+
currentFlatmap.moveMap(featureIds, {
|
174
|
+
offsetX: offset ? -150 : 0,
|
175
|
+
zoom: 4,
|
176
|
+
});
|
177
|
+
}
|
178
|
+
}
|
179
|
+
},
|
180
|
+
showConnectivitiesByReference: function (payload) {
|
181
|
+
if (this?.alive) {
|
182
|
+
const currentFlatmap = this.$refs.flatmap;
|
183
|
+
if (currentFlatmap) {
|
184
|
+
currentFlatmap.showConnectivitiesByReference(payload);
|
185
|
+
}
|
186
|
+
}
|
187
|
+
},
|
154
188
|
zoomToFeatures: function(info, forceSelect) {
|
155
189
|
let name = info.name;
|
156
190
|
const flatmap = this.$refs.flatmap.mapImp;
|
@@ -172,13 +206,13 @@ export default {
|
|
172
206
|
changeViewingMode: function (modeName) {
|
173
207
|
this.$refs.flatmap.changeViewingMode(modeName);
|
174
208
|
},
|
175
|
-
|
209
|
+
updateViewerSettings: function () {
|
176
210
|
const {
|
177
211
|
backgroundDisplay,
|
178
212
|
viewingMode,
|
179
213
|
flightPathDisplay,
|
180
214
|
organsDisplay,
|
181
|
-
|
215
|
+
outlinesDisplay,
|
182
216
|
} = this.settingsStore.globalSettings;
|
183
217
|
|
184
218
|
const currentFlatmap = this.$refs.flatmap;
|
@@ -186,7 +220,7 @@ export default {
|
|
186
220
|
currentFlatmap.changeViewingMode(viewingMode);
|
187
221
|
currentFlatmap.setFlightPath3D(flightPathDisplay);
|
188
222
|
currentFlatmap.setColour(organsDisplay);
|
189
|
-
currentFlatmap.setOutlines(
|
223
|
+
currentFlatmap.setOutlines(outlinesDisplay);
|
190
224
|
currentFlatmap.backgroundChangeCallback(backgroundDisplay);
|
191
225
|
},
|
192
226
|
},
|
@@ -195,57 +229,6 @@ export default {
|
|
195
229
|
return this.settingsStore.facets.species;
|
196
230
|
},
|
197
231
|
},
|
198
|
-
mounted: function() {
|
199
|
-
EventBus.on('annotation-close', () => {
|
200
|
-
if (this?.alive) {
|
201
|
-
const currentFlatmap = this.$refs.flatmap;
|
202
|
-
if (currentFlatmap) {
|
203
|
-
this.$refs.flatmap.annotationEventCallback({}, { type: 'aborted' })
|
204
|
-
}
|
205
|
-
}
|
206
|
-
});
|
207
|
-
EventBus.on("markerUpdate", () => {
|
208
|
-
if (this?.alive) this.flatmapMarkerUpdate(undefined);
|
209
|
-
});
|
210
|
-
EventBus.on("hoverUpdate", () => {
|
211
|
-
if (this?.alive) this.cardHoverHighlight();
|
212
|
-
});
|
213
|
-
EventBus.on('viewingModeUpdate', (payload) => {
|
214
|
-
if (this?.alive) this.$refs.flatmap.changeViewingMode(payload);
|
215
|
-
});
|
216
|
-
EventBus.on('flightPathUpdate', (payload) => {
|
217
|
-
if (this?.alive) this.$refs.flatmap.setFlightPath3D(payload);
|
218
|
-
});
|
219
|
-
EventBus.on('organsDisplayUpdate', (payload) => {
|
220
|
-
if (this?.alive) this.$refs.flatmap.setColour(payload);
|
221
|
-
});
|
222
|
-
EventBus.on('outlinesDisplayUpdate', (payload) => {
|
223
|
-
if (this?.alive) this.$refs.flatmap.setOutlines(payload);
|
224
|
-
});
|
225
|
-
EventBus.on('backgroundDisplayUpdate', (payload) => {
|
226
|
-
if (this?.alive) this.$refs.flatmap.backgroundChangeCallback(payload);
|
227
|
-
});
|
228
|
-
EventBus.on('show-connectivity', (payload) => {
|
229
|
-
if (this?.alive) {
|
230
|
-
const { featureIds, offset } = payload;
|
231
|
-
const currentFlatmap = this.$refs.flatmap;
|
232
|
-
if (currentFlatmap) {
|
233
|
-
currentFlatmap.moveMap(featureIds, {
|
234
|
-
offsetX: offset ? -150 : 0,
|
235
|
-
zoom: 4,
|
236
|
-
});
|
237
|
-
}
|
238
|
-
}
|
239
|
-
});
|
240
|
-
EventBus.on('show-reference-connectivities', (payload) => {
|
241
|
-
if (this?.alive) {
|
242
|
-
const currentFlatmap = this.$refs.flatmap;
|
243
|
-
if (currentFlatmap) {
|
244
|
-
currentFlatmap.showConnectivitiesByReference(payload);
|
245
|
-
}
|
246
|
-
}
|
247
|
-
});
|
248
|
-
},
|
249
232
|
};
|
250
233
|
</script>
|
251
234
|
|