10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-26 06:14:38 +01:00

end multipledataset

This commit is contained in:
Mickaël Véril 2019-09-28 15:08:56 +02:00
parent 2242643b9f
commit bbd993bd1c

View File

@ -14,7 +14,7 @@ draft: false
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<script> <script>
window.onload= async ()=>{ window.onload= async ()=>{
$('#dtypeform input[type=radio]').on('change', async function(event) { $('#form input[type=radio]').on('change', async function(event) {
var result = $(this).val(); var result = $(this).val();
var files=[]; var files=[];
switch (result) { switch (result) {
@ -34,9 +34,9 @@ draft: false
}) })
} }
function reloadSelect(){ function reloadSelect(){
$('#dat_table > thead > tr > th > select').each(function(){ $('#form > select').each(function(){
$(this).find('option[value!=""]').remove() $(this).find('option[value!=""]').remove()
const vals=new Set(window.dats.map((d)=>{return d[$(this).data("prop")]})) const vals=new Set(window.dats.map((d)=>{return d[$(this).attr("name")]}))
for (const val of vals){ for (const val of vals){
op=document.createElement("option") op=document.createElement("option")
op.value=val op.value=val
@ -49,7 +49,7 @@ draft: false
var filt=window.dats var filt=window.dats
$('#dat_table > thead > tr > th > select').each(function(){ $('#dat_table > thead > tr > th > select').each(function(){
const prop=$(this).data("prop") const prop=$(this).data("prop")
const value=$(this).attr("value") const value=$(this).val()
filt=filt.filter((d)=>{ filt=filt.filter((d)=>{
if(value==""){ if(value==""){
return true return true
@ -59,16 +59,15 @@ draft: false
} }
}) })
}) })
var tb=document.getElementById("ex_table_b"); var tb=document.getElementById("table_b");
tb.innerHTML='' tb.innerHTML=''
for (const el of filt) { for (const d of filt) {
var row=document.createElement("tr") var row=document.createElement("tr")
var rowd=[] var rowd=[]
var e=[d.Molecule,d.Comment,d.Code,d.DOI] var e=[d.molecule,d.comment,d.code,d.method,d.DOI]
e.forEach((val)=>rowd.push(noNanPrecision(val,3))) for(el of e){
for(d of rowd) {
td=document.createElement("td") td=document.createElement("td")
td.innerText=d td.innerText=el
row.appendChild(td) row.appendChild(td)
} }
tb.appendChild(row) tb.appendChild(row)
@ -76,36 +75,43 @@ draft: false
} }
</script> </script>
{{< getDataFilesName >}} {{< getDataFilesName >}}
<form id="dtypeform" action="" method="post"> <form id="form" action="" method="post">
<legend>Data type</legend> <legend>Data type</legend>
<input type="radio" id="abs" value="abs" name="datatype"> <input type="radio" id="abs" value="abs" name="datatype">
<label for="abs">Absorption</label> <label for="abs">Absorption</label>
<input type="radio" id="fluo" value="fluo" name="datatype"> <input type="radio" id="fluo" value="fluo" name="datatype">
<label for="Fluorescence">Fluorescence</label> <label for="fluo">Fluorescence</label>
<input type="radio" id="zpe" value="zpe" name="datatype"> <input type="radio" id="zpe" value="zpe" name="datatype">
<label for="Fluorescence">\(\Delta \text{ZPE}\)</label> <label for="zpe">\(\Delta \text{ZPE}\)</label>
<br/>
<select id="mol_select" onchange="reloadContent()" name="molecule">
<option value="">All</option>
</select>
<label for="mol_select">Molecule</label>
<select id="code_select" onchange="reloadContent()" name="code">
<option value="">All</option>
</select>
<label for="code_select">Code</label>
<select id="method_select" onchange="reloadContent()" name="method">
<option value="">All</option>
</select>
<label for="method_select">Method</label>
<select id="DOI_select" onchange="reloadContent()" name="DOI">
<option value="">All</option>
</select>
<label for="DOI_select">DOI</label>
</form> </form>
<br/>
<div id="data_div"> <div id="data_div">
<table id="dat_table"> <table id="dat_table">
<thead> <thead>
<th>Molecule : <th>Molecule</th>
<select id="mol_select" onchange="reloadContent()" data-prop="molecule">
<option value="">All</option>
</select>
</th>
<th>Comment</th> <th>Comment</th>
<th>Code : <th>Code</th>
<select id="code_select" onchange="reloadContent()" data-prop="code"> <th>Method</th>
<option value="">All</option> <th>DOI</th>
</select>
</th>
<th>DOI :
<select id="DOI_select" onchange="reloadContent()" data-prop="DOI">
<option value="">All</option>
</select>
</th>
</thead> </thead>
<tbody id="ex_table_b"> <tbody id="table_b">
</tbody> </tbody>
</table> </table>
</div> </div>