@abi-software/mapintegratedvuer 1.23.0 → 1.24.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/{ConnectivityGraph-Cao0C1-G.js → ConnectivityGraph-Cye6QvZR.js} +6 -6
- package/dist/{ContentMixin-4t04VWoF.js → ContentMixin-SBI5HTPO.js} +295 -244
- package/dist/{DynamicMarkerMixin-tATj70ym.js → DynamicMarkerMixin-LB2RYdSY.js} +1 -1
- package/dist/{Flatmap-DF4FAwLY.js → Flatmap-TcOqOyD5.js} +5 -5
- package/dist/{Iframe-DbQ22y53.js → Iframe-D-Eq3G6T.js} +2 -2
- package/dist/{MultiFlatmap-Dwy9gbWC.js → MultiFlatmap-C122IUmB.js} +6 -6
- package/dist/{Plot-COXE_H78.js → Plot-DTv-vd63.js} +2 -2
- package/dist/{Scaffold-9ubjNzcD.js → Scaffold-B2g3O1xF.js} +46 -36
- package/dist/{Simulation-CR-yKjxu.js → Simulation-ClMZ5HHt.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 +32 -21
- package/src/services/screenshot.js +1186 -0
- package/src/stores/connectivities.js +38 -5
- package/src/stores/settings.js +18 -0
|
@@ -1,6 +1,23 @@
|
|
|
1
|
+
import { markRaw, toRaw } from 'vue';
|
|
1
2
|
import { defineStore } from 'pinia';
|
|
2
3
|
import { listsAreEqual } from '../components/scripts/utilities';
|
|
3
4
|
|
|
5
|
+
// Structural equality with JSON.stringify semantics (undefined properties are
|
|
6
|
+
// ignored), without serialising the whole knowledge base into strings.
|
|
7
|
+
function isJsonEqual(a, b) {
|
|
8
|
+
if (a === b) return true;
|
|
9
|
+
if (typeof a !== 'object' || typeof b !== 'object' || a === null || b === null) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
if (Array.isArray(a) !== Array.isArray(b)) return false;
|
|
13
|
+
if (Array.isArray(a)) {
|
|
14
|
+
return a.length === b.length && a.every((value, index) => isJsonEqual(value, b[index]));
|
|
15
|
+
}
|
|
16
|
+
const keysA = Object.keys(a).filter((key) => a[key] !== undefined);
|
|
17
|
+
const keysB = Object.keys(b).filter((key) => b[key] !== undefined);
|
|
18
|
+
return keysA.length === keysB.length && keysA.every((key) => isJsonEqual(a[key], b[key]));
|
|
19
|
+
}
|
|
20
|
+
|
|
4
21
|
function mergeConnectivityEntries(existingEntries = [], incomingEntries = []) {
|
|
5
22
|
const merged = new Map();
|
|
6
23
|
|
|
@@ -114,14 +131,30 @@ export const useConnectivitiesStore = defineStore('connectivities', {
|
|
|
114
131
|
// snapshot may be stale for the same entry set. Merge by key and by id
|
|
115
132
|
// so a later flatmap update does not wipe richer scaffold metadata such
|
|
116
133
|
// as nerve-label.
|
|
117
|
-
|
|
134
|
+
//
|
|
135
|
+
// Entry arrays are large, read-only and not watched by any module, they
|
|
136
|
+
// are marked as raw.
|
|
137
|
+
const current = toRaw(this.globalConnectivities);
|
|
138
|
+
const merged = { ...current };
|
|
139
|
+
let changed = false;
|
|
118
140
|
|
|
119
|
-
Object.entries(globalConnectivities).forEach(([uuid, entries]) => {
|
|
120
|
-
const existingEntries =
|
|
121
|
-
|
|
141
|
+
Object.entries(toRaw(globalConnectivities)).forEach(([uuid, entries]) => {
|
|
142
|
+
const existingEntries = toRaw(current[uuid]);
|
|
143
|
+
const mergedEntries = mergeConnectivityEntries(
|
|
144
|
+
existingEntries || [],
|
|
145
|
+
toRaw(entries) || [],
|
|
146
|
+
);
|
|
147
|
+
if (existingEntries && isJsonEqual(mergedEntries, existingEntries)) {
|
|
148
|
+
// Unchanged; keep the stored array (viewers may have written it
|
|
149
|
+
// into the store directly) but stop Vue from proxying it
|
|
150
|
+
markRaw(existingEntries);
|
|
151
|
+
} else {
|
|
152
|
+
merged[uuid] = markRaw(mergedEntries);
|
|
153
|
+
changed = true;
|
|
154
|
+
}
|
|
122
155
|
});
|
|
123
156
|
|
|
124
|
-
if (
|
|
157
|
+
if (changed) {
|
|
125
158
|
this.globalConnectivities = merged;
|
|
126
159
|
this.connectivitiesUpdated = true;
|
|
127
160
|
}
|
package/src/stores/settings.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineStore } from 'pinia';
|
|
2
|
+
import { SCREENSHOT_LEGEND_MODES } from '../services/screenshot';
|
|
2
3
|
|
|
3
4
|
export const useSettingsStore = defineStore('settings', {
|
|
4
5
|
state: () => {
|
|
@@ -32,6 +33,11 @@ export const useSettingsStore = defineStore('settings', {
|
|
|
32
33
|
allClosable: true,
|
|
33
34
|
offlineAnnotationEnabled: false,
|
|
34
35
|
displayMinimap: true,
|
|
36
|
+
screenshot: {
|
|
37
|
+
scale: 1, // multiplier on top of the device pixel ratio
|
|
38
|
+
legend: 'exclude', // exclude, include, only
|
|
39
|
+
toolbar: false, // include the header bar of each pane
|
|
40
|
+
},
|
|
35
41
|
globalSettings: {
|
|
36
42
|
displayMarkers: true, // comment out to hide in settings
|
|
37
43
|
// highlightConnectedPaths: false, // comment out to hide in settings
|
|
@@ -211,6 +217,18 @@ export const useSettingsStore = defineStore('settings', {
|
|
|
211
217
|
updateDisplayMinimap(displayMinimap) {
|
|
212
218
|
this.displayMinimap = displayMinimap;
|
|
213
219
|
},
|
|
220
|
+
updateScreenshotOptions(options) {
|
|
221
|
+
const { scale, legend, toolbar } = options || {};
|
|
222
|
+
if (Number(scale) > 0) {
|
|
223
|
+
this.screenshot.scale = Number(scale);
|
|
224
|
+
}
|
|
225
|
+
if (SCREENSHOT_LEGEND_MODES.includes(legend)) {
|
|
226
|
+
this.screenshot.legend = legend;
|
|
227
|
+
}
|
|
228
|
+
if (typeof toolbar === 'boolean') {
|
|
229
|
+
this.screenshot.toolbar = toolbar;
|
|
230
|
+
}
|
|
231
|
+
},
|
|
214
232
|
updateGlobalSettings(globalSettings) {
|
|
215
233
|
for (const [key, value] of Object.entries(globalSettings)) {
|
|
216
234
|
this.globalSettings[key] = value;
|