Chart wheel: readable aspect lines
- only the major aspects between the ten planets, ASC and MC (the rest stays in the aspect table) - one style per aspect: trine blue, sextile blue dashed, square orange, opposition red; width and opacity by orb, tight aspects on top - line ends at the spread-out glyph angles, so neighbouring planets' lines no longer meet in one point - hovering or focusing a planet shows only its aspects (CSS :has) - shared legend, also on the example page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -15,6 +15,7 @@
|
|||||||
--ok: #9fd8b0;
|
--ok: #9fd8b0;
|
||||||
--harmonic: #7fb0e0;
|
--harmonic: #7fb0e0;
|
||||||
--tense: #e38b8b;
|
--tense: #e38b8b;
|
||||||
|
--square: #f0a35e;
|
||||||
--radius: 10px;
|
--radius: 10px;
|
||||||
--font-display: var(--font-cormorant), "Cormorant Garamond", Georgia, serif;
|
--font-display: var(--font-cormorant), "Cormorant Garamond", Georgia, serif;
|
||||||
--font-body: var(--font-inter), Inter, system-ui, sans-serif;
|
--font-body: var(--font-inter), Inter, system-ui, sans-serif;
|
||||||
@@ -195,10 +196,14 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|||||||
.chart-wheel-card { padding: 16px; gap: 10px; }
|
.chart-wheel-card { padding: 16px; gap: 10px; }
|
||||||
.chart-wheel { width: 100%; height: auto; display: block; max-width: 680px; margin: 0 auto; }
|
.chart-wheel { width: 100%; height: auto; display: block; max-width: 680px; margin: 0 auto; }
|
||||||
.chart-layout .big3 { grid-template-columns: 1fr; }
|
.chart-layout .big3 { grid-template-columns: 1fr; }
|
||||||
.wheel-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; justify-content: center; }
|
.wheel-legend { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
|
||||||
.legend-line { display: inline-block; width: 22px; height: 2px; border-radius: 1px; margin-left: 6px; }
|
.wheel-legend-items { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
|
||||||
.legend-harmonic { background: var(--harmonic); }
|
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
|
||||||
.legend-tense { background: var(--tense); }
|
.legend-line { display: inline-block; width: 24px; height: 2px; border-radius: 1px; }
|
||||||
|
.legend-trine { background: var(--harmonic); }
|
||||||
|
.legend-sextile { background: repeating-linear-gradient(90deg, var(--harmonic) 0 5px, transparent 5px 9px); }
|
||||||
|
.legend-square { background: var(--square); }
|
||||||
|
.legend-opposition { background: var(--tense); }
|
||||||
.aspect-tag { white-space: nowrap; }
|
.aspect-tag { white-space: nowrap; }
|
||||||
.aspect-harmonic { color: var(--harmonic); }
|
.aspect-harmonic { color: var(--harmonic); }
|
||||||
.aspect-tense { color: var(--tense); }
|
.aspect-tense { color: var(--tense); }
|
||||||
@@ -219,9 +224,13 @@ td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|||||||
.w-axis-label { fill: var(--gold); font: 600 14px var(--font-body); letter-spacing: 0.5px; }
|
.w-axis-label { fill: var(--gold); font: 600 14px var(--font-body); letter-spacing: 0.5px; }
|
||||||
.w-house-num { fill: var(--muted); font: 500 12px var(--font-body); }
|
.w-house-num { fill: var(--muted); font: 500 12px var(--font-body); }
|
||||||
.w-aspect { stroke-linecap: round; }
|
.w-aspect { stroke-linecap: round; }
|
||||||
.w-harmonic { stroke: var(--harmonic); }
|
.w-aspect { transition: stroke-opacity 0.15s; }
|
||||||
.w-tense { stroke: var(--tense); }
|
.w-asp-trine { stroke: var(--harmonic); }
|
||||||
.w-neutral { stroke: var(--gold); }
|
.w-asp-sextile { stroke: var(--harmonic); stroke-dasharray: 5 4; }
|
||||||
|
.w-asp-square { stroke: var(--square); }
|
||||||
|
.w-asp-opposition { stroke: var(--tense); }
|
||||||
|
.w-point { outline: none; cursor: default; }
|
||||||
|
.w-point:focus-visible .w-point-glyph { fill: var(--gold); }
|
||||||
.w-point-tick { stroke: var(--ink); stroke-width: 1.6; }
|
.w-point-tick { stroke: var(--ink); stroke-width: 1.6; }
|
||||||
.w-leader { stroke: var(--muted); stroke-width: 0.7; stroke-opacity: 0.6; }
|
.w-leader { stroke: var(--muted); stroke-width: 0.7; stroke-opacity: 0.6; }
|
||||||
.w-point-glyph { fill: var(--ink); font-family: var(--font-symbols); font-size: 22px; }
|
.w-point-glyph { fill: var(--ink); font-family: var(--font-symbols); font-size: 22px; }
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { notFound } from "next/navigation";
|
|||||||
import { BigThree, ChartTables } from "@/components/ChartTables";
|
import { BigThree, ChartTables } from "@/components/ChartTables";
|
||||||
import { ChartSummary } from "@/components/ChartSummary";
|
import { ChartSummary } from "@/components/ChartSummary";
|
||||||
import { DetailedAnalysis } from "@/components/DetailedAnalysis";
|
import { DetailedAnalysis } from "@/components/DetailedAnalysis";
|
||||||
import { ChartWheel } from "@/components/ChartWheel";
|
import { ChartWheel, WheelLegend } from "@/components/ChartWheel";
|
||||||
import { ELEMENTS, MODALITIES, MOON_PHASES, countryName, formatBirthDate, pointName } from "@/lib/astro";
|
import { ELEMENTS, MODALITIES, MOON_PHASES, countryName, formatBirthDate, pointName } from "@/lib/astro";
|
||||||
import { backendGet, requireMe } from "@/lib/server";
|
import { backendGet, requireMe } from "@/lib/server";
|
||||||
import type { Analysis, Chart } from "@/lib/types";
|
import type { Analysis, Chart } from "@/lib/types";
|
||||||
@@ -59,10 +59,7 @@ export default async function ChartPage({ params }: { params: Promise<{ id: stri
|
|||||||
<section className="chart-layout" aria-label="Képletrajz">
|
<section className="chart-layout" aria-label="Képletrajz">
|
||||||
<div className="card chart-wheel-card">
|
<div className="card chart-wheel-card">
|
||||||
<ChartWheel chart={result} timeKnown={timeKnown} />
|
<ChartWheel chart={result} timeKnown={timeKnown} />
|
||||||
<p className="hint wheel-legend">
|
<WheelLegend />
|
||||||
<span className="legend-line legend-harmonic" aria-hidden="true" /> harmonikus (trigon, szextil)
|
|
||||||
<span className="legend-line legend-tense" aria-hidden="true" /> feszült (kvadrát, szembenállás)
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
<div className="field" style={{ gap: 16 }}>
|
<div className="field" style={{ gap: 16 }}>
|
||||||
<ChartSummary chartId={chart.id} initial={summary} />
|
<ChartSummary chartId={chart.id} initial={summary} />
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import type { Metadata } from "next";
|
|||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
|
|
||||||
import { AnalysisView } from "@/components/AnalysisView";
|
import { AnalysisView } from "@/components/AnalysisView";
|
||||||
import { ChartWheel } from "@/components/ChartWheel";
|
import { ChartWheel, WheelLegend } from "@/components/ChartWheel";
|
||||||
import { Rich } from "@/components/Rich";
|
import { Rich } from "@/components/Rich";
|
||||||
import { Logo } from "@/components/SiteHeader";
|
import { Logo } from "@/components/SiteHeader";
|
||||||
import example from "@/content/pelda.json";
|
import example from "@/content/pelda.json";
|
||||||
@@ -38,6 +38,7 @@ export default async function ExamplePage() {
|
|||||||
<section className="chart-layout" aria-label="A példa képlete">
|
<section className="chart-layout" aria-label="A példa képlete">
|
||||||
<div className="card chart-wheel-card">
|
<div className="card chart-wheel-card">
|
||||||
<ChartWheel chart={chart} timeKnown />
|
<ChartWheel chart={chart} timeKnown />
|
||||||
|
<WheelLegend />
|
||||||
</div>
|
</div>
|
||||||
<div className="field" style={{ gap: 16 }}>
|
<div className="field" style={{ gap: 16 }}>
|
||||||
<section className="card summary-card" aria-labelledby="example-summary">
|
<section className="card summary-card" aria-labelledby="example-summary">
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ const WHEEL_POINTS = [
|
|||||||
"lilith",
|
"lilith",
|
||||||
"chiron",
|
"chiron",
|
||||||
];
|
];
|
||||||
|
// Aspects drawn on the wheel, between these points; the rest (minor aspects,
|
||||||
|
// nodes, Lilith, Chiron) are only in the aspect table.
|
||||||
|
const WHEEL_ASPECTS = ["opposition", "square", "trine", "sextile"];
|
||||||
|
const ASPECT_POINTS = ["sun", "moon", "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto"];
|
||||||
const SIGN_ORDER = Object.keys(SIGNS);
|
const SIGN_ORDER = Object.keys(SIGNS);
|
||||||
const SIGN_ELEMENT = ["fire", "earth", "air", "water"];
|
const SIGN_ELEMENT = ["fire", "earth", "air", "water"];
|
||||||
const ANGLE_LABELS: [string, string][] = [
|
const ANGLE_LABELS: [string, string][] = [
|
||||||
@@ -94,17 +98,31 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
9,
|
9,
|
||||||
);
|
);
|
||||||
|
|
||||||
// Longitudes for the aspect line ends (planets and, with a known time, the angles).
|
// Aspect line ends: the planets at their spread-out glyph angle (so lines of
|
||||||
const ends = new Map<string, number>(points.map((p) => [p.id, p.longitude]));
|
// neighbouring planets do not run into one point) and, with a known time,
|
||||||
|
// the ascendant and the midheaven.
|
||||||
|
const ends = new Map<string, number>();
|
||||||
|
points.forEach((p, i) => {
|
||||||
|
if (ASPECT_POINTS.includes(p.id)) ends.set(p.id, placed[i]);
|
||||||
|
});
|
||||||
if (timeKnown) {
|
if (timeKnown) {
|
||||||
for (const [key] of ANGLE_LABELS) {
|
for (const key of ["ascendant", "midheaven"]) {
|
||||||
const a = angle(key);
|
const a = angle(key);
|
||||||
if (a) ends.set(key, a.longitude);
|
if (a) ends.set(key, a.longitude);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const aspects = (chart.aspects ?? []).filter(
|
// Only the major aspects; tight ones are drawn last (on top).
|
||||||
(a) => a.aspect !== "conjunction" && ends.has(a.point1) && ends.has(a.point2),
|
const aspects = (chart.aspects ?? [])
|
||||||
);
|
.filter((a) => WHEEL_ASPECTS.includes(a.aspect) && ends.has(a.point1) && ends.has(a.point2))
|
||||||
|
.map((a) => ({ ...a, strength: a.max_orb > 0 ? 1 - Math.min(a.orb / a.max_orb, 1) : 0.5 }))
|
||||||
|
.sort((x, y) => x.strength - y.strength);
|
||||||
|
// Hovering or focusing a point shows only its aspects.
|
||||||
|
const highlight = [...ends.keys()]
|
||||||
|
.map((id) => {
|
||||||
|
const on = `.chart-wheel:has(.p-${id}:hover, .p-${id}:focus-visible)`;
|
||||||
|
return `${on} .w-aspect:not(.a-${id}){stroke-opacity:0.06}${on} .w-aspect.a-${id}{stroke-opacity:1}`;
|
||||||
|
})
|
||||||
|
.join("\n");
|
||||||
|
|
||||||
const description = points
|
const description = points
|
||||||
.map((p) => `${pointName(p.id)} ${signName(p.sign)} ${dms(p.degree_in_sign_dms)}`)
|
.map((p) => `${pointName(p.id)} ${signName(p.sign)} ${dms(p.degree_in_sign_dms)}`)
|
||||||
@@ -170,7 +188,14 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
if (!a) return null;
|
if (!a) return null;
|
||||||
const [x, y] = xy(a.longitude, R_LABEL, start);
|
const [x, y] = xy(a.longitude, R_LABEL, start);
|
||||||
return (
|
return (
|
||||||
<text key={key} x={f(x)} y={f(y)} className="w-axis-label" dominantBaseline="central" textAnchor="middle">
|
<text
|
||||||
|
key={key}
|
||||||
|
x={f(x)}
|
||||||
|
y={f(y)}
|
||||||
|
className={`w-axis-label p-${key}`}
|
||||||
|
dominantBaseline="central"
|
||||||
|
textAnchor="middle"
|
||||||
|
>
|
||||||
<title>
|
<title>
|
||||||
{pointName(key)}: {dms(a.degree_in_sign_dms)} {signName(a.sign)}
|
{pointName(key)}: {dms(a.degree_in_sign_dms)} {signName(a.sign)}
|
||||||
</title>
|
</title>
|
||||||
@@ -182,12 +207,12 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{/* Aspects */}
|
{/* Aspects */}
|
||||||
|
<style>{highlight}</style>
|
||||||
<circle cx={C} cy={C} r={R_INNER} className="w-ring w-inner" />
|
<circle cx={C} cy={C} r={R_INNER} className="w-ring w-inner" />
|
||||||
{aspects.map((a) => {
|
{aspects.map((a) => {
|
||||||
const [x1, y1] = xy(ends.get(a.point1)!, R_INNER, start);
|
const [x1, y1] = xy(ends.get(a.point1)!, R_INNER, start);
|
||||||
const [x2, y2] = xy(ends.get(a.point2)!, R_INNER, start);
|
const [x2, y2] = xy(ends.get(a.point2)!, R_INNER, start);
|
||||||
const kind = ASPECTS[a.aspect]?.kind ?? "neutral";
|
const s = a.strength;
|
||||||
const strength = a.max_orb > 0 ? 1 - Math.min(a.orb / a.max_orb, 1) : 0.5;
|
|
||||||
return (
|
return (
|
||||||
<line
|
<line
|
||||||
key={`${a.point1}-${a.point2}-${a.aspect}`}
|
key={`${a.point1}-${a.point2}-${a.aspect}`}
|
||||||
@@ -195,9 +220,9 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
y1={f(y1)}
|
y1={f(y1)}
|
||||||
x2={f(x2)}
|
x2={f(x2)}
|
||||||
y2={f(y2)}
|
y2={f(y2)}
|
||||||
className={`w-aspect w-${kind}`}
|
className={`w-aspect w-asp-${a.aspect} a-${a.point1} a-${a.point2}`}
|
||||||
strokeOpacity={(0.3 + 0.7 * strength).toFixed(2)}
|
strokeOpacity={(0.2 + 0.8 * s * s).toFixed(2)}
|
||||||
strokeWidth={(0.8 + 1.4 * strength).toFixed(2)}
|
strokeWidth={(0.6 + 1.9 * s).toFixed(2)}
|
||||||
>
|
>
|
||||||
<title>
|
<title>
|
||||||
{pointName(a.point1)} {ASPECTS[a.aspect]?.hu ?? a.aspect} {pointName(a.point2)} (orbis{" "}
|
{pointName(a.point1)} {ASPECTS[a.aspect]?.hu ?? a.aspect} {pointName(a.point2)} (orbis{" "}
|
||||||
@@ -214,10 +239,10 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
const [lx, ly] = xy(placed[i], R_GLYPH + 14, start);
|
const [lx, ly] = xy(placed[i], R_GLYPH + 14, start);
|
||||||
const [gx, gy] = xy(placed[i], R_GLYPH, start);
|
const [gx, gy] = xy(placed[i], R_GLYPH, start);
|
||||||
const [dx, dy] = xy(placed[i], R_DEG, start);
|
const [dx, dy] = xy(placed[i], R_DEG, start);
|
||||||
const [ex, ey] = xy(p.longitude, R_INNER, start);
|
const [ex, ey] = xy(placed[i], R_INNER, start);
|
||||||
const deg = Number.parseInt(p.degree_in_sign_dms, 10);
|
const deg = Number.parseInt(p.degree_in_sign_dms, 10);
|
||||||
return (
|
return (
|
||||||
<g key={p.id} className="w-point">
|
<g key={p.id} className={`w-point p-${p.id}`} tabIndex={0}>
|
||||||
<title>
|
<title>
|
||||||
{pointName(p.id)}: {dms(p.degree_in_sign_dms)} {signName(p.sign)}
|
{pointName(p.id)}: {dms(p.degree_in_sign_dms)} {signName(p.sign)}
|
||||||
{p.retrograde ? ", retrográd" : ""}
|
{p.retrograde ? ", retrográd" : ""}
|
||||||
@@ -231,10 +256,34 @@ export function ChartWheel({ chart, timeKnown }: { chart: ChartResult; timeKnown
|
|||||||
<text x={f(dx)} y={f(dy)} className="w-point-deg" dominantBaseline="central" textAnchor="middle">
|
<text x={f(dx)} y={f(dy)} className="w-point-deg" dominantBaseline="central" textAnchor="middle">
|
||||||
{deg}°{p.retrograde ? "℞" : ""}
|
{deg}°{p.retrograde ? "℞" : ""}
|
||||||
</text>
|
</text>
|
||||||
<circle cx={f(ex)} cy={f(ey)} r={2.2} className="w-end" />
|
{ends.has(p.id) && <circle cx={f(ex)} cy={f(ey)} r={2.2} className="w-end" />}
|
||||||
</g>
|
</g>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const LEGEND: [string, string][] = [
|
||||||
|
["trine", "trigon"],
|
||||||
|
["sextile", "szextil"],
|
||||||
|
["square", "kvadrát"],
|
||||||
|
["opposition", "szembenállás"],
|
||||||
|
];
|
||||||
|
|
||||||
|
/** Key to the aspect lines of the wheel. */
|
||||||
|
export function WheelLegend() {
|
||||||
|
return (
|
||||||
|
<div className="hint wheel-legend">
|
||||||
|
<p className="wheel-legend-items">
|
||||||
|
{LEGEND.map(([aspect, label]) => (
|
||||||
|
<span key={aspect} className="legend-item">
|
||||||
|
<span className={`legend-line legend-${aspect}`} aria-hidden="true" /> {label}
|
||||||
|
</span>
|
||||||
|
))}
|
||||||
|
</p>
|
||||||
|
<p>Vastagabb vonal: szorosabb fényszög. Egy bolygóra mutatva csak az ő fényszögei látszanak.</p>
|
||||||
|
<p>A körön a bolygók, az ASC és az MC főfényszögei vannak; az összes fényszög a táblázatban.</p>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user