@roxyapi/ui 0.2.3 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +216 -38
- package/README.md +200 -24
- package/dist/cdn/components/compatibility-card.js.map +1 -1
- package/dist/cdn/components/dasha-timeline.js +8 -8
- package/dist/cdn/components/dasha-timeline.js.map +2 -2
- package/dist/cdn/components/divisional-chart.js +35 -23
- package/dist/cdn/components/divisional-chart.js.map +4 -4
- package/dist/cdn/components/guna-milan.js.map +1 -1
- package/dist/cdn/components/kp-chart.js +306 -0
- package/dist/cdn/components/kp-chart.js.map +7 -0
- package/dist/cdn/components/kp-planets-table.js.map +1 -1
- package/dist/cdn/components/kp-ruling-planets.js +269 -0
- package/dist/cdn/components/kp-ruling-planets.js.map +7 -0
- package/dist/cdn/components/location-search.js +7 -5
- package/dist/cdn/components/location-search.js.map +3 -3
- package/dist/cdn/components/moon-phase.js.map +1 -1
- package/dist/cdn/components/nakshatra-card.js +229 -0
- package/dist/cdn/components/nakshatra-card.js.map +7 -0
- package/dist/cdn/components/natal-chart.js +228 -115
- package/dist/cdn/components/natal-chart.js.map +4 -4
- package/dist/cdn/components/numerology-card.js +3 -3
- package/dist/cdn/components/numerology-card.js.map +2 -2
- package/dist/cdn/components/panchang-table.js.map +1 -1
- package/dist/cdn/components/shadbala-table.js.map +1 -1
- package/dist/cdn/components/synastry-chart.js +3 -3
- package/dist/cdn/components/synastry-chart.js.map +2 -2
- package/dist/cdn/components/transits-table.js.map +1 -1
- package/dist/cdn/components/vedic-kundli.js +34 -22
- package/dist/cdn/components/vedic-kundli.js.map +4 -4
- package/dist/cdn/components/vedic-planets-table.js +231 -0
- package/dist/cdn/components/vedic-planets-table.js.map +7 -0
- package/dist/cdn/components/western-planets-table.js +220 -0
- package/dist/cdn/components/western-planets-table.js.map +7 -0
- package/dist/cdn/roxy-ui.js +1078 -331
- package/dist/cdn/roxy-ui.js.map +4 -4
- package/dist/components/compatibility-card.js.map +1 -1
- package/dist/components/dasha-timeline.d.ts.map +1 -1
- package/dist/components/dasha-timeline.js.map +2 -2
- package/dist/components/divisional-chart.d.ts +5 -3
- package/dist/components/divisional-chart.d.ts.map +1 -1
- package/dist/components/divisional-chart.js +159 -38
- package/dist/components/divisional-chart.js.map +3 -3
- package/dist/components/guna-milan.js.map +1 -1
- package/dist/components/kp-chart.d.ts +26 -0
- package/dist/components/kp-chart.d.ts.map +1 -0
- package/dist/components/kp-chart.js +382 -0
- package/dist/components/kp-chart.js.map +7 -0
- package/dist/components/kp-planets-table.js.map +1 -1
- package/dist/components/kp-ruling-planets.d.ts +20 -0
- package/dist/components/kp-ruling-planets.d.ts.map +1 -0
- package/dist/components/kp-ruling-planets.js +275 -0
- package/dist/components/kp-ruling-planets.js.map +7 -0
- package/dist/components/location-search.d.ts.map +1 -1
- package/dist/components/location-search.js +9 -2
- package/dist/components/location-search.js.map +2 -2
- package/dist/components/moon-phase.js.map +1 -1
- package/dist/components/nakshatra-card.d.ts +18 -0
- package/dist/components/nakshatra-card.d.ts.map +1 -0
- package/dist/components/nakshatra-card.js +231 -0
- package/dist/components/nakshatra-card.js.map +7 -0
- package/dist/components/natal-chart.d.ts +28 -0
- package/dist/components/natal-chart.d.ts.map +1 -1
- package/dist/components/natal-chart.js +401 -104
- package/dist/components/natal-chart.js.map +2 -2
- package/dist/components/numerology-card.d.ts.map +1 -1
- package/dist/components/numerology-card.js.map +2 -2
- package/dist/components/panchang-table.js.map +1 -1
- package/dist/components/shadbala-table.js.map +1 -1
- package/dist/components/synastry-chart.js.map +2 -2
- package/dist/components/transits-table.js.map +1 -1
- package/dist/components/vedic-kundli.d.ts +7 -3
- package/dist/components/vedic-kundli.d.ts.map +1 -1
- package/dist/components/vedic-kundli.js +209 -87
- package/dist/components/vedic-kundli.js.map +3 -3
- package/dist/components/vedic-planets-table.d.ts +21 -0
- package/dist/components/vedic-planets-table.d.ts.map +1 -0
- package/dist/components/vedic-planets-table.js +355 -0
- package/dist/components/vedic-planets-table.js.map +7 -0
- package/dist/components/western-planets-table.d.ts +21 -0
- package/dist/components/western-planets-table.d.ts.map +1 -0
- package/dist/components/western-planets-table.js +350 -0
- package/dist/components/western-planets-table.js.map +7 -0
- package/dist/index.cjs +2042 -695
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2029 -682
- package/dist/index.js.map +4 -4
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.json +5 -0
- package/dist/styles/tokens.css +4 -0
- package/dist/types/types.gen.d.ts +343 -49
- package/dist/types/types.gen.d.ts.map +1 -1
- package/dist/utils/degree.d.ts +12 -0
- package/dist/utils/degree.d.ts.map +1 -1
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/kundli-render.d.ts +85 -12
- package/dist/utils/kundli-render.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/dasha-timeline.ts +1 -7
- package/src/components/divisional-chart.ts +27 -41
- package/src/components/kp-chart.ts +313 -0
- package/src/components/kp-ruling-planets.ts +196 -0
- package/src/components/location-search.ts +16 -2
- package/src/components/nakshatra-card.ts +149 -0
- package/src/components/natal-chart.ts +408 -119
- package/src/components/numerology-card.ts +1 -5
- package/src/components/vedic-kundli.ts +30 -40
- package/src/components/vedic-planets-table.ts +184 -0
- package/src/components/western-planets-table.ts +180 -0
- package/src/index.ts +5 -0
- package/src/manifest.ts +146 -84
- package/src/styles/tokens.css +4 -0
- package/src/types/types.gen.ts +343 -49
- package/src/utils/degree.ts +21 -0
- package/src/utils/format.ts +1 -1
- package/src/utils/kundli-render.ts +234 -29
- package/src/version.ts +1 -1
package/src/utils/degree.ts
CHANGED
|
@@ -49,6 +49,27 @@ export function formatSignPosition(longitude: number): string {
|
|
|
49
49
|
return `${degree}° ${sign} ${String(minute).padStart(2, '0')}'`;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
/**
|
|
53
|
+
* The point diametrically opposite a longitude (e.g. Descendant from
|
|
54
|
+
* Ascendant, IC from MC). Exact derivation, always 180 degrees away.
|
|
55
|
+
*/
|
|
56
|
+
export function oppositePoint(longitude: number): number {
|
|
57
|
+
return normalizeLongitude(longitude + 180);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Midpoint of the forward arc from `start` to `end` (both ecliptic
|
|
62
|
+
* longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees
|
|
63
|
+
* yields a midpoint of 5, not 185. Used to place house numbers between two
|
|
64
|
+
* cusps regardless of how unequal the house is.
|
|
65
|
+
*/
|
|
66
|
+
export function arcMidpoint(start: number, end: number): number {
|
|
67
|
+
const s = normalizeLongitude(start);
|
|
68
|
+
let span = normalizeLongitude(end) - s;
|
|
69
|
+
if (span < 0) span += 360;
|
|
70
|
+
return normalizeLongitude(s + span / 2);
|
|
71
|
+
}
|
|
72
|
+
|
|
52
73
|
/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */
|
|
53
74
|
export function polarToCartesian(
|
|
54
75
|
cx: number,
|
package/src/utils/format.ts
CHANGED
|
@@ -66,7 +66,7 @@ export const ASPECT_CLASS: Record<string, string> = {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
|
-
* Normalize
|
|
69
|
+
* Normalize the `type` field on an aspect entry to a lowercase, hyphen-separated
|
|
70
70
|
* canonical name (`SEMI_SEXTILE` → `semi-sextile`). Accepts any aspect-shaped
|
|
71
71
|
* object so both natal and synastry inter-aspect entries can share this.
|
|
72
72
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TemplateResult } from 'lit';
|
|
2
2
|
import { nothing, svg } from 'lit';
|
|
3
3
|
import { PLANET_ABBR, SIGN_ABBR, SIGNS_ORDER } from '../tokens/index.js';
|
|
4
|
+
import { longitudeToSignPosition } from './degree.js';
|
|
4
5
|
import { capitalize } from './string.js';
|
|
5
6
|
|
|
6
7
|
export const KUNDLI_SIZE = 300;
|
|
@@ -15,6 +16,91 @@ export const RASHI_TO_SIGN: Record<string, string> = Object.fromEntries(
|
|
|
15
16
|
SIGNS_ORDER.map((s) => [s.toLowerCase(), s] as const),
|
|
16
17
|
);
|
|
17
18
|
|
|
19
|
+
/**
|
|
20
|
+
* A planet placed in a kundli house. This is a render-only view model, not an
|
|
21
|
+
* API type: it carries just enough per-graha detail to draw a compact label
|
|
22
|
+
* (abbreviation plus degree-within-sign plus retrograde mark) and a rich SVG
|
|
23
|
+
* `<title>` tooltip (full position, nakshatra, pada, avastha). Both the D1
|
|
24
|
+
* birth chart and the Dx divisional charts feed it from their `meta` map.
|
|
25
|
+
*/
|
|
26
|
+
export interface PlacedGraha {
|
|
27
|
+
graha: string;
|
|
28
|
+
longitude?: number;
|
|
29
|
+
nakshatra?: { name?: string; pada?: number; lord?: string };
|
|
30
|
+
isRetrograde?: boolean;
|
|
31
|
+
awastha?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface HouseDef {
|
|
35
|
+
/** 1-based cell number. For the sign-fixed styles (south, east) this is the rashi index, Aries = 1. */
|
|
36
|
+
number: number;
|
|
37
|
+
/** Sign name (TitleCase, e.g. "Aries"). */
|
|
38
|
+
sign: string;
|
|
39
|
+
/** Planets occupying this house, with full detail for label + tooltip. */
|
|
40
|
+
planets: PlacedGraha[];
|
|
41
|
+
/** Whether this house is the ascendant (Lagna). */
|
|
42
|
+
isLagna: boolean;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Superscript "r" used as a compact retrograde marker on planet labels. */
|
|
46
|
+
const RETRO_MARK = 'ʳ';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Compact in-cell label for a placed graha: abbreviation, whole-degree within
|
|
50
|
+
* the sign, and a retrograde mark. Degree is omitted when longitude is absent.
|
|
51
|
+
*/
|
|
52
|
+
function grahaLabel(p: PlacedGraha): string {
|
|
53
|
+
const abbr = PLANET_ABBR[capitalize(p.graha)] ?? p.graha.slice(0, 2);
|
|
54
|
+
const retro = p.isRetrograde ? RETRO_MARK : '';
|
|
55
|
+
if (typeof p.longitude !== 'number' || !Number.isFinite(p.longitude)) {
|
|
56
|
+
return `${abbr}${retro}`;
|
|
57
|
+
}
|
|
58
|
+
const { degree } = longitudeToSignPosition(p.longitude);
|
|
59
|
+
return `${abbr} ${degree}°${retro}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Full-detail tooltip text for a placed graha: name, exact degree and minute,
|
|
64
|
+
* nakshatra and pada, avastha, retrograde. Surfaced via an SVG `<title>` so the
|
|
65
|
+
* chart cell itself stays compact.
|
|
66
|
+
*/
|
|
67
|
+
function grahaTitle(p: PlacedGraha): string {
|
|
68
|
+
const parts: string[] = [capitalize(p.graha)];
|
|
69
|
+
if (typeof p.longitude === 'number' && Number.isFinite(p.longitude)) {
|
|
70
|
+
const sp = longitudeToSignPosition(p.longitude);
|
|
71
|
+
parts.push(
|
|
72
|
+
`${sp.degree}°${String(sp.minute).padStart(2, '0')}' ${sp.sign}`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
if (p.nakshatra?.name) {
|
|
76
|
+
const pada = p.nakshatra.pada ? ` pada ${p.nakshatra.pada}` : '';
|
|
77
|
+
parts.push(`${p.nakshatra.name}${pada}`);
|
|
78
|
+
}
|
|
79
|
+
if (p.awastha) parts.push(p.awastha);
|
|
80
|
+
if (p.isRetrograde) parts.push('retrograde');
|
|
81
|
+
return parts.join(' · ');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Render the stack of planet labels for one house cell. Shared by all three
|
|
86
|
+
* styles: vertically centers the stack on `baseY`, one line per planet, each
|
|
87
|
+
* with a `<title>` tooltip carrying the full detail.
|
|
88
|
+
*/
|
|
89
|
+
function renderPlanetStack(
|
|
90
|
+
planets: PlacedGraha[],
|
|
91
|
+
cx: number,
|
|
92
|
+
baseY: number,
|
|
93
|
+
lineHeight: number,
|
|
94
|
+
): (TemplateResult | typeof nothing)[] {
|
|
95
|
+
const startY = baseY - ((planets.length - 1) * lineHeight) / 2;
|
|
96
|
+
return planets.map((p, j) => {
|
|
97
|
+
const yPos = startY + j * lineHeight;
|
|
98
|
+
return svg`<text class="planet-text" x=${cx} y=${yPos} text-anchor="middle" dominant-baseline="central">${grahaLabel(
|
|
99
|
+
p,
|
|
100
|
+
)}<title>${grahaTitle(p)}</title></text>`;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
18
104
|
/**
|
|
19
105
|
* South Indian fixed-house square grid: house centers for planet text labels.
|
|
20
106
|
* House 1 is fixed top-center; positions are in the 300x300 viewBox.
|
|
@@ -72,20 +158,57 @@ export const NORTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {
|
|
|
72
158
|
12: { x: 200, y: 220 },
|
|
73
159
|
};
|
|
74
160
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
161
|
+
/**
|
|
162
|
+
* East Indian style: a fixed-sign square (like South Indian) cut by both
|
|
163
|
+
* diagonals and an inner diamond joining the side midpoints, giving 12 cells.
|
|
164
|
+
* The four inner-diamond quadrilaterals hold the cardinal-position signs
|
|
165
|
+
* (cell 1, 4, 7, 10) and the eight corner half-triangles fill between them,
|
|
166
|
+
* laid out clockwise from the top so cell `n` holds the n-th rashi (Aries = 1).
|
|
167
|
+
* Centers are the visual midpoints of those cells in the 300x300 viewBox,
|
|
168
|
+
* derived from the frame geometry (square 10..290, diagonals, side-midpoint
|
|
169
|
+
* diamond).
|
|
170
|
+
*
|
|
171
|
+
* @remarks The cell geometry is exact; the rashi-to-cell order follows the
|
|
172
|
+
* common clockwise-from-top convention and is slated for a regional
|
|
173
|
+
* reference-image confirmation pass (see docs/todo.md "East Indian polish").
|
|
174
|
+
*/
|
|
175
|
+
export const EAST_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {
|
|
176
|
+
1: { x: 150, y: 80 }, // inner diamond, top
|
|
177
|
+
2: { x: 220, y: 33 }, // top-right corner, upper triangle
|
|
178
|
+
3: { x: 267, y: 80 }, // top-right corner, right triangle
|
|
179
|
+
4: { x: 220, y: 150 }, // inner diamond, right
|
|
180
|
+
5: { x: 267, y: 220 }, // bottom-right corner, right triangle
|
|
181
|
+
6: { x: 220, y: 267 }, // bottom-right corner, lower triangle
|
|
182
|
+
7: { x: 150, y: 220 }, // inner diamond, bottom
|
|
183
|
+
8: { x: 80, y: 267 }, // bottom-left corner, lower triangle
|
|
184
|
+
9: { x: 33, y: 220 }, // bottom-left corner, left triangle
|
|
185
|
+
10: { x: 80, y: 150 }, // inner diamond, left
|
|
186
|
+
11: { x: 33, y: 80 }, // top-left corner, left triangle
|
|
187
|
+
12: { x: 80, y: 33 }, // top-left corner, upper triangle
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* East Indian sign abbreviation positions, nudged toward the outer edge of
|
|
192
|
+
* every cell so the abbreviation and the planet stack do not collide.
|
|
193
|
+
*/
|
|
194
|
+
export const EAST_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {
|
|
195
|
+
1: { x: 150, y: 55 },
|
|
196
|
+
2: { x: 235, y: 24 },
|
|
197
|
+
3: { x: 276, y: 62 },
|
|
198
|
+
4: { x: 242, y: 150 },
|
|
199
|
+
5: { x: 276, y: 238 },
|
|
200
|
+
6: { x: 235, y: 276 },
|
|
201
|
+
7: { x: 150, y: 245 },
|
|
202
|
+
8: { x: 65, y: 276 },
|
|
203
|
+
9: { x: 24, y: 238 },
|
|
204
|
+
10: { x: 58, y: 150 },
|
|
205
|
+
11: { x: 24, y: 62 },
|
|
206
|
+
12: { x: 65, y: 24 },
|
|
207
|
+
};
|
|
85
208
|
|
|
86
209
|
/**
|
|
87
|
-
* Render a single house group: lagna highlight, sign
|
|
88
|
-
*
|
|
210
|
+
* Render a single south-Indian house group: lagna highlight, sign
|
|
211
|
+
* abbreviation, planet labels with degree and tooltip.
|
|
89
212
|
*/
|
|
90
213
|
export function renderSouthHouseGroup(
|
|
91
214
|
h: HouseDef,
|
|
@@ -94,7 +217,7 @@ export function renderSouthHouseGroup(
|
|
|
94
217
|
const signPos = SOUTH_SIGN_POSITIONS[h.number];
|
|
95
218
|
if (!center || !signPos) return nothing;
|
|
96
219
|
const signAbbr = SIGN_ABBR[h.sign] ?? '';
|
|
97
|
-
const
|
|
220
|
+
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
98
221
|
return svg`
|
|
99
222
|
<g>
|
|
100
223
|
${
|
|
@@ -116,14 +239,7 @@ export function renderSouthHouseGroup(
|
|
|
116
239
|
? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 18} text-anchor="middle" dominant-baseline="central">LAGNA</text>`
|
|
117
240
|
: nothing
|
|
118
241
|
}
|
|
119
|
-
${planets.
|
|
120
|
-
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
121
|
-
const lineHeight = 13;
|
|
122
|
-
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
123
|
-
const startY = baseY - ((planets.length - 1) * lineHeight) / 2;
|
|
124
|
-
const yPos = startY + j * lineHeight;
|
|
125
|
-
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
126
|
-
})}
|
|
242
|
+
${renderPlanetStack(h.planets, center.x, baseY, 13)}
|
|
127
243
|
</g>
|
|
128
244
|
`;
|
|
129
245
|
}
|
|
@@ -153,7 +269,6 @@ export function renderNorthHouseGroup(
|
|
|
153
269
|
const center = NORTH_HOUSE_CENTERS[h.number];
|
|
154
270
|
if (!center) return nothing;
|
|
155
271
|
const signAbbr = SIGN_ABBR[h.sign] ?? '';
|
|
156
|
-
const planets = h.planets;
|
|
157
272
|
return svg`
|
|
158
273
|
<g>
|
|
159
274
|
${
|
|
@@ -167,13 +282,7 @@ export function renderNorthHouseGroup(
|
|
|
167
282
|
: nothing
|
|
168
283
|
}
|
|
169
284
|
<text class="house-num" x=${center.x} y=${center.y + 2} text-anchor="middle" dominant-baseline="central">${h.number}</text>
|
|
170
|
-
${planets.
|
|
171
|
-
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
172
|
-
const lineHeight = 11;
|
|
173
|
-
const startY = center.y + 14 - ((planets.length - 1) * lineHeight) / 2;
|
|
174
|
-
const yPos = startY + j * lineHeight;
|
|
175
|
-
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
176
|
-
})}
|
|
285
|
+
${renderPlanetStack(h.planets, center.x, center.y + 14, 11)}
|
|
177
286
|
</g>
|
|
178
287
|
`;
|
|
179
288
|
}
|
|
@@ -195,3 +304,99 @@ export function renderSouthFrame(): TemplateResult {
|
|
|
195
304
|
<line class="line" x1="10" y1="150" x2="80" y2="80" stroke-width="1" />
|
|
196
305
|
`;
|
|
197
306
|
}
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Render the east-Indian square frame: outer square, both diagonals, and the
|
|
310
|
+
* inner diamond joining the four side midpoints. Twelve triangular cells.
|
|
311
|
+
*/
|
|
312
|
+
export function renderEastFrame(): TemplateResult {
|
|
313
|
+
return svg`
|
|
314
|
+
<rect class="line" x="10" y="10" width="280" height="280" stroke-width="1.5" fill="none" />
|
|
315
|
+
<line class="line" x1="10" y1="10" x2="290" y2="290" stroke-width="1" />
|
|
316
|
+
<line class="line" x1="290" y1="10" x2="10" y2="290" stroke-width="1" />
|
|
317
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1" fill="none" />
|
|
318
|
+
`;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Render an east-Indian house group. East Indian charts are sign-fixed like
|
|
323
|
+
* the south style, so this mirrors `renderSouthHouseGroup` with the east cell
|
|
324
|
+
* centers and a smaller line height to fit the triangular cells.
|
|
325
|
+
*/
|
|
326
|
+
export function renderEastHouseGroup(
|
|
327
|
+
h: HouseDef,
|
|
328
|
+
): TemplateResult | typeof nothing {
|
|
329
|
+
const center = EAST_HOUSE_CENTERS[h.number];
|
|
330
|
+
const signPos = EAST_SIGN_POSITIONS[h.number];
|
|
331
|
+
if (!center || !signPos) return nothing;
|
|
332
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? '';
|
|
333
|
+
return svg`
|
|
334
|
+
<g>
|
|
335
|
+
${
|
|
336
|
+
h.isLagna
|
|
337
|
+
? svg`<circle class="lagna-bg" cx=${center.x} cy=${center.y} r="20" />`
|
|
338
|
+
: nothing
|
|
339
|
+
}
|
|
340
|
+
${
|
|
341
|
+
signAbbr
|
|
342
|
+
? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>`
|
|
343
|
+
: nothing
|
|
344
|
+
}
|
|
345
|
+
${
|
|
346
|
+
h.isLagna
|
|
347
|
+
? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 14} text-anchor="middle" dominant-baseline="central">LAGNA</text>`
|
|
348
|
+
: nothing
|
|
349
|
+
}
|
|
350
|
+
${renderPlanetStack(h.planets, center.x, center.y + 2, 11)}
|
|
351
|
+
</g>
|
|
352
|
+
`;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Bucket a graha-keyed `meta` map (from a D1 or Dx chart response) into the 12
|
|
357
|
+
* sign-indexed houses. Shared by the kundli and divisional chart components so
|
|
358
|
+
* both render the same rich per-graha detail. The Lagna entry is consumed only
|
|
359
|
+
* to flag the ascendant cell, not rendered as a planet.
|
|
360
|
+
*/
|
|
361
|
+
export function buildHousesFromMeta(
|
|
362
|
+
meta: Record<
|
|
363
|
+
string,
|
|
364
|
+
{
|
|
365
|
+
graha?: string;
|
|
366
|
+
rashi?: string;
|
|
367
|
+
longitude?: number;
|
|
368
|
+
nakshatra?: { name?: string; pada?: number; lord?: string };
|
|
369
|
+
isRetrograde?: boolean;
|
|
370
|
+
awastha?: string;
|
|
371
|
+
}
|
|
372
|
+
>,
|
|
373
|
+
): HouseDef[] {
|
|
374
|
+
const byRashi = new Map<string, PlacedGraha[]>();
|
|
375
|
+
let lagnaKey = '';
|
|
376
|
+
for (const [name, pos] of Object.entries(meta)) {
|
|
377
|
+
const rashiKey = (pos?.rashi ?? '').toLowerCase();
|
|
378
|
+
if (name === 'Lagna' || pos?.graha === 'Lagna') {
|
|
379
|
+
lagnaKey = rashiKey;
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
if (!rashiKey) continue;
|
|
383
|
+
const list = byRashi.get(rashiKey) ?? [];
|
|
384
|
+
list.push({
|
|
385
|
+
graha: pos.graha ?? name,
|
|
386
|
+
longitude: pos.longitude,
|
|
387
|
+
nakshatra: pos.nakshatra,
|
|
388
|
+
isRetrograde: pos.isRetrograde,
|
|
389
|
+
awastha: pos.awastha,
|
|
390
|
+
});
|
|
391
|
+
byRashi.set(rashiKey, list);
|
|
392
|
+
}
|
|
393
|
+
return SIGNS_ORDER.map((sign, i) => {
|
|
394
|
+
const key = sign.toLowerCase();
|
|
395
|
+
return {
|
|
396
|
+
number: i + 1,
|
|
397
|
+
sign,
|
|
398
|
+
planets: byRashi.get(key) ?? [],
|
|
399
|
+
isLagna: lagnaKey === key,
|
|
400
|
+
};
|
|
401
|
+
});
|
|
402
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by scripts/sync-version.ts. Do not edit.
|
|
2
|
-
export const ROXY_UI_VERSION = '0.
|
|
2
|
+
export const ROXY_UI_VERSION = '0.3.1';
|