@roxyapi/ui 0.2.3 → 0.3.0
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 +15 -10
- package/README.md +15 -10
- 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 +23 -18
- 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
|
@@ -13,55 +13,6 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
13
13
|
import { css as css2, html, LitElement } from "lit";
|
|
14
14
|
import { customElement, property } from "lit/decorators.js";
|
|
15
15
|
|
|
16
|
-
// packages/ui/src/tokens/index.ts
|
|
17
|
-
var PLANET_ABBR = {
|
|
18
|
-
Sun: "Su",
|
|
19
|
-
Moon: "Mo",
|
|
20
|
-
Mercury: "Me",
|
|
21
|
-
Venus: "Ve",
|
|
22
|
-
Mars: "Ma",
|
|
23
|
-
Jupiter: "Ju",
|
|
24
|
-
Saturn: "Sa",
|
|
25
|
-
Uranus: "Ur",
|
|
26
|
-
Neptune: "Ne",
|
|
27
|
-
Pluto: "Pl",
|
|
28
|
-
Rahu: "Ra",
|
|
29
|
-
Ketu: "Ke",
|
|
30
|
-
Ascendant: "Asc",
|
|
31
|
-
Lagna: "La"
|
|
32
|
-
};
|
|
33
|
-
var SIGN_ABBR = {
|
|
34
|
-
Aries: "Ar",
|
|
35
|
-
Taurus: "Ta",
|
|
36
|
-
Gemini: "Ge",
|
|
37
|
-
Cancer: "Cn",
|
|
38
|
-
Leo: "Le",
|
|
39
|
-
Virgo: "Vi",
|
|
40
|
-
Libra: "Li",
|
|
41
|
-
Scorpio: "Sc",
|
|
42
|
-
Sagittarius: "Sg",
|
|
43
|
-
Capricorn: "Cp",
|
|
44
|
-
Aquarius: "Aq",
|
|
45
|
-
Pisces: "Pi"
|
|
46
|
-
};
|
|
47
|
-
var SIGNS_ORDER = [
|
|
48
|
-
"Aries",
|
|
49
|
-
"Taurus",
|
|
50
|
-
"Gemini",
|
|
51
|
-
"Cancer",
|
|
52
|
-
"Leo",
|
|
53
|
-
"Virgo",
|
|
54
|
-
"Libra",
|
|
55
|
-
"Scorpio",
|
|
56
|
-
"Sagittarius",
|
|
57
|
-
"Capricorn",
|
|
58
|
-
"Aquarius",
|
|
59
|
-
"Pisces"
|
|
60
|
-
];
|
|
61
|
-
var RASHI_KEYS = SIGNS_ORDER.map(
|
|
62
|
-
(s) => s.toLowerCase()
|
|
63
|
-
);
|
|
64
|
-
|
|
65
16
|
// packages/ui/src/utils/base-styles.ts
|
|
66
17
|
import { css } from "lit";
|
|
67
18
|
var baseStyles = css`
|
|
@@ -151,6 +102,77 @@ var baseStyles = css`
|
|
|
151
102
|
// packages/ui/src/utils/kundli-render.ts
|
|
152
103
|
import { nothing, svg } from "lit";
|
|
153
104
|
|
|
105
|
+
// packages/ui/src/tokens/index.ts
|
|
106
|
+
var PLANET_ABBR = {
|
|
107
|
+
Sun: "Su",
|
|
108
|
+
Moon: "Mo",
|
|
109
|
+
Mercury: "Me",
|
|
110
|
+
Venus: "Ve",
|
|
111
|
+
Mars: "Ma",
|
|
112
|
+
Jupiter: "Ju",
|
|
113
|
+
Saturn: "Sa",
|
|
114
|
+
Uranus: "Ur",
|
|
115
|
+
Neptune: "Ne",
|
|
116
|
+
Pluto: "Pl",
|
|
117
|
+
Rahu: "Ra",
|
|
118
|
+
Ketu: "Ke",
|
|
119
|
+
Ascendant: "Asc",
|
|
120
|
+
Lagna: "La"
|
|
121
|
+
};
|
|
122
|
+
var SIGN_ABBR = {
|
|
123
|
+
Aries: "Ar",
|
|
124
|
+
Taurus: "Ta",
|
|
125
|
+
Gemini: "Ge",
|
|
126
|
+
Cancer: "Cn",
|
|
127
|
+
Leo: "Le",
|
|
128
|
+
Virgo: "Vi",
|
|
129
|
+
Libra: "Li",
|
|
130
|
+
Scorpio: "Sc",
|
|
131
|
+
Sagittarius: "Sg",
|
|
132
|
+
Capricorn: "Cp",
|
|
133
|
+
Aquarius: "Aq",
|
|
134
|
+
Pisces: "Pi"
|
|
135
|
+
};
|
|
136
|
+
var SIGNS_ORDER = [
|
|
137
|
+
"Aries",
|
|
138
|
+
"Taurus",
|
|
139
|
+
"Gemini",
|
|
140
|
+
"Cancer",
|
|
141
|
+
"Leo",
|
|
142
|
+
"Virgo",
|
|
143
|
+
"Libra",
|
|
144
|
+
"Scorpio",
|
|
145
|
+
"Sagittarius",
|
|
146
|
+
"Capricorn",
|
|
147
|
+
"Aquarius",
|
|
148
|
+
"Pisces"
|
|
149
|
+
];
|
|
150
|
+
var RASHI_KEYS = SIGNS_ORDER.map(
|
|
151
|
+
(s) => s.toLowerCase()
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
// packages/ui/src/utils/degree.ts
|
|
155
|
+
function normalizeLongitude(lon) {
|
|
156
|
+
const wrapped = lon % 360;
|
|
157
|
+
return wrapped < 0 ? wrapped + 360 : wrapped;
|
|
158
|
+
}
|
|
159
|
+
function longitudeToSignPosition(longitude) {
|
|
160
|
+
const lon = normalizeLongitude(longitude);
|
|
161
|
+
const signIndex = Math.floor(lon / 30) % 12;
|
|
162
|
+
const within = lon % 30;
|
|
163
|
+
const degree = Math.floor(within);
|
|
164
|
+
const minuteFloat = (within - degree) * 60;
|
|
165
|
+
const minute = Math.floor(minuteFloat);
|
|
166
|
+
const second = Math.round((minuteFloat - minute) * 60);
|
|
167
|
+
return {
|
|
168
|
+
sign: SIGNS_ORDER[signIndex] ?? "Aries",
|
|
169
|
+
signIndex,
|
|
170
|
+
degree,
|
|
171
|
+
minute,
|
|
172
|
+
second
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
|
|
154
176
|
// packages/ui/src/utils/string.ts
|
|
155
177
|
function capitalize(s) {
|
|
156
178
|
if (!s) return "";
|
|
@@ -161,6 +183,41 @@ function capitalize(s) {
|
|
|
161
183
|
var RASHI_TO_SIGN = Object.fromEntries(
|
|
162
184
|
SIGNS_ORDER.map((s) => [s.toLowerCase(), s])
|
|
163
185
|
);
|
|
186
|
+
var RETRO_MARK = "\u02B3";
|
|
187
|
+
function grahaLabel(p) {
|
|
188
|
+
const abbr = PLANET_ABBR[capitalize(p.graha)] ?? p.graha.slice(0, 2);
|
|
189
|
+
const retro = p.isRetrograde ? RETRO_MARK : "";
|
|
190
|
+
if (typeof p.longitude !== "number" || !Number.isFinite(p.longitude)) {
|
|
191
|
+
return `${abbr}${retro}`;
|
|
192
|
+
}
|
|
193
|
+
const { degree } = longitudeToSignPosition(p.longitude);
|
|
194
|
+
return `${abbr} ${degree}\xB0${retro}`;
|
|
195
|
+
}
|
|
196
|
+
function grahaTitle(p) {
|
|
197
|
+
const parts = [capitalize(p.graha)];
|
|
198
|
+
if (typeof p.longitude === "number" && Number.isFinite(p.longitude)) {
|
|
199
|
+
const sp = longitudeToSignPosition(p.longitude);
|
|
200
|
+
parts.push(
|
|
201
|
+
`${sp.degree}\xB0${String(sp.minute).padStart(2, "0")}' ${sp.sign}`
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
if (p.nakshatra?.name) {
|
|
205
|
+
const pada = p.nakshatra.pada ? ` pada ${p.nakshatra.pada}` : "";
|
|
206
|
+
parts.push(`${p.nakshatra.name}${pada}`);
|
|
207
|
+
}
|
|
208
|
+
if (p.awastha) parts.push(p.awastha);
|
|
209
|
+
if (p.isRetrograde) parts.push("retrograde");
|
|
210
|
+
return parts.join(" \xB7 ");
|
|
211
|
+
}
|
|
212
|
+
function renderPlanetStack(planets, cx, baseY, lineHeight) {
|
|
213
|
+
const startY = baseY - (planets.length - 1) * lineHeight / 2;
|
|
214
|
+
return planets.map((p, j) => {
|
|
215
|
+
const yPos = startY + j * lineHeight;
|
|
216
|
+
return svg`<text class="planet-text" x=${cx} y=${yPos} text-anchor="middle" dominant-baseline="central">${grahaLabel(
|
|
217
|
+
p
|
|
218
|
+
)}<title>${grahaTitle(p)}</title></text>`;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
164
221
|
var SOUTH_HOUSE_CENTERS = {
|
|
165
222
|
1: { x: 150, y: 58 },
|
|
166
223
|
2: { x: 205, y: 52 },
|
|
@@ -203,12 +260,52 @@ var NORTH_HOUSE_CENTERS = {
|
|
|
203
260
|
11: { x: 200, y: 80 },
|
|
204
261
|
12: { x: 200, y: 220 }
|
|
205
262
|
};
|
|
263
|
+
var EAST_HOUSE_CENTERS = {
|
|
264
|
+
1: { x: 150, y: 80 },
|
|
265
|
+
// inner diamond, top
|
|
266
|
+
2: { x: 220, y: 33 },
|
|
267
|
+
// top-right corner, upper triangle
|
|
268
|
+
3: { x: 267, y: 80 },
|
|
269
|
+
// top-right corner, right triangle
|
|
270
|
+
4: { x: 220, y: 150 },
|
|
271
|
+
// inner diamond, right
|
|
272
|
+
5: { x: 267, y: 220 },
|
|
273
|
+
// bottom-right corner, right triangle
|
|
274
|
+
6: { x: 220, y: 267 },
|
|
275
|
+
// bottom-right corner, lower triangle
|
|
276
|
+
7: { x: 150, y: 220 },
|
|
277
|
+
// inner diamond, bottom
|
|
278
|
+
8: { x: 80, y: 267 },
|
|
279
|
+
// bottom-left corner, lower triangle
|
|
280
|
+
9: { x: 33, y: 220 },
|
|
281
|
+
// bottom-left corner, left triangle
|
|
282
|
+
10: { x: 80, y: 150 },
|
|
283
|
+
// inner diamond, left
|
|
284
|
+
11: { x: 33, y: 80 },
|
|
285
|
+
// top-left corner, left triangle
|
|
286
|
+
12: { x: 80, y: 33 }
|
|
287
|
+
// top-left corner, upper triangle
|
|
288
|
+
};
|
|
289
|
+
var EAST_SIGN_POSITIONS = {
|
|
290
|
+
1: { x: 150, y: 55 },
|
|
291
|
+
2: { x: 235, y: 24 },
|
|
292
|
+
3: { x: 276, y: 62 },
|
|
293
|
+
4: { x: 242, y: 150 },
|
|
294
|
+
5: { x: 276, y: 238 },
|
|
295
|
+
6: { x: 235, y: 276 },
|
|
296
|
+
7: { x: 150, y: 245 },
|
|
297
|
+
8: { x: 65, y: 276 },
|
|
298
|
+
9: { x: 24, y: 238 },
|
|
299
|
+
10: { x: 58, y: 150 },
|
|
300
|
+
11: { x: 24, y: 62 },
|
|
301
|
+
12: { x: 65, y: 24 }
|
|
302
|
+
};
|
|
206
303
|
function renderSouthHouseGroup(h) {
|
|
207
304
|
const center = SOUTH_HOUSE_CENTERS[h.number];
|
|
208
305
|
const signPos = SOUTH_SIGN_POSITIONS[h.number];
|
|
209
306
|
if (!center || !signPos) return nothing;
|
|
210
307
|
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
211
|
-
const
|
|
308
|
+
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
212
309
|
return svg`
|
|
213
310
|
<g>
|
|
214
311
|
${h.isLagna ? svg`<rect
|
|
@@ -218,14 +315,7 @@ function renderSouthHouseGroup(h) {
|
|
|
218
315
|
/>` : nothing}
|
|
219
316
|
${signAbbr ? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
220
317
|
${h.isLagna ? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 18} text-anchor="middle" dominant-baseline="central">LAGNA</text>` : nothing}
|
|
221
|
-
${planets.
|
|
222
|
-
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
223
|
-
const lineHeight = 13;
|
|
224
|
-
const baseY = h.isLagna ? center.y + 8 : center.y;
|
|
225
|
-
const startY = baseY - (planets.length - 1) * lineHeight / 2;
|
|
226
|
-
const yPos = startY + j * lineHeight;
|
|
227
|
-
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
228
|
-
})}
|
|
318
|
+
${renderPlanetStack(h.planets, center.x, baseY, 13)}
|
|
229
319
|
</g>
|
|
230
320
|
`;
|
|
231
321
|
}
|
|
@@ -244,19 +334,12 @@ function renderNorthHouseGroup(h) {
|
|
|
244
334
|
const center = NORTH_HOUSE_CENTERS[h.number];
|
|
245
335
|
if (!center) return nothing;
|
|
246
336
|
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
247
|
-
const planets = h.planets;
|
|
248
337
|
return svg`
|
|
249
338
|
<g>
|
|
250
339
|
${h.isLagna ? svg`<circle class="lagna-bg" cx=${center.x} cy=${center.y} r="22" />` : nothing}
|
|
251
340
|
${signAbbr ? svg`<text class="sign-text" x=${center.x} y=${center.y - 10} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
252
341
|
<text class="house-num" x=${center.x} y=${center.y + 2} text-anchor="middle" dominant-baseline="central">${h.number}</text>
|
|
253
|
-
${planets.
|
|
254
|
-
const abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);
|
|
255
|
-
const lineHeight = 11;
|
|
256
|
-
const startY = center.y + 14 - (planets.length - 1) * lineHeight / 2;
|
|
257
|
-
const yPos = startY + j * lineHeight;
|
|
258
|
-
return svg`<text class="planet-text" x=${center.x} y=${yPos} text-anchor="middle" dominant-baseline="central">${abbr}</text>`;
|
|
259
|
-
})}
|
|
342
|
+
${renderPlanetStack(h.planets, center.x, center.y + 14, 11)}
|
|
260
343
|
</g>
|
|
261
344
|
`;
|
|
262
345
|
}
|
|
@@ -274,6 +357,58 @@ function renderSouthFrame() {
|
|
|
274
357
|
<line class="line" x1="10" y1="150" x2="80" y2="80" stroke-width="1" />
|
|
275
358
|
`;
|
|
276
359
|
}
|
|
360
|
+
function renderEastFrame() {
|
|
361
|
+
return svg`
|
|
362
|
+
<rect class="line" x="10" y="10" width="280" height="280" stroke-width="1.5" fill="none" />
|
|
363
|
+
<line class="line" x1="10" y1="10" x2="290" y2="290" stroke-width="1" />
|
|
364
|
+
<line class="line" x1="290" y1="10" x2="10" y2="290" stroke-width="1" />
|
|
365
|
+
<polygon class="line" points="150,10 290,150 150,290 10,150" stroke-width="1" fill="none" />
|
|
366
|
+
`;
|
|
367
|
+
}
|
|
368
|
+
function renderEastHouseGroup(h) {
|
|
369
|
+
const center = EAST_HOUSE_CENTERS[h.number];
|
|
370
|
+
const signPos = EAST_SIGN_POSITIONS[h.number];
|
|
371
|
+
if (!center || !signPos) return nothing;
|
|
372
|
+
const signAbbr = SIGN_ABBR[h.sign] ?? "";
|
|
373
|
+
return svg`
|
|
374
|
+
<g>
|
|
375
|
+
${h.isLagna ? svg`<circle class="lagna-bg" cx=${center.x} cy=${center.y} r="20" />` : nothing}
|
|
376
|
+
${signAbbr ? svg`<text class="sign-text" x=${signPos.x} y=${signPos.y} text-anchor="middle" dominant-baseline="central">${signAbbr}</text>` : nothing}
|
|
377
|
+
${h.isLagna ? svg`<text class="lagna-marker" x=${center.x} y=${center.y - 14} text-anchor="middle" dominant-baseline="central">LAGNA</text>` : nothing}
|
|
378
|
+
${renderPlanetStack(h.planets, center.x, center.y + 2, 11)}
|
|
379
|
+
</g>
|
|
380
|
+
`;
|
|
381
|
+
}
|
|
382
|
+
function buildHousesFromMeta(meta) {
|
|
383
|
+
const byRashi = /* @__PURE__ */ new Map();
|
|
384
|
+
let lagnaKey = "";
|
|
385
|
+
for (const [name, pos] of Object.entries(meta)) {
|
|
386
|
+
const rashiKey = (pos?.rashi ?? "").toLowerCase();
|
|
387
|
+
if (name === "Lagna" || pos?.graha === "Lagna") {
|
|
388
|
+
lagnaKey = rashiKey;
|
|
389
|
+
continue;
|
|
390
|
+
}
|
|
391
|
+
if (!rashiKey) continue;
|
|
392
|
+
const list = byRashi.get(rashiKey) ?? [];
|
|
393
|
+
list.push({
|
|
394
|
+
graha: pos.graha ?? name,
|
|
395
|
+
longitude: pos.longitude,
|
|
396
|
+
nakshatra: pos.nakshatra,
|
|
397
|
+
isRetrograde: pos.isRetrograde,
|
|
398
|
+
awastha: pos.awastha
|
|
399
|
+
});
|
|
400
|
+
byRashi.set(rashiKey, list);
|
|
401
|
+
}
|
|
402
|
+
return SIGNS_ORDER.map((sign, i) => {
|
|
403
|
+
const key = sign.toLowerCase();
|
|
404
|
+
return {
|
|
405
|
+
number: i + 1,
|
|
406
|
+
sign,
|
|
407
|
+
planets: byRashi.get(key) ?? [],
|
|
408
|
+
isLagna: lagnaKey === key
|
|
409
|
+
};
|
|
410
|
+
});
|
|
411
|
+
}
|
|
277
412
|
|
|
278
413
|
// packages/ui/src/components/vedic-kundli.ts
|
|
279
414
|
var RoxyVedicKundli = class extends LitElement {
|
|
@@ -283,29 +418,16 @@ var RoxyVedicKundli = class extends LitElement {
|
|
|
283
418
|
this.chartStyle = "south";
|
|
284
419
|
}
|
|
285
420
|
buildHouses() {
|
|
286
|
-
if (!this.data) return [];
|
|
287
|
-
|
|
288
|
-
const lagnaSign = this.data?.meta?.Lagna?.rashi ?? "";
|
|
289
|
-
const houses = [];
|
|
290
|
-
for (let i = 0; i < 12; i++) {
|
|
291
|
-
const key = RASHI_KEYS[i];
|
|
292
|
-
const bucket = data[key];
|
|
293
|
-
const planets = (bucket?.signs ?? []).map((p) => p.graha).filter(Boolean);
|
|
294
|
-
const sign = RASHI_TO_SIGN[key] ?? "";
|
|
295
|
-
houses.push({
|
|
296
|
-
number: i + 1,
|
|
297
|
-
sign,
|
|
298
|
-
planets,
|
|
299
|
-
isLagna: lagnaSign ? lagnaSign.toLowerCase() === sign.toLowerCase() : false
|
|
300
|
-
});
|
|
301
|
-
}
|
|
302
|
-
return houses;
|
|
421
|
+
if (!this.data?.meta) return [];
|
|
422
|
+
return buildHousesFromMeta(this.data.meta);
|
|
303
423
|
}
|
|
304
424
|
render() {
|
|
305
425
|
if (!this.data)
|
|
306
426
|
return html`<div class="roxy-empty" role="status">No kundli data</div>`;
|
|
307
427
|
const houses = this.buildHouses();
|
|
308
|
-
const
|
|
428
|
+
const style = this.chartStyle;
|
|
429
|
+
const frame = style === "north" ? renderNorthFrame() : style === "east" ? renderEastFrame() : renderSouthFrame();
|
|
430
|
+
const houseGroup = style === "north" ? renderNorthHouseGroup : style === "east" ? renderEastHouseGroup : renderSouthHouseGroup;
|
|
309
431
|
return html`<div class="wrap">
|
|
310
432
|
<h2 class="title">Vedic kundli</h2>
|
|
311
433
|
<svg
|
|
@@ -314,8 +436,8 @@ var RoxyVedicKundli = class extends LitElement {
|
|
|
314
436
|
aria-label="Vedic birth chart with twelve sign houses"
|
|
315
437
|
>
|
|
316
438
|
<title>Vedic kundli</title>
|
|
317
|
-
${
|
|
318
|
-
${
|
|
439
|
+
${frame}
|
|
440
|
+
${houses.map((h) => houseGroup(h))}
|
|
319
441
|
</svg>
|
|
320
442
|
</div>`;
|
|
321
443
|
}
|
|
@@ -350,7 +472,7 @@ RoxyVedicKundli.styles = [
|
|
|
350
472
|
}
|
|
351
473
|
.planet-text {
|
|
352
474
|
fill: var(--roxy-fg, #0a0a0a);
|
|
353
|
-
font-size:
|
|
475
|
+
font-size: 10px;
|
|
354
476
|
font-weight: 600;
|
|
355
477
|
font-family: var(--roxy-font-sans);
|
|
356
478
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/vedic-kundli.ts", "../../src/
|
|
4
|
-
"sourcesContent": ["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { RASHI_KEYS } from '../tokens/index.js';\nimport type { BirthChartResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport type { HouseDef } from '../utils/kundli-render.js';\nimport {\n\tRASHI_TO_SIGN,\n\trenderNorthFrame,\n\trenderNorthHouseGroup,\n\trenderSouthFrame,\n\trenderSouthHouseGroup,\n} from '../utils/kundli-render.js';\n\ntype RashiBucket = BirthChartResponse['aries'];\n\n// The /vedic-astrology/birth-chart response carries all 12 rashi keys\n// (aries, taurus, ..., pisces), each shaped like the spec-typed `aries`\n// bucket. This local alias indexes by rashi name without per-call casts.\ntype BirthChartByRashi = BirthChartResponse & Record<string, RashiBucket>;\n\n/**\n * Vedic kundli (D1 Rashi chart). South Indian style by default. Pass `data`\n * from /vedic-astrology/birth-chart. North Indian style via chartStyle=\"north\".\n *\n * Theming flows through CSS custom properties on :host, so the chart adopts\n * the host page palette without runtime color probing.\n */\n@customElement('roxy-vedic-kundli')\nexport class RoxyVedicKundli extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 360px;\n\t\t\t\tmargin: 0 auto;\n\t\t\t}\n\t\t\t.line {\n\t\t\t\tfill: transparent;\n\t\t\t\tstroke: var(--roxy-border, #e4e4e7);\n\t\t\t}\n\t\t\t.sign-text {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.planet-text {\n\t\t\t\tfill: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: 11px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.house-num {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.lagna-marker {\n\t\t\t\tfill: var(--roxy-accent-fg, #b45309);\n\t\t\t\tfont-size: 8px;\n\t\t\t\tfont-weight: 700;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t\tletter-spacing: 0.05em;\n\t\t\t}\n\t\t\t.lagna-bg {\n\t\t\t\tfill: color-mix(in srgb, var(--roxy-accent, #f59e0b) 12%, transparent);\n\t\t\t\tstroke: color-mix(in srgb, var(--roxy-accent, #f59e0b) 45%, transparent);\n\t\t\t\tstroke-width: 0.8;\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: BirthChartResponse | null = null;\n\n\t@property({ type: String, reflect: true, attribute: 'chart-style' })\n\tchartStyle: 'south' | 'north' = 'south';\n\n\tprivate buildHouses(): HouseDef[] {\n\t\tif (!this.data) return [];\n\t\tconst data = this.data as BirthChartByRashi;\n\t\tconst lagnaSign = this.data?.meta?.Lagna?.rashi ?? '';\n\t\tconst houses: HouseDef[] = [];\n\t\tfor (let i = 0; i < 12; i++) {\n\t\t\tconst key = RASHI_KEYS[i];\n\t\t\tconst bucket = data[key];\n\t\t\tconst planets = (bucket?.signs ?? []).map((p) => p.graha).filter(Boolean);\n\t\t\tconst sign = RASHI_TO_SIGN[key] ?? '';\n\t\t\thouses.push({\n\t\t\t\tnumber: i + 1,\n\t\t\t\tsign,\n\t\t\t\tplanets,\n\t\t\t\tisLagna: lagnaSign\n\t\t\t\t\t? lagnaSign.toLowerCase() === sign.toLowerCase()\n\t\t\t\t\t: false,\n\t\t\t});\n\t\t}\n\t\treturn houses;\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No kundli data</div>`;\n\t\tconst houses = this.buildHouses();\n\t\tconst isNorth = this.chartStyle === 'north';\n\n\t\treturn html`<div class=\"wrap\">\n\t\t\t<h2 class=\"title\">Vedic kundli</h2>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 300 300\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Vedic birth chart with twelve sign houses\"\n\t\t\t>\n\t\t\t\t<title>Vedic kundli</title>\n\t\t\t\t${isNorth ? renderNorthFrame() : renderSouthFrame()}\n\t\t\t\t${\n\t\t\t\t\tisNorth\n\t\t\t\t\t\t? houses.map((h) => renderNorthHouseGroup(h))\n\t\t\t\t\t\t: houses.map((h) => renderSouthHouseGroup(h))\n\t\t\t\t}\n\t\t\t</svg>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-vedic-kundli': RoxyVedicKundli;\n\t}\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n`;\n", "import type { TemplateResult } from 'lit';\nimport { nothing, svg } from 'lit';\nimport { PLANET_ABBR, SIGN_ABBR, SIGNS_ORDER } from '../tokens/index.js';\nimport { capitalize } from './string.js';\n\nexport const KUNDLI_SIZE = 300;\nexport const KUNDLI_CENTER = 150;\n\n/**\n * Maps a lowercase rashi key (e.g. \"aries\") back to its canonical sign name\n * (e.g. \"Aries\"). Used by every kundli consumer to bridge spec lowercase\n * rashi keys to the title-cased SIGNS_ORDER tokens.\n */\nexport const RASHI_TO_SIGN: Record<string, string> = Object.fromEntries(\n\tSIGNS_ORDER.map((s) => [s.toLowerCase(), s] as const),\n);\n\n/**\n * South Indian fixed-house square grid: house centers for planet text labels.\n * House 1 is fixed top-center; positions are in the 300x300 viewBox.\n */\nexport const SOUTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 58 },\n\t2: { x: 205, y: 52 },\n\t3: { x: 253, y: 112 },\n\t4: { x: 243, y: 150 },\n\t5: { x: 253, y: 188 },\n\t6: { x: 205, y: 248 },\n\t7: { x: 150, y: 242 },\n\t8: { x: 95, y: 248 },\n\t9: { x: 47, y: 188 },\n\t10: { x: 57, y: 150 },\n\t11: { x: 47, y: 112 },\n\t12: { x: 95, y: 52 },\n};\n\n/**\n * South Indian sign abbreviation positions (slightly outward from center).\n */\nexport const SOUTH_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 35 },\n\t2: { x: 222, y: 40 },\n\t3: { x: 265, y: 100 },\n\t4: { x: 265, y: 150 },\n\t5: { x: 265, y: 200 },\n\t6: { x: 222, y: 260 },\n\t7: { x: 150, y: 265 },\n\t8: { x: 78, y: 260 },\n\t9: { x: 35, y: 200 },\n\t10: { x: 35, y: 150 },\n\t11: { x: 35, y: 100 },\n\t12: { x: 78, y: 40 },\n};\n\n/**\n * North Indian style: 12 triangular house positions.\n * Lagna (house 1) is the top diamond, numbered clockwise.\n * Centers represent the visual midpoint of each triangular cell.\n */\nexport const NORTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 60 },\n\t2: { x: 225, y: 100 },\n\t3: { x: 255, y: 150 },\n\t4: { x: 225, y: 200 },\n\t5: { x: 150, y: 240 },\n\t6: { x: 75, y: 200 },\n\t7: { x: 45, y: 150 },\n\t8: { x: 75, y: 100 },\n\t9: { x: 100, y: 80 },\n\t10: { x: 150, y: 108 },\n\t11: { x: 200, y: 80 },\n\t12: { x: 200, y: 220 },\n};\n\nexport interface HouseDef {\n\t/** 1-based house number. */\n\tnumber: number;\n\t/** Sign name (TitleCase, e.g. \"Aries\"). */\n\tsign: string;\n\t/** Planet abbreviation strings to display. */\n\tplanets: string[];\n\t/** Whether this house is the ascendant (Lagna). */\n\tisLagna: boolean;\n}\n\n/**\n * Render a single house group: lagna highlight, sign abbreviation, planet labels.\n * Returns an SVG fragment for use inside an `<svg>` element.\n */\nexport function renderSouthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = SOUTH_HOUSE_CENTERS[h.number];\n\tconst signPos = SOUTH_SIGN_POSITIONS[h.number];\n\tif (!center || !signPos) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\tconst planets = h.planets;\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<rect\n\t\t\t\t\t\t\tclass=\"lagna-bg\"\n\t\t\t\t\t\t\tx=${center.x - 30} y=${center.y - 28}\n\t\t\t\t\t\t\twidth=\"60\" height=\"56\" rx=\"6\"\n\t\t\t\t\t\t/>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${signPos.x} y=${signPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<text class=\"lagna-marker\" x=${center.x} y=${center.y - 18} text-anchor=\"middle\" dominant-baseline=\"central\">LAGNA</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${planets.map((planet, j) => {\n\t\t\t\tconst abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);\n\t\t\t\tconst lineHeight = 13;\n\t\t\t\tconst baseY = h.isLagna ? center.y + 8 : center.y;\n\t\t\t\tconst startY = baseY - ((planets.length - 1) * lineHeight) / 2;\n\t\t\t\tconst yPos = startY + j * lineHeight;\n\t\t\t\treturn svg`<text class=\"planet-text\" x=${center.x} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${abbr}</text>`;\n\t\t\t})}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render a north-Indian-style kundli wheel frame (grid lines only).\n * Returns the SVG structural lines; call `renderNorthHouseGroup` for content.\n */\nexport function renderNorthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"150\" y2=\"290\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"290\" y2=\"150\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t`;\n}\n\n/**\n * Render a north-Indian house group (sign abbr + house number + planets).\n */\nexport function renderNorthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = NORTH_HOUSE_CENTERS[h.number];\n\tif (!center) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\tconst planets = h.planets;\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<circle class=\"lagna-bg\" cx=${center.x} cy=${center.y} r=\"22\" />`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${center.x} y=${center.y - 10} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t<text class=\"house-num\" x=${center.x} y=${center.y + 2} text-anchor=\"middle\" dominant-baseline=\"central\">${h.number}</text>\n\t\t\t${planets.map((planet, j) => {\n\t\t\t\tconst abbr = PLANET_ABBR[capitalize(planet)] ?? planet.slice(0, 2);\n\t\t\t\tconst lineHeight = 11;\n\t\t\t\tconst startY = center.y + 14 - ((planets.length - 1) * lineHeight) / 2;\n\t\t\t\tconst yPos = startY + j * lineHeight;\n\t\t\t\treturn svg`<text class=\"planet-text\" x=${center.x} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${abbr}</text>`;\n\t\t\t})}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render the south-Indian square frame (border diamond + inner square + radial lines).\n */\nexport function renderSouthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<polygon class=\"line\" points=\"220,80 220,220 80,220 80,80\" stroke-width=\"1\" fill=\"none\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t`;\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;;;
|
|
3
|
+
"sources": ["../../src/components/vedic-kundli.ts", "../../src/utils/base-styles.ts", "../../src/utils/kundli-render.ts", "../../src/tokens/index.ts", "../../src/utils/degree.ts", "../../src/utils/string.ts"],
|
|
4
|
+
"sourcesContent": ["import { css, html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport type { BirthChartResponse } from '../types/index.js';\nimport { baseStyles } from '../utils/base-styles.js';\nimport {\n\tbuildHousesFromMeta,\n\ttype HouseDef,\n\trenderEastFrame,\n\trenderEastHouseGroup,\n\trenderNorthFrame,\n\trenderNorthHouseGroup,\n\trenderSouthFrame,\n\trenderSouthHouseGroup,\n} from '../utils/kundli-render.js';\n\n/**\n * Vedic kundli (D1 Rashi chart). Pass `data` from /vedic-astrology/birth-chart.\n * Three render styles via the `chart-style` attribute: south (default),\n * north, and east. All three draw the identical planet-in-sign data, so the\n * style is purely a layout choice. Each planet shows its abbreviation and\n * whole-degree, with an SVG tooltip carrying exact position, nakshatra, pada,\n * and avastha.\n *\n * Theming flows through CSS custom properties on :host, so the chart adopts\n * the host page palette without runtime color probing.\n */\n@customElement('roxy-vedic-kundli')\nexport class RoxyVedicKundli extends LitElement {\n\tstatic styles = [\n\t\tbaseStyles,\n\t\tcss`\n\t\t\t.wrap {\n\t\t\t\tdisplay: grid;\n\t\t\t\tgap: var(--roxy-space-md, 1rem);\n\t\t\t}\n\t\t\t.title {\n\t\t\t\tfont-size: var(--roxy-text-lg, 1.125rem);\n\t\t\t\tfont-weight: var(--roxy-weight-bold, 600);\n\t\t\t\tmargin: 0;\n\t\t\t}\n\t\t\tsvg {\n\t\t\t\tdisplay: block;\n\t\t\t\twidth: 100%;\n\t\t\t\tmax-width: 360px;\n\t\t\t\tmargin: 0 auto;\n\t\t\t}\n\t\t\t.line {\n\t\t\t\tfill: transparent;\n\t\t\t\tstroke: var(--roxy-border, #e4e4e7);\n\t\t\t}\n\t\t\t.sign-text {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 500;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.planet-text {\n\t\t\t\tfill: var(--roxy-fg, #0a0a0a);\n\t\t\t\tfont-size: 10px;\n\t\t\t\tfont-weight: 600;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.house-num {\n\t\t\t\tfill: var(--roxy-muted, #71717a);\n\t\t\t\tfont-size: 9px;\n\t\t\t\tfont-weight: 400;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t}\n\t\t\t.lagna-marker {\n\t\t\t\tfill: var(--roxy-accent-fg, #b45309);\n\t\t\t\tfont-size: 8px;\n\t\t\t\tfont-weight: 700;\n\t\t\t\tfont-family: var(--roxy-font-sans);\n\t\t\t\tletter-spacing: 0.05em;\n\t\t\t}\n\t\t\t.lagna-bg {\n\t\t\t\tfill: color-mix(in srgb, var(--roxy-accent, #f59e0b) 12%, transparent);\n\t\t\t\tstroke: color-mix(in srgb, var(--roxy-accent, #f59e0b) 45%, transparent);\n\t\t\t\tstroke-width: 0.8;\n\t\t\t}\n\t\t`,\n\t];\n\n\t@property({ attribute: false })\n\tdata: BirthChartResponse | null = null;\n\n\t@property({ type: String, reflect: true, attribute: 'chart-style' })\n\tchartStyle: 'south' | 'north' | 'east' = 'south';\n\n\tprivate buildHouses(): HouseDef[] {\n\t\tif (!this.data?.meta) return [];\n\t\treturn buildHousesFromMeta(this.data.meta);\n\t}\n\n\trender() {\n\t\tif (!this.data)\n\t\t\treturn html`<div class=\"roxy-empty\" role=\"status\">No kundli data</div>`;\n\t\tconst houses = this.buildHouses();\n\t\tconst style = this.chartStyle;\n\n\t\tconst frame =\n\t\t\tstyle === 'north'\n\t\t\t\t? renderNorthFrame()\n\t\t\t\t: style === 'east'\n\t\t\t\t\t? renderEastFrame()\n\t\t\t\t\t: renderSouthFrame();\n\t\tconst houseGroup =\n\t\t\tstyle === 'north'\n\t\t\t\t? renderNorthHouseGroup\n\t\t\t\t: style === 'east'\n\t\t\t\t\t? renderEastHouseGroup\n\t\t\t\t\t: renderSouthHouseGroup;\n\n\t\treturn html`<div class=\"wrap\">\n\t\t\t<h2 class=\"title\">Vedic kundli</h2>\n\t\t\t<svg\n\t\t\t\tviewBox=\"0 0 300 300\"\n\t\t\t\trole=\"img\"\n\t\t\t\taria-label=\"Vedic birth chart with twelve sign houses\"\n\t\t\t>\n\t\t\t\t<title>Vedic kundli</title>\n\t\t\t\t${frame}\n\t\t\t\t${houses.map((h) => houseGroup(h))}\n\t\t\t</svg>\n\t\t</div>`;\n\t}\n}\n\ndeclare global {\n\tinterface HTMLElementTagNameMap {\n\t\t'roxy-vedic-kundli': RoxyVedicKundli;\n\t}\n}\n", "import { css } from 'lit';\n\n/**\n * Shared host styles every component pulls in. Sets default font, color,\n * container query support, and the entry fade-in.\n */\nexport const baseStyles = css`\n\t:host {\n\t\tdisplay: block;\n\t\tcontainer-type: inline-size;\n\t\tfont-family: var(\n\t\t\t--roxy-font-sans,\n\t\t\tsystem-ui,\n\t\t\t-apple-system,\n\t\t\tBlinkMacSystemFont,\n\t\t\t'Segoe UI',\n\t\t\tRoboto,\n\t\t\tsans-serif\n\t\t);\n\t\tcolor: var(--roxy-fg, #0a0a0a);\n\t\tbackground: transparent;\n\t\tfont-size: var(--roxy-text-base, 1rem);\n\t\tline-height: var(--roxy-leading-normal, 1.5);\n\t\tanimation: roxy-fade-in var(--roxy-motion-duration, 200ms)\n\t\t\tvar(--roxy-motion-easing, cubic-bezier(0.4, 0, 0.2, 1)) both;\n\t}\n\n\t*,\n\t*::before,\n\t*::after {\n\t\tbox-sizing: border-box;\n\t}\n\n\t@keyframes roxy-fade-in {\n\t\tfrom {\n\t\t\topacity: 0;\n\t\t\ttransform: translateY(2px);\n\t\t}\n\t\tto {\n\t\t\topacity: 1;\n\t\t\ttransform: translateY(0);\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t:host {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-skeleton {\n\t\tbackground: linear-gradient(\n\t\t\t90deg,\n\t\t\tvar(--roxy-border, #e4e4e7) 0%,\n\t\t\tcolor-mix(in srgb, var(--roxy-border, #e4e4e7) 60%, transparent) 50%,\n\t\t\tvar(--roxy-border, #e4e4e7) 100%\n\t\t);\n\t\tbackground-size: 200% 100%;\n\t\tanimation: roxy-shimmer 1.4s ease-in-out infinite;\n\t\tborder-radius: var(--roxy-radius-md, 8px);\n\t}\n\n\t@keyframes roxy-shimmer {\n\t\t0% {\n\t\t\tbackground-position: 200% 0;\n\t\t}\n\t\t100% {\n\t\t\tbackground-position: -200% 0;\n\t\t}\n\t}\n\n\t@media (prefers-reduced-motion: reduce) {\n\t\t.roxy-skeleton {\n\t\t\tanimation: none;\n\t\t}\n\t}\n\n\t.roxy-empty {\n\t\tpadding: var(--roxy-space-lg, 1.5rem);\n\t\tcolor: var(--roxy-muted, #71717a);\n\t\ttext-align: center;\n\t\tfont-size: var(--roxy-text-sm, 0.875rem);\n\t}\n\n\t:host(:focus-within) .roxy-card {\n\t\toutline: 2px solid var(--roxy-ring, rgba(245, 158, 11, 0.4));\n\t\toutline-offset: 2px;\n\t}\n`;\n", "import type { TemplateResult } from 'lit';\nimport { nothing, svg } from 'lit';\nimport { PLANET_ABBR, SIGN_ABBR, SIGNS_ORDER } from '../tokens/index.js';\nimport { longitudeToSignPosition } from './degree.js';\nimport { capitalize } from './string.js';\n\nexport const KUNDLI_SIZE = 300;\nexport const KUNDLI_CENTER = 150;\n\n/**\n * Maps a lowercase rashi key (e.g. \"aries\") back to its canonical sign name\n * (e.g. \"Aries\"). Used by every kundli consumer to bridge spec lowercase\n * rashi keys to the title-cased SIGNS_ORDER tokens.\n */\nexport const RASHI_TO_SIGN: Record<string, string> = Object.fromEntries(\n\tSIGNS_ORDER.map((s) => [s.toLowerCase(), s] as const),\n);\n\n/**\n * A planet placed in a kundli house. This is a render-only view model, not an\n * API type: it carries just enough per-graha detail to draw a compact label\n * (abbreviation plus degree-within-sign plus retrograde mark) and a rich SVG\n * `<title>` tooltip (full position, nakshatra, pada, avastha). Both the D1\n * birth chart and the Dx divisional charts feed it from their `meta` map.\n */\nexport interface PlacedGraha {\n\tgraha: string;\n\tlongitude?: number;\n\tnakshatra?: { name?: string; pada?: number; lord?: string };\n\tisRetrograde?: boolean;\n\tawastha?: string;\n}\n\nexport interface HouseDef {\n\t/** 1-based cell number. For the sign-fixed styles (south, east) this is the rashi index, Aries = 1. */\n\tnumber: number;\n\t/** Sign name (TitleCase, e.g. \"Aries\"). */\n\tsign: string;\n\t/** Planets occupying this house, with full detail for label + tooltip. */\n\tplanets: PlacedGraha[];\n\t/** Whether this house is the ascendant (Lagna). */\n\tisLagna: boolean;\n}\n\n/** Superscript \"r\" used as a compact retrograde marker on planet labels. */\nconst RETRO_MARK = '\u02B3';\n\n/**\n * Compact in-cell label for a placed graha: abbreviation, whole-degree within\n * the sign, and a retrograde mark. Degree is omitted when longitude is absent.\n */\nfunction grahaLabel(p: PlacedGraha): string {\n\tconst abbr = PLANET_ABBR[capitalize(p.graha)] ?? p.graha.slice(0, 2);\n\tconst retro = p.isRetrograde ? RETRO_MARK : '';\n\tif (typeof p.longitude !== 'number' || !Number.isFinite(p.longitude)) {\n\t\treturn `${abbr}${retro}`;\n\t}\n\tconst { degree } = longitudeToSignPosition(p.longitude);\n\treturn `${abbr} ${degree}\u00B0${retro}`;\n}\n\n/**\n * Full-detail tooltip text for a placed graha: name, exact degree and minute,\n * nakshatra and pada, avastha, retrograde. Surfaced via an SVG `<title>` so the\n * chart cell itself stays compact.\n */\nfunction grahaTitle(p: PlacedGraha): string {\n\tconst parts: string[] = [capitalize(p.graha)];\n\tif (typeof p.longitude === 'number' && Number.isFinite(p.longitude)) {\n\t\tconst sp = longitudeToSignPosition(p.longitude);\n\t\tparts.push(\n\t\t\t`${sp.degree}\u00B0${String(sp.minute).padStart(2, '0')}' ${sp.sign}`,\n\t\t);\n\t}\n\tif (p.nakshatra?.name) {\n\t\tconst pada = p.nakshatra.pada ? ` pada ${p.nakshatra.pada}` : '';\n\t\tparts.push(`${p.nakshatra.name}${pada}`);\n\t}\n\tif (p.awastha) parts.push(p.awastha);\n\tif (p.isRetrograde) parts.push('retrograde');\n\treturn parts.join(' \u00B7 ');\n}\n\n/**\n * Render the stack of planet labels for one house cell. Shared by all three\n * styles: vertically centers the stack on `baseY`, one line per planet, each\n * with a `<title>` tooltip carrying the full detail.\n */\nfunction renderPlanetStack(\n\tplanets: PlacedGraha[],\n\tcx: number,\n\tbaseY: number,\n\tlineHeight: number,\n): (TemplateResult | typeof nothing)[] {\n\tconst startY = baseY - ((planets.length - 1) * lineHeight) / 2;\n\treturn planets.map((p, j) => {\n\t\tconst yPos = startY + j * lineHeight;\n\t\treturn svg`<text class=\"planet-text\" x=${cx} y=${yPos} text-anchor=\"middle\" dominant-baseline=\"central\">${grahaLabel(\n\t\t\tp,\n\t\t)}<title>${grahaTitle(p)}</title></text>`;\n\t});\n}\n\n/**\n * South Indian fixed-house square grid: house centers for planet text labels.\n * House 1 is fixed top-center; positions are in the 300x300 viewBox.\n */\nexport const SOUTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 58 },\n\t2: { x: 205, y: 52 },\n\t3: { x: 253, y: 112 },\n\t4: { x: 243, y: 150 },\n\t5: { x: 253, y: 188 },\n\t6: { x: 205, y: 248 },\n\t7: { x: 150, y: 242 },\n\t8: { x: 95, y: 248 },\n\t9: { x: 47, y: 188 },\n\t10: { x: 57, y: 150 },\n\t11: { x: 47, y: 112 },\n\t12: { x: 95, y: 52 },\n};\n\n/**\n * South Indian sign abbreviation positions (slightly outward from center).\n */\nexport const SOUTH_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 35 },\n\t2: { x: 222, y: 40 },\n\t3: { x: 265, y: 100 },\n\t4: { x: 265, y: 150 },\n\t5: { x: 265, y: 200 },\n\t6: { x: 222, y: 260 },\n\t7: { x: 150, y: 265 },\n\t8: { x: 78, y: 260 },\n\t9: { x: 35, y: 200 },\n\t10: { x: 35, y: 150 },\n\t11: { x: 35, y: 100 },\n\t12: { x: 78, y: 40 },\n};\n\n/**\n * North Indian style: 12 triangular house positions.\n * Lagna (house 1) is the top diamond, numbered clockwise.\n * Centers represent the visual midpoint of each triangular cell.\n */\nexport const NORTH_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 60 },\n\t2: { x: 225, y: 100 },\n\t3: { x: 255, y: 150 },\n\t4: { x: 225, y: 200 },\n\t5: { x: 150, y: 240 },\n\t6: { x: 75, y: 200 },\n\t7: { x: 45, y: 150 },\n\t8: { x: 75, y: 100 },\n\t9: { x: 100, y: 80 },\n\t10: { x: 150, y: 108 },\n\t11: { x: 200, y: 80 },\n\t12: { x: 200, y: 220 },\n};\n\n/**\n * East Indian style: a fixed-sign square (like South Indian) cut by both\n * diagonals and an inner diamond joining the side midpoints, giving 12 cells.\n * The four inner-diamond quadrilaterals hold the cardinal-position signs\n * (cell 1, 4, 7, 10) and the eight corner half-triangles fill between them,\n * laid out clockwise from the top so cell `n` holds the n-th rashi (Aries = 1).\n * Centers are the visual midpoints of those cells in the 300x300 viewBox,\n * derived from the frame geometry (square 10..290, diagonals, side-midpoint\n * diamond).\n *\n * @remarks The cell geometry is exact; the rashi-to-cell order follows the\n * common clockwise-from-top convention and is slated for a regional\n * reference-image confirmation pass (see docs/todo.md \"East Indian polish\").\n */\nexport const EAST_HOUSE_CENTERS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 80 }, // inner diamond, top\n\t2: { x: 220, y: 33 }, // top-right corner, upper triangle\n\t3: { x: 267, y: 80 }, // top-right corner, right triangle\n\t4: { x: 220, y: 150 }, // inner diamond, right\n\t5: { x: 267, y: 220 }, // bottom-right corner, right triangle\n\t6: { x: 220, y: 267 }, // bottom-right corner, lower triangle\n\t7: { x: 150, y: 220 }, // inner diamond, bottom\n\t8: { x: 80, y: 267 }, // bottom-left corner, lower triangle\n\t9: { x: 33, y: 220 }, // bottom-left corner, left triangle\n\t10: { x: 80, y: 150 }, // inner diamond, left\n\t11: { x: 33, y: 80 }, // top-left corner, left triangle\n\t12: { x: 80, y: 33 }, // top-left corner, upper triangle\n};\n\n/**\n * East Indian sign abbreviation positions, nudged toward the outer edge of\n * every cell so the abbreviation and the planet stack do not collide.\n */\nexport const EAST_SIGN_POSITIONS: Record<number, { x: number; y: number }> = {\n\t1: { x: 150, y: 55 },\n\t2: { x: 235, y: 24 },\n\t3: { x: 276, y: 62 },\n\t4: { x: 242, y: 150 },\n\t5: { x: 276, y: 238 },\n\t6: { x: 235, y: 276 },\n\t7: { x: 150, y: 245 },\n\t8: { x: 65, y: 276 },\n\t9: { x: 24, y: 238 },\n\t10: { x: 58, y: 150 },\n\t11: { x: 24, y: 62 },\n\t12: { x: 65, y: 24 },\n};\n\n/**\n * Render a single south-Indian house group: lagna highlight, sign\n * abbreviation, planet labels with degree and tooltip.\n */\nexport function renderSouthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = SOUTH_HOUSE_CENTERS[h.number];\n\tconst signPos = SOUTH_SIGN_POSITIONS[h.number];\n\tif (!center || !signPos) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\tconst baseY = h.isLagna ? center.y + 8 : center.y;\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<rect\n\t\t\t\t\t\t\tclass=\"lagna-bg\"\n\t\t\t\t\t\t\tx=${center.x - 30} y=${center.y - 28}\n\t\t\t\t\t\t\twidth=\"60\" height=\"56\" rx=\"6\"\n\t\t\t\t\t\t/>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${signPos.x} y=${signPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<text class=\"lagna-marker\" x=${center.x} y=${center.y - 18} text-anchor=\"middle\" dominant-baseline=\"central\">LAGNA</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${renderPlanetStack(h.planets, center.x, baseY, 13)}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render a north-Indian-style kundli wheel frame (grid lines only).\n * Returns the SVG structural lines; call `renderNorthHouseGroup` for content.\n */\nexport function renderNorthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"150\" y2=\"290\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"290\" y2=\"150\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"10\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"290\" y2=\"150\" stroke-width=\"0.6\" stroke-dasharray=\"3,3\" />\n\t`;\n}\n\n/**\n * Render a north-Indian house group (sign abbr + house number + planets).\n */\nexport function renderNorthHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = NORTH_HOUSE_CENTERS[h.number];\n\tif (!center) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<circle class=\"lagna-bg\" cx=${center.x} cy=${center.y} r=\"22\" />`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${center.x} y=${center.y - 10} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t<text class=\"house-num\" x=${center.x} y=${center.y + 2} text-anchor=\"middle\" dominant-baseline=\"central\">${h.number}</text>\n\t\t\t${renderPlanetStack(h.planets, center.x, center.y + 14, 11)}\n\t\t</g>\n\t`;\n}\n\n/**\n * Render the south-Indian square frame (border diamond + inner square + radial lines).\n */\nexport function renderSouthFrame(): TemplateResult {\n\treturn svg`\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1.5\" />\n\t\t<polygon class=\"line\" points=\"220,80 220,220 80,220 80,80\" stroke-width=\"1\" fill=\"none\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"10\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"80\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"150\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"220\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"150\" y1=\"290\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"220\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"150\" x2=\"80\" y2=\"80\" stroke-width=\"1\" />\n\t`;\n}\n\n/**\n * Render the east-Indian square frame: outer square, both diagonals, and the\n * inner diamond joining the four side midpoints. Twelve triangular cells.\n */\nexport function renderEastFrame(): TemplateResult {\n\treturn svg`\n\t\t<rect class=\"line\" x=\"10\" y=\"10\" width=\"280\" height=\"280\" stroke-width=\"1.5\" fill=\"none\" />\n\t\t<line class=\"line\" x1=\"10\" y1=\"10\" x2=\"290\" y2=\"290\" stroke-width=\"1\" />\n\t\t<line class=\"line\" x1=\"290\" y1=\"10\" x2=\"10\" y2=\"290\" stroke-width=\"1\" />\n\t\t<polygon class=\"line\" points=\"150,10 290,150 150,290 10,150\" stroke-width=\"1\" fill=\"none\" />\n\t`;\n}\n\n/**\n * Render an east-Indian house group. East Indian charts are sign-fixed like\n * the south style, so this mirrors `renderSouthHouseGroup` with the east cell\n * centers and a smaller line height to fit the triangular cells.\n */\nexport function renderEastHouseGroup(\n\th: HouseDef,\n): TemplateResult | typeof nothing {\n\tconst center = EAST_HOUSE_CENTERS[h.number];\n\tconst signPos = EAST_SIGN_POSITIONS[h.number];\n\tif (!center || !signPos) return nothing;\n\tconst signAbbr = SIGN_ABBR[h.sign] ?? '';\n\treturn svg`\n\t\t<g>\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<circle class=\"lagna-bg\" cx=${center.x} cy=${center.y} r=\"20\" />`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\tsignAbbr\n\t\t\t\t\t? svg`<text class=\"sign-text\" x=${signPos.x} y=${signPos.y} text-anchor=\"middle\" dominant-baseline=\"central\">${signAbbr}</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${\n\t\t\t\th.isLagna\n\t\t\t\t\t? svg`<text class=\"lagna-marker\" x=${center.x} y=${center.y - 14} text-anchor=\"middle\" dominant-baseline=\"central\">LAGNA</text>`\n\t\t\t\t\t: nothing\n\t\t\t}\n\t\t\t${renderPlanetStack(h.planets, center.x, center.y + 2, 11)}\n\t\t</g>\n\t`;\n}\n\n/**\n * Bucket a graha-keyed `meta` map (from a D1 or Dx chart response) into the 12\n * sign-indexed houses. Shared by the kundli and divisional chart components so\n * both render the same rich per-graha detail. The Lagna entry is consumed only\n * to flag the ascendant cell, not rendered as a planet.\n */\nexport function buildHousesFromMeta(\n\tmeta: Record<\n\t\tstring,\n\t\t{\n\t\t\tgraha?: string;\n\t\t\trashi?: string;\n\t\t\tlongitude?: number;\n\t\t\tnakshatra?: { name?: string; pada?: number; lord?: string };\n\t\t\tisRetrograde?: boolean;\n\t\t\tawastha?: string;\n\t\t}\n\t>,\n): HouseDef[] {\n\tconst byRashi = new Map<string, PlacedGraha[]>();\n\tlet lagnaKey = '';\n\tfor (const [name, pos] of Object.entries(meta)) {\n\t\tconst rashiKey = (pos?.rashi ?? '').toLowerCase();\n\t\tif (name === 'Lagna' || pos?.graha === 'Lagna') {\n\t\t\tlagnaKey = rashiKey;\n\t\t\tcontinue;\n\t\t}\n\t\tif (!rashiKey) continue;\n\t\tconst list = byRashi.get(rashiKey) ?? [];\n\t\tlist.push({\n\t\t\tgraha: pos.graha ?? name,\n\t\t\tlongitude: pos.longitude,\n\t\t\tnakshatra: pos.nakshatra,\n\t\t\tisRetrograde: pos.isRetrograde,\n\t\t\tawastha: pos.awastha,\n\t\t});\n\t\tbyRashi.set(rashiKey, list);\n\t}\n\treturn SIGNS_ORDER.map((sign, i) => {\n\t\tconst key = sign.toLowerCase();\n\t\treturn {\n\t\t\tnumber: i + 1,\n\t\t\tsign,\n\t\t\tplanets: byRashi.get(key) ?? [],\n\t\t\tisLagna: lagnaKey === key,\n\t\t};\n\t});\n}\n", "/**\n * Symbol constants used across components. Single source of truth so chart\n * wheels, card headers, hexagram displays, and panchang tables stay visually\n * consistent.\n */\n\nexport const PLANET_GLYPH: Record<string, string> = {\n\tSun: '\u2609',\n\tMoon: '\u263D',\n\tMercury: '\u263F',\n\tVenus: '\u2640',\n\tEarth: '\u2641',\n\tMars: '\u2642',\n\tJupiter: '\u2643',\n\tSaturn: '\u2644',\n\tUranus: '\u2645',\n\tNeptune: '\u2646',\n\tPluto: '\u2647',\n\tRahu: '\u260A',\n\tKetu: '\u260B',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n\tNorthNode: '\u260A',\n\tSouthNode: '\u260B',\n\t'North node': '\u260A',\n\t'South node': '\u260B',\n\tChiron: '\u26B7',\n\tLilith: '\u26B8',\n\t'Black moon lilith': '\u26B8',\n};\n\nexport const PLANET_ABBR: Record<string, string> = {\n\tSun: 'Su',\n\tMoon: 'Mo',\n\tMercury: 'Me',\n\tVenus: 'Ve',\n\tMars: 'Ma',\n\tJupiter: 'Ju',\n\tSaturn: 'Sa',\n\tUranus: 'Ur',\n\tNeptune: 'Ne',\n\tPluto: 'Pl',\n\tRahu: 'Ra',\n\tKetu: 'Ke',\n\tAscendant: 'Asc',\n\tLagna: 'La',\n};\n\nexport const SIGN_GLYPH: Record<string, string> = {\n\tAries: '\u2648',\n\tTaurus: '\u2649',\n\tGemini: '\u264A',\n\tCancer: '\u264B',\n\tLeo: '\u264C',\n\tVirgo: '\u264D',\n\tLibra: '\u264E',\n\tScorpio: '\u264F',\n\tSagittarius: '\u2650',\n\tCapricorn: '\u2651',\n\tAquarius: '\u2652',\n\tPisces: '\u2653',\n};\n\nexport const SIGN_ABBR: Record<string, string> = {\n\tAries: 'Ar',\n\tTaurus: 'Ta',\n\tGemini: 'Ge',\n\tCancer: 'Cn',\n\tLeo: 'Le',\n\tVirgo: 'Vi',\n\tLibra: 'Li',\n\tScorpio: 'Sc',\n\tSagittarius: 'Sg',\n\tCapricorn: 'Cp',\n\tAquarius: 'Aq',\n\tPisces: 'Pi',\n};\n\nexport const SIGNS_ORDER = [\n\t'Aries',\n\t'Taurus',\n\t'Gemini',\n\t'Cancer',\n\t'Leo',\n\t'Virgo',\n\t'Libra',\n\t'Scorpio',\n\t'Sagittarius',\n\t'Capricorn',\n\t'Aquarius',\n\t'Pisces',\n] as const;\n\n/**\n * Lowercase rashi keys in canonical zodiac order. Derived from `SIGNS_ORDER`\n * so the two stay in lockstep. The /vedic-astrology/birth-chart response\n * carries planet buckets keyed by these names.\n */\nexport const RASHI_KEYS = SIGNS_ORDER.map((s) =>\n\ts.toLowerCase(),\n) as readonly Lowercase<(typeof SIGNS_ORDER)[number]>[];\n\n/** Aspect symbols. Used by synastry and natal chart aspect tables. */\nexport const ASPECT_SYMBOL: Record<string, string> = {\n\tconjunction: '\u260C',\n\topposition: '\u260D',\n\ttrine: '\u25B3',\n\tsquare: '\u25A1',\n\tsextile: '\u2731',\n\tquincunx: '\u22BB',\n\tsemisextile: '\u22BC',\n};\n\n/** Trigrams used by I Ching hexagrams. Eight trigrams compose 64 hexagrams. */\nexport const TRIGRAM_GLYPH: Record<string, string> = {\n\theaven: '\u2630',\n\tlake: '\u2631',\n\tfire: '\u2632',\n\tthunder: '\u2633',\n\twind: '\u2634',\n\twater: '\u2635',\n\tmountain: '\u2636',\n\tearth: '\u2637',\n\tHeaven: '\u2630',\n\tLake: '\u2631',\n\tFire: '\u2632',\n\tThunder: '\u2633',\n\tWind: '\u2634',\n\tWater: '\u2635',\n\tMountain: '\u2636',\n\tEarth: '\u2637',\n};\n\n/** Moon phase emoji set. Used by moon phase card. */\nexport const MOON_PHASE_EMOJI: Record<string, string> = {\n\t'new moon': '\uD83C\uDF11',\n\t'waxing crescent': '\uD83C\uDF12',\n\t'first quarter': '\uD83C\uDF13',\n\t'waxing gibbous': '\uD83C\uDF14',\n\t'full moon': '\uD83C\uDF15',\n\t'waning gibbous': '\uD83C\uDF16',\n\t'last quarter': '\uD83C\uDF17',\n\t'waning crescent': '\uD83C\uDF18',\n};\n", "/**\n * Math helpers for converting raw ecliptic longitude decimals into the\n * sign / degree / minute / second triplet used across chart components.\n */\n\nimport { SIGNS_ORDER } from '../tokens/index.js';\n\nexport interface SignPosition {\n\tsign: string;\n\tsignIndex: number;\n\tdegree: number;\n\tminute: number;\n\tsecond: number;\n}\n\n/**\n * Wrap longitude into [0, 360) so negative or out-of-range values still\n * resolve to a real sign. Robust to wonky upstream data.\n */\nexport function normalizeLongitude(lon: number): number {\n\tconst wrapped = lon % 360;\n\treturn wrapped < 0 ? wrapped + 360 : wrapped;\n}\n\n/**\n * Convert decimal ecliptic longitude (0-360) into sign/degree/minute/second.\n * Used by every chart wheel and aspect table.\n */\nexport function longitudeToSignPosition(longitude: number): SignPosition {\n\tconst lon = normalizeLongitude(longitude);\n\tconst signIndex = Math.floor(lon / 30) % 12;\n\tconst within = lon % 30;\n\tconst degree = Math.floor(within);\n\tconst minuteFloat = (within - degree) * 60;\n\tconst minute = Math.floor(minuteFloat);\n\tconst second = Math.round((minuteFloat - minute) * 60);\n\treturn {\n\t\tsign: SIGNS_ORDER[signIndex] ?? 'Aries',\n\t\tsignIndex,\n\t\tdegree,\n\t\tminute,\n\t\tsecond,\n\t};\n}\n\n/** Compact display string like \"12\u00B0 Leo 34'\". Used in chart labels. */\nexport function formatSignPosition(longitude: number): string {\n\tconst { sign, degree, minute } = longitudeToSignPosition(longitude);\n\treturn `${degree}\u00B0 ${sign} ${String(minute).padStart(2, '0')}'`;\n}\n\n/**\n * The point diametrically opposite a longitude (e.g. Descendant from\n * Ascendant, IC from MC). Exact derivation, always 180 degrees away.\n */\nexport function oppositePoint(longitude: number): number {\n\treturn normalizeLongitude(longitude + 180);\n}\n\n/**\n * Midpoint of the forward arc from `start` to `end` (both ecliptic\n * longitudes). Handles the 360/0 wrap, so a house spanning 350 to 20 degrees\n * yields a midpoint of 5, not 185. Used to place house numbers between two\n * cusps regardless of how unequal the house is.\n */\nexport function arcMidpoint(start: number, end: number): number {\n\tconst s = normalizeLongitude(start);\n\tlet span = normalizeLongitude(end) - s;\n\tif (span < 0) span += 360;\n\treturn normalizeLongitude(s + span / 2);\n}\n\n/** Polar to cartesian for SVG wheel positioning. Angle in degrees, 0 at 3 o'clock. */\nexport function polarToCartesian(\n\tcx: number,\n\tcy: number,\n\tradius: number,\n\tangleDeg: number,\n): { x: number; y: number } {\n\tconst angleRad = (angleDeg * Math.PI) / 180;\n\treturn {\n\t\tx: cx + radius * Math.cos(angleRad),\n\t\ty: cy + radius * Math.sin(angleRad),\n\t};\n}\n", "/**\n * Shared string helpers used across components. Single source of truth so the\n * same formatting rules apply to every key/label/title that surfaces in the\n * shadow tree.\n *\n * - `capitalize`: title-cases the first character, lowercases the rest. Used\n * when matching API-supplied planet/sign names against the glyph maps in\n * `tokens/index.ts`, which use canonical TitleCase keys.\n * - `humanize`: turns an API key (`birth_date`, `birthDate`, `mahadasha-end`)\n * into a label suitable for display (\"Birth date\", \"Mahadasha end\").\n */\n\nexport function capitalize(s: string): string {\n\tif (!s) return '';\n\treturn s.charAt(0).toUpperCase() + s.slice(1).toLowerCase();\n}\n\nexport function humanize(s: string): string {\n\treturn s\n\t\t.replace(/[_-]+/g, ' ')\n\t\t.replace(/([a-z])([A-Z])/g, '$1 $2')\n\t\t.replace(/^\\w/, (c) => c.toUpperCase());\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;AAAA,SAAS,OAAAA,MAAK,MAAM,kBAAkB;AACtC,SAAS,eAAe,gBAAgB;;;ACDxC,SAAS,WAAW;AAMb,IAAM,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACL1B,SAAS,SAAS,WAAW;;;AC8BtB,IAAM,cAAsC;AAAA,EAClD,KAAK;AAAA,EACL,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,OAAO;AAAA,EACP,MAAM;AAAA,EACN,MAAM;AAAA,EACN,WAAW;AAAA,EACX,OAAO;AACR;AAiBO,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BAAiB;AACtB,UAAM,aACL,UAAU,UACP,wBACA,UAAU,SACT,uBACA;AAEL,WAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAQH,KAAK;AAAA,MACL,OAAO,IAAI,CAAC,MAAM,WAAW,CAAC,CAAC,CAAC;AAAA;AAAA;AAAA,EAGrC;AACD;AAnGa,gBACL,SAAS;AAAA,EACf;AAAA,EACAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDD;AAGA;AAAA,EADC,SAAS,EAAE,WAAW,MAAM,CAAC;AAAA,GAxDlB,gBAyDZ;AAGA;AAAA,EADC,SAAS,EAAE,MAAM,QAAQ,SAAS,MAAM,WAAW,cAAc,CAAC;AAAA,GA3DvD,gBA4DZ;AA5DY,kBAAN;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB;",
|
|
6
6
|
"names": ["css", "css"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { BirthChartResponse } from '../types/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Vedic planetary positions table. Renders /vedic-astrology/birth-chart `meta`
|
|
5
|
+
* as the full reference-grade positions grid a practitioner reads alongside
|
|
6
|
+
* the kundli wheel: graha, rashi, exact degree, nakshatra and pada, nakshatra
|
|
7
|
+
* lord, bhava (house), Baladi avastha, and retrograde.
|
|
8
|
+
*/
|
|
9
|
+
export declare class RoxyVedicPlanetsTable extends LitElement {
|
|
10
|
+
static styles: import("lit").CSSResult[];
|
|
11
|
+
data: BirthChartResponse | null;
|
|
12
|
+
/** Ordered [name, entry] pairs: GRAHA_ORDER first, then any extras. */
|
|
13
|
+
private orderedRows;
|
|
14
|
+
render(): import("lit").TemplateResult<1>;
|
|
15
|
+
}
|
|
16
|
+
declare global {
|
|
17
|
+
interface HTMLElementTagNameMap {
|
|
18
|
+
'roxy-vedic-planets-table': RoxyVedicPlanetsTable;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=vedic-planets-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vedic-planets-table.d.ts","sourceRoot":"","sources":["../../src/components/vedic-planets-table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAAC;AAGrD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAwB5D;;;;;GAKG;AACH,qBACa,qBAAsB,SAAQ,UAAU;IACpD,MAAM,CAAC,MAAM,4BAqEX;IAGF,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAAQ;IAEvC,uEAAuE;IACvE,OAAO,CAAC,WAAW;IAiBnB,MAAM;CAkDN;AAED,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,qBAAqB;QAC9B,0BAA0B,EAAE,qBAAqB,CAAC;KAClD;CACD"}
|