@abi-software/mapintegratedvuer 1.23.0 → 1.24.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-Cao0C1-G.js → ConnectivityGraph-CCxk8vcE.js} +6 -6
- package/dist/{ContentMixin-4t04VWoF.js → ContentMixin-Db8nqZax.js} +295 -240
- package/dist/{DynamicMarkerMixin-tATj70ym.js → DynamicMarkerMixin-LB2RYdSY.js} +1 -1
- package/dist/{Flatmap-DF4FAwLY.js → Flatmap-CqUzOkdl.js} +5 -5
- package/dist/{Iframe-DbQ22y53.js → Iframe-I-xdZ2FP.js} +2 -2
- package/dist/{MultiFlatmap-Dwy9gbWC.js → MultiFlatmap-11L97ycJ.js} +6 -6
- package/dist/{Plot-COXE_H78.js → Plot-Bd9RqyVD.js} +2 -2
- package/dist/{Scaffold-9ubjNzcD.js → Scaffold-CySWXQxI.js} +46 -36
- package/dist/{Simulation-CR-yKjxu.js → Simulation-ChUbGudZ.js} +2 -2
- package/dist/{connectivities-DhBMlBSj.js → connectivities-LtlFwLOp.js} +6399 -5790
- package/dist/es-D-YkSGXX.js +436 -0
- package/dist/mapintegratedvuer.js +12994 -11652
- package/dist/mapintegratedvuer.umd.cjs +191 -190
- package/dist/style.css +1 -1
- package/package.json +4 -4
- package/src/assets/header-icon.scss +9 -3
- package/src/components/ContentBar.vue +172 -92
- package/src/components/ContentVuer.vue +41 -1
- package/src/components/DialogToolbarContent.vue +45 -4
- package/src/components/EventBus.js +8 -0
- package/src/components/MapContent.vue +77 -31
- package/src/components/ResizeSensor.vue +7 -9
- package/src/components/ScreenshotPopover.vue +526 -0
- package/src/components/SplitDialog.vue +94 -93
- package/src/components/SplitFlow.vue +158 -96
- package/src/components/scripts/utilities.js +56 -1
- package/src/components/viewers/Flatmap.vue +1 -0
- package/src/components/viewers/MultiFlatmap.vue +3 -0
- package/src/components/viewers/Scaffold.vue +25 -13
- package/src/components.d.ts +2 -0
- package/src/mixins/ContentMixin.js +23 -10
- package/src/services/screenshot.js +1186 -0
- package/src/stores/connectivities.js +38 -5
- package/src/stores/settings.js +18 -0
|
@@ -57,6 +57,7 @@
|
|
|
57
57
|
import { markRaw } from 'vue';
|
|
58
58
|
import EventBus from '../EventBus';
|
|
59
59
|
import ContentMixin from '../../mixins/ContentMixin';
|
|
60
|
+
import { snapshotThreeRenderer } from '../../services/screenshot.js';
|
|
60
61
|
|
|
61
62
|
import { ScaffoldVuer } from '@abi-software/scaffoldvuer';
|
|
62
63
|
import '@abi-software/scaffoldvuer/dist/style.css';
|
|
@@ -150,7 +151,10 @@ export default {
|
|
|
150
151
|
// Both EventBus.emit and getKnowledgeTooltip will trigger sidebar content update
|
|
151
152
|
// Then setVisibilityFilter will be called to zoom to the clicked nerve.
|
|
152
153
|
if (resource.length === 1) {
|
|
153
|
-
|
|
154
|
+
// Keep only the fields needed here; resource data carries the live
|
|
155
|
+
// zincObject, which should not be made reactive or retained.
|
|
156
|
+
const { id, isNerves, anatomicalId } = resource[0].data;
|
|
157
|
+
this.clickedObject = { id, isNerves, anatomicalId };
|
|
154
158
|
if (this.clickedObject.isNerves || this.clickedObject.anatomicalId) {
|
|
155
159
|
const label = this.clickedObject.id.toLowerCase();
|
|
156
160
|
if (this.$refs.scaffold.viewingMode === 'Neuron Connection') {
|
|
@@ -245,6 +249,11 @@ export default {
|
|
|
245
249
|
this.scaffoldCamera.onResize();
|
|
246
250
|
}
|
|
247
251
|
},
|
|
252
|
+
getScreenshotSources: async function (pixelRatio) {
|
|
253
|
+
const zincRenderer = this.$refs.scaffold?.$module?.zincRenderer;
|
|
254
|
+
if (!zincRenderer) return [];
|
|
255
|
+
return [snapshotThreeRenderer(zincRenderer, pixelRatio)];
|
|
256
|
+
},
|
|
248
257
|
getState: function () {
|
|
249
258
|
if (this.$refs.scaffold) {
|
|
250
259
|
return this.$refs.scaffold.getState();
|
|
@@ -297,6 +306,7 @@ export default {
|
|
|
297
306
|
},
|
|
298
307
|
scaffoldIsReady: function () {
|
|
299
308
|
this.scaffoldLoaded = true;
|
|
309
|
+
this.$emit('viewer-ready', true);
|
|
300
310
|
this.$refs.scaffold.$module.graphicsHighlight.highlightColour = [1, 0, 1];
|
|
301
311
|
if (!this.scaffoldRef) {
|
|
302
312
|
this.scaffoldRef = markRaw(this.$refs.scaffold);
|
|
@@ -309,7 +319,7 @@ export default {
|
|
|
309
319
|
}
|
|
310
320
|
this.updateViewerSettings();
|
|
311
321
|
EventBus.emit('mapLoaded', this.$refs.scaffold);
|
|
312
|
-
setTimeout(() => {
|
|
322
|
+
this._greyScaleTimer = setTimeout(() => {
|
|
313
323
|
this.setNerveGreyScale();
|
|
314
324
|
}, 500);
|
|
315
325
|
},
|
|
@@ -383,6 +393,9 @@ export default {
|
|
|
383
393
|
? this.settingsStore.numberOfDatasetsForFacets
|
|
384
394
|
: {};
|
|
385
395
|
},
|
|
396
|
+
scaffoldKnowledge: function () {
|
|
397
|
+
return this.connectivityKnowledge?.[this.entry.resource];
|
|
398
|
+
},
|
|
386
399
|
},
|
|
387
400
|
watch: {
|
|
388
401
|
visible: {
|
|
@@ -403,23 +416,19 @@ export default {
|
|
|
403
416
|
});
|
|
404
417
|
}
|
|
405
418
|
},
|
|
406
|
-
deep: true,
|
|
407
419
|
immediate: true,
|
|
408
420
|
},
|
|
409
|
-
|
|
410
|
-
|
|
421
|
+
// Knowledge entries are replaced so a shallow watch on this scaffold's entry is sufficient
|
|
422
|
+
scaffoldKnowledge: {
|
|
423
|
+
handler(scaffoldKnowledge) {
|
|
411
424
|
// Store scaffold knowledge locally
|
|
412
|
-
if (this.
|
|
413
|
-
|
|
414
|
-
if (
|
|
415
|
-
this.
|
|
416
|
-
if (this.scaffoldLoaded) {
|
|
417
|
-
this.setNerveGreyScale();
|
|
418
|
-
}
|
|
425
|
+
if (scaffoldKnowledge && scaffoldKnowledge.length !== this.nervesKnowledge.length) {
|
|
426
|
+
this.nervesKnowledge = scaffoldKnowledge;
|
|
427
|
+
if (this.scaffoldLoaded) {
|
|
428
|
+
this.setNerveGreyScale();
|
|
419
429
|
}
|
|
420
430
|
}
|
|
421
431
|
},
|
|
422
|
-
deep: true,
|
|
423
432
|
immediate: true,
|
|
424
433
|
},
|
|
425
434
|
},
|
|
@@ -435,6 +444,9 @@ export default {
|
|
|
435
444
|
query: '',
|
|
436
445
|
};
|
|
437
446
|
},
|
|
447
|
+
beforeUnmount: function () {
|
|
448
|
+
clearTimeout(this._greyScaleTimer);
|
|
449
|
+
},
|
|
438
450
|
};
|
|
439
451
|
</script>
|
|
440
452
|
|
package/src/components.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ declare module 'vue' {
|
|
|
34
34
|
ElIcon: typeof import('element-plus/es')['ElIcon']
|
|
35
35
|
ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
|
|
36
36
|
ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
|
|
37
|
+
ElIconCamera: typeof import('@element-plus/icons-vue')['Camera']
|
|
37
38
|
ElIconCompass: typeof import('@element-plus/icons-vue')['Compass']
|
|
38
39
|
ElIconEditPen: typeof import('@element-plus/icons-vue')['EditPen']
|
|
39
40
|
ElIconMoreFilled: typeof import('@element-plus/icons-vue')['MoreFilled']
|
|
@@ -57,6 +58,7 @@ declare module 'vue' {
|
|
|
57
58
|
RouterLink: typeof import('vue-router')['RouterLink']
|
|
58
59
|
RouterView: typeof import('vue-router')['RouterView']
|
|
59
60
|
Scaffold: typeof import('./components/viewers/Scaffold.vue')['default']
|
|
61
|
+
ScreenshotPopover: typeof import('./components/ScreenshotPopover.vue')['default']
|
|
60
62
|
SearchControls: typeof import('./components/SearchControls.vue')['default']
|
|
61
63
|
Simulation: typeof import('./components/viewers/Simulation.vue')['default']
|
|
62
64
|
SplitDialog: typeof import('./components/SplitDialog.vue')['default']
|
|
@@ -6,6 +6,7 @@ import { useSettingsStore } from '../stores/settings';
|
|
|
6
6
|
import { useSplitFlowStore } from '../stores/splitFlow';
|
|
7
7
|
import { useConnectivitiesStore } from '../stores/connectivities';
|
|
8
8
|
import Tagging from '../services/tagging.js';
|
|
9
|
+
import { snapshotMaplibre } from '../services/screenshot.js';
|
|
9
10
|
|
|
10
11
|
import { getFlatmapFilterOptions } from '@abi-software/map-utilities';
|
|
11
12
|
import { FlatmapQueries } from '@abi-software/flatmapvuer/src/services/flatmapQueries.js';
|
|
@@ -17,14 +18,18 @@ import {
|
|
|
17
18
|
getTermNerveMaps,
|
|
18
19
|
getFilterOptions as getScaffoldFilterOptions,
|
|
19
20
|
} from '@abi-software/scaffoldvuer/src/scripts/MappedNerves.js';
|
|
20
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
defaultSpecies,
|
|
23
|
+
getLatestFlatmap,
|
|
24
|
+
getFlatmapPathways,
|
|
25
|
+
} from '../components/scripts/utilities.js';
|
|
21
26
|
|
|
22
27
|
function capitalise(text) {
|
|
23
28
|
return text[0].toUpperCase() + text.substring(1);
|
|
24
29
|
}
|
|
25
30
|
|
|
26
31
|
export default {
|
|
27
|
-
emits: ['flatmap-provenance-ready', 'resource-selected', 'species-changed'],
|
|
32
|
+
emits: ['flatmap-provenance-ready', 'resource-selected', 'species-changed', 'viewer-ready'],
|
|
28
33
|
props: {
|
|
29
34
|
/**
|
|
30
35
|
* Object containing information for
|
|
@@ -78,6 +83,8 @@ export default {
|
|
|
78
83
|
},
|
|
79
84
|
beforeUnmount: function () {
|
|
80
85
|
this.alive = false;
|
|
86
|
+
window.removeEventListener('mousedown', this.checkEndHelpMouseDown);
|
|
87
|
+
clearTimeout(this.highlightDelay);
|
|
81
88
|
},
|
|
82
89
|
mounted: function () {
|
|
83
90
|
if (this.$refs.multiflatmap) {
|
|
@@ -139,6 +146,17 @@ export default {
|
|
|
139
146
|
getState: function () {
|
|
140
147
|
return undefined;
|
|
141
148
|
},
|
|
149
|
+
/**
|
|
150
|
+
* Return snapshots of WebGL canvases rendered at `pixelRatio`,
|
|
151
|
+
* used by the screenshot service. Defaults to the flatmap canvas.
|
|
152
|
+
*/
|
|
153
|
+
getScreenshotSources: async function (pixelRatio) {
|
|
154
|
+
const map = this.getFlatmapImp?.()?.map;
|
|
155
|
+
if (map) {
|
|
156
|
+
return [await snapshotMaplibre(map, pixelRatio)];
|
|
157
|
+
}
|
|
158
|
+
return [];
|
|
159
|
+
},
|
|
142
160
|
openMap: function (type) {
|
|
143
161
|
EventBus.emit('OpenNewMap', type);
|
|
144
162
|
this.trackOpenMap(`open_new_${type}_map`);
|
|
@@ -612,19 +630,14 @@ export default {
|
|
|
612
630
|
return;
|
|
613
631
|
},
|
|
614
632
|
loadExplorerConfig: async function () {
|
|
615
|
-
this.flatmapService = await this.mockUpFlatmapService();
|
|
633
|
+
this.flatmapService = markRaw(await this.mockUpFlatmapService());
|
|
616
634
|
this.loadConnectivityExplorerConfig(this.flatmapService);
|
|
617
635
|
},
|
|
618
636
|
mockUpFlatmapService: async function () {
|
|
619
|
-
const
|
|
620
|
-
const flatmapJson = await flatmapResponse.json();
|
|
621
|
-
const latestFlatmap = flatmapJson
|
|
622
|
-
.filter((f) => f.id === 'human-flatmap_male')
|
|
623
|
-
.sort((a, b) => b.created.localeCompare(a.created))[0];
|
|
637
|
+
const latestFlatmap = await getLatestFlatmap(this.flatmapAPI, 'human-flatmap_male');
|
|
624
638
|
const flatmapUuid = latestFlatmap.uuid;
|
|
625
639
|
const flatmapSource = latestFlatmap.sckan['knowledge-source'];
|
|
626
|
-
const
|
|
627
|
-
const pathwaysJson = await pathwaysResponse.json();
|
|
640
|
+
const pathwaysJson = await getFlatmapPathways(this.flatmapAPI, flatmapUuid);
|
|
628
641
|
|
|
629
642
|
this.flatmapQueries = markRaw(new FlatmapQueries());
|
|
630
643
|
this.flatmapQueries.initialise(this.flatmapAPI);
|