'); const oneMarker = L.marker([lat, lng]).bindPopup(popupContent); mapMarkers.push(oneMarker); }); markerClusters.addLayers(mapMarkers); mapInstance.value.addLayer(markerClusters); // zoom var bounds = markerClusters.getBounds(); if (bounds.isValid()) { mapInstance.value.fitBounds(bounds); } // fill legend var nrSamples = samplesFiltered.length; var nrSamplesLoaded = mapMarkers.length; mapLegend.value.update(nrSamplesLoaded,nrSamples - nrSamplesLoaded); } catch (error) { console.error(error); } }; const resetMarkers = () => { markerClusters.removeLayers(mapMarkers); mapMarkers = []; }; const updateMap = async (requestedPackageTitle) => { if (markerClusters) { resetMarkers(); } addSamplesToMap(requestedPackageTitle); }; document.addEventListener('click', (event) => { if (event.target.tagName === 'A' && event.target.getAttribute('data-package-title')) { selectPackage(event.target.getAttribute('data-package-title')); } }); // #### per-package pages #### const getSamplesForPackage = (requestedPackageTitle) => { if (!samples.value) { return; } return samples.value.filter((s) => s.packageTitle === requestedPackageTitle); }; const selectPackage = async (requestedPackageTitle) => { loading.value = true; selectedPackageTitle.value = requestedPackageTitle; selectedPackage.value = packages.value.filter((pac) => pac.packageTitle === selectedPackageTitle.value )[0]; await updateMap(requestedPackageTitle); loading.value = false; } const unselectPackage = async () => { loading.value = true; selectedPackageTitle.value = null; await updateMap(); mapInstance.value.setView([30, 10], 1); loading.value = false; } // primitive attempt to enable a URL selection for packages // has to be done way more professionally // const selectPackageByURL = async () => { // let uri = window.location.href.split('?'); // if (uri.length == 2) { // let vars = uri[1].split('&'); // let getVars = {}; // let tmp = ''; // vars.forEach(function(v) { // tmp = v.split('='); // if(tmp.length == 2) // getVars[tmp[0]] = tmp[1]; // }); // if (getVars["package"]) { // await loadAllData(); // selectPackage(getVars["package"]); // console.log(selectedPackageTitle.value); // } // } // } // selectPackageByURL(); // #### general logic #### const loadAllData = async () => { await loadPackages(); await loadSamples(); }; const showSelection = async () => { loading.value = true; await loadAllData(); await updateMap(); loading.value = false; }; // trigger loading of the website showSelection(); return { packages, searchQuery, archiveType, loading, mapLegend, mapInstance, filteredPackages, showSelection, resetMarkers, downloadGenotypeData, getSamplesForPackage, selectPackage, selectedPackageTitle, selectedPackage, unselectPackage }; } }; const MapView = { template: ` `, mounted() { // prepare base map const map = L.map('map').setView([37, 10], 1); L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {}).addTo(map); // map legend const legend = L.control({ position: 'bottomright' }); legend.onAdd = function (map) { this._div = L.DomUtil.create('div', 'legend'); this._div.innerHTML += "Loading..."; return this._div; }; legend.update = function (nrLoaded, nrNotLoadable) { this._div.innerHTML = nrLoaded + " samples loaded
" + nrNotLoadable + " lat/lon missing
"; }; legend.addTo(map); // store legend and map in global variables this.$parent.mapLegend = legend; this.$parent.mapInstance = map; }, }; const app = createApp(PackageExplorer); app.component('map-view', MapView); app.mount('#archiveExplorer'); </script>
_ Loading...
Poseidon Community Archive
Poseidon AADR Archive
Poseidon Minotaur Archive
Back to the package overview page
Package: {{ selectedPackageTitle }}
Description | {{ selectedPackage.description }} |
Package version |
v{{ selectedPackage.packageVersion }}
(that is the latest available version)
(that is not the latest available version)
for Poseidon v{{ selectedPackage.poseidonVersion }}.
It was last modified on {{ selectedPackage.lastModified }}. |
Resources | See this package on GitHub: Download this package as .zip archive: |
Nr of samples | {{ selectedPackage.nrIndividuals }} |
Poseidon_ID | Groups | Details |
---|---|---|
{{ sample.poseidonID }} | {{ sample.groupNames.toString() }} |
View sample details
{{ addCol[0] }}: {{ addCol[1] }}
|
{{ pac.packageTitle }} v{{ pac.packageVersion }}, Samples: {{ pac.nrIndividuals }} |
{{ pac.description }} |