@aigne/astrochart 1.11.0-beta.12
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/LICENSE +33 -0
- package/assets/icons/ascendant.svg +3 -0
- package/assets/icons/jupiter.svg +3 -0
- package/assets/icons/mars.svg +10 -0
- package/assets/icons/mercury.svg +10 -0
- package/assets/icons/moon.svg +3 -0
- package/assets/icons/neptune.svg +10 -0
- package/assets/icons/saturn.svg +3 -0
- package/assets/icons/sun.svg +10 -0
- package/assets/icons/uranus.svg +3 -0
- package/assets/icons/venus.svg +10 -0
- package/dist/index.d.mts +574 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2643 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +56 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
//#region src/svg.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* SVG tools.
|
|
4
|
+
*
|
|
5
|
+
* @class
|
|
6
|
+
* @public
|
|
7
|
+
* @constructor
|
|
8
|
+
* @param {String} elementId - root DOM Element
|
|
9
|
+
* @param {int} width
|
|
10
|
+
* @param {int} height
|
|
11
|
+
*/
|
|
12
|
+
declare class SVG {
|
|
13
|
+
settings: Settings;
|
|
14
|
+
_paperElementId: string;
|
|
15
|
+
DOMElement: SVGSVGElement;
|
|
16
|
+
root: Element;
|
|
17
|
+
width: number;
|
|
18
|
+
height: number;
|
|
19
|
+
context: this;
|
|
20
|
+
constructor(elementId: string, width: number, height: number, settings: Settings);
|
|
21
|
+
_getSymbol(name: string, x: number, y: number): Element;
|
|
22
|
+
/**
|
|
23
|
+
* Get a required symbol.
|
|
24
|
+
*
|
|
25
|
+
* @param {String} name
|
|
26
|
+
* @param {int} x
|
|
27
|
+
* @param {int} y
|
|
28
|
+
*
|
|
29
|
+
* @return {SVGElement g}
|
|
30
|
+
*/
|
|
31
|
+
getSymbol(name: string, x: number, y: number): Element;
|
|
32
|
+
/**
|
|
33
|
+
* Create transparent rectangle.
|
|
34
|
+
*
|
|
35
|
+
* Used to improve area click, @see this.settings.ADD_CLICK_AREA
|
|
36
|
+
*
|
|
37
|
+
* @param {Number} x
|
|
38
|
+
* @param {Number} y
|
|
39
|
+
*
|
|
40
|
+
* @return {Element} rect
|
|
41
|
+
*/
|
|
42
|
+
createRectForClick(x: number, y: number): Element;
|
|
43
|
+
/**
|
|
44
|
+
* Get ID for sign wrapper.
|
|
45
|
+
*
|
|
46
|
+
* @param {String} sign
|
|
47
|
+
*
|
|
48
|
+
* @return {String id}
|
|
49
|
+
*/
|
|
50
|
+
getSignWrapperId(sign: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Get ID for house wrapper.
|
|
53
|
+
*
|
|
54
|
+
* @param {String} house
|
|
55
|
+
*
|
|
56
|
+
* @return {String id}
|
|
57
|
+
*/
|
|
58
|
+
getHouseIdWrapper(house: string): string;
|
|
59
|
+
sun(x: number, y: number): Element;
|
|
60
|
+
moon(x: number, y: number): Element;
|
|
61
|
+
mercury(x: number, y: number): Element;
|
|
62
|
+
venus(x: number, y: number): Element;
|
|
63
|
+
mars(x: number, y: number): Element;
|
|
64
|
+
jupiter(x: number, y: number): Element;
|
|
65
|
+
saturn(x: number, y: number): Element;
|
|
66
|
+
uranus(x: number, y: number): Element;
|
|
67
|
+
neptune(x: number, y: number): Element;
|
|
68
|
+
pluto(x: number, y: number): Element;
|
|
69
|
+
chiron(x: number, y: number): Element;
|
|
70
|
+
lilith(x: number, y: number): Element;
|
|
71
|
+
nnode(x: number, y: number): Element;
|
|
72
|
+
snode(x: number, y: number): Element;
|
|
73
|
+
fortune(x: number, y: number): Element;
|
|
74
|
+
aries(x: number, y: number): Element;
|
|
75
|
+
taurus(x: number, y: number): Element;
|
|
76
|
+
gemini(x: number, y: number): Element;
|
|
77
|
+
cancer(x: number, y: number): Element;
|
|
78
|
+
leo(x: number, y: number): Element;
|
|
79
|
+
virgo(x: number, y: number): Element;
|
|
80
|
+
libra(x: number, y: number): Element;
|
|
81
|
+
scorpio(x: number, y: number): Element;
|
|
82
|
+
sagittarius(x: number, y: number): Element;
|
|
83
|
+
capricorn(x: number, y: number): Element;
|
|
84
|
+
aquarius(x: number, y: number): Element;
|
|
85
|
+
pisces(x: number, y: number): Element;
|
|
86
|
+
/**
|
|
87
|
+
* Draw As symbol
|
|
88
|
+
*/
|
|
89
|
+
ascendant(x: number, y: number): Element;
|
|
90
|
+
/**
|
|
91
|
+
* Draw Ds symbol
|
|
92
|
+
*/
|
|
93
|
+
descendant(x: number, y: number): Element;
|
|
94
|
+
/**
|
|
95
|
+
* Draw MC symbol
|
|
96
|
+
*/
|
|
97
|
+
mediumCoeli(x: number, y: number): Element;
|
|
98
|
+
/**
|
|
99
|
+
* Draw IC symbol
|
|
100
|
+
*/
|
|
101
|
+
immumCoeli(x: number, y: number): Element;
|
|
102
|
+
number1(x: number, y: number): Element;
|
|
103
|
+
number2(x: number, y: number): Element;
|
|
104
|
+
number3(x: number, y: number): Element;
|
|
105
|
+
number4(x: number, y: number): Element;
|
|
106
|
+
number5(x: number, y: number): Element;
|
|
107
|
+
number6(x: number, y: number): Element;
|
|
108
|
+
number7(x: number, y: number): Element;
|
|
109
|
+
number8(x: number, y: number): Element;
|
|
110
|
+
number9(x: number, y: number): Element;
|
|
111
|
+
number10(x: number, y: number): Element;
|
|
112
|
+
number11(x: number, y: number): Element;
|
|
113
|
+
number12(x: number, y: number): Element;
|
|
114
|
+
/**
|
|
115
|
+
* Draw circular sector
|
|
116
|
+
*
|
|
117
|
+
* @param {int} x - circle x center position
|
|
118
|
+
* @param {int} y - circle y center position
|
|
119
|
+
* @param {int} radius - circle radius in px
|
|
120
|
+
* @param {int} a1 - angleFrom in degree
|
|
121
|
+
* @param {int} a2 - angleTo in degree
|
|
122
|
+
* @param {int} thickness - from outside to center in px
|
|
123
|
+
*
|
|
124
|
+
* @return {SVGElement} segment
|
|
125
|
+
*
|
|
126
|
+
* @see SVG Path arc: https://www.w3.org/TR/SVG/paths.html#PathData
|
|
127
|
+
*/
|
|
128
|
+
segment(x: number, y: number, radius: number, a1: number, a2: number, thickness: number, lFlag?: number, sFlag?: number): Element;
|
|
129
|
+
/**
|
|
130
|
+
* Draw line in circle
|
|
131
|
+
*
|
|
132
|
+
* @param {int} x1
|
|
133
|
+
* @param {int} y2
|
|
134
|
+
* @param {int} x2
|
|
135
|
+
* @param {int} y2
|
|
136
|
+
* @param {String} color - HTML rgb
|
|
137
|
+
*
|
|
138
|
+
* @return {SVGElement} line
|
|
139
|
+
*/
|
|
140
|
+
line(x1: number, y1: number, x2: number, y2: number): Element;
|
|
141
|
+
/**
|
|
142
|
+
* Draw a circle
|
|
143
|
+
*
|
|
144
|
+
* @param {int} cx
|
|
145
|
+
* @param {int} cy
|
|
146
|
+
* @param {int} radius
|
|
147
|
+
*
|
|
148
|
+
* @return {SVGElement} circle
|
|
149
|
+
*/
|
|
150
|
+
circle(cx: number, cy: number, radius: number): Element;
|
|
151
|
+
/**
|
|
152
|
+
* Draw a text
|
|
153
|
+
*
|
|
154
|
+
* @param {String} text
|
|
155
|
+
* @param {int} x
|
|
156
|
+
* @param {int} y
|
|
157
|
+
* @param {String} size - etc. "13px"
|
|
158
|
+
* @param {String} color - HTML rgb
|
|
159
|
+
*
|
|
160
|
+
* @return {SVGElement} text
|
|
161
|
+
*/
|
|
162
|
+
text(txt: string, x: number, y: number, size: string, color: string): Element;
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
//#region src/settings.d.ts
|
|
166
|
+
interface AspectData {
|
|
167
|
+
degree: number;
|
|
168
|
+
orbit: number;
|
|
169
|
+
color: string;
|
|
170
|
+
}
|
|
171
|
+
type Aspect = Record<string, AspectData>;
|
|
172
|
+
interface Dignity {
|
|
173
|
+
name: string;
|
|
174
|
+
position: number;
|
|
175
|
+
orbit: number;
|
|
176
|
+
}
|
|
177
|
+
interface Settings {
|
|
178
|
+
SYMBOL_SCALE: number;
|
|
179
|
+
COLOR_BACKGROUND: string;
|
|
180
|
+
POINTS_COLOR: string;
|
|
181
|
+
POINTS_TEXT_SIZE: number;
|
|
182
|
+
POINTS_STROKE: number;
|
|
183
|
+
SIGNS_COLOR: string;
|
|
184
|
+
SIGNS_STROKE: number;
|
|
185
|
+
MARGIN: number;
|
|
186
|
+
PADDING: number;
|
|
187
|
+
ID_CHART: string;
|
|
188
|
+
ID_RADIX: string;
|
|
189
|
+
ID_TRANSIT: string;
|
|
190
|
+
ID_ASPECTS: string;
|
|
191
|
+
ID_POINTS: string;
|
|
192
|
+
ID_SIGNS: string;
|
|
193
|
+
ID_CIRCLES: string;
|
|
194
|
+
ID_AXIS: string;
|
|
195
|
+
ID_CUSPS: string;
|
|
196
|
+
ID_RULER: string;
|
|
197
|
+
ID_BG: string;
|
|
198
|
+
CIRCLE_COLOR: string;
|
|
199
|
+
CIRCLE_STRONG: number;
|
|
200
|
+
LINE_COLOR: string;
|
|
201
|
+
INDOOR_CIRCLE_RADIUS_RATIO: number;
|
|
202
|
+
INNER_CIRCLE_RADIUS_RATIO: number;
|
|
203
|
+
RULER_RADIUS: number;
|
|
204
|
+
SYMBOL_SUN: string;
|
|
205
|
+
SYMBOL_MOON: string;
|
|
206
|
+
SYMBOL_MERCURY: string;
|
|
207
|
+
SYMBOL_VENUS: string;
|
|
208
|
+
SYMBOL_MARS: string;
|
|
209
|
+
SYMBOL_JUPITER: string;
|
|
210
|
+
SYMBOL_SATURN: string;
|
|
211
|
+
SYMBOL_URANUS: string;
|
|
212
|
+
SYMBOL_NEPTUNE: string;
|
|
213
|
+
SYMBOL_PLUTO: string;
|
|
214
|
+
SYMBOL_CHIRON: string;
|
|
215
|
+
SYMBOL_LILITH: string;
|
|
216
|
+
SYMBOL_NNODE: string;
|
|
217
|
+
SYMBOL_SNODE: string;
|
|
218
|
+
SYMBOL_FORTUNE: string;
|
|
219
|
+
SYMBOL_AS: string;
|
|
220
|
+
SYMBOL_DS: string;
|
|
221
|
+
SYMBOL_MC: string;
|
|
222
|
+
SYMBOL_IC: string;
|
|
223
|
+
SYMBOL_AXIS_FONT_COLOR: string;
|
|
224
|
+
SYMBOL_AXIS_STROKE: number;
|
|
225
|
+
SYMBOL_CUSP_1: string;
|
|
226
|
+
SYMBOL_CUSP_2: string;
|
|
227
|
+
SYMBOL_CUSP_3: string;
|
|
228
|
+
SYMBOL_CUSP_4: string;
|
|
229
|
+
SYMBOL_CUSP_5: string;
|
|
230
|
+
SYMBOL_CUSP_6: string;
|
|
231
|
+
SYMBOL_CUSP_7: string;
|
|
232
|
+
SYMBOL_CUSP_8: string;
|
|
233
|
+
SYMBOL_CUSP_9: string;
|
|
234
|
+
SYMBOL_CUSP_10: string;
|
|
235
|
+
SYMBOL_CUSP_11: string;
|
|
236
|
+
SYMBOL_CUSP_12: string;
|
|
237
|
+
CUSPS_STROKE: number;
|
|
238
|
+
CUSPS_FONT_COLOR: string;
|
|
239
|
+
SYMBOL_ARIES: string;
|
|
240
|
+
SYMBOL_TAURUS: string;
|
|
241
|
+
SYMBOL_GEMINI: string;
|
|
242
|
+
SYMBOL_CANCER: string;
|
|
243
|
+
SYMBOL_LEO: string;
|
|
244
|
+
SYMBOL_VIRGO: string;
|
|
245
|
+
SYMBOL_LIBRA: string;
|
|
246
|
+
SYMBOL_SCORPIO: string;
|
|
247
|
+
SYMBOL_SAGITTARIUS: string;
|
|
248
|
+
SYMBOL_CAPRICORN: string;
|
|
249
|
+
SYMBOL_AQUARIUS: string;
|
|
250
|
+
SYMBOL_PISCES: string;
|
|
251
|
+
SYMBOL_SIGNS: string[];
|
|
252
|
+
COLOR_ARIES: string;
|
|
253
|
+
COLOR_TAURUS: string;
|
|
254
|
+
COLOR_GEMINI: string;
|
|
255
|
+
COLOR_CANCER: string;
|
|
256
|
+
COLOR_LEO: string;
|
|
257
|
+
COLOR_VIRGO: string;
|
|
258
|
+
COLOR_LIBRA: string;
|
|
259
|
+
COLOR_SCORPIO: string;
|
|
260
|
+
COLOR_SAGITTARIUS: string;
|
|
261
|
+
COLOR_CAPRICORN: string;
|
|
262
|
+
COLOR_AQUARIUS: string;
|
|
263
|
+
COLOR_PISCES: string;
|
|
264
|
+
COLORS_SIGNS: string[];
|
|
265
|
+
CUSTOM_SYMBOL_FN: null | ((name: string, x: number, y: number, context: SVG) => Element);
|
|
266
|
+
SHIFT_IN_DEGREES: number;
|
|
267
|
+
STROKE_ONLY: boolean;
|
|
268
|
+
ADD_CLICK_AREA: boolean;
|
|
269
|
+
COLLISION_RADIUS: number;
|
|
270
|
+
ASPECTS: Aspect;
|
|
271
|
+
SHOW_DIGNITIES_TEXT: boolean;
|
|
272
|
+
DIGNITIES_RULERSHIP: string;
|
|
273
|
+
DIGNITIES_DETRIMENT: string;
|
|
274
|
+
DIGNITIES_EXALTATION: string;
|
|
275
|
+
DIGNITIES_EXACT_EXALTATION: string;
|
|
276
|
+
DIGNITIES_FALL: string;
|
|
277
|
+
DIGNITIES_EXACT_EXALTATION_DEFAULT: Dignity[];
|
|
278
|
+
ANIMATION_CUSPS_ROTATION_SPEED: number;
|
|
279
|
+
DEBUG: boolean;
|
|
280
|
+
}
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/aspect.d.ts
|
|
283
|
+
interface FormedAspect {
|
|
284
|
+
point: {
|
|
285
|
+
name: string;
|
|
286
|
+
position: number;
|
|
287
|
+
};
|
|
288
|
+
toPoint: {
|
|
289
|
+
name: string;
|
|
290
|
+
position: number;
|
|
291
|
+
};
|
|
292
|
+
aspect: {
|
|
293
|
+
name: string;
|
|
294
|
+
degree: number;
|
|
295
|
+
color: string;
|
|
296
|
+
orbit: number;
|
|
297
|
+
};
|
|
298
|
+
precision: string;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Aspects calculator
|
|
302
|
+
*
|
|
303
|
+
* @class
|
|
304
|
+
* @public
|
|
305
|
+
* @constructor
|
|
306
|
+
* @param {AspectPoints} points; {"Sun":[0], "Moon":[90], "Neptune":[120], "As":[30]}
|
|
307
|
+
* @param {Object | null } settings
|
|
308
|
+
*/
|
|
309
|
+
declare class AspectCalculator {
|
|
310
|
+
settings: Partial<Settings>;
|
|
311
|
+
toPoints: Points;
|
|
312
|
+
context: this;
|
|
313
|
+
constructor(toPoints: Points, settings?: Partial<Settings>);
|
|
314
|
+
/**
|
|
315
|
+
* Getter for this.toPoints
|
|
316
|
+
* @see constructor
|
|
317
|
+
*
|
|
318
|
+
* @return {Object}
|
|
319
|
+
*/
|
|
320
|
+
getToPoints(): Points;
|
|
321
|
+
/**
|
|
322
|
+
* Radix aspects
|
|
323
|
+
*
|
|
324
|
+
* In radix calculation is the param "points" the same as param "toPoints" in constructor
|
|
325
|
+
* , but without special points such as: As,Ds, Mc, Ic, ...
|
|
326
|
+
*
|
|
327
|
+
* @param {Object} points; {"Sun":[0], "Moon":[90]}
|
|
328
|
+
*
|
|
329
|
+
* @return {Array<Object>} [{"aspect":{"name":"conjunction", "degree":120}"", "point":{"name":"Sun", "position":123}, "toPoint":{"name":"Moon", "position":345}, "precision":0.5}]]
|
|
330
|
+
*/
|
|
331
|
+
radix(points: Points): FormedAspect[];
|
|
332
|
+
/**
|
|
333
|
+
* Transit aspects
|
|
334
|
+
*
|
|
335
|
+
* @param {Object} points - transiting points; {"Sun":[0, 1], "Uranus":[90, -1], "NAME":[ANGLE, SPEED]};
|
|
336
|
+
* @return {Array<Object>} [{"aspect":{"name":"conjunction", "degree":120}"", "point":{"name":"Sun", "position":123}, "toPoint":{"name":"Moon", "position":345}, "precision":0.5}]]
|
|
337
|
+
*/
|
|
338
|
+
transit(points: Points): FormedAspect[];
|
|
339
|
+
hasAspect(point: number, toPoint: number, aspect: AspectData): boolean;
|
|
340
|
+
calcPrecision(point: number, toPoint: number, aspect: number): number;
|
|
341
|
+
isTransitPointApproachingToAspect(aspect: number, toPoint: number, point: number): boolean;
|
|
342
|
+
compareAspectsByPrecision(a: FormedAspect, b: FormedAspect): number;
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region src/transit.d.ts
|
|
346
|
+
/**
|
|
347
|
+
* Transit charts.
|
|
348
|
+
*
|
|
349
|
+
* @class
|
|
350
|
+
* @public
|
|
351
|
+
* @constructor
|
|
352
|
+
* @param {this.settings.Radix} radix
|
|
353
|
+
* @param {Object} data
|
|
354
|
+
*/
|
|
355
|
+
declare class Transit {
|
|
356
|
+
data: AstroData;
|
|
357
|
+
paper: SVG;
|
|
358
|
+
cx: number;
|
|
359
|
+
cy: number;
|
|
360
|
+
toPoints: Points;
|
|
361
|
+
radius: number;
|
|
362
|
+
settings: Settings;
|
|
363
|
+
rulerRadius: number;
|
|
364
|
+
pointRadius: number;
|
|
365
|
+
shift: number;
|
|
366
|
+
universe: Element;
|
|
367
|
+
context: this;
|
|
368
|
+
locatedPoints: LocatedPoint[];
|
|
369
|
+
constructor(radix: Radix, data: AstroData, settings: Settings);
|
|
370
|
+
/**
|
|
371
|
+
* Draw background
|
|
372
|
+
*/
|
|
373
|
+
drawBg(): void;
|
|
374
|
+
/**
|
|
375
|
+
* Draw planets
|
|
376
|
+
*
|
|
377
|
+
* @param{undefined | Object} planetsData, posible data planets to draw
|
|
378
|
+
*/
|
|
379
|
+
drawPoints(planetsData?: Points): void;
|
|
380
|
+
/**
|
|
381
|
+
* Draw circles
|
|
382
|
+
*/
|
|
383
|
+
drawCircles(): void;
|
|
384
|
+
/**
|
|
385
|
+
* Draw cusps
|
|
386
|
+
* @param{undefined | Object} cuspsData, posible data cusps to draw
|
|
387
|
+
*/
|
|
388
|
+
drawCusps(cuspsData?: number[]): void;
|
|
389
|
+
drawRuler(): void;
|
|
390
|
+
/**
|
|
391
|
+
* Draw aspects
|
|
392
|
+
* @param{Array<Object> | null} customAspects - posible custom aspects to draw;
|
|
393
|
+
*/
|
|
394
|
+
aspects(customAspects: FormedAspect[]): Transit;
|
|
395
|
+
/**
|
|
396
|
+
* Moves points to another position.
|
|
397
|
+
*
|
|
398
|
+
* @param {Object} data - planets target positions.
|
|
399
|
+
* @param {Integer} duration - in seconds
|
|
400
|
+
* @param {boolean} isReverse
|
|
401
|
+
* @param {Function | undefined} callbck - the function executed at the end of animation
|
|
402
|
+
*/
|
|
403
|
+
animate(data: AstroData, duration: number, isReverse: boolean, callback: () => void): Transit;
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region src/radix.d.ts
|
|
407
|
+
type Points = Record<string, number[]>;
|
|
408
|
+
interface LocatedPoint {
|
|
409
|
+
name: string;
|
|
410
|
+
x: number;
|
|
411
|
+
y: number;
|
|
412
|
+
r: number;
|
|
413
|
+
angle: number;
|
|
414
|
+
pointer?: number;
|
|
415
|
+
index?: number;
|
|
416
|
+
}
|
|
417
|
+
interface AstroData {
|
|
418
|
+
planets: Points;
|
|
419
|
+
cusps: number[];
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Radix charts.
|
|
423
|
+
*
|
|
424
|
+
* @class
|
|
425
|
+
* @public
|
|
426
|
+
* @constructor
|
|
427
|
+
* @param {this.settings.SVG} paper
|
|
428
|
+
* @param {int} cx
|
|
429
|
+
* @param {int} cy
|
|
430
|
+
* @param {int} radius
|
|
431
|
+
* @param {Object} data
|
|
432
|
+
*/
|
|
433
|
+
declare class Radix {
|
|
434
|
+
settings: Settings;
|
|
435
|
+
data: AstroData;
|
|
436
|
+
paper: SVG;
|
|
437
|
+
cx: number;
|
|
438
|
+
cy: number;
|
|
439
|
+
radius: number;
|
|
440
|
+
locatedPoints: LocatedPoint[];
|
|
441
|
+
rulerRadius: number;
|
|
442
|
+
pointRadius: number;
|
|
443
|
+
toPoints: Points;
|
|
444
|
+
shift: number;
|
|
445
|
+
universe: Element;
|
|
446
|
+
context: this;
|
|
447
|
+
constructor(paper: SVG, cx: number, cy: number, radius: number, data: AstroData, settings: Settings);
|
|
448
|
+
/**
|
|
449
|
+
* Draw background
|
|
450
|
+
*/
|
|
451
|
+
drawBg(): void;
|
|
452
|
+
/**
|
|
453
|
+
* Draw universe.
|
|
454
|
+
*/
|
|
455
|
+
drawUniverse(): void;
|
|
456
|
+
/**
|
|
457
|
+
* Draw points
|
|
458
|
+
*/
|
|
459
|
+
drawPoints(): void;
|
|
460
|
+
drawAxis(): void;
|
|
461
|
+
/**
|
|
462
|
+
* Draw cusps
|
|
463
|
+
*/
|
|
464
|
+
drawCusps(): void;
|
|
465
|
+
/**
|
|
466
|
+
* Draw aspects
|
|
467
|
+
* @param{Array<Object> | null} customAspects - posible custom aspects to draw;
|
|
468
|
+
*/
|
|
469
|
+
aspects(customAspects?: FormedAspect[] | null): Radix;
|
|
470
|
+
/**
|
|
471
|
+
* Add points of interest for aspects calculation
|
|
472
|
+
* @param {Obect} points, {"As":[0],"Ic":[90],"Ds":[180],"Mc":[270]}
|
|
473
|
+
* @see (this.settings.AspectCalculator( toPoints) )
|
|
474
|
+
*/
|
|
475
|
+
addPointsOfInterest(points: Points): Radix;
|
|
476
|
+
drawRuler(): void;
|
|
477
|
+
/**
|
|
478
|
+
* Draw circles
|
|
479
|
+
*/
|
|
480
|
+
drawCircles(): void;
|
|
481
|
+
/**
|
|
482
|
+
* Display transit horoscope
|
|
483
|
+
*
|
|
484
|
+
* @param {Object} data
|
|
485
|
+
* @example
|
|
486
|
+
* {
|
|
487
|
+
* "planets":{"Moon":[0], "Sun":[30], ... },
|
|
488
|
+
* "cusps":[300, 340, 30, 60, 75, 90, 116, 172, 210, 236, 250, 274], *
|
|
489
|
+
* }
|
|
490
|
+
*
|
|
491
|
+
* @return {Transit} transit
|
|
492
|
+
*/
|
|
493
|
+
transit(data: AstroData): Transit;
|
|
494
|
+
}
|
|
495
|
+
//#endregion
|
|
496
|
+
//#region src/chart.d.ts
|
|
497
|
+
/**
|
|
498
|
+
* Displays astrology charts.
|
|
499
|
+
*
|
|
500
|
+
* @class
|
|
501
|
+
* @public
|
|
502
|
+
* @constructor
|
|
503
|
+
* @param {String} elementId - root DOMElement
|
|
504
|
+
* @param {int} width
|
|
505
|
+
* @param {int} height
|
|
506
|
+
* @param {Object} settings
|
|
507
|
+
*/
|
|
508
|
+
declare class Chart {
|
|
509
|
+
paper: SVG;
|
|
510
|
+
cx: number;
|
|
511
|
+
cy: number;
|
|
512
|
+
radius: number;
|
|
513
|
+
settings: Settings;
|
|
514
|
+
constructor(elementId: string, width: number, height: number, settings?: Partial<Settings>);
|
|
515
|
+
/**
|
|
516
|
+
* Display radix horoscope
|
|
517
|
+
*
|
|
518
|
+
* @param {Object} data
|
|
519
|
+
* @example
|
|
520
|
+
* {
|
|
521
|
+
* "points":{"Moon":[0], "Sun":[30], ... },
|
|
522
|
+
* "cusps":[300, 340, 30, 60, 75, 90, 116, 172, 210, 236, 250, 274]
|
|
523
|
+
* }
|
|
524
|
+
*
|
|
525
|
+
* @return {Radix} radix
|
|
526
|
+
*/
|
|
527
|
+
radix(data: AstroData): Radix;
|
|
528
|
+
/**
|
|
529
|
+
* Scale chart
|
|
530
|
+
*
|
|
531
|
+
* @param {int} factor
|
|
532
|
+
*/
|
|
533
|
+
scale(factor: number): void;
|
|
534
|
+
/**
|
|
535
|
+
* Draw the symbol on the axis.
|
|
536
|
+
* For debug only.
|
|
537
|
+
*
|
|
538
|
+
*/
|
|
539
|
+
calibrate(): Chart;
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region src/utils.d.ts
|
|
543
|
+
/**
|
|
544
|
+
* Calculate position of the point on the circle.
|
|
545
|
+
*
|
|
546
|
+
* @param {int} cx - center x
|
|
547
|
+
* @param {int} cy - center y
|
|
548
|
+
* @param {int} radius
|
|
549
|
+
* @param {double} angle - degree
|
|
550
|
+
*
|
|
551
|
+
* @return {{x: number, y: number}} Obj - {x:10, y:20}
|
|
552
|
+
*/
|
|
553
|
+
declare const getPointPosition: (cx: number, cy: number, radius: number, angle: number, astrology: {
|
|
554
|
+
SHIFT_IN_DEGREES: number;
|
|
555
|
+
}) => {
|
|
556
|
+
x: number;
|
|
557
|
+
y: number;
|
|
558
|
+
};
|
|
559
|
+
declare const degreeToRadians: (degrees: number) => number;
|
|
560
|
+
declare const radiansToDegree: (radians: number) => number;
|
|
561
|
+
/**
|
|
562
|
+
* Checks a source data
|
|
563
|
+
* @private
|
|
564
|
+
*
|
|
565
|
+
* @param {Object} data
|
|
566
|
+
* @return {{hasError: boolean, messages: string[]}} status
|
|
567
|
+
*/
|
|
568
|
+
declare const validate: (data: AstroData) => {
|
|
569
|
+
hasError: boolean;
|
|
570
|
+
messages: string[];
|
|
571
|
+
};
|
|
572
|
+
//#endregion
|
|
573
|
+
export { type Aspect, AspectCalculator, type AspectData, type AstroData, Chart, type Dignity, type FormedAspect, type LocatedPoint, type Points, type Settings, degreeToRadians, getPointPosition, radiansToDegree, validate };
|
|
574
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/svg.ts","../src/settings.ts","../src/aspect.ts","../src/transit.ts","../src/radix.ts","../src/chart.ts","../src/utils.ts"],"mappings":";AAA6C;;;;;;;;;;AAAA,cAYvC,GAAA;EACJ,QAAA,EAAU,QAAA;EACV,eAAA;EACA,UAAA,EAAY,aAAA;EACZ,IAAA,EAAM,OAAA;EACN,KAAA;EACA,MAAA;EACA,OAAA;cACY,SAAA,UAAmB,KAAA,UAAe,MAAA,UAAgB,QAAA,EAAU,QAAA;EA4BxE,UAAA,CAAW,IAAA,UAAc,CAAA,UAAW,CAAA,WAAY,OAAA;EAwelB;;;;;;;;;EA7X9B,SAAA,CAAU,IAAA,UAAc,CAAA,UAAW,CAAA,WAAY,OAAA;EAksBlB;;;;;;;;;;EA/qB7B,kBAAA,CAAmB,CAAA,UAAW,CAAA,WAAY,OAAA;EA49BX;;;;;;;EA38B/B,gBAAA,CAAiB,IAAA;EA2nCc;;;;;;;EAhnC/B,iBAAA,CAAkB,KAAA;EAalB,GAAA,CAAI,CAAA,UAAW,CAAA,WAAY,OAAA;EA6B3B,IAAA,CAAK,CAAA,UAAW,CAAA,WAAY,OAAA;EA6B5B,OAAA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