pca.astro (932B)
1 --- 2 import Base from "../layouts/Base.astro"; 3 import PCAPlot from "../components/PCAPlot"; 4 import fs from "node:fs"; 5 import path from "node:path"; 6 7 const pcaPath = path.resolve(process.cwd(), "../results/analysis/pca.json"); 8 let pcaData = null; 9 if (fs.existsSync(pcaPath)) { 10 pcaData = JSON.parse(fs.readFileSync(pcaPath, "utf-8")); 11 } 12 --- 13 14 <Base title="PCA"> 15 <h1 style="margin-bottom: 8px;">Principal Component Analysis</h1> 16 <p style="color: var(--text-muted); margin-bottom: 24px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;"> 17 Dimensionality reduction of the configuration space. Which axes drive the most variance? 18 </p> 19 20 {pcaData ? ( 21 <PCAPlot client:only="react" data={pcaData} /> 22 ) : ( 23 <div class="card" style="text-align: center; padding: 40px; color: var(--text-muted);"> 24 No PCA data yet. Run <code>python3 harness/pca-analysis.py</code> to generate. 25 </div> 26 )} 27 </Base>