From baae4618bb2abec37ab3d9920dfffb47aa2baf3d Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:36:01 +1200 Subject: [PATCH 01/47] Update to support show image on flatmap --- package-lock.json | 8 +- package.json | 2 +- src/App.vue | 6 +- src/components/FlatmapVuer.vue | 61 +++++---- src/components/MultiFlatmapVuer.vue | 8 ++ src/mixins/flatmapImageMixin.js | 64 +++++----- src/services/scicrunchMixin.js | 190 +++++++++++++++++++++------- 7 files changed, 225 insertions(+), 114 deletions(-) diff --git a/package-lock.json b/package-lock.json index 12507663..415f9a68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "2.9.5", - "@abi-software/map-utilities": "^0.0.0-beta.7", + "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", @@ -80,9 +80,9 @@ } }, "node_modules/@abi-software/map-utilities": { - "version": "0.0.0-beta.7", - "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-0.0.0-beta.7.tgz", - "integrity": "sha512-9V1WM5oZl5QL6QtsGejdzKdnbTT4msNnONq015fZxKX8wtwO49oVIvIlwtrcnrw4W5PeO3rdPCWOiGU9cbDW8w==", + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.0.0-beta.1.tgz", + "integrity": "sha512-gOMGlaAqY8Rv6rXJ64oqOeTJHO1W0FigQZnTJKMOj9wMA0jWYsHHREyP8FKbEZZ0YGk9l2cJGL38K/sHTkcNpw==", "dependencies": { "@abi-software/gallery": "^1.1.0", "@abi-software/svg-sprite": "^1.0.0", diff --git a/package.json b/package.json index 07b944b1..c957d8dd 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@abi-software/flatmap-viewer": "2.9.5", - "@abi-software/map-utilities": "^0.0.0-beta.7", + "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/src/App.vue b/src/App.vue index 2d833043..ff3ece5c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -77,7 +77,8 @@ :displayMinimap="true" :enableOpenMapUI="true" :flatmapAPI="flatmapAPI" - :sparcAPI="sparcApi" + :rootURL="rootURL" + :sparcAPI="sparcAPI" :disableUI="disableUI" @open-pubmed-url="onOpenPubmedUrl" @pathway-selection-changed="onPathwaySelectionChanged" @@ -287,7 +288,8 @@ export default { useHelpModeDialog: true, multiflatmapRef: null, mapSettings: [], - sparcApi: "http://localhost:5000", + rootURL: "http://localhost:3000", + sparcAPI: "http://localhost:8000", //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/" //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/" //flatmapAPI: "https://mapcoe-demo.org/current/flatmap/v3/", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 4c59650c..ee07014b 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -602,19 +602,12 @@ Please use `const` to assign meaningful names to them... ref="tooltip" class="tooltip" v-show="tooltipDisplay" - :annotationEntry="annotationEntry" - :tooltipEntry="tooltipEntry" :tooltipType="tooltipType" - :galleryItems="galleryItems" - :annotationDisplay="viewingMode === 'Annotation'" - @viewImage="viewIframeImage" + :provenanceEntry="provenanceEntry" + :annotationEntry="annotationEntry" + :imageEntry="imageEntry" @annotation="commitAnnotationEvent" /> - @@ -655,7 +648,7 @@ import * as flatmap from '@abi-software/flatmap-viewer' import { AnnotationService } from '@abi-software/sparc-annotation' import { mapState } from 'pinia' import { useMainStore } from '@/store/index' -import { DrawToolbar, Tooltip, TreeControls, IframeImageDialog } from '@abi-software/map-utilities' +import { DrawToolbar, Tooltip, TreeControls } from '@abi-software/map-utilities' import '@abi-software/map-utilities/dist/style.css' const centroid = (geometry) => { @@ -1680,7 +1673,6 @@ export default { } if ( data && - data.type !== 'marker' && eventType === 'click' && !(this.viewingMode === 'Neuron Connection') && // Disable popup when drawing @@ -1719,15 +1711,27 @@ export default { checkAndCreatePopups: async function (data) { if (data.feature.type === 'marker') { - this.tooltipType = 'image-gallery' + this.tooltipType = 'image' console.log('marker data', data) console.log('saved images', this.images) let filteredImages = this.findImagesForAnatomy(this.images, data.resource[0]) console.log('filtered images:',filteredImages) - this.galleryItems = filteredImages - this.displayTooltip(data.feature.models) - } else { + this.imageEntry = filteredImages + console.log(data.feature.models); + // this.displayTooltip(data.feature.models) + let options = { className: 'flatmapvuer-popover' } + let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] + if (!this.activeDrawTool) { + options.positionAtLastClick = true + } + this.tooltipDisplay = true; + this.$nextTick(() => { + this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); + this.popUpCssHacks(); + }); + + } else { // Call flatmap database to get the connection data if (this.viewingMode === 'Annotation') { if (data.feature) { @@ -1812,7 +1816,7 @@ export default { * @arg data */ createTooltipFromNeuronCuration: async function (data) { - this.tooltipEntry = await this.flatmapQueries.createTooltipData(data) + this.provenanceEntry = await this.flatmapQueries.createTooltipData(data) this.displayTooltip(data.resource[0]) }, /** @@ -2025,9 +2029,9 @@ export default { // const featureIds = [feature]; // this.moveMap(featureIds); if (this.featuresAlert) { - this.tooltipEntry['featuresAlert'] = this.featuresAlert; + this.provenanceEntry['featuresAlert'] = this.featuresAlert; } - this.$emit('connectivity-info-open', this.tooltipEntry); + this.$emit('connectivity-info-open', this.provenanceEntry); } // If UI is not disabled, // And connectivityInfoSidebar is not set (default) or set to `false` @@ -2058,7 +2062,7 @@ export default { origins, provenanceTaxonomy, provenanceTaxonomyLabel - } = this.tooltipEntry; + } = this.provenanceEntry; return Boolean( components?.length || @@ -2377,7 +2381,7 @@ export default { if (_map) { _map.on('click', (e) => { - if (this.tooltipEntry.featureId) { + if (this.provenanceEntry.featureId) { this.$emit('connectivity-info-close'); } }); @@ -2636,6 +2640,13 @@ export default { type: String, default: 'https://mapcore-demo.org/current/flatmap/v3/', }, + /** + * Specify the root url of the SPARC portal. + */ + rootURL: { + type: String, + default: 'https://sparc.science/', + }, /** * Specify the endpoint of the SPARC API. */ @@ -2646,7 +2657,7 @@ export default { /** * Flag to disable UIs on Map */ - disableUI: { + disableUI: { type: Boolean, default: false, }, @@ -2680,9 +2691,7 @@ export default { serverURL: undefined, layers: [], pathways: [], - imageIframeOpen: false, - imageIframeURL: '', - galleryItems: [], + imageEntry: [], tooltipType: 'provenance', sckanDisplay: [ { @@ -2727,7 +2736,7 @@ export default { availableBackground: ['white', 'lightskyblue', 'black'], loading: false, flatmapMarker: flatmapMarker, - tooltipEntry: createUnfilledTooltipData(), + provenanceEntry: createUnfilledTooltipData(), connectivityTooltipVisible: false, drawerOpen: false, featuresAlert: undefined, diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 574a37ad..6683a378 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -80,6 +80,7 @@ :showStarInLegend="showStarInLegend" style="height: 100%" :flatmapAPI="flatmapAPI" + :rootURL="rootURL" :sparcAPI="sparcAPI" /> @@ -687,6 +688,13 @@ export default { type: String, default: 'https://mapcore-demo.org/current/flatmap/v3/', }, + /** + * Specify the root url of the SPARC portal. + */ + rootURL: { + type: String, + default: 'https://sparc.science/', + }, /** * Specify the endpoint of the SPARC API. */ diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js index 5ef81b02..b1bdb226 100644 --- a/src/mixins/flatmapImageMixin.js +++ b/src/mixins/flatmapImageMixin.js @@ -6,31 +6,31 @@ export default { console.log('images in populateflatmap', images) images.forEach((image) => { if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (!anatomyList.includes(anatomy.curie)) { - anatomyList.push(anatomy.curie) - this.createImageThumbnailMarkerUrl(mapImp, anatomy.curie, image.thumbnail) - } - }) - } - }) + image.value.forEach((image) => { + if (image.anatomy && image.anatomy.length > 0) { + image.anatomy.forEach((anatomy) => { + if (!anatomyList.includes(anatomy.curie)) { + anatomyList.push(anatomy.curie) + this.createImageThumbnailMarkerUrl(mapImp, anatomy.curie, image.thumbnail) + } + }) + } + }) }) }, findImagesForAnatomy: function (images = [], anatomyToFind) { let imageList = [] images.forEach((image) => { if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (anatomy.curie === anatomyToFind) { - imageList.push(image) - } - }) - } - }) + image.value.forEach((image) => { + if (image.anatomy && image.anatomy.length > 0) { + image.anatomy.forEach((anatomy) => { + if (anatomy.curie === anatomyToFind) { + imageList.push(image) + } + }) + } + }) }) return imageList }, @@ -43,23 +43,23 @@ export default { let img = new Image(); img.src = image; img.style = "height: auto;width: 50px;margin-right: 80px;" - img.onload = function() { - wrapperElement.appendChild(img); + img.onload = function () { + wrapperElement.appendChild(img); - // add it to the flatmap - const markerIdentifier = mapImp.addMarker(id, { - element: wrapperElement, - className: "highlight-marker", - cluster: false, - type: "image", - }); + // add it to the flatmap + const markerIdentifier = mapImp.addMarker(id, { + element: wrapperElement, + className: "highlight-marker", + cluster: false, + type: "image", + }); - const marker = mapImp.addMarker(id); - resolve(marker); + const marker = mapImp.addMarker(id); + resolve(marker); }; - img.onerror = function() { - reject(new Error("Failed to load image at " + image)); + img.onerror = function () { + reject(new Error("Failed to load image at " + image)); }; }); }, diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js index b9c21680..0013d2da 100644 --- a/src/services/scicrunchMixin.js +++ b/src/services/scicrunchMixin.js @@ -2,88 +2,180 @@ const imageQuery = '"*jp2* OR *vnd.ome.xml* OR *jpx*"'; const generateShareLink = (datasetId, datasetVersion, filePath) => { - const prefix = 'https://sparc.biolucida.net'; + const prefix = "https://sparc.biolucida.net"; return `${prefix}/dataviewer?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; -} +}; + +const getView2DImageLink = (rootURL, datasetId, datasetVersion, filePath) => { + return `${rootURL}/datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; +}; + +const getView3DImageLink = ( + rootURL, + datasetId, + datasetVersion, + dataset_image +) => { + const viewEncoding = dataset_image.share_link.replace( + "https://sparc.biolucida.net/image?c=", + "" + ); + return ( + rootURL + + "datasets/biolucidaviewer/" + + dataset_image.image_id + + "?view=" + + viewEncoding + + "&dataset_version=" + + datasetVersion + + "&dataset_id=" + + datasetId + + "&item_id=" + + dataset_image.sourcepkg_id + ); +}; const getBiolucidaInfo = async function (sparcAPI, datasetId) { return new Promise((resolve, reject) => { - const endpoint = `${sparcAPI}/image_search/${datasetId}` + const endpoint = `${sparcAPI}/image_search/${datasetId}`; fetch(endpoint) .then((response) => response.json()) .then((data) => { - if (data.status == 'success') resolve(data); - }) - }) -} + if (data.status == "success") { + let imageObjects = {}; + data.dataset_images.forEach((image) => { + if (!(image.image_id in imageObjects)) { + imageObjects[image.image_id] = image; + } + }); + resolve(imageObjects); + } else { + reject(data.reason); + } + }); + }); +}; + +const getAnnotatedBiolucida = function (data) { + let annBiolucida = []; + let ann2DBiolucida = []; + if ("biolucida-2d" in data) { + annBiolucida = [...annBiolucida, ...data["biolucida-2d"]]; + ann2DBiolucida = [...annBiolucida, ...data["biolucida-2d"]]; + } + if ("biolucida-3d" in data) { + annBiolucida = [...annBiolucida, ...data["biolucida-3d"]]; + } + annBiolucida = annBiolucida.filter((biolucida) => biolucida.biolucida); + ann2DBiolucida = ann2DBiolucida.filter((biolucida) => biolucida.biolucida); + ann2DBiolucida.map((biolucida) => { + biolucida.biolucida.identifier; + }); + return { annBiolucida, ann2DBiolucida }; +}; export default { // Note that the setting store is included in MapContent.vue methods: { - getThumbnailURL: function(thumbnailId) { - console.log('thumbnail url', `${this.sparcAPI}/thumbnail/${thumbnailId}`) - return `${this.sparcAPI}/thumbnail/${thumbnailId}` + getThumbnailURL: function (thumbnailId) { + return `${this.sparcAPI}/thumbnail/${thumbnailId}`; }, - getSegmentationThumbnailURL: function(datasetId, datasetVersion, filePath, s3uri) { - console.log('thumbnail url', `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}&s3uri=${s3uri}`) + getSegmentationThumbnailURL: function ( + datasetId, + datasetVersion, + filePath, + s3uri + ) { return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}&s3uri=${s3uri}`; - }, + }, + getImagesFromScicrunch: async function () { try { - const response = await fetch(`${this.sparcAPI}/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams({q: imageQuery})}`); + const response = await fetch( + `${ + this.sparcAPI + }/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams( + { q: imageQuery } + )}` + ); const data = await response.json(); - console.log('number of hits:', data.numberOfHits); + console.log("number of hits:", data.numberOfHits); if (data.numberOfHits >= 1) { let images = await this.processResults(data.results); - return {success: true, images: images}; + return { success: true, images: images }; } - return {success: false}; + return { success: false }; } catch (error) { - console.error('Error:', error); - return {success: false}; + console.error("Error:", error); + return { success: false }; } }, - + processResults: async function (results) { try { let images = []; - const dataType = 'segmentation'; - console.log('starting promise list') + const dataType = "Image"; + console.log("starting promise list"); let promiseList = results.map(async (result, i) => { - if (i !== 8){ const datasetId = result.dataset_identifier; const datasetVersion = result.dataset_version; - const s3uri = result.s3uri; - const biolucidaInfo = await getBiolucidaInfo(this.sparcAPI, datasetId); - return biolucidaInfo.dataset_images.map(bioImage => { - return { - resource: { - share_link: bioImage.share_link, - }, - title: 'Image', - anatomy: result.organs, - species: result.organisms, - datasetId: datasetId, - datasetVersion: datasetVersion, - link: bioImage.share_link, - s3uri: s3uri, - type: dataType, - thumbnail: bioImage.thumbnail_url, - }; - });} + const biolucidaInfo = await getBiolucidaInfo( + this.sparcAPI, + datasetId + ); + const imageIds = Object.values(biolucidaInfo).map( + (image) => image.image_id + ); + const { annBiolucida, ann2DBiolucida } = + getAnnotatedBiolucida(result); + return annBiolucida + .filter((bioImage) => + imageIds.includes(bioImage.biolucida.identifier) + ) + .map((bioImage) => { + const datasetImage = biolucidaInfo[bioImage.biolucida.identifier]; + const link = ann2DBiolucida.includes( + bioImage.biolucida.identifier + ) + ? getView2DImageLink( + this.rootURL, + datasetId, + datasetVersion, + bioImage.dataset.path + ) + : getView3DImageLink( + this.rootURL, + datasetId, + datasetVersion, + datasetImage + ); + return { + resource: { + share_link: datasetImage.share_link, + }, + title: bioImage.name, + anatomy: result.organs, + species: result.organisms, + datasetId: datasetId, + datasetVersion: datasetVersion, + link: link, + s3uri: result.s3uri, + type: dataType, + thumbnail: datasetImage.thumbnail_url, + }; + }); }); - console.log('promiseList:', promiseList); + console.log("promiseList:", promiseList); let biolucidaInfos = await Promise.allSettled(promiseList); images = biolucidaInfos.flat(); - console.log('biolucidaInfos:', biolucidaInfos); - console.log('finished!') + console.log("biolucidaInfos:", biolucidaInfos); + console.log("finished!"); return images; } catch (error) { - console.error('Error:', error); + console.error("Error:", error); return []; } - } - } -} - \ No newline at end of file + }, + }, +}; From abf93480f25fe1bce6859f95d09392525baadcf3 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:51:27 +1200 Subject: [PATCH 02/47] Comment out test use code and remove unused --- src/components/FlatmapVuer.vue | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index ee07014b..79d4dd51 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1718,18 +1718,18 @@ export default { console.log('filtered images:',filteredImages) this.imageEntry = filteredImages console.log(data.feature.models); - // this.displayTooltip(data.feature.models) - - let options = { className: 'flatmapvuer-popover' } - let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] - if (!this.activeDrawTool) { - options.positionAtLastClick = true - } - this.tooltipDisplay = true; - this.$nextTick(() => { - this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); - this.popUpCssHacks(); - }); + this.displayTooltip(data.feature.models) + + // let options = { className: 'flatmapvuer-popover' } + // let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] + // if (!this.activeDrawTool) { + // options.positionAtLastClick = true + // } + // this.tooltipDisplay = true; + // this.$nextTick(() => { + // this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); + // this.popUpCssHacks(); + // }); } else { // Call flatmap database to get the connection data @@ -2459,14 +2459,6 @@ export default { if (this.mapImp) return this.mapImp.search(term) return [] }, - viewIframeImage: function (url) { - this.imageIframeURL = url - this.imageIframeOpen = true - }, - closeImageIframe: function () { - this.imageIframeURL = '' - this.imageIframeOpen = false - }, addImagesToMap: async function () { if (this.mapImp) { let response = await this.getImagesFromScicrunch() From 38f23f9ebec3a2f51374d32d20118f2cbf66f68a Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 31 Jul 2024 15:38:47 +1200 Subject: [PATCH 03/47] Minor url issue --- src/App.vue | 4 ++-- src/services/scicrunchMixin.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/App.vue b/src/App.vue index ff3ece5c..9b2816cd 100644 --- a/src/App.vue +++ b/src/App.vue @@ -288,8 +288,8 @@ export default { useHelpModeDialog: true, multiflatmapRef: null, mapSettings: [], - rootURL: "http://localhost:3000", - sparcAPI: "http://localhost:8000", + rootURL: "http://localhost:3000/", + sparcAPI: "http://localhost:8000/", //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/" //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/" //flatmapAPI: "https://mapcoe-demo.org/current/flatmap/v3/", diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js index 0013d2da..46bfce27 100644 --- a/src/services/scicrunchMixin.js +++ b/src/services/scicrunchMixin.js @@ -7,7 +7,7 @@ const generateShareLink = (datasetId, datasetVersion, filePath) => { }; const getView2DImageLink = (rootURL, datasetId, datasetVersion, filePath) => { - return `${rootURL}/datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; + return `${rootURL}datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; }; const getView3DImageLink = ( @@ -37,7 +37,7 @@ const getView3DImageLink = ( const getBiolucidaInfo = async function (sparcAPI, datasetId) { return new Promise((resolve, reject) => { - const endpoint = `${sparcAPI}/image_search/${datasetId}`; + const endpoint = `${sparcAPI}image_search/${datasetId}`; fetch(endpoint) .then((response) => response.json()) .then((data) => { @@ -78,7 +78,7 @@ export default { // Note that the setting store is included in MapContent.vue methods: { getThumbnailURL: function (thumbnailId) { - return `${this.sparcAPI}/thumbnail/${thumbnailId}`; + return `${this.sparcAPI}thumbnail/${thumbnailId}`; }, getSegmentationThumbnailURL: function ( @@ -87,7 +87,7 @@ export default { filePath, s3uri ) { - return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}&s3uri=${s3uri}`; + return `${this.sparcAPI}thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}&s3uri=${s3uri}`; }, getImagesFromScicrunch: async function () { @@ -95,7 +95,7 @@ export default { const response = await fetch( `${ this.sparcAPI - }/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams( + }multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams( { q: imageQuery } )}` ); From 03300303751841fede7f19e75fe13c6da057752d Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:10:45 +1200 Subject: [PATCH 04/47] Update to use same mixin as scaffold --- src/App.vue | 5 - src/components/FlatmapVuer.vue | 46 ++++--- src/mixins/flatmapImageMixin.js | 67 ---------- src/mixins/imageMixin.js | 213 ++++++++++++++++++++++++++++++++ src/services/scicrunchMixin.js | 181 --------------------------- 5 files changed, 234 insertions(+), 278 deletions(-) delete mode 100644 src/mixins/flatmapImageMixin.js create mode 100644 src/mixins/imageMixin.js delete mode 100644 src/services/scicrunchMixin.js diff --git a/src/App.vue b/src/App.vue index 9b2816cd..8212d606 100644 --- a/src/App.vue +++ b/src/App.vue @@ -108,10 +108,6 @@ import { ElRow as Row, } from 'element-plus' import './icons/mapicon-species-style.css' -import imageThumbnail1 from './icons/imageThumbnail1' -import imageThumbnail2 from './icons/imageThumbnail2' -import imageThumbnail3 from './icons/imageThumbnail3' -import scicrunchMixin from './services/scicrunchMixin' import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue' import { HelpModeDialog } from '@abi-software/map-utilities' import '@abi-software/map-utilities/dist/style.css' @@ -128,7 +124,6 @@ export default { MultiFlatmapVuer, HelpModeDialog, }, - mixins: [scicrunchMixin], methods: { saveSettings: function () { this.mapSettings.push(this.$refs.multi.getState()) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 79d4dd51..3c9f22c1 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -640,8 +640,7 @@ import { FlatmapQueries, findTaxonomyLabel, } from '../services/flatmapQueries.js' -import scicrunchMixin from '../services/scicrunchMixin.js' -import flatmapImageMixin from '../mixins/flatmapImageMixin.js' +import imageMixin from '../mixins/imageMixin.js' import yellowstar from '../icons/yellowstar' import ResizeSensor from 'css-element-queries/src/ResizeSensor' import * as flatmap from '@abi-software/flatmap-viewer' @@ -738,7 +737,7 @@ const createUnfilledTooltipData = function () { */ export default { name: 'FlatmapVuer', - mixins: [scicrunchMixin, flatmapImageMixin], + mixins: [imageMixin], components: { Button, Col, @@ -1712,24 +1711,21 @@ export default { if (data.feature.type === 'marker') { this.tooltipType = 'image' - console.log('marker data', data) - console.log('saved images', this.images) - let filteredImages = this.findImagesForAnatomy(this.images, data.resource[0]) - console.log('filtered images:',filteredImages) - this.imageEntry = filteredImages - console.log(data.feature.models); - this.displayTooltip(data.feature.models) - - // let options = { className: 'flatmapvuer-popover' } - // let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] - // if (!this.activeDrawTool) { - // options.positionAtLastClick = true - // } - // this.tooltipDisplay = true; - // this.$nextTick(() => { - // this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); - // this.popUpCssHacks(); - // }); + if (data.resource[0] in this.anatomyImages) { + this.imageEntry = this.anatomyImages[data.resource[0]] + } + // this.displayTooltip(data.feature.models) + + let options = { className: 'flatmapvuer-popover' } + let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] + if (!this.activeDrawTool) { + options.positionAtLastClick = true + } + this.tooltipDisplay = true; + this.$nextTick(() => { + this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); + this.popUpCssHacks(); + }); } else { // Call flatmap database to get the connection data @@ -2461,10 +2457,9 @@ export default { }, addImagesToMap: async function () { if (this.mapImp) { - let response = await this.getImagesFromScicrunch() + let response = await this.getImageDatasetFromScicrunch() if (response && response.success) { - this.images = response.images - this.populateFlatmapWithImages(this.mapImp, response.images) + this.anatomyImages = this.populateViewerWithImages(response.datasets, this.mapImp) } } }, @@ -2797,7 +2792,8 @@ export default { with: true, without: true, } - }) + }), + anatomyImages: {} } }, computed: { diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js deleted file mode 100644 index b1bdb226..00000000 --- a/src/mixins/flatmapImageMixin.js +++ /dev/null @@ -1,67 +0,0 @@ -export default { - // Note that the setting store is included in MapContent.vue - methods: { - populateFlatmapWithImages: function (mapImp, images = []) { - let anatomyList = [] - console.log('images in populateflatmap', images) - images.forEach((image) => { - if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (!anatomyList.includes(anatomy.curie)) { - anatomyList.push(anatomy.curie) - this.createImageThumbnailMarkerUrl(mapImp, anatomy.curie, image.thumbnail) - } - }) - } - }) - }) - }, - findImagesForAnatomy: function (images = [], anatomyToFind) { - let imageList = [] - images.forEach((image) => { - if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (anatomy.curie === anatomyToFind) { - imageList.push(image) - } - }) - } - }) - }) - return imageList - }, - createImageThumbnailMarkerUrl: function (mapImp, id, image) { - return new Promise((resolve, reject) => { - // create the image element - let wrapperElement = document.createElement("div"); - - // download image: - let img = new Image(); - img.src = image; - img.style = "height: auto;width: 50px;margin-right: 80px;" - img.onload = function () { - wrapperElement.appendChild(img); - - // add it to the flatmap - const markerIdentifier = mapImp.addMarker(id, { - element: wrapperElement, - className: "highlight-marker", - cluster: false, - type: "image", - }); - - const marker = mapImp.addMarker(id); - resolve(marker); - }; - - img.onerror = function () { - reject(new Error("Failed to load image at " + image)); - }; - }); - }, - } -} diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js new file mode 100644 index 00000000..89faf1a4 --- /dev/null +++ b/src/mixins/imageMixin.js @@ -0,0 +1,213 @@ +const imageQuery = '"*jp2* OR *vnd.ome.xml* OR *jpx*"'; + +const getView2DImageLink = (rootURL, datasetId, datasetVersion, filePath) => { + return `${rootURL}datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; +}; + +const getView3DImageLink = ( + rootURL, + datasetId, + datasetVersion, + dataset_image +) => { + const viewEncoding = dataset_image.share_link.replace( + "https://sparc.biolucida.net/image?c=", + "" + ); + return ( + rootURL + + "datasets/biolucidaviewer/" + + dataset_image.image_id + + "?view=" + + viewEncoding + + "&dataset_version=" + + datasetVersion + + "&dataset_id=" + + datasetId + + "&item_id=" + + dataset_image.sourcepkg_id + ); +}; + +const getBiolucidaInfo = async function (sparcAPI, datasetId) { + return new Promise((resolve, reject) => { + const endpoint = `${sparcAPI}image_search/${datasetId}`; + fetch(endpoint) + .then((response) => response.json()) + .then((data) => { + if (data.status == "success") { + let imageObjects = {}; + data.dataset_images.forEach((image) => { + if (!(image.image_id in imageObjects)) { + imageObjects[image.image_id] = image; + } + }); + resolve(imageObjects); + } else { + reject(data.reason); + } + }); + }); +}; + +const getAnnotatedBiolucida = function (data) { + let bioList = []; + let bio2DIds = []; + if ("biolucida-2d" in data) { + const bio2DLength = data["biolucida-2d"].length; + for (let i = 0; i < bio2DLength; i++) { + const biolucida = data["biolucida-2d"][i]; + if (biolucida.biolucida) { + bioList.push(biolucida); + bio2DIds.push(biolucida.biolucida.identifier); + } + } + } + if ("biolucida-3d" in data) { + const bio3DLength = data["biolucida-3d"].length; + for (let i = 0; i < bio3DLength; i++) { + const biolucida = data["biolucida-3d"][i]; + if (biolucida.biolucida) { + bioList.push(biolucida); + } + } + } + return { bioList, bio2DIds }; +}; + +export default { + // Note that the setting store is included in MapContent.vue + methods: { + createThumbnailMarkers: function (mapImp, id, image) { + return new Promise((resolve, reject) => { + let wrapperElement = document.createElement("div"); + let img = new Image(); + img.src = image; + img.style = "height: auto;width: 50px;margin-right: 80px;"; + img.onload = function () { + wrapperElement.appendChild(img); + const markerIdentifier = mapImp.addMarker(id, { + element: wrapperElement, + className: "highlight-marker", + cluster: false, + type: "image", + }); + resolve(markerIdentifier); + }; + img.onerror = function () { + reject(new Error("Failed to load image at " + image)); + }; + }); + }, + + populateViewerWithImages: function (datasets, mapImp = undefined) { + let anatomyImageObjects = {}; + const datasetsLength = datasets.length; + for (let i = 0; i < datasetsLength; i++) { + const dataset = datasets[i]; + if (dataset.value && dataset.value.length) { + const imagesLength = dataset.value.length; + for (let j = 0; j < imagesLength; j++) { + const image = dataset.value[j]; + if (image.anatomy && image.anatomy.length) { + const anatomyLength = image.anatomy.length; + for (let k = 0; k < anatomyLength; k++) { + const anatomy = image.anatomy[k]; + const locationIdentifier = mapImp + ? anatomy.curie + : anatomy.name; + if (!(locationIdentifier in anatomyImageObjects)) { + anatomyImageObjects[locationIdentifier] = []; + if (mapImp) { + this.createThumbnailMarkers( + mapImp, + locationIdentifier, + image.thumbnail + ); + } + } + anatomyImageObjects[locationIdentifier].push(image); + } + } + } + } + } + return anatomyImageObjects; + }, + + processResults: async function (results) { + try { + let datasets = []; + const dataType = "Image"; + console.log("starting promise list"); + let promiseList = results.map(async (result) => { + const datasetId = result.dataset_identifier; + const datasetVersion = result.dataset_version; + const biolucidaInfo = await getBiolucidaInfo( + this.sparcAPI, + datasetId + ); + const imageIds = Object.values(biolucidaInfo).map( + (image) => image.image_id + ); + const { bioList, bio2DIds } = getAnnotatedBiolucida(result); + return bioList + .filter((bioImage) => + imageIds.includes(bioImage.biolucida.identifier) + ) + .map((bioImage) => { + const datasetImage = biolucidaInfo[bioImage.biolucida.identifier]; + const link = bio2DIds.includes(bioImage.biolucida.identifier) + ? getView2DImageLink( + this.rootURL, + datasetId, + datasetVersion, + bioImage.dataset.path + ) + : getView3DImageLink( + this.rootURL, + datasetId, + datasetVersion, + datasetImage + ); + return { + title: bioImage.name, + anatomy: result.organs, + species: result.organisms, + datasetId: datasetId, + datasetVersion: datasetVersion, + link: link, + type: dataType, + thumbnail: datasetImage.thumbnail_url, + }; + }); + }); + console.log("promiseList:", promiseList); + let promiseResult = await Promise.allSettled(promiseList); + datasets = promiseResult.flat(); + console.log("promiseResult:", promiseResult); + return datasets; + } catch (error) { + console.error("Error:", error); + return []; + } + }, + + getImageDatasetFromScicrunch: async function () { + const endpoint = + `${this.sparcAPI}multiple_dataset_info/using_multiple_mimetype/?` + + `${new URLSearchParams({ q: imageQuery })}`; + try { + const response = await fetch(endpoint); + const data = await response.json(); + if (data.numberOfHits >= 1) { + let datasets = await this.processResults(data.results); + return { success: true, datasets: datasets }; + } + return { success: false, error: "No datasets found" }; + } catch (error) { + return { success: false, error: error }; + } + }, + }, +}; diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js deleted file mode 100644 index 46bfce27..00000000 --- a/src/services/scicrunchMixin.js +++ /dev/null @@ -1,181 +0,0 @@ -/* eslint-disable no-alert, no-console */ -const imageQuery = '"*jp2* OR *vnd.ome.xml* OR *jpx*"'; - -const generateShareLink = (datasetId, datasetVersion, filePath) => { - const prefix = "https://sparc.biolucida.net"; - return `${prefix}/dataviewer?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; -}; - -const getView2DImageLink = (rootURL, datasetId, datasetVersion, filePath) => { - return `${rootURL}datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; -}; - -const getView3DImageLink = ( - rootURL, - datasetId, - datasetVersion, - dataset_image -) => { - const viewEncoding = dataset_image.share_link.replace( - "https://sparc.biolucida.net/image?c=", - "" - ); - return ( - rootURL + - "datasets/biolucidaviewer/" + - dataset_image.image_id + - "?view=" + - viewEncoding + - "&dataset_version=" + - datasetVersion + - "&dataset_id=" + - datasetId + - "&item_id=" + - dataset_image.sourcepkg_id - ); -}; - -const getBiolucidaInfo = async function (sparcAPI, datasetId) { - return new Promise((resolve, reject) => { - const endpoint = `${sparcAPI}image_search/${datasetId}`; - fetch(endpoint) - .then((response) => response.json()) - .then((data) => { - if (data.status == "success") { - let imageObjects = {}; - data.dataset_images.forEach((image) => { - if (!(image.image_id in imageObjects)) { - imageObjects[image.image_id] = image; - } - }); - resolve(imageObjects); - } else { - reject(data.reason); - } - }); - }); -}; - -const getAnnotatedBiolucida = function (data) { - let annBiolucida = []; - let ann2DBiolucida = []; - if ("biolucida-2d" in data) { - annBiolucida = [...annBiolucida, ...data["biolucida-2d"]]; - ann2DBiolucida = [...annBiolucida, ...data["biolucida-2d"]]; - } - if ("biolucida-3d" in data) { - annBiolucida = [...annBiolucida, ...data["biolucida-3d"]]; - } - annBiolucida = annBiolucida.filter((biolucida) => biolucida.biolucida); - ann2DBiolucida = ann2DBiolucida.filter((biolucida) => biolucida.biolucida); - ann2DBiolucida.map((biolucida) => { - biolucida.biolucida.identifier; - }); - return { annBiolucida, ann2DBiolucida }; -}; - -export default { - // Note that the setting store is included in MapContent.vue - methods: { - getThumbnailURL: function (thumbnailId) { - return `${this.sparcAPI}thumbnail/${thumbnailId}`; - }, - - getSegmentationThumbnailURL: function ( - datasetId, - datasetVersion, - filePath, - s3uri - ) { - return `${this.sparcAPI}thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}&s3uri=${s3uri}`; - }, - - getImagesFromScicrunch: async function () { - try { - const response = await fetch( - `${ - this.sparcAPI - }multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams( - { q: imageQuery } - )}` - ); - const data = await response.json(); - console.log("number of hits:", data.numberOfHits); - if (data.numberOfHits >= 1) { - let images = await this.processResults(data.results); - return { success: true, images: images }; - } - return { success: false }; - } catch (error) { - console.error("Error:", error); - return { success: false }; - } - }, - - processResults: async function (results) { - try { - let images = []; - const dataType = "Image"; - console.log("starting promise list"); - let promiseList = results.map(async (result, i) => { - const datasetId = result.dataset_identifier; - const datasetVersion = result.dataset_version; - const biolucidaInfo = await getBiolucidaInfo( - this.sparcAPI, - datasetId - ); - const imageIds = Object.values(biolucidaInfo).map( - (image) => image.image_id - ); - const { annBiolucida, ann2DBiolucida } = - getAnnotatedBiolucida(result); - return annBiolucida - .filter((bioImage) => - imageIds.includes(bioImage.biolucida.identifier) - ) - .map((bioImage) => { - const datasetImage = biolucidaInfo[bioImage.biolucida.identifier]; - const link = ann2DBiolucida.includes( - bioImage.biolucida.identifier - ) - ? getView2DImageLink( - this.rootURL, - datasetId, - datasetVersion, - bioImage.dataset.path - ) - : getView3DImageLink( - this.rootURL, - datasetId, - datasetVersion, - datasetImage - ); - return { - resource: { - share_link: datasetImage.share_link, - }, - title: bioImage.name, - anatomy: result.organs, - species: result.organisms, - datasetId: datasetId, - datasetVersion: datasetVersion, - link: link, - s3uri: result.s3uri, - type: dataType, - thumbnail: datasetImage.thumbnail_url, - }; - }); - }); - console.log("promiseList:", promiseList); - let biolucidaInfos = await Promise.allSettled(promiseList); - images = biolucidaInfos.flat(); - console.log("biolucidaInfos:", biolucidaInfos); - console.log("finished!"); - return images; - } catch (error) { - console.error("Error:", error); - return []; - } - }, - }, -}; From a732b8bb5731696024d6d1b8720c91828972cddd Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 16 Aug 2024 11:33:04 +1200 Subject: [PATCH 05/47] Demo implementation with new image API still bugs --- package-lock.json | 995 +++++++++++++++++++++++----- package.json | 2 +- src/App.vue | 13 +- src/components/FlatmapVuer.vue | 53 +- src/components/MultiFlatmapVuer.vue | 8 + src/mixins/imageMixin.js | 72 +- 6 files changed, 899 insertions(+), 244 deletions(-) diff --git a/package-lock.json b/package-lock.json index 59b812d0..5556c11d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.3.2-beta.2", "license": "Apache-2.0", "dependencies": { - "@abi-software/flatmap-viewer": "2.9.5", + "@abi-software/flatmap-viewer": "3.0.2", "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", @@ -43,13 +43,14 @@ } }, "node_modules/@abi-software/flatmap-viewer": { - "version": "2.9.5", - "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-2.9.5.tgz", - "integrity": "sha512-Sib5EghUvNmcTyEc4tuEDSE2UBwnBC+1qaVcaF69auwUBrcEH8A4x0kqjEd6TdUV0XF5rVnbov+addBDgdBEdg==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.0.2.tgz", + "integrity": "sha512-rhqUlwvrqFg3pEIKKaBNSW3+95FnQcBU2C/VdXFa2NSQ3ohZ0pdQrn+ZSmh6WlkqH9OKVayKggQy2o16WX0H4A==", "dependencies": { - "@deck.gl/core": "^8.9.35", - "@deck.gl/layers": "^8.9.35", - "@deck.gl/mapbox": "^8.9.35", + "@deck.gl/core": "^9.0.17", + "@deck.gl/geo-layers": "^9.0.18", + "@deck.gl/layers": "^9.0.17", + "@deck.gl/mapbox": "^9.0.17", "@mapbox/mapbox-gl-draw": "^1.4.3", "@turf/area": "^6.5.0", "@turf/bbox": "^6.5.0", @@ -602,58 +603,123 @@ } }, "node_modules/@deck.gl/core": { - "version": "8.9.36", - "resolved": "https://registry.npmjs.org/@deck.gl/core/-/core-8.9.36.tgz", - "integrity": "sha512-mkIv4/fY1jE+iehqSJzUQi75l9cgfx2ZBa1s1AifgLu0TCkCZgRgISV3UnDBECDCmTZ9Cqk+oKq3OGay3Bz1RQ==", - "dependencies": { - "@babel/runtime": "^7.0.0", - "@loaders.gl/core": "^3.4.13", - "@loaders.gl/images": "^3.4.13", - "@luma.gl/constants": "^8.5.21", - "@luma.gl/core": "^8.5.21", - "@luma.gl/webgl": "^8.5.21", - "@math.gl/core": "^3.6.2", - "@math.gl/sun": "^3.6.2", - "@math.gl/web-mercator": "^3.6.2", - "@probe.gl/env": "^3.5.0", - "@probe.gl/log": "^3.5.0", - "@probe.gl/stats": "^3.5.0", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/core/-/core-9.0.27.tgz", + "integrity": "sha512-2lHN9xvQLjcjIfBeWnHIDGhlYfcKkkpzaiNEL5wNiDeF8mIvrHbCwehm24ZhdlEmRFCNfRT6h6swUCp1H3oenQ==", + "dependencies": { + "@loaders.gl/core": "^4.2.0", + "@loaders.gl/images": "^4.2.0", + "@luma.gl/constants": "^9.0.15", + "@luma.gl/core": "^9.0.15", + "@luma.gl/engine": "^9.0.15", + "@luma.gl/shadertools": "^9.0.15", + "@luma.gl/webgl": "^9.0.15", + "@math.gl/core": "^4.0.0", + "@math.gl/sun": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/env": "^4.0.9", + "@probe.gl/log": "^4.0.9", + "@probe.gl/stats": "^4.0.9", + "@types/offscreencanvas": "^2019.6.4", "gl-matrix": "^3.0.0", - "math.gl": "^3.6.2", "mjolnir.js": "^2.7.0" } }, + "node_modules/@deck.gl/extensions": { + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/extensions/-/extensions-9.0.27.tgz", + "integrity": "sha512-vR1sgWBWZkgwIr0z87necPqSuOvQgDVQu11nAxLq+zQ0xYk9QD0dmLf4Ve63/EeOM5auATGqhq3PcEsS0y2sKg==", + "peer": true, + "dependencies": { + "@luma.gl/constants": "^9.0.15", + "@luma.gl/shadertools": "^9.0.15", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" + } + }, + "node_modules/@deck.gl/geo-layers": { + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/geo-layers/-/geo-layers-9.0.27.tgz", + "integrity": "sha512-mIlAr6ff8gJTMfyEkmW6JnmuIcP6haUGKYjr5Gk1MP1zA1/cYktQLrZTK6jQhXq7xqSvHsDWkZdO97P639uSXw==", + "dependencies": { + "@loaders.gl/3d-tiles": "^4.2.0", + "@loaders.gl/gis": "^4.2.0", + "@loaders.gl/loader-utils": "^4.2.0", + "@loaders.gl/mvt": "^4.2.0", + "@loaders.gl/schema": "^4.2.0", + "@loaders.gl/terrain": "^4.2.0", + "@loaders.gl/tiles": "^4.2.0", + "@loaders.gl/wms": "^4.2.0", + "@luma.gl/gltf": "^9.0.15", + "@luma.gl/shadertools": "^9.0.15", + "@math.gl/core": "^4.0.0", + "@math.gl/culling": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@types/geojson": "^7946.0.8", + "h3-js": "^4.1.0", + "long": "^3.2.0" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@deck.gl/extensions": "^9.0.0", + "@deck.gl/layers": "^9.0.0", + "@deck.gl/mesh-layers": "^9.0.0", + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" + } + }, "node_modules/@deck.gl/layers": { - "version": "8.9.36", - "resolved": "https://registry.npmjs.org/@deck.gl/layers/-/layers-8.9.36.tgz", - "integrity": "sha512-sr/QKELXZ4W0ZHb12QC2+EV1bZJOM6cU6kAfOJD5jOVixOcyccr+FnPPGn39VK9cl/VFY0S339ZPs9reyhDFVg==", - "dependencies": { - "@babel/runtime": "^7.0.0", - "@loaders.gl/images": "^3.4.13", - "@loaders.gl/schema": "^3.4.13", - "@luma.gl/constants": "^8.5.21", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/layers/-/layers-9.0.27.tgz", + "integrity": "sha512-+r8w9J9nHOqZt/2vIUsthz6GzjLnRiVCZvvr9ckxGi9IsibX1DgabIQfZ8vAi1AG4ngGswZA4C2mIB6mTLiO4Q==", + "dependencies": { + "@loaders.gl/images": "^4.2.0", + "@loaders.gl/schema": "^4.2.0", "@mapbox/tiny-sdf": "^2.0.5", - "@math.gl/core": "^3.6.2", - "@math.gl/polygon": "^3.6.2", - "@math.gl/web-mercator": "^3.6.2", + "@math.gl/core": "^4.0.0", + "@math.gl/polygon": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", "earcut": "^2.2.4" }, "peerDependencies": { - "@deck.gl/core": "^8.0.0", - "@loaders.gl/core": "^3.4.13", - "@luma.gl/core": "^8.0.0" + "@deck.gl/core": "^9.0.0", + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" } }, "node_modules/@deck.gl/mapbox": { - "version": "8.9.36", - "resolved": "https://registry.npmjs.org/@deck.gl/mapbox/-/mapbox-8.9.36.tgz", - "integrity": "sha512-JUMkxHsaV5/FhKx68cp87vcHTdYTqS1fWpytN7I1B0p1gxhd37iYNU/FtEg3Pxs5ce9zLkjVepF6PALVWnDlGw==", + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/mapbox/-/mapbox-9.0.27.tgz", + "integrity": "sha512-s33A8p1jIutSAy1+29U8LuQn+VR84In2bBxunHfYy/8LvkXfqDcuNGmQraV994Ev3SkUv02nR3Adsx4NB1GBfg==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@types/mapbox-gl": "^2.6.3" + "@luma.gl/constants": "^9.0.15", + "@math.gl/web-mercator": "^4.0.0" }, "peerDependencies": { - "@deck.gl/core": "^8.0.0" + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "^9.0.0" + } + }, + "node_modules/@deck.gl/mesh-layers": { + "version": "9.0.27", + "resolved": "https://registry.npmjs.org/@deck.gl/mesh-layers/-/mesh-layers-9.0.27.tgz", + "integrity": "sha512-+MTKR6+OOl8xL48R/+Q2slJnAVxbfqz5wOH/9miIih96Znnr5BRctkOBdItnrDRqIiNE67f3lq4lzONedsvb3g==", + "peer": true, + "dependencies": { + "@loaders.gl/gltf": "^4.2.0", + "@luma.gl/gltf": "^9.0.15", + "@luma.gl/shadertools": "^9.0.15" + }, + "peerDependencies": { + "@deck.gl/core": "^9.0.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" } }, "node_modules/@digitalbazaar/http-client": { @@ -1314,116 +1380,360 @@ "integrity": "sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==", "dev": true }, + "node_modules/@loaders.gl/3d-tiles": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/3d-tiles/-/3d-tiles-4.2.2.tgz", + "integrity": "sha512-op7KelDjEahz+ViFmavJdHw10n6lRZeTefC/cVYVQ1Jfvb8T+55KaOOXGoZODo14/B8Z53FnyPGVqR68dBYARw==", + "dependencies": { + "@loaders.gl/compression": "4.2.2", + "@loaders.gl/crypto": "4.2.2", + "@loaders.gl/draco": "4.2.2", + "@loaders.gl/gltf": "4.2.2", + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/math": "4.2.2", + "@loaders.gl/tiles": "4.2.2", + "@loaders.gl/zip": "4.2.2", + "@math.gl/core": "^4.0.1", + "@math.gl/culling": "^4.0.1", + "@math.gl/geospatial": "^4.0.1", + "@probe.gl/log": "^4.0.4", + "long": "^5.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/3d-tiles/node_modules/long": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", + "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" + }, + "node_modules/@loaders.gl/compression": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/compression/-/compression-4.2.2.tgz", + "integrity": "sha512-dBFjMe4zLhE4NXfVsPkhs267/55qnxgP/AIhksOKTx30gQxCtcty6RWhfWGnluTnbAEXID2Uq/vfp1HYH7ZYCg==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "@types/brotli": "^1.3.0", + "@types/pako": "^1.0.1", + "fflate": "0.7.4", + "lzo-wasm": "^0.0.4", + "pako": "1.0.11", + "snappyjs": "^0.6.1" + }, + "optionalDependencies": { + "brotli": "^1.3.2", + "lz4js": "^0.2.0", + "zstd-codec": "^0.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, "node_modules/@loaders.gl/core": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-3.4.15.tgz", - "integrity": "sha512-rPOOTuusWlRRNMWg7hymZBoFmPCXWThsA5ZYRfqqXnsgVeQIi8hzcAhJ7zDUIFAd/OSR8ravtqb0SH+3k6MOFQ==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/core/-/core-4.2.2.tgz", + "integrity": "sha512-d3YElSsqL29MaiOwzGB97v994SPotbTvJnooCqoQsYGoYYrECdIetv1/zlfDsh5UB2Wl/NaUMJrzyOqlLmDz5Q==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "@probe.gl/log": "^4.0.2" + } + }, + "node_modules/@loaders.gl/crypto": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/crypto/-/crypto-4.2.2.tgz", + "integrity": "sha512-0rbpHX8784wkcTb8+gjkzAxdA4p2CH3W5xxzdvpG4r37jVQwKYrh2NJxeF+xGIuuxlEaxD8x4kcyadKgCVtspA==", "dependencies": { - "@babel/runtime": "^7.3.1", - "@loaders.gl/loader-utils": "3.4.15", - "@loaders.gl/worker-utils": "3.4.15", - "@probe.gl/log": "^3.5.0" + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "@types/crypto-js": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/draco": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/draco/-/draco-4.2.2.tgz", + "integrity": "sha512-WM7Zw6+04QzqlXjUYibR63Zi4I2iuBaDR41Rguur1s+ns2faiHDyEvuFlKtArTChFPQ8Xzf+6MNt7JeR8kpZTA==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "draco3d": "1.5.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/gis": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/gis/-/gis-4.2.2.tgz", + "integrity": "sha512-s9kD6yLMKn8+jAhDFDVWBeeKcDkJHFrscTnVWveGBfnC7IYT4gD6lQeHRIfXrJKs0LWmKPrAS8grTq7Ull8V6Q==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@mapbox/vector-tile": "^1.3.1", + "@math.gl/polygon": "^4.0.0", + "pbf": "^3.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/gltf": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/gltf/-/gltf-4.2.2.tgz", + "integrity": "sha512-AK90PnRoaZ1jw/QWkg6TEJG8Yxd/QefxwlbMRJvtgk7QafsYo8dMm0e7EYgyOms0wDOcPflm5LHkIoqViRp/ww==", + "dependencies": { + "@loaders.gl/draco": "4.2.2", + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/textures": "4.2.2", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" } }, "node_modules/@loaders.gl/images": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-3.4.15.tgz", - "integrity": "sha512-QpjYhEetHabY/z9mWZYJXZZp4XJAxa38f9Ii/DjPlnJErepzY5GLBUTDHMu4oZ6n99gGImtuGFicDnFV6mb60g==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/images/-/images-4.2.2.tgz", + "integrity": "sha512-R53rkexvVT0i4YXt++r8gLq3reB6kWTLvdJL81J3R4YJbM5+kNSe40jJOA94LFYlsTN+oirF4lkLTe5YXGZPYQ==", "dependencies": { - "@loaders.gl/loader-utils": "3.4.15" + "@loaders.gl/loader-utils": "4.2.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" } }, "node_modules/@loaders.gl/loader-utils": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-3.4.15.tgz", - "integrity": "sha512-uUx6tCaky6QgCRkqCNuuXiUfpTzKV+ZlJOf6C9bKp62lpvFOv9AwqoXmL23j8nfsENdlzsX3vPhc3en6QQyksA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/loader-utils/-/loader-utils-4.2.2.tgz", + "integrity": "sha512-5udJQhFx1KNIcRBYkFMi8QZitAsK+m3PkZ9GejM8VpOSsJUHD2Yal3wBHOPTRsOjQ0zXG/nqM7BHOojjeetNTg==", + "dependencies": { + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/math": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/math/-/math-4.2.2.tgz", + "integrity": "sha512-nfiNNxXobhdKJILlHDWvm92SMEMMh1XAsb4BYvRIHyTzw4KzflFMS6C62v8ctAW6P8pQKyRvuos9LcRyroty1A==", "dependencies": { - "@babel/runtime": "^7.3.1", - "@loaders.gl/worker-utils": "3.4.15", - "@probe.gl/stats": "^3.5.0" + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/mvt": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/mvt/-/mvt-4.2.2.tgz", + "integrity": "sha512-KglhYp1rwIs6h6AtrmKjrEYWxcX6xhlG3c3pTIFJwfA5nMBa+cmzD19vBRo1po9hzWKq4oqqhi7JL0ovH6GAqw==", + "dependencies": { + "@loaders.gl/gis": "4.2.2", + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@math.gl/polygon": "^4.0.0", + "pbf": "^3.2.1" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" } }, "node_modules/@loaders.gl/schema": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-3.4.15.tgz", - "integrity": "sha512-8oRtstz0IsqES7eZd2jQbmCnmExCMtL8T6jWd1+BfmnuyZnQ0B6TNccy++NHtffHdYuzEoQgSELwcdmhSApYew==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/schema/-/schema-4.2.2.tgz", + "integrity": "sha512-vrQ6vlGWWptJXDP1DrL5x/j70xmyt2l36QZcGyDYptrohTGvQLc3yrOEHuD5v96fXX5WR619pT3zSYhuf1FnIg==", "dependencies": { "@types/geojson": "^7946.0.7" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/terrain": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/terrain/-/terrain-4.2.2.tgz", + "integrity": "sha512-M5wDS20y0TTq9giCONLOWSIznD9H4JxfU1wicyEGUOa8U2u0Fdau5TObr//fOcT+Tvemkvcn01Oxj8acJWIsGw==", + "dependencies": { + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@mapbox/martini": "^0.2.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/textures": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/textures/-/textures-4.2.2.tgz", + "integrity": "sha512-UlxCCi7VbCloj4VCzSULASgGVA059jglQYLc3kIHclvGoMcx3MJi0hID0MEQ6IhdO9Zyn4F42doVPrriNDVJFQ==", + "dependencies": { + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/worker-utils": "4.2.2", + "@math.gl/types": "^4.0.1", + "ktx-parse": "^0.0.4", + "texture-compressor": "^1.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/tiles": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/tiles/-/tiles-4.2.2.tgz", + "integrity": "sha512-mozBA1FOrOFXa0lBxrRvHoRxsSb9T8D6ZfFIpbVR1z0zEWKm+NgRQzO8yS4IJD/CPFOn/r31SolZII6yXnzWbg==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/math": "4.2.2", + "@math.gl/core": "^4.0.0", + "@math.gl/culling": "^4.0.0", + "@math.gl/geospatial": "^4.0.0", + "@math.gl/web-mercator": "^4.0.0", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/wms": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/wms/-/wms-4.2.2.tgz", + "integrity": "sha512-MoZqOgebyXsElfNbjX/el4jA9Rypusq7Z+cJ1tiP2yBTepuLkPBpXLeuUgt/v0MOqGoUWrkUY8I811ijkZYyjA==", + "dependencies": { + "@loaders.gl/images": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "@loaders.gl/xml": "4.2.2", + "@turf/rewind": "^5.1.5", + "deep-strict-equal": "^0.2.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" } }, "node_modules/@loaders.gl/worker-utils": { - "version": "3.4.15", - "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-3.4.15.tgz", - "integrity": "sha512-zUUepOYRYmcYIcr/c4Mchox9h5fBFNkD81rsGnLlZyq19QvyHzN+93SVxrLc078gw93t2RKrVcOOZY13zT3t1w==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/worker-utils/-/worker-utils-4.2.2.tgz", + "integrity": "sha512-7Ad83VS/PmS0T3LXo+LB6cq5oHhAUW3GvYWizm4OfeuBDQRtYK7iRehgC13/BomkNtWIn0y7iAphlQMVrNdvhQ==", + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/xml": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/xml/-/xml-4.2.2.tgz", + "integrity": "sha512-ADikkGCwkS6d2IwFPomVAZfTNEHC6xXqDFbzfhYThsG3ptPpeosjJmn4GdI4dyazTsQnKIeiqV/RLS4CvJgxzw==", + "dependencies": { + "@loaders.gl/loader-utils": "4.2.2", + "@loaders.gl/schema": "4.2.2", + "fast-xml-parser": "^4.2.5" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" + } + }, + "node_modules/@loaders.gl/zip": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@loaders.gl/zip/-/zip-4.2.2.tgz", + "integrity": "sha512-8wuhWrmGFUb9X7i1E9ObhqyiYuwQj6x0ttzujXE6o83T8TI1i88fySttMe0LSV2aIrTLo8A5n6MOf2LPSefPYg==", "dependencies": { - "@babel/runtime": "^7.3.1" + "@loaders.gl/compression": "4.2.2", + "@loaders.gl/crypto": "4.2.2", + "@loaders.gl/loader-utils": "4.2.2", + "jszip": "^3.1.5", + "md5": "^2.3.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.0.0" } }, "node_modules/@luma.gl/constants": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/constants/-/constants-8.5.21.tgz", - "integrity": "sha512-aJxayGxTT+IRd1vfpcgD/cKSCiVJjBNiuiChS96VulrmCvkzUOLvYXr42y5qKB4RyR7vOIda5uQprNzoHrhQAA==" + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/constants/-/constants-9.0.23.tgz", + "integrity": "sha512-s/ZhIyEQMisXYj8HCMywcSyem5b8XbVzGPeiftG0k52Nm8+I6Z7cSrF8B88B7GoHVJylwaKyPMXGSXy19STz4w==" }, "node_modules/@luma.gl/core": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/core/-/core-8.5.21.tgz", - "integrity": "sha512-11jQJQEMoR/IN2oIsd4zFxiQJk6FE+xgVIMUcsCTBuzafTtQZ8Po9df8mt+MVewpDyBlTVs6g8nxHRH4np1ukA==", + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/core/-/core-9.0.23.tgz", + "integrity": "sha512-7ZU5lKaIfpkqIIL/fF4vLqfeAo1VyFCdHz9MdcKmKFKig7QE6B97BygiVUOwRgOCgrxIpdMZS16JeKIiZFVdwQ==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/engine": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@luma.gl/shadertools": "8.5.21", - "@luma.gl/webgl": "8.5.21" + "@math.gl/types": "^4.0.0", + "@probe.gl/env": "^4.0.2", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2", + "@types/offscreencanvas": "^2019.6.4" } }, "node_modules/@luma.gl/engine": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/engine/-/engine-8.5.21.tgz", - "integrity": "sha512-IG3WQSKXFNUEs8QG7ZjHtGiOtsakUu+BAxtJ6997A6/F06yynZ44tPe5NU70jG9Yfu3kV0LykPZg7hO3vXZDiA==", + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/engine/-/engine-9.0.23.tgz", + "integrity": "sha512-npv8VUlaWbJOPrAtBqJGqWqR0BZZvoVqB3vB90MPi6b0s4BaETP3x4QEthxqQb386+Z2HgjCbPcNRFnUdSErcg==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@luma.gl/shadertools": "8.5.21", - "@luma.gl/webgl": "8.5.21", - "@math.gl/core": "^3.5.0", - "@probe.gl/env": "^3.5.0", - "@probe.gl/stats": "^3.5.0", - "@types/offscreencanvas": "^2019.7.0" + "@luma.gl/shadertools": "9.0.23", + "@math.gl/core": "^4.0.0", + "@probe.gl/log": "^4.0.2", + "@probe.gl/stats": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, - "node_modules/@luma.gl/gltools": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/gltools/-/gltools-8.5.21.tgz", - "integrity": "sha512-6qZ0LaT2Mxa4AJT5F44TFoaziokYiHUwO45vnM/NYUOIu9xevcmS6VtToawytMEACGL6PDeDyVqP3Y80SDzq5g==", + "node_modules/@luma.gl/gltf": { + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/gltf/-/gltf-9.0.23.tgz", + "integrity": "sha512-FVYa/Umn68OJNLbX3NZT/t3LO4RDd0mdtxyJe9+59sGTEOIyU2scEhMj8mua8RnNnOcF2u4zr9eZ/AQFWGF7Xg==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@probe.gl/env": "^3.5.0", - "@probe.gl/log": "^3.5.0", - "@types/offscreencanvas": "^2019.7.0" + "@loaders.gl/textures": "^4.2.0", + "@luma.gl/shadertools": "9.0.23", + "@math.gl/core": "^4.0.0" + }, + "peerDependencies": { + "@loaders.gl/core": "^4.2.0", + "@luma.gl/core": "^9.0.0", + "@luma.gl/engine": "^9.0.0" } }, "node_modules/@luma.gl/shadertools": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/shadertools/-/shadertools-8.5.21.tgz", - "integrity": "sha512-WQah7yFDJ8cNCLPYpIm3r0wSlXLvjoA279fcknmATvvkW3/i8PcCJ/nYEBJO3hHEwwMQxD16+YZu/uwGiifLMg==", + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/shadertools/-/shadertools-9.0.23.tgz", + "integrity": "sha512-qgSHxl+6nEEvAFSa09QiMesPVOxPdttH/UiTld++VkVHEQPE0tau4tBcBHbDCZNn9KeybA31TCkcbovH/zTcRQ==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@math.gl/core": "^3.5.0" + "@math.gl/core": "^4.0.0", + "@math.gl/types": "^4.0.0", + "wgsl_reflect": "^1.0.1" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, "node_modules/@luma.gl/webgl": { - "version": "8.5.21", - "resolved": "https://registry.npmjs.org/@luma.gl/webgl/-/webgl-8.5.21.tgz", - "integrity": "sha512-ZVLO4W5UuaOlzZIwmFWhnmZ1gYoU97a+heMqxLrSSmCUAsSu3ZETUex9gOmzdM1WWxcdWaa3M68rvKCNEgwz0Q==", + "version": "9.0.23", + "resolved": "https://registry.npmjs.org/@luma.gl/webgl/-/webgl-9.0.23.tgz", + "integrity": "sha512-ZicCtMbzOPq/1dEPF/0blZ6tVh14nBeZQ3LP2QUT76PjyM5rdwlLTVeAvgL235lla/fKcizMOqY0uT81h3Cbaw==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@luma.gl/constants": "8.5.21", - "@luma.gl/gltools": "8.5.21", - "@probe.gl/env": "^3.5.0", - "@probe.gl/stats": "^3.5.0" + "@luma.gl/constants": "9.0.23", + "@probe.gl/env": "^4.0.2" + }, + "peerDependencies": { + "@luma.gl/core": "^9.0.0" } }, "node_modules/@mapbox/extent": { @@ -1515,6 +1825,11 @@ "xtend": "^4.0.2" } }, + "node_modules/@mapbox/martini": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@mapbox/martini/-/martini-0.2.0.tgz", + "integrity": "sha512-7hFhtkb0KTLEls+TRw/rWayq5EeHtTaErgm/NskVoXmtgAQu/9D299aeyj6mzAR/6XUnYRp2lU+4IcrYRFjVsQ==" + }, "node_modules/@mapbox/point-geometry": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-0.1.0.tgz", @@ -1572,44 +1887,51 @@ "integrity": "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==" }, "node_modules/@math.gl/core": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-3.6.3.tgz", - "integrity": "sha512-jBABmDkj5uuuE0dTDmwwss7Cup5ZwQ6Qb7h1pgvtkEutTrhkcv8SuItQNXmF45494yIHeoGue08NlyeY6wxq2A==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/core/-/core-4.0.1.tgz", + "integrity": "sha512-9IewNjR9V66o+gYIIq5agFoHy6ZT6DRpRGQBfsUpZz4glAqOjVt64he8GGzjpmqfT+kKT4qwQ7nQl/hZLF15qA==", "dependencies": { - "@babel/runtime": "^7.12.0", - "@math.gl/types": "3.6.3", - "gl-matrix": "^3.4.0" + "@math.gl/types": "4.0.1" } }, - "node_modules/@math.gl/polygon": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/polygon/-/polygon-3.6.3.tgz", - "integrity": "sha512-FivQ1ZnYcAss1wVifOkHP/ZnlfQy1IL/769uzNtiHxwUbW0kZG3yyOZ9I7fwyzR5Hvqt3ErJKHjSYZr0uVlz5g==", + "node_modules/@math.gl/culling": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/culling/-/culling-4.0.1.tgz", + "integrity": "sha512-lv83sMKp0n1HjORhuNtWgX9ylYyj+/zHEPF0xxRXZvcpurB85fhgFLhvR81KLjmSbhQmFgzl0fZe7Ei3WxEP5Q==", "dependencies": { - "@math.gl/core": "3.6.3" + "@math.gl/core": "4.0.1" } }, - "node_modules/@math.gl/sun": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/sun/-/sun-3.6.3.tgz", - "integrity": "sha512-mrx6CGYYeTNSQttvcw0KVUy+35YDmnjMqpO/o0t06Vcghrt0HNruB/ScRgUSbJrgkbOg1Vcqm23HBd++clzQzw==", + "node_modules/@math.gl/geospatial": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/geospatial/-/geospatial-4.0.1.tgz", + "integrity": "sha512-FfTUMk8uRlBa4W3dMSFwPjRgdEBnOeVjBr3mcGqb3lHA/PPMvKuE+o7OJfA61Wj6ItuZqCEZHbLbA3WRAENoqQ==", + "dependencies": { + "@math.gl/core": "4.0.1" + } + }, + "node_modules/@math.gl/polygon": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/polygon/-/polygon-4.0.1.tgz", + "integrity": "sha512-pwtEbwW3N5qy09K/1FwRYW7M2u9XMPBfIe8BNpkbJh8uH3DPXQdT4uCNFiwrQPPQUQTDdlQyLu/0mRHm2R/fbg==", "dependencies": { - "@babel/runtime": "^7.12.0" + "@math.gl/core": "4.0.1" } }, + "node_modules/@math.gl/sun": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/sun/-/sun-4.0.1.tgz", + "integrity": "sha512-nDkQZ9PKd5iMySRM1j01hYG6MwA/MkKXZe4JvArggWUtPXL6nCcPSeiifPXQGIvE9eZdQkbn81StNY9q5l0cFg==" + }, "node_modules/@math.gl/types": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-3.6.3.tgz", - "integrity": "sha512-3uWLVXHY3jQxsXCr/UCNPSc2BG0hNUljhmOBt9l+lNFDp7zHgm0cK2Tw4kj2XfkJy4TgwZTBGwRDQgWEbLbdTA==" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/types/-/types-4.0.1.tgz", + "integrity": "sha512-E9qBKAjVBiZD8Is7TbygiLGtYBP3GSLus6RUJSuzFQegdYXeVagvrs4UkBJxhrRAxw4crfH0Tq7IhTMKuuJNQw==" }, "node_modules/@math.gl/web-mercator": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-3.6.3.tgz", - "integrity": "sha512-UVrkSOs02YLehKaehrxhAejYMurehIHPfFQvPFZmdJHglHOU4V2cCUApTVEwOksvCp161ypEqVp+9H6mGhTTcw==", - "dependencies": { - "@babel/runtime": "^7.12.0", - "gl-matrix": "^3.4.0" - } + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@math.gl/web-mercator/-/web-mercator-4.0.1.tgz", + "integrity": "sha512-eJ0nDw8140kJorf8ASyKRC53rI+UG6vPxpsKJiGRD6lXsoKTeKYebeEAXiGDWTvi2AMe6+xngxTqqwm58fL3Fw==" }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.5", @@ -1654,29 +1976,22 @@ } }, "node_modules/@probe.gl/env": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-3.6.0.tgz", - "integrity": "sha512-4tTZYUg/8BICC3Yyb9rOeoKeijKbZHRXBEKObrfPmX4sQmYB15ZOUpoVBhAyJkOYVAM8EkPci6Uw5dLCwx2BEQ==", - "dependencies": { - "@babel/runtime": "^7.0.0" - } + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/env/-/env-4.0.9.tgz", + "integrity": "sha512-AOmVMD0/j78mX+k4+qX7ZhE0sY9H+EaJgIO6trik0BwV6VcrwxTGCGFAeuRsIGhETDnye06tkLXccYatYxAYwQ==" }, "node_modules/@probe.gl/log": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-3.6.0.tgz", - "integrity": "sha512-hjpyenpEvOdowgZ1qMeCJxfRD4JkKdlXz0RC14m42Un62NtOT+GpWyKA4LssT0+xyLULCByRAtG2fzZorpIAcA==", + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/log/-/log-4.0.9.tgz", + "integrity": "sha512-ebuZaodSRE9aC+3bVC7cKRHT8garXeT1jTbj1R5tQRqQYc9iGeT3iemVOHx5bN9Q6gAs/0j54iPI+1DvWMAW4A==", "dependencies": { - "@babel/runtime": "^7.0.0", - "@probe.gl/env": "3.6.0" + "@probe.gl/env": "4.0.9" } }, "node_modules/@probe.gl/stats": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-3.6.0.tgz", - "integrity": "sha512-JdALQXB44OP4kUBN/UrQgzbJe4qokbVF4Y8lkIA8iVCFnjVowWIgkD/z/0QO65yELT54tTrtepw1jScjKB+rhQ==", - "dependencies": { - "@babel/runtime": "^7.0.0" - } + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@probe.gl/stats/-/stats-4.0.9.tgz", + "integrity": "sha512-Q9Xt/sJUQaMsbjRKjOscv2t7wXIymTrOEJ4a3da4FTCn7bkKvcdxdyFAQySCrtPxE+YZ5I5lXpWPgv9BwmpE1g==" }, "node_modules/@rollup/pluginutils": { "version": "5.1.0", @@ -1946,6 +2261,20 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/boolean-clockwise": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/boolean-clockwise/-/boolean-clockwise-5.1.5.tgz", + "integrity": "sha512-FqbmEEOJ4rU4/2t7FKx0HUWmjFEVqR+NJrFP7ymGSjja2SQ7Q91nnBihGuT+yuHHl6ElMjQ3ttsB/eTmyCycxA==", + "dependencies": { + "@turf/helpers": "^5.1.5", + "@turf/invariant": "^5.1.5" + } + }, + "node_modules/@turf/boolean-clockwise/node_modules/@turf/helpers": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", + "integrity": "sha512-/lF+JR+qNDHZ8bF9d+Cp58nxtZWJ3sqFe6n3u3Vpj+/0cqkjk4nXKYBSY0azm+GIYB5mWKxUXvuP/m0ZnKj1bw==" + }, "node_modules/@turf/clone": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/clone/-/clone-6.5.0.tgz", @@ -1965,6 +2294,19 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/invariant": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-5.2.0.tgz", + "integrity": "sha512-28RCBGvCYsajVkw2EydpzLdcYyhSA77LovuOvgCJplJWaNVyJYH6BOR3HR9w50MEkPqb/Vc/jdo6I6ermlRtQA==", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/@turf/invariant/node_modules/@turf/helpers": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", + "integrity": "sha512-/lF+JR+qNDHZ8bF9d+Cp58nxtZWJ3sqFe6n3u3Vpj+/0cqkjk4nXKYBSY0azm+GIYB5mWKxUXvuP/m0ZnKj1bw==" + }, "node_modules/@turf/meta": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", @@ -1989,6 +2331,39 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/rewind": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/rewind/-/rewind-5.1.5.tgz", + "integrity": "sha512-Gdem7JXNu+G4hMllQHXRFRihJl3+pNl7qY+l4qhQFxq+hiU1cQoVFnyoleIqWKIrdK/i2YubaSwc3SCM7N5mMw==", + "dependencies": { + "@turf/boolean-clockwise": "^5.1.5", + "@turf/clone": "^5.1.5", + "@turf/helpers": "^5.1.5", + "@turf/invariant": "^5.1.5", + "@turf/meta": "^5.1.5" + } + }, + "node_modules/@turf/rewind/node_modules/@turf/clone": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/clone/-/clone-5.1.5.tgz", + "integrity": "sha512-//pITsQ8xUdcQ9pVb4JqXiSqG4dos5Q9N4sYFoWghX21tfOV2dhc5TGqYOhnHrQS7RiKQL1vQ48kIK34gQ5oRg==", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, + "node_modules/@turf/rewind/node_modules/@turf/helpers": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", + "integrity": "sha512-/lF+JR+qNDHZ8bF9d+Cp58nxtZWJ3sqFe6n3u3Vpj+/0cqkjk4nXKYBSY0azm+GIYB5mWKxUXvuP/m0ZnKj1bw==" + }, + "node_modules/@turf/rewind/node_modules/@turf/meta": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-5.2.0.tgz", + "integrity": "sha512-ZjQ3Ii62X9FjnK4hhdsbT+64AYRpaI8XMBMcyftEOGSmPMUVnkbvuv3C9geuElAXfQU7Zk1oWGOcrGOD9zr78Q==", + "dependencies": { + "@turf/helpers": "^5.1.5" + } + }, "node_modules/@types/body-parser": { "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", @@ -2008,6 +2383,14 @@ "@types/node": "*" } }, + "node_modules/@types/brotli": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/@types/brotli/-/brotli-1.3.4.tgz", + "integrity": "sha512-cKYjgaS2DMdCKF7R0F5cgx1nfBYObN2ihIuPGQ4/dlIY6RpV7OWNwe9L8V4tTVKL2eZqOkNM9FM/rgTvLf4oXw==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -2027,6 +2410,11 @@ "@types/node": "*" } }, + "node_modules/@types/crypto-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz", + "integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==" + }, "node_modules/@types/eslint": { "version": "8.56.10", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", @@ -2172,14 +2560,6 @@ "@types/pbf": "*" } }, - "node_modules/@types/mapbox-gl": { - "version": "2.7.21", - "resolved": "https://registry.npmjs.org/@types/mapbox-gl/-/mapbox-gl-2.7.21.tgz", - "integrity": "sha512-Dx9MuF2kKgT/N22LsMUB4b3acFZh9clVqz9zv1fomoiPoBrJolwYxpWA/9LPO/2N0xWbKi4V+pkjTaFkkx/4wA==", - "dependencies": { - "@types/geojson": "*" - } - }, "node_modules/@types/markdown-it": { "version": "14.1.1", "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.1.tgz", @@ -2206,7 +2586,6 @@ "version": "20.14.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.2.tgz", "integrity": "sha512-xyu6WAMVwv6AKFLB+e/7ySZVr/0zLCzOa7rSpq6jNwpqOrUbcACDWC+53d4n2QHOnDou0fbIsg8wZu/sxrnI4Q==", - "dev": true, "dependencies": { "undici-types": "~5.26.4" } @@ -2225,6 +2604,11 @@ "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==" }, + "node_modules/@types/pako": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@types/pako/-/pako-1.0.7.tgz", + "integrity": "sha512-YBtzT2ztNF6R/9+UXj2wTGFnC9NklAnASt3sC0h2m1bbH7G6FyBIkt4AN8ThZpNfxUo1b2iMVO0UawiJymEt8A==" + }, "node_modules/@types/pbf": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/@types/pbf/-/pbf-3.0.5.tgz", @@ -3729,6 +4113,15 @@ "node": ">=8" } }, + "node_modules/brotli": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/brotli/-/brotli-1.3.3.tgz", + "integrity": "sha512-oTKjJdShmDuGW94SyyaoQvAjf30dZaHnjJ8uAF+u2/vGJkJbJPJAT1gDiOJP5v1Zb6f9KEyW/1HpuaWIXtGHPg==", + "optional": true, + "dependencies": { + "base64-js": "^1.1.2" + } + }, "node_modules/browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -3769,6 +4162,14 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/buf-compare": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", + "integrity": "sha512-Bvx4xH00qweepGc43xFvMs5BKASXTbHaHm6+kDYIK9p/4iFwjATQkmPKHQSgJZzKbAymhztRbXUf1Nqhzl73/Q==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -3946,6 +4347,14 @@ "node": ">=4" } }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "engines": { + "node": "*" + } + }, "node_modules/check-more-types": { "version": "2.24.0", "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", @@ -4363,6 +4772,18 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "dev": true }, + "node_modules/core-assert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", + "integrity": "sha512-IG97qShIP+nrJCXMCgkNZgH7jZQ4n8RpPyPeXX++T6avR/KhLhgLiHKoEn5Rc1KjfycSfA9DMa6m+4C4eguHhw==", + "dependencies": { + "buf-compare": "^1.0.0", + "is-error": "^2.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/core-js": { "version": "3.37.1", "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.37.1.tgz", @@ -4376,8 +4797,7 @@ "node_modules/core-util-is": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", - "dev": true + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==" }, "node_modules/cross-fetch": { "version": "3.1.8", @@ -4400,6 +4820,14 @@ "node": ">= 8" } }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "engines": { + "node": "*" + } + }, "node_modules/css-element-queries": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/css-element-queries/-/css-element-queries-1.2.3.tgz", @@ -4761,6 +5189,17 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, + "node_modules/deep-strict-equal": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/deep-strict-equal/-/deep-strict-equal-0.2.0.tgz", + "integrity": "sha512-3daSWyvZ/zwJvuMGlzG1O+Ow0YSadGfb3jsh9xoCutv2tWyB9dA4YvR9L9/fSdDZa2dByYQe+TqapSGUrjnkoA==", + "dependencies": { + "core-assert": "^0.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/default-gateway": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", @@ -4997,6 +5436,11 @@ "tslib": "^2.0.3" } }, + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==" + }, "node_modules/earcut": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/earcut/-/earcut-2.2.4.tgz", @@ -6333,6 +6777,27 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, + "node_modules/fast-xml-parser": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.1.tgz", + "integrity": "sha512-xkjOecfnKGkSsOwtZ5Pz7Us/T6mrbPQrq0nh+aCO5V9nk5NLWmasAHumTKjiPJPWANe+kAZ84Jc8ooJkzZ88Sw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/NaturalIntelligence" + }, + { + "type": "paypal", + "url": "https://paypal.me/naturalintelligence" + } + ], + "dependencies": { + "strnum": "^1.0.5" + }, + "bin": { + "fxparser": "src/cli/cli.js" + } + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -6384,6 +6849,11 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/fflate": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.7.4.tgz", + "integrity": "sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==" + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -6987,6 +7457,16 @@ "graphology-types": ">=0.23.0" } }, + "node_modules/h3-js": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/h3-js/-/h3-js-4.1.0.tgz", + "integrity": "sha512-LQhmMl1dRQQjMXPzJc7MpZ/CqPOWWuAvVEoVJM9n/s7vHypj+c3Pd5rLQCkAsOgAoAYKbNCsYFE++LF7MvSfCQ==", + "engines": { + "node": ">=4", + "npm": ">=3", + "yarn": ">=1.3.0" + } + }, "node_modules/hammerjs": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/hammerjs/-/hammerjs-2.0.8.tgz", @@ -7526,6 +8006,22 @@ "node": ">= 4" } }, + "node_modules/image-size": { + "version": "0.7.5", + "resolved": "https://registry.npmjs.org/image-size/-/image-size-0.7.5.tgz", + "integrity": "sha512-Hiyv+mXHfFEP7LzUL/llg9RwFxxY+o9N3JVLIeG5E7iFIFAalxvRU9UZthBdYDEVnzHMgjnKJPPpay5BWf1g9g==", + "bin": { + "image-size": "bin/image-size.js" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "node_modules/immutable": { "version": "4.3.6", "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.6.tgz", @@ -7681,6 +8177,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -7758,6 +8259,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-error": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", + "integrity": "sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==" + }, "node_modules/is-extendable": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", @@ -8300,6 +8806,49 @@ "node": ">=4.0" } }, + "node_modules/jszip": { + "version": "3.10.1", + "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", + "integrity": "sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "setimmediate": "^1.0.5" + } + }, + "node_modules/jszip/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==" + }, + "node_modules/jszip/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/jszip/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/jszip/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/kdbush": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/kdbush/-/kdbush-4.0.2.tgz", @@ -8321,6 +8870,11 @@ "node": ">=0.10.0" } }, + "node_modules/ktx-parse": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/ktx-parse/-/ktx-parse-0.0.4.tgz", + "integrity": "sha512-LY3nrmfXl+wZZdPxgJ3ZmLvG+wkOZZP3/dr4RbQj1Pk3Qwz44esOOSFFVQJcNWpXAtiNIC66WgXufX/SYgYz6A==" + }, "node_modules/ky": { "version": "0.33.3", "resolved": "https://registry.npmjs.org/ky/-/ky-0.33.3.tgz", @@ -8404,6 +8958,14 @@ "node": ">= 0.8.0" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/listr2": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", @@ -8741,6 +9303,14 @@ "node": ">=8" } }, + "node_modules/long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha512-ZYvPPOMqUwPoDsbJaR10iQJYnMuZhRTvHYl62ErLIEX7RgFlziSBUUvrt3OVfc47QlHHpzPZYP17g3Fv7oeJkg==", + "engines": { + "node": ">=0.6" + } + }, "node_modules/loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -8772,6 +9342,17 @@ "node": ">=10" } }, + "node_modules/lz4js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/lz4js/-/lz4js-0.2.0.tgz", + "integrity": "sha512-gY2Ia9Lm7Ep8qMiuGRhvUq0Q7qUereeldZPP1PMEJxPtEWHJLqw9pgX68oHajBH0nzJK4MaZEA/YNV3jT8u8Bg==", + "optional": true + }, + "node_modules/lzo-wasm": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/lzo-wasm/-/lzo-wasm-0.0.4.tgz", + "integrity": "sha512-VKlnoJRFrB8SdJhlVKvW5vI1gGwcZ+mvChEXcSX6r2xDNc/Q2FD9esfBmGCuPZdrJ1feO+YcVFd2PTk0c137Gw==" + }, "node_modules/magic-string": { "version": "0.30.10", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", @@ -8827,14 +9408,6 @@ "integrity": "sha512-1I+1qpDt4idfgLQG+BNWmrqku+7/2bi5nLf4YwF8y8zXvmfiTBY3PV3ZibfrjBueCByROpuBjLLFCajqkgYoLQ==", "dev": true }, - "node_modules/math.gl": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/math.gl/-/math.gl-3.6.3.tgz", - "integrity": "sha512-Yq9CyECvSDox9+5ETi2+x1bGTY5WvGUGL3rJfC4KPoCZAM51MGfrCm6rIn4yOJUVfMPs2a5RwMD+yGS/n1g3gg==", - "dependencies": { - "@math.gl/core": "3.6.3" - } - }, "node_modules/mathjax-full": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/mathjax-full/-/mathjax-full-3.2.2.tgz", @@ -8846,6 +9419,16 @@ "speech-rule-engine": "^4.0.6" } }, + "node_modules/md5": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/md5/-/md5-2.3.0.tgz", + "integrity": "sha512-T1GITYmFaKuO91vxyoQMFETst+O71VUPEU3ze5GNzDm0OWdP8v1ziTaAEPUr/3kLsY3Sftgz242A1SetQiDL7g==", + "dependencies": { + "charenc": "0.0.2", + "crypt": "0.0.2", + "is-buffer": "~1.1.6" + } + }, "node_modules/media-typer": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", @@ -9982,6 +10565,11 @@ "node": ">=6" } }, + "node_modules/pako": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", + "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==" + }, "node_modules/param-case": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", @@ -10367,8 +10955,7 @@ "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", - "dev": true + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" }, "node_modules/prop-types": { "version": "15.8.1", @@ -11361,6 +11948,11 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "node_modules/snappyjs": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/snappyjs/-/snappyjs-0.6.1.tgz", + "integrity": "sha512-YIK6I2lsH072UE0aOFxxY1dPDCS43I5ktqHpeAsuLNYWkE5pGxRGWfDM4/vSUfNzXjC1Ivzt3qx31PCLmc9yqg==" + }, "node_modules/sockjs": { "version": "0.3.24", "resolved": "https://registry.npmjs.org/sockjs/-/sockjs-0.3.24.tgz", @@ -11638,6 +12230,11 @@ "node": ">=0.10.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==" + }, "node_modules/sshpk": { "version": "1.18.0", "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", @@ -11868,6 +12465,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/strnum": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/strnum/-/strnum-1.0.5.tgz", + "integrity": "sha512-J8bbNyKKXl5qYcR36TIO8W3mVGVHrmmxsd5PAItGkmyzwJvybiw2IVq5nqd0i4LSNSkB/sx9VHllbfFdr9k1JA==" + }, "node_modules/supercluster": { "version": "8.0.1", "resolved": "https://registry.npmjs.org/supercluster/-/supercluster-8.0.1.tgz", @@ -12003,6 +12605,26 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==" }, + "node_modules/texture-compressor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/texture-compressor/-/texture-compressor-1.0.2.tgz", + "integrity": "sha512-dStVgoaQ11mA5htJ+RzZ51ZxIZqNOgWKAIvtjLrW1AliQQLCmrDqNzQZ8Jh91YealQ95DXt4MEduLzJmbs6lig==", + "dependencies": { + "argparse": "^1.0.10", + "image-size": "^0.7.4" + }, + "bin": { + "texture-compressor": "bin/texture-compressor.js" + } + }, + "node_modules/texture-compressor/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/throttleit": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", @@ -12334,8 +12956,7 @@ "node_modules/undici-types": { "version": "5.26.5", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==" }, "node_modules/union-value": { "version": "1.0.1", @@ -12513,8 +13134,7 @@ "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", - "dev": true + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" }, "node_modules/util.promisify": { "version": "1.0.0", @@ -13243,6 +13863,11 @@ "resolved": "https://registry.npmjs.org/wgs84/-/wgs84-0.0.0.tgz", "integrity": "sha512-ANHlY4Rb5kHw40D0NJ6moaVfOCMrp9Gpd1R/AIQYg2ko4/jzcJ+TVXYYF6kXJqQwITvEZP4yEthjM7U6rYlljQ==" }, + "node_modules/wgsl_reflect": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/wgsl_reflect/-/wgsl_reflect-1.0.9.tgz", + "integrity": "sha512-NgO7ApUnFuB3FTsBVYjWizMIM5qOawlkSsi7j5BsYlMAW/e+j5IgB2M9kdKzR5lgUECFDSZZK3zdJ4yDmjfx4Q==" + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -13580,6 +14205,12 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zstd-codec": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/zstd-codec/-/zstd-codec-0.1.5.tgz", + "integrity": "sha512-v3fyjpK8S/dpY/X5WxqTK3IoCnp/ZOLxn144GZVlNUjtwAchzrVo03h+oMATFhCIiJ5KTr4V3vDQQYz4RU684g==", + "optional": true } } } diff --git a/package.json b/package.json index 3058fe30..05e10c84 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "./src/*": "./src/*" }, "dependencies": { - "@abi-software/flatmap-viewer": "2.9.5", + "@abi-software/flatmap-viewer": "3.0.2", "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", diff --git a/src/App.vue b/src/App.vue index 74d1d177..49e33907 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,6 +83,7 @@ @open-pubmed-url="onOpenPubmedUrl" @pathway-selection-changed="onPathwaySelectionChanged" @flatmapChanged="onFlatmapChanged" + :anatomyImages="anatomyImages" />
+ Viewing Mode
@@ -453,6 +454,7 @@ Please use `const` to assign meaningful names to them... + + View Image + + + Hide + Show + + Flight path display @@ -640,7 +655,6 @@ import { FlatmapQueries, findTaxonomyLabel, } from '../services/flatmapQueries.js' -import imageMixin from '../mixins/imageMixin.js' import yellowstar from '../icons/yellowstar' import ResizeSensor from 'css-element-queries/src/ResizeSensor' import * as flatmap from '@abi-software/flatmap-viewer' @@ -737,7 +751,6 @@ const createUnfilledTooltipData = function () { */ export default { name: 'FlatmapVuer', - mixins: [imageMixin], components: { Button, Col, @@ -1084,6 +1097,26 @@ export default { this.addAnnotationFeature() } }, + /** + * @vuese + * Function to switch the type of person who annotated. + * @arg flag + */ + setImage: function (flag) { + this.imageRadio = flag + if (this.mapImp) { + if (flag) { + for (const [key, value] of Object.entries(this.anatomyImages)) { + this.mapImp.addMarker(key, { className: "slandered-marker", cluster: false }) + const id = this.mapImp.addImage(key, value[0].thumbnail) + if (id) this.imageIds.push(id) + } + } else { + this.mapImp.clearMarkers(); + this.imageIds.forEach((id) => this.mapImp.removeImage(id)) + } + } + }, /** * @vuese * Function to switch from 2D to 3D @@ -2356,7 +2389,6 @@ export default { this.computePathControlsMaximumHeight() this.drawerOpen = true this.mapResize() - this.addImagesToMap() this.handleMapClick(); /** * This is ``onFlatmapReady`` event. @@ -2452,14 +2484,6 @@ export default { if (this.mapImp) return this.mapImp.search(term) return [] }, - addImagesToMap: async function () { - if (this.mapImp) { - let response = await this.getImageDatasetFromScicrunch() - if (response && response.success) { - this.anatomyImages = this.populateViewerWithImages(response.datasets, this.mapImp) - } - } - }, }, props: { /** @@ -2652,6 +2676,10 @@ export default { type: Boolean, default: false, }, + anatomyImages: { + type: Object, + default: {}, + }, }, provide() { return { @@ -2781,7 +2809,8 @@ export default { without: true, } }), - anatomyImages: {} + imageRadio: false, + imageIds: [], } }, computed: { diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 1ea3adf8..53502ba1 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -82,6 +82,7 @@ :flatmapAPI="flatmapAPI" :rootURL="rootURL" :sparcAPI="sparcAPI" + :anatomyImages="anatomyImages" />
@@ -724,6 +725,13 @@ export default { type: Boolean, default: false, }, + /** + * The option to show connectivity information in sidebar + */ + anatomyImages: { + type: Object, + default: {}, + }, }, data: function () { return { diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index 89faf1a4..fc4b520f 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -78,30 +78,9 @@ const getAnnotatedBiolucida = function (data) { export default { // Note that the setting store is included in MapContent.vue methods: { - createThumbnailMarkers: function (mapImp, id, image) { - return new Promise((resolve, reject) => { - let wrapperElement = document.createElement("div"); - let img = new Image(); - img.src = image; - img.style = "height: auto;width: 50px;margin-right: 80px;"; - img.onload = function () { - wrapperElement.appendChild(img); - const markerIdentifier = mapImp.addMarker(id, { - element: wrapperElement, - className: "highlight-marker", - cluster: false, - type: "image", - }); - resolve(markerIdentifier); - }; - img.onerror = function () { - reject(new Error("Failed to load image at " + image)); - }; - }); - }, - - populateViewerWithImages: function (datasets, mapImp = undefined) { - let anatomyImageObjects = {}; + populateAnatomyImageObjects: function (datasets) { + let anatomyCurieImageObjects = {}; + let anatomyNameImageObjects = {}; const datasetsLength = datasets.length; for (let i = 0; i < datasetsLength; i++) { const dataset = datasets[i]; @@ -113,26 +92,23 @@ export default { const anatomyLength = image.anatomy.length; for (let k = 0; k < anatomyLength; k++) { const anatomy = image.anatomy[k]; - const locationIdentifier = mapImp - ? anatomy.curie - : anatomy.name; - if (!(locationIdentifier in anatomyImageObjects)) { - anatomyImageObjects[locationIdentifier] = []; - if (mapImp) { - this.createThumbnailMarkers( - mapImp, - locationIdentifier, - image.thumbnail - ); - } + if (!(anatomy.curie in anatomyCurieImageObjects)) { + anatomyCurieImageObjects[anatomy.curie] = []; + } + anatomyCurieImageObjects[anatomy.curie].push(image); + if (!(anatomy.name in anatomyNameImageObjects)) { + anatomyNameImageObjects[anatomy.name] = []; } - anatomyImageObjects[locationIdentifier].push(image); + anatomyNameImageObjects[anatomy.name].push(image); } } } } } - return anatomyImageObjects; + return { + "anatomyCurie": anatomyCurieImageObjects, + "anatomyName": anatomyNameImageObjects + }; }, processResults: async function (results) { @@ -159,17 +135,17 @@ export default { const datasetImage = biolucidaInfo[bioImage.biolucida.identifier]; const link = bio2DIds.includes(bioImage.biolucida.identifier) ? getView2DImageLink( - this.rootURL, - datasetId, - datasetVersion, - bioImage.dataset.path - ) + this.rootURL, + datasetId, + datasetVersion, + bioImage.dataset.path + ) : getView3DImageLink( - this.rootURL, - datasetId, - datasetVersion, - datasetImage - ); + this.rootURL, + datasetId, + datasetVersion, + datasetImage + ); return { title: bioImage.name, anatomy: result.organs, From 61ce7b0823016464ccfc11e974a8a4d11a541c1f Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 16 Aug 2024 14:16:04 +1200 Subject: [PATCH 06/47] Package version update removeImage fixed --- package-lock.json | 357 ++++++++++++++++++++++++++++----- package.json | 4 +- src/components/FlatmapVuer.vue | 4 +- 3 files changed, 309 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d690e43..9ec79a49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,8 +9,8 @@ "version": "1.4.0", "license": "Apache-2.0", "dependencies": { - "@abi-software/flatmap-viewer": "3.0.2", - "@abi-software/map-utilities": "1.1.0", + "@abi-software/flatmap-viewer": "3.1.0", + "@abi-software/map-utilities": "1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", @@ -43,9 +43,9 @@ } }, "node_modules/@abi-software/flatmap-viewer": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.0.2.tgz", - "integrity": "sha512-rhqUlwvrqFg3pEIKKaBNSW3+95FnQcBU2C/VdXFa2NSQ3ohZ0pdQrn+ZSmh6WlkqH9OKVayKggQy2o16WX0H4A==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.1.0.tgz", + "integrity": "sha512-5X8KgSv95qFWg7cYFRnsiIOgfZMrE0j3ZznIjUIljKMtid/FhuuopmqMTY/YKEwaHIAW8rQvBss4edybPsPhnA==", "dependencies": { "@deck.gl/core": "^9.0.17", "@deck.gl/geo-layers": "^9.0.18", @@ -55,6 +55,8 @@ "@turf/area": "^6.5.0", "@turf/bbox": "^6.5.0", "@turf/helpers": "^6.5.0", + "@turf/length": "^7.0.0", + "@turf/nearest-point-on-line": "^7.0.0", "@turf/projection": "^6.5.0", "bezier-js": "^6.1.0", "colord": "^2.9.3", @@ -63,17 +65,29 @@ "graphology-operators": "^1.6.0", "graphology-shortest-path": "^2.1.0", "html-es6cape": "^2.0.2", - "maplibre-gl": ">=4.3.0", + "maplibre-gl": ">=4.5.0", "mathjax-full": "^3.2.2", "minisearch": "^2.2.1", "polylabel": "^1.1.0" } }, + "node_modules/@abi-software/gallery": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@abi-software/gallery/-/gallery-1.1.1.tgz", + "integrity": "sha512-EOnKEQpL/6R7UZQpjiaBn5g4KPxc8RHrIfyTf4ukA+WJ2SU5T+R5GIYzi8Kuzgh797NehPpe/iFzPa21FvN+HQ==", + "dependencies": { + "axios": "^1.6.5", + "element-plus": "^2.4.4", + "unplugin-vue-components": "^0.26.0", + "vue": "^3.3.13" + } + }, "node_modules/@abi-software/map-utilities": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.1.0.tgz", - "integrity": "sha512-icRE0/VTa4RollDDHSqKsK63gwUAxAepDoAYPJCljgsnW6TxVyXOt9Olacwd3k2u0jfKOaUt1QfdTlpVxY4QpQ==", + "version": "1.0.0-beta.1", + "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.0.0-beta.1.tgz", + "integrity": "sha512-gOMGlaAqY8Rv6rXJ64oqOeTJHO1W0FigQZnTJKMOj9wMA0jWYsHHREyP8FKbEZZ0YGk9l2cJGL38K/sHTkcNpw==", "dependencies": { + "@abi-software/gallery": "^1.1.0", "@abi-software/svg-sprite": "^1.0.0", "@element-plus/icons-vue": "^2.3.1", "element-plus": "^2.7.3", @@ -1517,6 +1531,11 @@ "gl-style-validate": "dist/gl-style-validate.mjs" } }, + "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/quickselect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", + "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + }, "node_modules/@maplibre/maplibre-gl-style-spec/node_modules/rw": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/rw/-/rw-1.3.3.tgz", @@ -1702,6 +1721,45 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/bearing": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/bearing/-/bearing-7.1.0.tgz", + "integrity": "sha512-X5lackrZ6FW+YhgjWxwVFRgWD1j4xm4t5VvE6EE6v/1PVaHQ5OCjf6u1oaLx5LSG+gaHUhjTlAHrn9MYPFaeTA==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@turf/invariant": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/bearing/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/bearing/node_modules/@turf/invariant": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-7.1.0.tgz", + "integrity": "sha512-OCLNqkItBYIP1nE9lJGuIUatWGtQ4rhBKAyTfFu0z8npVzGEYzvguEeof8/6LkKmTTEHW53tCjoEhSSzdRh08Q==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, "node_modules/@turf/boolean-clockwise": { "version": "5.1.5", "resolved": "https://registry.npmjs.org/@turf/boolean-clockwise/-/boolean-clockwise-5.1.5.tgz", @@ -1727,6 +1785,84 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/destination": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/destination/-/destination-7.1.0.tgz", + "integrity": "sha512-97XuvB0iaAiMg86hrnZ529WwP44TQAA9mmI5PMlchACiA4LFrEtWjjDzvO6234coieoqhrw6dZYcJvd5O2PwrQ==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@turf/invariant": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/destination/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/destination/node_modules/@turf/invariant": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-7.1.0.tgz", + "integrity": "sha512-OCLNqkItBYIP1nE9lJGuIUatWGtQ4rhBKAyTfFu0z8npVzGEYzvguEeof8/6LkKmTTEHW53tCjoEhSSzdRh08Q==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/distance": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/distance/-/distance-7.1.0.tgz", + "integrity": "sha512-hhNHhxCHB3ddzAGCNY4BtE29OZh+DAJPvUapQz+wOjISnlwvMcwLKvslgHWSYF536QDVe/93FEU2q67+CsZTPA==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@turf/invariant": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/distance/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/distance/node_modules/@turf/invariant": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-7.1.0.tgz", + "integrity": "sha512-OCLNqkItBYIP1nE9lJGuIUatWGtQ4rhBKAyTfFu0z8npVzGEYzvguEeof8/6LkKmTTEHW53tCjoEhSSzdRh08Q==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, "node_modules/@turf/helpers": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-6.5.0.tgz", @@ -1748,6 +1884,71 @@ "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-5.1.5.tgz", "integrity": "sha512-/lF+JR+qNDHZ8bF9d+Cp58nxtZWJ3sqFe6n3u3Vpj+/0cqkjk4nXKYBSY0azm+GIYB5mWKxUXvuP/m0ZnKj1bw==" }, + "node_modules/@turf/length": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/length/-/length-7.1.0.tgz", + "integrity": "sha512-wUJj9WLKEudG1ngNao2ZwD+Dt6UkvWIbubuJ6lR6FndFDL3iezFhNGy0IXS+0xH9kXi2apiTnM9Vk5+i8BTEvQ==", + "dependencies": { + "@turf/distance": "^7.1.0", + "@turf/helpers": "^7.1.0", + "@turf/meta": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/length/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/length/node_modules/@turf/meta": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.1.0.tgz", + "integrity": "sha512-ZgGpWWiKz797Fe8lfRj7HKCkGR+nSJ/5aKXMyofCvLSc2PuYJs/qyyifDPWjASQQCzseJ7AlF2Pc/XQ/3XkkuA==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/line-intersect": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/line-intersect/-/line-intersect-7.1.0.tgz", + "integrity": "sha512-JI3dvOsAoCqd4vUJ134FIzgcC42QpC/tBs+b4OJoxWmwDek3REv4qGaZY6wCg9X4hFSlCKFcnhMIQQZ/n720Qg==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10", + "sweepline-intersections": "^1.5.0", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/line-intersect/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, "node_modules/@turf/meta": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-6.5.0.tgz", @@ -1759,6 +1960,62 @@ "url": "https://opencollective.com/turf" } }, + "node_modules/@turf/nearest-point-on-line": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/nearest-point-on-line/-/nearest-point-on-line-7.1.0.tgz", + "integrity": "sha512-aTjAOm7ab0tl5JoxGYRx/J/IbRL1DY1ZCIYQDMEQjK5gOllhclgeBC0wDXDkEZFGaVftjw0W2RtE2I0jX7RG4A==", + "dependencies": { + "@turf/bearing": "^7.1.0", + "@turf/destination": "^7.1.0", + "@turf/distance": "^7.1.0", + "@turf/helpers": "^7.1.0", + "@turf/invariant": "^7.1.0", + "@turf/line-intersect": "^7.1.0", + "@turf/meta": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/nearest-point-on-line/node_modules/@turf/helpers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/helpers/-/helpers-7.1.0.tgz", + "integrity": "sha512-dTeILEUVeNbaEeoZUOhxH5auv7WWlOShbx7QSd4s0T4Z0/iz90z9yaVCtZOLbU89umKotwKaJQltBNO9CzVgaQ==", + "dependencies": { + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/nearest-point-on-line/node_modules/@turf/invariant": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/invariant/-/invariant-7.1.0.tgz", + "integrity": "sha512-OCLNqkItBYIP1nE9lJGuIUatWGtQ4rhBKAyTfFu0z8npVzGEYzvguEeof8/6LkKmTTEHW53tCjoEhSSzdRh08Q==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10", + "tslib": "^2.6.2" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, + "node_modules/@turf/nearest-point-on-line/node_modules/@turf/meta": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@turf/meta/-/meta-7.1.0.tgz", + "integrity": "sha512-ZgGpWWiKz797Fe8lfRj7HKCkGR+nSJ/5aKXMyofCvLSc2PuYJs/qyyifDPWjASQQCzseJ7AlF2Pc/XQ/3XkkuA==", + "dependencies": { + "@turf/helpers": "^7.1.0", + "@types/geojson": "^7946.0.10" + }, + "funding": { + "url": "https://opencollective.com/turf" + } + }, "node_modules/@turf/projection": { "version": "6.5.0", "resolved": "https://registry.npmjs.org/@turf/projection/-/projection-6.5.0.tgz", @@ -1962,11 +2219,6 @@ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, - "node_modules/@types/junit-report-builder": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/junit-report-builder/-/junit-report-builder-3.0.2.tgz", - "integrity": "sha512-R5M+SYhMbwBeQcNXYWNCZkl09vkVfAtcPIaCGdzIkkbeaTrVbGQ7HVgi4s+EmM/M1K4ZuWQH0jGcvMvNePfxYA==" - }, "node_modules/@types/linkify-it": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", @@ -3267,8 +3519,7 @@ "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/at-least-node": { "version": "1.0.0", @@ -3331,9 +3582,6 @@ "version": "1.7.2", "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", - "dev": true, - "optional": true, - "peer": true, "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -3344,9 +3592,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "optional": true, - "peer": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -3359,10 +3604,7 @@ "node_modules/axios/node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true, - "optional": true, - "peer": true + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" }, "node_modules/babel-eslint": { "version": "10.1.0", @@ -3985,7 +4227,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4753,7 +4994,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -6433,7 +6673,6 @@ "version": "1.15.6", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", - "dev": true, "funding": [ { "type": "individual", @@ -6593,9 +6832,9 @@ "integrity": "sha512-k/6BCd0qAt7vdqdM1LkLfAy72EsLDy0laNwX0x2h49vfYCiQkRc4PSra8DNEdJ10EKRpwEvDXMb0dBknTJuWpQ==" }, "node_modules/geojson-vt": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-3.2.1.tgz", - "integrity": "sha512-EvGQQi/zPrDA6zr6BnJD/YhwAkBP8nnJ9emh3EnHQKVMfg/MRVtPbMYdgVy/IaEmn4UfagD2a6fafPDL5hbtwg==" + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/geojson-vt/-/geojson-vt-4.0.2.tgz", + "integrity": "sha512-AV9ROqlNqoZEIJGfm1ncNjEXfkz2hdFlZf0qkVfmkwdKa8vj7H16YUOT81rJw1rdFhyEDlN2Tds91p/glzbl5A==" }, "node_modules/get-caller-file": { "version": "2.0.5", @@ -8816,9 +9055,9 @@ } }, "node_modules/maplibre-gl": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.3.2.tgz", - "integrity": "sha512-/oXDsb9I+LkjweL/28aFMLDZoIcXKNEhYNAZDLA4xgTNkfvKQmV/r0KZdxEMcVthincJzdyc6Y4N8YwZtHKNnQ==", + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/maplibre-gl/-/maplibre-gl-4.5.2.tgz", + "integrity": "sha512-vlWL9EY2bSGg5FAt0mKPfYqlfX15uLW5D3kKv4Xjn54nIVn01MKdfUJMAVIr+8fXVqfSX6c095Iy5XnV+T76kQ==", "dependencies": { "@mapbox/geojson-rewind": "^0.5.2", "@mapbox/jsonlint-lines-primitives": "^2.0.2", @@ -8827,25 +9066,24 @@ "@mapbox/unitbezier": "^0.0.1", "@mapbox/vector-tile": "^1.3.1", "@mapbox/whoots-js": "^3.1.0", - "@maplibre/maplibre-gl-style-spec": "^20.2.0", + "@maplibre/maplibre-gl-style-spec": "^20.3.0", "@types/geojson": "^7946.0.14", "@types/geojson-vt": "3.2.5", - "@types/junit-report-builder": "^3.0.2", "@types/mapbox__point-geometry": "^0.1.4", "@types/mapbox__vector-tile": "^1.3.4", "@types/pbf": "^3.0.5", "@types/supercluster": "^7.1.3", - "earcut": "^2.2.4", - "geojson-vt": "^3.2.1", + "earcut": "^3.0.0", + "geojson-vt": "^4.0.2", "gl-matrix": "^3.4.3", "global-prefix": "^3.0.0", "kdbush": "^4.0.2", "murmurhash-js": "^1.0.0", - "pbf": "^3.2.1", + "pbf": "^3.3.0", "potpack": "^2.0.0", - "quickselect": "^2.0.0", + "quickselect": "^3.0.0", "supercluster": "^8.0.1", - "tinyqueue": "^2.0.3", + "tinyqueue": "^3.0.0", "vt-pbf": "^3.1.3" }, "engines": { @@ -8856,6 +9094,16 @@ "url": "https://github.com/maplibre/maplibre-gl-js?sponsor=1" } }, + "node_modules/maplibre-gl/node_modules/earcut": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/earcut/-/earcut-3.0.0.tgz", + "integrity": "sha512-41Fs7Q/PLq1SDbqjsgcY7GA42T0jvaCNGXgGtsNdvg+Yv8eIu06bxv4/PoREkZ9nMDNwnUSG9OFB9+yv8eKhDg==" + }, + "node_modules/maplibre-gl/node_modules/tinyqueue": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/tinyqueue/-/tinyqueue-3.0.0.tgz", + "integrity": "sha512-gRa9gwYU3ECmQYv3lslts5hxuIa90veaEcxDYuu3QGOIAEM2mOZkVHp48ANJuu1CURtRdHKUBY5Lm1tHV+sD4g==" + }, "node_modules/mark.js": { "version": "8.11.1", "resolved": "https://registry.npmjs.org/mark.js/-/mark.js-8.11.1.tgz", @@ -8971,7 +9219,6 @@ "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, "engines": { "node": ">= 0.6" } @@ -8980,7 +9227,6 @@ "version": "2.1.35", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, "dependencies": { "mime-db": "1.52.0" }, @@ -10127,9 +10373,9 @@ "dev": true }, "node_modules/pbf": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.2.1.tgz", - "integrity": "sha512-ClrV7pNOn7rtmoQVF4TS1vyU0WhYRnP92fzbfF75jAIwpnzdJXf8iTd4CMEqO4yUenH6NDqLiwjqlh6QgZzgLQ==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-3.3.0.tgz", + "integrity": "sha512-XDF38WCH3z5OV/OVa8GKUNtLAyneuzbCisx7QUCF8Q6Nutx0WnJrQe5O+kOtBlLfRNUws98Y58Lblp+NJG5T4Q==", "dependencies": { "ieee754": "^1.1.12", "resolve-protobuf-schema": "^2.1.0" @@ -10521,9 +10767,9 @@ ] }, "node_modules/quickselect": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-2.0.0.tgz", - "integrity": "sha512-RKJ22hX8mHe3Y6wH/N3wCM6BWtjaxIyyUIkpHOvfFnxdI4yD4tBXEBKSbriGujF6jnSVkJrffuo6vxACiSSxIw==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/quickselect/-/quickselect-3.0.0.tgz", + "integrity": "sha512-XdjUArbK4Bm5fLLvlm5KpTFOiOThgfWWI4axAZDWg4E/0mKdZyI9tNEfds27qCi1ze/vwTR16kvmmGhRra3c2g==" }, "node_modules/randombytes": { "version": "2.1.0", @@ -11957,6 +12203,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/sweepline-intersections": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/sweepline-intersections/-/sweepline-intersections-1.5.0.tgz", + "integrity": "sha512-AoVmx72QHpKtItPu72TzFL+kcYjd67BPLDoR0LarIk+xyaRg+pDTMFXndIEvZf9xEKnJv6JdhgRMnocoG0D3AQ==", + "dependencies": { + "tinyqueue": "^2.0.0" + } + }, "node_modules/tabbable": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz", @@ -12213,8 +12467,7 @@ "node_modules/tslib": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", - "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", - "dev": true + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==" }, "node_modules/tunnel-agent": { "version": "0.6.0", diff --git a/package.json b/package.json index 5690b537..c964ce9a 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "./src/*": "./src/*" }, "dependencies": { - "@abi-software/flatmap-viewer": "3.0.2", - "@abi-software/map-utilities": "1.1.0", + "@abi-software/flatmap-viewer": "3.1.0", + "@abi-software/map-utilities": "1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 988f308c..dee39440 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -433,7 +433,6 @@ Please use `const` to assign meaningful names to them... virtual-triggering >
- Viewing Mode
@@ -1107,13 +1106,14 @@ export default { if (this.mapImp) { if (flag) { for (const [key, value] of Object.entries(this.anatomyImages)) { - this.mapImp.addMarker(key, { className: "slandered-marker", cluster: false }) + this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) const id = this.mapImp.addImage(key, value[0].thumbnail) if (id) this.imageIds.push(id) } } else { this.mapImp.clearMarkers(); this.imageIds.forEach((id) => this.mapImp.removeImage(id)) + this.imageIds = [] } } }, From 3021eaa2b578591736142177512d585a96a717ca Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 16 Aug 2024 15:28:44 +1200 Subject: [PATCH 07/47] Update flatmap-viewer version --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ec79a49..6b9207b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.4.0", "license": "Apache-2.0", "dependencies": { - "@abi-software/flatmap-viewer": "3.1.0", + "@abi-software/flatmap-viewer": "3.1.2", "@abi-software/map-utilities": "1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", @@ -43,9 +43,9 @@ } }, "node_modules/@abi-software/flatmap-viewer": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.1.0.tgz", - "integrity": "sha512-5X8KgSv95qFWg7cYFRnsiIOgfZMrE0j3ZznIjUIljKMtid/FhuuopmqMTY/YKEwaHIAW8rQvBss4edybPsPhnA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.1.2.tgz", + "integrity": "sha512-fwpBE+LsJtxqkwnfJXCD0BrP1wdfw6632cKOaXRUnfQ5LnzXuvbbJL5NAo6K7PmmWsvnJYTqy/ssBEgmltCmNw==", "dependencies": { "@deck.gl/core": "^9.0.17", "@deck.gl/geo-layers": "^9.0.18", diff --git a/package.json b/package.json index c964ce9a..214b0b16 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "./src/*": "./src/*" }, "dependencies": { - "@abi-software/flatmap-viewer": "3.1.0", + "@abi-software/flatmap-viewer": "3.1.2", "@abi-software/map-utilities": "1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", From 08e94b7f7a8b211b20627f37dfbf55a487344dbc Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:17:51 +1200 Subject: [PATCH 08/47] Add select box for selecting different image type --- package-lock.json | 2 +- package.json | 2 +- src/components/FlatmapVuer.vue | 85 +++++++++++++++++++++++++++------- 3 files changed, 70 insertions(+), 19 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6b9207b7..9d52dd9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.2", - "@abi-software/map-utilities": "1.0.0-beta.1", + "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/package.json b/package.json index 214b0b16..97cac0de 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@abi-software/flatmap-viewer": "3.1.2", - "@abi-software/map-utilities": "1.0.0-beta.1", + "@abi-software/map-utilities": "^1.0.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index dee39440..2c8456c6 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -503,14 +503,37 @@ Please use `const` to assign meaningful names to them... View Image - - Hide - Show - + + + Hide + Show + + + + + + + {{ item }} + + + + Flight path display @@ -1096,24 +1119,50 @@ export default { this.addAnnotationFeature() } }, + removeImageFromMap: function () { + if (this.mapImp) { + this.mapImp.clearMarkers(); + this.imageIds.forEach((id) => this.mapImp.removeImage(id)) + this.imageIds = [] + } + }, + populateImageToMap: function () { + if (this.mapImp) { + for (const [key, value] of Object.entries(this.anatomyImages)) { + this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) + const id = this.mapImp.addImage(key, value[0].thumbnail) + if (id) this.imageIds.push(id) + } + } + }, /** * @vuese - * Function to switch the type of person who annotated. + * Function to switch the type of displayed image. + * @arg flag + */ + setImageType: function (flag) { + this.imageType = flag + if (this.mapImp) { + if (flag === 'Biolucida') { + this.populateImageToMap() + } else { + console.log('switch to', flag); + this.removeImageFromMap() + } + } + }, + /** + * @vuese + * Function to switch show or hide images. * @arg flag */ setImage: function (flag) { this.imageRadio = flag if (this.mapImp) { if (flag) { - for (const [key, value] of Object.entries(this.anatomyImages)) { - this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) - const id = this.mapImp.addImage(key, value[0].thumbnail) - if (id) this.imageIds.push(id) - } + this.setImageType(this.imageType) } else { - this.mapImp.clearMarkers(); - this.imageIds.forEach((id) => this.mapImp.removeImage(id)) - this.imageIds = [] + this.removeImageFromMap() } } }, @@ -2811,6 +2860,8 @@ export default { }), imageRadio: false, imageIds: [], + imageType: 'Biolucida', + imageTypes: ['Biolucida', 'Plot', 'Scaffold', 'Segmentation'], } }, computed: { From 3ee9039fa72fd6b037389ee7fa5e547b984c90d7 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 20 Aug 2024 16:36:21 +1200 Subject: [PATCH 09/47] Modify image selector based on new image api --- src/App.vue | 14 +- src/components/FlatmapVuer.vue | 48 ++-- src/components/MultiFlatmapVuer.vue | 8 - src/mixins/imageMixin.js | 369 +++++++++++++++------------- 4 files changed, 233 insertions(+), 206 deletions(-) diff --git a/src/App.vue b/src/App.vue index 49e33907..26b8e3d6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -83,7 +83,6 @@ @open-pubmed-url="onOpenPubmedUrl" @pathway-selection-changed="onPathwaySelectionChanged" @flatmapChanged="onFlatmapChanged" - :anatomyImages="anatomyImages" /> { let featureGeometry = { lng: 0, lat: 0, } @@ -773,6 +774,7 @@ const createUnfilledTooltipData = function () { */ export default { name: 'FlatmapVuer', + mixins:[imageMixin], components: { Button, Col, @@ -1128,27 +1130,38 @@ export default { }, populateImageToMap: function () { if (this.mapImp) { - for (const [key, value] of Object.entries(this.anatomyImages)) { - this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) - const id = this.mapImp.addImage(key, value[0].thumbnail) - if (id) this.imageIds.push(id) + for (const [key, value] of Object.entries(this.anatomyImages[this.imageType])) { + if (value.length) { + const id = this.mapImp.addImage(key, value[0].thumbnail) + if (id) { + this.imageIds.push(id) + this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) + } + } } } }, /** * @vuese * Function to switch the type of displayed image. - * @arg flag + * @arg type */ - setImageType: function (flag) { - this.imageType = flag + setImageType: async function (type) { + this.imageType = type if (this.mapImp) { - if (flag === 'Biolucida') { - this.populateImageToMap() + this.loading = true + const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers + this.removeImageFromMap() + if (type === 'Image' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await this.getBiolucidaThumbnails("id", anatomicalIdentifiers) + } else if (type === 'Segmentation' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await this.getSegmentationThumbnails("id", anatomicalIdentifiers) } else { - console.log('switch to', flag); - this.removeImageFromMap() + console.log('switch to', type); } + this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) + // this.populateImageToMap() + this.loading = false } }, /** @@ -1790,8 +1803,8 @@ export default { if (data.feature.type === 'marker') { this.tooltipType = 'image' - if (data.resource[0] in this.anatomyImages) { - this.imageEntry = this.anatomyImages[data.resource[0]] + if (data.resource[0] in this.anatomyImages[this.imageType]) { + this.imageEntry = this.anatomyImages[this.imageType][data.resource[0]] } // this.displayTooltip(data.feature.models) @@ -2725,10 +2738,6 @@ export default { type: Boolean, default: false, }, - anatomyImages: { - type: Object, - default: {}, - }, }, provide() { return { @@ -2858,10 +2867,11 @@ export default { without: true, } }), + anatomyImages: {}, imageRadio: false, imageIds: [], - imageType: 'Biolucida', - imageTypes: ['Biolucida', 'Plot', 'Scaffold', 'Segmentation'], + imageType: 'Image', + imageTypes: ['Image', 'Plot', 'Scaffold', 'Segmentation'], } }, computed: { diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 53502ba1..1ea3adf8 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -82,7 +82,6 @@ :flatmapAPI="flatmapAPI" :rootURL="rootURL" :sparcAPI="sparcAPI" - :anatomyImages="anatomyImages" />
@@ -725,13 +724,6 @@ export default { type: Boolean, default: false, }, - /** - * The option to show connectivity information in sidebar - */ - anatomyImages: { - type: Object, - default: {}, - }, }, data: function () { return { diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index fc4b520f..ca8b4365 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -1,189 +1,222 @@ -const imageQuery = '"*jp2* OR *vnd.ome.xml* OR *jpx*"'; - -const getView2DImageLink = (rootURL, datasetId, datasetVersion, filePath) => { - return `${rootURL}datasets/file/${datasetId}/${datasetVersion}?path=files/${filePath}`; -}; - -const getView3DImageLink = ( - rootURL, - datasetId, - datasetVersion, - dataset_image -) => { - const viewEncoding = dataset_image.share_link.replace( - "https://sparc.biolucida.net/image?c=", - "" - ); - return ( - rootURL + - "datasets/biolucidaviewer/" + - dataset_image.image_id + - "?view=" + - viewEncoding + - "&dataset_version=" + - datasetVersion + - "&dataset_id=" + - datasetId + - "&item_id=" + - dataset_image.sourcepkg_id - ); -}; - -const getBiolucidaInfo = async function (sparcAPI, datasetId) { - return new Promise((resolve, reject) => { - const endpoint = `${sparcAPI}image_search/${datasetId}`; - fetch(endpoint) - .then((response) => response.json()) - .then((data) => { - if (data.status == "success") { - let imageObjects = {}; - data.dataset_images.forEach((image) => { - if (!(image.image_id in imageObjects)) { - imageObjects[image.image_id] = image; - } - }); - resolve(imageObjects); - } else { - reject(data.reason); - } - }); +const getFilesInfo = async (api, key, idsList, types) => { + let params = new URLSearchParams(); + types.forEach((type) => { + params.append("arrayparams", type); + params.append("arrayparams", type); }); -}; - -const getAnnotatedBiolucida = function (data) { - let bioList = []; - let bio2DIds = []; - if ("biolucida-2d" in data) { - const bio2DLength = data["biolucida-2d"].length; - for (let i = 0; i < bio2DLength; i++) { - const biolucida = data["biolucida-2d"][i]; - if (biolucida.biolucida) { - bioList.push(biolucida); - bio2DIds.push(biolucida.biolucida.identifier); - } + let response = await fetch(`${api}get-organ-curies/?${params}`); + let data = await response.json(); + const identifiers = []; + data.uberon.array.forEach((pair) => { + const identifier = { + id: pair.id.toUpperCase(), + name: pair.name, + }; + if (idsList.includes(identifier[key])) { + identifiers.push(identifier); } - } - if ("biolucida-3d" in data) { - const bio3DLength = data["biolucida-3d"].length; - for (let i = 0; i < bio3DLength; i++) { - const biolucida = data["biolucida-3d"][i]; - if (biolucida.biolucida) { - bioList.push(biolucida); - } - } - } - return { bioList, bio2DIds }; + }); + const keys = identifiers.map((item) => item[key]); + response = await fetch(`${api}get-files-info-for-curies`, { + method: "POST", + body: JSON.stringify({ + filetypes: types, + curies: keys, + }), + headers: { + "Content-Type": "application/json", + }, + }); + data = await response.json(); + return data; }; export default { - // Note that the setting store is included in MapContent.vue methods: { - populateAnatomyImageObjects: function (datasets) { - let anatomyCurieImageObjects = {}; - let anatomyNameImageObjects = {}; - const datasetsLength = datasets.length; - for (let i = 0; i < datasetsLength; i++) { - const dataset = datasets[i]; - if (dataset.value && dataset.value.length) { - const imagesLength = dataset.value.length; - for (let j = 0; j < imagesLength; j++) { - const image = dataset.value[j]; - if (image.anatomy && image.anatomy.length) { - const anatomyLength = image.anatomy.length; - for (let k = 0; k < anatomyLength; k++) { - const anatomy = image.anatomy[k]; - if (!(anatomy.curie in anatomyCurieImageObjects)) { - anatomyCurieImageObjects[anatomy.curie] = []; - } - anatomyCurieImageObjects[anatomy.curie].push(image); - if (!(anatomy.name in anatomyNameImageObjects)) { - anatomyNameImageObjects[anatomy.name] = []; + getBiolucidaThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "biolucida-2d", + "biolucida-3d", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.biolucida_id) { + let image = { + thumbnail: this.getBiolucidaThumbnailURL( + entry.biolucida_id + ), + id: entry.id, + title: entry.file_path.substring( + entry.file_path.lastIndexOf("/") + 1 + ), + type: "Image", + link: `https://sparc.biolucida.net/api/v1/thumbnail/${entry.biolucida_id}`, + mimetype: 'image/png' + }; + list.push(image); } - anatomyNameImageObjects[anatomy.name].push(image); - } + }); + images[key] = list; } } + return images; } - } - return { - "anatomyCurie": anatomyCurieImageObjects, - "anatomyName": anatomyNameImageObjects - }; - }, - - processResults: async function (results) { - try { - let datasets = []; - const dataType = "Image"; - console.log("starting promise list"); - let promiseList = results.map(async (result) => { - const datasetId = result.dataset_identifier; - const datasetVersion = result.dataset_version; - const biolucidaInfo = await getBiolucidaInfo( - this.sparcAPI, - datasetId - ); - const imageIds = Object.values(biolucidaInfo).map( - (image) => image.image_id - ); - const { bioList, bio2DIds } = getAnnotatedBiolucida(result); - return bioList - .filter((bioImage) => - imageIds.includes(bioImage.biolucida.identifier) - ) - .map((bioImage) => { - const datasetImage = biolucidaInfo[bioImage.biolucida.identifier]; - const link = bio2DIds.includes(bioImage.biolucida.identifier) - ? getView2DImageLink( - this.rootURL, - datasetId, - datasetVersion, - bioImage.dataset.path - ) - : getView3DImageLink( - this.rootURL, - datasetId, - datasetVersion, - datasetImage - ); - return { - title: bioImage.name, - anatomy: result.organs, - species: result.organisms, - datasetId: datasetId, - datasetVersion: datasetVersion, - link: link, - type: dataType, - thumbnail: datasetImage.thumbnail_url, - }; - }); - }); - console.log("promiseList:", promiseList); - let promiseResult = await Promise.allSettled(promiseList); - datasets = promiseResult.flat(); - console.log("promiseResult:", promiseResult); - return datasets; } catch (error) { console.error("Error:", error); - return []; } + return {}; }, - - getImageDatasetFromScicrunch: async function () { - const endpoint = - `${this.sparcAPI}multiple_dataset_info/using_multiple_mimetype/?` + - `${new URLSearchParams({ q: imageQuery })}`; + getBiolucidaThumbnailURL: function (biolucidaId) { + return `${this.sparcAPI}thumbnail/${biolucidaId}`; + }, + getSegmentationThumbnails: async function (key, idsList) { try { - const response = await fetch(endpoint); - const data = await response.json(); - if (data.numberOfHits >= 1) { - let datasets = await this.processResults(data.results); - return { success: true, datasets: datasets }; + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "mbf-segmentation", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + let image = { + thumbnail: this.getSegmentationThumbnailURL( + entry.id, + entry.version, + entry.file_path + ), + id: entry.id, + title: entry.file_path.substring( + entry.file_path.lastIndexOf("/") + 1 + ), + type: "Segmentation", + link: this.getBiolucidaThumbnailURL(entry.biolucida_id), + }; + list.push(image); + }); + images[key] = list; + } + } + return images; } - return { success: false, error: "No datasets found" }; } catch (error) { - return { success: false, error: error }; + console.error("Error:", error); + } + return {}; + }, + getSegmentationThumbnailURL: function ( + datasetId, + datasetVersion, + filePath + ) { + return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; + }, + populateMapWithImages: function (mapImp, images, type) { + for (const [key, list] of Object.entries(images)) { + this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type); } }, + downloadAndCreateImageThumbnailMarkerUrl: function ( + mapImp, + key, + list, + type + ) { + const count = list.length; + if (count > 0) { + //Pick a random image + const index = Math.floor(Math.random() * count); + const thumbnail = list[index].thumbnail; + this.getThumbnail(thumbnail, type) + .then((wrappedElement) => { + this.createImageThumbnailMarkerUrl(mapImp, key, wrappedElement); + }) + .catch(() => { + //Failed to download, pick another one + list.splice(index); + this.downloadAndCreateImageThumbnailMarkerUrl( + mapImp, + key, + list, + type + ); + }); + } + }, + getThumbnail: async function (url, type) { + return new Promise((resolve, reject) => { + if (type === "Segmentation" || type === "Image") { + this.getBinaryThumbnail(url) + .then((response) => resolve(response)) + .catch((response) => reject(response)); + } else { + this.getGenericThumbnail(url) + .then((response) => resolve(response)) + .catch((response) => reject(response)); + } + }); + }, + getBinaryThumbnail: async function (url) { + return new Promise((resolve, reject) => { + fetch(url) + .then((response) => { + if (response.status >= 200 && response.status < 300) { + return response.text(); + } else { + reject(); + } + }) + .then((data) => { + if (data) { + let img = new Image(); + let wrapperElement = document.createElement("div"); + img.style = "height: auto;width: 50px;margin-right: 80px;"; + img.onload = function () { + wrapperElement.appendChild(img); + resolve(wrapperElement); + }; + img.onerror = function () { + reject(new Error("Failed to load image at " + url)); + }; + img.src = `data:'image/png';base64,${data}`; + } else { + reject(new Error("Failed to load image at " + url)); + } + }); + }); + }, + getGenericThumbnail: async function (url) { + return new Promise((resolve, reject) => { + let img = new Image(); + let wrapperElement = document.createElement("div"); + img.style = "height: auto;width: 50px;margin-right: 80px;"; + img.onload = function () { + wrapperElement.appendChild(img); + resolve(wrapperElement); + }; + img.onerror = function () { + reject(new Error("Failed to load image at " + url)); + }; + img.src = url; + }); + }, + createImageThumbnailMarkerUrl: function (mapImp, id, wrapperElement) { + // add it to the flatmap + const markerIdentifier = mapImp.addMarker(id, { + element: wrapperElement, + className: "highlight-marker", + cluster: false, + type: "image", + }); + + const marker = mapImp.addMarker(id); + return marker; + }, }, }; From e23211ea3117b882151671411a49e228e18eae9e Mon Sep 17 00:00:00 2001 From: alan-wu Date: Wed, 21 Aug 2024 14:43:23 +1200 Subject: [PATCH 10/47] Support scaffold in display image mode. --- src/components/FlatmapVuer.vue | 8 +++- src/mixins/flatmapImageMixin.js | 3 +- src/services/scicrunchMixin.js | 72 +++++++++++++++++++++++++++++---- 3 files changed, 73 insertions(+), 10 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 5705b1cc..6c155a13 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -2491,7 +2491,11 @@ export default { if (this.mapImp) { this.mapImp.clearMarkers() const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers - if (type === "Segmentations") { + if (type === "Scaffolds") { + let images = await this.getScaffoldThumbnails("id", anatomicalIdentifiers) + this.images = images + this.populateFlatmapWithImages(this.mapImp, images, type) + } else if (type === "Segmentations") { let images = await this.getSegmentationsThumbnails("id", anatomicalIdentifiers) this.images = images this.populateFlatmapWithImages(this.mapImp, images, type) @@ -2788,7 +2792,7 @@ export default { drawnType: 'All tools', drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'], imageType: 'None', - imageTypes: ['Segmentations', 'Images', 'None'], + imageTypes: ['Images', 'Scaffolds', 'Segmentations', 'None'], annotatedType: 'Anyone', annotatedTypes: ['Anyone', 'Me', 'Others'], openMapRef: undefined, diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js index 6d15df92..e2c28288 100644 --- a/src/mixins/flatmapImageMixin.js +++ b/src/mixins/flatmapImageMixin.js @@ -63,7 +63,8 @@ export default { getThumbnail: async function(url, type) { return new Promise((resolve, reject) => { if (type === "Segmentations" || - type === "Images") { + type === "Images" || + type === "Scaffolds") { this.getBinaryThumbnail(url) .then((response) => resolve(response)) .catch((response) => reject(response)) diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js index 954d7355..fa38cc89 100644 --- a/src/services/scicrunchMixin.js +++ b/src/services/scicrunchMixin.js @@ -25,8 +25,7 @@ const getBiolucidaInfo = async (sparcAPI, datasetId) => { const getFilesInfo = async (api, key, idsList, types) => { let params = new URLSearchParams(); types.forEach((type) => { - params.append('arrayparams', type); - params.append('arrayparams', type); + params.append('filetypes', type); }); let response = await fetch(`${api}/get-organ-curies/?${params}`); let data = await response.json(); @@ -60,12 +59,9 @@ const getFilesInfo = async (api, key, idsList, types) => { export default { // Note that the setting store is included in MapContent.vue methods: { - getThumbnailURL: function(thumbnailId) { + getBiolucidaThumbnailURL: function(thumbnailId) { return `${this.sparcAPI}/thumbnail/${thumbnailId}` }, - getSegmentationThumbnailURL: function(datasetId, datasetVersion, filePath) { - return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; - }, getBiolucidaThumbnails: async function (key, idsList) { try { const data = await getFilesInfo(this.sparcAPI, key, idsList, ["biolucida-2d", "biolucida-3d"]); @@ -77,7 +73,8 @@ export default { value.forEach((entry) => { if (entry.biolucida_id) { let image = { - thumbnail: this.getThumbnailURL(entry.biolucida_id), + thumbnail: this.getBiolucidaThumbnailURL(entry.biolucida_id), + resource: entry.file_path, datasetId: entry.id, } list.push(image); @@ -93,6 +90,63 @@ export default { } return {}; }, + findEntryWithPathInArray(entry, list, type) { + if (entry && list) { + for (let i = 0; i < entry.isSourceOf.length; i++) { + for (let l = 0; l < list.length; l++) { + const item = list[l]; + if (entry.id === item.id && (!type || item.type === type) && + entry.isSourceOf[i] === item.file_path) { + return item; + } + } + } + } + return undefined + }, + getScaffoldThumbnailURL: function(entry, list) { + const viewEntry = this.findEntryWithPathInArray( + entry, list, "abi-scaffold-view-file"); + const thumbnailEntry = this.findEntryWithPathInArray( + viewEntry, list, "abi-thumbnail"); + if (thumbnailEntry) { + return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}?${new URLSearchParams({encodeBase64: true})}`; + } + return undefined; + }, + getScaffoldThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, + ["abi-thumbnail", "abi-scaffold-metadata-file", 'abi-scaffold-view-file']); + if (data['files_info']) { + const images = {}; + for (const [key, value] of Object.entries(data['files_info'])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-scaffold-metadata-file") { + const thumbnailURL = this.getScaffoldThumbnailURL(entry, value); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + datasetId: entry.id, + } + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error('Error:', error); + } + return {}; + }, + //Get representative segmentations thumbnails // key - can either be // id - use the uberon id as key or @@ -111,6 +165,7 @@ export default { let image = { thumbnail: this.getSegmentationThumbnailURL(entry.id, entry.version, entry.file_path), + resource: entry.file_path, datasetId: entry.id, } list.push(image); @@ -125,6 +180,9 @@ export default { } return {}; }, + getSegmentationThumbnailURL: function(datasetId, datasetVersion, filePath) { + return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; + }, getImagesFromScicrunch: async function () { try { const response = await fetch(`${this.sparcAPI}/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams({q: imageQuery})}`); From c0dbe1bbeb904a41ca56b64929fd5ade64814f76 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 21 Aug 2024 15:46:24 +1200 Subject: [PATCH 11/47] Modify code and add scaffold support --- src/App.vue | 5 +- src/components/FlatmapVuer.vue | 47 ++---- src/components/MultiFlatmapVuer.vue | 10 +- src/mixins/imageMixin.js | 119 +--------------- src/mixins/scicrunchMixin.js | 213 ++++++++++++++++++++++++++++ 5 files changed, 228 insertions(+), 166 deletions(-) create mode 100644 src/mixins/scicrunchMixin.js diff --git a/src/App.vue b/src/App.vue index 26b8e3d6..6a6658d0 100644 --- a/src/App.vue +++ b/src/App.vue @@ -77,7 +77,6 @@ :displayMinimap="true" :enableOpenMapUI="true" :flatmapAPI="flatmapAPI" - :rootURL="rootURL" :sparcAPI="sparcAPI" :disableUI="disableUI" @open-pubmed-url="onOpenPubmedUrl" @@ -286,13 +285,11 @@ export default { useHelpModeDialog: true, multiflatmapRef: null, mapSettings: [], - rootURL: "http://localhost:3000/", sparcAPI: import.meta.env.VITE_SPARC_API, - flatmapAPI: import.meta.env.FLATMAP_API, //flatmapAPI: "https://mapcore-demo.org/current/flatmap/v2/" //flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v3/" //flatmapAPI: "https://mapcoe-demo.org/current/flatmap/v3/", - // flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/', + flatmapAPI: 'https://mapcore-demo.org/devel/flatmap/v4/', //flatmapAPI: "https://mapcore-demo.org/fccb/flatmap/" //flatmapAPI: "https://mapcore-demo.org/staging/flatmap/v1/" // flatmapAPI: "https://mapcore-demo.org/devel/flatmap/v1/", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 93e8e6d0..e4acfbac 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -501,7 +501,7 @@ Please use `const` to assign meaningful names to them...
- View Image + Images Display { @@ -774,7 +775,7 @@ const createUnfilledTooltipData = function () { */ export default { name: 'FlatmapVuer', - mixins:[imageMixin], + mixins:[scicrunchMixin,imageMixin], components: { Button, Col, @@ -1121,26 +1122,6 @@ export default { this.addAnnotationFeature() } }, - removeImageFromMap: function () { - if (this.mapImp) { - this.mapImp.clearMarkers(); - this.imageIds.forEach((id) => this.mapImp.removeImage(id)) - this.imageIds = [] - } - }, - populateImageToMap: function () { - if (this.mapImp) { - for (const [key, value] of Object.entries(this.anatomyImages[this.imageType])) { - if (value.length) { - const id = this.mapImp.addImage(key, value[0].thumbnail) - if (id) { - this.imageIds.push(id) - this.mapImp.addMarker(key, { className: "standard-marker", cluster: false }) - } - } - } - } - }, /** * @vuese * Function to switch the type of displayed image. @@ -1151,15 +1132,19 @@ export default { if (this.mapImp) { this.loading = true const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers - this.removeImageFromMap() + this.mapImp.clearMarkers(); if (type === 'Image' && !(type in this.anatomyImages)) { this.anatomyImages[type] = await this.getBiolucidaThumbnails("id", anatomicalIdentifiers) } else if (type === 'Segmentation' && !(type in this.anatomyImages)) { this.anatomyImages[type] = await this.getSegmentationThumbnails("id", anatomicalIdentifiers) + } else if (type === 'Scaffold' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await this.getScaffoldThumbnails("id", anatomicalIdentifiers) } else { console.log('switch to', type); } - this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) + if (this.anatomyImages[type]) { + this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) + } // this.populateImageToMap() this.loading = false } @@ -1175,7 +1160,7 @@ export default { if (flag) { this.setImageType(this.imageType) } else { - this.removeImageFromMap() + this.mapImp.clearMarkers(); } } }, @@ -2710,19 +2695,12 @@ export default { type: String, default: 'https://mapcore-demo.org/current/flatmap/v3/', }, - /** - * Specify the root url of the SPARC portal. - */ - rootURL: { - type: String, - default: 'https://sparc.science/', - }, /** * Specify the endpoint of the SPARC API. */ sparcAPI: { type: String, - default: 'https://api.sparc.science/', + default: 'https://api.sparc.science', }, /** * Flag to disable UIs on Map @@ -2742,7 +2720,6 @@ export default { provide() { return { flatmapAPI: this.flatmapAPI, - sparcAPI: this.sparcAPI, $annotator: this.annotator, getFeaturesAlert: () => this.featuresAlert, userApiKey: this.userToken, @@ -2867,7 +2844,7 @@ export default { without: true, } }), - anatomyImages: {}, + anatomyImages: markRaw({}), imageRadio: false, imageIds: [], imageType: 'Image', diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 1ea3adf8..d6591266 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -80,7 +80,6 @@ :showStarInLegend="showStarInLegend" style="height: 100%" :flatmapAPI="flatmapAPI" - :rootURL="rootURL" :sparcAPI="sparcAPI" />
@@ -696,19 +695,12 @@ export default { type: String, default: 'https://mapcore-demo.org/current/flatmap/v3/', }, - /** - * Specify the root url of the SPARC portal. - */ - rootURL: { - type: String, - default: 'https://sparc.science/', - }, /** * Specify the endpoint of the SPARC API. */ sparcAPI: { type: String, - default: 'https://api.sparc.science/', + default: 'https://api.sparc.science', }, /** * Flag to disable UIs on Map diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index ca8b4365..93d123be 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -1,122 +1,5 @@ -const getFilesInfo = async (api, key, idsList, types) => { - let params = new URLSearchParams(); - types.forEach((type) => { - params.append("arrayparams", type); - params.append("arrayparams", type); - }); - let response = await fetch(`${api}get-organ-curies/?${params}`); - let data = await response.json(); - const identifiers = []; - data.uberon.array.forEach((pair) => { - const identifier = { - id: pair.id.toUpperCase(), - name: pair.name, - }; - if (idsList.includes(identifier[key])) { - identifiers.push(identifier); - } - }); - const keys = identifiers.map((item) => item[key]); - response = await fetch(`${api}get-files-info-for-curies`, { - method: "POST", - body: JSON.stringify({ - filetypes: types, - curies: keys, - }), - headers: { - "Content-Type": "application/json", - }, - }); - data = await response.json(); - return data; -}; - export default { methods: { - getBiolucidaThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "biolucida-2d", - "biolucida-3d", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.biolucida_id) { - let image = { - thumbnail: this.getBiolucidaThumbnailURL( - entry.biolucida_id - ), - id: entry.id, - title: entry.file_path.substring( - entry.file_path.lastIndexOf("/") + 1 - ), - type: "Image", - link: `https://sparc.biolucida.net/api/v1/thumbnail/${entry.biolucida_id}`, - mimetype: 'image/png' - }; - list.push(image); - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getBiolucidaThumbnailURL: function (biolucidaId) { - return `${this.sparcAPI}thumbnail/${biolucidaId}`; - }, - getSegmentationThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "mbf-segmentation", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - let image = { - thumbnail: this.getSegmentationThumbnailURL( - entry.id, - entry.version, - entry.file_path - ), - id: entry.id, - title: entry.file_path.substring( - entry.file_path.lastIndexOf("/") + 1 - ), - type: "Segmentation", - link: this.getBiolucidaThumbnailURL(entry.biolucida_id), - }; - list.push(image); - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getSegmentationThumbnailURL: function ( - datasetId, - datasetVersion, - filePath - ) { - return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; - }, populateMapWithImages: function (mapImp, images, type) { for (const [key, list] of Object.entries(images)) { this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type); @@ -151,7 +34,7 @@ export default { }, getThumbnail: async function (url, type) { return new Promise((resolve, reject) => { - if (type === "Segmentation" || type === "Image") { + if (type === "Image" || type === "Segmentation" || type === "Scaffold") { this.getBinaryThumbnail(url) .then((response) => resolve(response)) .catch((response) => reject(response)); diff --git a/src/mixins/scicrunchMixin.js b/src/mixins/scicrunchMixin.js new file mode 100644 index 00000000..cd740de5 --- /dev/null +++ b/src/mixins/scicrunchMixin.js @@ -0,0 +1,213 @@ +const getFilesInfo = async (api, key, idsList, types) => { + let params = new URLSearchParams(); + types.forEach((type) => { + params.append("filetypes", type); + }); + let response = await fetch(`${api}/get-organ-curies/?${params}`); + let data = await response.json(); + const identifiers = []; + data.uberon.array.forEach((pair) => { + const identifier = { + id: pair.id.toUpperCase(), + name: pair.name, + }; + if (idsList.includes(identifier[key])) { + identifiers.push(identifier); + } + }); + const keys = identifiers.map((item) => item[key]); + response = await fetch(`${api}/get-files-info-for-curies`, { + method: "POST", + body: JSON.stringify({ + filetypes: types, + curies: keys, + species: ["Rat"], + }), + headers: { + "Content-Type": "application/json", + }, + }); + data = await response.json(); + return data; +}; + +const getFileName = (filePath) => { + return filePath.substring(filePath.lastIndexOf("/") + 1); +}; + +export default { + methods: { + getBiolucidaThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "biolucida-2d", + "biolucida-3d", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.biolucida_id) { + let image = { + thumbnail: this.getBiolucidaThumbnailURL( + entry.biolucida_id + ), + id: entry.id, + title: getFileName(entry.file_path), + type: "Image", + link: this.getBiolucidaThumbnailLink(entry.biolucida_id), + mimetype: entry.mimetype, + }; + list.push(image); + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; + }, + getBiolucidaThumbnailURL: function (biolucidaId) { + return `${this.sparcAPI}/thumbnail/${biolucidaId}`; + }, + getBiolucidaThumbnailLink: function (biolucidaId) { + return `${this.sparcAPI}/thumbnail/${biolucidaId}`; + }, + getSegmentationThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "mbf-segmentation", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + let image = { + thumbnail: this.getSegmentationThumbnailURL( + entry.id, + entry.version, + entry.file_path + ), + id: entry.id, + title: getFileName(entry.file_path), + type: "Segmentation", + link: this.getSegmentationThumbnailLink( + entry.id, + entry.version, + entry.file_path + ), + mimetype: entry.mimetype, + }; + list.push(image); + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; + }, + getSegmentationThumbnailURL: function ( + datasetId, + datasetVersion, + filePath + ) { + return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; + }, + getSegmentationThumbnailLink: function ( + datasetId, + datasetVersion, + filePath + ) { + return `https://sparc.biolucida.net:8081/thumbnail?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; + }, + getScaffoldThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "abi-thumbnail", + "abi-scaffold-metadata-file", + "abi-scaffold-view-file", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-scaffold-metadata-file") { + const thumbnailURL = this.getScaffoldThumbnailURL( + entry, + value + ); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + id: entry.id, + title: getFileName(entry.file_path), + type: "Scaffold", + link: thumbnailURL, + mimetype: entry.mimetype, + }; + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; + }, + getScaffoldThumbnailURL: function (entry, list) { + const viewEntry = this.findEntryWithPathInArray( + entry, + list, + "abi-scaffold-view-file" + ); + const thumbnailEntry = this.findEntryWithPathInArray( + viewEntry, + list, + "abi-thumbnail" + ); + if (thumbnailEntry) { + return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${ + thumbnailEntry.file_path + }?${new URLSearchParams({ encodeBase64: true })}`; + } + return undefined; + }, + findEntryWithPathInArray(entry, list, type) { + if (entry && list) { + for (let i = 0; i < entry.isSourceOf.length; i++) { + for (let l = 0; l < list.length; l++) { + const item = list[l]; + if ( + entry.id === item.id && + (!type || item.type === type) && + entry.isSourceOf[i] === item.file_path + ) { + return item; + } + } + } + } + return undefined; + }, + }, +}; From 00455dccb5ad92db048c8707ad2db8f402084042 Mon Sep 17 00:00:00 2001 From: alan-wu Date: Wed, 21 Aug 2024 15:47:40 +1200 Subject: [PATCH 12/47] Add plot type. --- src/components/FlatmapVuer.vue | 17 ++++++------ src/mixins/flatmapImageMixin.js | 3 +-- src/services/scicrunchMixin.js | 46 ++++++++++++++++++++++++++++++--- 3 files changed, 53 insertions(+), 13 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 6c155a13..8e38deaf 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -2491,19 +2491,20 @@ export default { if (this.mapImp) { this.mapImp.clearMarkers() const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers - if (type === "Scaffolds") { + if (type === "Images") { + let images = await this.getBiolucidaThumbnails("id", anatomicalIdentifiers) + this.images = images + } else if (type === "Scaffolds") { let images = await this.getScaffoldThumbnails("id", anatomicalIdentifiers) this.images = images - this.populateFlatmapWithImages(this.mapImp, images, type) } else if (type === "Segmentations") { - let images = await this.getSegmentationsThumbnails("id", anatomicalIdentifiers) + let images = await this.getSegmentationThumbnails("id", anatomicalIdentifiers) this.images = images - this.populateFlatmapWithImages(this.mapImp, images, type) - } else if (type === "Images") { - let images = await this.getBiolucidaThumbnails("id", anatomicalIdentifiers) + } else if (type === "Plots") { + let images = await this.getPlotThumbnails("id", anatomicalIdentifiers) this.images = images - this.populateFlatmapWithImages(this.mapImp, images, type) } + this.populateFlatmapWithImages(this.mapImp, this.images, type) } }, }, @@ -2792,7 +2793,7 @@ export default { drawnType: 'All tools', drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'], imageType: 'None', - imageTypes: ['Images', 'Scaffolds', 'Segmentations', 'None'], + imageTypes: ['Images', 'Scaffolds', 'Segmentations', 'Plots', 'None'], annotatedType: 'Anyone', annotatedTypes: ['Anyone', 'Me', 'Others'], openMapRef: undefined, diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js index e2c28288..6d15df92 100644 --- a/src/mixins/flatmapImageMixin.js +++ b/src/mixins/flatmapImageMixin.js @@ -63,8 +63,7 @@ export default { getThumbnail: async function(url, type) { return new Promise((resolve, reject) => { if (type === "Segmentations" || - type === "Images" || - type === "Scaffolds") { + type === "Images") { this.getBinaryThumbnail(url) .then((response) => resolve(response)) .catch((response) => reject(response)) diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js index fa38cc89..7d3de2f5 100644 --- a/src/services/scicrunchMixin.js +++ b/src/services/scicrunchMixin.js @@ -110,7 +110,7 @@ export default { const thumbnailEntry = this.findEntryWithPathInArray( viewEntry, list, "abi-thumbnail"); if (thumbnailEntry) { - return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}?${new URLSearchParams({encodeBase64: true})}`; + return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}`; } return undefined; }, @@ -146,14 +146,13 @@ export default { } return {}; }, - //Get representative segmentations thumbnails // key - can either be // id - use the uberon id as key or // name - anatomical name as key // idsList - Only id / name from the server matching the one in this list // will be used - getSegmentationsThumbnails: async function (key, idsList) { + getSegmentationThumbnails: async function (key, idsList) { try { const data = await getFilesInfo(this.sparcAPI, key, idsList, ["mbf-segmentation"]); if (data['files_info']) { @@ -183,6 +182,47 @@ export default { getSegmentationThumbnailURL: function(datasetId, datasetVersion, filePath) { return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; }, + getPlotThumbnailURL: function(entry) { + //None of the thumbnail for plot is properly annotated. + //We will use the first in is source of for testing. + if (entry.isSourceOf.length > 0) { + return `${this.sparcAPI}/s3-resource/${entry.id}/files/${entry.isSourceOf[0]}`; + } + return undefined; + }, + getPlotThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, + ["abi-plot", "abi-thumbnail"]); + if (data['files_info']) { + const images = {}; + for (const [key, value] of Object.entries(data['files_info'])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-plot") { + console.log(entry); + const thumbnailURL = this.getPlotThumbnailURL(entry); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + datasetId: entry.id, + } + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error('Error:', error); + } + return {}; + }, getImagesFromScicrunch: async function () { try { const response = await fetch(`${this.sparcAPI}/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams({q: imageQuery})}`); From e6bbb6ce73a156881451b83dab126e6afa146313 Mon Sep 17 00:00:00 2001 From: alan-wu Date: Wed, 21 Aug 2024 15:50:39 +1200 Subject: [PATCH 13/47] Clean up unused codes. --- src/mixins/flatmapImageMixin.js | 31 ------------- src/services/scicrunchMixin.js | 80 --------------------------------- 2 files changed, 111 deletions(-) diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js index 6d15df92..1cd2768c 100644 --- a/src/mixins/flatmapImageMixin.js +++ b/src/mixins/flatmapImageMixin.js @@ -22,43 +22,12 @@ export default { for (const [key, list] of Object.entries(images)) { this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type) } - /* - images.forEach((image) => { - if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (!anatomyList.includes(anatomy.curie) && ids.includes(anatomy.curie)) { - console.log(anatomy.curie) - anatomyList.push(anatomy.curie) - this.createImageThumbnailMarkerUrl(mapImp, anatomy.curie, image.thumbnail) - } - }) - } - }) - }) - */ }, findImagesForAnatomy: function (images = [], anatomyToFind) { if (anatomyToFind in images) { return images[anatomyToFind] } return [] - /* - images.forEach((image) => { - if (image.value && image.value.length > 0) - image.value.forEach((image) => { - if (image.anatomy && image.anatomy.length > 0) { - image.anatomy.forEach((anatomy) => { - if (anatomy.curie === anatomyToFind) { - imageList.push(image) - } - }) - } - }) - }) - return imageList - */ }, getThumbnail: async function(url, type) { return new Promise((resolve, reject) => { diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js index 7d3de2f5..d34e3143 100644 --- a/src/services/scicrunchMixin.js +++ b/src/services/scicrunchMixin.js @@ -1,27 +1,4 @@ /* eslint-disable no-alert, no-console */ -const imageQuery = '"*jp2* OR *vnd.ome.xml* OR *jpx*"'; - -const getBiolucidaInfo = async (sparcAPI, datasetId) => { - return new Promise((resolve, reject) => { - const endpoint = `${sparcAPI}/image_search/${datasetId}` - fetch(endpoint) - .then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.json(); - } else { - reject(); - } - }) - .then((data) => { - if (data.status == 'success') { - resolve(data); - } else { - reject(); - } - }) - }) -} - const getFilesInfo = async (api, key, idsList, types) => { let params = new URLSearchParams(); types.forEach((type) => { @@ -201,7 +178,6 @@ export default { const list = []; value.forEach((entry) => { if (entry.type === "abi-plot") { - console.log(entry); const thumbnailURL = this.getPlotThumbnailURL(entry); if (thumbnailURL) { let image = { @@ -223,61 +199,5 @@ export default { } return {}; }, - getImagesFromScicrunch: async function () { - try { - const response = await fetch(`${this.sparcAPI}/multiple_dataset_info/using_multiple_mimetype/?${new URLSearchParams({q: imageQuery})}`); - const data = await response.json(); - - console.log('number of hits:', data.numberOfHits); - if (data.numberOfHits >= 1) { - let images = await this.processResults(data.results); - return {success: true, images: images}; - } - return {success: false}; - } catch (error) { - console.error('Error:', error); - return {success: false}; - } - }, - - processResults: async function (results) { - try { - let images = []; - const dataType = 'segmentation'; - console.log('starting promise list') - let promiseList = results.map(async (result, i) => { - const datasetId = result.dataset_identifier; - const datasetVersion = result.dataset_version; - const s3uri = result.s3uri; - const biolucidaInfo = await getBiolucidaInfo(this.sparcAPI, datasetId); - return biolucidaInfo.dataset_images.map(bioImage => { - return { - resource: { - share_link: bioImage.share_link, - }, - title: 'Image', - anatomy: result.organs, - species: result.organisms, - datasetId: datasetId, - datasetVersion: datasetVersion, - link: bioImage.share_link, - s3uri: s3uri, - type: dataType, - thumbnail: bioImage.thumbnail_url, - }; - }); - }); - console.log('promiseList:', promiseList); - let biolucidaInfos = await Promise.allSettled(promiseList); - images = biolucidaInfos.flat(); - console.log('biolucidaInfos:', biolucidaInfos); - console.log('finished!') - return images; - } catch (error) { - console.error('Error:', error); - return []; - } - } } } - \ No newline at end of file From 3722c4c9342878f77fb08a43195554347d5c1466 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:40:31 +1200 Subject: [PATCH 14/47] Make some changes after merge in upstream --- src/components/FlatmapVuer.vue | 14 +-- src/mixins/flatmapImageMixin.js | 104 ---------------- src/mixins/imageMixin.js | 2 +- src/mixins/scicrunchMixin.js | 52 +++++++- src/services/scicrunchMixin.js | 203 -------------------------------- 5 files changed, 55 insertions(+), 320 deletions(-) delete mode 100644 src/mixins/flatmapImageMixin.js delete mode 100644 src/services/scicrunchMixin.js diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 585e7d1a..9e61b1e5 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -795,8 +795,7 @@ export default { ElIconWarningFilled, ElIconArrowDown, ElIconArrowLeft, - DrawToolbar, - IframeImageDialog + DrawToolbar }, beforeCreate: function () { //The state watcher may triggered before @@ -2804,10 +2803,12 @@ export default { }, drawnType: 'All tools', drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'], - imageType: 'None', - imageTypes: ['Images', 'Scaffolds', 'Segmentations', 'Plots', 'None'], annotatedType: 'Anyone', annotatedTypes: ['Anyone', 'Me', 'Others'], + anatomyImages: markRaw({}), + imageRadio: false, + imageType: 'Image', + imageTypes: ['Image', 'Plot', 'Scaffold', 'Segmentation'], openMapRef: undefined, backgroundIconRef: undefined, toolbarOptions: [ @@ -2846,11 +2847,6 @@ export default { without: true, } }), - anatomyImages: markRaw({}), - imageRadio: false, - imageIds: [], - imageType: 'Image', - imageTypes: ['Image', 'Plot', 'Scaffold', 'Segmentation'], } }, computed: { diff --git a/src/mixins/flatmapImageMixin.js b/src/mixins/flatmapImageMixin.js deleted file mode 100644 index 1cd2768c..00000000 --- a/src/mixins/flatmapImageMixin.js +++ /dev/null @@ -1,104 +0,0 @@ -export default { - // Note that the setting store is included in MapContent.vue - methods: { - downloadAndCreateImageThumbnailMarkerUrl: function(mapImp, key, list, type) { - const count = list.length - if (count > 0) { - //Pick a random image - const index = Math.floor(Math.random() * count) - const thumbnail = list[index].thumbnail - this.getThumbnail(thumbnail, type) - .then((wrappedElement) => { - this.createImageThumbnailMarkerUrl(mapImp, key, wrappedElement) - }) - .catch(() => { - //Failed to download, pick another one - list.splice(index) - this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type) - }) - } - }, - populateFlatmapWithImages: function (mapImp, images = [], type) { - for (const [key, list] of Object.entries(images)) { - this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type) - } - }, - findImagesForAnatomy: function (images = [], anatomyToFind) { - if (anatomyToFind in images) { - return images[anatomyToFind] - } - return [] - }, - getThumbnail: async function(url, type) { - return new Promise((resolve, reject) => { - if (type === "Segmentations" || - type === "Images") { - this.getBinaryThumbnail(url) - .then((response) => resolve(response)) - .catch((response) => reject(response)) - } else { - this.getGenericThumbnail(url) - .then((response) => resolve(response)) - .catch((response) => reject(response)) - } - }) - }, - getBinaryThumbnail: async function(url) { - return new Promise((resolve, reject) => { - fetch(url) - .then((response) => { - if (response.status >= 200 && response.status < 300) { - return response.text() - } else { - reject(); - } - }) - .then((data) => { - if (data) { - let img = new Image(); - let wrapperElement = document.createElement("div") - img.style = "height: auto;width: 50px;margin-right: 80px;" - img.onload = function() { - wrapperElement.appendChild(img); - resolve(wrapperElement); - } - img.onerror = function() { - reject(new Error("Failed to load image at " + url)); - }; - img.src= `data:'image/png';base64,${data}` - } else { - reject(new Error("Failed to load image at " + url)); - } - }) - }) - }, - getGenericThumbnail: async function(url) { - return new Promise((resolve, reject) => { - let img = new Image(); - let wrapperElement = document.createElement("div"); - img.style = "height: auto;width: 50px;margin-right: 80px;" - img.onload = function() { - wrapperElement.appendChild(img); - resolve(wrapperElement); - } - img.onerror = function() { - reject(new Error("Failed to load image at " + url)); - }; - img.src = url; - }); - }, - createImageThumbnailMarkerUrl: function (mapImp, id, wrapperElement) { - // add it to the flatmap - const markerIdentifier = mapImp.addMarker(id, { - element: wrapperElement, - className: "highlight-marker", - cluster: false, - type: "image", - }); - - const marker = mapImp.addMarker(id); - return marker - } - - } -} diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index 93d123be..0b7e3cf8 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -34,7 +34,7 @@ export default { }, getThumbnail: async function (url, type) { return new Promise((resolve, reject) => { - if (type === "Image" || type === "Segmentation" || type === "Scaffold") { + if (type === "Image" || type === "Segmentation") { this.getBinaryThumbnail(url) .then((response) => resolve(response)) .catch((response) => reject(response)); diff --git a/src/mixins/scicrunchMixin.js b/src/mixins/scicrunchMixin.js index cd740de5..ab4f4f3d 100644 --- a/src/mixins/scicrunchMixin.js +++ b/src/mixins/scicrunchMixin.js @@ -54,6 +54,7 @@ export default { thumbnail: this.getBiolucidaThumbnailURL( entry.biolucida_id ), + resource: entry.file_path, id: entry.id, title: getFileName(entry.file_path), type: "Image", @@ -96,6 +97,7 @@ export default { entry.version, entry.file_path ), + resource: entry.file_path, id: entry.id, title: getFileName(entry.file_path), type: "Segmentation", @@ -186,9 +188,7 @@ export default { "abi-thumbnail" ); if (thumbnailEntry) { - return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${ - thumbnailEntry.file_path - }?${new URLSearchParams({ encodeBase64: true })}`; + return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}`; } return undefined; }, @@ -209,5 +209,51 @@ export default { } return undefined; }, + getPlotThumbnails: async function (key, idsList) { + try { + const data = await getFilesInfo(this.sparcAPI, key, idsList, [ + "abi-plot", + "abi-thumbnail", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-plot") { + const thumbnailURL = this.getPlotThumbnailURL(entry); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + datasetId: entry.id, + title: getFileName(entry.file_path), + type: "Plot", + link: thumbnailURL, + mimetype: entry.mimetype, + }; + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; + }, + getPlotThumbnailURL: function (entry) { + //None of the thumbnail for plot is properly annotated. + //We will use the first in is source of for testing. + if (entry.isSourceOf.length > 0) { + return `${this.sparcAPI}/s3-resource/${entry.id}/files/${entry.isSourceOf[0]}`; + } + return undefined; + }, }, }; diff --git a/src/services/scicrunchMixin.js b/src/services/scicrunchMixin.js deleted file mode 100644 index d34e3143..00000000 --- a/src/services/scicrunchMixin.js +++ /dev/null @@ -1,203 +0,0 @@ -/* eslint-disable no-alert, no-console */ -const getFilesInfo = async (api, key, idsList, types) => { - let params = new URLSearchParams(); - types.forEach((type) => { - params.append('filetypes', type); - }); - let response = await fetch(`${api}/get-organ-curies/?${params}`); - let data = await response.json(); - const identifiers = []; - data.uberon.array.forEach(pair => { - const identifier = { - id: pair.id.toUpperCase(), - name: pair.name - }; - if (idsList.includes(identifier[key])) { - identifiers.push(identifier); - } - }); - const keys = identifiers.map((item) => item[key]); - response = await fetch(`${api}/get-files-info-for-curies`, { - method: "POST", - body: JSON.stringify( - { - filetypes: types, - curies: keys, - } - ), - headers: { - "Content-Type": "application/json", - }, - }); - data = await response.json(); - return data; -} - -export default { - // Note that the setting store is included in MapContent.vue - methods: { - getBiolucidaThumbnailURL: function(thumbnailId) { - return `${this.sparcAPI}/thumbnail/${thumbnailId}` - }, - getBiolucidaThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, ["biolucida-2d", "biolucida-3d"]); - if (data['files_info']) { - const images = {}; - for (const [key, value] of Object.entries(data['files_info'])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.biolucida_id) { - let image = { - thumbnail: this.getBiolucidaThumbnailURL(entry.biolucida_id), - resource: entry.file_path, - datasetId: entry.id, - } - list.push(image); - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error('Error:', error); - } - return {}; - }, - findEntryWithPathInArray(entry, list, type) { - if (entry && list) { - for (let i = 0; i < entry.isSourceOf.length; i++) { - for (let l = 0; l < list.length; l++) { - const item = list[l]; - if (entry.id === item.id && (!type || item.type === type) && - entry.isSourceOf[i] === item.file_path) { - return item; - } - } - } - } - return undefined - }, - getScaffoldThumbnailURL: function(entry, list) { - const viewEntry = this.findEntryWithPathInArray( - entry, list, "abi-scaffold-view-file"); - const thumbnailEntry = this.findEntryWithPathInArray( - viewEntry, list, "abi-thumbnail"); - if (thumbnailEntry) { - return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}`; - } - return undefined; - }, - getScaffoldThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, - ["abi-thumbnail", "abi-scaffold-metadata-file", 'abi-scaffold-view-file']); - if (data['files_info']) { - const images = {}; - for (const [key, value] of Object.entries(data['files_info'])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.type === "abi-scaffold-metadata-file") { - const thumbnailURL = this.getScaffoldThumbnailURL(entry, value); - if (thumbnailURL) { - let image = { - thumbnail: thumbnailURL, - resource: entry.file_path, - datasetId: entry.id, - } - list.push(image); - } - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error('Error:', error); - } - return {}; - }, - //Get representative segmentations thumbnails - // key - can either be - // id - use the uberon id as key or - // name - anatomical name as key - // idsList - Only id / name from the server matching the one in this list - // will be used - getSegmentationThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, ["mbf-segmentation"]); - if (data['files_info']) { - const images = {}; - for (const [key, value] of Object.entries(data['files_info'])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - let image = { - thumbnail: this.getSegmentationThumbnailURL(entry.id, - entry.version, entry.file_path), - resource: entry.file_path, - datasetId: entry.id, - } - list.push(image); - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error('Error:', error); - } - return {}; - }, - getSegmentationThumbnailURL: function(datasetId, datasetVersion, filePath) { - return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; - }, - getPlotThumbnailURL: function(entry) { - //None of the thumbnail for plot is properly annotated. - //We will use the first in is source of for testing. - if (entry.isSourceOf.length > 0) { - return `${this.sparcAPI}/s3-resource/${entry.id}/files/${entry.isSourceOf[0]}`; - } - return undefined; - }, - getPlotThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, - ["abi-plot", "abi-thumbnail"]); - if (data['files_info']) { - const images = {}; - for (const [key, value] of Object.entries(data['files_info'])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.type === "abi-plot") { - const thumbnailURL = this.getPlotThumbnailURL(entry); - if (thumbnailURL) { - let image = { - thumbnail: thumbnailURL, - resource: entry.file_path, - datasetId: entry.id, - } - list.push(image); - } - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error('Error:', error); - } - return {}; - }, - } -} From ff4517136a0180ea08ee539f06369f7246f9d339 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:08:01 +1200 Subject: [PATCH 15/47] Change scicrunch mixin to service --- src/components/FlatmapVuer.vue | 103 ++++++------ src/mixins/scicrunchMixin.js | 259 ------------------------------- src/services/scicrunchQueries.js | 255 ++++++++++++++++++++++++++++++ 3 files changed, 314 insertions(+), 303 deletions(-) delete mode 100644 src/mixins/scicrunchMixin.js create mode 100644 src/services/scicrunchQueries.js diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 9e61b1e5..9057ec8d 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -685,7 +685,12 @@ import { mapState } from 'pinia' import { useMainStore } from '@/store/index' import { DrawToolbar, Tooltip, TreeControls } from '@abi-software/map-utilities' import '@abi-software/map-utilities/dist/style.css' -import scicrunchMixin from '../mixins/scicrunchMixin' +import { + getBiolucidaThumbnails, + getSegmentationThumbnails, + getScaffoldThumbnails, + getPlotThumbnails +} from '../services/scicrunchQueries' import imageMixin from '../mixins/imageMixin' const centroid = (geometry) => { @@ -775,7 +780,7 @@ const createUnfilledTooltipData = function () { */ export default { name: 'FlatmapVuer', - mixins:[scicrunchMixin,imageMixin], + mixins:[imageMixin], components: { Button, Col, @@ -808,6 +813,57 @@ export default { return { annotator } }, methods: { + /** + * @vuese + * Function to add image thumbnails to the map. + */ + populateImageThumbnails: async function (type) { + if (this.mapImp) { + this.loading = true + const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers + this.closeTooltip() + this.mapImp.clearMarkers(); + if (type === 'Image' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await getBiolucidaThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) + } else if (type === 'Segmentation' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await getSegmentationThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) + } else if (type === 'Scaffold' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await getScaffoldThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) + } else if (type === 'Plot' && !(type in this.anatomyImages)) { + this.anatomyImages[type] = await getPlotThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) + } + if (this.anatomyImages[type]) { + this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) + } + this.loading = false + } + }, + /** + * @vuese + * Function to switch the type of displayed image. + * @arg type + */ + setImageType: function (type) { + this.imageType = type + if (this.mapImp) { + this.populateImageThumbnails(type) + } + }, + /** + * @vuese + * Function to switch show or hide images. + * @arg flag + */ + setImage: function (flag) { + this.imageRadio = flag + if (this.mapImp) { + if (flag) { + this.setImageType(this.imageType) + } else { + this.mapImp.clearMarkers(); + } + } + }, /** * @vuese * Function to initialise drawing. @@ -1122,47 +1178,6 @@ export default { this.addAnnotationFeature() } }, - /** - * @vuese - * Function to switch the type of displayed image. - * @arg type - */ - setImageType: async function (type) { - this.imageType = type - if (this.mapImp) { - this.loading = true - const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers - this.mapImp.clearMarkers(); - if (type === 'Image' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await this.getBiolucidaThumbnails("id", anatomicalIdentifiers) - } else if (type === 'Segmentation' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await this.getSegmentationThumbnails("id", anatomicalIdentifiers) - } else if (type === 'Scaffold' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await this.getScaffoldThumbnails("id", anatomicalIdentifiers) - } else if (type === 'Plot' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await this.getPlotThumbnails("id", anatomicalIdentifiers) - } - if (this.anatomyImages[type]) { - this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) - } - this.loading = false - } - }, - /** - * @vuese - * Function to switch show or hide images. - * @arg flag - */ - setImage: function (flag) { - this.imageRadio = flag - if (this.mapImp) { - if (flag) { - this.setImageType(this.imageType) - } else { - this.mapImp.clearMarkers(); - } - } - }, /** * @vuese * Function to switch from 2D to 3D @@ -2808,7 +2823,7 @@ export default { anatomyImages: markRaw({}), imageRadio: false, imageType: 'Image', - imageTypes: ['Image', 'Plot', 'Scaffold', 'Segmentation'], + imageTypes: ['Image', 'Segmentation', 'Scaffold', 'Plot'], openMapRef: undefined, backgroundIconRef: undefined, toolbarOptions: [ diff --git a/src/mixins/scicrunchMixin.js b/src/mixins/scicrunchMixin.js deleted file mode 100644 index ab4f4f3d..00000000 --- a/src/mixins/scicrunchMixin.js +++ /dev/null @@ -1,259 +0,0 @@ -const getFilesInfo = async (api, key, idsList, types) => { - let params = new URLSearchParams(); - types.forEach((type) => { - params.append("filetypes", type); - }); - let response = await fetch(`${api}/get-organ-curies/?${params}`); - let data = await response.json(); - const identifiers = []; - data.uberon.array.forEach((pair) => { - const identifier = { - id: pair.id.toUpperCase(), - name: pair.name, - }; - if (idsList.includes(identifier[key])) { - identifiers.push(identifier); - } - }); - const keys = identifiers.map((item) => item[key]); - response = await fetch(`${api}/get-files-info-for-curies`, { - method: "POST", - body: JSON.stringify({ - filetypes: types, - curies: keys, - species: ["Rat"], - }), - headers: { - "Content-Type": "application/json", - }, - }); - data = await response.json(); - return data; -}; - -const getFileName = (filePath) => { - return filePath.substring(filePath.lastIndexOf("/") + 1); -}; - -export default { - methods: { - getBiolucidaThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "biolucida-2d", - "biolucida-3d", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.biolucida_id) { - let image = { - thumbnail: this.getBiolucidaThumbnailURL( - entry.biolucida_id - ), - resource: entry.file_path, - id: entry.id, - title: getFileName(entry.file_path), - type: "Image", - link: this.getBiolucidaThumbnailLink(entry.biolucida_id), - mimetype: entry.mimetype, - }; - list.push(image); - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getBiolucidaThumbnailURL: function (biolucidaId) { - return `${this.sparcAPI}/thumbnail/${biolucidaId}`; - }, - getBiolucidaThumbnailLink: function (biolucidaId) { - return `${this.sparcAPI}/thumbnail/${biolucidaId}`; - }, - getSegmentationThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "mbf-segmentation", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - let image = { - thumbnail: this.getSegmentationThumbnailURL( - entry.id, - entry.version, - entry.file_path - ), - resource: entry.file_path, - id: entry.id, - title: getFileName(entry.file_path), - type: "Segmentation", - link: this.getSegmentationThumbnailLink( - entry.id, - entry.version, - entry.file_path - ), - mimetype: entry.mimetype, - }; - list.push(image); - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getSegmentationThumbnailURL: function ( - datasetId, - datasetVersion, - filePath - ) { - return `${this.sparcAPI}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; - }, - getSegmentationThumbnailLink: function ( - datasetId, - datasetVersion, - filePath - ) { - return `https://sparc.biolucida.net:8081/thumbnail?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; - }, - getScaffoldThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "abi-thumbnail", - "abi-scaffold-metadata-file", - "abi-scaffold-view-file", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.type === "abi-scaffold-metadata-file") { - const thumbnailURL = this.getScaffoldThumbnailURL( - entry, - value - ); - if (thumbnailURL) { - let image = { - thumbnail: thumbnailURL, - resource: entry.file_path, - id: entry.id, - title: getFileName(entry.file_path), - type: "Scaffold", - link: thumbnailURL, - mimetype: entry.mimetype, - }; - list.push(image); - } - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getScaffoldThumbnailURL: function (entry, list) { - const viewEntry = this.findEntryWithPathInArray( - entry, - list, - "abi-scaffold-view-file" - ); - const thumbnailEntry = this.findEntryWithPathInArray( - viewEntry, - list, - "abi-thumbnail" - ); - if (thumbnailEntry) { - return `${this.sparcAPI}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}`; - } - return undefined; - }, - findEntryWithPathInArray(entry, list, type) { - if (entry && list) { - for (let i = 0; i < entry.isSourceOf.length; i++) { - for (let l = 0; l < list.length; l++) { - const item = list[l]; - if ( - entry.id === item.id && - (!type || item.type === type) && - entry.isSourceOf[i] === item.file_path - ) { - return item; - } - } - } - } - return undefined; - }, - getPlotThumbnails: async function (key, idsList) { - try { - const data = await getFilesInfo(this.sparcAPI, key, idsList, [ - "abi-plot", - "abi-thumbnail", - ]); - if (data["files_info"]) { - const images = {}; - for (const [key, value] of Object.entries(data["files_info"])) { - if (value.length > 0) { - const list = []; - value.forEach((entry) => { - if (entry.type === "abi-plot") { - const thumbnailURL = this.getPlotThumbnailURL(entry); - if (thumbnailURL) { - let image = { - thumbnail: thumbnailURL, - resource: entry.file_path, - datasetId: entry.id, - title: getFileName(entry.file_path), - type: "Plot", - link: thumbnailURL, - mimetype: entry.mimetype, - }; - list.push(image); - } - } - }); - images[key] = list; - } - } - return images; - } - } catch (error) { - console.error("Error:", error); - } - return {}; - }, - getPlotThumbnailURL: function (entry) { - //None of the thumbnail for plot is properly annotated. - //We will use the first in is source of for testing. - if (entry.isSourceOf.length > 0) { - return `${this.sparcAPI}/s3-resource/${entry.id}/files/${entry.isSourceOf[0]}`; - } - return undefined; - }, - }, -}; diff --git a/src/services/scicrunchQueries.js b/src/services/scicrunchQueries.js new file mode 100644 index 00000000..d4416e65 --- /dev/null +++ b/src/services/scicrunchQueries.js @@ -0,0 +1,255 @@ +const getFilesInfo = async (sparcApi, key, idsList, types) => { + let params = new URLSearchParams(); + types.forEach((type) => { + params.append("filetypes", type); + }); + let response = await fetch(`${sparcApi}/get-organ-curies/?${params}`); + let data = await response.json(); + const identifiers = []; + data.uberon.array.forEach((pair) => { + const identifier = { + id: pair.id.toUpperCase(), + name: pair.name, + }; + if (idsList.includes(identifier[key])) { + identifiers.push(identifier); + } + }); + const keys = identifiers.map((item) => item[key]); + response = await fetch(`${sparcApi}/get-files-info-for-curies`, { + method: "POST", + body: JSON.stringify({ + filetypes: types, + curies: keys, + species: ["Rat"], + }), + headers: { + "Content-Type": "application/json", + }, + }); + data = await response.json(); + return data; +}; + +const getFileName = (filePath) => { + return filePath.substring(filePath.lastIndexOf("/") + 1); +}; + +const getBiolucidaThumbnailURL = (sparcApi, biolucidaId) => { + return `${sparcApi}/thumbnail/${biolucidaId}`; +}; +const getBiolucidaThumbnails = async (sparcApi, key, idsList) => { + try { + const data = await getFilesInfo(sparcApi, key, idsList, [ + "biolucida-2d", + "biolucida-3d", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + const thumbnailURL = getBiolucidaThumbnailURL( + sparcApi, + entry.biolucida_id + ); + if (entry.biolucida_id) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + id: entry.id, + title: getFileName(entry.file_path), + type: "Image", + link: thumbnailURL, + mimetype: entry.mimetype, + }; + list.push(image); + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; +}; + +const getSegmentationThumbnailURL = ( + sparcApi, + datasetId, + datasetVersion, + filePath +) => { + return `${sparcApi}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; +}; +const getSegmentationThumbnails = async (sparcApi, key, idsList) => { + try { + const data = await getFilesInfo(sparcApi, key, idsList, [ + "mbf-segmentation", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + const thumbnailURL = getSegmentationThumbnailURL( + sparcApi, + entry.id, + entry.version, + entry.file_path + ); + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + id: entry.id, + title: getFileName(entry.file_path), + type: "Segmentation", + link: thumbnailURL, + mimetype: entry.mimetype, + }; + list.push(image); + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; +}; + +const findEntryWithPathInArray = (entry, list, type) => { + if (entry && list) { + for (let i = 0; i < entry.isSourceOf.length; i++) { + for (let l = 0; l < list.length; l++) { + const item = list[l]; + if ( + entry.id === item.id && + (!type || item.type === type) && + entry.isSourceOf[i] === item.file_path + ) { + return item; + } + } + } + } + return undefined; +}; +const getScaffoldThumbnailURL = (sparcApi, entry, list) => { + const viewEntry = findEntryWithPathInArray( + entry, + list, + "abi-scaffold-view-file" + ); + const thumbnailEntry = findEntryWithPathInArray( + viewEntry, + list, + "abi-thumbnail" + ); + if (thumbnailEntry) { + return `${sparcApi}/s3-resource/${thumbnailEntry.id}/files/${thumbnailEntry.file_path}`; + } + return undefined; +}; +const getScaffoldThumbnails = async (sparcApi, key, idsList) => { + try { + const data = await getFilesInfo(sparcApi, key, idsList, [ + "abi-thumbnail", + "abi-scaffold-metadata-file", + "abi-scaffold-view-file", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-scaffold-metadata-file") { + const thumbnailURL = getScaffoldThumbnailURL( + sparcApi, + entry, + value + ); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + id: entry.id, + title: getFileName(entry.file_path), + type: "Scaffold", + link: thumbnailURL, + }; + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; +}; + +const getPlotThumbnailURL = (sparcApi, entry) => { + //None of the thumbnail for plot is properly annotated. + //We will use the first in is source of for testing. + if (entry.isSourceOf.length > 0) { + return `${sparcApi}/s3-resource/${entry.id}/files/${entry.isSourceOf[0]}`; + } + return undefined; +}; +const getPlotThumbnails = async (sparcApi, key, idsList) => { + try { + const data = await getFilesInfo(sparcApi, key, idsList, [ + "abi-plot", + "abi-thumbnail", + ]); + if (data["files_info"]) { + const images = {}; + for (const [key, value] of Object.entries(data["files_info"])) { + if (value.length > 0) { + const list = []; + value.forEach((entry) => { + if (entry.type === "abi-plot") { + const thumbnailURL = getPlotThumbnailURL(sparcApi, entry); + if (thumbnailURL) { + let image = { + thumbnail: thumbnailURL, + resource: entry.file_path, + datasetId: entry.id, + title: getFileName(entry.file_path), + type: "Plot", + link: thumbnailURL, + }; + list.push(image); + } + } + }); + images[key] = list; + } + } + return images; + } + } catch (error) { + console.error("Error:", error); + } + return {}; +}; + +export { + getBiolucidaThumbnails, + getSegmentationThumbnails, + getScaffoldThumbnails, + getPlotThumbnails, +}; From 6f45801cd10e728bc0ba913373f6663106dee62a Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:17:42 +1200 Subject: [PATCH 16/47] Rename function --- src/mixins/imageMixin.js | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index 0b7e3cf8..f9ba2db8 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -2,33 +2,23 @@ export default { methods: { populateMapWithImages: function (mapImp, images, type) { for (const [key, list] of Object.entries(images)) { - this.downloadAndCreateImageThumbnailMarkerUrl(mapImp, key, list, type); + this.downloadImageThumbnail(mapImp, key, list, type); } }, - downloadAndCreateImageThumbnailMarkerUrl: function ( - mapImp, - key, - list, - type - ) { + downloadImageThumbnail: function (mapImp, key, list, type) { const count = list.length; if (count > 0) { //Pick a random image const index = Math.floor(Math.random() * count); const thumbnail = list[index].thumbnail; this.getThumbnail(thumbnail, type) - .then((wrappedElement) => { - this.createImageThumbnailMarkerUrl(mapImp, key, wrappedElement); + .then((wrapperElement) => { + this.addImageThumbnailMarker(mapImp, key, wrapperElement); }) .catch(() => { //Failed to download, pick another one list.splice(index); - this.downloadAndCreateImageThumbnailMarkerUrl( - mapImp, - key, - list, - type - ); + this.downloadImageThumbnail(mapImp, key, list, type); }); } }, @@ -89,17 +79,13 @@ export default { img.src = url; }); }, - createImageThumbnailMarkerUrl: function (mapImp, id, wrapperElement) { - // add it to the flatmap + addImageThumbnailMarker: function (mapImp, id, wrapperElement) { const markerIdentifier = mapImp.addMarker(id, { element: wrapperElement, className: "highlight-marker", cluster: false, type: "image", }); - - const marker = mapImp.addMarker(id); - return marker; }, }, }; From 326c1e6b1c1d6715e5a6cbed1672fc42ffdf195d Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Thu, 22 Aug 2024 16:42:58 +1200 Subject: [PATCH 17/47] Fix image size issue --- package-lock.json | 8 ++++---- package.json | 2 +- src/components/FlatmapVuer.vue | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9d52dd9e..93345a70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,7 @@ "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.2", - "@abi-software/map-utilities": "^1.0.0-beta.1", + "@abi-software/map-utilities": "^1.1.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", @@ -83,9 +83,9 @@ } }, "node_modules/@abi-software/map-utilities": { - "version": "1.0.0-beta.1", - "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.0.0-beta.1.tgz", - "integrity": "sha512-gOMGlaAqY8Rv6rXJ64oqOeTJHO1W0FigQZnTJKMOj9wMA0jWYsHHREyP8FKbEZZ0YGk9l2cJGL38K/sHTkcNpw==", + "version": "1.1.0-beta.1", + "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.1.0-beta.1.tgz", + "integrity": "sha512-HMVxeoNn+iTGhw2Y2YOTXGjrxXeFyS1zrpUklLN9+5lGoCt2bakUbB+Xpc2rwgZUmTvWpPAeUzff1iDH5v/W3A==", "dependencies": { "@abi-software/gallery": "^1.1.0", "@abi-software/svg-sprite": "^1.0.0", diff --git a/package.json b/package.json index 97cac0de..a9ed2736 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@abi-software/flatmap-viewer": "3.1.2", - "@abi-software/map-utilities": "^1.0.0-beta.1", + "@abi-software/map-utilities": "^1.1.0-beta.1", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 9057ec8d..a6664d0c 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1799,7 +1799,6 @@ export default { * @arg data */ checkAndCreatePopups: async function (data) { - console.log("checkandcreate") if (data.feature.type === 'marker') { this.tooltipType = 'image' if (data.resource[0] in this.anatomyImages[this.imageType]) { From b4cecee48721fe72c147b1f19794afd883c6be41 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 23 Aug 2024 16:07:43 +1200 Subject: [PATCH 18/47] Create settings store --- src/App.vue | 9 ++- src/components/FlatmapVuer.vue | 37 +++++---- src/main.js | 2 +- src/services/scicrunchQueries.js | 134 ++++++++++++++++++++++--------- src/{store => stores}/index.js | 0 src/stores/settings.js | 17 ++++ 6 files changed, 140 insertions(+), 59 deletions(-) rename src/{store => stores}/index.js (100%) create mode 100644 src/stores/settings.js diff --git a/src/App.vue b/src/App.vue index 6a6658d0..21449e0c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -110,11 +110,12 @@ import './icons/mapicon-species-style.css' import MultiFlatmapVuer from './components/MultiFlatmapVuer.vue' import { HelpModeDialog } from '@abi-software/map-utilities' import '@abi-software/map-utilities/dist/style.css' -import imageMixin from './mixins/imageMixin.js' +import { mapStores } from 'pinia'; +import { useSettingsStore } from './stores/settings'; +import { getOrganCuries } from './services/scicrunchQueries' export default { name: 'app', - mixins: [imageMixin], components: { Autocomplete, Button, @@ -298,6 +299,10 @@ export default { }, mounted: function () { this.multiflatmapRef = this.$refs.multi; + getOrganCuries(this.sparcAPI).then((organCuries) => this.settingsStore.updateOrganCuries(organCuries)) + }, + computed: { + ...mapStores(useSettingsStore), }, watch: { helpMode: function (newVal) { diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index a6664d0c..92861dce 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -426,7 +426,7 @@ Please use `const` to assign meaningful names to them... ref="backgroundPopover" :virtual-ref="backgroundIconRef" placement="top-start" - width="320" + width="330" :teleported="false" trigger="click" popper-class="background-popper h-auto" @@ -501,7 +501,7 @@ Please use `const` to assign meaningful names to them...
- Images Display + Types display - Hide - Show + Marker + Image @@ -681,8 +681,9 @@ import yellowstar from '../icons/yellowstar' import ResizeSensor from 'css-element-queries/src/ResizeSensor' import * as flatmap from '@abi-software/flatmap-viewer' import { AnnotationService } from '@abi-software/sparc-annotation' -import { mapState } from 'pinia' -import { useMainStore } from '@/store/index' +import { mapState, mapStores } from 'pinia' +import { useMainStore } from '@/stores/index' +import { useSettingsStore } from '@/stores/settings' import { DrawToolbar, Tooltip, TreeControls } from '@abi-software/map-utilities' import '@abi-software/map-utilities/dist/style.css' import { @@ -820,19 +821,22 @@ export default { populateImageThumbnails: async function (type) { if (this.mapImp) { this.loading = true - const anatomicalIdentifiers = this.mapImp.anatomicalIdentifiers + const identifiers = this.mapImp.anatomicalIdentifiers + const organCuries = this.settingsStore.organCuries this.closeTooltip() this.mapImp.clearMarkers(); - if (type === 'Image' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await getBiolucidaThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) - } else if (type === 'Segmentation' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await getSegmentationThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) - } else if (type === 'Scaffold' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await getScaffoldThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) - } else if (type === 'Plot' && !(type in this.anatomyImages)) { - this.anatomyImages[type] = await getPlotThumbnails(this.sparcAPI, "id", anatomicalIdentifiers) + if (!(type in this.anatomyImages)) { + if (type === 'Image') { + this.anatomyImages[type] = await getBiolucidaThumbnails(this.sparcAPI, "id", identifiers, organCuries) + } else if (type === 'Segmentation') { + this.anatomyImages[type] = await getSegmentationThumbnails(this.sparcAPI, "id", identifiers, organCuries) + } else if (type === 'Scaffold') { + this.anatomyImages[type] = await getScaffoldThumbnails(this.sparcAPI, "id", identifiers, organCuries) + } else if (type === 'Plot') { + this.anatomyImages[type] = await getPlotThumbnails(this.sparcAPI, "id", identifiers, organCuries) + } } - if (this.anatomyImages[type]) { + if (type in this.anatomyImages) { this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) } this.loading = false @@ -2865,6 +2869,7 @@ export default { }, computed: { ...mapState(useMainStore, ['userToken']), + ...mapStores(useSettingsStore), isValidDrawnCreated: function () { return Object.keys(this.drawnCreatedEvent).length > 0 }, diff --git a/src/main.js b/src/main.js index c7585f1b..99b5d454 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ import { createApp } from 'vue' import { createPinia } from 'pinia' import App from './App.vue' -import { useMainStore } from '@/store/index' +import { useMainStore } from '@/stores/index' const pinia = createPinia() const app = createApp(App) diff --git a/src/services/scicrunchQueries.js b/src/services/scicrunchQueries.js index d4416e65..487ebef3 100644 --- a/src/services/scicrunchQueries.js +++ b/src/services/scicrunchQueries.js @@ -1,49 +1,75 @@ -const getFilesInfo = async (sparcApi, key, idsList, types) => { +const getOrganCuries = async (sparcApi, filetypes = [], species = []) => { let params = new URLSearchParams(); - types.forEach((type) => { + filetypes.forEach((type) => { params.append("filetypes", type); }); - let response = await fetch(`${sparcApi}/get-organ-curies/?${params}`); - let data = await response.json(); - const identifiers = []; + species.forEach((name) => { + params.append("species", name); + }); + + const response = await fetch(`${sparcApi}/get-organ-curies/?${params}`); + const data = await response.json(); + + let organCuries = []; data.uberon.array.forEach((pair) => { - const identifier = { + const organCurie = { id: pair.id.toUpperCase(), name: pair.name, }; - if (idsList.includes(identifier[key])) { - identifiers.push(identifier); - } + organCuries.push(organCurie); }); - const keys = identifiers.map((item) => item[key]); - response = await fetch(`${sparcApi}/get-files-info-for-curies`, { + + return organCuries; +}; + +const getFilesInfoForCuries = async ( + sparcApi, + key, + identifiers, + organCuries, + filetypes +) => { + const curies = organCuries + .filter((item) => identifiers.includes(item[key])) + .map((item) => item.id); + + const response = await fetch(`${sparcApi}/get-files-info-for-curies`, { method: "POST", body: JSON.stringify({ - filetypes: types, - curies: keys, - species: ["Rat"], + curies: curies, + filetypes: filetypes, }), headers: { "Content-Type": "application/json", }, }); - data = await response.json(); + const data = await response.json(); + return data; }; -const getFileName = (filePath) => { +const getFileNameFromPath = (filePath) => { return filePath.substring(filePath.lastIndexOf("/") + 1); }; const getBiolucidaThumbnailURL = (sparcApi, biolucidaId) => { return `${sparcApi}/thumbnail/${biolucidaId}`; }; -const getBiolucidaThumbnails = async (sparcApi, key, idsList) => { + +const getBiolucidaThumbnails = async ( + sparcApi, + key, + identifiers, + organCuries +) => { try { - const data = await getFilesInfo(sparcApi, key, idsList, [ - "biolucida-2d", - "biolucida-3d", - ]); + const data = await getFilesInfoForCuries( + sparcApi, + key, + identifiers, + organCuries, + ["biolucida-2d", "biolucida-3d"] + ); if (data["files_info"]) { const images = {}; for (const [key, value] of Object.entries(data["files_info"])) { @@ -59,10 +85,11 @@ const getBiolucidaThumbnails = async (sparcApi, key, idsList) => { thumbnail: thumbnailURL, resource: entry.file_path, id: entry.id, - title: getFileName(entry.file_path), + title: getFileNameFromPath(entry.file_path), type: "Image", link: thumbnailURL, mimetype: entry.mimetype, + species: entry.species, }; list.push(image); } @@ -86,11 +113,21 @@ const getSegmentationThumbnailURL = ( ) => { return `${sparcApi}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; }; -const getSegmentationThumbnails = async (sparcApi, key, idsList) => { + +const getSegmentationThumbnails = async ( + sparcApi, + key, + identifiers, + organCuries +) => { try { - const data = await getFilesInfo(sparcApi, key, idsList, [ - "mbf-segmentation", - ]); + const data = await getFilesInfoForCuries( + sparcApi, + key, + identifiers, + organCuries, + ["mbf-segmentation"] + ); if (data["files_info"]) { const images = {}; for (const [key, value] of Object.entries(data["files_info"])) { @@ -107,10 +144,11 @@ const getSegmentationThumbnails = async (sparcApi, key, idsList) => { thumbnail: thumbnailURL, resource: entry.file_path, id: entry.id, - title: getFileName(entry.file_path), + title: getFileNameFromPath(entry.file_path), type: "Segmentation", link: thumbnailURL, mimetype: entry.mimetype, + species: entry.species, }; list.push(image); }); @@ -142,6 +180,7 @@ const findEntryWithPathInArray = (entry, list, type) => { } return undefined; }; + const getScaffoldThumbnailURL = (sparcApi, entry, list) => { const viewEntry = findEntryWithPathInArray( entry, @@ -158,13 +197,21 @@ const getScaffoldThumbnailURL = (sparcApi, entry, list) => { } return undefined; }; -const getScaffoldThumbnails = async (sparcApi, key, idsList) => { + +const getScaffoldThumbnails = async ( + sparcApi, + key, + identifiers, + organCuries +) => { try { - const data = await getFilesInfo(sparcApi, key, idsList, [ - "abi-thumbnail", - "abi-scaffold-metadata-file", - "abi-scaffold-view-file", - ]); + const data = await getFilesInfoForCuries( + sparcApi, + key, + identifiers, + organCuries, + ["abi-thumbnail", "abi-scaffold-metadata-file", "abi-scaffold-view-file"] + ); if (data["files_info"]) { const images = {}; for (const [key, value] of Object.entries(data["files_info"])) { @@ -182,9 +229,10 @@ const getScaffoldThumbnails = async (sparcApi, key, idsList) => { thumbnail: thumbnailURL, resource: entry.file_path, id: entry.id, - title: getFileName(entry.file_path), + title: getFileNameFromPath(entry.file_path), type: "Scaffold", link: thumbnailURL, + species: entry.species, }; list.push(image); } @@ -209,12 +257,16 @@ const getPlotThumbnailURL = (sparcApi, entry) => { } return undefined; }; -const getPlotThumbnails = async (sparcApi, key, idsList) => { + +const getPlotThumbnails = async (sparcApi, key, identifiers, organCuries) => { try { - const data = await getFilesInfo(sparcApi, key, idsList, [ - "abi-plot", - "abi-thumbnail", - ]); + const data = await getFilesInfoForCuries( + sparcApi, + key, + identifiers, + organCuries, + ["abi-plot", "abi-thumbnail"] + ); if (data["files_info"]) { const images = {}; for (const [key, value] of Object.entries(data["files_info"])) { @@ -228,9 +280,10 @@ const getPlotThumbnails = async (sparcApi, key, idsList) => { thumbnail: thumbnailURL, resource: entry.file_path, datasetId: entry.id, - title: getFileName(entry.file_path), + title: getFileNameFromPath(entry.file_path), type: "Plot", link: thumbnailURL, + species: entry.species, }; list.push(image); } @@ -248,6 +301,7 @@ const getPlotThumbnails = async (sparcApi, key, idsList) => { }; export { + getOrganCuries, getBiolucidaThumbnails, getSegmentationThumbnails, getScaffoldThumbnails, diff --git a/src/store/index.js b/src/stores/index.js similarity index 100% rename from src/store/index.js rename to src/stores/index.js diff --git a/src/stores/settings.js b/src/stores/settings.js new file mode 100644 index 00000000..465d6751 --- /dev/null +++ b/src/stores/settings.js @@ -0,0 +1,17 @@ +import { defineStore } from "pinia"; + +/* eslint-disable no-alert, no-console */ + +export const useSettingsStore = defineStore("settings", { + state: () => { + return { + organCuries: [], + }; + }, + getters: {}, + actions: { + updateOrganCuries(organCuries) { + this.organCuries = organCuries; + }, + }, +}); From 2fc3286cf386b64cfb319e89c4fc7fc4f7bc854b Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Mon, 26 Aug 2024 09:53:56 +1200 Subject: [PATCH 19/47] Emit image data to sidebar --- src/components/FlatmapVuer.vue | 30 ++++++++++++++--------------- src/components/MultiFlatmapVuer.vue | 12 ++++++++++++ 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 92861dce..f9f1168f 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1808,19 +1808,7 @@ export default { if (data.resource[0] in this.anatomyImages[this.imageType]) { this.imageEntry = this.anatomyImages[this.imageType][data.resource[0]] } - // this.displayTooltip(data.feature.models) - - let options = { className: 'flatmapvuer-popover' } - let featureId = this.mapImp.modelFeatureIds(data.feature.models)[0] - if (!this.activeDrawTool) { - options.positionAtLastClick = true - } - this.tooltipDisplay = true; - this.$nextTick(() => { - this.mapImp.showPopup(featureId, this.$refs.tooltip.$el, options); - this.popUpCssHacks(); - }); - + this.displayTooltip(data.feature.models) } else { // Call flatmap database to get the connection data if (this.viewingMode === 'Annotation') { @@ -2123,6 +2111,9 @@ export default { } this.$emit('connectivity-info-open', this.provenanceEntry); } + if (this.imageThumbnailSidebar && this.imageEntry.length && this.viewingMode === 'Exploration') { + this.$emit('image-thumbnail-open', this.imageEntry) + } // If UI is not disabled, // And connectivityInfoSidebar is not set (default) or set to `false` // Provenance popup will be shown on map @@ -2132,8 +2123,10 @@ export default { this.viewingMode === 'Annotation' || ( this.viewingMode === 'Exploration' && - !this.connectivityInfoSidebar && - this.hasTooltipEntry() + ( + (!this.connectivityInfoSidebar && this.hasTooltipEntry()) || + (!this.imageThumbnailSidebar && this.imageEntry.length) + ) ) ) ) { @@ -2733,6 +2726,13 @@ export default { type: Boolean, default: false, }, + /** + * The option to show image thumbnail in sidebar + */ + imageThumbnailSidebar: { + type: Boolean, + default: false, + }, }, provide() { return { diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index d6591266..c2be68e5 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -81,6 +81,8 @@ style="height: 100%" :flatmapAPI="flatmapAPI" :sparcAPI="sparcAPI" + :imageThumbnailSidebar="imageThumbnailSidebar" + @image-thumbnail-open="onImageThumbnailOpen" />
@@ -264,6 +266,9 @@ export default { onConnectivityInfoOpen: function (entryData) { this.$emit('connectivity-info-open', entryData); }, + onImageThumbnailOpen: function (payload) { + this.$emit('image-thumbnail-open', payload); + }, onSelectionsDataChanged: function (data) { this.$emit('pathway-selection-changed', data); }, @@ -716,6 +721,13 @@ export default { type: Boolean, default: false, }, + /** + * The option to show image thumbnail in sidebar + */ + imageThumbnailSidebar: { + type: Boolean, + default: false, + }, }, data: function () { return { From fe64a8d6a4f352e56fa1ec4ef484a7df5ab652ce Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 27 Aug 2024 12:41:41 +1200 Subject: [PATCH 20/47] minor update --- package-lock.json | 45 +++++++++++---------------------------------- package.json | 2 +- 2 files changed, 12 insertions(+), 35 deletions(-) diff --git a/package-lock.json b/package-lock.json index 703e1934..43cdc974 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ "@cypress/webpack-dev-server": "^3.6.1", "@vitejs/plugin-vue": "^4.6.2", "@vuese/markdown-render": "^2.11.3", - "@vuese/parser": "^2.10.3", + "@vuese/parser": "^2.9.1", "auto-changelog": "^2.4.0", "babel-eslint": "^10.1.0", "chokidar": "^3.6.0", @@ -2619,17 +2619,10 @@ "dev": true }, "node_modules/@vuese/parser": { - "version": "2.10.3", - "resolved": "https://registry.npmjs.org/@vuese/parser/-/parser-2.10.3.tgz", - "integrity": "sha512-Vcn++EJps0KS8fs9aBllFC6CKx6ttVPXtbbZCyXXWtoQC5VyDaydU0UFVaDciznUNGqwSzjNNVvxQqOPdmV0vQ==", - "dev": true, - "dependencies": { - "@babel/generator": "^7.12.10", - "@babel/parser": "^7.12.0", - "@babel/traverse": "^7.12.0", - "@babel/types": "^7.3.4", - "vue-template-compiler": "^2.6.11" - } + "version": "2.9.1", + "resolved": "https://registry.npmjs.org/@vuese/parser/-/parser-2.9.1.tgz", + "integrity": "sha512-5XVgmg9TviosbQEzo0Et1n/WX6s+fmK2l3DKEX8tGaPJLKN+Qh5GEosjHVYw1E4nZllPv2kDa7HqKwqR+0QUUw==", + "dev": true }, "node_modules/@vueuse/core": { "version": "9.13.0", @@ -3579,9 +3572,9 @@ "dev": true }, "node_modules/axios": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz", - "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==", + "version": "1.7.5", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", + "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", @@ -4842,12 +4835,6 @@ "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.11.tgz", "integrity": "sha512-okzr3f11N6WuqYtZSvm+F776mB41wRZMhKP+hc34YdW+KmtYYK9iqvHSwo2k9FEH3fhGXvOPV6yz2IcSrfRUDg==" }, - "node_modules/de-indent": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/de-indent/-/de-indent-1.0.2.tgz", - "integrity": "sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==", - "dev": true - }, "node_modules/debug": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", @@ -9192,9 +9179,9 @@ "integrity": "sha512-kYmyrCirqJf3zZ9t/0wGgRZ4/ZJw//VwaRVGA75C4nhE60vtnIzhl9J9ndkX/h6hxSN7pjg/cE0VxbnNM+bnDQ==" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -13201,16 +13188,6 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/vue-template-compiler": { - "version": "2.7.16", - "resolved": "https://registry.npmjs.org/vue-template-compiler/-/vue-template-compiler-2.7.16.tgz", - "integrity": "sha512-AYbUWAJHLGGQM7+cNTELw+KsOG9nl2CnSv467WobS5Cv9uk3wFcnr1Etsz2sEIHEZvw1U+o9mRlEO6QbZvUPGQ==", - "dev": true, - "dependencies": { - "de-indent": "^1.0.2", - "he": "^1.2.0" - } - }, "node_modules/watchpack": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.1.tgz", diff --git a/package.json b/package.json index f7a7d7c1..541ec61b 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "@cypress/webpack-dev-server": "^3.6.1", "@vitejs/plugin-vue": "^4.6.2", "@vuese/markdown-render": "^2.11.3", - "@vuese/parser": "^2.10.3", + "@vuese/parser": "^2.9.1", "auto-changelog": "^2.4.0", "babel-eslint": "^10.1.0", "chokidar": "^3.6.0", From 76e6d53130b59c4c40c2684cc474d5b7ec023603 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Tue, 27 Aug 2024 13:01:25 +1200 Subject: [PATCH 21/47] Try to fix testing --- package-lock.json | 211 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 5 +- 2 files changed, 215 insertions(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index 43cdc974..6ee3dec0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,6 +14,7 @@ "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", + "@rollup/rollup-linux-x64-gnu": "*", "css-element-queries": "^1.2.2", "element-plus": "2.5.5", "mitt": "^3.0.1", @@ -40,6 +41,9 @@ "sass": "^1.69.5", "vite": "^5.0.10", "vitepress": "^1.0.0-rc.44" + }, + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.21.1" } }, "node_modules/@abi-software/flatmap-viewer": { @@ -1669,6 +1673,32 @@ } } }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.18.0.tgz", + "integrity": "sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.18.0.tgz", + "integrity": "sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ] + }, "node_modules/@rollup/rollup-darwin-arm64": { "version": "4.18.0", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.18.0.tgz", @@ -1682,6 +1712,174 @@ "darwin" ] }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.18.0.tgz", + "integrity": "sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.18.0.tgz", + "integrity": "sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.18.0.tgz", + "integrity": "sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.18.0.tgz", + "integrity": "sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.18.0.tgz", + "integrity": "sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.18.0.tgz", + "integrity": "sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.18.0.tgz", + "integrity": "sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.18.0.tgz", + "integrity": "sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.21.1", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.1.tgz", + "integrity": "sha512-kXQVcWqDcDKw0S2E0TmhlTLlUgAmMVqPrJZR+KpH/1ZaZhLSl23GZpQVmawBQGVhyP5WXIsIQ/zqbDBBYmxm5w==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.18.0.tgz", + "integrity": "sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.18.0.tgz", + "integrity": "sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.18.0.tgz", + "integrity": "sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.18.0.tgz", + "integrity": "sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@shikijs/core": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-1.6.3.tgz", @@ -11148,6 +11346,19 @@ "fsevents": "~2.3.2" } }, + "node_modules/rollup/node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.18.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.18.0.tgz", + "integrity": "sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index 541ec61b..6de22d58 100644 --- a/package.json +++ b/package.json @@ -92,5 +92,8 @@ "browserslist": [ "> 1%", "last 2 versions" - ] + ], + "optionalDependencies": { + "@rollup/rollup-linux-x64-gnu": "^4.21.1" + } } From 9a943edafa2acb579d9ae9453abb998dfb5714b9 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 28 Aug 2024 12:11:48 +1200 Subject: [PATCH 22/47] Add more stored state --- package-lock.json | 58 +++++----------- package.json | 2 +- src/components/FlatmapVuer.vue | 52 +++++++------- src/services/scicrunchQueries.js | 115 ++++++++++++------------------- src/stores/settings.js | 31 ++++++++- 5 files changed, 120 insertions(+), 138 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6ee3dec0..a044d644 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,11 +10,10 @@ "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", - "@abi-software/map-utilities": "^1.1.0-beta.1", + "@abi-software/map-utilities": "^1.1.0-beta.2", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", - "@rollup/rollup-linux-x64-gnu": "*", "css-element-queries": "^1.2.2", "element-plus": "2.5.5", "mitt": "^3.0.1", @@ -87,11 +86,11 @@ } }, "node_modules/@abi-software/map-utilities": { - "version": "1.1.0-beta.1", - "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.1.0-beta.1.tgz", - "integrity": "sha512-HMVxeoNn+iTGhw2Y2YOTXGjrxXeFyS1zrpUklLN9+5lGoCt2bakUbB+Xpc2rwgZUmTvWpPAeUzff1iDH5v/W3A==", + "version": "1.1.0-beta.2", + "resolved": "https://registry.npmjs.org/@abi-software/map-utilities/-/map-utilities-1.1.0-beta.2.tgz", + "integrity": "sha512-pDK6H8eciFgYl2XGVJIVuXmm+zvPI9VsM2NoN0mOX3kC1sMD7yL+dIO9VJe1xARg8zSZidAf1ra55je6Z31yTA==", "dependencies": { - "@abi-software/gallery": "^1.1.0", + "@abi-software/gallery": "^1.1.1", "@abi-software/svg-sprite": "^1.0.0", "@element-plus/icons-vue": "^2.3.1", "element-plus": "^2.7.3", @@ -2311,28 +2310,6 @@ "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz", "integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==" }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -3262,10 +3239,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peer": true, "peerDependencies": { @@ -5406,9 +5383,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "peer": true, "dependencies": { @@ -13436,22 +13413,21 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "peer": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 6de22d58..b8fbb11e 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ }, "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", - "@abi-software/map-utilities": "^1.1.0-beta.1", + "@abi-software/map-utilities": "^1.1.0-beta.2", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", "@element-plus/icons-vue": "^2.3.1", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 587578de..ae4dbeba 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -820,36 +820,44 @@ export default { */ populateImageThumbnails: async function (type) { if (this.mapImp) { - this.loading = true - const identifiers = this.mapImp.anatomicalIdentifiers - const organCuries = this.settingsStore.organCuries this.closeTooltip() this.mapImp.clearMarkers(); - if (!(type in this.anatomyImages)) { - if (type === 'Image') { - this.anatomyImages[type] = await getBiolucidaThumbnails(this.sparcAPI, "id", identifiers, organCuries) - } else if (type === 'Segmentation') { - this.anatomyImages[type] = await getSegmentationThumbnails(this.sparcAPI, "id", identifiers, organCuries) - } else if (type === 'Scaffold') { - this.anatomyImages[type] = await getScaffoldThumbnails(this.sparcAPI, "id", identifiers, organCuries) - } else if (type === 'Plot') { - this.anatomyImages[type] = await getPlotThumbnails(this.sparcAPI, "id", identifiers, organCuries) - } - } - if (type in this.anatomyImages) { - this.populateMapWithImages(this.mapImp, this.anatomyImages[type], type) - } - this.loading = false + const identifiers = this.mapImp.anatomicalIdentifiers + const imageThumbnails = this.settingsStore.getImageThumbnails(type, identifiers) + this.populateMapWithImages(this.mapImp, imageThumbnails, type) + } + }, + /** + * @vuese + * Function to fetching image thumbnails. + */ + fetchImageThumbnails: async function (type) { + let thumbnails = {} + const organCuries = this.settingsStore.organCuries + if (type === 'Image') { + thumbnails = await getBiolucidaThumbnails(this.sparcAPI, organCuries, type) + } else if (type === 'Segmentation') { + thumbnails = await getSegmentationThumbnails(this.sparcAPI, organCuries, type) + } else if (type === 'Scaffold') { + thumbnails = await getScaffoldThumbnails(this.sparcAPI, organCuries, type) + } else if (type === 'Plot') { + thumbnails = await getPlotThumbnails(this.sparcAPI, organCuries, type) } + this.settingsStore.updateImageThumbnails(type, thumbnails) }, /** * @vuese * Function to switch the type of displayed image. * @arg type */ - setImageType: function (type) { + setImageType: async function (type) { this.imageType = type if (this.mapImp) { + if (!this.settingsStore.imageTypeCached(type)) { + this.loading = true + await this.fetchImageThumbnails(type) + this.loading = false + } this.populateImageThumbnails(type) } }, @@ -1805,9 +1813,8 @@ export default { checkAndCreatePopups: async function (data) { if (data.feature.type === 'marker') { this.tooltipType = 'image' - if (data.resource[0] in this.anatomyImages[this.imageType]) { - this.imageEntry = this.anatomyImages[this.imageType][data.resource[0]] - } + const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]]) + this.imageEntry = imageThumbnails[data.resource[0]] this.displayTooltip(data.feature.models) } else { // Call flatmap database to get the connection data @@ -2829,7 +2836,6 @@ export default { drawnTypes: ['All tools', 'Point', 'LineString', 'Polygon', 'None'], annotatedType: 'Anyone', annotatedTypes: ['Anyone', 'Me', 'Others'], - anatomyImages: markRaw({}), imageRadio: false, imageType: 'Image', imageTypes: ['Image', 'Segmentation', 'Scaffold', 'Plot'], diff --git a/src/services/scicrunchQueries.js b/src/services/scicrunchQueries.js index 487ebef3..a6ab34af 100644 --- a/src/services/scicrunchQueries.js +++ b/src/services/scicrunchQueries.js @@ -22,21 +22,11 @@ const getOrganCuries = async (sparcApi, filetypes = [], species = []) => { return organCuries; }; -const getFilesInfoForCuries = async ( - sparcApi, - key, - identifiers, - organCuries, - filetypes -) => { - const curies = organCuries - .filter((item) => identifiers.includes(item[key])) - .map((item) => item.id); - +const getFilesInfoForCuries = async (sparcApi, organCuries, filetypes) => { const response = await fetch(`${sparcApi}/get-files-info-for-curies`, { method: "POST", body: JSON.stringify({ - curies: curies, + curies: organCuries.map((item) => item.id), filetypes: filetypes, }), headers: { @@ -56,25 +46,18 @@ const getBiolucidaThumbnailURL = (sparcApi, biolucidaId) => { return `${sparcApi}/thumbnail/${biolucidaId}`; }; -const getBiolucidaThumbnails = async ( - sparcApi, - key, - identifiers, - organCuries -) => { +const getBiolucidaThumbnails = async (sparcApi, organCuries, type) => { try { - const data = await getFilesInfoForCuries( - sparcApi, - key, - identifiers, - organCuries, - ["biolucida-2d", "biolucida-3d"] - ); + const data = await getFilesInfoForCuries(sparcApi, organCuries, [ + "biolucida-2d", + "biolucida-3d", + ]); + if (data["files_info"]) { - const images = {}; + let images = {}; for (const [key, value] of Object.entries(data["files_info"])) { if (value.length > 0) { - const list = []; + let list = []; value.forEach((entry) => { const thumbnailURL = getBiolucidaThumbnailURL( sparcApi, @@ -86,10 +69,11 @@ const getBiolucidaThumbnails = async ( resource: entry.file_path, id: entry.id, title: getFileNameFromPath(entry.file_path), - type: "Image", + type: type, link: thumbnailURL, mimetype: entry.mimetype, species: entry.species, + version: entry.version, }; list.push(image); } @@ -114,25 +98,17 @@ const getSegmentationThumbnailURL = ( return `${sparcApi}/thumbnail/neurolucida?datasetId=${datasetId}&version=${datasetVersion}&path=files/${filePath}`; }; -const getSegmentationThumbnails = async ( - sparcApi, - key, - identifiers, - organCuries -) => { +const getSegmentationThumbnails = async (sparcApi, organCuries, type) => { try { - const data = await getFilesInfoForCuries( - sparcApi, - key, - identifiers, - organCuries, - ["mbf-segmentation"] - ); + const data = await getFilesInfoForCuries(sparcApi, organCuries, [ + "mbf-segmentation", + ]); + if (data["files_info"]) { - const images = {}; + let images = {}; for (const [key, value] of Object.entries(data["files_info"])) { if (value.length > 0) { - const list = []; + let list = []; value.forEach((entry) => { const thumbnailURL = getSegmentationThumbnailURL( sparcApi, @@ -145,10 +121,11 @@ const getSegmentationThumbnails = async ( resource: entry.file_path, id: entry.id, title: getFileNameFromPath(entry.file_path), - type: "Segmentation", + type: type, link: thumbnailURL, mimetype: entry.mimetype, species: entry.species, + version: entry.version, }; list.push(image); }); @@ -198,25 +175,19 @@ const getScaffoldThumbnailURL = (sparcApi, entry, list) => { return undefined; }; -const getScaffoldThumbnails = async ( - sparcApi, - key, - identifiers, - organCuries -) => { +const getScaffoldThumbnails = async (sparcApi, organCuries, type) => { try { - const data = await getFilesInfoForCuries( - sparcApi, - key, - identifiers, - organCuries, - ["abi-thumbnail", "abi-scaffold-metadata-file", "abi-scaffold-view-file"] - ); + const data = await getFilesInfoForCuries(sparcApi, organCuries, [ + "abi-thumbnail", + "abi-scaffold-metadata-file", + "abi-scaffold-view-file", + ]); + if (data["files_info"]) { - const images = {}; + let images = {}; for (const [key, value] of Object.entries(data["files_info"])) { if (value.length > 0) { - const list = []; + let list = []; value.forEach((entry) => { if (entry.type === "abi-scaffold-metadata-file") { const thumbnailURL = getScaffoldThumbnailURL( @@ -230,9 +201,10 @@ const getScaffoldThumbnails = async ( resource: entry.file_path, id: entry.id, title: getFileNameFromPath(entry.file_path), - type: "Scaffold", + type: type, link: thumbnailURL, species: entry.species, + version: entry.version, }; list.push(image); } @@ -258,20 +230,18 @@ const getPlotThumbnailURL = (sparcApi, entry) => { return undefined; }; -const getPlotThumbnails = async (sparcApi, key, identifiers, organCuries) => { +const getPlotThumbnails = async (sparcApi, organCuries, type) => { try { - const data = await getFilesInfoForCuries( - sparcApi, - key, - identifiers, - organCuries, - ["abi-plot", "abi-thumbnail"] - ); + const data = await getFilesInfoForCuries(sparcApi, organCuries, [ + "abi-plot", + "abi-thumbnail", + ]); + if (data["files_info"]) { - const images = {}; + let images = {}; for (const [key, value] of Object.entries(data["files_info"])) { if (value.length > 0) { - const list = []; + let list = []; value.forEach((entry) => { if (entry.type === "abi-plot") { const thumbnailURL = getPlotThumbnailURL(sparcApi, entry); @@ -279,11 +249,12 @@ const getPlotThumbnails = async (sparcApi, key, identifiers, organCuries) => { let image = { thumbnail: thumbnailURL, resource: entry.file_path, - datasetId: entry.id, + id: entry.id, title: getFileNameFromPath(entry.file_path), - type: "Plot", + type: type, link: thumbnailURL, species: entry.species, + version: entry.version, }; list.push(image); } diff --git a/src/stores/settings.js b/src/stores/settings.js index 465d6751..67bc5a73 100644 --- a/src/stores/settings.js +++ b/src/stores/settings.js @@ -6,12 +6,41 @@ export const useSettingsStore = defineStore("settings", { state: () => { return { organCuries: [], + imageTypes: [], + imageThumbnails: {}, }; }, - getters: {}, + getters: { + imageTypeCached: (state) => (imageType) => { + return state.imageTypes.includes(imageType); + }, + getImageThumbnails: + (state) => + (imageType, uberonIds = undefined) => { + if (uberonIds) { + let thumbnails = {}; + Object.entries(state.imageThumbnails).forEach(([key, value]) => { + if (uberonIds.includes(key)) { + thumbnails[key] = value.filter((item) => item.type === imageType); + } + }); + return thumbnails; + } + return state.imageThumbnails; + }, + }, actions: { updateOrganCuries(organCuries) { this.organCuries = organCuries; }, + updateImageThumbnails(imageType, imageThumbnails) { + this.imageTypes.push(imageType); + Object.keys(imageThumbnails).forEach((key) => { + if (!(key in this.imageThumbnails)) { + this.imageThumbnails[key] = []; + } + this.imageThumbnails[key].push(...imageThumbnails[key]); + }); + }, }, }); From 965a49e05852e9b77016143cf0ba2f0b566650fb Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Wed, 28 Aug 2024 15:08:50 +1200 Subject: [PATCH 23/47] Add markRaw --- src/components/FlatmapVuer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index ae4dbeba..cbfebfbe 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1814,7 +1814,7 @@ export default { if (data.feature.type === 'marker') { this.tooltipType = 'image' const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]]) - this.imageEntry = imageThumbnails[data.resource[0]] + this.imageEntry = markRaw(imageThumbnails[data.resource[0]]) this.displayTooltip(data.feature.models) } else { // Call flatmap database to get the connection data @@ -2767,7 +2767,7 @@ export default { serverURL: undefined, layers: [], pathways: [], - imageEntry: [], + imageEntry: markRaw([]), tooltipType: 'provenance', sckanDisplay: [ { From cc056e176a05bc49671dd42858e36a7f292398f2 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:09:45 +1200 Subject: [PATCH 24/47] Update image select box --- src/components/FlatmapVuer.vue | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index cbfebfbe..c05a1b47 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -460,7 +460,7 @@ Please use `const` to assign meaningful names to them... :teleported="false" v-model="drawnType" placeholder="Select" - class="select-box" + class="select-box annotationSelector" popper-class="flatmap_dropdown" @change="setDrawnType" > @@ -483,7 +483,7 @@ Please use `const` to assign meaningful names to them... :teleported="false" v-model="annotatedType" placeholder="Select" - class="select-box" + class="select-box annotationSelector" popper-class="flatmap_dropdown" @change="setAnnotatedType" > @@ -501,24 +501,24 @@ Please use `const` to assign meaningful names to them... - Types display + Markers display - + - Marker + Standard Image - + @@ -3719,7 +3719,12 @@ export default { background-color: var(--white); font-weight: 500; color: rgb(48, 49, 51); - width: 150px!important; + &.annotationSelector { + width: 150px!important; + } + &.imageSelector { + width: 120px!important; + } } :deep(.flatmap_dropdown) { From df4be7f21e81124dfd978ac2653bde211809c592 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Thu, 29 Aug 2024 13:51:36 +1200 Subject: [PATCH 25/47] Increase select box width --- src/components/FlatmapVuer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index c05a1b47..a5c23daf 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -3723,7 +3723,7 @@ export default { width: 150px!important; } &.imageSelector { - width: 120px!important; + width: 125px!important; } } From 30e93d76613221a89b6d8cfdf0ad239ff1110155 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:46:06 +1200 Subject: [PATCH 26/47] Fix minor issue --- src/components/FlatmapVuer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index a5c23daf..63d9c702 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1811,7 +1811,7 @@ export default { * @arg data */ checkAndCreatePopups: async function (data) { - if (data.feature.type === 'marker') { + if (data.feature.type === 'marker' && this.imageRadio) { this.tooltipType = 'image' const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]]) this.imageEntry = markRaw(imageThumbnails[data.resource[0]]) From 4e5c99cee199da0baddc9cd9360f7f6859f0f465 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 30 Aug 2024 11:46:36 +1200 Subject: [PATCH 27/47] v1.4.1-beta.1 image selector --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index a044d644..41933e04 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1", + "version": "1.4.1-beta.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@abi-software/flatmapvuer", - "version": "1.4.1", + "version": "1.4.1-beta.1", "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", diff --git a/package.json b/package.json index b8fbb11e..c3d182db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1", + "version": "1.4.1-beta.1", "license": "Apache-2.0", "files": [ "dist/*", From 314481e4a3be84bd542a831aa52caae253d0b266 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 30 Aug 2024 12:25:26 +1200 Subject: [PATCH 28/47] Fix image data emit issue --- package-lock.json | 4 ++-- package.json | 2 +- src/components/FlatmapVuer.vue | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 41933e04..dda1fe07 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.1", + "version": "1.4.1-beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.1", + "version": "1.4.1-beta.2", "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", diff --git a/package.json b/package.json index c3d182db..be33f7dc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.1", + "version": "1.4.1-beta.2", "license": "Apache-2.0", "files": [ "dist/*", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 63d9c702..c99c6d67 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1814,7 +1814,10 @@ export default { if (data.feature.type === 'marker' && this.imageRadio) { this.tooltipType = 'image' const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]]) - this.imageEntry = markRaw(imageThumbnails[data.resource[0]]) + this.imageEntry = markRaw([]) + if (data.resource[0] in imageThumbnails) { + this.imageEntry = markRaw(imageThumbnails[data.resource[0]]) + } this.displayTooltip(data.feature.models) } else { // Call flatmap database to get the connection data From 767ab479b24b1c959aa7796b367454b992daa002 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 30 Aug 2024 12:51:35 +1200 Subject: [PATCH 29/47] Emit empty array if no imageEntry --- package-lock.json | 4 ++-- package.json | 2 +- src/components/FlatmapVuer.vue | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index dda1fe07..6873fa1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.2", + "version": "1.4.1-beta.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.2", + "version": "1.4.1-beta.3", "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", diff --git a/package.json b/package.json index be33f7dc..05eb4d24 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.2", + "version": "1.4.1-beta.3", "license": "Apache-2.0", "files": [ "dist/*", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index c99c6d67..a3e52bd7 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -2121,7 +2121,7 @@ export default { } this.$emit('connectivity-info-open', this.provenanceEntry); } - if (this.imageThumbnailSidebar && this.imageEntry.length && this.viewingMode === 'Exploration') { + if (this.imageThumbnailSidebar && this.viewingMode === 'Exploration') { this.$emit('image-thumbnail-open', this.imageEntry) } // If UI is not disabled, From 6e56b0a6c8183ab36e918c9d2783bdd241fccc45 Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Fri, 30 Aug 2024 16:03:07 +1200 Subject: [PATCH 30/47] Reset tooltip entries --- src/components/FlatmapVuer.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index a3e52bd7..c1171001 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -1811,10 +1811,11 @@ export default { * @arg data */ checkAndCreatePopups: async function (data) { + this.imageEntry = [] + this.provenanceEntry = {} if (data.feature.type === 'marker' && this.imageRadio) { this.tooltipType = 'image' const imageThumbnails = this.settingsStore.getImageThumbnails(this.imageType, [data.resource[0]]) - this.imageEntry = markRaw([]) if (data.resource[0] in imageThumbnails) { this.imageEntry = markRaw(imageThumbnails[data.resource[0]]) } @@ -2105,7 +2106,7 @@ export default { options.annotationFeatureGeometry = geometry } else { featureId = this.mapImp.modelFeatureIds(feature)[0] - if (!this.activeDrawTool) { + if (!this.activeDrawTool && !this.imageEntry.length) { options.positionAtLastClick = true } } From b13f3fc0f5c395322a037a5ec767577da5403aed Mon Sep 17 00:00:00 2001 From: "David J. Yu" <87633683+ddjnw1yu@users.noreply.github.com> Date: Mon, 2 Sep 2024 10:06:08 +1200 Subject: [PATCH 31/47] v1.4.1-beta.4 minor fix --- package-lock.json | 4 ++-- package.json | 2 +- src/components/FlatmapVuer.vue | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6873fa1b..a34d91e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.3", + "version": "1.4.1-beta.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.3", + "version": "1.4.1-beta.4", "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.4", diff --git a/package.json b/package.json index 05eb4d24..23bc77d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.1-beta.3", + "version": "1.4.1-beta.4", "license": "Apache-2.0", "files": [ "dist/*", diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index c1171001..93d7ef1d 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -2479,7 +2479,8 @@ export default { if (_map) { _map.on('click', (e) => { - if (this.provenanceEntry.featureId) { + // Tmeporary add imageEntry length + if (this.provenanceEntry.featureId || this.imageEntry.length) { this.$emit('connectivity-info-close'); } }); From f77a321120b8f96a298e3052a80fffbad2f75261 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Mon, 2 Sep 2024 11:19:54 +1200 Subject: [PATCH 32/47] Fix help-mode index --- src/components/FlatmapVuer.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index db2e17f0..7bd89ebd 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -285,7 +285,7 @@ Please use `const` to assign meaningful names to them... width="200" trigger="manual" popper-class="flatmap-popper flatmap-marker-popper" - :visible="hoverVisibilities[5].value" + :visible="hoverVisibilities[0].value" ref="markerPopover" > - - Markers display - - + + Organs display @@ -2749,7 +2753,7 @@ export default { */ sparcAPI: { type: String, - default: 'https://api.sparc.science', + default: '', }, /** * Flag to disable UIs on Map diff --git a/src/components/MultiFlatmapVuer.vue b/src/components/MultiFlatmapVuer.vue index 0c7daf50..5db24d02 100644 --- a/src/components/MultiFlatmapVuer.vue +++ b/src/components/MultiFlatmapVuer.vue @@ -709,7 +709,7 @@ export default { */ sparcAPI: { type: String, - default: 'https://api.sparc.science', + default: '', }, /** * Flag to disable UIs on Map From b106917d3101664faf2a4d4e15391f2eedf4f5e5 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Tue, 3 Sep 2024 13:35:03 +1200 Subject: [PATCH 41/47] Clear tooltip when switching between markers display --- src/components/FlatmapVuer.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 3261963b..0f8368e6 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -893,6 +893,7 @@ export default { this.setImageType(this.imageType) } else { this.mapImp.clearMarkers(); + this.closeTooltip(); } this.$emit('imageThumbnailDisplay', flag) } From 479369523c0765eaab1ce71171e7a15f83126fd6 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 4 Sep 2024 10:46:11 +1200 Subject: [PATCH 42/47] Disable markers display switch while downloading thumbnail images --- src/components/FlatmapVuer.vue | 4 ++++ src/mixins/imageMixin.js | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 0f8368e6..4f87f178 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -520,6 +520,7 @@ Please use `const` to assign meaningful names to them... v-model="imageRadio" class="flatmap-radio" @change="setImage" + :disabled="imagesDownloading" > Standard Image @@ -539,6 +540,7 @@ Please use `const` to assign meaningful names to them... :key="item" :label="item" :value="item" + :disabled="imagesDownloading" > {{ item }} @@ -873,6 +875,7 @@ export default { setImageType: async function (type) { this.imageType = type if (this.mapImp) { + this.imagesDownloading = true; if (!this.settingsStore.imageTypeCached(type)) { this.loading = true await this.fetchImageThumbnails(type) @@ -2840,6 +2843,7 @@ export default { currentBackground: 'white', availableBackground: ['white', 'lightskyblue', 'black'], loading: false, + imagesDownloading: false, flatmapMarker: flatmapMarker, provenanceEntry: createUnfilledTooltipData(), connectivityTooltipVisible: false, diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index f9ba2db8..56bb1c3c 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -1,25 +1,46 @@ export default { methods: { populateMapWithImages: function (mapImp, images, type) { + this.downloadImageKeys = []; // to count downloaded images for (const [key, list] of Object.entries(images)) { this.downloadImageThumbnail(mapImp, key, list, type); } }, downloadImageThumbnail: function (mapImp, key, list, type) { const count = list.length; + + if (!this.downloadImageKeys.includes(key)) { + this.downloadImageKeys.push(key); + } + if (count > 0) { //Pick a random image const index = Math.floor(Math.random() * count); const thumbnail = list[index].thumbnail; this.getThumbnail(thumbnail, type) .then((wrapperElement) => { + this.downloadImageKeys = this.downloadImageKeys.filter((item) => item !== key); this.addImageThumbnailMarker(mapImp, key, wrapperElement); + + // All images are downloaded + if (!this.downloadImageKeys.length) { + this.imagesDownloading = false; + } }) .catch(() => { //Failed to download, pick another one list.splice(index); this.downloadImageThumbnail(mapImp, key, list, type); }); + } else { + if (this.downloadImageKeys.includes(key)) { + this.downloadImageKeys = this.downloadImageKeys.filter((item) => item !== key); + + // Failed to download, the last item + if (!this.downloadImageKeys.length) { + this.imagesDownloading = false; + } + } } }, getThumbnail: async function (url, type) { From be9ab3b0d4226d01e51abc4025b779b4fd89c5e2 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Wed, 4 Sep 2024 11:33:22 +1200 Subject: [PATCH 43/47] Fix empty list rendering for image thumbnails loading --- src/mixins/imageMixin.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mixins/imageMixin.js b/src/mixins/imageMixin.js index 56bb1c3c..73617815 100644 --- a/src/mixins/imageMixin.js +++ b/src/mixins/imageMixin.js @@ -3,10 +3,14 @@ export default { populateMapWithImages: function (mapImp, images, type) { this.downloadImageKeys = []; // to count downloaded images for (const [key, list] of Object.entries(images)) { - this.downloadImageThumbnail(mapImp, key, list, type); + // Exclude empty list + if (list.length) { + this.downloadImageThumbnail(mapImp, key, list, type); + } } }, downloadImageThumbnail: function (mapImp, key, list, type) { + // This inner list count will be updated by failed download const count = list.length; if (!this.downloadImageKeys.includes(key)) { From 8d1d26e8d8f731ffddf48ac3445e976138dd4d32 Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 5 Sep 2024 17:41:06 +1200 Subject: [PATCH 44/47] Prevent image thumbnail emit on connectivity click --- src/components/FlatmapVuer.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FlatmapVuer.vue b/src/components/FlatmapVuer.vue index 7264eccd..8bd2b1dc 100644 --- a/src/components/FlatmapVuer.vue +++ b/src/components/FlatmapVuer.vue @@ -2152,7 +2152,7 @@ export default { } this.$emit('connectivity-info-open', this.provenanceEntry); } - if (this.imageThumbnailSidebar && this.viewingMode === 'Exploration') { + if (this.imageThumbnailSidebar && this.imageEntry.length && this.viewingMode === 'Exploration') { this.$emit('image-thumbnail-open', this.imageEntry) } // If UI is not disabled, From 4b763b928c54e6a46c7b4b538bfaeb38f87e6f34 Mon Sep 17 00:00:00 2001 From: alan-wu Date: Thu, 12 Sep 2024 09:50:02 +1200 Subject: [PATCH 45/47] Update flatmap-viewer which fixes an issue on the minimap. --- package-lock.json | 178 +++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 107 insertions(+), 73 deletions(-) diff --git a/package-lock.json b/package-lock.json index a42ef678..b355231c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.4.3", "license": "Apache-2.0", "dependencies": { - "@abi-software/flatmap-viewer": "3.1.7", + "@abi-software/flatmap-viewer": "3.1.8", "@abi-software/map-utilities": "1.1.0", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", @@ -43,9 +43,9 @@ } }, "node_modules/@abi-software/flatmap-viewer": { - "version": "3.1.7", - "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.1.7.tgz", - "integrity": "sha512-nNyeMKWumA6Q+nu3Vj/S1/KuuZc6dLl0SuTWZllyD+vkED4SqlSliP4DKHBES+ajsxeIPOzZI1TZWwHQV2U0jw==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/@abi-software/flatmap-viewer/-/flatmap-viewer-3.1.8.tgz", + "integrity": "sha512-X1bRBgrDZFR98Qg28C3jrK5qUmHndNX56RHJnAqXGVElPueeWSMcdrRh/AMmw0gxrpTzZBWJf9ilI774F+tbwQ==", "dependencies": { "@deck.gl/core": "^9.0.17", "@deck.gl/geo-layers": "^9.0.18", @@ -2629,28 +2629,6 @@ "resolved": "https://registry.npmjs.org/@types/crypto-js/-/crypto-js-4.2.2.tgz", "integrity": "sha512-sDOLlVbHhXpAUAL0YHDUUwDZf3iN4Bwi4W6a0W0b+QcAezUbRtH4FVb+9J4h+XFPW7l/gQ9F8qC7P+Ec4k8QVQ==" }, - "node_modules/@types/eslint": { - "version": "8.56.10", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", - "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", - "dev": true, - "peer": true, - "dependencies": { - "@types/estree": "*", - "@types/json-schema": "*" - } - }, - "node_modules/@types/eslint-scope": { - "version": "3.7.7", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.7.tgz", - "integrity": "sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==", - "dev": true, - "peer": true, - "dependencies": { - "@types/eslint": "*", - "@types/estree": "*" - } - }, "node_modules/@types/estree": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", @@ -3587,10 +3565,10 @@ "node": ">=0.4.0" } }, - "node_modules/acorn-import-assertions": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/acorn-import-assertions/-/acorn-import-assertions-1.9.0.tgz", - "integrity": "sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==", + "node_modules/acorn-import-attributes": { + "version": "1.9.5", + "resolved": "https://registry.npmjs.org/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz", + "integrity": "sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==", "dev": true, "peer": true, "peerDependencies": { @@ -4197,9 +4175,9 @@ "dev": true }, "node_modules/body-parser": { - "version": "1.20.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", - "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", + "integrity": "sha512-7rAxByjUMqQ3/bHJy7D6OGXvx/MMc4IqBn/X0fcM1QUcAItpZrBEYhWGem+tzXH90c+G01ypMcYJBO9Y30203g==", "dev": true, "dependencies": { "bytes": "3.1.2", @@ -4210,7 +4188,7 @@ "http-errors": "2.0.0", "iconv-lite": "0.4.24", "on-finished": "2.4.1", - "qs": "6.11.0", + "qs": "6.13.0", "raw-body": "2.5.2", "type-is": "~1.6.18", "unpipe": "1.0.0" @@ -4245,12 +4223,12 @@ "dev": true }, "node_modules/body-parser/node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", "dev": true, "dependencies": { - "side-channel": "^1.0.4" + "side-channel": "^1.0.6" }, "engines": { "node": ">=0.6" @@ -5712,9 +5690,9 @@ } }, "node_modules/enhanced-resolve": { - "version": "5.17.0", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz", - "integrity": "sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA==", + "version": "5.17.1", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.17.1.tgz", + "integrity": "sha512-LMHl3dXhTcfv8gM4kEzIUeTQ+7fpdA0l2tUf34BddXPkz2A5xJ5L/Pchd5BL6rdccM9QGvu0sWZzK1Z1t4wwyg==", "dev": true, "peer": true, "dependencies": { @@ -6814,37 +6792,37 @@ } }, "node_modules/express": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", - "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/express/-/express-4.20.0.tgz", + "integrity": "sha512-pLdae7I6QqShF5PnNTCVn4hI91Dx0Grkn2+IAsMTgMIKuQVte2dN9PeGSSAME2FR8anOhVA62QDIUaWVfEXVLw==", "dev": true, "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.20.2", + "body-parser": "1.20.3", "content-disposition": "0.5.4", "content-type": "~1.0.4", "cookie": "0.6.0", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "2.0.0", - "encodeurl": "~1.0.2", + "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "1.2.0", "fresh": "0.5.2", "http-errors": "2.0.0", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "2.4.1", "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", + "path-to-regexp": "0.1.10", "proxy-addr": "~2.0.7", "qs": "6.11.0", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", - "send": "0.18.0", - "serve-static": "1.15.0", + "send": "0.19.0", + "serve-static": "1.16.0", "setprototypeof": "1.2.0", "statuses": "2.0.1", "type-is": "~1.6.18", @@ -6864,6 +6842,15 @@ "ms": "2.0.0" } }, + "node_modules/express/node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "dev": true, + "engines": { + "node": ">= 0.8" + } + }, "node_modules/express/node_modules/ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -9650,10 +9637,13 @@ "integrity": "sha512-rkpe71W0N0c0Xz6QD0eJETuWAJGnJ9afsl1srmwPrI+yBCkge5EycXXbYRyvL29zZVUWQCY7InPRCv3GDXuZNw==" }, "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", - "dev": true + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, "node_modules/merge-stream": { "version": "2.0.0", @@ -9684,9 +9674,9 @@ "integrity": "sha512-kYmyrCirqJf3zZ9t/0wGgRZ4/ZJw//VwaRVGA75C4nhE60vtnIzhl9J9ndkX/h6hxSN7pjg/cE0VxbnNM+bnDQ==" }, "node_modules/micromatch": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", - "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" @@ -10861,9 +10851,9 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==" }, "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.10.tgz", + "integrity": "sha512-7lf7qcQidTku0Gu3YDPc8DJ1q7OOucfa/BSsIwjuh56VU7katFvuM8hULfkwB3Fns/rsVF7PwPKVw1sl5KQS9w==", "dev": true }, "node_modules/pbf": { @@ -11823,9 +11813,9 @@ } }, "node_modules/send": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", - "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "version": "0.19.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz", + "integrity": "sha512-dW41u5VfLXu8SJh5bwRmyYUbAoSB3c9uQh6L8h/KtsFREPWpbX1lrljJo186Jc4nmci/sGUZ9a0a0J2zgfq2hw==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -11956,9 +11946,9 @@ } }, "node_modules/serve-static": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", - "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.0.tgz", + "integrity": "sha512-pDLK8zwl2eKaYrs8mrPZBJua4hMplRWJ1tIFksVC3FtBEBnl8dxgeHtsaMS8DhS9i4fLObaon6ABoc4/hQGdPA==", "dev": true, "dependencies": { "encodeurl": "~1.0.2", @@ -11970,6 +11960,51 @@ "node": ">= 0.8.0" } }, + "node_modules/serve-static/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/serve-static/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/serve-static/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "node_modules/serve-static/node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "dev": true, + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -13742,22 +13777,21 @@ "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==" }, "node_modules/webpack": { - "version": "5.91.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.91.0.tgz", - "integrity": "sha512-rzVwlLeBWHJbmgTC/8TvAcu5vpJNII+MelQpylD4jNERPwpBJOE2lEcko1zJX3QJeLjTTAnQxn/OJ8bjDzVQaw==", + "version": "5.94.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.94.0.tgz", + "integrity": "sha512-KcsGn50VT+06JH/iunZJedYGUJS5FGjow8wb9c0v5n1Om8O1g4L6LjtfxwlXIATopoQu+vOXXa7gYisWxCoPyg==", "dev": true, "peer": true, "dependencies": { - "@types/eslint-scope": "^3.7.3", "@types/estree": "^1.0.5", "@webassemblyjs/ast": "^1.12.1", "@webassemblyjs/wasm-edit": "^1.12.1", "@webassemblyjs/wasm-parser": "^1.12.1", "acorn": "^8.7.1", - "acorn-import-assertions": "^1.9.0", + "acorn-import-attributes": "^1.9.5", "browserslist": "^4.21.10", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.16.0", + "enhanced-resolve": "^5.17.1", "es-module-lexer": "^1.2.1", "eslint-scope": "5.1.1", "events": "^3.2.0", diff --git a/package.json b/package.json index 1baf2cc7..32638410 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "./src/*": "./src/*" }, "dependencies": { - "@abi-software/flatmap-viewer": "3.1.7", + "@abi-software/flatmap-viewer": "3.1.8", "@abi-software/map-utilities": "1.1.0", "@abi-software/sparc-annotation": "0.3.1", "@abi-software/svg-sprite": "1.0.0", From 4dd799d951465eed0043ce739a39a19b2d218753 Mon Sep 17 00:00:00 2001 From: alan-wu Date: Thu, 12 Sep 2024 09:51:58 +1200 Subject: [PATCH 46/47] 1.4.4 --- CHANGELOG.md | 8 +++++++- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcd1f98f..66e2c538 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). -## [v1.4.3](https://github.com/alan-wu/flatmapvuer/compare/v1.4.2...v1.4.3) +## [v1.4.4](https://github.com/alan-wu/flatmapvuer/compare/v1.4.3...v1.4.4) + +### Commits + +- Update flatmap-viewer which fixes an issue on the minimap. [`4b763b9`](https://github.com/alan-wu/flatmapvuer/commit/4b763b928c54e6a46c7b4b538bfaeb38f87e6f34) + +## [v1.4.3](https://github.com/alan-wu/flatmapvuer/compare/v1.4.2...v1.4.3) - 2024-09-03 ### Merged diff --git a/package-lock.json b/package-lock.json index b355231c..52ffd035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.3", + "version": "1.4.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@abi-software/flatmapvuer", - "version": "1.4.3", + "version": "1.4.4", "license": "Apache-2.0", "dependencies": { "@abi-software/flatmap-viewer": "3.1.8", diff --git a/package.json b/package.json index 32638410..3b9fbb83 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@abi-software/flatmapvuer", - "version": "1.4.3", + "version": "1.4.4", "license": "Apache-2.0", "files": [ "dist/*", From dc750b74f88c689740c29abc8e04a35afe4fad0b Mon Sep 17 00:00:00 2001 From: akhuoa Date: Thu, 19 Sep 2024 17:41:22 +1200 Subject: [PATCH 47/47] Add biolucida id for thumbnail images --- src/services/scicrunchQueries.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/services/scicrunchQueries.js b/src/services/scicrunchQueries.js index a6ab34af..a0ad1561 100644 --- a/src/services/scicrunchQueries.js +++ b/src/services/scicrunchQueries.js @@ -67,6 +67,7 @@ const getBiolucidaThumbnails = async (sparcApi, organCuries, type) => { let image = { thumbnail: thumbnailURL, resource: entry.file_path, + biolucida_id: entry.biolucida_id, id: entry.id, title: getFileNameFromPath(entry.file_path), type: type,