10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 14:23:42 +01:00
QUESTDB_website/content/_index.html

153 lines
5.2 KiB
HTML
Raw Normal View History

---
title: "Welcome"
date: 2019-08-29 09:00
draft: false
---
<script src="/scripts/data.js" type="text/javascript"></script>
<script src="/scripts/getFullDataPath.js" type="text/javascript"></script>
<script src="/scripts/getTextFromFile.js" type="text/javascript"></script>
2019-08-22 15:23:52 +02:00
<script src="https://cdn.rawgit.com/larsgw/citation.js/archive/citation.js/citation-0.4.0-9.js" type="text/javascript"></script>
2019-09-05 12:59:54 +02:00
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script type="text/javascript" id="MathJax-script" async
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
2019-09-03 15:38:17 +02:00
</script>
2019-09-20 10:23:07 +02:00
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
{{< getDataFilesName >}}
2019-08-21 20:04:29 +02:00
<script>
window.onload=function()
{
fsel=document.getElementById("fileSelect")
getDataFilesName().forEach(function(element) {
op=document.createElement("option");
op.value=element;
op.innerText=element.split('.')[0];
fsel.appendChild(op);
});
}
async function update_file(file) {
2019-09-05 09:34:48 +02:00
var lnk_file=document.getElementById('lnk_file');
lnk_file.setAttribute('href',String.raw`view?dataFile=${file}`);
dat= await data.loadAsync(file);
2019-09-05 10:32:46 +02:00
await applyData(dat);
}
2019-09-05 10:32:46 +02:00
async function applyData(dat) {
2019-08-22 15:23:52 +02:00
const Cite = require('citation-js');
2019-09-05 15:26:50 +02:00
// Start an async task to get publi data
let publiPromise = Cite.async(dat.doi.string)
2019-09-05 10:32:46 +02:00
const LatexInline=['\\(','\\)']
var par=document.getElementById("data_par")
2019-09-03 15:38:17 +02:00
par.innerHTML='';
var md=[];
var els=[];
2019-09-19 15:05:07 +02:00
md.push(["Molecule",dat.molecule]);
md.push(["Comment",dat.comment])
var dict = {
"Ground state": dat.GS,
2019-09-20 10:17:34 +02:00
"Excited states": dat.ES,
2019-09-19 15:05:07 +02:00
};
for (var key in dict){
md.push(key)
md.push(["Code",dict[key].code])
md.push(["Method",dict[key].method])
md.push(["Geometry",dict[key].geometry])
}
md.push("ZPE")
md.push(["Code",dat.ZPE.code])
md.push(["Method",dat.ZPE.method])
2019-09-03 15:38:17 +02:00
md.push(["DOI",dat.doi]);
2019-09-19 15:05:07 +02:00
div=document.getElementById("meta_div")
2019-09-03 15:38:17 +02:00
md.forEach(function(element){
2019-09-19 15:05:07 +02:00
var node =null;
if(typeof element==="string"){
node= document.createElement("h2");
node.innerText=element;
} else {
node = document.createElement("div");
node.innerText= element[0]+': '+element[1];
}
div.appendChild(node);
2019-09-03 15:38:17 +02:00
});
2019-09-20 09:46:38 +02:00
var tb=document.getElementById("ex_table_b");
tb.innerHTML=''
2019-09-19 15:05:07 +02:00
dat.excitations.forEach(el=> {
var row=document.createElement("tr")
var rowd=[]
rowd.push(String.raw`${LatexInline[0]} ${el.start.toLaTeX()} \rightarrow ${el.end.toLaTeX()}${LatexInline[1]}`)
2019-09-19 18:54:23 +02:00
var e=[el.Eabs,el.Efluo,el.EZPE,el.Eadia,el.Ezz]
2019-09-19 15:05:07 +02:00
e.forEach((val)=>rowd.push(val.toFixed(2)))
rowd.forEach((d)=>{
td=document.createElement("td")
td.innerText=d
row.appendChild(td)
})
2019-09-20 09:46:38 +02:00
tb.appendChild(row)
2019-09-03 15:38:17 +02:00
});
2019-09-19 15:05:07 +02:00
await MathJax.typesetPromise();
document.getElementById("ex_div").hidden=false
2019-09-20 10:23:07 +02:00
var plotdat = [{
x: [],
y: [],
type: 'bar'
}];
var expdat= await data.loadAsync("/"+dat.molecule.toLowerCase()+"_exp.dat")
var i;
for (i = 0; i < dat.excitations.length; i++) {
var ext=dat.excitations[i];
var exexp=expdat.excitations[i]
plotdat[0].x.push(ext.end.toString())
plotdat[0].y.push(ext.Eabs-exexp.Eabs)
}
await MathJax.typesetPromise();
Plotly.newPlot('abs_plot', plotdat);
document.getElementById("graph_div").hidden=false
2019-09-03 15:38:17 +02:00
var lnkdoi = document.createElement("a");
2019-09-05 10:32:46 +02:00
// Wait for the value of publi when required
let publi=await publiPromise;
2019-09-03 15:38:17 +02:00
let output = publi.format('bibliography', {
format: 'html',
template: 'apa',
lang: 'en-US'
})
lnkdoi.innerHTML=output
lnkdoi.setAttribute('target','_blank');
lnkdoi.setAttribute('href',dat.doi.url);
par.appendChild(lnkdoi);
}
2019-08-21 20:04:29 +02:00
</script>
<script>
function onValueChange(e) {
2019-09-05 09:34:48 +02:00
update_file(e.target.value);
2019-08-22 10:34:07 +02:00
}
2019-08-21 20:04:29 +02:00
</script>
2019-08-22 10:34:07 +02:00
<label>Write a data file name without extension<br/>
<select id="fileSelect" onchange="onValueChange(event)">
<option value="" disabled=true selected=true>Select a file</option>
</select>
2019-08-22 10:34:07 +02:00
</label><br/>
2019-09-05 15:26:50 +02:00
<h1>Data</h1>
2019-09-19 15:05:07 +02:00
<p id=data_par>
<div id="meta_div"></div>
<div id="ex_div" hidden=true>
2019-09-20 09:48:28 +02:00
<h2>Excitation</h2>
2019-09-19 15:05:07 +02:00
<table id="ex_table">
2019-09-20 09:46:38 +02:00
<thead>
2019-09-19 15:05:07 +02:00
<th>Transition</th>
<th>\(E_{abs}\)</th>
<th>\(E_{fluo}\)</th>
<th>\(\Delta E_{ZPE}\)</th>
2019-09-19 18:54:23 +02:00
<th>\(E_{adia}\)</th>
2019-09-19 15:05:07 +02:00
<th>\(E_{00}\)</th>
2019-09-20 09:46:38 +02:00
</thead>
<tbody id="ex_table_b">
</tbody>
2019-09-19 15:05:07 +02:00
</table>
</div>
2019-09-20 10:23:07 +02:00
<div id="graph_div" hidden=true>
<h2>Absorbtion theory deviation</h2>
<div id="abs_plot">
</div>
</div>
2019-09-19 15:05:07 +02:00
</p>
<a target="_blank" id='lnk_file'>Go to file</a>