@eaprelsky/nocturna-wheel 2.0.0 → 3.0.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
@@ -18,6 +18,14 @@ A JavaScript library for rendering astrological natal charts.
18
18
 
19
19
  ## Installation
20
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
+
21
29
  ### Direct Script Include
22
30
 
23
31
  ```html
@@ -28,12 +36,6 @@ A JavaScript library for rendering astrological natal charts.
28
36
  <script src="path/to/nocturna-wheel.min.js"></script>
29
37
  ```
30
38
 
31
- ### NPM Installation
32
-
33
- ```bash
34
- npm install @eaprelsky/nocturna-wheel
35
- ```
36
-
37
39
  ## Basic Usage
38
40
 
39
41
  ### ES Module (Recommended)
@@ -329,6 +331,76 @@ chart.toggleSynastryAspects(true);
329
331
 
330
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.
331
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
+
332
404
  ## License
333
405
 
334
406
  This project is licensed under the MIT License - see the LICENSE file for details.