@eaprelsky/nocturna-wheel 1.1.0 → 3.0.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/README.md CHANGED
@@ -4,15 +4,28 @@ A JavaScript library for rendering astrological natal charts.
4
4
 
5
5
  ## Features
6
6
 
7
- - Responsive SVG-based chart rendering
8
- - Zodiac sign display with customizable styling
9
- - House system rendering with multiple system options
10
- - Planet placement with customizable icons and colors
11
- - Aspect calculation and visualization
12
- - Interactive tooltips for celestial objects
7
+ - **Responsive SVG-based chart rendering**
8
+ - **Dual chart support** - independent inner and outer circles for synastry and transit charts
9
+ - **Zodiac sign display** with customizable styling
10
+ - **House system rendering** with multiple system options (Placidus, Koch, Equal, etc.)
11
+ - **Planet placement** with customizable icons and colors on two independent circles
12
+ - **Three types of aspects:**
13
+ - Primary aspects (outer circle to outer circle)
14
+ - Secondary aspects (inner circle to inner circle)
15
+ - Synastry aspects (outer to inner circle with projection dots)
16
+ - **Interactive tooltips** for celestial objects
17
+ - **Full control** over colors, line styles, and orbs for each aspect type
13
18
 
14
19
  ## Installation
15
20
 
21
+ ### NPM Installation (Recommended)
22
+
23
+ ```bash
24
+ npm install @eaprelsky/nocturna-wheel
25
+ ```
26
+
27
+ The library comes with **inline SVG icons** bundled as data URLs, so you don't need to worry about copying asset files. Icons work out of the box!
28
+
16
29
  ### Direct Script Include
17
30
 
18
31
  ```html
@@ -23,12 +36,6 @@ A JavaScript library for rendering astrological natal charts.
23
36
  <script src="path/to/nocturna-wheel.min.js"></script>
24
37
  ```
25
38
 
26
- ### NPM Installation
27
-
28
- ```bash
29
- npm install @eaprelsky/nocturna-wheel
30
- ```
31
-
32
39
  ## Basic Usage
33
40
 
34
41
  ### ES Module (Recommended)
@@ -105,29 +112,47 @@ Main class for creating and managing astrological charts.
105
112
  #### Constructor Options
106
113
 
107
114
  - `container`: String selector or DOM element for the chart container
108
- - `planets`: Object containing planet positions and properties
115
+ - `planets`: Object containing primary planet positions (outer circle)
116
+ - `secondaryPlanets`: Object containing secondary planet positions (inner circle, optional)
109
117
  - `houses`: Array of house cusp positions
110
- - `aspectSettings`: Object with aspect calculation settings
111
- - `config`: Additional configuration options
118
+ - `config`: Additional configuration options including aspect settings
112
119
 
113
120
  ```javascript
114
121
  const chart = new NocturnaWheel.WheelChart({
115
122
  container: "#chart-container",
116
123
  planets: {
117
- sun: { lon: 85.83, color: "#ff0000" },
118
- moon: { lon: 133.21 }
124
+ sun: { lon: 85.83, color: "#000000" },
125
+ moon: { lon: 133.21, color: "#000000" }
119
126
  },
120
- houses: [{ lon: 300.32 }, ...],
121
- aspectSettings: {
122
- enabled: true,
123
- orb: 6,
124
- types: {
125
- conjunction: { angle: 0, orb: 8, color: "#000000", enabled: true }
126
- }
127
+ secondaryPlanets: {
128
+ sun: { lon: 115.20, color: "#FF5500" },
129
+ moon: { lon: 200.45, color: "#0066CC" }
127
130
  },
131
+ houses: [{ lon: 300.32 }, ...],
128
132
  config: {
129
133
  zodiacSettings: { enabled: true },
130
- planetSettings: { enabled: true }
134
+ planetSettings: { enabled: true },
135
+ // Primary aspects (outer circle to outer circle)
136
+ primaryAspectSettings: {
137
+ enabled: true,
138
+ orb: 6,
139
+ types: {
140
+ conjunction: { angle: 0, orb: 8, color: "#000000", enabled: true, lineStyle: 'none', strokeWidth: 1 },
141
+ opposition: { angle: 180, orb: 6, color: "#E41B17", enabled: true, lineStyle: 'solid', strokeWidth: 1 }
142
+ }
143
+ },
144
+ // Secondary aspects (inner circle to inner circle)
145
+ secondaryAspectSettings: {
146
+ enabled: true,
147
+ orb: 6,
148
+ types: { /* ... */ }
149
+ },
150
+ // Synastry aspects (outer to inner circle projections)
151
+ synastryAspectSettings: {
152
+ enabled: true,
153
+ orb: 6,
154
+ types: { /* ... */ }
155
+ }
131
156
  }
132
157
  });
133
158
  ```
@@ -136,11 +161,14 @@ const chart = new NocturnaWheel.WheelChart({
136
161
 
137
162
  - `render()`: Renders the chart
138
163
  - `update(config)`: Updates chart configuration
139
- - `togglePlanet(name, visible)`: Toggles visibility of a planet
164
+ - `updateData(data)`: Updates planet and house data
165
+ - `togglePlanet(name, visible)`: Toggles visibility of a specific planet
140
166
  - `toggleHouses(visible)`: Toggles visibility of houses
141
- - `toggleAspects(visible)`: Toggles visibility of aspects
142
- - `togglePrimaryPlanets(visible)`: Toggles primary planets
143
- - `toggleSecondaryPlanets(visible)`: Toggles secondary planets
167
+ - `togglePrimaryPlanets(visible)`: Toggles visibility of primary planets (outer circle)
168
+ - `toggleSecondaryPlanets(visible)`: Toggles visibility of secondary planets (inner circle)
169
+ - `togglePrimaryAspects(visible)`: Toggles visibility of primary aspects (outer circle)
170
+ - `toggleSecondaryAspects(visible)`: Toggles visibility of secondary aspects (inner circle)
171
+ - `toggleSynastryAspects(visible)`: Toggles visibility of synastry aspects (cross-circle)
144
172
  - `setHouseRotation(angle)`: Sets house system rotation
145
173
  - `setHouseSystem(name)`: Changes the house system
146
174
  - `destroy()`: Removes the chart and cleans up resources
@@ -159,13 +187,38 @@ const chartConfig = {
159
187
  houseSystem: "Placidus"
160
188
  },
161
189
 
162
- // Aspect settings
163
- aspectSettings: {
190
+ // Primary aspect settings (outer circle to outer circle)
191
+ primaryAspectSettings: {
164
192
  enabled: true,
165
193
  orb: 6,
166
194
  types: {
167
- conjunction: { angle: 0, orb: 8, color: "#ff0000", enabled: true },
168
- opposition: { angle: 180, orb: 8, color: "#0000ff", enabled: true }
195
+ conjunction: { angle: 0, orb: 8, color: "#000000", enabled: true, lineStyle: 'none', strokeWidth: 1 },
196
+ opposition: { angle: 180, orb: 6, color: "#E41B17", enabled: true, lineStyle: 'solid', strokeWidth: 1 },
197
+ trine: { angle: 120, orb: 6, color: "#4CC417", enabled: true, lineStyle: 'solid', strokeWidth: 1 },
198
+ square: { angle: 90, orb: 6, color: "#F62817", enabled: true, lineStyle: 'dashed', strokeWidth: 1 },
199
+ sextile: { angle: 60, orb: 4, color: "#56A5EC", enabled: true, lineStyle: 'dashed', strokeWidth: 1 }
200
+ }
201
+ },
202
+
203
+ // Secondary aspect settings (inner circle to inner circle)
204
+ secondaryAspectSettings: {
205
+ enabled: true,
206
+ orb: 6,
207
+ types: {
208
+ conjunction: { angle: 0, orb: 8, color: "#AA00AA", enabled: true, lineStyle: 'none', strokeWidth: 1 },
209
+ opposition: { angle: 180, orb: 6, color: "#FF6600", enabled: true, lineStyle: 'solid', strokeWidth: 1 }
210
+ // ... other aspects
211
+ }
212
+ },
213
+
214
+ // Synastry aspect settings (outer to inner circle)
215
+ synastryAspectSettings: {
216
+ enabled: true,
217
+ orb: 6,
218
+ types: {
219
+ conjunction: { angle: 0, orb: 8, color: "#666666", enabled: true, lineStyle: 'none', strokeWidth: 1 },
220
+ opposition: { angle: 180, orb: 6, color: "#9933CC", enabled: true, lineStyle: 'solid', strokeWidth: 0.5 }
221
+ // ... other aspects
169
222
  }
170
223
  },
171
224
 
@@ -245,6 +298,109 @@ chart.render();
245
298
 
246
299
  See MODULE_ARCHITECTURE.md for more details on the library's architecture.
247
300
 
301
+ ## Synastry and Dual Charts
302
+
303
+ The library supports dual charts for synastry, transits, and progressions. Each circle operates independently:
304
+
305
+ ```javascript
306
+ const chart = new WheelChart({
307
+ container: '#chart-container',
308
+ // Natal chart (outer circle)
309
+ planets: {
310
+ sun: { lon: 85.83, color: '#000000' },
311
+ moon: { lon: 133.21, color: '#000000' }
312
+ },
313
+ // Transit/Partner chart (inner circle)
314
+ secondaryPlanets: {
315
+ sun: { lon: 115.20, color: '#FF5500' },
316
+ moon: { lon: 200.45, color: '#0066CC' }
317
+ },
318
+ config: {
319
+ // Configure three independent aspect systems
320
+ primaryAspectSettings: { /* natal-to-natal */ },
321
+ secondaryAspectSettings: { /* transit-to-transit */ },
322
+ synastryAspectSettings: { /* natal-to-transit with projection dots */ }
323
+ }
324
+ });
325
+
326
+ // Toggle each aspect type independently
327
+ chart.togglePrimaryAspects(true);
328
+ chart.toggleSecondaryAspects(false);
329
+ chart.toggleSynastryAspects(true);
330
+ ```
331
+
332
+ **Synastry aspects** are rendered with hollow projection dots on the inner circle, showing where outer circle planets project onto the inner radius. This creates a cleaner, more aesthetically pleasing visualization.
333
+
334
+ ## Working with Icons
335
+
336
+ ### Inline Icons (Default)
337
+
338
+ By default, the library uses **inline SVG icons** bundled as data URLs. This means:
339
+ - ✅ **No asset copying needed** - icons are bundled with the JavaScript
340
+ - ✅ **Works out of the box** - no path configuration required
341
+ - ✅ **Cross-platform** - works in all environments (browser, webpack, vite, etc.)
342
+
343
+ ```javascript
344
+ // Icons work automatically - no configuration needed!
345
+ const chart = new WheelChart({
346
+ container: '#chart-container',
347
+ planets: { sun: { lon: 85.83 } }
348
+ });
349
+ ```
350
+
351
+ ### Using Custom External Icons
352
+
353
+ If you want to use your own custom icons, you can disable inline mode:
354
+
355
+ ```javascript
356
+ import { IconProvider } from '@eaprelsky/nocturna-wheel';
357
+
358
+ // Create IconProvider with external icons
359
+ const iconProvider = new IconProvider({
360
+ useInline: false,
361
+ basePath: '/my-custom-icons/'
362
+ });
363
+
364
+ // Pass to ServiceRegistry
365
+ import { ServiceRegistry } from '@eaprelsky/nocturna-wheel';
366
+ ServiceRegistry.register('iconProvider', iconProvider);
367
+
368
+ // Now create your chart
369
+ const chart = new WheelChart({ /* ... */ });
370
+ ```
371
+
372
+ ### Accessing Bundled Icon Files
373
+
374
+ If you need direct access to the SVG files (e.g., for documentation or custom usage):
375
+
376
+ ```javascript
377
+ // Using package.json exports
378
+ import sunIcon from '@eaprelsky/nocturna-wheel/icons/zodiac-planet-sun.svg';
379
+ ```
380
+
381
+ Or copy them from `node_modules`:
382
+
383
+ ```bash
384
+ cp -r node_modules/@eaprelsky/nocturna-wheel/dist/assets/svg ./public/
385
+ ```
386
+
387
+ ### Custom Icon Data URLs
388
+
389
+ You can also provide custom icons as data URLs:
390
+
391
+ ```javascript
392
+ const customIcons = {
393
+ planets: {
394
+ sun: 'data:image/svg+xml,...',
395
+ moon: 'data:image/svg+xml,...'
396
+ }
397
+ };
398
+
399
+ const iconProvider = new IconProvider({
400
+ customIcons: customIcons
401
+ });
402
+ ```
403
+
248
404
  ## License
249
405
 
250
406
  This project is licensed under the MIT License - see the LICENSE file for details.