caelus-wheel 0.1.1 → 0.2.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/README.md CHANGED
@@ -3,11 +3,15 @@
3
3
  React SVG chart wheel for [caelus](https://github.com/heavyblotto/caelus).
4
4
  SSR-safe, zero runtime dependencies (react is a peer), ~3.4 KB gzipped.
5
5
 
6
+ ```bash
7
+ npm install caelus-wheel
8
+ ```
9
+
6
10
  ```tsx
7
11
  import { ChartWheel } from "caelus-wheel";
8
12
 
9
13
  <ChartWheel
10
- chart={chart} // the Chart object from caelus, as-is
14
+ chart={chart} // caelus Chart object or caelus-mcp chart payload, as-is
11
15
  size={520} // px, square
12
16
  showAspects={true}
13
17
  aspectTypes={["conjunction", "sextile", "square", "trine", "opposition"]}
@@ -15,6 +19,11 @@ import { ChartWheel } from "caelus-wheel";
15
19
  />
16
20
  ```
17
21
 
22
+ `chart` accepts either the `Chart` object from the caelus engine or a
23
+ `natal_chart` / `current_sky` response from caelus-mcp — the MCP payload's
24
+ `rx` retrograde flag is understood and `signDeg` is derived from `lon`
25
+ when absent. An MCP client can pipe a tool response straight in.
26
+
18
27
  ## What it draws
19
28
 
20
29
  - **Zodiac ring** — sign glyphs, sign boundaries, 1°/5°/10° tick marks.
@@ -40,3 +49,10 @@ counterclockwise.
40
49
  - Pure render: no hooks, no client-only APIs — works in server components,
41
50
  static export, and `renderToStaticMarkup` (the test suite renders real
42
51
  engine charts exactly that way).
52
+
53
+ ## The caelus packages
54
+
55
+ - [caelus](https://www.npmjs.com/package/caelus) — the engine
56
+ - [caelus-birth](https://www.npmjs.com/package/caelus-birth) — local birth time + place → UT
57
+ - caelus-wheel — this package
58
+ - [caelus-mcp](https://www.npmjs.com/package/caelus-mcp) — MCP server, six chart tools over stdio
@@ -12,8 +12,9 @@
12
12
  import type { ReactElement } from "react";
13
13
  export interface WheelPosition {
14
14
  lon: number;
15
- retrograde: boolean;
16
- signDeg: number;
15
+ retrograde?: boolean;
16
+ rx?: boolean;
17
+ signDeg?: number;
17
18
  }
18
19
  export interface WheelAspect {
19
20
  a: string;
@@ -44,7 +45,8 @@ export interface WheelTheme {
44
45
  export declare const DARK_THEME: WheelTheme;
45
46
  export declare const GLYPHS: Record<string, string>;
46
47
  export interface ChartWheelProps {
47
- /** The Chart object from caelus, as-is. */
48
+ /** The Chart object from caelus, or a caelus-mcp natal_chart /
49
+ * current_sky tool response, as-is. */
48
50
  chart: WheelChart;
49
51
  /** Square size in px. */
50
52
  size?: number;
package/dist/src/index.js CHANGED
@@ -179,9 +179,11 @@ export function ChartWheel({ chart, size = 520, showAspects = true, aspectTypes
179
179
  el.push(_jsx("line", { x1: fix(x1), y1: fix(y1), x2: fix(x2), y2: fix(y2), stroke: T.labelText, strokeWidth: 0.5, opacity: 0.5 }, `conn-${b}`));
180
180
  }
181
181
  el.push(text(disp, 0.655, G[b] ?? b.slice(0, 2).toUpperCase(), size * 0.05, T.planetText, `pg-${b}`));
182
- const deg = Math.floor(p.signDeg);
183
- const min = String(Math.floor(mod(p.signDeg, 1) * 60)).padStart(2, "0");
184
- el.push(text(disp, 0.585, `${deg}°${min}'${p.retrograde ? "℞" : ""}`, size * 0.024, T.labelText, `pl-${b}`));
182
+ const signDeg = p.signDeg ?? mod(p.lon, 30);
183
+ const retro = p.retrograde ?? p.rx ?? false;
184
+ const deg = Math.floor(signDeg);
185
+ const min = String(Math.floor(mod(signDeg, 1) * 60)).padStart(2, "0");
186
+ el.push(text(disp, 0.585, `${deg}°${min}'${retro ? "℞" : ""}`, size * 0.024, T.labelText, `pl-${b}`));
185
187
  });
186
188
  return (_jsx("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, role: "img", "aria-label": "astrological chart wheel", style: { background: T.background }, children: el }));
187
189
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "caelus-wheel",
3
- "version": "0.1.1",
3
+ "version": "0.2.1",
4
4
  "description": "React SVG chart wheel for caelus: zodiac, houses, planets with collision avoidance, aspect lines. SSR-safe, zero runtime dependencies.",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -45,4 +45,4 @@
45
45
  "svg",
46
46
  "natal-chart"
47
47
  ]
48
- }
48
+ }