Commit bab0e309 authored by Lauri Himanen's avatar Lauri Himanen
Browse files

Updated GUI to use commas as thousands separator and to better handle missing...

Updated GUI to use commas as thousands separator and to better handle missing electronic structure data on overview page.
parent 048843c0
Pipeline #85080 skipped with stage
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,12 +2,12 @@ window.nomadEnv = {
//apiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//guiRoot: "https://labdev-nomad.esc.rzg.mpg.de/dev/nomad/encyclopedia-api/",
//userCookieDomain: ".esc.rzg.mpg.de",
//userCookieDomain: ".nomad-lab.eu",
//apiRoot: "https://nomad-lab.eu/prod/rae/api/encyclopedia/",
//guiRoot: "https://nomad-lab.eu/prod/rae/encyclopedia/",
guiRoot: "http://localhost:3000/gui/",
apiRoot: "http://localhost:8000/fairdi/nomad/latest/api/encyclopedia/",
userCookieDomain: ".localhost",
apiRoot: "https://nomad-lab.eu/prod/rae/beta/api/encyclopedia/",
guiRoot: "https://nomad-lab.eu/prod/rae/beta/encyclopedia/",
userCookieDomain: ".nomad-lab.eu",
//guiRoot: "http://localhost:3000/gui/",
//apiRoot: "http://localhost:8000/fairdi/nomad/latest/api/encyclopedia/",
//userCookieDomain: ".localhost",
guestUserToken: 'eyJhbGciOiJIUzI1NiIsImlhdCI6MTUyMzg4MDE1OSwiZXhwIjoxNjgxNTYwMTU5fQ.ey'+
'JpZCI6ImVuY2d1aSJ9.MsMWQa3IklH7cQTxRaIRSF9q8D_2LD5Fs2-irpWPTp4',
keycloakBase: 'https://nomad-lab.eu/fairdi/keycloak/auth/',
......
......@@ -390,6 +390,9 @@ function getMinMaxHTML(calcs,prop){
return '('+Math.min.apply(null, propArray)+' ... '+Math.max.apply(null, propArray)+')';
}
function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
function generateDiagramSteps(maxVal, d=4){
......@@ -463,6 +466,7 @@ module.exports = {
getMinMaxHTML: getMinMaxHTML,
getSubscriptedFormula: getSubscriptedFormula,
getAverage,
numberWithCommas,
generateDiagramSteps,
getCalcMapByFunctional,
getDefault,
......
......@@ -474,9 +474,11 @@ class Overview {
'</b><br><span style="font-size: 0.8em">('+calcWithBS.functional_type+' - '+calcWithBS.code_name+')</span>';
if (bandStructData.section_k_band_segment[0].band_energies.length === 2)
this.spinLegend.style.display = 'block';
this.bsLoaded = true;
isReady();
} else {
this.bandPlotter.setNoData();
}
this.bsLoaded = true;
isReady();
LoadingPopup.hide("overview_electronic_band_structure");
});
}
......@@ -497,9 +499,11 @@ class Overview {
'</b><br><span style="font-size: 0.8em">('+calcWithDOS.functional_type+' - '+calcWithDOS.code_name+')</span>';
if (dosData.dos_values.length === 2)
this.spinLegend.style.display = 'block';
this.dosLoaded = true;
isReady();
} else {
this.dosPlotter.setNoData();
}
this.dosLoaded = true;
isReady();
LoadingPopup.hide("overview_electronic_dos");
});
}
......
......@@ -146,7 +146,7 @@ class MaterialList {
// The number of results is set only on the first page, as it is not
// returned if after key is provided.
if (this.page === 1) {
this.nMaterials.innerHTML = "(total: " + data.pages.total + ")";
this.nMaterials.innerHTML = "(total: " + util.numberWithCommas(data.pages.total) + ")";
this.nPages = Math.ceil(data.pages.total / this.searchJson.search_by.per_page);
}
......@@ -216,7 +216,7 @@ class MaterialList {
_updateUI() {
this.pageElement.innerHTML= 'page ' + this.page + "/" +this.nPages;
this.pageElement.innerHTML= 'page ' + this.page + "/" + util.numberWithCommas(this.nPages);
let html = '';
if (this.matMap.size === 0) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment