Chart page with a drawn wheel; reuse saved charts for identical birth data

- New /kepletek/[id] page: chart wheel (SVG), big three, elements,
  modalities, moon phase, positions and an aspects table. /keplet opens
  the user's own chart; the home page goes there after login.
- The profile only shows the birth data, with a link to the chart.
- Saving the same birth data again returns the stored chart (200)
  instead of calculating a new one.
- Charts without a birth time (angles null) render without houses.

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-16 06:37:59 +00:00
co-authored by Claude Opus 5.5
parent 1f177f859e
commit e789e5a981
15 changed files with 675 additions and 93 deletions
+72 -31
View File
@@ -1,39 +1,40 @@
// Hungarian names and glyphs for the chart tables.
// Hungarian names and glyphs for the chart pages.
// Glyphs end in U+FE0E so phones show them as text, not as emoji.
export const SIGNS: Record<string, { hu: string; glyph: string }> = {
aries: { hu: "Kos", glyph: "♈" },
taurus: { hu: "Bika", glyph: "♉" },
gemini: { hu: "Ikrek", glyph: "♊" },
cancer: { hu: "Rák", glyph: "♋" },
leo: { hu: "Oroszlán", glyph: "♌" },
virgo: { hu: "Szűz", glyph: "♍" },
libra: { hu: "Mérleg", glyph: "♎" },
scorpio: { hu: "Skorpió", glyph: "♏" },
sagittarius: { hu: "Nyilas", glyph: "♐" },
capricorn: { hu: "Bak", glyph: "♑" },
aquarius: { hu: "Vízöntő", glyph: "♒" },
pisces: { hu: "Halak", glyph: "♓" },
aries: { hu: "Kos", glyph: "♈\uFE0E" },
taurus: { hu: "Bika", glyph: "♉\uFE0E" },
gemini: { hu: "Ikrek", glyph: "♊\uFE0E" },
cancer: { hu: "Rák", glyph: "♋\uFE0E" },
leo: { hu: "Oroszlán", glyph: "♌\uFE0E" },
virgo: { hu: "Szűz", glyph: "♍\uFE0E" },
libra: { hu: "Mérleg", glyph: "♎\uFE0E" },
scorpio: { hu: "Skorpió", glyph: "♏\uFE0E" },
sagittarius: { hu: "Nyilas", glyph: "♐\uFE0E" },
capricorn: { hu: "Bak", glyph: "♑\uFE0E" },
aquarius: { hu: "Vízöntő", glyph: "♒\uFE0E" },
pisces: { hu: "Halak", glyph: "♓\uFE0E" },
};
export const POINTS: Record<string, { hu: string; glyph: string }> = {
sun: { hu: "Nap", glyph: "☉" },
moon: { hu: "Hold", glyph: "☽" },
mercury: { hu: "Merkúr", glyph: "☿" },
venus: { hu: "Vénusz", glyph: "♀" },
mars: { hu: "Mars", glyph: "♂" },
jupiter: { hu: "Jupiter", glyph: "♃" },
saturn: { hu: "Szaturnusz", glyph: "♄" },
uranus: { hu: "Uránusz", glyph: "♅" },
neptune: { hu: "Neptunusz", glyph: "♆" },
pluto: { hu: "Plútó", glyph: "♇" },
north_node: { hu: "Észak-Holdcsomópont", glyph: "☊" },
south_node: { hu: "Dél-Holdcsomópont", glyph: "☋" },
lilith: { hu: "Lilith", glyph: "⚸" },
chiron: { hu: "Kiron", glyph: "⚷" },
ceres: { hu: "Ceres", glyph: "⚳" },
pallas: { hu: "Pallas", glyph: "⚴" },
juno: { hu: "Juno", glyph: "⚵" },
vesta: { hu: "Vesta", glyph: "⚶" },
sun: { hu: "Nap", glyph: "☉\uFE0E" },
moon: { hu: "Hold", glyph: "☽\uFE0E" },
mercury: { hu: "Merkúr", glyph: "☿\uFE0E" },
venus: { hu: "Vénusz", glyph: "♀\uFE0E" },
mars: { hu: "Mars", glyph: "♂\uFE0E" },
jupiter: { hu: "Jupiter", glyph: "♃\uFE0E" },
saturn: { hu: "Szaturnusz", glyph: "♄\uFE0E" },
uranus: { hu: "Uránusz", glyph: "♅\uFE0E" },
neptune: { hu: "Neptunusz", glyph: "♆\uFE0E" },
pluto: { hu: "Plútó", glyph: "♇\uFE0E" },
north_node: { hu: "Észak-Holdcsomópont", glyph: "☊\uFE0E" },
south_node: { hu: "Dél-Holdcsomópont", glyph: "☋\uFE0E" },
lilith: { hu: "Lilith", glyph: "⚸\uFE0E" },
chiron: { hu: "Kiron", glyph: "⚷\uFE0E" },
ceres: { hu: "Ceres", glyph: "⚳\uFE0E" },
pallas: { hu: "Pallas", glyph: "⚴\uFE0E" },
juno: { hu: "Juno", glyph: "⚵\uFE0E" },
vesta: { hu: "Vesta", glyph: "⚶\uFE0E" },
};
export const ANGLES: [string, string][] = [
@@ -90,3 +91,43 @@ export function formatBirthDate(date: string): string {
new Date(Date.UTC(y, m - 1, d)),
);
}
export const ASPECTS: Record<string, { hu: string; glyph: string; kind: "harmonic" | "tense" | "neutral" }> = {
conjunction: { hu: "együttállás", glyph: "☌", kind: "neutral" },
opposition: { hu: "szembenállás", glyph: "☍", kind: "tense" },
trine: { hu: "trigon", glyph: "△", kind: "harmonic" },
square: { hu: "kvadrát", glyph: "□", kind: "tense" },
sextile: { hu: "szextil", glyph: "⚹", kind: "harmonic" },
quincunx: { hu: "kvinkunx", glyph: "⚻", kind: "tense" },
semisextile: { hu: "félszextil", glyph: "⚺", kind: "harmonic" },
semisquare: { hu: "félkvadrát", glyph: "∠", kind: "tense" },
sesquiquadrate: { hu: "másfélkvadrát", glyph: "⚼", kind: "tense" },
quintile: { hu: "kvintil", glyph: "Q", kind: "harmonic" },
biquintile: { hu: "bikvintil", glyph: "bQ", kind: "harmonic" },
};
export const ELEMENTS: Record<string, string> = { fire: "Tűz", earth: "Föld", air: "Levegő", water: "Víz" };
export const MODALITIES: Record<string, string> = { cardinal: "Kardinális", fixed: "Fix", mutable: "Változó" };
export const MOON_PHASES: Record<string, string> = {
new_moon: "Újhold",
waxing_crescent: "Növő holdsarló",
first_quarter: "Első negyed",
waxing_gibbous: "Növő hold",
full_moon: "Telihold",
waning_gibbous: "Fogyó hold",
last_quarter: "Utolsó negyed",
waning_crescent: "Fogyó holdsarló",
};
/** Name of a point or angle for labels (`midheaven` → `MC`). */
export function pointName(id: string): string {
return POINTS[id]?.hu ?? ANGLES.find(([k]) => k === id)?.[1] ?? id;
}
/** Orb in degrees and minutes: `2.25` → `2°15′`. */
export function orbText(orb: number): string {
const d = Math.floor(orb);
const m = Math.round((orb - d) * 60);
return m === 60 ? `${d + 1}°00′` : `${d}°${String(m).padStart(2, "0")}′`;
}
+17 -1
View File
@@ -29,6 +29,7 @@ export interface PublicConfig {
}
export interface Position {
longitude: number;
sign: string;
degree_in_sign_dms: string;
house?: number | null;
@@ -37,13 +38,28 @@ export interface Position {
export interface ChartPoint extends Position {
id: string;
kind?: string;
}
export interface Aspect {
point1: string;
point2: string;
aspect: string;
orb: number;
max_orb: number;
applying?: boolean | null;
}
type Groups = Record<string, { count: number; points: string[] }>;
export interface ChartResult {
points: ChartPoint[];
angles: Record<string, Position | number>;
angles: Record<string, Position | number> | null;
houses?: { cusps: (Position & { house: number })[] } | null;
lots?: Record<string, Position> | null;
aspects?: Aspect[];
summary?: { elements?: Groups; modalities?: Groups } | null;
moon_phase?: { phase: string; illumination: number; waxing: boolean } | null;
time: { time_known: boolean; local: string; zone: string; utc_offset: string; dst: boolean };
location: { place?: { name: string; region?: string | null; country_code: string } | null; latitude: number; longitude: number };
}