mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-25 13:53:48 +01:00
Add Unpublished publications (publications without DOI) support
This commit is contained in:
parent
a9c090e24f
commit
d295352285
@ -99,12 +99,12 @@ draft: false
|
|||||||
var data= await loadAllData()
|
var data= await loadAllData()
|
||||||
window.defaultDats = []
|
window.defaultDats = []
|
||||||
for (const sub of Object.values(data)) {
|
for (const sub of Object.values(data)) {
|
||||||
for (const doi of uniq(sub.map(d => d.DOI.string))) {
|
for (const doi of uniq(sub.map(d => (d.DOI == null ? "" : d.DOI.string)))) {
|
||||||
const subdoi = sub.filter(d => d.DOI.string === doi)
|
const subdoi = sub.filter(d => (d.DOI == null ? "" : d.DOI.string) === doi)
|
||||||
for (mol of uniq(subdoi.map(d => d.molecule))) {
|
for (mol of uniq(subdoi.map(d => d.molecule))) {
|
||||||
const submol = subdoi.filter(d => d.molecule === mol)
|
const submol = subdoi.filter(d => d.molecule === mol)
|
||||||
const source = submol.find((d) => {
|
const source = submol.find((d) => {
|
||||||
if (d.DOI.string === "10.1021/acs.jctc.8b01205") {
|
if ((d.DOI == null ? "" : d.DOI.string) === "10.1021/acs.jctc.8b01205") {
|
||||||
return d.method.name === "CASPT2" && d.method.basis === "aug-cc-pVDZ"
|
return d.method.name === "CASPT2" && d.method.basis === "aug-cc-pVDZ"
|
||||||
} else {
|
} else {
|
||||||
return d.method.isTBE
|
return d.method.isTBE
|
||||||
@ -120,11 +120,24 @@ draft: false
|
|||||||
|
|
||||||
window.defaultDats = window.defaultDats.concat(sub)
|
window.defaultDats = window.defaultDats.concat(sub)
|
||||||
}
|
}
|
||||||
await doiCache.addRange(Array.from(new Set(window.defaultDats.map(d=>d.DOI.string))))
|
await doiCache.addRange(Array.from(new Set(window.defaultDats.filter(d=>d.DOI!==null).map(d=>d.DOI.string))))
|
||||||
window.defaultDats = window.defaultDats.sort((datfa,datfb)=>{
|
window.defaultDats = window.defaultDats.sort((datfa,datfb)=>{
|
||||||
const puba = doiCache.get(datfa.DOI.string).format('data', { format: 'object' })[0]
|
const DOIa=datfa.DOI
|
||||||
const pubb = doiCache.get(datfb.DOI.string).format('data', { format: 'object' })[0]
|
const DOIb=datfb.DOI
|
||||||
|
if (DOIa == null && DOIb == null) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
else if (DOIa == null){
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
else if (DOIb == null){
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const puba = doiCache.get(DOIa.string).format('data', { format: 'object' })[0]
|
||||||
|
const pubb = doiCache.get(DOIb.string).format('data', { format: 'object' })[0]
|
||||||
return pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb)
|
return pubUtils.getIssuedDate(puba) - pubUtils.getIssuedDate(pubb)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
processingIndicator.isActive = false
|
processingIndicator.isActive = false
|
||||||
reloadCustomFiles()
|
reloadCustomFiles()
|
||||||
@ -194,7 +207,8 @@ draft: false
|
|||||||
const sets = await (async () => {
|
const sets = await (async () => {
|
||||||
if (name === "DOI") {
|
if (name === "DOI") {
|
||||||
const publis = await getPublis()
|
const publis = await getPublis()
|
||||||
const sets = publis.sets
|
var sets = publis.sets
|
||||||
|
sets.set("","Unknow set")
|
||||||
return sets
|
return sets
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -238,7 +252,7 @@ draft: false
|
|||||||
case "basis":
|
case "basis":
|
||||||
return data.method.basis
|
return data.method.basis
|
||||||
case "DOI":
|
case "DOI":
|
||||||
return data.DOI.string
|
return data.DOI === null ? "" : data.DOI.string
|
||||||
default:
|
default:
|
||||||
return data[name]
|
return data[name]
|
||||||
break;
|
break;
|
||||||
@ -256,7 +270,7 @@ draft: false
|
|||||||
if (!(sdatdic.has(key))) {
|
if (!(sdatdic.has(key))) {
|
||||||
sdatdic.set(key, new Map())
|
sdatdic.set(key, new Map())
|
||||||
}
|
}
|
||||||
const myT1s = T1ref.get(d.DOI.string).get(d.molecule)
|
const myT1s = T1ref.get(d.DOI == null ? "" : d.DOI.string).get(d.molecule)
|
||||||
for (const exc of d.excitations) {
|
for (const exc of d.excitations) {
|
||||||
var allowT1 = false
|
var allowT1 = false
|
||||||
const T1Key = JSON.stringify((exc.initial, exc.final))
|
const T1Key = JSON.stringify((exc.initial, exc.final))
|
||||||
@ -367,14 +381,14 @@ draft: false
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
window.T1ref = new Map()
|
window.T1ref = new Map()
|
||||||
var dois = new Set(window.filtData.map((d) => d.DOI.string))
|
var dois = new Set(window.filtData.map((d) =>d.DOI===null ? "" : d.DOI.string))
|
||||||
var mols = new Set(window.filtData.map((d) => d.molecule))
|
var mols = new Set(window.filtData.map((d) => d.molecule))
|
||||||
await window.doiCache.addRange(dois)
|
await window.doiCache.addRange(dois)
|
||||||
for (const doi of dois) {
|
for (const doi of dois) {
|
||||||
window.T1ref.set(doi, new Map())
|
window.T1ref.set(doi, new Map())
|
||||||
for (const mol of mols) {
|
for (const mol of mols) {
|
||||||
window.T1ref.get(doi).set(mol, new Map())
|
window.T1ref.get(doi).set(mol, new Map())
|
||||||
var TBESortdat = window.dats.filter(d => d.DOI.string === doi && d.molecule === mol).sort((d1, d2) => {
|
var TBESortdat = window.dats.filter(d => (d.DOI === null ? "" : d.DOI.string) === doi && d.molecule === mol).sort((d1, d2) => {
|
||||||
if (d1.method.isTBE && !d2.method.isTBE) {
|
if (d1.method.isTBE && !d2.method.isTBE) {
|
||||||
return -1
|
return -1
|
||||||
} else if (!d1.method.isTBE && d2.method.isTBE) {
|
} else if (!d1.method.isTBE && d2.method.isTBE) {
|
||||||
@ -398,7 +412,7 @@ draft: false
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(sel_ref).empty()
|
$(sel_ref).empty()
|
||||||
for (const el of uniq(window.filtData.map(d => [d.method, d.DOI.string]))) {
|
for (const el of uniq(window.filtData.map(d => [d.method, (d.DOI === null ? null : d.DOI.string)]))) {
|
||||||
op = $("<option/>", {
|
op = $("<option/>", {
|
||||||
value: JSON.stringify(el)
|
value: JSON.stringify(el)
|
||||||
}).text(el[0])
|
}).text(el[0])
|
||||||
@ -413,10 +427,11 @@ draft: false
|
|||||||
var data = $("#data")
|
var data = $("#data")
|
||||||
$(data).empty();
|
$(data).empty();
|
||||||
if (window.filtData.length > 0) {
|
if (window.filtData.length > 0) {
|
||||||
const sets = (await getPublis()).sets
|
var sets = (await getPublis()).sets
|
||||||
|
sets.set("","Unknow set")
|
||||||
for (const doi of doiCache.keys()) {
|
for (const doi of doiCache.keys()) {
|
||||||
paperdata = window.filtData.filter((d) => {
|
paperdata = window.filtData.filter((d) => {
|
||||||
return d.DOI.string == doi
|
return (d.DOI === null ? "" : d.DOI.string) == doi
|
||||||
})
|
})
|
||||||
var methods = uniq(paperdata.map(d => d.method))
|
var methods = uniq(paperdata.map(d => d.method))
|
||||||
const sortedMethods = methods.sort((a, b) => {
|
const sortedMethods = methods.sort((a, b) => {
|
||||||
@ -451,7 +466,7 @@ draft: false
|
|||||||
datadic = new Map()
|
datadic = new Map()
|
||||||
for (const dat of paperdata) {
|
for (const dat of paperdata) {
|
||||||
const key1 = dat.molecule;
|
const key1 = dat.molecule;
|
||||||
const myT1s = T1ref.get(dat.DOI.string).get(dat.molecule)
|
const myT1s = T1ref.get(dat.DOI == null ? "" : dat.DOI.string).get(dat.molecule)
|
||||||
if (!datadic.has(key1)) {
|
if (!datadic.has(key1)) {
|
||||||
datadic.set(key1, new Map())
|
datadic.set(key1, new Map())
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ draft: false
|
|||||||
window.onload = async function () {
|
window.onload = async function () {
|
||||||
var div = document.getElementById("publis_div")
|
var div = document.getElementById("publis_div")
|
||||||
const Cite = require("citation-js")
|
const Cite = require("citation-js")
|
||||||
const sdois = uniq(Object.values(await loadAllData()).flat().map(d => d.DOI.string))
|
const sdois = uniq(Object.values(await loadAllData()).flat().filter(d => d.DOI !== null).map(d => d.DOI.string))
|
||||||
const spubliscite = await Cite.async(sdois)
|
const spubliscite = await Cite.async(sdois)
|
||||||
const pubs = await getPublis()
|
const pubs = await getPublis()
|
||||||
const uospublis = spubliscite.format('data', { format: 'object' })
|
const uospublis = spubliscite.format('data', { format: 'object' })
|
||||||
|
Loading…
Reference in New Issue
Block a user