kaabalah 6.2.4 → 6.4.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.
Files changed (62) hide show
  1. package/README.md +71 -0
  2. package/dist/{chunk-S4EJ3ZY7.mjs → chunk-6P2CJUTH.mjs} +3 -3
  3. package/dist/{chunk-S4EJ3ZY7.mjs.map → chunk-6P2CJUTH.mjs.map} +1 -1
  4. package/dist/chunk-7WG6PUEN.js +1741 -0
  5. package/dist/chunk-7WG6PUEN.js.map +1 -0
  6. package/dist/{chunk-O3ZBG566.js → chunk-COPYH3O2.js} +23 -23
  7. package/dist/{chunk-O3ZBG566.js.map → chunk-COPYH3O2.js.map} +1 -1
  8. package/dist/{chunk-RZBVUDBM.mjs → chunk-EFZUZI22.mjs} +81 -73
  9. package/dist/chunk-EFZUZI22.mjs.map +1 -0
  10. package/dist/chunk-EMMXVM35.mjs +511 -0
  11. package/dist/chunk-EMMXVM35.mjs.map +1 -0
  12. package/dist/{chunk-2RGUI5FG.mjs → chunk-MTI2SOQ6.mjs} +4 -4
  13. package/dist/{chunk-2RGUI5FG.mjs.map → chunk-MTI2SOQ6.mjs.map} +1 -1
  14. package/dist/{chunk-TMN4PYVG.js → chunk-OKZUVGA3.js} +9 -9
  15. package/dist/{chunk-TMN4PYVG.js.map → chunk-OKZUVGA3.js.map} +1 -1
  16. package/dist/{chunk-Y4PTMABP.js → chunk-PAKYKIZH.js} +4 -4
  17. package/dist/{chunk-Y4PTMABP.js.map → chunk-PAKYKIZH.js.map} +1 -1
  18. package/dist/chunk-PBPYXWX4.mjs +1721 -0
  19. package/dist/chunk-PBPYXWX4.mjs.map +1 -0
  20. package/dist/{chunk-HAMDOCS5.js → chunk-S6KNERP7.js} +81 -73
  21. package/dist/chunk-S6KNERP7.js.map +1 -0
  22. package/dist/chunk-WGYXJEG5.js +518 -0
  23. package/dist/chunk-WGYXJEG5.js.map +1 -0
  24. package/dist/{chunk-G76K6OVQ.mjs → chunk-WIKUOEOB.mjs} +3 -3
  25. package/dist/{chunk-G76K6OVQ.mjs.map → chunk-WIKUOEOB.mjs.map} +1 -1
  26. package/dist/{chunk-WSSELKIB.js → chunk-XTE5DSDO.js} +23 -23
  27. package/dist/{chunk-WSSELKIB.js.map → chunk-XTE5DSDO.js.map} +1 -1
  28. package/dist/{chunk-NBP75BAH.mjs → chunk-ZKIJAZ6B.mjs} +3 -3
  29. package/dist/{chunk-NBP75BAH.mjs.map → chunk-ZKIJAZ6B.mjs.map} +1 -1
  30. package/dist/cli.js +954 -104
  31. package/dist/cli.js.map +1 -1
  32. package/dist/core/index.js +43 -43
  33. package/dist/core/index.mjs +2 -2
  34. package/dist/gematria/index.js +5 -5
  35. package/dist/gematria/index.mjs +2 -2
  36. package/dist/index.d.mts +2 -1
  37. package/dist/index.d.ts +2 -1
  38. package/dist/index.js +191 -114
  39. package/dist/index.mjs +8 -7
  40. package/dist/numerology/index.js +18 -18
  41. package/dist/numerology/index.mjs +3 -3
  42. package/dist/semantic/index.d.mts +150 -2
  43. package/dist/semantic/index.d.ts +150 -2
  44. package/dist/semantic/index.js +65 -10
  45. package/dist/semantic/index.mjs +7 -4
  46. package/dist/tarot/index.js +23 -23
  47. package/dist/tarot/index.mjs +3 -3
  48. package/dist/visual/index.d.mts +64 -0
  49. package/dist/visual/index.d.ts +64 -0
  50. package/dist/visual/index.js +35 -0
  51. package/dist/visual/index.js.map +1 -0
  52. package/dist/visual/index.mjs +6 -0
  53. package/dist/visual/index.mjs.map +1 -0
  54. package/dist/webassembly.md +127 -0
  55. package/package.json +6 -1
  56. package/wasm/build/webassembly.md +127 -0
  57. package/dist/chunk-3KJSW6ZP.js +0 -850
  58. package/dist/chunk-3KJSW6ZP.js.map +0 -1
  59. package/dist/chunk-HAMDOCS5.js.map +0 -1
  60. package/dist/chunk-RWX6HFS5.mjs +0 -843
  61. package/dist/chunk-RWX6HFS5.mjs.map +0 -1
  62. package/dist/chunk-RZBVUDBM.mjs.map +0 -1
@@ -1,91 +1,91 @@
1
1
  'use strict';
2
2
 
3
- var chunkWSSELKIB_js = require('../chunk-WSSELKIB.js');
4
- require('../chunk-TMN4PYVG.js');
5
- require('../chunk-HAMDOCS5.js');
3
+ var chunkXTE5DSDO_js = require('../chunk-XTE5DSDO.js');
4
+ require('../chunk-OKZUVGA3.js');
5
+ require('../chunk-S6KNERP7.js');
6
6
  require('../chunk-FM7WUVZV.js');
7
7
 
8
8
 
9
9
 
10
10
  Object.defineProperty(exports, "ARKANNUS", {
11
11
  enumerable: true,
12
- get: function () { return chunkWSSELKIB_js.ARKANNUS; }
12
+ get: function () { return chunkXTE5DSDO_js.ARKANNUS; }
13
13
  });
14
14
  Object.defineProperty(exports, "DEFAULT_TAROT_TREE_ID", {
15
15
  enumerable: true,
16
- get: function () { return chunkWSSELKIB_js.DEFAULT_TAROT_TREE_ID; }
16
+ get: function () { return chunkXTE5DSDO_js.DEFAULT_TAROT_TREE_ID; }
17
17
  });
18
18
  Object.defineProperty(exports, "TAROT_IMAGE_BASE_URL", {
19
19
  enumerable: true,
20
- get: function () { return chunkWSSELKIB_js.TAROT_IMAGE_BASE_URL; }
20
+ get: function () { return chunkXTE5DSDO_js.TAROT_IMAGE_BASE_URL; }
21
21
  });
22
22
  Object.defineProperty(exports, "TAROT_TREE_IDS", {
23
23
  enumerable: true,
24
- get: function () { return chunkWSSELKIB_js.TAROT_TREE_IDS; }
24
+ get: function () { return chunkXTE5DSDO_js.TAROT_TREE_IDS; }
25
25
  });
26
26
  Object.defineProperty(exports, "drawTarotSpread", {
27
27
  enumerable: true,
28
- get: function () { return chunkWSSELKIB_js.drawTarotSpread; }
28
+ get: function () { return chunkXTE5DSDO_js.drawTarotSpread; }
29
29
  });
30
30
  Object.defineProperty(exports, "getTarotArchetype", {
31
31
  enumerable: true,
32
- get: function () { return chunkWSSELKIB_js.getTarotArchetype; }
32
+ get: function () { return chunkXTE5DSDO_js.getTarotArchetype; }
33
33
  });
34
34
  Object.defineProperty(exports, "getTarotCardByNumber", {
35
35
  enumerable: true,
36
- get: function () { return chunkWSSELKIB_js.getTarotCardByNumber; }
36
+ get: function () { return chunkXTE5DSDO_js.getTarotCardByNumber; }
37
37
  });
38
38
  Object.defineProperty(exports, "getTarotCardNumber", {
39
39
  enumerable: true,
40
- get: function () { return chunkWSSELKIB_js.getTarotCardNumber; }
40
+ get: function () { return chunkXTE5DSDO_js.getTarotCardNumber; }
41
41
  });
42
42
  Object.defineProperty(exports, "getTarotCardProfile", {
43
43
  enumerable: true,
44
- get: function () { return chunkWSSELKIB_js.getTarotCardProfile; }
44
+ get: function () { return chunkXTE5DSDO_js.getTarotCardProfile; }
45
45
  });
46
46
  Object.defineProperty(exports, "getTarotCorrespondenceProfile", {
47
47
  enumerable: true,
48
- get: function () { return chunkWSSELKIB_js.getTarotCorrespondenceProfile; }
48
+ get: function () { return chunkXTE5DSDO_js.getTarotCorrespondenceProfile; }
49
49
  });
50
50
  Object.defineProperty(exports, "getTarotRepresentation", {
51
51
  enumerable: true,
52
- get: function () { return chunkWSSELKIB_js.getTarotRepresentation; }
52
+ get: function () { return chunkXTE5DSDO_js.getTarotRepresentation; }
53
53
  });
54
54
  Object.defineProperty(exports, "getTarotRepresentations", {
55
55
  enumerable: true,
56
- get: function () { return chunkWSSELKIB_js.getTarotRepresentations; }
56
+ get: function () { return chunkXTE5DSDO_js.getTarotRepresentations; }
57
57
  });
58
58
  Object.defineProperty(exports, "getTarotSpread", {
59
59
  enumerable: true,
60
- get: function () { return chunkWSSELKIB_js.getTarotSpread; }
60
+ get: function () { return chunkXTE5DSDO_js.getTarotSpread; }
61
61
  });
62
62
  Object.defineProperty(exports, "listTarotDecks", {
63
63
  enumerable: true,
64
- get: function () { return chunkWSSELKIB_js.listTarotDecks; }
64
+ get: function () { return chunkXTE5DSDO_js.listTarotDecks; }
65
65
  });
66
66
  Object.defineProperty(exports, "listTarotSpreads", {
67
67
  enumerable: true,
68
- get: function () { return chunkWSSELKIB_js.listTarotSpreads; }
68
+ get: function () { return chunkXTE5DSDO_js.listTarotSpreads; }
69
69
  });
70
70
  Object.defineProperty(exports, "listTarotTrees", {
71
71
  enumerable: true,
72
- get: function () { return chunkWSSELKIB_js.listTarotTrees; }
72
+ get: function () { return chunkXTE5DSDO_js.listTarotTrees; }
73
73
  });
74
74
  Object.defineProperty(exports, "majorArcana", {
75
75
  enumerable: true,
76
- get: function () { return chunkWSSELKIB_js.majorArcana; }
76
+ get: function () { return chunkXTE5DSDO_js.majorArcana; }
77
77
  });
78
78
  Object.defineProperty(exports, "resolveTarotImageUrl", {
79
79
  enumerable: true,
80
- get: function () { return chunkWSSELKIB_js.resolveTarotImageUrl; }
80
+ get: function () { return chunkXTE5DSDO_js.resolveTarotImageUrl; }
81
81
  });
82
82
  Object.defineProperty(exports, "shuffleTarotDeck", {
83
83
  enumerable: true,
84
- get: function () { return chunkWSSELKIB_js.shuffleTarotDeck; }
84
+ get: function () { return chunkXTE5DSDO_js.shuffleTarotDeck; }
85
85
  });
86
86
  Object.defineProperty(exports, "validateTarotSpreadSelection", {
87
87
  enumerable: true,
88
- get: function () { return chunkWSSELKIB_js.validateTarotSpreadSelection; }
88
+ get: function () { return chunkXTE5DSDO_js.validateTarotSpreadSelection; }
89
89
  });
90
90
  //# sourceMappingURL=index.js.map
91
91
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- export { ARKANNUS, DEFAULT_TAROT_TREE_ID, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection } from '../chunk-2RGUI5FG.mjs';
2
- import '../chunk-NBP75BAH.mjs';
3
- import '../chunk-RZBVUDBM.mjs';
1
+ export { ARKANNUS, DEFAULT_TAROT_TREE_ID, TAROT_IMAGE_BASE_URL, TAROT_TREE_IDS, drawTarotSpread, getTarotArchetype, getTarotCardByNumber, getTarotCardNumber, getTarotCardProfile, getTarotCorrespondenceProfile, getTarotRepresentation, getTarotRepresentations, getTarotSpread, listTarotDecks, listTarotSpreads, listTarotTrees, majorArcana, resolveTarotImageUrl, shuffleTarotDeck, validateTarotSpreadSelection } from '../chunk-MTI2SOQ6.mjs';
2
+ import '../chunk-ZKIJAZ6B.mjs';
3
+ import '../chunk-EFZUZI22.mjs';
4
4
  import '../chunk-WY6NIR2V.mjs';
5
5
  //# sourceMappingURL=index.mjs.map
6
6
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,64 @@
1
+ import { a6 as NodeId, _ as KaabalahTypes, R as SystemKey } from '../correspondence-model-DWXbAjC-.mjs';
2
+
3
+ interface TreeSvgViewBox {
4
+ minX?: number;
5
+ minY?: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ interface TreeLayoutCoordinate {
10
+ x: number;
11
+ y: number;
12
+ }
13
+ type TreeSphereName = "Kether" | "Chokhmah" | "Binah" | "Daath" | "Chesed" | "Geburah" | "Tiphareth" | "Netzach" | "Hod" | "Yesod" | "Malkuth";
14
+ type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;
15
+ type TreePathId = NodeId<KaabalahTypes.PATH>;
16
+ interface TreeLayoutPath {
17
+ fromId: TreeSphereId;
18
+ toId: TreeSphereId;
19
+ from: TreeLayoutCoordinate;
20
+ to: TreeLayoutCoordinate;
21
+ }
22
+ interface TreeLayoutMap {
23
+ spheres: Record<TreeSphereId, TreeLayoutCoordinate>;
24
+ paths: Record<TreePathId, TreeLayoutPath>;
25
+ }
26
+ interface TreeLayout {
27
+ system: SystemKey;
28
+ viewBox: Required<TreeSvgViewBox>;
29
+ sphereOrder: TreeSphereId[];
30
+ pathOrder: TreePathId[];
31
+ percentages: TreeLayoutMap;
32
+ viewBoxUnits: TreeLayoutMap;
33
+ }
34
+ interface TreeSvgCustomPalette {
35
+ defaultSphereFill?: string;
36
+ defaultPathColor?: string;
37
+ sphereFills?: Partial<Record<TreeSphereId, string | string[]>>;
38
+ pathColors?: Partial<Record<TreePathId, string>>;
39
+ pathEdgeColor?: string;
40
+ sphereStrokeColor?: string;
41
+ sphereStrokeWidth?: number;
42
+ pathHighlightColor?: string;
43
+ pathHighlightOpacity?: number;
44
+ specialSphereMode?: "preserve" | "plain";
45
+ }
46
+ type TreeSvgPalette = "color" | "monochrome" | TreeSvgCustomPalette;
47
+ type TreeSvgDaathLayer = "front" | "back";
48
+ interface TreeSvgOptions {
49
+ width?: number | string;
50
+ height?: number | string;
51
+ viewBox?: TreeSvgViewBox;
52
+ background?: string | "transparent";
53
+ palette?: TreeSvgPalette;
54
+ system?: SystemKey;
55
+ daathLayer?: TreeSvgDaathLayer;
56
+ }
57
+ declare const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox>;
58
+ declare const TREE_SPHERE_NAMES: readonly ["Kether", "Chokhmah", "Binah", "Daath", "Chesed", "Geburah", "Tiphareth", "Netzach", "Hod", "Yesod", "Malkuth"];
59
+ declare const TREE_SPHERE_IDS: TreeSphereId[];
60
+ declare const TREE_PATH_IDS: TreePathId[];
61
+ declare function getTreeLayout(system?: SystemKey): TreeLayout;
62
+ declare function generateTreeSvg(options?: TreeSvgOptions): string;
63
+
64
+ export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, generateTreeSvg, getTreeLayout };
@@ -0,0 +1,64 @@
1
+ import { a6 as NodeId, _ as KaabalahTypes, R as SystemKey } from '../correspondence-model-DWXbAjC-.js';
2
+
3
+ interface TreeSvgViewBox {
4
+ minX?: number;
5
+ minY?: number;
6
+ width: number;
7
+ height: number;
8
+ }
9
+ interface TreeLayoutCoordinate {
10
+ x: number;
11
+ y: number;
12
+ }
13
+ type TreeSphereName = "Kether" | "Chokhmah" | "Binah" | "Daath" | "Chesed" | "Geburah" | "Tiphareth" | "Netzach" | "Hod" | "Yesod" | "Malkuth";
14
+ type TreeSphereId = NodeId<KaabalahTypes.SPHERE>;
15
+ type TreePathId = NodeId<KaabalahTypes.PATH>;
16
+ interface TreeLayoutPath {
17
+ fromId: TreeSphereId;
18
+ toId: TreeSphereId;
19
+ from: TreeLayoutCoordinate;
20
+ to: TreeLayoutCoordinate;
21
+ }
22
+ interface TreeLayoutMap {
23
+ spheres: Record<TreeSphereId, TreeLayoutCoordinate>;
24
+ paths: Record<TreePathId, TreeLayoutPath>;
25
+ }
26
+ interface TreeLayout {
27
+ system: SystemKey;
28
+ viewBox: Required<TreeSvgViewBox>;
29
+ sphereOrder: TreeSphereId[];
30
+ pathOrder: TreePathId[];
31
+ percentages: TreeLayoutMap;
32
+ viewBoxUnits: TreeLayoutMap;
33
+ }
34
+ interface TreeSvgCustomPalette {
35
+ defaultSphereFill?: string;
36
+ defaultPathColor?: string;
37
+ sphereFills?: Partial<Record<TreeSphereId, string | string[]>>;
38
+ pathColors?: Partial<Record<TreePathId, string>>;
39
+ pathEdgeColor?: string;
40
+ sphereStrokeColor?: string;
41
+ sphereStrokeWidth?: number;
42
+ pathHighlightColor?: string;
43
+ pathHighlightOpacity?: number;
44
+ specialSphereMode?: "preserve" | "plain";
45
+ }
46
+ type TreeSvgPalette = "color" | "monochrome" | TreeSvgCustomPalette;
47
+ type TreeSvgDaathLayer = "front" | "back";
48
+ interface TreeSvgOptions {
49
+ width?: number | string;
50
+ height?: number | string;
51
+ viewBox?: TreeSvgViewBox;
52
+ background?: string | "transparent";
53
+ palette?: TreeSvgPalette;
54
+ system?: SystemKey;
55
+ daathLayer?: TreeSvgDaathLayer;
56
+ }
57
+ declare const TREE_SVG_DEFAULT_VIEWBOX: Required<TreeSvgViewBox>;
58
+ declare const TREE_SPHERE_NAMES: readonly ["Kether", "Chokhmah", "Binah", "Daath", "Chesed", "Geburah", "Tiphareth", "Netzach", "Hod", "Yesod", "Malkuth"];
59
+ declare const TREE_SPHERE_IDS: TreeSphereId[];
60
+ declare const TREE_PATH_IDS: TreePathId[];
61
+ declare function getTreeLayout(system?: SystemKey): TreeLayout;
62
+ declare function generateTreeSvg(options?: TreeSvgOptions): string;
63
+
64
+ export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, type TreeLayout, type TreeLayoutCoordinate, type TreeLayoutMap, type TreeLayoutPath, type TreePathId, type TreeSphereId, type TreeSphereName, type TreeSvgCustomPalette, type TreeSvgDaathLayer, type TreeSvgOptions, type TreeSvgPalette, type TreeSvgViewBox, generateTreeSvg, getTreeLayout };
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var chunkWGYXJEG5_js = require('../chunk-WGYXJEG5.js');
4
+ require('../chunk-OKZUVGA3.js');
5
+ require('../chunk-S6KNERP7.js');
6
+ require('../chunk-FM7WUVZV.js');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "TREE_PATH_IDS", {
11
+ enumerable: true,
12
+ get: function () { return chunkWGYXJEG5_js.TREE_PATH_IDS; }
13
+ });
14
+ Object.defineProperty(exports, "TREE_SPHERE_IDS", {
15
+ enumerable: true,
16
+ get: function () { return chunkWGYXJEG5_js.TREE_SPHERE_IDS; }
17
+ });
18
+ Object.defineProperty(exports, "TREE_SPHERE_NAMES", {
19
+ enumerable: true,
20
+ get: function () { return chunkWGYXJEG5_js.TREE_SPHERE_NAMES; }
21
+ });
22
+ Object.defineProperty(exports, "TREE_SVG_DEFAULT_VIEWBOX", {
23
+ enumerable: true,
24
+ get: function () { return chunkWGYXJEG5_js.TREE_SVG_DEFAULT_VIEWBOX; }
25
+ });
26
+ Object.defineProperty(exports, "generateTreeSvg", {
27
+ enumerable: true,
28
+ get: function () { return chunkWGYXJEG5_js.generateTreeSvg; }
29
+ });
30
+ Object.defineProperty(exports, "getTreeLayout", {
31
+ enumerable: true,
32
+ get: function () { return chunkWGYXJEG5_js.getTreeLayout; }
33
+ });
34
+ //# sourceMappingURL=index.js.map
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,6 @@
1
+ export { TREE_PATH_IDS, TREE_SPHERE_IDS, TREE_SPHERE_NAMES, TREE_SVG_DEFAULT_VIEWBOX, generateTreeSvg, getTreeLayout } from '../chunk-EMMXVM35.mjs';
2
+ import '../chunk-ZKIJAZ6B.mjs';
3
+ import '../chunk-EFZUZI22.mjs';
4
+ import '../chunk-WY6NIR2V.mjs';
5
+ //# sourceMappingURL=index.mjs.map
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
@@ -0,0 +1,127 @@
1
+ # Swiss Ephemeris WebAssembly Integration
2
+
3
+ This document explains how to set up and use the Swiss Ephemeris WebAssembly integration in the Kaabalah library.
4
+
5
+ ## Overview
6
+
7
+ The Swiss Ephemeris is a high-precision astronomical calculation library written in C that is widely used for astrological calculations. To use it in web browsers via our JavaScript/TypeScript library, we've created a WebAssembly wrapper.
8
+
9
+ ## Prerequisites
10
+
11
+ To compile the Swiss Ephemeris to WebAssembly, you will need:
12
+
13
+ 1. **Emscripten SDK (emsdk)**: The compiler toolchain for WebAssembly
14
+ - Installation instructions: https://emscripten.org/docs/getting_started/downloads.html
15
+
16
+ 2. **Swiss Ephemeris Source Code**: The C code that will be compiled
17
+ - Download from: https://www.astro.com/swisseph/swesrc.htm
18
+
19
+ 3. **Ephemeris Files**: Data files used by Swiss Ephemeris for calculations
20
+ - Download from: https://www.astro.com/ftp/swisseph/ephe/
21
+
22
+ ## Compilation Process
23
+
24
+ 1. **Download the Swiss Ephemeris source code** and extract it to the `wasm/swisseph` directory
25
+
26
+ 2. **Install Emscripten SDK** by following their installation instructions
27
+
28
+ 3. **Compile the code** using the provided script:
29
+ ```bash
30
+ cd wasm/scripts
31
+ chmod +x compile.sh
32
+ ./compile.sh
33
+ ```
34
+
35
+ 4. **Verify the output files**:
36
+ - `wasm/build/swisseph.js`: JavaScript glue code
37
+ - `wasm/build/swisseph.wasm`: WebAssembly binary
38
+
39
+ ## Integration with the Library
40
+
41
+ The Swiss Ephemeris WebAssembly integration is used by the astrology module to perform accurate astronomical calculations.
42
+
43
+ ### Module Structure
44
+
45
+ - `src/astrology/swisseph.ts`: Wrapper that interfaces with the WebAssembly module
46
+ - `src/astrology/index.ts`: Main astrology functionality that uses the wrapper
47
+
48
+ ### Dynamic Loading
49
+
50
+ The WebAssembly module is loaded dynamically at runtime, making it compatible with both Node.js and browser environments. This approach ensures that:
51
+
52
+ 1. The heavy WebAssembly code is only loaded when needed
53
+ 2. The same code works in both Node.js and browsers
54
+ 3. The library can gracefully fall back if WebAssembly is not available
55
+
56
+ ## Usage in Browser
57
+
58
+ To use the Swiss Ephemeris in a browser environment:
59
+
60
+ 1. **Copy the WebAssembly files** to a location accessible by your web application:
61
+ - `swisseph.js`
62
+ - `swisseph.wasm`
63
+
64
+ 2. **Handle cross-origin issues**: Ensure your web server is configured to serve WebAssembly files with the correct MIME type (`application/wasm`)
65
+
66
+ 3. **Provide the ephemeris files** that Swiss Ephemeris needs for calculations:
67
+ - Create a directory accessible by your web application
68
+ - Place the ephemeris files (*.se1) in that directory
69
+ - Specify the path when initializing the Swiss Ephemeris module
70
+
71
+ ## Usage in Node.js
72
+
73
+ For Node.js environments:
74
+
75
+ 1. **Include the built WebAssembly files** in your published package:
76
+ - Add them to the `files` array in `package.json`
77
+ - Make sure they're copied to the `dist` directory during build
78
+
79
+ 2. **Place ephemeris files** in a known location:
80
+ - For example, in a subdirectory named `ephe` within your package
81
+ - Set the ephemeris path when initializing the module
82
+
83
+ ## Fallback Mechanism
84
+
85
+ The astrology module includes a fallback mechanism to handle situations where the WebAssembly module might not be available:
86
+
87
+ 1. If compilation fails or the WebAssembly files are missing, the module gracefully degrades
88
+ 2. Placeholder values are returned instead of throwing errors
89
+ 3. A warning is logged to the console
90
+
91
+ ## Example Implementation
92
+
93
+ ```typescript
94
+ import { getBirthChart } from 'kaabalah/astrology';
95
+
96
+ // Calculate a birth chart
97
+ const chart = await getBirthChart({
98
+ date: new Date('1990-06-15T12:30:00'),
99
+ latitude: 40.7128,
100
+ longitude: -74.0060,
101
+ timezone: -4
102
+ });
103
+
104
+ console.log(`Ascendant: ${chart.ascendant}`);
105
+ console.log(`Sun position: ${chart.planets.sun.longitude}`);
106
+ ```
107
+
108
+ ## Troubleshooting
109
+
110
+ ### Common Issues
111
+
112
+ 1. **"WebAssembly module not found"**:
113
+ - Ensure the .wasm and .js files are properly included in your distribution
114
+ - Check the paths in your code
115
+
116
+ 2. **"Cannot find ephemeris files"**:
117
+ - Make sure the ephemeris files are available at the specified path
118
+ - Check file permissions
119
+
120
+ 3. **"Calculation error"**:
121
+ - Verify the input parameters (date, location) are valid
122
+ - Ensure you have the correct ephemeris files for the date range
123
+
124
+ ### Debugging Tools
125
+
126
+ - Use browser developer tools to check for WASM-related errors in the console
127
+ - Enable the `ASSERTIONS=1` flag during compilation for more verbose error messages
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kaabalah",
3
- "version": "6.2.4",
3
+ "version": "6.4.0",
4
4
  "description": "The de-facto library for any esoteric calculations and tooling",
5
5
  "engines": {
6
6
  "node": ">=18.18.0"
@@ -63,6 +63,11 @@
63
63
  "types": "./dist/semantic/index.d.ts",
64
64
  "require": "./dist/semantic/index.js",
65
65
  "import": "./dist/semantic/index.mjs"
66
+ },
67
+ "./visual": {
68
+ "types": "./dist/visual/index.d.ts",
69
+ "require": "./dist/visual/index.js",
70
+ "import": "./dist/visual/index.mjs"
66
71
  }
67
72
  },
68
73
  "files": [
@@ -0,0 +1,127 @@
1
+ # Swiss Ephemeris WebAssembly Integration
2
+
3
+ This document explains how to set up and use the Swiss Ephemeris WebAssembly integration in the Kaabalah library.
4
+
5
+ ## Overview
6
+
7
+ The Swiss Ephemeris is a high-precision astronomical calculation library written in C that is widely used for astrological calculations. To use it in web browsers via our JavaScript/TypeScript library, we've created a WebAssembly wrapper.
8
+
9
+ ## Prerequisites
10
+
11
+ To compile the Swiss Ephemeris to WebAssembly, you will need:
12
+
13
+ 1. **Emscripten SDK (emsdk)**: The compiler toolchain for WebAssembly
14
+ - Installation instructions: https://emscripten.org/docs/getting_started/downloads.html
15
+
16
+ 2. **Swiss Ephemeris Source Code**: The C code that will be compiled
17
+ - Download from: https://www.astro.com/swisseph/swesrc.htm
18
+
19
+ 3. **Ephemeris Files**: Data files used by Swiss Ephemeris for calculations
20
+ - Download from: https://www.astro.com/ftp/swisseph/ephe/
21
+
22
+ ## Compilation Process
23
+
24
+ 1. **Download the Swiss Ephemeris source code** and extract it to the `wasm/swisseph` directory
25
+
26
+ 2. **Install Emscripten SDK** by following their installation instructions
27
+
28
+ 3. **Compile the code** using the provided script:
29
+ ```bash
30
+ cd wasm/scripts
31
+ chmod +x compile.sh
32
+ ./compile.sh
33
+ ```
34
+
35
+ 4. **Verify the output files**:
36
+ - `wasm/build/swisseph.js`: JavaScript glue code
37
+ - `wasm/build/swisseph.wasm`: WebAssembly binary
38
+
39
+ ## Integration with the Library
40
+
41
+ The Swiss Ephemeris WebAssembly integration is used by the astrology module to perform accurate astronomical calculations.
42
+
43
+ ### Module Structure
44
+
45
+ - `src/astrology/swisseph.ts`: Wrapper that interfaces with the WebAssembly module
46
+ - `src/astrology/index.ts`: Main astrology functionality that uses the wrapper
47
+
48
+ ### Dynamic Loading
49
+
50
+ The WebAssembly module is loaded dynamically at runtime, making it compatible with both Node.js and browser environments. This approach ensures that:
51
+
52
+ 1. The heavy WebAssembly code is only loaded when needed
53
+ 2. The same code works in both Node.js and browsers
54
+ 3. The library can gracefully fall back if WebAssembly is not available
55
+
56
+ ## Usage in Browser
57
+
58
+ To use the Swiss Ephemeris in a browser environment:
59
+
60
+ 1. **Copy the WebAssembly files** to a location accessible by your web application:
61
+ - `swisseph.js`
62
+ - `swisseph.wasm`
63
+
64
+ 2. **Handle cross-origin issues**: Ensure your web server is configured to serve WebAssembly files with the correct MIME type (`application/wasm`)
65
+
66
+ 3. **Provide the ephemeris files** that Swiss Ephemeris needs for calculations:
67
+ - Create a directory accessible by your web application
68
+ - Place the ephemeris files (*.se1) in that directory
69
+ - Specify the path when initializing the Swiss Ephemeris module
70
+
71
+ ## Usage in Node.js
72
+
73
+ For Node.js environments:
74
+
75
+ 1. **Include the built WebAssembly files** in your published package:
76
+ - Add them to the `files` array in `package.json`
77
+ - Make sure they're copied to the `dist` directory during build
78
+
79
+ 2. **Place ephemeris files** in a known location:
80
+ - For example, in a subdirectory named `ephe` within your package
81
+ - Set the ephemeris path when initializing the module
82
+
83
+ ## Fallback Mechanism
84
+
85
+ The astrology module includes a fallback mechanism to handle situations where the WebAssembly module might not be available:
86
+
87
+ 1. If compilation fails or the WebAssembly files are missing, the module gracefully degrades
88
+ 2. Placeholder values are returned instead of throwing errors
89
+ 3. A warning is logged to the console
90
+
91
+ ## Example Implementation
92
+
93
+ ```typescript
94
+ import { getBirthChart } from 'kaabalah/astrology';
95
+
96
+ // Calculate a birth chart
97
+ const chart = await getBirthChart({
98
+ date: new Date('1990-06-15T12:30:00'),
99
+ latitude: 40.7128,
100
+ longitude: -74.0060,
101
+ timezone: -4
102
+ });
103
+
104
+ console.log(`Ascendant: ${chart.ascendant}`);
105
+ console.log(`Sun position: ${chart.planets.sun.longitude}`);
106
+ ```
107
+
108
+ ## Troubleshooting
109
+
110
+ ### Common Issues
111
+
112
+ 1. **"WebAssembly module not found"**:
113
+ - Ensure the .wasm and .js files are properly included in your distribution
114
+ - Check the paths in your code
115
+
116
+ 2. **"Cannot find ephemeris files"**:
117
+ - Make sure the ephemeris files are available at the specified path
118
+ - Check file permissions
119
+
120
+ 3. **"Calculation error"**:
121
+ - Verify the input parameters (date, location) are valid
122
+ - Ensure you have the correct ephemeris files for the date range
123
+
124
+ ### Debugging Tools
125
+
126
+ - Use browser developer tools to check for WASM-related errors in the console
127
+ - Enable the `ASSERTIONS=1` flag during compilation for more verbose error messages