10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 05:03:53 +01:00

Merge branch 'publis.yaml' into TBE

This commit is contained in:
Mickaël Véril 2020-03-18 14:54:37 +01:00
commit ac60bbb978
8 changed files with 42 additions and 25 deletions

View File

@ -16,7 +16,7 @@ draft: false
<script src="/js/processingIndicator.js"></script>
<script src="/js/noNan.js"></script>
<script src="/js/websiteFile.js"></script>
<script src="/js/getSets.js"></script>
<script src="/js/getPublis.js"></script>
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js"
type="text/javascript"></script>
<script src="/js/DOICache.js"></script>
@ -24,6 +24,7 @@ draft: false
<script src="/js/selectSelectAll.js"></script>
<script src="https://unpkg.com/simple-statistics@7.0.2/dist/simple-statistics.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bowser@2.5.3/es5.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.13.1/js-yaml.min.js"></script>
<script src="/js/numberUtils.js"></script>
<script>
function adjustSticky() {
@ -184,7 +185,16 @@ draft: false
return $(el).val().includes(getSelectValue(d, el.name))
})
}).map((d) => getSelectValue(d, name)))
const sets = (name === "DOI") ? await getSets() : undefined
const sets = await (async ()=>{
if(name === "DOI"){
const publis=await getPublis()
const sets=publis.sets
return sets
}
else{
return undefined
}
})()
for (const val of vals) {
if (val !== null) {
$("<option/>", {
@ -250,7 +260,8 @@ draft: false
th.clone().text(meth.toString("\n").split('-').join('\u2011')).appendTo(row)
var thdoi = th.clone()
var publi = doiCache.get(doi, true)
const sets = await getSets()
const publis = await getPublis()
const sets=publis.sets
if (sets.has(doi)) {
var str = sets.get(doi)
$(thdoi).append(str + " ")
@ -341,7 +352,7 @@ draft: false
var data = $("#data")
$(data).empty();
if (window.filtData.length > 0) {
var sets = await getSets()
const sets = (await getPublis()).sets
for (const doi of doiCache.keys()) {
paperdata = window.filtData.filter((d) => {
return d.DOI.string == doi

View File

@ -5,12 +5,13 @@ draft: false
---
<link rel="stylesheet" type="text/css" href="/css/publi.css" />
<script src="/js/data.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.13.1/js-yaml.min.js"></script>
<script src="/js/loadAllData.js" type="text/javascript"></script>
<script src="/js/getFullDataPath.js" type="text/javascript"></script>
<script src="/js/getTextFromFile.js" type="text/javascript"></script>
<script src="/js/trueTypeOf.js" type="text/javascript"></script>
<script src="/js/uniq.js"></script>
<script src="/js/getSets.js"></script>
<script src="/js/getPublis.js"></script>
<script src="/js/websiteFile.js"></script>
<script src="/js/numberUtils.js"></script>
<script src="/js/createPubliUI.js"></script>
@ -21,10 +22,14 @@ draft: false
const Cite = require("citation-js")
const dois = uniq(Object.values(await loadAllData()).flat().map(d => d.DOI.string))
const publiscite = await Cite.async(dois)
const sets = await getSets()
const pubs = await getPublis()
const publis = publiscite.format('data', { format: 'object' })
for (const publi of publis) {
art=createPubliUI(publi,sets,true)
art=createPubliUI(publi,pubs.sets,true)
$(art).appendTo("<li/>").appendTo("#publis_ul")
}
for (const publi of pubs.others.keys()) {
art=createPubliUI(publi,pubs.others,true)
$(art).appendTo("<li/>").appendTo("#publis_ul")
}
}

View File

@ -12,7 +12,8 @@ draft: false
<script src="/js/getTextFromFile.js" type="text/javascript"></script>
<script src="/js/trueTypeOf.js" type="text/javascript"></script>
<script src="/js/noNan.js"></script>
<script src="/js/getSets.js"></script>
<script src="/js/getPUblis.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-yaml/3.13.1/js-yaml.min.js"></script>
<script src="/js/websiteFile.js"></script>
{{< getDataFilesName >}}
<script>
@ -103,7 +104,7 @@ draft: false
case DOI.name:
var publi = await Cite.async(element.string)
var publiel=$("<div/>")
const sets=await getSets()
const sets=(await getPublis()).sets()
if(sets.has(element.string)){
$(publiel).append(sets.get(element.string))
}

View File

@ -1,5 +0,0 @@
10.1021/acs.jctc.8b00406 : QUEST#1
10.1021/acs.jctc.8b01205 : QUEST#2
10.1021/acs.jctc.9b01216 : QUEST#3
10.1021/acs.jpclett.8b02058 : set 3
10.1021/acs.jctc.8b01103 : set 4

8
static/data/publis.yaml Normal file
View File

@ -0,0 +1,8 @@
sets:
10.1021/acs.jctc.8b00406 : QUEST#1
10.1021/acs.jctc.8b01205 : QUEST#2
10.1021/acs.jctc.9b01216 : QUEST#3
10.1021/acs.jpclett.8b02058 : set 3
10.1021/acs.jctc.8b01103 : set 4
others:

View File

@ -1,7 +1,7 @@
function createPubliUI(publi,sets=new Map(),toolTips=false) {
const art = $("<article/>").addClass("publi")
art.className = "publi"
if (sets.has(publi.DOI)) {
if (sets.has(publi.DOI) && sets.get(publi.DOI)!==null) {
$("<h1/>").text(sets.get(publi.DOI)).appendTo(art)
}
$("<a/>", {

7
static/js/getPublis.js Normal file
View File

@ -0,0 +1,7 @@
async function getPublis() {
const text = await getTextFromFileUrlAsync("/data/publis.yaml")
const myYaml=jsyaml.load(text);
myYaml.sets= ((myYaml.sets===null) ? new Map() : new Map(Object.entries(myYaml.sets)));
myYaml.others=((myYaml.others===null) ? new Map() : new Map(Object.entries(myYaml.others)));
return myYaml
}

View File

@ -1,10 +0,0 @@
async function getSets(){
var m=new Map()
const text=await getTextFromFileUrlAsync("/data/datasets.lst")
const lines=text.split("\n")
for(const line of lines){
const kv=line.split(":",2)
m.set(kv[0].trim(),kv[1].trim())
}
return m
}