diff --git a/content/dataset.html b/content/dataset.html index f25543df..bad4dfc2 100644 --- a/content/dataset.html +++ b/content/dataset.html @@ -98,12 +98,12 @@ draft: false var data = await loadAllData() window.defaultDats = [] for (const sub of Object.values(data)) { - for (const doi of new Set(sub.map(d => d.DOI))) { - const subdoi = sub.filter(d => (d.DOI == null ? "" : d.DOI) === doi) + for (const article of new Set(sub.map(d => d.article))) { + const subdoi = sub.filter(d => (d.article == null ? "" : d.article) === article) for (mol of uniq(subdoi.map(d => d.molecule))) { const submol = subdoi.filter(d => d.molecule === mol) const source = submol.find((d) => { - if ((d.DOI == null ? "" : d.DOI) === "10.1021/acs.jctc.8b01205") { + if ((d.article == null ? "" : d.article) === "10.1021/acs.jctc.8b01205") { return d.method.name === "CASPT2" && d.method.basis === "aug-cc-pVDZ" } else { return d.method.isTBE @@ -119,22 +119,22 @@ draft: false window.defaultDats = window.defaultDats.concat(sub) } - await doiCache.addRange(Array.from(new Set(window.defaultDats.filter(d => d.DOI !== null).map(d => d.DOI)))) + await doiCache.tryAddRange(Array.from(new Set(window.defaultDats.filter(d => d.article !== null).map(d => d.article)))) window.defaultDats = window.defaultDats.sort((datfa, datfb) => { - const DOIa = datfa.DOI - const DOIb = datfb.DOI - if (DOIa == null && DOIb == null) { + const articleA = datfa.article + const articleB = datfb.article + if ([articleA,articleB].every(art=>!doiCache.has(art))) { return 0 } - else if (DOIa == null) { + else if (!doiCache.has(articleA)) { return 1 } - else if (DOIb == null) { + else if (!doiCache.has(articleB)) { return -1 } else { - const puba = doiCache.get(DOIa).format('data', { format: 'object' })[0] - const pubb = doiCache.get(DOIb).format('data', { format: 'object' })[0] + const puba = doiCache.get(articleA).format('data', { format: 'object' })[0] + const pubb = doiCache.get(articleB).format('data', { format: 'object' })[0] return pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb) } }) @@ -152,7 +152,7 @@ draft: false } } } - reloadSelect("DOI") + reloadSelect("article") } async function clearSelect(BeforeName = null) { var selects = ((BeforeName == null) ? getAllSelect() : getAllSelectAfter(BeforeName, true)) @@ -195,7 +195,7 @@ draft: false function getAllVals(select) { var baseval = $(select).val() switch (select.name) { - case "DOI": + case "article": vals=baseval.reduce((accumulator,currentValue)=>accumulator.concat(JSON.parse(currentValue)),[]) return vals break; @@ -220,7 +220,7 @@ draft: false }) }).map((d) => getSelectValue(d, name))) const publis = await (async () => { - if (name === "DOI") { + if (name === "article") { const publis = await publiDB.loadAsync() return publis } @@ -228,7 +228,7 @@ draft: false return undefined } })() - if (name === "DOI") { + if (name === "article") { let newvals = [] for (const val of vals) { if (val==="") { @@ -248,7 +248,7 @@ draft: false } textSelctor = function (value) { switch (name) { - case "DOI": + case "article": setname = publis.findNameFromSet(value, true) return setname === null ? value.toString() : setname break; @@ -288,8 +288,8 @@ draft: false break; case "basis": return data.method.basis - case "DOI": - return data.DOI === null ? "" : data.DOI + case "article": + return data.article === null ? "" : data.article default: return data[name] break; @@ -305,8 +305,8 @@ draft: false var sdatdic = new Map() for (const d of window.filtData) { const key = JSON.stringify(d.method) - const doi = (d.DOI == null ? "" : d.DOI) - const SetName = publis.findSetNameFromDOI(doi,true) + const article = (d.article == null ? "" : d.article) + const SetName = publis.findSetNameFromArticle(article,true) if (!(sdatdic.has(key))) { sdatdic.set(key, new Map()) } @@ -422,15 +422,15 @@ draft: false }) }) window.T1ref = new Map() - var dois = new Set(window.filtData.map((d) => d.DOI === null ? "" : d.DOI)) + var articles = new Set(window.filtData.map((d) => d.article === null ? "" : d.article)) var mols = new Set(window.filtData.map((d) => d.molecule)) - await window.doiCache.addRange(dois) - for (const doi of dois) { - const setName = publis.findSetNameFromDOI(doi,true) + await window.doiCache.tryAddRange(articles) + for (const article of articles) { + const setName = publis.findSetNameFromArticle(article,true) window.T1ref.set(setName, new Map()) for (const mol of mols) { window.T1ref.get(setName).set(mol, new Map()) - var TBESortdat = window.dats.filter(d => (d.DOI === null ? "" : d.DOI) === doi && d.molecule === mol).sort((d1, d2) => { + var TBESortdat = window.dats.filter(d => (d.article === null ? "" : d.article) === article && d.molecule === mol).sort((d1, d2) => { if (d1.method.isTBE && !d2.method.isTBE) { return -1 } else if (!d1.method.isTBE && d2.method.isTBE) { @@ -454,7 +454,7 @@ draft: false } } $(sel_ref).empty() - for (const el of uniq(window.filtData.map(d => [d.method, (d.DOI === null ? null : d.DOI)]))) { + for (const el of uniq(window.filtData.map(d => [d.method, (d.article === null ? null : d.article)]))) { op = $("