@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.mjs
ADDED
|
@@ -0,0 +1,2643 @@
|
|
|
1
|
+
//#region src/settings.ts
|
|
2
|
+
const default_settings = {
|
|
3
|
+
SYMBOL_SCALE: 1,
|
|
4
|
+
COLOR_BACKGROUND: "#fff",
|
|
5
|
+
POINTS_COLOR: "#000",
|
|
6
|
+
POINTS_TEXT_SIZE: 8,
|
|
7
|
+
POINTS_STROKE: 1.8,
|
|
8
|
+
SIGNS_COLOR: "#000",
|
|
9
|
+
SIGNS_STROKE: 1.5,
|
|
10
|
+
MARGIN: 50,
|
|
11
|
+
PADDING: 18,
|
|
12
|
+
ID_CHART: "astrology",
|
|
13
|
+
ID_RADIX: "radix",
|
|
14
|
+
ID_TRANSIT: "transit",
|
|
15
|
+
ID_ASPECTS: "aspects",
|
|
16
|
+
ID_POINTS: "planets",
|
|
17
|
+
ID_SIGNS: "signs",
|
|
18
|
+
ID_CIRCLES: "circles",
|
|
19
|
+
ID_AXIS: "axis",
|
|
20
|
+
ID_CUSPS: "cusps",
|
|
21
|
+
ID_RULER: "ruler",
|
|
22
|
+
ID_BG: "bg",
|
|
23
|
+
CIRCLE_COLOR: "#333",
|
|
24
|
+
CIRCLE_STRONG: 2,
|
|
25
|
+
LINE_COLOR: "#333",
|
|
26
|
+
INDOOR_CIRCLE_RADIUS_RATIO: 2,
|
|
27
|
+
INNER_CIRCLE_RADIUS_RATIO: 8,
|
|
28
|
+
RULER_RADIUS: 4,
|
|
29
|
+
SYMBOL_SUN: "Sun",
|
|
30
|
+
SYMBOL_MOON: "Moon",
|
|
31
|
+
SYMBOL_MERCURY: "Mercury",
|
|
32
|
+
SYMBOL_VENUS: "Venus",
|
|
33
|
+
SYMBOL_MARS: "Mars",
|
|
34
|
+
SYMBOL_JUPITER: "Jupiter",
|
|
35
|
+
SYMBOL_SATURN: "Saturn",
|
|
36
|
+
SYMBOL_URANUS: "Uranus",
|
|
37
|
+
SYMBOL_NEPTUNE: "Neptune",
|
|
38
|
+
SYMBOL_PLUTO: "Pluto",
|
|
39
|
+
SYMBOL_CHIRON: "Chiron",
|
|
40
|
+
SYMBOL_LILITH: "Lilith",
|
|
41
|
+
SYMBOL_NNODE: "NNode",
|
|
42
|
+
SYMBOL_SNODE: "SNode",
|
|
43
|
+
SYMBOL_FORTUNE: "Fortune",
|
|
44
|
+
SYMBOL_AS: "As",
|
|
45
|
+
SYMBOL_DS: "Ds",
|
|
46
|
+
SYMBOL_MC: "Mc",
|
|
47
|
+
SYMBOL_IC: "Ic",
|
|
48
|
+
SYMBOL_AXIS_FONT_COLOR: "#333",
|
|
49
|
+
SYMBOL_AXIS_STROKE: 1.6,
|
|
50
|
+
SYMBOL_CUSP_1: "1",
|
|
51
|
+
SYMBOL_CUSP_2: "2",
|
|
52
|
+
SYMBOL_CUSP_3: "3",
|
|
53
|
+
SYMBOL_CUSP_4: "4",
|
|
54
|
+
SYMBOL_CUSP_5: "5",
|
|
55
|
+
SYMBOL_CUSP_6: "6",
|
|
56
|
+
SYMBOL_CUSP_7: "7",
|
|
57
|
+
SYMBOL_CUSP_8: "8",
|
|
58
|
+
SYMBOL_CUSP_9: "9",
|
|
59
|
+
SYMBOL_CUSP_10: "10",
|
|
60
|
+
SYMBOL_CUSP_11: "11",
|
|
61
|
+
SYMBOL_CUSP_12: "12",
|
|
62
|
+
CUSPS_STROKE: 1,
|
|
63
|
+
CUSPS_FONT_COLOR: "#000",
|
|
64
|
+
SYMBOL_ARIES: "Aries",
|
|
65
|
+
SYMBOL_TAURUS: "Taurus",
|
|
66
|
+
SYMBOL_GEMINI: "Gemini",
|
|
67
|
+
SYMBOL_CANCER: "Cancer",
|
|
68
|
+
SYMBOL_LEO: "Leo",
|
|
69
|
+
SYMBOL_VIRGO: "Virgo",
|
|
70
|
+
SYMBOL_LIBRA: "Libra",
|
|
71
|
+
SYMBOL_SCORPIO: "Scorpio",
|
|
72
|
+
SYMBOL_SAGITTARIUS: "Sagittarius",
|
|
73
|
+
SYMBOL_CAPRICORN: "Capricorn",
|
|
74
|
+
SYMBOL_AQUARIUS: "Aquarius",
|
|
75
|
+
SYMBOL_PISCES: "Pisces",
|
|
76
|
+
SYMBOL_SIGNS: [
|
|
77
|
+
"Aries",
|
|
78
|
+
"Taurus",
|
|
79
|
+
"Gemini",
|
|
80
|
+
"Cancer",
|
|
81
|
+
"Leo",
|
|
82
|
+
"Virgo",
|
|
83
|
+
"Libra",
|
|
84
|
+
"Scorpio",
|
|
85
|
+
"Sagittarius",
|
|
86
|
+
"Capricorn",
|
|
87
|
+
"Aquarius",
|
|
88
|
+
"Pisces"
|
|
89
|
+
],
|
|
90
|
+
COLOR_ARIES: "#FF4500",
|
|
91
|
+
COLOR_TAURUS: "#8B4513",
|
|
92
|
+
COLOR_GEMINI: "#87CEEB",
|
|
93
|
+
COLOR_CANCER: "#27AE60",
|
|
94
|
+
COLOR_LEO: "#FF4500",
|
|
95
|
+
COLOR_VIRGO: "#8B4513",
|
|
96
|
+
COLOR_LIBRA: "#87CEEB",
|
|
97
|
+
COLOR_SCORPIO: "#27AE60",
|
|
98
|
+
COLOR_SAGITTARIUS: "#FF4500",
|
|
99
|
+
COLOR_CAPRICORN: "#8B4513",
|
|
100
|
+
COLOR_AQUARIUS: "#87CEEB",
|
|
101
|
+
COLOR_PISCES: "#27AE60",
|
|
102
|
+
COLORS_SIGNS: [
|
|
103
|
+
"#FF4500",
|
|
104
|
+
"#8B4513",
|
|
105
|
+
"#87CEEB",
|
|
106
|
+
"#27AE60",
|
|
107
|
+
"#FF4500",
|
|
108
|
+
"#8B4513",
|
|
109
|
+
"#87CEEB",
|
|
110
|
+
"#27AE60",
|
|
111
|
+
"#FF4500",
|
|
112
|
+
"#8B4513",
|
|
113
|
+
"#87CEEB",
|
|
114
|
+
"#27AE60"
|
|
115
|
+
],
|
|
116
|
+
CUSTOM_SYMBOL_FN: null,
|
|
117
|
+
SHIFT_IN_DEGREES: 180,
|
|
118
|
+
STROKE_ONLY: false,
|
|
119
|
+
ADD_CLICK_AREA: false,
|
|
120
|
+
COLLISION_RADIUS: 10,
|
|
121
|
+
ASPECTS: {
|
|
122
|
+
conjunction: {
|
|
123
|
+
degree: 0,
|
|
124
|
+
orbit: 10,
|
|
125
|
+
color: "transparent"
|
|
126
|
+
},
|
|
127
|
+
square: {
|
|
128
|
+
degree: 90,
|
|
129
|
+
orbit: 8,
|
|
130
|
+
color: "#FF4500"
|
|
131
|
+
},
|
|
132
|
+
trine: {
|
|
133
|
+
degree: 120,
|
|
134
|
+
orbit: 8,
|
|
135
|
+
color: "#27AE60"
|
|
136
|
+
},
|
|
137
|
+
opposition: {
|
|
138
|
+
degree: 180,
|
|
139
|
+
orbit: 10,
|
|
140
|
+
color: "#27AE60"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
SHOW_DIGNITIES_TEXT: true,
|
|
144
|
+
DIGNITIES_RULERSHIP: "r",
|
|
145
|
+
DIGNITIES_DETRIMENT: "d",
|
|
146
|
+
DIGNITIES_EXALTATION: "e",
|
|
147
|
+
DIGNITIES_EXACT_EXALTATION: "E",
|
|
148
|
+
DIGNITIES_FALL: "f",
|
|
149
|
+
DIGNITIES_EXACT_EXALTATION_DEFAULT: [
|
|
150
|
+
{
|
|
151
|
+
name: "Sun",
|
|
152
|
+
position: 19,
|
|
153
|
+
orbit: 2
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "Moon",
|
|
157
|
+
position: 33,
|
|
158
|
+
orbit: 2
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "Mercury",
|
|
162
|
+
position: 155,
|
|
163
|
+
orbit: 2
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "Venus",
|
|
167
|
+
position: 357,
|
|
168
|
+
orbit: 2
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "Mars",
|
|
172
|
+
position: 298,
|
|
173
|
+
orbit: 2
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "Jupiter",
|
|
177
|
+
position: 105,
|
|
178
|
+
orbit: 2
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "Saturn",
|
|
182
|
+
position: 201,
|
|
183
|
+
orbit: 2
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "NNode",
|
|
187
|
+
position: 63,
|
|
188
|
+
orbit: 2
|
|
189
|
+
}
|
|
190
|
+
],
|
|
191
|
+
ANIMATION_CUSPS_ROTATION_SPEED: 2,
|
|
192
|
+
DEBUG: false
|
|
193
|
+
};
|
|
194
|
+
var settings_default = default_settings;
|
|
195
|
+
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/utils.ts
|
|
198
|
+
/**
|
|
199
|
+
* Calculate position of the point on the circle.
|
|
200
|
+
*
|
|
201
|
+
* @param {int} cx - center x
|
|
202
|
+
* @param {int} cy - center y
|
|
203
|
+
* @param {int} radius
|
|
204
|
+
* @param {double} angle - degree
|
|
205
|
+
*
|
|
206
|
+
* @return {{x: number, y: number}} Obj - {x:10, y:20}
|
|
207
|
+
*/
|
|
208
|
+
const getPointPosition = (cx, cy, radius, angle, astrology) => {
|
|
209
|
+
const angleInRadius = (astrology.SHIFT_IN_DEGREES - angle) * Math.PI / 180;
|
|
210
|
+
return {
|
|
211
|
+
x: cx + radius * Math.cos(angleInRadius),
|
|
212
|
+
y: cy + radius * Math.sin(angleInRadius)
|
|
213
|
+
};
|
|
214
|
+
};
|
|
215
|
+
const degreeToRadians = (degrees) => degrees * Math.PI / 180;
|
|
216
|
+
const radiansToDegree = (radians) => radians * 180 / Math.PI;
|
|
217
|
+
/**
|
|
218
|
+
* Calculates positions of the point description
|
|
219
|
+
*
|
|
220
|
+
* @param {Object} point
|
|
221
|
+
* @param {Array<String>} texts
|
|
222
|
+
*
|
|
223
|
+
* @return {Array<Object>} [{text:"abc", x:123, y:456}, {text:"cvb", x:456, y:852}, ...]
|
|
224
|
+
*/
|
|
225
|
+
const getDescriptionPosition = function(point, texts, astrology) {
|
|
226
|
+
const RATION = 1.4;
|
|
227
|
+
const result = [];
|
|
228
|
+
const posX = point.x + astrology.COLLISION_RADIUS / RATION * astrology.SYMBOL_SCALE;
|
|
229
|
+
const posY = point.y - astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE;
|
|
230
|
+
texts.forEach((text, idx) => {
|
|
231
|
+
result.push({
|
|
232
|
+
text,
|
|
233
|
+
x: posX,
|
|
234
|
+
y: posY + astrology.COLLISION_RADIUS / RATION * astrology.SYMBOL_SCALE * idx
|
|
235
|
+
});
|
|
236
|
+
}, this);
|
|
237
|
+
return result;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Checks a source data
|
|
241
|
+
* @private
|
|
242
|
+
*
|
|
243
|
+
* @param {Object} data
|
|
244
|
+
* @return {{hasError: boolean, messages: string[]}} status
|
|
245
|
+
*/
|
|
246
|
+
const validate = (data) => {
|
|
247
|
+
const status = {
|
|
248
|
+
hasError: false,
|
|
249
|
+
messages: []
|
|
250
|
+
};
|
|
251
|
+
if (data == null) {
|
|
252
|
+
status.messages.push("Data is not set.");
|
|
253
|
+
status.hasError = true;
|
|
254
|
+
return status;
|
|
255
|
+
}
|
|
256
|
+
if (data.planets == null) {
|
|
257
|
+
status.messages.push("There is not property 'planets'.");
|
|
258
|
+
status.hasError = true;
|
|
259
|
+
}
|
|
260
|
+
for (const property in data.planets) if (data.planets.hasOwnProperty(property)) {
|
|
261
|
+
if (!Array.isArray(data.planets[property])) {
|
|
262
|
+
status.messages.push("The planets property '" + property + "' has to be Array.");
|
|
263
|
+
status.hasError = true;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (data.cusps != null && !Array.isArray(data.cusps)) {
|
|
267
|
+
status.messages.push("Property 'cusps' has to be Array.");
|
|
268
|
+
status.hasError = true;
|
|
269
|
+
}
|
|
270
|
+
if (data.cusps != null && data.cusps.length !== 12) {
|
|
271
|
+
status.messages.push("Count of 'cusps' values has to be 12.");
|
|
272
|
+
status.hasError = true;
|
|
273
|
+
}
|
|
274
|
+
return status;
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* Get empty DOMElement with ID
|
|
278
|
+
*
|
|
279
|
+
* @param{String} elementID
|
|
280
|
+
* @param{DOMElement} parent
|
|
281
|
+
* @return {DOMElement}
|
|
282
|
+
*/
|
|
283
|
+
const getEmptyWrapper = (parent, elementID, _paperElementId) => {
|
|
284
|
+
const element = document.getElementById(elementID);
|
|
285
|
+
if (element != null) {
|
|
286
|
+
removeChilds(element);
|
|
287
|
+
return element;
|
|
288
|
+
}
|
|
289
|
+
const paper = document.getElementById(_paperElementId);
|
|
290
|
+
if (paper == null) throw new Error("Paper element should exist");
|
|
291
|
+
const wrapper = document.createElementNS(paper.namespaceURI, "g");
|
|
292
|
+
wrapper.setAttribute("id", elementID);
|
|
293
|
+
parent.appendChild(wrapper);
|
|
294
|
+
return wrapper;
|
|
295
|
+
};
|
|
296
|
+
/**
|
|
297
|
+
* Remove childs
|
|
298
|
+
*
|
|
299
|
+
* @param{DOMElement} parent
|
|
300
|
+
*/
|
|
301
|
+
const removeChilds = (parent) => {
|
|
302
|
+
if (parent == null) return;
|
|
303
|
+
let last;
|
|
304
|
+
while ((last = parent.lastChild) != null) parent.removeChild(last);
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Check circle collision between two objects
|
|
308
|
+
*
|
|
309
|
+
* @param {Object} circle1, {x:123, y:123, r:50}
|
|
310
|
+
* @param {Object} circle2, {x:456, y:456, r:60}
|
|
311
|
+
* @return {boolean}
|
|
312
|
+
*/
|
|
313
|
+
const isCollision = (circle1, circle2) => {
|
|
314
|
+
const vx = circle1.x - circle2.x;
|
|
315
|
+
const vy = circle1.y - circle2.y;
|
|
316
|
+
return Math.sqrt(vx * vx + vy * vy) <= circle1.r + circle2.r;
|
|
317
|
+
};
|
|
318
|
+
/**
|
|
319
|
+
* Places a new point in the located list
|
|
320
|
+
*
|
|
321
|
+
* @param {Array<Object>} locatedPoints, [{name:"Mars", x:123, y:123, r:50, ephemeris:45.96}, {name:"Sun", x:1234, y:1234, r:50, ephemeris:100.96}]
|
|
322
|
+
* @param {Object} point, {name:"Venus", x:78, y:56, r:50, angle:15.96}
|
|
323
|
+
* @param {Object} universe - current universe
|
|
324
|
+
* @return {Array<Object>} locatedPoints
|
|
325
|
+
*/
|
|
326
|
+
const assemble = (locatedPoints, point, universe, astrology) => {
|
|
327
|
+
if (locatedPoints.length === 0) {
|
|
328
|
+
locatedPoints.push(point);
|
|
329
|
+
return locatedPoints;
|
|
330
|
+
}
|
|
331
|
+
if (2 * Math.PI * universe.r - 2 * (astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE) * (locatedPoints.length + 2) <= 0) {
|
|
332
|
+
if (astrology.DEBUG) console.log("Universe circumference: " + 2 * Math.PI * universe.r + ", Planets circumference: " + 2 * (astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE) * (locatedPoints.length + 2));
|
|
333
|
+
throw new Error("Unresolved planet collision. Try change SYMBOL_SCALE or paper size.");
|
|
334
|
+
}
|
|
335
|
+
let hasCollision = false;
|
|
336
|
+
let locatedButInCollisionPoint;
|
|
337
|
+
locatedPoints.sort(comparePoints);
|
|
338
|
+
for (let i = 0, ln = locatedPoints.length; i < ln; i++) if (isCollision(locatedPoints[i], point)) {
|
|
339
|
+
hasCollision = true;
|
|
340
|
+
locatedButInCollisionPoint = locatedPoints[i];
|
|
341
|
+
locatedButInCollisionPoint.index = i;
|
|
342
|
+
if (astrology.DEBUG) console.log("Resolve collision: " + locatedButInCollisionPoint.name + " X " + point.name);
|
|
343
|
+
break;
|
|
344
|
+
}
|
|
345
|
+
if (hasCollision && locatedButInCollisionPoint != null && locatedButInCollisionPoint.index != null) {
|
|
346
|
+
placePointsInCollision(locatedButInCollisionPoint, point);
|
|
347
|
+
let newPointPosition = getPointPosition(universe.cx, universe.cy, universe.r, locatedButInCollisionPoint.angle, astrology);
|
|
348
|
+
locatedButInCollisionPoint.x = newPointPosition.x;
|
|
349
|
+
locatedButInCollisionPoint.y = newPointPosition.y;
|
|
350
|
+
newPointPosition = getPointPosition(universe.cx, universe.cy, universe.r, point.angle, astrology);
|
|
351
|
+
point.x = newPointPosition.x;
|
|
352
|
+
point.y = newPointPosition.y;
|
|
353
|
+
locatedPoints.splice(locatedButInCollisionPoint.index, 1);
|
|
354
|
+
locatedPoints = assemble(locatedPoints, locatedButInCollisionPoint, universe, astrology);
|
|
355
|
+
locatedPoints = assemble(locatedPoints, point, universe, astrology);
|
|
356
|
+
} else locatedPoints.push(point);
|
|
357
|
+
locatedPoints.sort(comparePoints);
|
|
358
|
+
return locatedPoints;
|
|
359
|
+
};
|
|
360
|
+
/**
|
|
361
|
+
* Sets the positions of two points that are in collision.
|
|
362
|
+
*
|
|
363
|
+
* @param {Object} p1, {..., pointer:123, angle:456}
|
|
364
|
+
* @param {Object} p2, {..., pointer:23, angle:56}
|
|
365
|
+
*/
|
|
366
|
+
const placePointsInCollision = (p1, p2) => {
|
|
367
|
+
const step = 1;
|
|
368
|
+
let adjustedP1Pointer = p1.pointer === void 0 ? p1.angle : p1.pointer;
|
|
369
|
+
let adjustedP2Pointer = p2.pointer === void 0 ? p2.angle : p2.pointer;
|
|
370
|
+
if (Math.abs(adjustedP1Pointer - adjustedP2Pointer) > 180) {
|
|
371
|
+
adjustedP1Pointer = (adjustedP1Pointer + 180) % 360;
|
|
372
|
+
adjustedP2Pointer = (adjustedP2Pointer + 180) % 360;
|
|
373
|
+
}
|
|
374
|
+
if (adjustedP1Pointer <= adjustedP2Pointer) {
|
|
375
|
+
p1.angle = p1.angle - step;
|
|
376
|
+
p2.angle = p2.angle + step;
|
|
377
|
+
} else if (adjustedP1Pointer >= adjustedP2Pointer) {
|
|
378
|
+
p1.angle = p1.angle + step;
|
|
379
|
+
p2.angle = p2.angle - step;
|
|
380
|
+
}
|
|
381
|
+
p1.angle = (p1.angle + 360) % 360;
|
|
382
|
+
p2.angle = (p2.angle + 360) % 360;
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* Check collision between angle and object
|
|
386
|
+
*
|
|
387
|
+
* @param {double} angle
|
|
388
|
+
* @param {Array<Object>} points, [{x:456, y:456, r:60, angle:123}, ...]
|
|
389
|
+
* @return {boolean}
|
|
390
|
+
*/
|
|
391
|
+
const isInCollision = (angle, points, astrology) => {
|
|
392
|
+
const deg360 = radiansToDegree(2 * Math.PI);
|
|
393
|
+
const collisionRadius = astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE / 2;
|
|
394
|
+
let result = false;
|
|
395
|
+
for (let i = 0, ln = points.length; i < ln; i++) if (Math.abs(points[i].angle - angle) <= collisionRadius || deg360 - Math.abs(points[i].angle - angle) <= collisionRadius) {
|
|
396
|
+
result = true;
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
return result;
|
|
400
|
+
};
|
|
401
|
+
/**
|
|
402
|
+
* Calculates positions of the dashed line passing through the obstacle.
|
|
403
|
+
* *
|
|
404
|
+
* @param {double} centerX
|
|
405
|
+
* @param {double} centerY
|
|
406
|
+
* @param {double} angle - line angle
|
|
407
|
+
* @param {double} lineStartRadius
|
|
408
|
+
* @param {double} lineEndRadius
|
|
409
|
+
* @param {double} obstacleRadius
|
|
410
|
+
* @param {Array<Object>} obstacles, [{x:456, y:456, r:60, angle:123}, ...]
|
|
411
|
+
*
|
|
412
|
+
* @return {Array<any>} [{startX:1, startY:1, endX:4, endY:4}, {startX:6, startY:6, endX:8, endY:8}]
|
|
413
|
+
*/
|
|
414
|
+
const getDashedLinesPositions = (centerX, centerY, angle, lineStartRadius, lineEndRadius, obstacleRadius, obstacles, astrology) => {
|
|
415
|
+
let startPos;
|
|
416
|
+
let endPos;
|
|
417
|
+
const result = [];
|
|
418
|
+
if (isInCollision(angle, obstacles, astrology)) {
|
|
419
|
+
startPos = getPointPosition(centerX, centerY, lineStartRadius, angle, astrology);
|
|
420
|
+
endPos = getPointPosition(centerX, centerY, obstacleRadius - astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE, angle, astrology);
|
|
421
|
+
result.push({
|
|
422
|
+
startX: startPos.x,
|
|
423
|
+
startY: startPos.y,
|
|
424
|
+
endX: endPos.x,
|
|
425
|
+
endY: endPos.y
|
|
426
|
+
});
|
|
427
|
+
if (obstacleRadius + 2 * (astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE) < lineEndRadius) {
|
|
428
|
+
startPos = getPointPosition(centerX, centerY, obstacleRadius + 2 * (astrology.COLLISION_RADIUS * astrology.SYMBOL_SCALE), angle, astrology);
|
|
429
|
+
endPos = getPointPosition(centerX, centerY, lineEndRadius, angle, astrology);
|
|
430
|
+
result.push({
|
|
431
|
+
startX: startPos.x,
|
|
432
|
+
startY: startPos.y,
|
|
433
|
+
endX: endPos.x,
|
|
434
|
+
endY: endPos.y
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
} else {
|
|
438
|
+
startPos = getPointPosition(centerX, centerY, lineStartRadius, angle, astrology);
|
|
439
|
+
endPos = getPointPosition(centerX, centerY, lineEndRadius, angle, astrology);
|
|
440
|
+
result.push({
|
|
441
|
+
startX: startPos.x,
|
|
442
|
+
startY: startPos.y,
|
|
443
|
+
endX: endPos.x,
|
|
444
|
+
endY: endPos.y
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
return result;
|
|
448
|
+
};
|
|
449
|
+
/**
|
|
450
|
+
* Calculate ruler positions.
|
|
451
|
+
*
|
|
452
|
+
* @param {Double} centerX
|
|
453
|
+
* @param {Double} centerY
|
|
454
|
+
* @param {Double} startRadius
|
|
455
|
+
* @param {Double} endRadius
|
|
456
|
+
* @param {Boolean} startAngle
|
|
457
|
+
*
|
|
458
|
+
* @return {Array<Object>} [ {startX:1,startY:2, endX:3, endX:4 }, ...]
|
|
459
|
+
*/
|
|
460
|
+
const getRulerPositions = (centerX, centerY, startRadius, endRadius, startAngle, astrology) => {
|
|
461
|
+
const result = [];
|
|
462
|
+
const rayRadius = endRadius;
|
|
463
|
+
const halfRayRadius = startRadius <= endRadius ? rayRadius - Math.abs(endRadius - startRadius) / 2 : rayRadius + Math.abs(endRadius - startRadius) / 2;
|
|
464
|
+
for (let i = 0, start = 0, step = 5; i < 72; i++) {
|
|
465
|
+
const angle = start + startAngle;
|
|
466
|
+
const startPos = getPointPosition(centerX, centerY, startRadius, angle, astrology);
|
|
467
|
+
const endPos = getPointPosition(centerX, centerY, i % 2 === 0 ? rayRadius : halfRayRadius, angle, astrology);
|
|
468
|
+
result.push({
|
|
469
|
+
startX: startPos.x,
|
|
470
|
+
startY: startPos.y,
|
|
471
|
+
endX: endPos.x,
|
|
472
|
+
endY: endPos.y
|
|
473
|
+
});
|
|
474
|
+
start += step;
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
477
|
+
};
|
|
478
|
+
/**
|
|
479
|
+
* Compare two points
|
|
480
|
+
*
|
|
481
|
+
* @param {Object} pointA, {name:"Venus", x:78, y:56, r:50, angle:15.96}
|
|
482
|
+
* @param {Object} pointB, {name:"Mercury", x:78, y:56, r:50, angle:20.26}
|
|
483
|
+
* @return
|
|
484
|
+
*/
|
|
485
|
+
const comparePoints = (pointA, pointB) => {
|
|
486
|
+
return pointA.angle - pointB.angle;
|
|
487
|
+
};
|
|
488
|
+
|
|
489
|
+
//#endregion
|
|
490
|
+
//#region src/zodiac.ts
|
|
491
|
+
const SIGNS_ARIES = 1;
|
|
492
|
+
const SIGNS_TAURUS = 2;
|
|
493
|
+
const SIGNS_GEMINI = 3;
|
|
494
|
+
const SIGNS_CANCER = 4;
|
|
495
|
+
const SIGNS_LEO = 5;
|
|
496
|
+
const SIGNS_VIRGO = 6;
|
|
497
|
+
const SIGNS_LIBRA = 7;
|
|
498
|
+
const SIGNS_SCORPIO = 8;
|
|
499
|
+
const SIGNS_SAGITTARIUS = 9;
|
|
500
|
+
const SIGNS_CAPRICORN = 10;
|
|
501
|
+
const SIGNS_AQUARIUS = 11;
|
|
502
|
+
const SIGNS_PISCES = 12;
|
|
503
|
+
/**
|
|
504
|
+
* Zodiac
|
|
505
|
+
*
|
|
506
|
+
* Gives the position of points in the zodiac.
|
|
507
|
+
* Position of point in the zodiac.
|
|
508
|
+
* Position of point in houses.
|
|
509
|
+
* Dignities of planets.
|
|
510
|
+
*
|
|
511
|
+
* @class
|
|
512
|
+
* @public
|
|
513
|
+
* @constructor
|
|
514
|
+
* @param {Array} cusps - cusprs in zodiac; [296, 350, 30, 56, 75, 94, 116, 170, 210, 236, 255, 274]
|
|
515
|
+
* @param {Object | null } settings
|
|
516
|
+
*/
|
|
517
|
+
var Zodiac = class {
|
|
518
|
+
cusps;
|
|
519
|
+
settings;
|
|
520
|
+
constructor(cusps, settings) {
|
|
521
|
+
if (cusps === null) throw new Error("Param 'cusps' must not be empty.");
|
|
522
|
+
if (!(Array.isArray(cusps) && cusps.length === 12)) throw new Error("Param 'cusps' is not 12 length Array.");
|
|
523
|
+
this.cusps = cusps;
|
|
524
|
+
this.settings = settings ?? settings_default;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Get astrological sign
|
|
528
|
+
* 1 - Arise, ... , 12 - Pisces
|
|
529
|
+
*
|
|
530
|
+
* @param {double} point - angle of point in circle
|
|
531
|
+
* @return { \[1-9] | 1[0-2]\ }
|
|
532
|
+
*/
|
|
533
|
+
getSign(point) {
|
|
534
|
+
const angle = point % radiansToDegree(2 * Math.PI);
|
|
535
|
+
return Math.floor(angle / 30 + 1);
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Is retrograde
|
|
539
|
+
*
|
|
540
|
+
* @param {double} speed
|
|
541
|
+
* @return {boolean}
|
|
542
|
+
*/
|
|
543
|
+
isRetrograde(speed) {
|
|
544
|
+
return speed < 0;
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Get house number
|
|
548
|
+
* 1 - 12
|
|
549
|
+
*
|
|
550
|
+
* @param {double} point - angle of point in circle
|
|
551
|
+
* @return { \[1-9] | 1[0-2]\ }
|
|
552
|
+
*/
|
|
553
|
+
getHouseNumber(point) {
|
|
554
|
+
const angle = point % radiansToDegree(2 * Math.PI);
|
|
555
|
+
for (let i = 0, ln = this.cusps.length; i < ln; i++) if (angle >= this.cusps[i] && angle < this.cusps[i % (ln - 1) + 1]) return i + 1;
|
|
556
|
+
for (let i = 0, ln = this.cusps.length; i < ln; i++) if (this.cusps[i] > this.cusps[i % (ln - 1) + 1]) return i + 1;
|
|
557
|
+
throw new Error("Oops, serious error in the method: 'astrology.Zodiac.getHouseNumber'.");
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* Calculate dignities of planet
|
|
561
|
+
*
|
|
562
|
+
* r - Rulership
|
|
563
|
+
* d - Detriment
|
|
564
|
+
* e - Exaltation
|
|
565
|
+
* E - Exalatation - Exact exaltation
|
|
566
|
+
* f - Fall
|
|
567
|
+
*
|
|
568
|
+
* @param {Object} planet, { name:"Sun", position:60.2 }
|
|
569
|
+
* @param {Array<Object> | null } exactExaltation - list of named angles, [{ name:"Sun", position:278, orbit:2 }, { name:"Moon", position:3, , orbit:2 }]
|
|
570
|
+
* @return {Array<String>}
|
|
571
|
+
*/
|
|
572
|
+
getDignities(planet, exactExaltation) {
|
|
573
|
+
if (!(planet && planet.name && planet.position != null)) return [];
|
|
574
|
+
const result = [];
|
|
575
|
+
const sign = this.getSign(planet.position);
|
|
576
|
+
planet.position % radiansToDegree(2 * Math.PI);
|
|
577
|
+
switch (planet.name) {
|
|
578
|
+
case this.settings.SYMBOL_SUN:
|
|
579
|
+
if (sign === SIGNS_LEO) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
580
|
+
else if (sign === SIGNS_AQUARIUS) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
581
|
+
if (sign === SIGNS_ARIES) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
582
|
+
else if (sign === SIGNS_VIRGO) result.push(this.settings.DIGNITIES_FALL);
|
|
583
|
+
break;
|
|
584
|
+
case this.settings.SYMBOL_MOON:
|
|
585
|
+
if (sign === SIGNS_CANCER) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
586
|
+
else if (sign === SIGNS_CAPRICORN) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
587
|
+
if (sign === SIGNS_TAURUS) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
588
|
+
else if (sign === SIGNS_SCORPIO) result.push(this.settings.DIGNITIES_FALL);
|
|
589
|
+
break;
|
|
590
|
+
case this.settings.SYMBOL_MERCURY:
|
|
591
|
+
if (sign === SIGNS_GEMINI) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
592
|
+
else if (sign === SIGNS_SAGITTARIUS) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
593
|
+
if (sign === SIGNS_VIRGO) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
594
|
+
else if (sign === SIGNS_PISCES) result.push(this.settings.DIGNITIES_FALL);
|
|
595
|
+
break;
|
|
596
|
+
case this.settings.SYMBOL_VENUS:
|
|
597
|
+
if (sign === SIGNS_TAURUS || sign === SIGNS_LIBRA) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
598
|
+
else if (sign === SIGNS_ARIES || sign === SIGNS_SCORPIO) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
599
|
+
if (sign === SIGNS_PISCES) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
600
|
+
else if (sign === SIGNS_VIRGO) result.push(this.settings.DIGNITIES_FALL);
|
|
601
|
+
break;
|
|
602
|
+
case this.settings.SYMBOL_MARS:
|
|
603
|
+
if (sign === SIGNS_ARIES || sign === SIGNS_SCORPIO) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
604
|
+
else if (sign === SIGNS_TAURUS || sign === SIGNS_LIBRA) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
605
|
+
if (sign === SIGNS_CAPRICORN) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
606
|
+
else if (sign === SIGNS_CANCER) result.push(this.settings.DIGNITIES_FALL);
|
|
607
|
+
break;
|
|
608
|
+
case this.settings.SYMBOL_JUPITER:
|
|
609
|
+
if (sign === SIGNS_SAGITTARIUS || sign === SIGNS_PISCES) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
610
|
+
else if (sign === SIGNS_GEMINI || sign === SIGNS_VIRGO) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
611
|
+
if (sign === SIGNS_CANCER) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
612
|
+
else if (sign === SIGNS_CAPRICORN) result.push(this.settings.DIGNITIES_FALL);
|
|
613
|
+
break;
|
|
614
|
+
case this.settings.SYMBOL_SATURN:
|
|
615
|
+
if (sign === SIGNS_CAPRICORN || sign === SIGNS_AQUARIUS) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
616
|
+
else if (sign === SIGNS_CANCER || sign === SIGNS_LEO) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
617
|
+
if (sign === SIGNS_LIBRA) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
618
|
+
else if (sign === SIGNS_ARIES) result.push(this.settings.DIGNITIES_FALL);
|
|
619
|
+
break;
|
|
620
|
+
case this.settings.SYMBOL_URANUS:
|
|
621
|
+
if (sign === SIGNS_AQUARIUS) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
622
|
+
else if (sign === SIGNS_LEO) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
623
|
+
if (sign === SIGNS_SCORPIO) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
624
|
+
else if (sign === SIGNS_TAURUS) result.push(this.settings.DIGNITIES_FALL);
|
|
625
|
+
break;
|
|
626
|
+
case this.settings.SYMBOL_NEPTUNE:
|
|
627
|
+
if (sign === SIGNS_PISCES) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
628
|
+
else if (sign === SIGNS_VIRGO) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
629
|
+
if (sign === SIGNS_LEO || sign === SIGNS_SAGITTARIUS) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
630
|
+
else if (sign === SIGNS_AQUARIUS || sign === SIGNS_GEMINI) result.push(this.settings.DIGNITIES_FALL);
|
|
631
|
+
break;
|
|
632
|
+
case this.settings.SYMBOL_PLUTO:
|
|
633
|
+
if (sign === SIGNS_SCORPIO) result.push(this.settings.DIGNITIES_RULERSHIP);
|
|
634
|
+
else if (sign === SIGNS_TAURUS) result.push(this.settings.DIGNITIES_DETRIMENT);
|
|
635
|
+
if (sign === SIGNS_ARIES) result.push(this.settings.DIGNITIES_EXALTATION);
|
|
636
|
+
else if (sign === SIGNS_LIBRA) result.push(this.settings.DIGNITIES_FALL);
|
|
637
|
+
break;
|
|
638
|
+
default: break;
|
|
639
|
+
}
|
|
640
|
+
if (exactExaltation != null && Array.isArray(exactExaltation)) {
|
|
641
|
+
for (let i = 0, ln = exactExaltation.length; i < ln; i++) if (planet.name === exactExaltation[i].name) {
|
|
642
|
+
if (this.hasConjunction(planet.position, exactExaltation[i].position, exactExaltation[i].orbit)) result.push(this.settings.DIGNITIES_EXACT_EXALTATION);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
return result;
|
|
646
|
+
}
|
|
647
|
+
toDMS(d) {
|
|
648
|
+
d += .5 / 3600 / 1e4;
|
|
649
|
+
const deg = parseInt(d.toString(), 10);
|
|
650
|
+
d = (d - deg) * 60;
|
|
651
|
+
const min = parseInt(d.toString(), 10);
|
|
652
|
+
const sec = parseInt(((d - min) * 60).toString(), 10);
|
|
653
|
+
return deg + "° " + min + "' " + sec;
|
|
654
|
+
}
|
|
655
|
+
hasConjunction(planetPosition, pointPosition, orbit) {
|
|
656
|
+
let result = false;
|
|
657
|
+
const minOrbit = pointPosition - orbit / 2 < 0 ? radiansToDegree(2 * Math.PI) - (pointPosition - orbit / 2) : pointPosition - orbit / 2;
|
|
658
|
+
const maxOrbit = pointPosition + orbit / 2 >= radiansToDegree(2 * Math.PI) ? pointPosition + orbit / 2 - radiansToDegree(2 * Math.PI) : pointPosition + orbit / 2;
|
|
659
|
+
if (minOrbit > maxOrbit) {
|
|
660
|
+
if (minOrbit >= planetPosition && planetPosition <= minOrbit) result = true;
|
|
661
|
+
} else if (minOrbit <= planetPosition && planetPosition <= maxOrbit) result = true;
|
|
662
|
+
return result;
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
var zodiac_default = Zodiac;
|
|
666
|
+
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region src/aspect.ts
|
|
669
|
+
const DEFAULT_ASPECTS = {
|
|
670
|
+
conjunction: {
|
|
671
|
+
degree: 0,
|
|
672
|
+
orbit: 10,
|
|
673
|
+
color: "transparent"
|
|
674
|
+
},
|
|
675
|
+
square: {
|
|
676
|
+
degree: 90,
|
|
677
|
+
orbit: 8,
|
|
678
|
+
color: "#FF4500"
|
|
679
|
+
},
|
|
680
|
+
trine: {
|
|
681
|
+
degree: 120,
|
|
682
|
+
orbit: 8,
|
|
683
|
+
color: "#27AE60"
|
|
684
|
+
},
|
|
685
|
+
opposition: {
|
|
686
|
+
degree: 180,
|
|
687
|
+
orbit: 10,
|
|
688
|
+
color: "#27AE60"
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
/**
|
|
692
|
+
* Aspects calculator
|
|
693
|
+
*
|
|
694
|
+
* @class
|
|
695
|
+
* @public
|
|
696
|
+
* @constructor
|
|
697
|
+
* @param {AspectPoints} points; {"Sun":[0], "Moon":[90], "Neptune":[120], "As":[30]}
|
|
698
|
+
* @param {Object | null } settings
|
|
699
|
+
*/
|
|
700
|
+
var AspectCalculator = class {
|
|
701
|
+
settings;
|
|
702
|
+
toPoints;
|
|
703
|
+
context;
|
|
704
|
+
constructor(toPoints, settings) {
|
|
705
|
+
if (toPoints == null) throw new Error("Param 'toPoint' must not be empty.");
|
|
706
|
+
this.settings = settings ?? {};
|
|
707
|
+
this.settings.ASPECTS = settings?.ASPECTS ?? DEFAULT_ASPECTS;
|
|
708
|
+
this.toPoints = toPoints;
|
|
709
|
+
this.context = this;
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Getter for this.toPoints
|
|
713
|
+
* @see constructor
|
|
714
|
+
*
|
|
715
|
+
* @return {Object}
|
|
716
|
+
*/
|
|
717
|
+
getToPoints() {
|
|
718
|
+
return this.toPoints;
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Radix aspects
|
|
722
|
+
*
|
|
723
|
+
* In radix calculation is the param "points" the same as param "toPoints" in constructor
|
|
724
|
+
* , but without special points such as: As,Ds, Mc, Ic, ...
|
|
725
|
+
*
|
|
726
|
+
* @param {Object} points; {"Sun":[0], "Moon":[90]}
|
|
727
|
+
*
|
|
728
|
+
* @return {Array<Object>} [{"aspect":{"name":"conjunction", "degree":120}"", "point":{"name":"Sun", "position":123}, "toPoint":{"name":"Moon", "position":345}, "precision":0.5}]]
|
|
729
|
+
*/
|
|
730
|
+
radix(points) {
|
|
731
|
+
if (points == null) return [];
|
|
732
|
+
const aspects = [];
|
|
733
|
+
for (const point in points) if (points.hasOwnProperty(point)) {
|
|
734
|
+
for (const toPoint in this.toPoints) if (this.toPoints.hasOwnProperty(toPoint)) {
|
|
735
|
+
if (point !== toPoint) {
|
|
736
|
+
for (const aspect in this.settings.ASPECTS) if (this.hasAspect(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect])) aspects.push({
|
|
737
|
+
aspect: {
|
|
738
|
+
name: aspect,
|
|
739
|
+
degree: this.settings.ASPECTS[aspect].degree,
|
|
740
|
+
orbit: this.settings.ASPECTS[aspect].orbit,
|
|
741
|
+
color: this.settings.ASPECTS[aspect].color
|
|
742
|
+
},
|
|
743
|
+
point: {
|
|
744
|
+
name: point,
|
|
745
|
+
position: points[point][0]
|
|
746
|
+
},
|
|
747
|
+
toPoint: {
|
|
748
|
+
name: toPoint,
|
|
749
|
+
position: this.toPoints[toPoint][0]
|
|
750
|
+
},
|
|
751
|
+
precision: this.calcPrecision(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect].degree).toFixed(4)
|
|
752
|
+
});
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
return aspects.sort(this.compareAspectsByPrecision);
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Transit aspects
|
|
760
|
+
*
|
|
761
|
+
* @param {Object} points - transiting points; {"Sun":[0, 1], "Uranus":[90, -1], "NAME":[ANGLE, SPEED]};
|
|
762
|
+
* @return {Array<Object>} [{"aspect":{"name":"conjunction", "degree":120}"", "point":{"name":"Sun", "position":123}, "toPoint":{"name":"Moon", "position":345}, "precision":0.5}]]
|
|
763
|
+
*/
|
|
764
|
+
transit(points) {
|
|
765
|
+
if (points == null) return [];
|
|
766
|
+
const aspects = [];
|
|
767
|
+
for (const point in points) if (points.hasOwnProperty(point)) {
|
|
768
|
+
for (const toPoint in this.toPoints) if (this.toPoints.hasOwnProperty(toPoint)) {
|
|
769
|
+
for (const aspect in this.settings.ASPECTS) if (this.hasAspect(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect])) {
|
|
770
|
+
let precision = this.calcPrecision(points[point][0], this.toPoints[toPoint][0], this.settings.ASPECTS[aspect].degree);
|
|
771
|
+
if (this.isTransitPointApproachingToAspect(this.settings.ASPECTS[aspect].degree, this.toPoints[toPoint][0], points[point][0])) precision *= -1;
|
|
772
|
+
if (points[point][1] && points[point][1] < 0) precision *= -1;
|
|
773
|
+
aspects.push({
|
|
774
|
+
aspect: {
|
|
775
|
+
name: aspect,
|
|
776
|
+
degree: this.settings.ASPECTS[aspect].degree,
|
|
777
|
+
orbit: this.settings.ASPECTS[aspect].orbit,
|
|
778
|
+
color: this.settings.ASPECTS[aspect].color
|
|
779
|
+
},
|
|
780
|
+
point: {
|
|
781
|
+
name: point,
|
|
782
|
+
position: points[point][0]
|
|
783
|
+
},
|
|
784
|
+
toPoint: {
|
|
785
|
+
name: toPoint,
|
|
786
|
+
position: this.toPoints[toPoint][0]
|
|
787
|
+
},
|
|
788
|
+
precision: precision.toFixed(4)
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
return aspects.sort(this.compareAspectsByPrecision);
|
|
794
|
+
}
|
|
795
|
+
hasAspect(point, toPoint, aspect) {
|
|
796
|
+
let result = false;
|
|
797
|
+
let gap = Math.abs(point - toPoint);
|
|
798
|
+
if (gap > radiansToDegree(Math.PI)) gap = radiansToDegree(2 * Math.PI) - gap;
|
|
799
|
+
const orbitMin = aspect.degree - aspect.orbit / 2;
|
|
800
|
+
const orbitMax = aspect.degree + aspect.orbit / 2;
|
|
801
|
+
if (orbitMin <= gap && gap <= orbitMax) result = true;
|
|
802
|
+
return result;
|
|
803
|
+
}
|
|
804
|
+
calcPrecision(point, toPoint, aspect) {
|
|
805
|
+
let gap = Math.abs(point - toPoint);
|
|
806
|
+
if (gap > radiansToDegree(Math.PI)) gap = radiansToDegree(2 * Math.PI) - gap;
|
|
807
|
+
return Math.abs(gap - aspect);
|
|
808
|
+
}
|
|
809
|
+
isTransitPointApproachingToAspect(aspect, toPoint, point) {
|
|
810
|
+
if (point - toPoint > 0) if (point - toPoint > radiansToDegree(Math.PI)) point = (point + aspect) % radiansToDegree(2 * Math.PI);
|
|
811
|
+
else toPoint = (toPoint + aspect) % radiansToDegree(2 * Math.PI);
|
|
812
|
+
else if (toPoint - point > radiansToDegree(Math.PI)) toPoint = (toPoint + aspect) % radiansToDegree(2 * Math.PI);
|
|
813
|
+
else point = (point + aspect) % radiansToDegree(2 * Math.PI);
|
|
814
|
+
let _point = point;
|
|
815
|
+
let _toPoint = toPoint;
|
|
816
|
+
const difference = _point - _toPoint;
|
|
817
|
+
if (Math.abs(difference) > radiansToDegree(Math.PI)) {
|
|
818
|
+
_point = toPoint;
|
|
819
|
+
_toPoint = point;
|
|
820
|
+
}
|
|
821
|
+
return _point - _toPoint < 0;
|
|
822
|
+
}
|
|
823
|
+
compareAspectsByPrecision(a, b) {
|
|
824
|
+
return parseFloat(a.precision) - parseFloat(b.precision);
|
|
825
|
+
}
|
|
826
|
+
};
|
|
827
|
+
var aspect_default = AspectCalculator;
|
|
828
|
+
|
|
829
|
+
//#endregion
|
|
830
|
+
//#region src/animation/timer.ts
|
|
831
|
+
var Timer = class {
|
|
832
|
+
debug;
|
|
833
|
+
callback;
|
|
834
|
+
boundTick_;
|
|
835
|
+
lastGameLoopFrame;
|
|
836
|
+
requestID_;
|
|
837
|
+
constructor(callback, debug) {
|
|
838
|
+
if (typeof callback !== "function") throw new Error("param 'callback' has to be a function.");
|
|
839
|
+
this.debug = debug;
|
|
840
|
+
this.callback = callback;
|
|
841
|
+
this.boundTick_ = this.tick.bind(this);
|
|
842
|
+
}
|
|
843
|
+
start() {
|
|
844
|
+
if (!this.requestID_) {
|
|
845
|
+
this.lastGameLoopFrame = (/* @__PURE__ */ new Date()).getTime();
|
|
846
|
+
this.tick();
|
|
847
|
+
if (this.debug) console.log("[astrology.Timer] start");
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
stop() {
|
|
851
|
+
if (this.requestID_) {
|
|
852
|
+
window.cancelAnimationFrame(this.requestID_);
|
|
853
|
+
this.requestID_ = void 0;
|
|
854
|
+
if (this.debug) console.log("[astrology.Timer] stop");
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
isRunning() {
|
|
858
|
+
return !!this.requestID_;
|
|
859
|
+
}
|
|
860
|
+
tick() {
|
|
861
|
+
const now = (/* @__PURE__ */ new Date()).getTime();
|
|
862
|
+
this.requestID_ = window.requestAnimationFrame(this.boundTick_);
|
|
863
|
+
this.callback(now - this.lastGameLoopFrame);
|
|
864
|
+
this.lastGameLoopFrame = now;
|
|
865
|
+
}
|
|
866
|
+
};
|
|
867
|
+
var timer_default = Timer;
|
|
868
|
+
|
|
869
|
+
//#endregion
|
|
870
|
+
//#region src/animation/animator.ts
|
|
871
|
+
/**
|
|
872
|
+
* Transit chart animator
|
|
873
|
+
*
|
|
874
|
+
* Animates the object on a circle.
|
|
875
|
+
*
|
|
876
|
+
* @class
|
|
877
|
+
* @public
|
|
878
|
+
* @constructor
|
|
879
|
+
* @param {Object} from, {"Sun":[12], "Moon":[60]}
|
|
880
|
+
* @param {Object} to, {"Sun":[30], "Moon":[180]}
|
|
881
|
+
* @param {Object} settings, {cx:100, cy:100, radius:200, prefix:"astro-chart-"}
|
|
882
|
+
*/
|
|
883
|
+
var Animator = class {
|
|
884
|
+
transit;
|
|
885
|
+
isReverse;
|
|
886
|
+
rotation;
|
|
887
|
+
settings;
|
|
888
|
+
actualPlanetPos;
|
|
889
|
+
timer;
|
|
890
|
+
timeSinceLoopStart;
|
|
891
|
+
context;
|
|
892
|
+
cuspsElement;
|
|
893
|
+
data;
|
|
894
|
+
duration;
|
|
895
|
+
callback;
|
|
896
|
+
constructor(transit, settings) {
|
|
897
|
+
this.transit = transit;
|
|
898
|
+
this.isReverse = false;
|
|
899
|
+
this.rotation = 0;
|
|
900
|
+
this.settings = settings;
|
|
901
|
+
this.actualPlanetPos = {};
|
|
902
|
+
for (const planet in this.transit.data.planets) if (this.transit.data.planets.hasOwnProperty(planet)) this.actualPlanetPos[planet] = this.transit.data.planets[planet];
|
|
903
|
+
this.timer = new timer_default(this.update.bind(this), this.settings.DEBUG);
|
|
904
|
+
this.timeSinceLoopStart = 0;
|
|
905
|
+
this.context = this;
|
|
906
|
+
this.cuspsElement = null;
|
|
907
|
+
}
|
|
908
|
+
/**
|
|
909
|
+
* Animate objects
|
|
910
|
+
|
|
911
|
+
* @param {Object} data, targetPositions
|
|
912
|
+
* @param {Integer} duration - seconds
|
|
913
|
+
* @param {boolean} isReverse
|
|
914
|
+
* @param {Function} callbck - start et the end of animation
|
|
915
|
+
*/
|
|
916
|
+
animate(data, duration, isReverse, callback) {
|
|
917
|
+
this.data = data;
|
|
918
|
+
this.duration = duration * 1e3;
|
|
919
|
+
this.isReverse = isReverse || false;
|
|
920
|
+
this.callback = callback;
|
|
921
|
+
this.rotation = 0;
|
|
922
|
+
this.cuspsElement = document.getElementById(this.transit.paper._paperElementId + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_CUSPS);
|
|
923
|
+
this.timer.start();
|
|
924
|
+
}
|
|
925
|
+
update(deltaTime) {
|
|
926
|
+
deltaTime = deltaTime ?? 1;
|
|
927
|
+
this.timeSinceLoopStart += deltaTime;
|
|
928
|
+
if (this.timeSinceLoopStart >= this.duration) {
|
|
929
|
+
this.timer.stop();
|
|
930
|
+
if (typeof this.callback === "function") this.callback();
|
|
931
|
+
return;
|
|
932
|
+
}
|
|
933
|
+
const expectedNumberOfLoops = this.duration - this.timeSinceLoopStart < deltaTime ? 1 : Math.round((this.duration - this.timeSinceLoopStart) / deltaTime);
|
|
934
|
+
this.updatePlanets(expectedNumberOfLoops);
|
|
935
|
+
this.updateCusps(expectedNumberOfLoops);
|
|
936
|
+
}
|
|
937
|
+
updateCusps(expectedNumberOfLoops) {
|
|
938
|
+
const deg360 = radiansToDegree(2 * Math.PI);
|
|
939
|
+
let targetCuspAngle = this.transit.data.cusps[0] - this.data.cusps[0];
|
|
940
|
+
if (targetCuspAngle < 0) targetCuspAngle += deg360;
|
|
941
|
+
if (this.settings.ANIMATION_CUSPS_ROTATION_SPEED > 0) targetCuspAngle += this.isReverse ? -1 * (this.settings.ANIMATION_CUSPS_ROTATION_SPEED * deg360 + deg360) : this.settings.ANIMATION_CUSPS_ROTATION_SPEED * deg360;
|
|
942
|
+
let difference = this.isReverse ? this.rotation - targetCuspAngle : targetCuspAngle - this.rotation;
|
|
943
|
+
if (difference < 0) difference += deg360;
|
|
944
|
+
let increment = difference / expectedNumberOfLoops;
|
|
945
|
+
if (this.isReverse) increment *= -1;
|
|
946
|
+
this.rotation += increment;
|
|
947
|
+
this.cuspsElement.setAttribute("transform", "rotate(" + this.rotation + " " + this.transit.cx + " " + this.transit.cy + ")");
|
|
948
|
+
if (expectedNumberOfLoops === 1) this.cuspsElement.removeAttribute("transform");
|
|
949
|
+
}
|
|
950
|
+
updatePlanets(expectedNumberOfLoops) {
|
|
951
|
+
for (const planet in this.data.planets) if (this.data.planets.hasOwnProperty(planet)) {
|
|
952
|
+
const actualPlanetAngle = this.actualPlanetPos[planet][0];
|
|
953
|
+
const targetPlanetAngle = this.data.planets[planet][0];
|
|
954
|
+
const isRetrograde = this.actualPlanetPos[planet][1] != null && this.actualPlanetPos[planet][1] < 0;
|
|
955
|
+
let difference;
|
|
956
|
+
if (this.isReverse && isRetrograde) difference = targetPlanetAngle - actualPlanetAngle;
|
|
957
|
+
else if (this.isReverse || isRetrograde) difference = actualPlanetAngle - targetPlanetAngle;
|
|
958
|
+
else difference = targetPlanetAngle - actualPlanetAngle;
|
|
959
|
+
if (difference < 0) difference += radiansToDegree(2 * Math.PI);
|
|
960
|
+
let increment = difference / expectedNumberOfLoops;
|
|
961
|
+
if (this.isReverse) increment *= -1;
|
|
962
|
+
if (isRetrograde) increment *= -1;
|
|
963
|
+
let newPos = actualPlanetAngle + increment;
|
|
964
|
+
if (newPos < 0) newPos += radiansToDegree(2 * Math.PI);
|
|
965
|
+
this.actualPlanetPos[planet][0] = newPos;
|
|
966
|
+
}
|
|
967
|
+
this.transit.drawPoints(this.actualPlanetPos);
|
|
968
|
+
}
|
|
969
|
+
};
|
|
970
|
+
var animator_default = Animator;
|
|
971
|
+
|
|
972
|
+
//#endregion
|
|
973
|
+
//#region src/transit.ts
|
|
974
|
+
/**
|
|
975
|
+
* Transit charts.
|
|
976
|
+
*
|
|
977
|
+
* @class
|
|
978
|
+
* @public
|
|
979
|
+
* @constructor
|
|
980
|
+
* @param {this.settings.Radix} radix
|
|
981
|
+
* @param {Object} data
|
|
982
|
+
*/
|
|
983
|
+
var Transit = class {
|
|
984
|
+
data;
|
|
985
|
+
paper;
|
|
986
|
+
cx;
|
|
987
|
+
cy;
|
|
988
|
+
toPoints;
|
|
989
|
+
radius;
|
|
990
|
+
settings;
|
|
991
|
+
rulerRadius;
|
|
992
|
+
pointRadius;
|
|
993
|
+
shift;
|
|
994
|
+
universe;
|
|
995
|
+
context;
|
|
996
|
+
locatedPoints;
|
|
997
|
+
constructor(radix, data, settings) {
|
|
998
|
+
const status = validate(data);
|
|
999
|
+
if (status.hasError) throw new Error(status.messages.join(" | "));
|
|
1000
|
+
this.data = data;
|
|
1001
|
+
this.paper = radix.paper;
|
|
1002
|
+
this.cx = radix.cx;
|
|
1003
|
+
this.cy = radix.cy;
|
|
1004
|
+
this.toPoints = radix.toPoints;
|
|
1005
|
+
this.radius = radix.radius;
|
|
1006
|
+
this.settings = settings;
|
|
1007
|
+
this.rulerRadius = this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO / this.settings.RULER_RADIUS;
|
|
1008
|
+
this.pointRadius = this.radius + (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.settings.PADDING * this.settings.SYMBOL_SCALE);
|
|
1009
|
+
this.shift = radix.shift;
|
|
1010
|
+
this.universe = document.createElementNS(this.paper.root.namespaceURI, "g");
|
|
1011
|
+
this.universe.setAttribute("id", this.paper._paperElementId + "-" + this.settings.ID_TRANSIT);
|
|
1012
|
+
this.paper.root.appendChild(this.universe);
|
|
1013
|
+
this.context = this;
|
|
1014
|
+
}
|
|
1015
|
+
/**
|
|
1016
|
+
* Draw background
|
|
1017
|
+
*/
|
|
1018
|
+
drawBg() {
|
|
1019
|
+
const universe = this.universe;
|
|
1020
|
+
const wrapper = getEmptyWrapper(universe, this.paper._paperElementId + "-" + this.settings.ID_BG, this.paper._paperElementId);
|
|
1021
|
+
const hemisphere = this.paper.segment(this.cx, this.cy, this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO, 0, 359.99, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, 1);
|
|
1022
|
+
hemisphere.setAttribute("fill", this.settings.STROKE_ONLY ? "none" : this.settings.COLOR_BACKGROUND);
|
|
1023
|
+
wrapper.appendChild(hemisphere);
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Draw planets
|
|
1027
|
+
*
|
|
1028
|
+
* @param{undefined | Object} planetsData, posible data planets to draw
|
|
1029
|
+
*/
|
|
1030
|
+
drawPoints(planetsData) {
|
|
1031
|
+
const planets = planetsData == null ? this.data.planets : planetsData;
|
|
1032
|
+
if (planets == null) return;
|
|
1033
|
+
const universe = this.universe;
|
|
1034
|
+
const wrapper = getEmptyWrapper(universe, this.paper._paperElementId + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_POINTS, this.paper._paperElementId);
|
|
1035
|
+
(this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO) - 2 * (this.settings.PADDING * this.settings.SYMBOL_SCALE)) / Object.keys(planets).length;
|
|
1036
|
+
const pointerRadius = this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO;
|
|
1037
|
+
let startPosition;
|
|
1038
|
+
let endPosition;
|
|
1039
|
+
this.locatedPoints = [];
|
|
1040
|
+
for (const planet in planets) if (planets.hasOwnProperty(planet)) {
|
|
1041
|
+
const position = getPointPosition(this.cx, this.cy, this.pointRadius, planets[planet][0] + this.shift, this.settings);
|
|
1042
|
+
const point = {
|
|
1043
|
+
name: planet,
|
|
1044
|
+
x: position.x,
|
|
1045
|
+
y: position.y,
|
|
1046
|
+
r: this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE,
|
|
1047
|
+
angle: planets[planet][0] + this.shift,
|
|
1048
|
+
pointer: planets[planet][0] + this.shift
|
|
1049
|
+
};
|
|
1050
|
+
this.locatedPoints = assemble(this.locatedPoints, point, {
|
|
1051
|
+
cx: this.cx,
|
|
1052
|
+
cy: this.cy,
|
|
1053
|
+
r: this.pointRadius
|
|
1054
|
+
}, this.settings);
|
|
1055
|
+
}
|
|
1056
|
+
if (this.settings.DEBUG) console.log("Transit count of points: " + this.locatedPoints.length);
|
|
1057
|
+
if (this.settings.DEBUG) console.log("Transit located points:\n" + JSON.stringify(this.locatedPoints));
|
|
1058
|
+
this.locatedPoints.forEach(function(point) {
|
|
1059
|
+
startPosition = getPointPosition(this.cx, this.cy, pointerRadius, planets[point.name][0] + this.shift, this.settings);
|
|
1060
|
+
endPosition = getPointPosition(this.cx, this.cy, pointerRadius + this.rulerRadius / 2, planets[point.name][0] + this.shift, this.settings);
|
|
1061
|
+
const pointer = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1062
|
+
pointer.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1063
|
+
pointer.setAttribute("stroke-width", this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1064
|
+
wrapper.appendChild(pointer);
|
|
1065
|
+
if (!this.settings.STROKE_ONLY && planets[point.name][0] + this.shift !== point.angle) {
|
|
1066
|
+
startPosition = endPosition;
|
|
1067
|
+
endPosition = getPointPosition(this.cx, this.cy, this.pointRadius - this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE, point.angle, this.settings);
|
|
1068
|
+
const line = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1069
|
+
line.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
1070
|
+
line.setAttribute("stroke-width", .5 * (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE));
|
|
1071
|
+
wrapper.appendChild(line);
|
|
1072
|
+
}
|
|
1073
|
+
const symbol = this.paper.getSymbol(point.name, point.x, point.y);
|
|
1074
|
+
symbol.setAttribute("id", this.paper.root.id + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_POINTS + "-" + point.name);
|
|
1075
|
+
wrapper.appendChild(symbol);
|
|
1076
|
+
let textsToShow = [(Math.floor(planets[point.name][0]) % 30).toString()];
|
|
1077
|
+
const zodiac = new zodiac_default(this.data.cusps, this.settings);
|
|
1078
|
+
if (planets[point.name][1] && zodiac.isRetrograde(planets[point.name][1])) textsToShow.push("R");
|
|
1079
|
+
else textsToShow.push("");
|
|
1080
|
+
textsToShow = textsToShow.concat(zodiac.getDignities({
|
|
1081
|
+
name: point.name,
|
|
1082
|
+
position: planets[point.name][0]
|
|
1083
|
+
}, this.settings.DIGNITIES_EXACT_EXALTATION_DEFAULT).join(","));
|
|
1084
|
+
getDescriptionPosition(point, textsToShow, this.settings).forEach(function(dsc) {
|
|
1085
|
+
wrapper.appendChild(this.paper.text(dsc.text, dsc.x, dsc.y, this.settings.POINTS_TEXT_SIZE, this.settings.SIGNS_COLOR));
|
|
1086
|
+
}, this);
|
|
1087
|
+
}, this);
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Draw circles
|
|
1091
|
+
*/
|
|
1092
|
+
drawCircles() {
|
|
1093
|
+
const universe = this.universe;
|
|
1094
|
+
const wrapper = getEmptyWrapper(universe, this.paper._paperElementId + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_CIRCLES, this.paper._paperElementId);
|
|
1095
|
+
const radius = this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO;
|
|
1096
|
+
const circle = this.paper.circle(this.cx, this.cy, radius);
|
|
1097
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1098
|
+
circle.setAttribute("stroke-width", (this.settings.CIRCLE_STRONG * this.settings.SYMBOL_SCALE).toString());
|
|
1099
|
+
wrapper.appendChild(circle);
|
|
1100
|
+
}
|
|
1101
|
+
/**
|
|
1102
|
+
* Draw cusps
|
|
1103
|
+
* @param{undefined | Object} cuspsData, posible data cusps to draw
|
|
1104
|
+
*/
|
|
1105
|
+
drawCusps(cuspsData) {
|
|
1106
|
+
const cusps = cuspsData == null ? this.data.cusps : cuspsData;
|
|
1107
|
+
if (cusps == null) return;
|
|
1108
|
+
const universe = this.universe;
|
|
1109
|
+
const wrapper = getEmptyWrapper(universe, this.paper._paperElementId + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_CUSPS, this.paper._paperElementId);
|
|
1110
|
+
const numbersRadius = this.radius + (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO - this.rulerRadius) / 2;
|
|
1111
|
+
for (let i = 0, ln = cusps.length; i < ln; i++) {
|
|
1112
|
+
const startPosition = getPointPosition(this.cx, this.cy, this.radius, cusps[i] + this.shift, this.settings);
|
|
1113
|
+
const endPosition = getPointPosition(this.cx, this.cy, this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO - this.rulerRadius, cusps[i] + this.shift, this.settings);
|
|
1114
|
+
const line = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1115
|
+
line.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
1116
|
+
line.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
1117
|
+
wrapper.appendChild(line);
|
|
1118
|
+
const deg360 = radiansToDegree(2 * Math.PI);
|
|
1119
|
+
const startOfCusp = cusps[i];
|
|
1120
|
+
const endOfCusp = cusps[(i + 1) % 12];
|
|
1121
|
+
const gap = endOfCusp - startOfCusp > 0 ? endOfCusp - startOfCusp : endOfCusp - startOfCusp + deg360;
|
|
1122
|
+
const textPosition = getPointPosition(this.cx, this.cy, numbersRadius, (startOfCusp + gap / 2) % deg360 + this.shift, this.settings);
|
|
1123
|
+
wrapper.appendChild(this.paper.getSymbol((i + 1).toString(), textPosition.x, textPosition.y));
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
drawRuler() {
|
|
1127
|
+
const universe = this.universe;
|
|
1128
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_TRANSIT + "-" + this.settings.ID_RULER, this.paper._paperElementId);
|
|
1129
|
+
const startRadius = this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO;
|
|
1130
|
+
getRulerPositions(this.cx, this.cy, startRadius, startRadius - this.rulerRadius, this.shift, this.settings).forEach(function(ray) {
|
|
1131
|
+
const line = this.paper.line(ray.startX, ray.startY, ray.endX, ray.endY);
|
|
1132
|
+
line.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1133
|
+
line.setAttribute("stroke-width", this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1134
|
+
wrapper.appendChild(line);
|
|
1135
|
+
}, this);
|
|
1136
|
+
const circle = this.paper.circle(this.cx, this.cy, startRadius - this.rulerRadius);
|
|
1137
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1138
|
+
circle.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
1139
|
+
wrapper.appendChild(circle);
|
|
1140
|
+
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Draw aspects
|
|
1143
|
+
* @param{Array<Object> | null} customAspects - posible custom aspects to draw;
|
|
1144
|
+
*/
|
|
1145
|
+
aspects(customAspects) {
|
|
1146
|
+
const aspectsList = customAspects != null && Array.isArray(customAspects) ? customAspects : new aspect_default(this.toPoints, this.settings).transit(this.data.planets);
|
|
1147
|
+
const universe = this.universe;
|
|
1148
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_ASPECTS, this.paper._paperElementId);
|
|
1149
|
+
for (let i = 0, ln = aspectsList.length; i < ln; i++) {
|
|
1150
|
+
const startPoint = getPointPosition(this.cx, this.cy, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, aspectsList[i].toPoint.position + this.shift, this.settings);
|
|
1151
|
+
const endPoint = getPointPosition(this.cx, this.cy, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, aspectsList[i].point.position + this.shift, this.settings);
|
|
1152
|
+
const line = this.paper.line(startPoint.x, startPoint.y, endPoint.x, endPoint.y);
|
|
1153
|
+
line.setAttribute("stroke", this.settings.STROKE_ONLY ? this.settings.LINE_COLOR : aspectsList[i].aspect.color);
|
|
1154
|
+
line.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
1155
|
+
line.setAttribute("data-name", aspectsList[i].aspect.name);
|
|
1156
|
+
line.setAttribute("data-degree", aspectsList[i].aspect.degree.toString());
|
|
1157
|
+
line.setAttribute("data-point", aspectsList[i].point.name);
|
|
1158
|
+
line.setAttribute("data-toPoint", aspectsList[i].toPoint.name);
|
|
1159
|
+
line.setAttribute("data-precision", aspectsList[i].precision.toString());
|
|
1160
|
+
wrapper.appendChild(line);
|
|
1161
|
+
}
|
|
1162
|
+
return this.context;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Moves points to another position.
|
|
1166
|
+
*
|
|
1167
|
+
* @param {Object} data - planets target positions.
|
|
1168
|
+
* @param {Integer} duration - in seconds
|
|
1169
|
+
* @param {boolean} isReverse
|
|
1170
|
+
* @param {Function | undefined} callbck - the function executed at the end of animation
|
|
1171
|
+
*/
|
|
1172
|
+
animate(data, duration, isReverse, callback) {
|
|
1173
|
+
const status = validate(data);
|
|
1174
|
+
if (status.hasError) throw new Error(status.messages.join(" | "));
|
|
1175
|
+
getEmptyWrapper(this.universe, this.paper._paperElementId + "-" + this.settings.ID_ASPECTS, this.paper._paperElementId);
|
|
1176
|
+
new animator_default(this.context, this.settings).animate(data, duration, isReverse, function() {
|
|
1177
|
+
this.data = data;
|
|
1178
|
+
this.drawPoints();
|
|
1179
|
+
this.drawCusps();
|
|
1180
|
+
this.aspects();
|
|
1181
|
+
if (typeof callback === "function") callback();
|
|
1182
|
+
}.bind(this));
|
|
1183
|
+
return this.context;
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
var transit_default = Transit;
|
|
1187
|
+
|
|
1188
|
+
//#endregion
|
|
1189
|
+
//#region src/radix.ts
|
|
1190
|
+
/**
|
|
1191
|
+
* Radix charts.
|
|
1192
|
+
*
|
|
1193
|
+
* @class
|
|
1194
|
+
* @public
|
|
1195
|
+
* @constructor
|
|
1196
|
+
* @param {this.settings.SVG} paper
|
|
1197
|
+
* @param {int} cx
|
|
1198
|
+
* @param {int} cy
|
|
1199
|
+
* @param {int} radius
|
|
1200
|
+
* @param {Object} data
|
|
1201
|
+
*/
|
|
1202
|
+
var Radix = class {
|
|
1203
|
+
settings;
|
|
1204
|
+
data;
|
|
1205
|
+
paper;
|
|
1206
|
+
cx;
|
|
1207
|
+
cy;
|
|
1208
|
+
radius;
|
|
1209
|
+
locatedPoints;
|
|
1210
|
+
rulerRadius;
|
|
1211
|
+
pointRadius;
|
|
1212
|
+
toPoints;
|
|
1213
|
+
shift;
|
|
1214
|
+
universe;
|
|
1215
|
+
context;
|
|
1216
|
+
constructor(paper, cx, cy, radius, data, settings) {
|
|
1217
|
+
this.settings = settings;
|
|
1218
|
+
const status = validate(data);
|
|
1219
|
+
if (status.hasError) throw new Error(status.messages.join(" | "));
|
|
1220
|
+
this.data = data;
|
|
1221
|
+
this.paper = paper;
|
|
1222
|
+
this.cx = cx;
|
|
1223
|
+
this.cy = cy;
|
|
1224
|
+
this.radius = radius;
|
|
1225
|
+
this.locatedPoints = [];
|
|
1226
|
+
this.rulerRadius = this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO / this.settings.RULER_RADIUS;
|
|
1227
|
+
this.pointRadius = this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + 2 * this.rulerRadius + this.settings.PADDING * this.settings.SYMBOL_SCALE);
|
|
1228
|
+
this.toPoints = JSON.parse(JSON.stringify(this.data.planets));
|
|
1229
|
+
this.shift = 0;
|
|
1230
|
+
if (this.data.cusps && this.data.cusps[0]) this.shift = radiansToDegree(2 * Math.PI) - this.data.cusps[0];
|
|
1231
|
+
const divisionForAspects = document.createElementNS(this.paper.root.namespaceURI, "g");
|
|
1232
|
+
divisionForAspects.setAttribute("id", this.paper.root.id + "-" + this.settings.ID_ASPECTS);
|
|
1233
|
+
this.paper.root.appendChild(divisionForAspects);
|
|
1234
|
+
this.universe = document.createElementNS(this.paper.root.namespaceURI, "g");
|
|
1235
|
+
this.universe.setAttribute("id", this.paper.root.id + "-" + this.settings.ID_RADIX);
|
|
1236
|
+
this.paper.root.appendChild(this.universe);
|
|
1237
|
+
this.context = this;
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Draw background
|
|
1241
|
+
*/
|
|
1242
|
+
drawBg() {
|
|
1243
|
+
const universe = this.universe;
|
|
1244
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_BG, this.paper.root.id);
|
|
1245
|
+
const hemisphere = this.paper.segment(this.cx, this.cy, this.radius - this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO, 0, 359.99, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, 1);
|
|
1246
|
+
hemisphere.setAttribute("fill", this.settings.STROKE_ONLY ? "none" : this.settings.COLOR_BACKGROUND);
|
|
1247
|
+
wrapper.appendChild(hemisphere);
|
|
1248
|
+
}
|
|
1249
|
+
/**
|
|
1250
|
+
* Draw universe.
|
|
1251
|
+
*/
|
|
1252
|
+
drawUniverse() {
|
|
1253
|
+
const universe = this.universe;
|
|
1254
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_SIGNS, this.paper.root.id);
|
|
1255
|
+
for (let i = 0, step = 30, start = this.shift, len = this.settings.COLORS_SIGNS.length; i < len; i++) {
|
|
1256
|
+
const segment = this.paper.segment(this.cx, this.cy, this.radius, start, start + step, this.radius - this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO);
|
|
1257
|
+
segment.setAttribute("fill", this.settings.STROKE_ONLY ? "none" : this.settings.COLORS_SIGNS[i]);
|
|
1258
|
+
segment.setAttribute("id", this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_SIGNS + "-" + i);
|
|
1259
|
+
segment.setAttribute("stroke", this.settings.STROKE_ONLY ? this.settings.CIRCLE_COLOR : "none");
|
|
1260
|
+
segment.setAttribute("stroke-width", this.settings.STROKE_ONLY ? "1" : "0");
|
|
1261
|
+
wrapper.appendChild(segment);
|
|
1262
|
+
start += step;
|
|
1263
|
+
}
|
|
1264
|
+
for (let i = 0, step = 30, start = 15 + this.shift, len = this.settings.SYMBOL_SIGNS.length; i < len; i++) {
|
|
1265
|
+
const position = getPointPosition(this.cx, this.cy, this.radius - this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO / 2, start, this.settings);
|
|
1266
|
+
wrapper.appendChild(this.paper.getSymbol(this.settings.SYMBOL_SIGNS[i], position.x, position.y));
|
|
1267
|
+
start += step;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Draw points
|
|
1272
|
+
*/
|
|
1273
|
+
drawPoints() {
|
|
1274
|
+
if (this.data.planets == null) return;
|
|
1275
|
+
const universe = this.universe;
|
|
1276
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_POINTS, this.paper.root.id);
|
|
1277
|
+
(this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO) - 2 * (this.settings.PADDING * this.settings.SYMBOL_SCALE)) / Object.keys(this.data.planets).length;
|
|
1278
|
+
const pointerRadius = this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.rulerRadius);
|
|
1279
|
+
let startPosition;
|
|
1280
|
+
let endPosition;
|
|
1281
|
+
for (const planet in this.data.planets) if (this.data.planets.hasOwnProperty(planet)) {
|
|
1282
|
+
const position = getPointPosition(this.cx, this.cy, this.pointRadius, this.data.planets[planet][0] + this.shift, this.settings);
|
|
1283
|
+
const point = {
|
|
1284
|
+
name: planet,
|
|
1285
|
+
x: position.x,
|
|
1286
|
+
y: position.y,
|
|
1287
|
+
r: this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE,
|
|
1288
|
+
angle: this.data.planets[planet][0] + this.shift,
|
|
1289
|
+
pointer: this.data.planets[planet][0] + this.shift
|
|
1290
|
+
};
|
|
1291
|
+
this.locatedPoints = assemble(this.locatedPoints, point, {
|
|
1292
|
+
cx: this.cx,
|
|
1293
|
+
cy: this.cy,
|
|
1294
|
+
r: this.pointRadius
|
|
1295
|
+
}, this.settings);
|
|
1296
|
+
}
|
|
1297
|
+
if (this.settings.DEBUG) console.log("Radix count of points: " + this.locatedPoints.length);
|
|
1298
|
+
if (this.settings.DEBUG) console.log("Radix located points:\n" + JSON.stringify(this.locatedPoints));
|
|
1299
|
+
this.locatedPoints.forEach(function(point) {
|
|
1300
|
+
startPosition = getPointPosition(this.cx, this.cy, pointerRadius, this.data.planets[point.name][0] + this.shift, this.settings);
|
|
1301
|
+
endPosition = getPointPosition(this.cx, this.cy, pointerRadius - this.rulerRadius / 2, this.data.planets[point.name][0] + this.shift, this.settings);
|
|
1302
|
+
const pointer = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1303
|
+
pointer.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1304
|
+
pointer.setAttribute("stroke-width", this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1305
|
+
wrapper.appendChild(pointer);
|
|
1306
|
+
if (!this.settings.STROKE_ONLY && this.data.planets[point.name][0] + this.shift !== point.angle) {
|
|
1307
|
+
startPosition = endPosition;
|
|
1308
|
+
endPosition = getPointPosition(this.cx, this.cy, this.pointRadius + this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE, point.angle, this.settings);
|
|
1309
|
+
const line = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1310
|
+
line.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
1311
|
+
line.setAttribute("stroke-width", .5 * (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE));
|
|
1312
|
+
wrapper.appendChild(line);
|
|
1313
|
+
}
|
|
1314
|
+
const symbol = this.paper.getSymbol(point.name, point.x, point.y);
|
|
1315
|
+
symbol.setAttribute("id", this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_POINTS + "-" + point.name);
|
|
1316
|
+
wrapper.appendChild(symbol);
|
|
1317
|
+
let textsToShow = [(Math.floor(this.data.planets[point.name][0]) % 30).toString()];
|
|
1318
|
+
const zodiac = new zodiac_default(this.data.cusps, this.settings);
|
|
1319
|
+
if (this.data.planets[point.name][1] && zodiac.isRetrograde(this.data.planets[point.name][1])) textsToShow.push("R");
|
|
1320
|
+
else textsToShow.push("");
|
|
1321
|
+
if (this.settings.SHOW_DIGNITIES_TEXT) textsToShow = textsToShow.concat(zodiac.getDignities({
|
|
1322
|
+
name: point.name,
|
|
1323
|
+
position: this.data.planets[point.name][0]
|
|
1324
|
+
}, this.settings.DIGNITIES_EXACT_EXALTATION_DEFAULT).join(","));
|
|
1325
|
+
getDescriptionPosition(point, textsToShow, this.settings).forEach(function(dsc) {
|
|
1326
|
+
wrapper.appendChild(this.paper.text(dsc.text, dsc.x, dsc.y, this.settings.POINTS_TEXT_SIZE, this.settings.SIGNS_COLOR));
|
|
1327
|
+
}, this);
|
|
1328
|
+
}, this);
|
|
1329
|
+
}
|
|
1330
|
+
drawAxis() {
|
|
1331
|
+
if (this.data.cusps == null) return;
|
|
1332
|
+
const universe = this.universe;
|
|
1333
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_AXIS, this.paper.root.id);
|
|
1334
|
+
const axisRadius = this.radius + this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO / 4;
|
|
1335
|
+
const AS = 0;
|
|
1336
|
+
const IC = 3;
|
|
1337
|
+
const DC = 6;
|
|
1338
|
+
const MC = 9;
|
|
1339
|
+
let overlapLine;
|
|
1340
|
+
let startPosition;
|
|
1341
|
+
let endPosition;
|
|
1342
|
+
[
|
|
1343
|
+
AS,
|
|
1344
|
+
IC,
|
|
1345
|
+
DC,
|
|
1346
|
+
MC
|
|
1347
|
+
].forEach(function(i) {
|
|
1348
|
+
let textPosition;
|
|
1349
|
+
startPosition = getPointPosition(this.cx, this.cy, this.radius, this.data.cusps[i] + this.shift, this.settings);
|
|
1350
|
+
endPosition = getPointPosition(this.cx, this.cy, axisRadius, this.data.cusps[i] + this.shift, this.settings);
|
|
1351
|
+
overlapLine = this.paper.line(startPosition.x, startPosition.y, endPosition.x, endPosition.y);
|
|
1352
|
+
overlapLine.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
1353
|
+
overlapLine.setAttribute("stroke-width", this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1354
|
+
wrapper.appendChild(overlapLine);
|
|
1355
|
+
if (i === AS) {
|
|
1356
|
+
textPosition = getPointPosition(this.cx, this.cy, axisRadius + 20 * this.settings.SYMBOL_SCALE, this.data.cusps[i] + this.shift, this.settings);
|
|
1357
|
+
wrapper.appendChild(this.paper.getSymbol(this.settings.SYMBOL_AS, textPosition.x, textPosition.y));
|
|
1358
|
+
}
|
|
1359
|
+
if (i === DC) {
|
|
1360
|
+
textPosition = getPointPosition(this.cx, this.cy, axisRadius + 2 * this.settings.SYMBOL_SCALE, this.data.cusps[i] + this.shift, this.settings);
|
|
1361
|
+
wrapper.appendChild(this.paper.getSymbol(this.settings.SYMBOL_DS, textPosition.x, textPosition.y));
|
|
1362
|
+
}
|
|
1363
|
+
if (i === IC) {
|
|
1364
|
+
textPosition = getPointPosition(this.cx, this.cy, axisRadius + 10 * this.settings.SYMBOL_SCALE, this.data.cusps[i] - 2 + this.shift, this.settings);
|
|
1365
|
+
wrapper.appendChild(this.paper.getSymbol(this.settings.SYMBOL_IC, textPosition.x, textPosition.y));
|
|
1366
|
+
}
|
|
1367
|
+
if (i === MC) {
|
|
1368
|
+
textPosition = getPointPosition(this.cx, this.cy, axisRadius + 10 * this.settings.SYMBOL_SCALE, this.data.cusps[i] + 2 + this.shift, this.settings);
|
|
1369
|
+
wrapper.appendChild(this.paper.getSymbol(this.settings.SYMBOL_MC, textPosition.x, textPosition.y));
|
|
1370
|
+
}
|
|
1371
|
+
}, this);
|
|
1372
|
+
}
|
|
1373
|
+
/**
|
|
1374
|
+
* Draw cusps
|
|
1375
|
+
*/
|
|
1376
|
+
drawCusps() {
|
|
1377
|
+
if (this.data.cusps == null) return;
|
|
1378
|
+
let lines;
|
|
1379
|
+
const universe = this.universe;
|
|
1380
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_CUSPS, this.paper.root.id);
|
|
1381
|
+
const numbersRadius = this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO + this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE;
|
|
1382
|
+
const mainAxis = [
|
|
1383
|
+
0,
|
|
1384
|
+
3,
|
|
1385
|
+
6,
|
|
1386
|
+
9
|
|
1387
|
+
];
|
|
1388
|
+
for (let i = 0, ln = this.data.cusps.length; i < ln; i++) {
|
|
1389
|
+
lines = getDashedLinesPositions(this.cx, this.cy, this.data.cusps[i] + this.shift, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.rulerRadius), this.pointRadius, this.locatedPoints, this.settings);
|
|
1390
|
+
lines.forEach(function(line) {
|
|
1391
|
+
const newLine = this.paper.line(line.startX, line.startY, line.endX, line.endY);
|
|
1392
|
+
newLine.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
1393
|
+
if (mainAxis.includes(i)) newLine.setAttribute("stroke-width", this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1394
|
+
else newLine.setAttribute("stroke-width", this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1395
|
+
wrapper.appendChild(newLine);
|
|
1396
|
+
}, this);
|
|
1397
|
+
const deg360 = radiansToDegree(2 * Math.PI);
|
|
1398
|
+
const startOfCusp = this.data.cusps[i];
|
|
1399
|
+
const endOfCusp = this.data.cusps[(i + 1) % 12];
|
|
1400
|
+
const gap = endOfCusp - startOfCusp > 0 ? endOfCusp - startOfCusp : endOfCusp - startOfCusp + deg360;
|
|
1401
|
+
const textPosition = getPointPosition(this.cx, this.cy, numbersRadius, (startOfCusp + gap / 2) % deg360 + this.shift, this.settings);
|
|
1402
|
+
wrapper.appendChild(this.paper.getSymbol((i + 1).toString(), textPosition.x, textPosition.y));
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
1406
|
+
* Draw aspects
|
|
1407
|
+
* @param{Array<Object> | null} customAspects - posible custom aspects to draw;
|
|
1408
|
+
*/
|
|
1409
|
+
aspects(customAspects) {
|
|
1410
|
+
const aspectsList = customAspects != null && Array.isArray(customAspects) ? customAspects : new aspect_default(this.toPoints, this.settings).radix(this.data.planets);
|
|
1411
|
+
const universe = this.universe;
|
|
1412
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_ASPECTS, this.paper.root.id);
|
|
1413
|
+
const duplicateCheck = [];
|
|
1414
|
+
for (let i = 0, ln = aspectsList.length; i < ln; i++) {
|
|
1415
|
+
const key = aspectsList[i].aspect.name + "-" + aspectsList[i].point.name + "-" + aspectsList[i].toPoint.name;
|
|
1416
|
+
const opositeKey = aspectsList[i].aspect.name + "-" + aspectsList[i].toPoint.name + "-" + aspectsList[i].point.name;
|
|
1417
|
+
if (!duplicateCheck.includes(opositeKey)) {
|
|
1418
|
+
duplicateCheck.push(key);
|
|
1419
|
+
const startPoint = getPointPosition(this.cx, this.cy, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, aspectsList[i].toPoint.position + this.shift, this.settings);
|
|
1420
|
+
const endPoint = getPointPosition(this.cx, this.cy, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO, aspectsList[i].point.position + this.shift, this.settings);
|
|
1421
|
+
const line = this.paper.line(startPoint.x, startPoint.y, endPoint.x, endPoint.y);
|
|
1422
|
+
line.setAttribute("stroke", this.settings.STROKE_ONLY ? this.settings.LINE_COLOR : aspectsList[i].aspect.color);
|
|
1423
|
+
line.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
1424
|
+
line.setAttribute("data-name", aspectsList[i].aspect.name);
|
|
1425
|
+
line.setAttribute("data-degree", aspectsList[i].aspect.degree.toString());
|
|
1426
|
+
line.setAttribute("data-point", aspectsList[i].point.name);
|
|
1427
|
+
line.setAttribute("data-toPoint", aspectsList[i].toPoint.name);
|
|
1428
|
+
line.setAttribute("data-precision", aspectsList[i].precision.toString());
|
|
1429
|
+
wrapper.appendChild(line);
|
|
1430
|
+
}
|
|
1431
|
+
}
|
|
1432
|
+
return this.context;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Add points of interest for aspects calculation
|
|
1436
|
+
* @param {Obect} points, {"As":[0],"Ic":[90],"Ds":[180],"Mc":[270]}
|
|
1437
|
+
* @see (this.settings.AspectCalculator( toPoints) )
|
|
1438
|
+
*/
|
|
1439
|
+
addPointsOfInterest(points) {
|
|
1440
|
+
for (const point in points) if (points.hasOwnProperty(point)) this.toPoints[point] = points[point];
|
|
1441
|
+
return this.context;
|
|
1442
|
+
}
|
|
1443
|
+
drawRuler() {
|
|
1444
|
+
const universe = this.universe;
|
|
1445
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_RULER, this.paper.root.id);
|
|
1446
|
+
const startRadius = this.radius - (this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO + this.rulerRadius);
|
|
1447
|
+
getRulerPositions(this.cx, this.cy, startRadius, startRadius + this.rulerRadius, this.shift, this.settings).forEach(function(ray) {
|
|
1448
|
+
const line = this.paper.line(ray.startX, ray.startY, ray.endX, ray.endY);
|
|
1449
|
+
line.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1450
|
+
line.setAttribute("stroke-width", this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE);
|
|
1451
|
+
wrapper.appendChild(line);
|
|
1452
|
+
}, this);
|
|
1453
|
+
const circle = this.paper.circle(this.cx, this.cy, startRadius);
|
|
1454
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1455
|
+
circle.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
1456
|
+
wrapper.appendChild(circle);
|
|
1457
|
+
}
|
|
1458
|
+
/**
|
|
1459
|
+
* Draw circles
|
|
1460
|
+
*/
|
|
1461
|
+
drawCircles() {
|
|
1462
|
+
const universe = this.universe;
|
|
1463
|
+
const wrapper = getEmptyWrapper(universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_CIRCLES, this.paper.root.id);
|
|
1464
|
+
let circle = this.paper.circle(this.cx, this.cy, this.radius / this.settings.INDOOR_CIRCLE_RADIUS_RATIO);
|
|
1465
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1466
|
+
circle.setAttribute("stroke-width", (this.settings.CIRCLE_STRONG * this.settings.SYMBOL_SCALE).toString());
|
|
1467
|
+
wrapper.appendChild(circle);
|
|
1468
|
+
circle = this.paper.circle(this.cx, this.cy, this.radius);
|
|
1469
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1470
|
+
circle.setAttribute("stroke-width", (this.settings.CIRCLE_STRONG * this.settings.SYMBOL_SCALE).toString());
|
|
1471
|
+
wrapper.appendChild(circle);
|
|
1472
|
+
circle = this.paper.circle(this.cx, this.cy, this.radius - this.radius / this.settings.INNER_CIRCLE_RADIUS_RATIO);
|
|
1473
|
+
circle.setAttribute("stroke", this.settings.CIRCLE_COLOR);
|
|
1474
|
+
circle.setAttribute("stroke-width", (this.settings.CIRCLE_STRONG * this.settings.SYMBOL_SCALE).toString());
|
|
1475
|
+
wrapper.appendChild(circle);
|
|
1476
|
+
}
|
|
1477
|
+
/**
|
|
1478
|
+
* Display transit horoscope
|
|
1479
|
+
*
|
|
1480
|
+
* @param {Object} data
|
|
1481
|
+
* @example
|
|
1482
|
+
* {
|
|
1483
|
+
* "planets":{"Moon":[0], "Sun":[30], ... },
|
|
1484
|
+
* "cusps":[300, 340, 30, 60, 75, 90, 116, 172, 210, 236, 250, 274], *
|
|
1485
|
+
* }
|
|
1486
|
+
*
|
|
1487
|
+
* @return {Transit} transit
|
|
1488
|
+
*/
|
|
1489
|
+
transit(data) {
|
|
1490
|
+
getEmptyWrapper(this.universe, this.paper.root.id + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_AXIS, this.paper.root.id);
|
|
1491
|
+
const transit = new transit_default(this.context, data, this.settings);
|
|
1492
|
+
transit.drawBg();
|
|
1493
|
+
transit.drawPoints();
|
|
1494
|
+
transit.drawCusps();
|
|
1495
|
+
transit.drawRuler();
|
|
1496
|
+
transit.drawCircles();
|
|
1497
|
+
return transit;
|
|
1498
|
+
}
|
|
1499
|
+
};
|
|
1500
|
+
var radix_default = Radix;
|
|
1501
|
+
|
|
1502
|
+
//#endregion
|
|
1503
|
+
//#region src/svg.ts
|
|
1504
|
+
/**
|
|
1505
|
+
* SVG tools.
|
|
1506
|
+
*
|
|
1507
|
+
* @class
|
|
1508
|
+
* @public
|
|
1509
|
+
* @constructor
|
|
1510
|
+
* @param {String} elementId - root DOM Element
|
|
1511
|
+
* @param {int} width
|
|
1512
|
+
* @param {int} height
|
|
1513
|
+
*/
|
|
1514
|
+
var SVG = class {
|
|
1515
|
+
settings;
|
|
1516
|
+
_paperElementId;
|
|
1517
|
+
DOMElement;
|
|
1518
|
+
root;
|
|
1519
|
+
width;
|
|
1520
|
+
height;
|
|
1521
|
+
context;
|
|
1522
|
+
constructor(elementId, width, height, settings) {
|
|
1523
|
+
this.settings = settings;
|
|
1524
|
+
const rootElement = document.getElementById(elementId);
|
|
1525
|
+
if (rootElement == null) throw new Error("Root element not found");
|
|
1526
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
1527
|
+
svg.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
1528
|
+
svg.setAttribute("style", "position: relative; overflow: hidden;");
|
|
1529
|
+
svg.setAttribute("version", "1.1");
|
|
1530
|
+
svg.setAttribute("width", width.toString());
|
|
1531
|
+
svg.setAttribute("height", height.toString());
|
|
1532
|
+
svg.setAttribute("viewBox", "0 0 " + width + " " + height);
|
|
1533
|
+
rootElement.appendChild(svg);
|
|
1534
|
+
this._paperElementId = elementId + "-" + this.settings.ID_CHART;
|
|
1535
|
+
const wrapper = document.createElementNS(svg.namespaceURI, "g");
|
|
1536
|
+
wrapper.setAttribute("id", this._paperElementId);
|
|
1537
|
+
svg.appendChild(wrapper);
|
|
1538
|
+
this.DOMElement = svg;
|
|
1539
|
+
this.root = wrapper;
|
|
1540
|
+
this.width = width;
|
|
1541
|
+
this.height = height;
|
|
1542
|
+
this.context = this;
|
|
1543
|
+
}
|
|
1544
|
+
_getSymbol(name, x, y) {
|
|
1545
|
+
switch (name) {
|
|
1546
|
+
case this.settings.SYMBOL_SUN: return this.sun(x, y);
|
|
1547
|
+
case this.settings.SYMBOL_MOON: return this.moon(x, y);
|
|
1548
|
+
case this.settings.SYMBOL_MERCURY: return this.mercury(x, y);
|
|
1549
|
+
case this.settings.SYMBOL_VENUS: return this.venus(x, y);
|
|
1550
|
+
case this.settings.SYMBOL_MARS: return this.mars(x, y);
|
|
1551
|
+
case this.settings.SYMBOL_JUPITER: return this.jupiter(x, y);
|
|
1552
|
+
case this.settings.SYMBOL_SATURN: return this.saturn(x, y);
|
|
1553
|
+
case this.settings.SYMBOL_URANUS: return this.uranus(x, y);
|
|
1554
|
+
case this.settings.SYMBOL_NEPTUNE: return this.neptune(x, y);
|
|
1555
|
+
case this.settings.SYMBOL_PLUTO: return this.pluto(x, y);
|
|
1556
|
+
case this.settings.SYMBOL_CHIRON: return this.chiron(x, y);
|
|
1557
|
+
case this.settings.SYMBOL_LILITH: return this.lilith(x, y);
|
|
1558
|
+
case this.settings.SYMBOL_NNODE: return this.nnode(x, y);
|
|
1559
|
+
case this.settings.SYMBOL_SNODE: return this.snode(x, y);
|
|
1560
|
+
case this.settings.SYMBOL_FORTUNE: return this.fortune(x, y);
|
|
1561
|
+
case this.settings.SYMBOL_ARIES: return this.aries(x, y);
|
|
1562
|
+
case this.settings.SYMBOL_TAURUS: return this.taurus(x, y);
|
|
1563
|
+
case this.settings.SYMBOL_GEMINI: return this.gemini(x, y);
|
|
1564
|
+
case this.settings.SYMBOL_CANCER: return this.cancer(x, y);
|
|
1565
|
+
case this.settings.SYMBOL_LEO: return this.leo(x, y);
|
|
1566
|
+
case this.settings.SYMBOL_VIRGO: return this.virgo(x, y);
|
|
1567
|
+
case this.settings.SYMBOL_LIBRA: return this.libra(x, y);
|
|
1568
|
+
case this.settings.SYMBOL_SCORPIO: return this.scorpio(x, y);
|
|
1569
|
+
case this.settings.SYMBOL_SAGITTARIUS: return this.sagittarius(x, y);
|
|
1570
|
+
case this.settings.SYMBOL_CAPRICORN: return this.capricorn(x, y);
|
|
1571
|
+
case this.settings.SYMBOL_AQUARIUS: return this.aquarius(x, y);
|
|
1572
|
+
case this.settings.SYMBOL_PISCES: return this.pisces(x, y);
|
|
1573
|
+
case this.settings.SYMBOL_AS: return this.ascendant(x, y);
|
|
1574
|
+
case this.settings.SYMBOL_DS: return this.descendant(x, y);
|
|
1575
|
+
case this.settings.SYMBOL_MC: return this.mediumCoeli(x, y);
|
|
1576
|
+
case this.settings.SYMBOL_IC: return this.immumCoeli(x, y);
|
|
1577
|
+
case this.settings.SYMBOL_CUSP_1: return this.number1(x, y);
|
|
1578
|
+
case this.settings.SYMBOL_CUSP_2: return this.number2(x, y);
|
|
1579
|
+
case this.settings.SYMBOL_CUSP_3: return this.number3(x, y);
|
|
1580
|
+
case this.settings.SYMBOL_CUSP_4: return this.number4(x, y);
|
|
1581
|
+
case this.settings.SYMBOL_CUSP_5: return this.number5(x, y);
|
|
1582
|
+
case this.settings.SYMBOL_CUSP_6: return this.number6(x, y);
|
|
1583
|
+
case this.settings.SYMBOL_CUSP_7: return this.number7(x, y);
|
|
1584
|
+
case this.settings.SYMBOL_CUSP_8: return this.number8(x, y);
|
|
1585
|
+
case this.settings.SYMBOL_CUSP_9: return this.number9(x, y);
|
|
1586
|
+
case this.settings.SYMBOL_CUSP_10: return this.number10(x, y);
|
|
1587
|
+
case this.settings.SYMBOL_CUSP_11: return this.number11(x, y);
|
|
1588
|
+
case this.settings.SYMBOL_CUSP_12: return this.number12(x, y);
|
|
1589
|
+
default: {
|
|
1590
|
+
const unknownPoint = this.circle(x, y, 8);
|
|
1591
|
+
unknownPoint.setAttribute("stroke", "#ffff00");
|
|
1592
|
+
unknownPoint.setAttribute("stroke-width", "1");
|
|
1593
|
+
unknownPoint.setAttribute("fill", "#ff0000");
|
|
1594
|
+
return unknownPoint;
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Get a required symbol.
|
|
1600
|
+
*
|
|
1601
|
+
* @param {String} name
|
|
1602
|
+
* @param {int} x
|
|
1603
|
+
* @param {int} y
|
|
1604
|
+
*
|
|
1605
|
+
* @return {SVGElement g}
|
|
1606
|
+
*/
|
|
1607
|
+
getSymbol(name, x, y) {
|
|
1608
|
+
if (this.settings.CUSTOM_SYMBOL_FN == null) return this._getSymbol(name, x, y);
|
|
1609
|
+
const symbol = this.settings.CUSTOM_SYMBOL_FN(name, x, y, this.context);
|
|
1610
|
+
if (symbol == null || symbol === void 0) return this._getSymbol(name, x, y);
|
|
1611
|
+
return symbol;
|
|
1612
|
+
}
|
|
1613
|
+
/**
|
|
1614
|
+
* Create transparent rectangle.
|
|
1615
|
+
*
|
|
1616
|
+
* Used to improve area click, @see this.settings.ADD_CLICK_AREA
|
|
1617
|
+
*
|
|
1618
|
+
* @param {Number} x
|
|
1619
|
+
* @param {Number} y
|
|
1620
|
+
*
|
|
1621
|
+
* @return {Element} rect
|
|
1622
|
+
*/
|
|
1623
|
+
createRectForClick(x, y) {
|
|
1624
|
+
const rect = document.createElementNS(this.context.root.namespaceURI, "rect");
|
|
1625
|
+
rect.setAttribute("x", (x - this.settings.SIGNS_STROKE).toString());
|
|
1626
|
+
rect.setAttribute("y", (y - this.settings.SIGNS_STROKE).toString());
|
|
1627
|
+
rect.setAttribute("width", "20px");
|
|
1628
|
+
rect.setAttribute("height", "20px");
|
|
1629
|
+
rect.setAttribute("fill", "transparent");
|
|
1630
|
+
return rect;
|
|
1631
|
+
}
|
|
1632
|
+
/**
|
|
1633
|
+
* Get ID for sign wrapper.
|
|
1634
|
+
*
|
|
1635
|
+
* @param {String} sign
|
|
1636
|
+
*
|
|
1637
|
+
* @return {String id}
|
|
1638
|
+
*/
|
|
1639
|
+
getSignWrapperId(sign) {
|
|
1640
|
+
return this._paperElementId + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_SIGNS + "-" + sign;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Get ID for house wrapper.
|
|
1644
|
+
*
|
|
1645
|
+
* @param {String} house
|
|
1646
|
+
*
|
|
1647
|
+
* @return {String id}
|
|
1648
|
+
*/
|
|
1649
|
+
getHouseIdWrapper(house) {
|
|
1650
|
+
return this._paperElementId + "-" + this.settings.ID_RADIX + "-" + this.settings.ID_CUSPS + "-" + house;
|
|
1651
|
+
}
|
|
1652
|
+
sun(x, y) {
|
|
1653
|
+
const xShift = -1;
|
|
1654
|
+
const yShift = -8;
|
|
1655
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1656
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1657
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1658
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1659
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1660
|
+
node.setAttribute("d", "m" + x + ", " + y + " -2.18182,0.727268 -2.181819,1.454543 -1.454552,2.18182 -0.727268,2.181819 0,2.181819 0.727268,2.181819 1.454552,2.18182 2.181819,1.454544 2.18182,0.727276 2.18181,0 2.18182,-0.727276 2.181819,-1.454544 1.454552,-2.18182 0.727268,-2.181819 0,-2.181819 -0.727268,-2.181819 -1.454552,-2.18182 -2.181819,-1.454543 -2.18182,-0.727268 -2.18181,0 m 0.727267,6.54545 -0.727267,0.727276 0,0.727275 0.727267,0.727268 0.727276,0 0.727267,-0.727268 0,-0.727275 -0.727267,-0.727276 -0.727276,0 m 0,0.727276 0,0.727275 0.727276,0 0,-0.727275 -0.727276,0");
|
|
1661
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1662
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1663
|
+
node.setAttribute("fill", "none");
|
|
1664
|
+
wrapper.appendChild(node);
|
|
1665
|
+
return wrapper;
|
|
1666
|
+
}
|
|
1667
|
+
moon(x, y) {
|
|
1668
|
+
const xShift = -2;
|
|
1669
|
+
const yShift = -7;
|
|
1670
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1671
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1672
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1673
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1674
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1675
|
+
node.setAttribute("d", "m" + x + ", " + y + " a 7.4969283,7.4969283 0 0 1 0,14.327462 7.4969283,7.4969283 0 1 0 0,-14.327462 z");
|
|
1676
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1677
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1678
|
+
node.setAttribute("fill", "none");
|
|
1679
|
+
wrapper.appendChild(node);
|
|
1680
|
+
return wrapper;
|
|
1681
|
+
}
|
|
1682
|
+
mercury(x, y) {
|
|
1683
|
+
const xShift = -2;
|
|
1684
|
+
const yShift = 7;
|
|
1685
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1686
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1687
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1688
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1689
|
+
const body = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1690
|
+
body.setAttribute("d", "m" + x + ", " + y + " 4.26011,0 m -2.13005,-2.98207 0,5.11213 m 4.70312,-9.7983 a 4.70315,4.70315 0 0 1 -4.70315,4.70314 4.70315,4.70315 0 0 1 -4.70314,-4.70314 4.70315,4.70315 0 0 1 4.70314,-4.70315 4.70315,4.70315 0 0 1 4.70315,4.70315 z");
|
|
1691
|
+
body.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1692
|
+
body.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1693
|
+
body.setAttribute("fill", "none");
|
|
1694
|
+
wrapper.appendChild(body);
|
|
1695
|
+
const crownXShift = 6;
|
|
1696
|
+
const crownYShift = -16;
|
|
1697
|
+
const crown = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1698
|
+
crown.setAttribute("d", "m" + (x + crownXShift) + ", " + (y + crownYShift) + " a 3.9717855,3.9717855 0 0 1 -3.95541,3.59054 3.9717855,3.9717855 0 0 1 -3.95185,-3.59445");
|
|
1699
|
+
crown.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1700
|
+
crown.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1701
|
+
crown.setAttribute("fill", "none");
|
|
1702
|
+
wrapper.appendChild(crown);
|
|
1703
|
+
return wrapper;
|
|
1704
|
+
}
|
|
1705
|
+
venus(x, y) {
|
|
1706
|
+
const xShift = 2;
|
|
1707
|
+
const yShift = 7;
|
|
1708
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1709
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1710
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1711
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1712
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1713
|
+
node.setAttribute("d", "m" + x + ", " + y + " -4.937669,0.03973 m 2.448972,2.364607 0,-5.79014 c -3.109546,-0.0085 -5.624617,-2.534212 -5.620187,-5.64208 0.0044,-3.107706 2.526514,-5.621689 5.635582,-5.621689 3.109068,0 5.631152,2.513983 5.635582,5.621689 0.0044,3.107868 -2.510641,5.633586 -5.620187,5.64208");
|
|
1714
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1715
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1716
|
+
node.setAttribute("fill", "none");
|
|
1717
|
+
wrapper.appendChild(node);
|
|
1718
|
+
return wrapper;
|
|
1719
|
+
}
|
|
1720
|
+
mars(x, y) {
|
|
1721
|
+
const xShift = 2;
|
|
1722
|
+
const yShift = -2;
|
|
1723
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1724
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1725
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1726
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1727
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1728
|
+
node.setAttribute("d", "m" + x + ", " + y + " c -5.247438,-4.150623 -11.6993,3.205518 -7.018807,7.886007 4.680494,4.680488 12.036628,-1.771382 7.885999,-7.018816 z m 0,0 0.433597,0.433595 3.996566,-4.217419 m -3.239802,-0.05521 3.295015,0 0.110427,3.681507");
|
|
1729
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1730
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1731
|
+
node.setAttribute("fill", "none");
|
|
1732
|
+
wrapper.appendChild(node);
|
|
1733
|
+
return wrapper;
|
|
1734
|
+
}
|
|
1735
|
+
jupiter(x, y) {
|
|
1736
|
+
const xShift = -5;
|
|
1737
|
+
const yShift = -2;
|
|
1738
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1739
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1740
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1741
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1742
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1743
|
+
node.setAttribute("d", "m" + x + ", " + y + " c -0.43473,0 -1.30422,-0.40572 -1.30422,-2.02857 0,-1.62285 1.73897,-3.2457 3.47792,-3.2457 1.73897,0 3.47792,1.21715 3.47792,4.05713 0,2.83999 -2.1737,7.30283 -6.52108,7.30283 m 12.17269,0 -12.60745,0 m 9.99902,-11.76567 0,15.82279");
|
|
1744
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1745
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1746
|
+
node.setAttribute("fill", "none");
|
|
1747
|
+
wrapper.appendChild(node);
|
|
1748
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y - 3));
|
|
1749
|
+
return wrapper;
|
|
1750
|
+
}
|
|
1751
|
+
saturn(x, y) {
|
|
1752
|
+
const xShift = 5;
|
|
1753
|
+
const yShift = 10;
|
|
1754
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1755
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1756
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1757
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1758
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1759
|
+
node.setAttribute("d", "m" + x + ", " + y + " c -0.52222,0.52221 -1.04445,1.04444 -1.56666,1.04444 -0.52222,0 -1.56667,-0.52223 -1.56667,-1.56667 0,-1.04443 0.52223,-2.08887 1.56667,-3.13332 1.04444,-1.04443 2.08888,-3.13331 2.08888,-5.22219 0,-2.08888 -1.04444,-4.17776 -3.13332,-4.17776 -1.97566,0 -3.65555,1.04444 -4.69998,3.13333 m -2.55515,-5.87499 6.26664,0 m -3.71149,-2.48054 0,15.14438");
|
|
1760
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1761
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1762
|
+
node.setAttribute("fill", "none");
|
|
1763
|
+
wrapper.appendChild(node);
|
|
1764
|
+
return wrapper;
|
|
1765
|
+
}
|
|
1766
|
+
uranus(x, y) {
|
|
1767
|
+
const xShift = -5;
|
|
1768
|
+
const yShift = -7;
|
|
1769
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1770
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1771
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1772
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1773
|
+
const horns = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1774
|
+
horns.setAttribute("d", "m" + x + ", " + y + " 0,10.23824 m 10.23633,-10.32764 0,10.23824 m -10.26606,-4.6394 10.23085,0 m -5.06415,-5.51532 0,11.94985");
|
|
1775
|
+
horns.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1776
|
+
horns.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1777
|
+
horns.setAttribute("fill", "none");
|
|
1778
|
+
wrapper.appendChild(horns);
|
|
1779
|
+
const bodyXShift = 7;
|
|
1780
|
+
const bodyYShift = 14.5;
|
|
1781
|
+
const body = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1782
|
+
body.setAttribute("d", "m" + (x + bodyXShift) + ", " + (y + bodyYShift) + " a 1.8384377,1.8384377 0 0 1 -1.83844,1.83843 1.8384377,1.8384377 0 0 1 -1.83842,-1.83843 1.8384377,1.8384377 0 0 1 1.83842,-1.83844 1.8384377,1.8384377 0 0 1 1.83844,1.83844 z");
|
|
1783
|
+
body.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1784
|
+
body.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1785
|
+
body.setAttribute("fill", "none");
|
|
1786
|
+
wrapper.appendChild(body);
|
|
1787
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
1788
|
+
return wrapper;
|
|
1789
|
+
}
|
|
1790
|
+
neptune(x, y) {
|
|
1791
|
+
const xShift = 3;
|
|
1792
|
+
const yShift = -5;
|
|
1793
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1794
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1795
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1796
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1797
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1798
|
+
node.setAttribute("d", "m" + x + ", " + y + " 1.77059,-2.36312 2.31872,1.8045 m -14.44264,-0.20006 2.34113,-1.77418 1.74085,2.38595 m -1.80013,-1.77265 c -1.23776,8.40975 0.82518,9.67121 4.95106,9.67121 4.12589,0 6.18883,-1.26146 4.95107,-9.67121 m -7.05334,3.17005 2.03997,-2.12559 2.08565,2.07903 m -5.32406,9.91162 6.60142,0 m -3.30071,-12.19414 0,15.55803");
|
|
1799
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1800
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1801
|
+
node.setAttribute("fill", "none");
|
|
1802
|
+
wrapper.appendChild(node);
|
|
1803
|
+
return wrapper;
|
|
1804
|
+
}
|
|
1805
|
+
pluto(x, y) {
|
|
1806
|
+
const xShift = 5;
|
|
1807
|
+
const yShift = -5;
|
|
1808
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1809
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1810
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1811
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1812
|
+
const body = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1813
|
+
body.setAttribute("d", "m" + x + ", " + y + " a 5.7676856,5.7676856 0 0 1 -2.88385,4.99496 5.7676856,5.7676856 0 0 1 -5.76768,0 5.7676856,5.7676856 0 0 1 -2.88385,-4.99496 m 5.76771,13.93858 0,-8.17088 m -3.84512,4.32576 7.69024,0");
|
|
1814
|
+
body.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1815
|
+
body.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1816
|
+
body.setAttribute("fill", "none");
|
|
1817
|
+
wrapper.appendChild(body);
|
|
1818
|
+
const headXShift = -2.3;
|
|
1819
|
+
const headYShift = 0;
|
|
1820
|
+
const head = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1821
|
+
head.setAttribute("d", "m" + (x + headXShift) + ", " + (y + headYShift) + " a 3.3644834,3.3644834 0 0 1 -3.36448,3.36449 3.3644834,3.3644834 0 0 1 -3.36448,-3.36449 3.3644834,3.3644834 0 0 1 3.36448,-3.36448 3.3644834,3.3644834 0 0 1 3.36448,3.36448 z");
|
|
1822
|
+
head.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1823
|
+
head.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1824
|
+
head.setAttribute("fill", "none");
|
|
1825
|
+
wrapper.appendChild(head);
|
|
1826
|
+
return wrapper;
|
|
1827
|
+
}
|
|
1828
|
+
chiron(x, y) {
|
|
1829
|
+
const xShift = 3;
|
|
1830
|
+
const yShift = 5;
|
|
1831
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1832
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1833
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1834
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1835
|
+
const body = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1836
|
+
body.setAttribute("d", "m" + x + ", " + y + " a 3.8764725,3.0675249 0 0 1 -3.876473,3.067525 3.8764725,3.0675249 0 0 1 -3.876472,-3.067525 3.8764725,3.0675249 0 0 1 3.876472,-3.067525 3.8764725,3.0675249 0 0 1 3.876473,3.067525 z");
|
|
1837
|
+
body.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1838
|
+
body.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1839
|
+
body.setAttribute("fill", "none");
|
|
1840
|
+
wrapper.appendChild(body);
|
|
1841
|
+
const headXShift = 0;
|
|
1842
|
+
const headYShift = -13;
|
|
1843
|
+
const head = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1844
|
+
head.setAttribute("d", "m" + (x + headXShift) + ", " + (y + headYShift) + " -3.942997,4.243844 4.110849,3.656151 m -4.867569,-9.009468 0,11.727251");
|
|
1845
|
+
head.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1846
|
+
head.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1847
|
+
head.setAttribute("fill", "none");
|
|
1848
|
+
wrapper.appendChild(head);
|
|
1849
|
+
return wrapper;
|
|
1850
|
+
}
|
|
1851
|
+
lilith(x, y) {
|
|
1852
|
+
const xShift = 2;
|
|
1853
|
+
const yShift = 4;
|
|
1854
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1855
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1856
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1857
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1858
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1859
|
+
node.setAttribute("d", "m" + x + ", " + y + " -2.525435,-1.12853 -1.464752,-1.79539 -0.808138,-2.20576 0.151526,-2.05188 0.909156,-1.5389 1.010173,-1.02593 0.909157,-0.56427 1.363735,-0.61556 m 2.315327,-0.39055 -1.716301,0.54716 -1.7163,1.09431 -1.1442,1.64146 -0.572102,1.64146 0,1.64146 0.572102,1.64147 1.1442,1.64145 1.7163,1.09432 1.716301,0.54715 m 0,-11.49024 -2.2884,0 -2.288401,0.54716 -1.716302,1.09431 -1.144201,1.64146 -0.5721,1.64146 0,1.64146 0.5721,1.64147 1.144201,1.64145 1.716302,1.09432 2.288401,0.54715 2.2884,0 m -4.36712,-0.4752 0,6.44307 m -2.709107,-3.41101 5.616025,0");
|
|
1860
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1861
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1862
|
+
node.setAttribute("fill", "none");
|
|
1863
|
+
wrapper.appendChild(node);
|
|
1864
|
+
return wrapper;
|
|
1865
|
+
}
|
|
1866
|
+
nnode(x, y) {
|
|
1867
|
+
const xShift = -2;
|
|
1868
|
+
const yShift = 3;
|
|
1869
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1870
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1871
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1872
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1873
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1874
|
+
node.setAttribute("d", "m" + x + ", " + y + " -1.3333334,-0.6666667 -0.6666666,0 -1.3333334,0.6666667 -0.6666667,1.3333333 0,0.6666667 0.6666667,1.3333333 1.3333334,0.6666667 0.6666666,0 1.3333334,-0.6666667 0.6666666,-1.3333333 0,-0.6666667 -0.6666666,-1.3333333 -2,-2.66666665 -0.6666667,-1.99999995 0,-1.3333334 0.6666667,-2 1.3333333,-1.3333333 2,-0.6666667 2.6666666,0 2,0.6666667 1.3333333,1.3333333 0.6666667,2 0,1.3333334 -0.6666667,1.99999995 -2,2.66666665 -0.6666666,1.3333333 0,0.6666667 0.6666666,1.3333333 1.3333334,0.6666667 0.6666666,0 1.3333334,-0.6666667 0.6666667,-1.3333333 0,-0.6666667 -0.6666667,-1.3333333 -1.3333334,-0.6666667 -0.6666666,0 -1.3333334,0.6666667 m -7.9999999,-6 0.6666667,-1.3333333 1.3333333,-1.3333333 2,-0.6666667 2.6666666,0 2,0.6666667 1.3333333,1.3333333 0.6666667,1.3333333");
|
|
1875
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1876
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1877
|
+
node.setAttribute("fill", "none");
|
|
1878
|
+
wrapper.appendChild(node);
|
|
1879
|
+
return wrapper;
|
|
1880
|
+
}
|
|
1881
|
+
snode(x, y) {
|
|
1882
|
+
const xShift = 0;
|
|
1883
|
+
const yShift = -5;
|
|
1884
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1885
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1886
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1887
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1888
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1889
|
+
node.setAttribute("d", "m" + x + ", " + y + " l1.3333282470703125,0.666656494140625l0.6666717529296875,0l1.3333282470703125,-0.666656494140625l0.6666717529296875,-1.333343505859375l0,-0.666656494140625l-0.6666717529296875,-1.333343505859375l-1.3333282470703125,-0.666656494140625l-0.6666717529296875,0l-1.3333282470703125,0.666656494140625l-0.6666717529296875,1.333343505859375l0,0.666656494140625l0.6666717529296875,1.333343505859375l2,2.666656494140625l0.6666717529296875,2l0,1.333343505859375l-0.6666717529296875,2l-1.3333282470703125,1.333343505859375l-2,0.666656494140625l-2.6666717529296875,0l-2,-0.666656494140625l-1.3333282470703125,-1.333343505859375l-0.6666717529296875,-2l0,-1.333343505859375l0.6666717529296875,-2l2,-2.666656494140625l0.666656494140625,-1.333343505859375l0,-0.666656494140625l-0.666656494140625,-1.333343505859375l-1.333343505859375,-0.666656494140625l-0.666656494140625,0l-1.333343505859375,0.666656494140625l-0.666656494140625,1.333343505859375l0,0.666656494140625l0.666656494140625,1.333343505859375l1.333343505859375,0.666656494140625l0.666656494140625,0l1.333343505859375,-0.666656494140625m8,6l-0.6666717529296875,1.333343505859375l-1.3333282470703125,1.33331298828125l-2,0.66668701171875l-2.6666717529296875,0l-2,-0.66668701171875l-1.3333282470703125,-1.33331298828125l-0.6666717529296875,-1.333343505859375");
|
|
1890
|
+
node.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1891
|
+
node.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1892
|
+
node.setAttribute("fill", "none");
|
|
1893
|
+
wrapper.appendChild(node);
|
|
1894
|
+
return wrapper;
|
|
1895
|
+
}
|
|
1896
|
+
fortune(x, y) {
|
|
1897
|
+
const xShift = -10;
|
|
1898
|
+
const yShift = -8;
|
|
1899
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1900
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1901
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1902
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1903
|
+
const path1 = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1904
|
+
path1.setAttribute("d", "M15.971322059631348,8.000000953674316A7.971322252863855,7.971322252863855,0,0,1,8,15.97132396697998A7.971322252863855,7.971322252863855,0,0,1,0.028678132221102715,8.000000953674316A7.971322252863855,7.971322252863855,0,0,1,8,0.028677448630332947A7.971322252863855,7.971322252863855,0,0,1,15.971322059631348,8.000000953674316Z");
|
|
1905
|
+
const path2 = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1906
|
+
path2.setAttribute("d", "M2.668839454650879,2.043858766555786C6.304587364196777,5.906839370727539,9.94033432006836,9.769822120666504,13.576082229614258,13.632804870605469");
|
|
1907
|
+
const path3 = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1908
|
+
path3.setAttribute("d", "m2.5541272163391113,13.747519493103027c3.635746955871582,-3.8629846572875977,7.271494388580322,-7.72596549987793,10.90724229812622,-11.588947772979736");
|
|
1909
|
+
const fortuneGroup = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1910
|
+
fortuneGroup.setAttribute("transform", "translate(" + x + "," + y + ")");
|
|
1911
|
+
fortuneGroup.appendChild(path1);
|
|
1912
|
+
fortuneGroup.appendChild(path2);
|
|
1913
|
+
fortuneGroup.appendChild(path3);
|
|
1914
|
+
wrapper.setAttribute("stroke", this.settings.POINTS_COLOR);
|
|
1915
|
+
wrapper.setAttribute("stroke-width", this.settings.POINTS_STROKE.toString());
|
|
1916
|
+
wrapper.setAttribute("fill", "none");
|
|
1917
|
+
wrapper.appendChild(fortuneGroup);
|
|
1918
|
+
return wrapper;
|
|
1919
|
+
}
|
|
1920
|
+
aries(x, y) {
|
|
1921
|
+
const xShift = -9;
|
|
1922
|
+
const yShift = -2;
|
|
1923
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1924
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1925
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1926
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_ARIES));
|
|
1927
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1928
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1929
|
+
node.setAttribute("d", "m " + x + ", " + y + " -0.9,-0.9 0,-1.8 0.9,-1.8 1.8,-0.8999998 1.8,0 1.8,0.8999998 0.9,0.9 0.9,1.8 0.9,4.5 m -9,-5.4 1.8,-1.8 1.8,0 1.8,0.9 0.9,0.9 0.9,1.8 0.9,3.6 0,9.9 m 8.1,-12.6 0.9,-0.9 0,-1.8 -0.9,-1.8 -1.8,-0.8999998 -1.8,0 -1.8,0.8999998 -0.9,0.9 -0.9,1.8 -0.9,4.5 m 9,-5.4 -1.8,-1.8 -1.8,0 -1.8,0.9 -0.9,0.9 -0.9,1.8 -0.9,3.6 0,9.9");
|
|
1930
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
1931
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
1932
|
+
node.setAttribute("fill", "none");
|
|
1933
|
+
wrapper.appendChild(node);
|
|
1934
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y - 4));
|
|
1935
|
+
return wrapper;
|
|
1936
|
+
}
|
|
1937
|
+
taurus(x, y) {
|
|
1938
|
+
const xShift = -9;
|
|
1939
|
+
const yShift = -11;
|
|
1940
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1941
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1942
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1943
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_TAURUS));
|
|
1944
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1945
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1946
|
+
node.setAttribute("d", "m " + x + ", " + y + " 1,4 1,2 2,2 3,1 4,0 3,-1 2,-2 1,-2 1,-4 m -18,0 1,3 1,2 2,2 3,1 4,0 3,-1 2,-2 1,-2 1,-3 m -11,8 -2,1 -1,1 -1,2 0,3 1,2 2,2 2,1 2,0 2,-1 2,-2 1,-2 0,-3 -1,-2 -1,-1 -2,-1 m -4,1 -2,1 -1,2 0,3 1,3 m 8,0 1,-3 0,-3 -1,-2 -2,-1");
|
|
1947
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
1948
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
1949
|
+
node.setAttribute("fill", "none");
|
|
1950
|
+
wrapper.appendChild(node);
|
|
1951
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
1952
|
+
return wrapper;
|
|
1953
|
+
}
|
|
1954
|
+
gemini(x, y) {
|
|
1955
|
+
const xShift = -6;
|
|
1956
|
+
const yShift = -6;
|
|
1957
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1958
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1959
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1960
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_GEMINI));
|
|
1961
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1962
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1963
|
+
node.setAttribute("d", "m " + x + ", " + y + " 0,11.546414 m 0.9622011,-10.5842129 0,9.6220117 m 7.6976097,-9.6220117 0,9.6220117 m 0.962201,-10.5842128 0,11.546414 m -13.4708165,-14.4330172 1.9244023,1.924402 1.9244024,0.9622012 2.8866038,0.9622011 3.848804,0 2.886604,-0.9622011 1.924402,-0.9622012 1.924403,-1.924402 m -17.3196215,17.3196207 1.9244023,-1.9244024 1.9244024,-0.9622011 2.8866038,-0.9622012 3.848804,0 2.886604,0.9622012 1.924402,0.9622011 1.924403,1.9244024");
|
|
1964
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
1965
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
1966
|
+
node.setAttribute("fill", "none");
|
|
1967
|
+
wrapper.appendChild(node);
|
|
1968
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
1969
|
+
return wrapper;
|
|
1970
|
+
}
|
|
1971
|
+
cancer(x, y) {
|
|
1972
|
+
const xShift = 9;
|
|
1973
|
+
const yShift = -9;
|
|
1974
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1975
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1976
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1977
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_CANCER));
|
|
1978
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1979
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1980
|
+
node.setAttribute("d", "m " + x + ", " + y + " -15,0 -2,1 -1,2 0,2 1,2 2,1 2,0 2,-1 1,-2 0,-2 -1,-2 11,0 m -18,3 1,2 1,1 2,1 m 4,-4 -1,-2 -1,-1 -2,-1 m -4,15 15,0 2,-1 1,-2 0,-2 -1,-2 -2,-1 -2,0 -2,1 -1,2 0,2 1,2 -11,0 m 18,-3 -1,-2 -1,-1 -2,-1 m -4,4 1,2 1,1 2,1");
|
|
1981
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
1982
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
1983
|
+
node.setAttribute("fill", "none");
|
|
1984
|
+
wrapper.appendChild(node);
|
|
1985
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x - 18, y));
|
|
1986
|
+
return wrapper;
|
|
1987
|
+
}
|
|
1988
|
+
leo(x, y) {
|
|
1989
|
+
const xShift = -3;
|
|
1990
|
+
const yShift = 4;
|
|
1991
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
1992
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
1993
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
1994
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_LEO));
|
|
1995
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
1996
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
1997
|
+
node.setAttribute("d", "m " + x + ", " + y + " -2,-1 -1,0 -2,1 -1,2 0,1 1,2 2,1 1,0 2,-1 1,-2 0,-1 -1,-2 -5,-5 -1,-2 0,-3 1,-2 2,-1 3,-1 4,0 4,1 2,2 1,2 0,3 -1,3 -3,3 -1,2 0,2 1,2 2,0 1,-1 1,-2 m -13,-5 -2,-3 -1,-2 0,-3 1,-2 1,-1 m 7,-1 3,1 2,2 1,2 0,3 -1,3 -2,3");
|
|
1998
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
1999
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2000
|
+
node.setAttribute("fill", "none");
|
|
2001
|
+
wrapper.appendChild(node);
|
|
2002
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x - 6, y - 13));
|
|
2003
|
+
return wrapper;
|
|
2004
|
+
}
|
|
2005
|
+
virgo(x, y) {
|
|
2006
|
+
const xShift = -9;
|
|
2007
|
+
const yShift = -5;
|
|
2008
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2009
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2010
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2011
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_VIRGO));
|
|
2012
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2013
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2014
|
+
node.setAttribute("d", "m " + x + ", " + y + " 2.5894868,-2.5894868 1.7263245,2.5894868 0,9.4947847 m -2.5894868,-11.2211092 1.7263245,2.5894867 0,8.6316225 m 0.8631623,-9.4947847 2.5894867,-2.5894868 1.72632451,2.5894868 0,8.6316224 m -2.58948671,-10.3579469 1.72632447,2.5894867 0,7.7684602 m 0.86316224,-8.6316224 2.58948679,-2.5894868 1.7263244,2.5894868 0,13.8105959 m -2.5894867,-15.5369204 1.7263245,2.5894867 0,12.9474337 m 0.8631622,-13.8105959 2.5894868,-2.5894868 0.8631622,1.7263245 0.8631623,2.5894868 0,2.5894867 -0.8631623,2.58948673 -0.8631622,1.72632447 -1.7263245,1.7263245 -2.5894867,1.7263245 -4.3158113,1.7263245 m 7.7684602,-15.5369204 0.8631623,0.8631622 0.8631622,2.5894868 0,2.5894867 -0.8631622,2.58948673 -0.8631623,1.72632447 -1.7263245,1.7263245 -2.5894867,1.7263245 -3.452649,1.7263245");
|
|
2015
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2016
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2017
|
+
node.setAttribute("fill", "none");
|
|
2018
|
+
wrapper.appendChild(node);
|
|
2019
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2020
|
+
return wrapper;
|
|
2021
|
+
}
|
|
2022
|
+
libra(x, y) {
|
|
2023
|
+
const xShift = -2;
|
|
2024
|
+
const yShift = -8;
|
|
2025
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2026
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2027
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2028
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_LIBRA));
|
|
2029
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2030
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2031
|
+
node.setAttribute("d", "m " + x + ", " + y + " c 0.7519,1e-5 1.3924,0.12227 1.9316,0.35156 0.6619,0.28495 1.2134,0.63854 1.666,1.0625 0.4838,0.45481 0.853,0.97255 1.1172,1.56641 0.2467,0.56612 0.3711,1.17397 0.3711,1.83789 0,0.64113 -0.1244,1.23948 -0.373,1.80859 -0.1624,0.36305 -0.3631,0.69725 -0.6055,1.00586 l -0.6367,0.8086 4.3789,0 0,0.67187 -5.4024,0 0,-0.91797 c 0.2173,-0.1385 0.4379,-0.27244 0.6367,-0.44726 0.4215,-0.36876 0.7529,-0.82784 0.9883,-1.35547 0.2215,-0.50074 0.334,-1.0358 0.334,-1.58594 0,-0.55653 -0.1122,-1.09434 -0.334,-1.5957 l -0,-0.002 0,-0.004 c -0.2292,-0.49901 -0.5581,-0.94778 -0.9746,-1.33789 l -0,-0.002 -0,-0.002 c -0.3967,-0.36155 -0.8679,-0.65723 -1.4062,-0.88476 l -0,0 c -0.4984,-0.20903 -1.0622,-0.30663 -1.6817,-0.30664 -0.5926,1e-5 -1.1526,0.10008 -1.6699,0.30273 l -0,0 c -0.5261,0.20799 -1.0032,0.5067 -1.4199,0.88867 l -0,0.002 -0,0.002 c -0.4166,0.39011 -0.7454,0.83887 -0.9746,1.33789 l 0,0.004 -0,0.002 c -0.2218,0.50136 -0.334,1.03915 -0.334,1.5957 0,0.55015 0.1125,1.08519 0.334,1.58594 l 0,0.002 0,0.004 c 0.229,0.49855 0.5574,0.94911 0.9746,1.33984 0.1876,0.17482 0.4143,0.31484 0.6367,0.45703 l 0,0.91797 -5.3906,0 0,-0.67187 4.3789,0 -0.6367,-0.8086 c -0.2428,-0.30904 -0.443,-0.64418 -0.6055,-1.00781 -0.2487,-0.56911 -0.3731,-1.16552 -0.3731,-1.80664 0,-0.66391 0.1244,-1.27178 0.3711,-1.83789 l 0,-0.002 c 3e-4,-5.8e-4 -2e-4,-10e-4 0,-0.002 0.2641,-0.59218 0.6326,-1.10871 1.1153,-1.5625 0.4847,-0.45571 1.0332,-0.80585 1.6562,-1.05859 0.5861,-0.23488 1.2294,-0.35546 1.9414,-0.35547 z m -7.8496,13.45899 15.6992,0 0,0.67187 -15.6992,0 z");
|
|
2032
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2033
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2034
|
+
node.setAttribute("fill", "none");
|
|
2035
|
+
wrapper.appendChild(node);
|
|
2036
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x - 6, y));
|
|
2037
|
+
return wrapper;
|
|
2038
|
+
}
|
|
2039
|
+
scorpio(x, y) {
|
|
2040
|
+
const xShift = -9;
|
|
2041
|
+
const yShift = -4;
|
|
2042
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2043
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2044
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2045
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_SCORPIO));
|
|
2046
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2047
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2048
|
+
node.setAttribute("d", "m " + x + ", " + y + " 2.3781101,-2.3781101 2.3781101,2.3781101 0,9.5124404 m -3.1708135,-11.0978471 2.3781101,2.3781101 0,8.719737 m 0.7927034,-9.5124404 2.3781101,-2.3781101 2.37811007,2.3781101 0,9.5124404 m -3.17081347,-11.0978471 2.3781101,2.3781101 0,8.719737 m 0.79270337,-9.5124404 2.37811013,-2.3781101 2.3781101,2.3781101 0,8.719737 1.5854067,1.5854068 m -4.7562202,-11.8905505 2.3781101,2.3781101 0,8.719737 1.5854067,1.5854067 2.3781101,-2.3781101");
|
|
2049
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2050
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2051
|
+
node.setAttribute("fill", "none");
|
|
2052
|
+
wrapper.appendChild(node);
|
|
2053
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2054
|
+
return wrapper;
|
|
2055
|
+
}
|
|
2056
|
+
sagittarius(x, y) {
|
|
2057
|
+
const xShift = 7;
|
|
2058
|
+
const yShift = -9;
|
|
2059
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2060
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2061
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2062
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_SAGITTARIUS));
|
|
2063
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2064
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2065
|
+
node.setAttribute("d", "m " + x + ", " + y + " -17.11444,17.11444 m 17.11444,-17.11444 -3.2089575,1.0696525 -6.417915,0 m 7.4875675,1.0696525 -3.2089575,0 -4.27861,-1.0696525 m 9.6268725,-1.0696525 -1.0696525,3.2089575 0,6.41791504 m -1.0696525,-7.48756754 0,3.2089575 1.0696525,4.27861004 m -8.55722,0 -7.4875675,0 m 6.417915,1.06965246 -3.2089575,0 -3.2089575,-1.06965246 m 7.4875675,0 0,7.48756746 m -1.0696525,-6.417915 0,3.2089575 1.0696525,3.2089575");
|
|
2066
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2067
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2068
|
+
node.setAttribute("fill", "none");
|
|
2069
|
+
wrapper.appendChild(node);
|
|
2070
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x - 12, y));
|
|
2071
|
+
return wrapper;
|
|
2072
|
+
}
|
|
2073
|
+
capricorn(x, y) {
|
|
2074
|
+
const xShift = -9;
|
|
2075
|
+
const yShift = -3;
|
|
2076
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2077
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2078
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2079
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_CAPRICORN));
|
|
2080
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2081
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2082
|
+
node.setAttribute("d", "m " + x + ", " + y + " 1.8047633,-3.6095267 4.5119084,9.0238168 m -4.5119084,-7.2190534 4.5119084,9.0238167 2.707145,-6.3166717 4.5119084,0 2.707145,-0.9023817 0.9023817,-1.8047633 0,-1.8047634 -0.9023817,-1.8047633 -1.8047634,-0.9023817 -0.9023816,0 -1.8047634,0.9023817 -0.9023817,1.8047633 0,1.8047634 0.9023817,2.707145 0.9023817,1.80476336 0.9023817,2.70714504 0,2.707145 -1.8047634,1.8047633 m 1.8047634,-16.2428701 -0.9023817,0.9023817 -0.9023817,1.8047633 0,1.8047634 1.8047634,3.6095267 0.9023816,2.707145 0,2.707145 -0.9023816,1.8047634 -1.8047634,0.9023816");
|
|
2083
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2084
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2085
|
+
node.setAttribute("fill", "none");
|
|
2086
|
+
wrapper.appendChild(node);
|
|
2087
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2088
|
+
return wrapper;
|
|
2089
|
+
}
|
|
2090
|
+
aquarius(x, y) {
|
|
2091
|
+
const xShift = -8;
|
|
2092
|
+
const yShift = -2;
|
|
2093
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2094
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2095
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2096
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_AQUARIUS));
|
|
2097
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2098
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2099
|
+
node.setAttribute("d", "m " + x + ", " + y + " 2.8866035,-2.8866035 3.8488047,1.9244023 m -4.8110059,-0.9622011 3.8488047,1.9244023 2.8866035,-2.8866035 2.8866035,1.9244023 m -3.84880467,-0.9622011 2.88660347,1.9244023 2.8866035,-2.8866035 1.9244024,1.9244023 m -2.8866035,-0.9622011 1.9244023,1.9244023 2.8866035,-2.8866035 m -17.319621,8.6598105 2.8866035,-2.88660348 3.8488047,1.92440238 m -4.8110059,-0.96220121 3.8488047,1.92440231 2.8866035,-2.88660348 2.8866035,1.92440238 m -3.84880467,-0.96220121 2.88660347,1.92440231 2.8866035,-2.88660348 1.9244024,1.92440238 m -2.8866035,-0.96220121 1.9244023,1.92440231 2.8866035,-2.88660348");
|
|
2100
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2101
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2102
|
+
node.setAttribute("fill", "none");
|
|
2103
|
+
wrapper.appendChild(node);
|
|
2104
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2105
|
+
return wrapper;
|
|
2106
|
+
}
|
|
2107
|
+
pisces(x, y) {
|
|
2108
|
+
const xShift = -8;
|
|
2109
|
+
const yShift = -8;
|
|
2110
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2111
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2112
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2113
|
+
wrapper.setAttribute("id", this.getSignWrapperId(this.settings.SYMBOL_PISCES));
|
|
2114
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2115
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2116
|
+
node.setAttribute("d", "m " + x + ", " + y + " 4,2 2,2 1,3 0,3 -1,3 -2,2 -4,2 m 0,-17 3,1 2,1 2,2 1,3 m 0,3 -1,3 -2,2 -2,1 -3,1 m 16,-17 -3,1 -2,1 -2,2 -1,3 m 0,3 1,3 2,2 2,1 3,1 m 0,-17 -4,2 -2,2 -1,3 0,3 1,3 2,2 4,2 m -17,-9 18,0 m -18,1 18,0");
|
|
2117
|
+
node.setAttribute("stroke", this.settings.SIGNS_COLOR);
|
|
2118
|
+
node.setAttribute("stroke-width", this.settings.SIGNS_STROKE.toString());
|
|
2119
|
+
node.setAttribute("fill", "none");
|
|
2120
|
+
wrapper.appendChild(node);
|
|
2121
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2122
|
+
return wrapper;
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Draw As symbol
|
|
2126
|
+
*/
|
|
2127
|
+
ascendant(x, y) {
|
|
2128
|
+
const xShift = 12;
|
|
2129
|
+
const yShift = -2;
|
|
2130
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2131
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2132
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2133
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2134
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2135
|
+
node.setAttribute("d", "m " + x + ", " + y + " -0.563078,-1.1261527 -1.689228,-0.5630765 -1.689229,0 -1.68923,0.5630765 -0.563076,1.1261527 0.563076,1.12615272 1.126154,0.56307636 2.815381,0.56307635 1.126152,0.56307647 0.563078,1.1261526 0,0.5630763 -0.563078,1.1261528 -1.689228,0.5630764 -1.689229,0 -1.68923,-0.5630764 -0.563076,-1.1261528 m -6.756916,-10.135374 -4.504611,11.8246032 m 4.504611,-11.8246032 4.504611,11.8246032 m -7.3199925,-3.94153457 5.6307625,0");
|
|
2136
|
+
node.setAttribute("stroke", this.settings.SYMBOL_AXIS_FONT_COLOR);
|
|
2137
|
+
node.setAttribute("stroke-width", (this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2138
|
+
node.setAttribute("fill", "none");
|
|
2139
|
+
wrapper.appendChild(node);
|
|
2140
|
+
return wrapper;
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Draw Ds symbol
|
|
2144
|
+
*/
|
|
2145
|
+
descendant(x, y) {
|
|
2146
|
+
const xShift = 22;
|
|
2147
|
+
const yShift = -1;
|
|
2148
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2149
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2150
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2151
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2152
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2153
|
+
node.setAttribute("d", "m " + x + ", " + y + " -0.5625,-1.125 -1.6875,-0.5625 -1.6875,0 -1.6875,0.5625 -0.5625,1.125 0.5625,1.125 1.125,0.5625 2.8125,0.5625 1.125,0.5625 0.5625,1.125 0,0.5625 -0.5625,1.125 -1.6875,0.5625 -1.6875,0 -1.6875,-0.5625 -0.5625,-1.125 m -11.25,-10.125 0,11.8125 m 0,-11.8125 3.9375,0 1.6875,0.5625 1.125,1.125 0.5625,1.125 0.5625,1.6875 0,2.8125 -0.5625,1.6875 -0.5625,1.125 -1.125,1.125 -1.6875,0.5625 -3.9375,0");
|
|
2154
|
+
node.setAttribute("stroke", this.settings.SYMBOL_AXIS_FONT_COLOR);
|
|
2155
|
+
node.setAttribute("stroke-width", (this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2156
|
+
node.setAttribute("fill", "none");
|
|
2157
|
+
wrapper.appendChild(node);
|
|
2158
|
+
return wrapper;
|
|
2159
|
+
}
|
|
2160
|
+
/**
|
|
2161
|
+
* Draw MC symbol
|
|
2162
|
+
*/
|
|
2163
|
+
mediumCoeli(x, y) {
|
|
2164
|
+
const xShift = 19;
|
|
2165
|
+
const yShift = -4;
|
|
2166
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2167
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2168
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2169
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2170
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2171
|
+
node.setAttribute("d", "m " + x + ", " + y + " -1.004085,-1.0040845 -1.004084,-0.5020423 -1.506127,0 -1.004085,0.5020423 -1.004084,1.0040845 -0.502043,1.50612689 0,1.00408458 0.502043,1.50612683 1.004084,1.0040846 1.004085,0.5020423 1.506127,0 1.004084,-0.5020423 1.004085,-1.0040846 m -17.57148,-9.0367612 0,10.5428881 m 0,-10.5428881 4.016338,10.5428881 m 4.016338,-10.5428881 -4.016338,10.5428881 m 4.016338,-10.5428881 0,10.5428881");
|
|
2172
|
+
node.setAttribute("stroke", this.settings.SYMBOL_AXIS_FONT_COLOR);
|
|
2173
|
+
node.setAttribute("stroke-width", (this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2174
|
+
node.setAttribute("fill", "none");
|
|
2175
|
+
wrapper.appendChild(node);
|
|
2176
|
+
return wrapper;
|
|
2177
|
+
}
|
|
2178
|
+
/**
|
|
2179
|
+
* Draw IC symbol
|
|
2180
|
+
*/
|
|
2181
|
+
immumCoeli(x, y) {
|
|
2182
|
+
const xShift = 19;
|
|
2183
|
+
const yShift = 2;
|
|
2184
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2185
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2186
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2187
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2188
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2189
|
+
node.setAttribute("d", "m " + x + ", " + y + " -1.208852,-1.2088514 -1.208851,-0.6044258 -1.813278,0 -1.208852,0.6044258 -1.20885,1.2088514 -0.604426,1.81327715 0,1.20885135 0.604426,1.8132772 1.20885,1.2088513 1.208852,0.6044259 1.813278,0 1.208851,-0.6044259 1.208852,-1.2088513 m -11.4840902,-10.8796629 0,12.6929401");
|
|
2190
|
+
node.setAttribute("stroke", this.settings.SYMBOL_AXIS_FONT_COLOR);
|
|
2191
|
+
node.setAttribute("stroke-width", (this.settings.SYMBOL_AXIS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2192
|
+
node.setAttribute("fill", "none");
|
|
2193
|
+
wrapper.appendChild(node);
|
|
2194
|
+
return wrapper;
|
|
2195
|
+
}
|
|
2196
|
+
number1(x, y) {
|
|
2197
|
+
const xShift = 0;
|
|
2198
|
+
const yShift = -3;
|
|
2199
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2200
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2201
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2202
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_1));
|
|
2203
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2204
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2205
|
+
node.setAttribute("d", "m" + x + ", " + y + " -2.5128753,7.7578884 1.00515009,0 m 3.01545031,-9.5832737 -1.0051501,1.8253853 -2.51287527,7.7578884 m 3.51802537,-9.5832737 -3.01545031,9.5832737 m 3.01545031,-9.5832737 -1.5077251,1.3690388 -1.50772521,0.9126929 -1.00515009,0.4563463 m 2.5128753,-0.9126927 -1.00515016,0.4563464 -1.50772514,0.4563463");
|
|
2206
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2207
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2208
|
+
node.setAttribute("fill", "none");
|
|
2209
|
+
wrapper.appendChild(node);
|
|
2210
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2211
|
+
return wrapper;
|
|
2212
|
+
}
|
|
2213
|
+
number2(x, y) {
|
|
2214
|
+
const xShift = -2;
|
|
2215
|
+
const yShift = -3;
|
|
2216
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2217
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2218
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2219
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_2));
|
|
2220
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2221
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2222
|
+
node.setAttribute("d", "m" + x + ", " + y + " 0,-0.4545454 0.4545454,0 0,0.9090909 -0.9090909,0 0,-0.9090909 0.4545455,-0.9090909 0.4545454,-0.4545455 1.36363637,-0.4545454 1.36363633,0 1.3636364,0.4545454 0.4545455,0.9090909 0,0.9090909 -0.4545455,0.909091 -0.9090909,0.9090909 -4.5454546,2.72727269 -0.9090909,0.90909091 -0.9090909,1.8181818 m 6.8181818,-9.0909091 0.4545455,0.9090909 0,0.9090909 -0.4545455,0.909091 -0.9090909,0.9090909 -1.36363633,0.9090909 m 1.36363633,-5 0.4545455,0.4545454 0.4545454,0.9090909 0,0.9090909 -0.4545454,0.909091 -0.9090909,0.9090909 -3.6363637,2.72727269 m -1.3636363,1.81818181 0.4545454,-0.4545454 0.9090909,0 2.27272732,0.4545454 2.27272728,0 0.4545454,-0.4545454 m -5,0 2.27272732,0.9090909 2.27272728,0 m -4.5454546,-0.9090909 2.27272732,1.3636363 1.36363638,0 0.9090909,-0.4545454 0.4545454,-0.9090909 0,-0.4545455");
|
|
2223
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2224
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2225
|
+
node.setAttribute("fill", "none");
|
|
2226
|
+
wrapper.appendChild(node);
|
|
2227
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2228
|
+
return wrapper;
|
|
2229
|
+
}
|
|
2230
|
+
number3(x, y) {
|
|
2231
|
+
const xShift = -2;
|
|
2232
|
+
const yShift = -3;
|
|
2233
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2234
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2235
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2236
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_3));
|
|
2237
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2238
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2239
|
+
node.setAttribute("d", "m" + x + ", " + y + " 0,-0.4545454 0.45454549,0 0,0.9090909 -0.90909089,0 0,-0.9090909 0.4545454,-0.9090909 0.45454549,-0.4545455 1.36363636,-0.4545454 1.36363635,0 1.3636364,0.4545454 0.4545454,0.9090909 0,0.9090909 -0.4545454,0.909091 -0.4545455,0.4545454 -0.9090909,0.4545455 -1.36363635,0.4545454 m 2.27272725,-4.0909091 0.4545455,0.9090909 0,0.9090909 -0.4545455,0.909091 -0.4545454,0.4545454 m -0.4545455,-3.6363636 0.4545455,0.4545454 0.4545454,0.9090909 0,0.9090909 -0.4545454,0.909091 -0.9090909,0.9090909 -0.90909095,0.4545454 m -0.9090909,0 0.9090909,0 1.36363635,0.4545455 0.4545455,0.45454542 0.4545454,0.90909091 0,1.36363637 -0.4545454,0.9090909 -0.9090909,0.4545455 -1.3636364,0.4545454 -1.3636364,0 -1.3636363,-0.4545454 -0.4545455,-0.4545455 -0.4545454,-0.9090909 0,-0.90909091 0.9090909,0 0,0.90909091 -0.4545455,0 0,-0.45454546 m 5,-1.81818182 0.4545455,0.90909091 0,1.36363637 -0.4545455,0.9090909 m -1.36363635,-4.0909091 0.90909095,0.4545455 0.4545454,0.90909088 0,1.81818182 -0.4545454,0.9090909 -0.45454549,0.4545455 -0.90909091,0.4545454");
|
|
2240
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2241
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2242
|
+
node.setAttribute("fill", "none");
|
|
2243
|
+
wrapper.appendChild(node);
|
|
2244
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2245
|
+
return wrapper;
|
|
2246
|
+
}
|
|
2247
|
+
number4(x, y) {
|
|
2248
|
+
const xShift = 1;
|
|
2249
|
+
const yShift = -4;
|
|
2250
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2251
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2252
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2253
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_4));
|
|
2254
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2255
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2256
|
+
node.setAttribute("d", "m" + x + ", " + y + " -2.28678383,7.7750651 0.91471356,0 m 2.74414057,-9.6044922 -0.9147135,1.8294271 -2.28678386,7.7750651 m 3.20149736,-9.6044922 -2.74414057,9.6044922 m 2.74414057,-9.6044922 -7.3177083,6.8603516 7.3177083,0");
|
|
2257
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2258
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2259
|
+
node.setAttribute("fill", "none");
|
|
2260
|
+
wrapper.appendChild(node);
|
|
2261
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2262
|
+
return wrapper;
|
|
2263
|
+
}
|
|
2264
|
+
number5(x, y) {
|
|
2265
|
+
const xShift = -2;
|
|
2266
|
+
const yShift = -5;
|
|
2267
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2268
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2269
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2270
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_5));
|
|
2271
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2272
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2273
|
+
node.setAttribute("d", "m" + x + ", " + y + " -2.27272725,4.5454545 m 2.27272725,-4.5454545 4.54545455,0 m -4.54545455,0.4545454 3.63636365,0 m -4.0909091,0.4545455 2.2727273,0 1.8181818,-0.4545455 0.9090909,-0.4545454 m -6.8181818,4.5454545 0.4545454,-0.4545454 1.3636364,-0.4545455 1.36363636,0 1.36363634,0.4545455 0.4545455,0.4545454 0.4545454,0.90909092 0,1.36363638 -0.4545454,1.3636364 -0.9090909,0.9090909 -1.81818185,0.4545454 -1.36363635,0 -0.9090909,-0.4545454 -0.4545455,-0.4545455 -0.4545454,-0.9090909 0,-0.9090909 0.9090909,0 0,0.9090909 -0.4545455,0 0,-0.45454545 m 5,-2.72727275 0.4545455,0.90909092 0,1.36363638 -0.4545455,1.3636364 -0.9090909,0.9090909 m -0.45454544,-5.4545455 0.90909094,0.4545455 0.4545454,0.9090909 0,1.8181818 -0.4545454,1.3636364 -0.90909094,0.9090909 -0.90909091,0.4545454");
|
|
2274
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2275
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2276
|
+
node.setAttribute("fill", "none");
|
|
2277
|
+
wrapper.appendChild(node);
|
|
2278
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2279
|
+
return wrapper;
|
|
2280
|
+
}
|
|
2281
|
+
number6(x, y) {
|
|
2282
|
+
const xShift = 3;
|
|
2283
|
+
const yShift = -3;
|
|
2284
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2285
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2286
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2287
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_6));
|
|
2288
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2289
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2290
|
+
node.setAttribute("d", "m" + x + ", " + y + " 0,-0.4545455 -0.4545455,0 0,0.9090909 0.9090909,0 0,-0.9090909 -0.4545454,-0.9090909 -0.909091,-0.4545454 -1.3636363,0 -1.36363638,0.4545454 -0.90909092,0.9090909 -0.9090909,1.3636364 -0.4545455,1.3636364 -0.4545454,1.81818178 0,1.36363636 0.4545454,1.36363636 0.4545455,0.4545455 0.9090909,0.4545454 1.36363637,0 1.36363633,-0.4545454 0.9090909,-0.9090909 0.4545455,-0.90909096 0,-1.36363636 -0.4545455,-0.90909088 -0.4545454,-0.4545455 -0.9090909,-0.4545454 -1.36363638,0 -0.90909092,0.4545454 -0.4545454,0.4545455 -0.4545455,0.90909088 m 1.36363636,-4.54545458 -0.90909086,1.3636364 -0.4545455,1.3636364 -0.4545455,1.81818178 0,1.81818182 0.4545455,0.9090909 m 4.0909091,-0.4545454 0.4545454,-0.90909096 0,-1.36363636 -0.4545454,-0.90909088 m -0.9090909,-5 -0.90909093,0.4545454 -0.90909091,1.3636364 -0.45454546,0.9090909 -0.4545454,1.3636364 -0.4545455,1.81818178 0,2.27272732 0.4545455,0.9090909 0.4545454,0.4545454 m 1.36363637,0 0.90909093,-0.4545454 0.4545454,-0.4545455 0.4545455,-1.36363636 0,-1.81818182 -0.4545455,-0.90909092 -0.4545454,-0.4545454");
|
|
2291
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2292
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2293
|
+
node.setAttribute("fill", "none");
|
|
2294
|
+
wrapper.appendChild(node);
|
|
2295
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2296
|
+
return wrapper;
|
|
2297
|
+
}
|
|
2298
|
+
number7(x, y) {
|
|
2299
|
+
const xShift = -4;
|
|
2300
|
+
const yShift = -4;
|
|
2301
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2302
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2303
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2304
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_7));
|
|
2305
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2306
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2307
|
+
node.setAttribute("d", "m" + x + ", " + y + " -0.9090909,2.7272727 m 6.8181818,-2.7272727 -0.4545454,1.3636363 -0.909091,1.3636364 -1.8181818,2.2727273 -0.90909088,1.36363633 -0.45454546,1.36363637 -0.45454545,1.8181818 m 0.90909091,-3.63636362 -0.90909091,1.81818182 -0.45454546,1.8181818 m 4.09090905,-6.8181818 -2.72727268,2.72727272 -0.90909091,1.36363637 -0.45454546,0.90909091 -0.45454545,1.8181818 0.90909091,0 m -1.36363641,-8.1818182 1.36363641,-1.3636363 0.90909091,0 2.27272728,1.3636363 m -3.63636365,-0.9090909 1.36363637,0 2.27272728,0.9090909 m -4.5454546,0 0.90909095,-0.4545454 1.36363637,0 2.27272728,0.4545454 0.9090909,0 0.4545455,-0.4545454 0.4545454,-0.9090909");
|
|
2308
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2309
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2310
|
+
node.setAttribute("fill", "none");
|
|
2311
|
+
wrapper.appendChild(node);
|
|
2312
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2313
|
+
return wrapper;
|
|
2314
|
+
}
|
|
2315
|
+
number8(x, y) {
|
|
2316
|
+
const xShift = -1;
|
|
2317
|
+
const yShift = -5;
|
|
2318
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2319
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2320
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2321
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_8));
|
|
2322
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2323
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2324
|
+
node.setAttribute("d", "m" + x + ", " + y + " -1.3631244,0.4543748 -0.4543748,0.4543748 -0.4543748,0.9087496 0,1.3631244 0.4543748,0.9087496 0.9087496,0.4543748 1.3631244,0 1.3631244,-0.4543748 0.9087496,-0.4543748 0.4543748,-0.9087496 0,-1.3631244 -0.4543748,-0.9087496 -0.9087496,-0.4543748 -1.8174992,0 m 0.9087496,0 -2.271874,0.4543748 m 0,0.4543748 -0.4543748,0.9087496 0,1.8174992 0.4543748,0.4543748 m -0.4543748,0 1.3631244,0.4543748 m 0.4543748,0 1.8174992,-0.4543748 m 0.4543748,-0.4543748 0.4543748,-0.9087496 0,-1.3631244 -0.4543748,-0.9087496 m 0.4543748,0 -1.8174992,-0.4543748 m -0.9087496,0 -0.9087496,0.9087496 -0.4543748,0.9087496 0,1.8174992 0.4543748,0.9087496 m 1.3631244,0 0.9087496,-0.4543748 0.4543748,-0.4543748 0.4543748,-0.9087496 0,-1.8174992 -0.4543748,-0.9087496 m -2.7262488,4.543748 -1.8174992,0.4543748 -0.9087496,0.90874964 -0.4543748,0.9087496 0,1.36312436 0.4543748,0.9087496 1.3631244,0.4543748 1.8174992,0 1.8174992,-0.4543748 0.4543748,-0.4543748 0.4543748,-0.9087496 0,-1.36312436 -0.4543748,-0.9087496 -0.4543748,-0.45437484 -0.9087496,-0.4543748 m -0.9087496,0 -2.271874,0.4543748 m 0.4543748,0 -0.9087496,0.90874964 -0.4543748,0.9087496 0,1.36312436 0.4543748,0.9087496 m -0.4543748,0 2.271874,0.4543748 2.7262488,-0.4543748 m 0,-0.4543748 0.4543748,-0.9087496 0,-1.36312436 -0.4543748,-0.9087496 m 0,-0.45437484 -1.3631244,-0.4543748 m -0.9087496,0 -0.9087496,0.4543748 -0.9087496,0.90874964 -0.4543748,0.9087496 0,1.36312436 0.4543748,0.9087496 0.4543748,0.4543748 m 1.8174992,0 0.9087496,-0.4543748 0.4543748,-0.4543748 0.4543748,-0.9087496 0,-1.81749916 -0.4543748,-0.90874964 -0.4543748,-0.4543748");
|
|
2325
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2326
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2327
|
+
node.setAttribute("fill", "none");
|
|
2328
|
+
wrapper.appendChild(node);
|
|
2329
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2330
|
+
return wrapper;
|
|
2331
|
+
}
|
|
2332
|
+
number9(x, y) {
|
|
2333
|
+
const xShift = 1;
|
|
2334
|
+
const yShift = -2;
|
|
2335
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2336
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2337
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2338
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_9));
|
|
2339
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2340
|
+
const node = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2341
|
+
node.setAttribute("d", "m" + x + ", " + y + " -0.4545455,0.9090909 -0.4545454,0.4545455 -0.9090909,0.45454542 -1.36363638,0 -0.90909092,-0.45454542 -0.4545454,-0.4545455 -0.4545455,-0.9090909 0,-1.3636364 0.4545455,-0.9090909 0.90909086,-0.9090909 1.36363637,-0.4545454 1.36363637,0 0.9090909,0.4545454 0.4545455,0.4545455 0.4545454,1.3636363 0,1.3636364 -0.4545454,1.81818182 -0.4545455,1.36363637 -0.9090909,1.36363641 -0.9090909,0.9090909 -1.36363638,0.4545454 -1.36363632,0 -0.909091,-0.4545454 -0.4545454,-0.9090909 0,-0.90909096 0.9090909,0 0,0.90909096 -0.4545455,0 0,-0.4545455 m 1.3636364,-3.1818182 -0.4545454,-0.9090909 0,-1.3636364 0.4545454,-0.9090909 m 4.0909091,-0.4545454 0.4545455,0.9090909 0,1.8181818 -0.4545455,1.81818182 -0.4545455,1.36363637 -0.9090909,1.36363641 m -1.81818178,-2.72727278 -0.45454546,-0.45454542 -0.45454546,-0.9090909 0,-1.8181819 0.45454546,-1.3636363 0.45454546,-0.4545455 0.90909091,-0.4545454 m 1.36363637,0 0.4545454,0.4545454 0.4545455,0.9090909 0,2.2727273 -0.4545455,1.81818182 -0.4545454,1.36363637 -0.4545455,0.90909091 -0.90909087,1.3636364 -0.90909091,0.4545454");
|
|
2342
|
+
node.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2343
|
+
node.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2344
|
+
node.setAttribute("fill", "none");
|
|
2345
|
+
wrapper.appendChild(node);
|
|
2346
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2347
|
+
return wrapper;
|
|
2348
|
+
}
|
|
2349
|
+
number10(x, y) {
|
|
2350
|
+
const xShift = -3;
|
|
2351
|
+
const yShift = -3.5;
|
|
2352
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2353
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2354
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2355
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_10));
|
|
2356
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2357
|
+
const one = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2358
|
+
one.setAttribute("d", "m" + x + ", " + y + " -2.28795747,7.7790553 0.91518297,0 m 2.7455489,-9.6094213 -0.9151829,1.830366 -2.28795748,7.7790553 m 3.20314038,-9.6094213 -2.7455489,9.6094213 m 2.7455489,-9.6094213 -1.3727744,1.3727745 -1.3727745,0.915183 -0.91518297,0.4575915 m 2.28795747,-0.915183 -0.91518301,0.4575915 -1.37277446,0.4575915");
|
|
2359
|
+
one.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2360
|
+
one.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2361
|
+
one.setAttribute("fill", "none");
|
|
2362
|
+
wrapper.appendChild(one);
|
|
2363
|
+
const numberXShift = 6.5;
|
|
2364
|
+
const numberYShift = -1.5;
|
|
2365
|
+
const zero = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2366
|
+
zero.setAttribute("d", "m" + (x + numberXShift) + ", " + (y + numberYShift) + " -1.36363638,0.4545454 -0.90909092,0.9090909 -0.9090909,1.3636364 -0.4545455,1.3636364 -0.4545454,1.81818178 0,1.36363636 0.4545454,1.36363636 0.4545455,0.4545455 0.9090909,0.4545454 0.90909092,0 1.36363638,-0.4545454 0.9090909,-0.9090909 0.9090909,-1.36363641 0.4545455,-1.36363637 0.4545454,-1.81818182 0,-1.3636364 -0.4545454,-1.3636363 -0.4545455,-0.4545455 -0.9090909,-0.4545454 -0.9090909,0 m -1.36363638,0.9090909 -0.90909092,0.9090909 -0.4545454,0.9090909 -0.4545455,1.3636364 -0.4545455,1.81818178 0,1.81818182 0.4545455,0.9090909 m 3.1818182,0 0.9090909,-0.9090909 0.4545454,-0.90909091 0.4545455,-1.36363637 0.4545455,-1.81818182 0,-1.8181818 -0.4545455,-0.9090909 m -1.8181818,-0.9090909 -0.90909093,0.4545454 -0.90909091,1.3636364 -0.45454546,0.9090909 -0.4545454,1.3636364 -0.4545455,1.81818178 0,2.27272732 0.4545455,0.9090909 0.4545454,0.4545454 m 0.90909092,0 0.90909091,-0.4545454 0.90909087,-1.3636364 0.4545455,-0.90909091 0.4545454,-1.36363637 0.4545455,-1.81818182 0,-2.2727273 -0.4545455,-0.9090909 -0.4545454,-0.4545454");
|
|
2367
|
+
zero.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2368
|
+
zero.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2369
|
+
zero.setAttribute("fill", "none");
|
|
2370
|
+
wrapper.appendChild(zero);
|
|
2371
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2372
|
+
return wrapper;
|
|
2373
|
+
}
|
|
2374
|
+
number11(x, y) {
|
|
2375
|
+
const xShift = -3;
|
|
2376
|
+
const yShift = -3;
|
|
2377
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2378
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2379
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2380
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_11));
|
|
2381
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2382
|
+
const one = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2383
|
+
one.setAttribute("d", "m" + x + ", " + y + " -2.28795747,7.7790553 0.91518297,0 m 2.7455489,-9.6094213 -0.9151829,1.830366 -2.28795748,7.7790553 m 3.20314038,-9.6094213 -2.7455489,9.6094213 m 2.7455489,-9.6094213 -1.3727744,1.3727745 -1.3727745,0.915183 -0.91518297,0.4575915 m 2.28795747,-0.915183 -0.91518301,0.4575915 -1.37277446,0.4575915");
|
|
2384
|
+
one.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2385
|
+
one.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2386
|
+
one.setAttribute("fill", "none");
|
|
2387
|
+
wrapper.appendChild(one);
|
|
2388
|
+
const numberXShift = 6;
|
|
2389
|
+
const numberYShift = 0;
|
|
2390
|
+
const one2 = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2391
|
+
one2.setAttribute("d", "m" + (x + numberXShift) + ", " + (y + numberYShift) + " -2.28795747,7.7790553 0.91518297,0 m 2.7455489,-9.6094213 -0.9151829,1.830366 -2.28795748,7.7790553 m 3.20314038,-9.6094213 -2.7455489,9.6094213 m 2.7455489,-9.6094213 -1.3727744,1.3727745 -1.3727745,0.915183 -0.91518297,0.4575915 m 2.28795747,-0.915183 -0.91518301,0.4575915 -1.37277446,0.4575915");
|
|
2392
|
+
one2.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2393
|
+
one2.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2394
|
+
one2.setAttribute("fill", "none");
|
|
2395
|
+
wrapper.appendChild(one2);
|
|
2396
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2397
|
+
return wrapper;
|
|
2398
|
+
}
|
|
2399
|
+
number12(x, y) {
|
|
2400
|
+
const xShift = -3;
|
|
2401
|
+
const yShift = -3;
|
|
2402
|
+
x = Math.round(x + xShift * this.settings.SYMBOL_SCALE);
|
|
2403
|
+
y = Math.round(y + yShift * this.settings.SYMBOL_SCALE);
|
|
2404
|
+
const wrapper = document.createElementNS(this.context.root.namespaceURI, "g");
|
|
2405
|
+
wrapper.setAttribute("id", this.getHouseIdWrapper(this.settings.SYMBOL_CUSP_12));
|
|
2406
|
+
wrapper.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2407
|
+
const one = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2408
|
+
one.setAttribute("d", "m" + x + ", " + y + " -2.28795747,7.7790553 0.91518297,0 m 2.7455489,-9.6094213 -0.9151829,1.830366 -2.28795748,7.7790553 m 3.20314038,-9.6094213 -2.7455489,9.6094213 m 2.7455489,-9.6094213 -1.3727744,1.3727745 -1.3727745,0.915183 -0.91518297,0.4575915 m 2.28795747,-0.915183 -0.91518301,0.4575915 -1.37277446,0.4575915");
|
|
2409
|
+
one.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2410
|
+
one.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2411
|
+
one.setAttribute("fill", "none");
|
|
2412
|
+
wrapper.appendChild(one);
|
|
2413
|
+
const numberXShift = 4;
|
|
2414
|
+
const numberYShift = 1;
|
|
2415
|
+
const two = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2416
|
+
two.setAttribute("d", "m" + (x + numberXShift) + ", " + (y + numberYShift) + " 0,-0.4545454 0.4545454,0 0,0.9090909 -0.9090909,0 0,-0.9090909 0.4545455,-0.9090909 0.4545454,-0.4545455 1.36363637,-0.4545454 1.36363633,0 1.3636364,0.4545454 0.4545455,0.9090909 0,0.9090909 -0.4545455,0.909091 -0.9090909,0.9090909 -4.5454546,2.72727269 -0.9090909,0.90909091 -0.9090909,1.8181818 m 6.8181818,-9.0909091 0.4545455,0.9090909 0,0.9090909 -0.4545455,0.909091 -0.9090909,0.9090909 -1.36363633,0.9090909 m 1.36363633,-5 0.4545455,0.4545454 0.4545454,0.9090909 0,0.9090909 -0.4545454,0.909091 -0.9090909,0.9090909 -3.6363637,2.72727269 m -1.3636363,1.81818181 0.4545454,-0.4545454 0.9090909,0 2.27272732,0.4545454 2.27272728,0 0.4545454,-0.4545454 m -5,0 2.27272732,0.9090909 2.27272728,0 m -4.5454546,-0.9090909 2.27272732,1.3636363 1.36363638,0 0.9090909,-0.4545454 0.4545454,-0.9090909 0,-0.4545455");
|
|
2417
|
+
two.setAttribute("stroke", this.settings.CUSPS_FONT_COLOR);
|
|
2418
|
+
two.setAttribute("stroke-width", (this.settings.CUSPS_STROKE * this.settings.SYMBOL_SCALE).toString());
|
|
2419
|
+
two.setAttribute("fill", "none");
|
|
2420
|
+
wrapper.appendChild(two);
|
|
2421
|
+
if (this.settings.ADD_CLICK_AREA) wrapper.appendChild(this.createRectForClick(x, y));
|
|
2422
|
+
return wrapper;
|
|
2423
|
+
}
|
|
2424
|
+
/**
|
|
2425
|
+
* Draw circular sector
|
|
2426
|
+
*
|
|
2427
|
+
* @param {int} x - circle x center position
|
|
2428
|
+
* @param {int} y - circle y center position
|
|
2429
|
+
* @param {int} radius - circle radius in px
|
|
2430
|
+
* @param {int} a1 - angleFrom in degree
|
|
2431
|
+
* @param {int} a2 - angleTo in degree
|
|
2432
|
+
* @param {int} thickness - from outside to center in px
|
|
2433
|
+
*
|
|
2434
|
+
* @return {SVGElement} segment
|
|
2435
|
+
*
|
|
2436
|
+
* @see SVG Path arc: https://www.w3.org/TR/SVG/paths.html#PathData
|
|
2437
|
+
*/
|
|
2438
|
+
segment(x, y, radius, a1, a2, thickness, lFlag, sFlag) {
|
|
2439
|
+
const LARGE_ARC_FLAG = lFlag || 0;
|
|
2440
|
+
const SWEET_FLAG = sFlag || 0;
|
|
2441
|
+
a1 = (this.settings.SHIFT_IN_DEGREES - a1) % 360 * Math.PI / 180;
|
|
2442
|
+
a2 = (this.settings.SHIFT_IN_DEGREES - a2) % 360 * Math.PI / 180;
|
|
2443
|
+
const segment = document.createElementNS(this.context.root.namespaceURI, "path");
|
|
2444
|
+
segment.setAttribute("d", "M " + (x + thickness * Math.cos(a1)) + ", " + (y + thickness * Math.sin(a1)) + " l " + (radius - thickness) * Math.cos(a1) + ", " + (radius - thickness) * Math.sin(a1) + " A " + radius + ", " + radius + ",0 ," + LARGE_ARC_FLAG + ", " + SWEET_FLAG + ", " + (x + radius * Math.cos(a2)) + ", " + (y + radius * Math.sin(a2)) + " l " + (radius - thickness) * -Math.cos(a2) + ", " + (radius - thickness) * -Math.sin(a2) + " A " + thickness + ", " + thickness + ",0 ," + LARGE_ARC_FLAG + ", 1, " + (x + thickness * Math.cos(a1)) + ", " + (y + thickness * Math.sin(a1)));
|
|
2445
|
+
segment.setAttribute("fill", "none");
|
|
2446
|
+
return segment;
|
|
2447
|
+
}
|
|
2448
|
+
/**
|
|
2449
|
+
* Draw line in circle
|
|
2450
|
+
*
|
|
2451
|
+
* @param {int} x1
|
|
2452
|
+
* @param {int} y2
|
|
2453
|
+
* @param {int} x2
|
|
2454
|
+
* @param {int} y2
|
|
2455
|
+
* @param {String} color - HTML rgb
|
|
2456
|
+
*
|
|
2457
|
+
* @return {SVGElement} line
|
|
2458
|
+
*/
|
|
2459
|
+
line(x1, y1, x2, y2) {
|
|
2460
|
+
const line = document.createElementNS(this.context.root.namespaceURI, "line");
|
|
2461
|
+
line.setAttribute("x1", x1.toString());
|
|
2462
|
+
line.setAttribute("y1", y1.toString());
|
|
2463
|
+
line.setAttribute("x2", x2.toString());
|
|
2464
|
+
line.setAttribute("y2", y2.toString());
|
|
2465
|
+
return line;
|
|
2466
|
+
}
|
|
2467
|
+
/**
|
|
2468
|
+
* Draw a circle
|
|
2469
|
+
*
|
|
2470
|
+
* @param {int} cx
|
|
2471
|
+
* @param {int} cy
|
|
2472
|
+
* @param {int} radius
|
|
2473
|
+
*
|
|
2474
|
+
* @return {SVGElement} circle
|
|
2475
|
+
*/
|
|
2476
|
+
circle(cx, cy, radius) {
|
|
2477
|
+
const circle = document.createElementNS(this.context.root.namespaceURI, "circle");
|
|
2478
|
+
circle.setAttribute("cx", cx.toString());
|
|
2479
|
+
circle.setAttribute("cy", cy.toString());
|
|
2480
|
+
circle.setAttribute("r", radius.toString());
|
|
2481
|
+
circle.setAttribute("fill", "none");
|
|
2482
|
+
return circle;
|
|
2483
|
+
}
|
|
2484
|
+
/**
|
|
2485
|
+
* Draw a text
|
|
2486
|
+
*
|
|
2487
|
+
* @param {String} text
|
|
2488
|
+
* @param {int} x
|
|
2489
|
+
* @param {int} y
|
|
2490
|
+
* @param {String} size - etc. "13px"
|
|
2491
|
+
* @param {String} color - HTML rgb
|
|
2492
|
+
*
|
|
2493
|
+
* @return {SVGElement} text
|
|
2494
|
+
*/
|
|
2495
|
+
text(txt, x, y, size, color) {
|
|
2496
|
+
const text = document.createElementNS(this.context.root.namespaceURI, "text");
|
|
2497
|
+
text.setAttribute("x", x.toString());
|
|
2498
|
+
text.setAttribute("y", y.toString());
|
|
2499
|
+
text.setAttribute("font-size", size);
|
|
2500
|
+
text.setAttribute("fill", color);
|
|
2501
|
+
text.setAttribute("font-family", "serif");
|
|
2502
|
+
text.setAttribute("dominant-baseline", "central");
|
|
2503
|
+
text.appendChild(document.createTextNode(txt));
|
|
2504
|
+
text.setAttribute("transform", "translate(" + -x * (this.settings.SYMBOL_SCALE - 1) + "," + -y * (this.settings.SYMBOL_SCALE - 1) + ") scale(" + this.settings.SYMBOL_SCALE + ")");
|
|
2505
|
+
return text;
|
|
2506
|
+
}
|
|
2507
|
+
};
|
|
2508
|
+
var svg_default = SVG;
|
|
2509
|
+
|
|
2510
|
+
//#endregion
|
|
2511
|
+
//#region src/chart.ts
|
|
2512
|
+
/**
|
|
2513
|
+
* Displays astrology charts.
|
|
2514
|
+
*
|
|
2515
|
+
* @class
|
|
2516
|
+
* @public
|
|
2517
|
+
* @constructor
|
|
2518
|
+
* @param {String} elementId - root DOMElement
|
|
2519
|
+
* @param {int} width
|
|
2520
|
+
* @param {int} height
|
|
2521
|
+
* @param {Object} settings
|
|
2522
|
+
*/
|
|
2523
|
+
var Chart = class {
|
|
2524
|
+
paper;
|
|
2525
|
+
cx;
|
|
2526
|
+
cy;
|
|
2527
|
+
radius;
|
|
2528
|
+
settings;
|
|
2529
|
+
constructor(elementId, width, height, settings) {
|
|
2530
|
+
const chartSettings = settings_default;
|
|
2531
|
+
if (settings != null) {
|
|
2532
|
+
Object.assign(chartSettings, settings);
|
|
2533
|
+
if (!("COLORS_SIGNS" in settings)) chartSettings.COLORS_SIGNS = [
|
|
2534
|
+
settings_default.COLOR_ARIES,
|
|
2535
|
+
settings_default.COLOR_TAURUS,
|
|
2536
|
+
settings_default.COLOR_GEMINI,
|
|
2537
|
+
settings_default.COLOR_CANCER,
|
|
2538
|
+
settings_default.COLOR_LEO,
|
|
2539
|
+
settings_default.COLOR_VIRGO,
|
|
2540
|
+
settings_default.COLOR_LIBRA,
|
|
2541
|
+
settings_default.COLOR_SCORPIO,
|
|
2542
|
+
settings_default.COLOR_SAGITTARIUS,
|
|
2543
|
+
settings_default.COLOR_CAPRICORN,
|
|
2544
|
+
settings_default.COLOR_AQUARIUS,
|
|
2545
|
+
settings_default.COLOR_PISCES
|
|
2546
|
+
];
|
|
2547
|
+
}
|
|
2548
|
+
if (elementId !== "" && document.getElementById(elementId) == null) {
|
|
2549
|
+
const paper = document.createElement("div");
|
|
2550
|
+
paper.setAttribute("id", elementId);
|
|
2551
|
+
document.body.appendChild(paper);
|
|
2552
|
+
}
|
|
2553
|
+
this.paper = new svg_default(elementId, width, height, chartSettings);
|
|
2554
|
+
this.cx = this.paper.width / 2;
|
|
2555
|
+
this.cy = this.paper.height / 2;
|
|
2556
|
+
this.radius = this.paper.height / 2 - chartSettings.MARGIN;
|
|
2557
|
+
this.settings = chartSettings;
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Display radix horoscope
|
|
2561
|
+
*
|
|
2562
|
+
* @param {Object} data
|
|
2563
|
+
* @example
|
|
2564
|
+
* {
|
|
2565
|
+
* "points":{"Moon":[0], "Sun":[30], ... },
|
|
2566
|
+
* "cusps":[300, 340, 30, 60, 75, 90, 116, 172, 210, 236, 250, 274]
|
|
2567
|
+
* }
|
|
2568
|
+
*
|
|
2569
|
+
* @return {Radix} radix
|
|
2570
|
+
*/
|
|
2571
|
+
radix(data) {
|
|
2572
|
+
const radix = new radix_default(this.paper, this.cx, this.cy, this.radius, data, this.settings);
|
|
2573
|
+
radix.drawBg();
|
|
2574
|
+
radix.drawUniverse();
|
|
2575
|
+
radix.drawRuler();
|
|
2576
|
+
radix.drawPoints();
|
|
2577
|
+
radix.drawCusps();
|
|
2578
|
+
radix.drawAxis();
|
|
2579
|
+
radix.drawCircles();
|
|
2580
|
+
return radix;
|
|
2581
|
+
}
|
|
2582
|
+
/**
|
|
2583
|
+
* Scale chart
|
|
2584
|
+
*
|
|
2585
|
+
* @param {int} factor
|
|
2586
|
+
*/
|
|
2587
|
+
scale(factor) {
|
|
2588
|
+
this.paper.root.setAttribute("transform", "translate(" + -this.cx * (factor - 1) + "," + -this.cy * (factor - 1) + ") scale(" + factor + ")");
|
|
2589
|
+
}
|
|
2590
|
+
/**
|
|
2591
|
+
* Draw the symbol on the axis.
|
|
2592
|
+
* For debug only.
|
|
2593
|
+
*
|
|
2594
|
+
*/
|
|
2595
|
+
calibrate() {
|
|
2596
|
+
let positions;
|
|
2597
|
+
let circle;
|
|
2598
|
+
let line;
|
|
2599
|
+
const startRadius = 60;
|
|
2600
|
+
const planets = [
|
|
2601
|
+
"Sun",
|
|
2602
|
+
"Moon",
|
|
2603
|
+
"Mercury",
|
|
2604
|
+
"Venus",
|
|
2605
|
+
"Mars",
|
|
2606
|
+
"Jupiter",
|
|
2607
|
+
"Saturn",
|
|
2608
|
+
"Uranus",
|
|
2609
|
+
"Neptune",
|
|
2610
|
+
"Pluto",
|
|
2611
|
+
"Chiron",
|
|
2612
|
+
"Lilith",
|
|
2613
|
+
"NNode"
|
|
2614
|
+
];
|
|
2615
|
+
for (let planet = 0; planet < planets.length; planet++) {
|
|
2616
|
+
positions = getPointPosition(this.cx, this.cy, this.radius * 2, planet * 30, this.settings);
|
|
2617
|
+
line = this.paper.line(this.cx, this.cy, positions.x, positions.y);
|
|
2618
|
+
line.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
2619
|
+
this.paper.root.appendChild(line);
|
|
2620
|
+
circle = this.paper.circle(this.cx, this.cy, startRadius + startRadius * planet);
|
|
2621
|
+
circle.setAttribute("stroke", this.settings.LINE_COLOR);
|
|
2622
|
+
circle.setAttribute("stroke-width", "1");
|
|
2623
|
+
this.paper.root.appendChild(circle);
|
|
2624
|
+
}
|
|
2625
|
+
for (let n = 0, ln = planets.length; n < ln; n++) {
|
|
2626
|
+
const radius = startRadius + startRadius * n;
|
|
2627
|
+
for (let i = 0; i < 12; i++) {
|
|
2628
|
+
positions = getPointPosition(this.cx, this.cy, radius, i * 30, this.settings);
|
|
2629
|
+
circle = this.paper.circle(positions.x, positions.y, this.settings.COLLISION_RADIUS * this.settings.SYMBOL_SCALE);
|
|
2630
|
+
circle.setAttribute("stroke", "red");
|
|
2631
|
+
circle.setAttribute("stroke-width", "1");
|
|
2632
|
+
this.paper.root.appendChild(circle);
|
|
2633
|
+
this.paper.root.appendChild(this.paper.getSymbol(planets[n], positions.x, positions.y));
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
return this;
|
|
2637
|
+
}
|
|
2638
|
+
};
|
|
2639
|
+
var chart_default = Chart;
|
|
2640
|
+
|
|
2641
|
+
//#endregion
|
|
2642
|
+
export { aspect_default as AspectCalculator, chart_default as Chart, degreeToRadians, getPointPosition, radiansToDegree, validate };
|
|
2643
|
+
//# sourceMappingURL=index.mjs.map
|