Aspect grid: row and column headers, so both points of a cell are visible
CI / test (push) Successful in 40s
CI / build (push) Successful in 3m39s
CI / deploy (push) Skipped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
feco
2026-11-17 09:58:21 +00:00
co-authored by Claude Opus 5.5
parent 90fd87ab4a
commit 7d961fd70b
2 changed files with 45 additions and 23 deletions
+2
View File
@@ -230,6 +230,8 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
}
.aspect-grid th { color: var(--ink); font-weight: 400; font-size: 17px; background: var(--panel-2); }
.aspect-grid .grid-angle { font: 600 11px var(--font-body); color: var(--gold); letter-spacing: 0.3px; }
.aspect-grid td.void, .aspect-grid td.corner { border: 0; background: none; }
.aspect-grid tbody td:not(.void):hover { background: var(--panel-2); }
.asp-conjunction { color: var(--gold); }
.asp-trine, .asp-sextile { color: var(--harmonic); }
.asp-square { color: var(--square); }
@@ -84,13 +84,37 @@ function AspectGrid({ chart }: { chart: Chart }) {
byPair.set(`${a.point2}|${a.point1}`, a);
}
const label = ([id, text]: [string, string]) => (
<span className={text.length > 2 ? "sym" : "grid-angle"} aria-label={pointName(id)} role="img">
{text}
</span>
);
// Lower triangle with both headers: rows from the 2nd point, columns up to the last but one.
const cols = rows.slice(0, -1);
return (
<div className="aspect-grid-wrap">
<table className="aspect-grid" aria-label="Fényszögmátrix">
<thead>
<tr>
<td className="corner" />
{cols.map((c) => (
<th key={c[0]} scope="col" title={pointName(c[0])}>
{label(c)}
</th>
))}
</tr>
</thead>
<tbody>
{rows.map(([id, label], i) => (
{rows.slice(1).map((row, r) => {
const [id] = row;
return (
<tr key={id}>
{rows.slice(0, i).map(([other]) => {
<th scope="row" title={pointName(id)}>
{label(row)}
</th>
{cols.map(([other], j) => {
if (j > r) return <td key={other} className="void" />;
const a = byPair.get(`${id}|${other}`);
const info = a ? ASPECTS[a.aspect] : undefined;
const text = a ? `${pointName(other)} ${info?.hu ?? a.aspect} ${pointName(id)}` : undefined;
@@ -104,13 +128,9 @@ function AspectGrid({ chart }: { chart: Chart }) {
</td>
);
})}
<th scope="row" title={pointName(id)}>
<span className={label.length > 2 ? "sym" : "grid-angle"} aria-label={pointName(id)} role="img">
{label}
</span>
</th>
</tr>
))}
);
})}
</tbody>
</table>
</div>