Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 39 additions & 7 deletions components/ImagesGallery/ImagesGallery.vue
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,11 @@ const getThumbnailData = async (datasetDoi, datasetId, datasetVersion, datasetFa
if (flatmapData.length === 0) {
flatmapData.push(speciesData)
}
scicrunchData['flatmaps'] = flatmapData
if ('flatmaps' in scicrunchData) {
scicrunchData['flatmaps'].push(...flatmapData)
} else {
scicrunchData['flatmaps'] = flatmapData
}
}
}
} catch (e) {
Expand Down Expand Up @@ -402,13 +406,41 @@ export default {
}

if ('flatmaps' in scicrunchData) {
items.push(
...Array.from(scicrunchData.flatmaps, f => {
scicrunchData.flatmaps.forEach( f => {
if (('dataset' in f)) {
const flatmap_uuid = f.associated_flatmap?.identifier
if (flatmap_uuid) {
const id = f.identifier
const file_path = f.dataset.path
const thumbnail = this.getThumbnailPathForPlot(f, scicrunchData['abi-thumbnail'])
if (thumbnail.mimetype.name !== '' && thumbnail.dataset.path !== '') {
this.retrieveThumbnailFromInfo(
items,
{
id,
fetchAttempts: 0,
datasetId,
mimetype: thumbnail.mimetype.name,
file_path: thumbnail.dataset.path,
s3Bucket: s3Bucket
},
this.defaultImg
)
}
const linkUrl = `${baseRoute}maps?type=fc&dataset_version=${datasetVersion}&dataset_id=${datasetId}&fid=${flatmap_uuid}`
items.push({
id,
title: baseName(file_path),
type: 'FC Map',
thumbnail: this.defaultImg,
link: linkUrl
})
}
} else {
let title = f.uberonid ? f.uberonid : null
if (f.organ) {
title = `View ${f.organ}`
}

let linkUrl = `${baseRoute}maps?type=flatmap&dataset_version=${datasetVersion}&dataset_id=${datasetId}&taxo=${f.taxo}`
if (f.uberonid) linkUrl = linkUrl + `&uberonid=${f.uberonid}`
if (f.species) linkUrl = linkUrl + `&for_species=${f.species}`
Expand All @@ -430,9 +462,9 @@ export default {
},
true
)
return item
})
)
items.push(item)
}
});
}

if ('mbf-segmentation' in scicrunchData) {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
"sass": "^1.66.1"
},
"dependencies": {
"@abi-software/mapintegratedvuer": "1.12.0",
"@abi-software/mapintegratedvuer": "1.12.3",
"@abi-software/plotcomponents": "^0.2.4",
"@abi-software/plotdatahelpers": "^0.1.2",
"@abi-software/simulationvuer": "2.0.14",
"@abi-software/simulationvuer": "2.0.17",
"@element-plus/nuxt": "^1.0.10",
"@nuxtjs/sitemap": "^5.1.4",
"@pinia-plugin-persistedstate/nuxt": "^1.2.0",
Expand Down Expand Up @@ -65,7 +65,8 @@
"resolutions": {
"string-width": "4.2.3",
"mlly": "1.4.0",
"vue": "3.4.21"
"vue": "3.4.21",
"@abi-software/map-utilities": "1.7.2"
},
"engines": {
"node": "18.17.1"
Expand Down
27 changes: 18 additions & 9 deletions pages/apps/maps/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -237,22 +237,29 @@ const processEntry = async (route) => {
successMessage = messages.successMessage
failMessage = messages.failMessage
}
if (route.query.type === 'fc' && anatomy) {
}
if (route.query.type === 'fc') {
if (anatomy || route.query.fid) {
currentEntry = {
type: 'Flatmap',
resource: 'FunctionalConnectivity',
label: 'Functional',
state: { searchTerm: anatomy }
}
if (anatomy) {
currentEntry.state = { searchTerm: anatomy }
}
if (route.query.fid) {
currentEntry.resource = route.query.fid
}
} else {
startingMap = "FC"
}
}
if (route.query.type === 'ac' || route.query.type === 'flatmap') {
startingMap = "AC"
}
if (route.query.type === 'fc') {
startingMap = "FC"
}
return [startingMap, organ_name, currentEntry, successMessage, failMessage, []]

return [startingMap, organ_name, currentEntry, successMessage, failMessage]
}


Expand Down Expand Up @@ -401,7 +408,7 @@ const openViewWithQuery = async (router, route, $axios, sparcApi, algoliaIndex,
} else if (route.query.type === 'fc' ||
route.query.type === 'ac' ||
route.query.type === 'flatmap') {
return await processEntry(route)
return [...(await processEntry(route)), facets]
} else if (route.query.type === 'wholebody') {
startingMap = "WholeBody"
} else {
Expand All @@ -417,7 +424,9 @@ const openViewWithQuery = async (router, route, $axios, sparcApi, algoliaIndex,

const constructMapEntries = (apps) => {
if (!apps) return []
return apps.filter((app) => app.fields.url.startsWith('/apps/maps?type=')).map((app) => {
return apps.filter((app) => {
return (app.fields.url.startsWith('/apps/maps?type=') && !(app.fields.url.startsWith('/apps/maps?type=fc')))
}).map((app) => {
const words = pathOr('', ['fields', 'logo', 'fields', 'title'], app).split(" ");
const buttonText = words.map((word) => {
return word[0].toUpperCase() + word.substring(1);
Expand Down Expand Up @@ -674,7 +683,7 @@ export default {
flex-direction: column;
align-items: center;
padding: 1rem;

padding-left: 3rem;
.logo {
height: 6rem;
margin-bottom: 1.5rem;
Expand Down
10 changes: 5 additions & 5 deletions tests/cypress/e2e/mapsviewer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { retryableBefore, stringToArray } from '../support/utils.js'
// central coordinate around { 'x': 768, 'y': 373 }
const coordinate = { 'x': 800, 'y': 333 }
const pixelChange = 3
const mapTypes = ['ac', 'wholebody', 'fc']
const mapTypes = ['ac', 'wholebody']

/**
* Human Female, Human Male, Rat, Mouse, Pig, Cat
Expand Down Expand Up @@ -40,9 +40,9 @@ mapTypes.forEach((map) => {
} else if (map === 'wholebody') {
cy.waitForScaffoldLoading()
cy.waitForMapTreeControlLoading()
} else if (map === 'fc') {
} /* else if (map === 'fc') {
cy.waitForFlatmapLoading()
}
} */
// Close sidebar
cy.get('body').then(($body) => {
if ($body.find('.close-tab > .el-icon').length !== 0) {
Expand Down Expand Up @@ -412,7 +412,7 @@ mapTypes.forEach((map) => {
cy.contains('Vertical split').click()
cy.get('.pane-1 > .content-container > .toolbar > .el-row > .map-icon').click()
})
} else if (map === 'fc') {
}/* else if (map === 'fc') {
it('Map is loaded', function () {
cy.get('.toolbar .toolbar-title').then((title) => {
expect(title, 'Functional flatmap should be loaded').to.contain('Functional Flatmap')
Expand All @@ -438,6 +438,6 @@ mapTypes.forEach((map) => {
cy.contains('Vertical split').click()
cy.get('.pane-1 > .content-container > .toolbar > .el-row > .map-icon').click()
})
}
} */
})
})
Loading
Loading