Download frontend/src/components/MacroCorrelations.jsx from bhuvi3/CIOAgent: direct link, hf CLI and curl.
- Browser
- Download file 1.74 kB
-
https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/MacroCorrelations.jsx
- Command line
-
hf download hf://spaces/bhuvi3/CIOAgent/frontend/src/components/MacroCorrelations.jsx
-
curl -L -o MacroCorrelations.jsx https://huggingface.co/spaces/bhuvi3/CIOAgent/resolve/main/frontend/src/components/MacroCorrelations.jsx
1.74 kB
| import React from "react"; | |
| export default function MacroCorrelations({ data }) { | |
| if (!data || !data.correlations) return null; | |
| return ( | |
| <div className="section"> | |
| <h2>Macro Indicator Correlations</h2> | |
| <p className="caption">Portfolio sensitivity to major economic indicators.</p> | |
| <table className="data-table"> | |
| <thead> | |
| <tr> | |
| <th>Indicator</th> | |
| <th>Correlation</th> | |
| <th>Rolling (60d)</th> | |
| <th>Interpretation</th> | |
| </tr> | |
| </thead> | |
| <tbody> | |
| {data.correlations.map((c, i) => { | |
| const absCorr = Math.abs(c.correlation); | |
| const color = absCorr > 0.5 ? "var(--warning)" : absCorr > 0.3 ? "var(--info)" : "var(--text-muted)"; | |
| return ( | |
| <tr key={i}> | |
| <td><strong>{c.indicator}</strong></td> | |
| <td> | |
| <span style={{ color, fontWeight: 600 }}> | |
| {c.correlation > 0 ? "+" : ""}{c.correlation.toFixed(3)} | |
| </span> | |
| <div style={{ background: "var(--surface-2)", borderRadius: 3, height: 4, marginTop: 4 }}> | |
| <div style={{ | |
| width: `${absCorr * 100}%`, | |
| height: "100%", | |
| borderRadius: 3, | |
| background: c.correlation > 0 ? "var(--success)" : "var(--error)", | |
| }} /> | |
| </div> | |
| </td> | |
| <td>{c.rolling_current != null ? c.rolling_current.toFixed(3) : "—"}</td> | |
| <td className="caption">{c.interpretation}</td> | |
| </tr> | |
| ); | |
| })} | |
| </tbody> | |
| </table> | |
| </div> | |
| ); | |
| } | |