mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2025-01-12 14:08:28 +01:00
Use Plotly to plot Graph
This commit is contained in:
parent
d0fd7a8777
commit
7114a4a7a2
@ -11,6 +11,7 @@ draft: false
|
|||||||
<script type="text/javascript" id="MathJax-script" async
|
<script type="text/javascript" id="MathJax-script" async
|
||||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
|
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
|
||||||
</script>
|
</script>
|
||||||
|
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
||||||
{{< getDataFilesName >}}
|
{{< getDataFilesName >}}
|
||||||
<script>
|
<script>
|
||||||
window.onload=function()
|
window.onload=function()
|
||||||
@ -83,6 +84,22 @@ draft: false
|
|||||||
});
|
});
|
||||||
await MathJax.typesetPromise();
|
await MathJax.typesetPromise();
|
||||||
document.getElementById("ex_div").hidden=false
|
document.getElementById("ex_div").hidden=false
|
||||||
|
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
|
||||||
var lnkdoi = document.createElement("a");
|
var lnkdoi = document.createElement("a");
|
||||||
// Wait for the value of publi when required
|
// Wait for the value of publi when required
|
||||||
let publi=await publiPromise;
|
let publi=await publiPromise;
|
||||||
@ -127,5 +144,10 @@ draft: false
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="graph_div" hidden=true>
|
||||||
|
<h2>Absorbtion theory deviation</h2>
|
||||||
|
<div id="abs_plot">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<a target="_blank" id='lnk_file'>Go to file</a>
|
<a target="_blank" id='lnk_file'>Go to file</a>
|
Loading…
Reference in New Issue
Block a user