From a9db04986a73da8c3daac6752468b1391563bfe0 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 14 May 2024 10:26:55 +1200 Subject: [PATCH 1/2] add hoveredMarkers to zoom in marker --- src/components/SplitFlow.vue | 6 ++++++ src/components/viewers/MultiFlatmap.vue | 8 ++++++++ src/mixins/DynamicMarkerMixin.js | 9 ++++++--- src/stores/settings.js | 4 ++++ 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/components/SplitFlow.vue b/src/components/SplitFlow.vue index 43311c26..93a11fd6 100644 --- a/src/components/SplitFlow.vue +++ b/src/components/SplitFlow.vue @@ -28,6 +28,7 @@ @actionClick="actionClick" @tabClicked="tabClicked" @search-changed="searchChanged($event)" + @hover-changed="hoverChanged($event)" @contextUpdate="contextUpdate($event)" /> diff --git a/src/mixins/DynamicMarkerMixin.js b/src/mixins/DynamicMarkerMixin.js index fca4d9d1..780cafc6 100644 --- a/src/mixins/DynamicMarkerMixin.js +++ b/src/mixins/DynamicMarkerMixin.js @@ -9,7 +9,7 @@ import { useSettingsStore } from '../stores/settings'; * I have modified it to make sure the marker is displayed * if the uberon is not present in the hardcoded zoom-level list. */ -const checkMarkersAtZoomLevel = (flatmapImp, markers, zoomLevel) => { +const checkMarkersAtZoomLevel = (flatmapImp, markers, zoomLevel, hoveredMarkers) => { if (markers) { markers.forEach(id => { let foundInArray = false; @@ -19,7 +19,9 @@ const checkMarkersAtZoomLevel = (flatmapImp, markers, zoomLevel) => { if (markerZoomLevels[i].id === id) { foundInArray = true; if (zoomLevel >= markerZoomLevels[i].showAtZoom) { - flatmapImp.addMarker(id, {className: "standard-marker"}); + let markerClass = "standard-marker" + if (hoveredMarkers.includes(id)) markerClass = "hovered-marker" + flatmapImp.addMarker(id, { className: markerClass }); } break; } @@ -69,7 +71,8 @@ export default { this.zoomLevel = currentZoom; flatmapImp.clearMarkers(); let markers = this.settingsStore.markers; - checkMarkersAtZoomLevel(flatmapImp, markers, this.zoomLevel); + let hoveredMarkers = this.settingsStore.hoveredMarkers; + checkMarkersAtZoomLevel(flatmapImp, markers, this.zoomLevel, hoveredMarkers); if (this.entry.type === "MultiFlatmap") { this.restoreFeaturedMarkers(flatmapImp); } diff --git a/src/stores/settings.js b/src/stores/settings.js index db288cc8..d39c8738 100644 --- a/src/stores/settings.js +++ b/src/stores/settings.js @@ -17,6 +17,7 @@ export const useSettingsStore = defineStore('settings', { facets: { species: [], gender: [], organ: [] }, facetLabels: [], markers: [], + hoveredMarkers: [], featuredMarkers: [], featuredMarkerIdentifiers: [], featuredMarkerDois: [], @@ -67,6 +68,9 @@ export const useSettingsStore = defineStore('settings', { updateMarkers(markers) { this.markers = markers; }, + updateHoveredMarkers(markers) { + this.hoveredMarkers = markers; + }, updateFeatured(datasetIdentifiers) { this.featuredMarkerIdentifiers = new Array(datasetIdentifiers.length); this.featuredMarkers = new Array(datasetIdentifiers.length); From 77cc0f39c7cc8f056988b12a6d3de194881f4b5f Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 17 May 2024 15:50:20 +1200 Subject: [PATCH 2/2] @abi-software/map-side-bar@2.2.0 --- package-lock.json | 64 +++++++++++++++++++++++------------------------ package.json | 2 +- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8417d5da..2e19cc57 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@abi-software/flatmapvuer": "1.0.1", - "@abi-software/map-side-bar": "2.0.1", + "@abi-software/map-side-bar": "^2.2.0", "@abi-software/plotvuer": "1.0.0", "@abi-software/scaffoldvuer": "1.0.1", "@abi-software/simulationvuer": "1.0.0", @@ -69,7 +69,24 @@ "node": ">=0.10.0" } }, - "node_modules/@abi-software/flatmap-viewer": { + "node_modules/@abi-software/flatmapvuer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@abi-software/flatmapvuer/-/flatmapvuer-1.0.1.tgz", + "integrity": "sha512-D6Ydew2OL9Kes5SSKfmX4Wk+t7BCmUDEgRSlerUIMKG4Ne9jRW6cjT4sLCBK5h7xHPzHu+PmGotD0nf2FGpHLA==", + "dependencies": { + "@abi-software/flatmap-viewer": "2.6.2", + "@abi-software/sparc-annotation": "0.2.0", + "@abi-software/svg-sprite": "1.0.0", + "@element-plus/icons-vue": "^2.3.1", + "css-element-queries": "^1.2.2", + "element-plus": "2.5.5", + "mitt": "^3.0.1", + "pinia": "^2.1.7", + "unplugin-vue-components": "^0.26.0", + "vue": "^3.4.15" + } + }, + "node_modules/@abi-software/flatmapvuer/node_modules/@abi-software/flatmap-viewer": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-2.6.2.tgz", "integrity": "sha512-VhVIGq8gdiWJRQB9gDmgiqmuD+tzQVksLPm+B4sSUJY/ZslxiYucz0PxuGNAh1QNx9z/lCOOYA9HdR8Zdm2HkA==", @@ -93,27 +110,10 @@ "polylabel": "^1.1.0" } }, - "node_modules/@abi-software/flatmapvuer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@abi-software/flatmapvuer/-/flatmapvuer-1.0.1.tgz", - "integrity": "sha512-D6Ydew2OL9Kes5SSKfmX4Wk+t7BCmUDEgRSlerUIMKG4Ne9jRW6cjT4sLCBK5h7xHPzHu+PmGotD0nf2FGpHLA==", - "dependencies": { - "@abi-software/flatmap-viewer": "2.6.2", - "@abi-software/sparc-annotation": "0.2.0", - "@abi-software/svg-sprite": "1.0.0", - "@element-plus/icons-vue": "^2.3.1", - "css-element-queries": "^1.2.2", - "element-plus": "2.5.5", - "mitt": "^3.0.1", - "pinia": "^2.1.7", - "unplugin-vue-components": "^0.26.0", - "vue": "^3.4.15" - } - }, "node_modules/@abi-software/gallery": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-1.0.0.tgz", - "integrity": "sha512-cVhxBEEbM9SEYphVmjXJI0GJVsyPH9BYWpXuesjTrUGhE5irmWjd25+8YsjYDZ7DNoigQt6mSshZQ2KsTG2SEQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-1.1.0.tgz", + "integrity": "sha512-TZCqcqxZdC4wW35KJwBq96yXX8cd7pjGSqvaFLEtWhbe+mqsSrqhgnk/jbvN14/JtOFyo9S7KpBFKvLHFrwWJA==", "dependencies": { "axios": "^1.6.5", "element-plus": "^2.4.4", @@ -122,11 +122,11 @@ } }, "node_modules/@abi-software/map-side-bar": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@abi-software/map-side-bar/-/map-side-bar-2.0.1.tgz", - "integrity": "sha512-y1zScjghjVKkQoUQvFffbzQmkCOKxtdGNKOTa1my3qHiugsR3UKdWPgh3gVoXIsXs+CD3AonwMWKdSwFLG3WSQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@abi-software/map-side-bar/-/map-side-bar-2.2.0.tgz", + "integrity": "sha512-PtMmmixNpRME8uYswJ9XsLkSEMgmx+66G/aQps/5se/M4cj0Rqg5CZ6ZVbi83vxzAJGte+87NQbBgMMtZ2uJpQ==", "dependencies": { - "@abi-software/gallery": "^1.0.0", + "@abi-software/gallery": "^1.1.0", "@abi-software/svg-sprite": "^1.0.0", "@element-plus/icons-vue": "^2.3.1", "algoliasearch": "^4.10.5", @@ -6400,9 +6400,9 @@ } }, "node_modules/core-js": { - "version": "3.35.1", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.35.1.tgz", - "integrity": "sha512-IgdsbxNyMskrTFxa9lWHyMwAJU5gXOPP+1yO+K59d50VLVAIDAbs7gIv705KzALModfK3ZrSZTPNpC0PQgIZuw==", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", + "integrity": "sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==", "hasInstallScript": true, "funding": { "type": "opencollective", @@ -6410,9 +6410,9 @@ } }, "node_modules/core-js-pure": { - "version": "3.37.0", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.37.0.tgz", - "integrity": "sha512-d3BrpyFr5eD4KcbRvQ3FTUx/KWmaDesr7+a3+1+P46IUnNoEt+oiLijPINZMEon7w9oGkIINWxrBAU9DEciwFQ==", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.37.1.tgz", + "integrity": "sha512-J/r5JTHSmzTxbiYYrzXg9w1VpqrYt+gexenBE9pugeyhwPZTAEJddyiReJWsLO6uNQ8xJZFbod6XC7KKwatCiA==", "hasInstallScript": true, "funding": { "type": "opencollective", diff --git a/package.json b/package.json index de85de6c..a9b89677 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ ], "dependencies": { "@abi-software/flatmapvuer": "1.0.1", - "@abi-software/map-side-bar": "2.0.1", + "@abi-software/map-side-bar": "^2.2.0", "@abi-software/plotvuer": "1.0.0", "@abi-software/scaffoldvuer": "1.0.1", "@abi-software/simulationvuer": "1.0.0",