@abi-software/mapintegratedvuer 1.9.2 → 1.9.3-beta.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.
@@ -17,6 +17,7 @@
17
17
  :helpModeDialog="useHelpModeDialog"
18
18
  @annotation-open="onAnnotationOpen"
19
19
  @annotation-close="onAnnotationClose"
20
+ @update-offline-annotation-enabled="updateOfflineAnnotationEnabled"
20
21
  :annotationSidebar="annotationSidebar"
21
22
  @help-mode-last-item="onHelpModeLastItem"
22
23
  @shown-tooltip="onTooltipShown"
@@ -31,6 +32,8 @@
31
32
  :markerCluster="true"
32
33
  :markerLabels="markerLabels"
33
34
  :flatmapAPI="flatmapAPI"
35
+ :showLocalSettings="showLocalSettings"
36
+ :showOpenMapButton="showOpenMapButton"
34
37
  />
35
38
 
36
39
  <HelpModeDialog
@@ -139,6 +142,7 @@ export default {
139
142
  if (this.entry.rotation) rotation = this.entry.rotation;
140
143
  this.$refs.scaffold.toggleSyncControl(this.splitFlowStore.globalCallback, rotation);
141
144
  if (this.splitFlowStore.syncMode) this.$refs.scaffold.fitWindow();
145
+ this.updateSettings();
142
146
  }
143
147
  EventBus.emit("mapLoaded", this.$refs.scaffold);
144
148
  },
@@ -191,6 +195,15 @@ export default {
191
195
  changeViewingMode: function (modeName) {
192
196
  this.$refs.scaffold.changeViewingMode(modeName);
193
197
  },
198
+ updateSettings: function () {
199
+ const {
200
+ backgroundDisplay,
201
+ viewingMode,
202
+ } = this.settingsStore.globalSettings;
203
+
204
+ this.$refs.scaffold.backgroundChangeCallback(backgroundDisplay);
205
+ this.$refs.scaffold.changeViewingMode(viewingMode);
206
+ },
194
207
  },
195
208
  computed: {
196
209
  warningMessage: function() {
@@ -222,6 +235,12 @@ export default {
222
235
  this.cardHoverHighlight();
223
236
  }
224
237
  });
238
+ EventBus.on('backgroundDisplayUpdate', (payload) => {
239
+ this.$refs.scaffold.backgroundChangeCallback(payload);
240
+ });
241
+ EventBus.on('viewingModeUpdate', (payload) => {
242
+ this.$refs.scaffold.changeViewingMode(payload);
243
+ });
225
244
  },
226
245
  };
227
246
  </script>
@@ -19,14 +19,23 @@ declare module 'vue' {
19
19
  ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
20
20
  ElCol: typeof import('element-plus/es')['ElCol']
21
21
  ElContainer: typeof import('element-plus/es')['ElContainer']
22
+ ElDropdown: typeof import('element-plus/es')['ElDropdown']
23
+ ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem']
24
+ ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu']
22
25
  ElHeader: typeof import('element-plus/es')['ElHeader']
23
26
  ElIcon: typeof import('element-plus/es')['ElIcon']
24
27
  ElIconArrowDown: typeof import('@element-plus/icons-vue')['ArrowDown']
25
28
  ElIconArrowUp: typeof import('@element-plus/icons-vue')['ArrowUp']
29
+ ElIconCompass: typeof import('@element-plus/icons-vue')['Compass']
30
+ ElIconEditPen: typeof import('@element-plus/icons-vue')['EditPen']
31
+ ElIconMoreFilled: typeof import('@element-plus/icons-vue')['MoreFilled']
32
+ ElIconShare: typeof import('@element-plus/icons-vue')['Share']
26
33
  ElInput: typeof import('element-plus/es')['ElInput']
27
34
  ElMain: typeof import('element-plus/es')['ElMain']
28
35
  ElOption: typeof import('element-plus/es')['ElOption']
29
36
  ElPopover: typeof import('element-plus/es')['ElPopover']
37
+ ElRadio: typeof import('element-plus/es')['ElRadio']
38
+ ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
30
39
  ElRow: typeof import('element-plus/es')['ElRow']
31
40
  ElSelect: typeof import('element-plus/es')['ElSelect']
32
41
  ElSwitch: typeof import('element-plus/es')['ElSwitch']
@@ -35,6 +35,7 @@ export default {
35
35
  default: false,
36
36
  },
37
37
  },
38
+ inject: ['showGlobalSettings', 'showOpenMapButton'],
38
39
  computed: {
39
40
  ...mapStores(useSettingsStore, useSplitFlowStore, useConnectivitiesStore),
40
41
  idNamePair() {
@@ -52,16 +53,34 @@ export default {
52
53
  annotationSidebar() {
53
54
  return this.settingsStore.annotationSidebar;
54
55
  },
56
+ // Hide local settings if global settings are shown
57
+ showLocalSettings() {
58
+ return !this.showGlobalSettings;
59
+ },
55
60
  },
56
61
  mounted: function () {
57
62
  EventBus.on("startHelp", () => {
58
63
  this.startHelp();
59
64
  });
60
65
 
66
+ EventBus.on('connectivity-item-close', () => {
67
+ if (this.multiflatmapRef) {
68
+ const currentFlatmap = this.multiflatmapRef.getCurrentFlatmap();
69
+ if (currentFlatmap) {
70
+ currentFlatmap.closeTooltip();
71
+ }
72
+ }
73
+ if (this.flatmapRef) {
74
+ this.flatmapRef.closeTooltip();
75
+ }
76
+ });
77
+
61
78
  this.multiflatmapRef = this.$refs.multiflatmap;
62
79
  this.flatmapRef = this.$refs.flatmap;
63
80
  this.scaffoldRef = this.$refs.scaffold;
64
81
  this.connectivityKnowledge = this.connectivitiesStore.globalConnectivities;
82
+ this.connectivityFilterOptions = this.connectivitiesStore.filterOptions;
83
+ this.connectivityFilterSources = this.connectivitiesStore.filterSources;
65
84
  },
66
85
  methods: {
67
86
  toggleSyncMode: function () {
@@ -520,7 +539,10 @@ export default {
520
539
  if ((this.multiflatmapRef || this.flatmapRef) && flatmap) {
521
540
  this.flatmapHighlight(flatmap, hoverAnatomies, hoverDOI, hoverConnectivity).then((paths) => {
522
541
  try {
523
- flatmap.zoomToFeatures(paths);
542
+ flatmap.showConnectivityTooltips({
543
+ connectivityInfo: { featureId: paths },
544
+ data: []
545
+ });
524
546
  } catch (error) {
525
547
  console.log(error)
526
548
  // only for connectivity hover highlight
@@ -550,6 +572,9 @@ export default {
550
572
  onAnnotationClose: function () {
551
573
  EventBus.emit('annotation-close');
552
574
  },
575
+ updateOfflineAnnotationEnabled: function (payload) {
576
+ EventBus.emit('update-offline-annotation-enabled', payload);
577
+ },
553
578
  onConnectivityInfoOpen: function (connectivityInfoData) {
554
579
  EventBus.emit('connectivity-info-open', connectivityInfoData);
555
580
  },
@@ -559,42 +584,36 @@ export default {
559
584
  onConnectivityInfoClose: function () {
560
585
  EventBus.emit('connectivity-info-close');
561
586
  },
562
- loadConnectivityKnowledge: async function (flatmapImp) {
587
+ loadConnectivityExplorerConfig: async function (flatmap) {
588
+ const flatmapImp = flatmap.mapImp;
563
589
  const sckanVersion = getKnowledgeSource(flatmapImp);
564
590
  const flatmapQueries = markRaw(new FlatmapQueries());
565
591
  flatmapQueries.initialise(this.flatmapAPI);
566
592
  const knowledge = await loadAndStoreKnowledge(flatmapImp, flatmapQueries);
567
593
  const uuid = flatmapImp.uuid;
594
+ const pathways = flatmapImp.pathways;
568
595
 
569
596
  if (!this.connectivityKnowledge[sckanVersion]) {
570
597
  this.connectivityKnowledge[sckanVersion] = knowledge
571
598
  .filter((item) => {
572
- return (
573
- item.source === sckanVersion &&
574
- item.connectivity?.length
575
- );
599
+ return item.source === sckanVersion && item.connectivity?.length;
576
600
  })
577
601
  .sort((a, b) => a.label.localeCompare(b.label));
578
602
  }
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));
603
+ if (!this.connectivityKnowledge[uuid]) {
604
+ const pathsFromMap = pathways ? pathways.paths : {};
605
+ this.connectivityKnowledge[uuid] = this.connectivityKnowledge[sckanVersion]
606
+ .filter((item) => item.id in pathsFromMap);
593
607
  }
594
-
595
608
  this.connectivitiesStore.updateGlobalConnectivities(this.connectivityKnowledge);
596
-
597
- // EventBus.emit("connectivity-knowledge", { data: this.connectivityKnowledge[uuid] });
609
+ if (!this.connectivityFilterOptions[uuid]) {
610
+ this.connectivityFilterOptions[uuid] = await flatmap.getFilterOptions();
611
+ }
612
+ this.connectivitiesStore.updateFilterOptions(this.connectivityFilterOptions);
613
+ if (!this.connectivityFilterSources[uuid]) {
614
+ this.connectivityFilterSources[uuid] = flatmap.getFilterSources();
615
+ }
616
+ this.connectivitiesStore.updateFilterSources(this.connectivityFilterSources);
598
617
  EventBus.emit('species-layout-connectivity-update');
599
618
  },
600
619
  },
@@ -618,6 +637,8 @@ export default {
618
637
  isInHelp: false,
619
638
  mapManager: undefined,
620
639
  connectivityKnowledge: {},
640
+ connectivityFilterOptions: {},
641
+ connectivityFilterSources: {},
621
642
  highlightDelay: undefined
622
643
  };
623
644
  },
@@ -3,33 +3,81 @@ import { defineStore } from 'pinia';
3
3
  export const useConnectivitiesStore = defineStore('connectivities', {
4
4
  state: () => {
5
5
  return {
6
- globalConnectivities: {},
7
6
  activeConnectivityKeys: [],
8
- }
7
+ globalConnectivities: {},
8
+ filterOptions: {},
9
+ filterSources: {},
10
+ };
9
11
  },
10
12
  getters: {
11
13
  getUniqueConnectivitiesByKeys: (state) => {
12
14
  let combinedConnectivities = [];
13
15
  state.activeConnectivityKeys.forEach((uuid) => {
14
- if (uuid in state.globalConnectivities) {
15
- const connectivity = state.globalConnectivities[uuid];
16
- combinedConnectivities.push(...connectivity);
16
+ if (uuid in state['globalConnectivities']) {
17
+ const connectivities = state['globalConnectivities'][uuid];
18
+ combinedConnectivities.push(...connectivities);
17
19
  }
18
20
  });
19
-
20
21
  const uniqueConnectivities = Array.from(
21
- new Map(combinedConnectivities.map((item) => [item.id, item])).values()
22
+ new Map(combinedConnectivities.map((item) => [item['id'], item])).values()
22
23
  );
23
-
24
24
  return uniqueConnectivities;
25
25
  },
26
+ getUniqueFilterOptionsByKeys: (state) => {
27
+ const uniqueFilterOptions = state.activeConnectivityKeys.reduce((acc, uuid) => {
28
+ const filters = state.filterOptions[uuid];
29
+ if (!filters) return acc;
30
+
31
+ for (const filter of filters) {
32
+ const existing = acc[filter.key];
33
+
34
+ if (!existing) {
35
+ acc[filter.key] = { ...filter };
36
+ } else {
37
+ const mergedChildren = [...existing.children, ...filter.children];
38
+ const uniqueChildren = Array.from(
39
+ new Map(mergedChildren.map(child => [child.key, child])).values()
40
+ );
41
+ existing.children = uniqueChildren;
42
+ }
43
+ }
44
+
45
+ return acc;
46
+ }, {});
47
+ return Object.values(uniqueFilterOptions);
48
+ },
49
+ getUniqueFilterSourcesByKeys: (state) => {
50
+ const uniqueFilterSources = state.activeConnectivityKeys.reduce((acc, uuid) => {
51
+ const filters = state.filterSources[uuid];
52
+ if (!filters) return acc;
53
+
54
+ for (const [filter, options] of Object.entries(filters)) {
55
+ if (!acc[filter]) acc[filter] = {};
56
+
57
+ for (const [option, ids] of Object.entries(options)) {
58
+ acc[filter][option] = acc[filter][option]
59
+ ? Array.from(new Set([...acc[filter][option], ...ids]))
60
+ : [...ids];
61
+ }
62
+ }
63
+
64
+ return acc;
65
+ }, {});
66
+ return uniqueFilterSources;
67
+ },
26
68
  },
27
69
  actions: {
70
+ updateActiveConnectivityKeys(activeConnectivityKeys) {
71
+ this.activeConnectivityKeys = activeConnectivityKeys;
72
+ },
28
73
  updateGlobalConnectivities(globalConnectivities) {
29
74
  this.globalConnectivities = globalConnectivities;
30
75
  },
31
- updateActiveConnectivityKeys(activeConnectivityKeys) {
32
- this.activeConnectivityKeys = activeConnectivityKeys;
76
+ updateFilterOptions(filterOptions) {
77
+ this.filterOptions = filterOptions;
33
78
  },
34
- }
79
+ updateFilterSources(filterSources) {
80
+ this.filterSources = filterSources;
81
+ },
82
+ },
35
83
  });
@@ -32,11 +32,17 @@ export const useSettingsStore = defineStore('settings', {
32
32
  connectivityInfoSidebar: true,
33
33
  annotationSidebar: true,
34
34
  allClosable: true,
35
+ offlineAnnotationEnabled: false,
35
36
  globalSettings: {
36
- displayMarkers: true,
37
- highlightConnectedPaths: false,
38
- highlightDOIPaths: false, // comment out to hide in settings
39
- interactiveMode: 'dataset', // dataset, connectivity, multiscale
37
+ displayMarkers: true, // comment out to hide in settings
38
+ // highlightConnectedPaths: false, // comment out to hide in settings
39
+ // highlightDOIPaths: false, // comment out to hide in settings
40
+ interactiveMode: 'dataset', // dataset, connectivity, multiscale // comment out to hide in settings
41
+ viewingMode: 'Exploration',
42
+ flightPathDisplay: false,
43
+ organsDisplay: true,
44
+ outlinesDisplay: true,
45
+ backgroundDisplay: 'white',
40
46
  },
41
47
  }
42
48
  },
@@ -186,10 +192,15 @@ export const useSettingsStore = defineStore('settings', {
186
192
  updateAllClosable(allClosable) {
187
193
  this.allClosable = allClosable;
188
194
  },
195
+ updateOfflineAnnotationEnabled(offlineAnnotationEnabled) {
196
+ this.offlineAnnotationEnabled = offlineAnnotationEnabled;
197
+ },
189
198
  updateGlobalSettings(globalSettings) {
190
199
  for (const [key, value] of Object.entries(globalSettings)) {
191
200
  this.globalSettings[key] = value;
192
201
  }
202
+ // add global settins to storage
203
+ localStorage.setItem('mapviewer.globalSettings', JSON.stringify(this.globalSettings));
193
204
  },
194
205
  }
195
206
  });
@@ -12,13 +12,16 @@ export default defineConfig((configEnv) => {
12
12
  fileName: "mapintegratedvuer",
13
13
  },
14
14
  rollupOptions: {
15
- external: ["vue", "pinia", "@abi-software/plotvuer", "@abi-software/simulationvuer"],
15
+ external: ["vue", "pinia", "@abi-software/flatmapvuer", "@abi-software/plotvuer",
16
+ "@abi-software/scaffoldvuer", "@abi-software/simulationvuer"],
16
17
  output: {
17
18
  globals: {
18
19
  vue: "Vue",
19
20
  pinia: "pinia",
20
- "@abi-software/simulationvuer": "simulationvuer",
21
+ "@abi-software/flatmapvuer": "flatmapvuer",
21
22
  "@abi-software/plotvuer": "plotvuer",
23
+ "@abi-software/scaffoldvuer": "scaffoldvuer",
24
+ "@abi-software/simulationvuer": "simulationvuer",
22
25
  },
23
26
  },
24
27
  },