kerykeion 4.12.3__py3-none-any.whl → 4.14.2__py3-none-any.whl
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.
Potentially problematic release.
This version of kerykeion might be problematic. Click here for more details.
- kerykeion/__init__.py +1 -0
- kerykeion/aspects/aspects_utils.py +10 -9
- kerykeion/aspects/natal_aspects.py +9 -1
- kerykeion/aspects/synastry_aspects.py +10 -2
- kerykeion/astrological_subject.py +89 -42
- kerykeion/charts/charts_utils.py +389 -24
- kerykeion/charts/kerykeion_chart_svg.py +79 -417
- kerykeion/charts/templates/chart.xml +76 -58
- kerykeion/enums.py +1 -0
- kerykeion/ephemeris_data.py +174 -0
- kerykeion/fetch_geonames.py +2 -3
- kerykeion/kr_types/chart_types.py +3 -9
- kerykeion/kr_types/kr_literals.py +2 -2
- kerykeion/kr_types/kr_models.py +45 -25
- kerykeion/kr_types/settings_models.py +4 -1
- kerykeion/settings/kr.config.json +19 -5
- kerykeion/utilities.py +6 -2
- {kerykeion-4.12.3.dist-info → kerykeion-4.14.2.dist-info}/METADATA +1 -1
- kerykeion-4.14.2.dist-info/RECORD +33 -0
- kerykeion-4.12.3.dist-info/RECORD +0 -32
- {kerykeion-4.12.3.dist-info → kerykeion-4.14.2.dist-info}/LICENSE +0 -0
- {kerykeion-4.12.3.dist-info → kerykeion-4.14.2.dist-info}/WHEEL +0 -0
- {kerykeion-4.12.3.dist-info → kerykeion-4.14.2.dist-info}/entry_points.txt +0 -0
|
@@ -27,7 +27,12 @@ from kerykeion.charts.charts_utils import (
|
|
|
27
27
|
draw_degree_ring,
|
|
28
28
|
draw_transit_ring,
|
|
29
29
|
draw_first_circle,
|
|
30
|
-
draw_second_circle
|
|
30
|
+
draw_second_circle,
|
|
31
|
+
draw_third_circle,
|
|
32
|
+
draw_aspect_grid,
|
|
33
|
+
draw_houses_cusps_and_text_number,
|
|
34
|
+
draw_aspect_transit_grid,
|
|
35
|
+
draw_moon_phase
|
|
31
36
|
)
|
|
32
37
|
from pathlib import Path
|
|
33
38
|
from scour.scour import scourString
|
|
@@ -98,7 +103,6 @@ class KerykeionChartSVG:
|
|
|
98
103
|
location: str
|
|
99
104
|
geolat: float
|
|
100
105
|
geolon: float
|
|
101
|
-
zoom: int
|
|
102
106
|
zodiac: tuple
|
|
103
107
|
template: str
|
|
104
108
|
|
|
@@ -303,93 +307,6 @@ class KerykeionChartSVG:
|
|
|
303
307
|
|
|
304
308
|
return output
|
|
305
309
|
|
|
306
|
-
def _makeHouses(self, r):
|
|
307
|
-
path = ""
|
|
308
|
-
|
|
309
|
-
xr = 12
|
|
310
|
-
for i in range(xr):
|
|
311
|
-
# check transit
|
|
312
|
-
if self.chart_type == "Transit" or self.chart_type == "Synastry":
|
|
313
|
-
dropin = 160
|
|
314
|
-
roff = 72
|
|
315
|
-
t_roff = 36
|
|
316
|
-
else:
|
|
317
|
-
dropin = self.c3
|
|
318
|
-
roff = self.c1
|
|
319
|
-
|
|
320
|
-
# offset is negative desc houses_degree_ut[6]
|
|
321
|
-
offset = (int(self.user.houses_degree_ut[int(xr / 2)]) / -1) + int(self.user.houses_degree_ut[i])
|
|
322
|
-
x1 = sliceToX(0, (r - dropin), offset) + dropin
|
|
323
|
-
y1 = sliceToY(0, (r - dropin), offset) + dropin
|
|
324
|
-
x2 = sliceToX(0, r - roff, offset) + roff
|
|
325
|
-
y2 = sliceToY(0, r - roff, offset) + roff
|
|
326
|
-
|
|
327
|
-
if i < (xr - 1):
|
|
328
|
-
text_offset = offset + int(degreeDiff(self.user.houses_degree_ut[(i + 1)], self.user.houses_degree_ut[i]) / 2)
|
|
329
|
-
else:
|
|
330
|
-
text_offset = offset + int(degreeDiff(self.user.houses_degree_ut[0], self.user.houses_degree_ut[(xr - 1)]) / 2)
|
|
331
|
-
|
|
332
|
-
# mc, asc, dsc, ic
|
|
333
|
-
if i == 0:
|
|
334
|
-
linecolor = self.planets_settings[12]["color"]
|
|
335
|
-
elif i == 9:
|
|
336
|
-
linecolor = self.planets_settings[13]["color"]
|
|
337
|
-
elif i == 6:
|
|
338
|
-
linecolor = self.planets_settings[14]["color"]
|
|
339
|
-
elif i == 3:
|
|
340
|
-
linecolor = self.planets_settings[15]["color"]
|
|
341
|
-
else:
|
|
342
|
-
linecolor = self.chart_colors_settings["houses_radix_line"]
|
|
343
|
-
|
|
344
|
-
# Transit houses lines.
|
|
345
|
-
if self.chart_type == "Transit" or self.chart_type == "Synastry":
|
|
346
|
-
# Degrees for point zero.
|
|
347
|
-
|
|
348
|
-
zeropoint = 360 - self.user.houses_degree_ut[6]
|
|
349
|
-
t_offset = zeropoint + self.t_user.houses_degree_ut[i]
|
|
350
|
-
if t_offset > 360:
|
|
351
|
-
t_offset = t_offset - 360
|
|
352
|
-
t_x1 = sliceToX(0, (r - t_roff), t_offset) + t_roff
|
|
353
|
-
t_y1 = sliceToY(0, (r - t_roff), t_offset) + t_roff
|
|
354
|
-
t_x2 = sliceToX(0, r, t_offset)
|
|
355
|
-
t_y2 = sliceToY(0, r, t_offset)
|
|
356
|
-
if i < 11:
|
|
357
|
-
t_text_offset = t_offset + int(degreeDiff(self.t_user.houses_degree_ut[(i + 1)], self.t_user.houses_degree_ut[i]) / 2)
|
|
358
|
-
else:
|
|
359
|
-
t_text_offset = t_offset + int(degreeDiff(self.t_user.houses_degree_ut[0], self.t_user.houses_degree_ut[11]) / 2)
|
|
360
|
-
# linecolor
|
|
361
|
-
if i == 0 or i == 9 or i == 6 or i == 3:
|
|
362
|
-
t_linecolor = linecolor
|
|
363
|
-
else:
|
|
364
|
-
t_linecolor = self.chart_colors_settings["houses_transit_line"]
|
|
365
|
-
xtext = sliceToX(0, (r - 8), t_text_offset) + 8
|
|
366
|
-
ytext = sliceToY(0, (r - 8), t_text_offset) + 8
|
|
367
|
-
|
|
368
|
-
if self.chart_type == "Transit":
|
|
369
|
-
path = path + '<text style="fill: #00f; fill-opacity: 0; font-size: 14px"><tspan x="' + str(xtext - 3) + '" y="' + str(ytext + 3) + '">' + str(i + 1) + "</tspan></text>"
|
|
370
|
-
path = f"{path}<line x1='{str(t_x1)}' y1='{str(t_y1)}' x2='{str(t_x2)}' y2='{str(t_y2)}' style='stroke: {t_linecolor}; stroke-width: 2px; stroke-opacity:0;'/>"
|
|
371
|
-
|
|
372
|
-
else:
|
|
373
|
-
path = path + '<text style="fill: #00f; fill-opacity: .4; font-size: 14px"><tspan x="' + str(xtext - 3) + '" y="' + str(ytext + 3) + '">' + str(i + 1) + "</tspan></text>"
|
|
374
|
-
path = f"{path}<line x1='{str(t_x1)}' y1='{str(t_y1)}' x2='{str(t_x2)}' y2='{str(t_y2)}' style='stroke: {t_linecolor}; stroke-width: 2px; stroke-opacity:.3;'/>"
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
# if transit
|
|
378
|
-
if self.chart_type == "Transit" or self.chart_type == "Synastry":
|
|
379
|
-
dropin = 84
|
|
380
|
-
elif self.chart_type == "ExternalNatal":
|
|
381
|
-
dropin = 100
|
|
382
|
-
# Natal
|
|
383
|
-
else:
|
|
384
|
-
dropin = 48
|
|
385
|
-
|
|
386
|
-
xtext = sliceToX(0, (r - dropin), text_offset) + dropin # was 132
|
|
387
|
-
ytext = sliceToY(0, (r - dropin), text_offset) + dropin # was 132
|
|
388
|
-
path = f'{path}<line x1="{x1}" y1="{y1}" x2="{x2}" y2="{y2}" style="stroke: {linecolor}; stroke-width: 2px; stroke-dasharray:3,2; stroke-opacity:.4;"/>'
|
|
389
|
-
path = path + '<text style="fill: #f00; fill-opacity: .6; font-size: 14px"><tspan x="' + str(xtext - 3) + '" y="' + str(ytext + 3) + '">' + str(i + 1) + "</tspan></text>"
|
|
390
|
-
|
|
391
|
-
return path
|
|
392
|
-
|
|
393
310
|
def _calculate_elements_points_from_planets(self):
|
|
394
311
|
"""
|
|
395
312
|
Calculate chart element points from a planet.
|
|
@@ -608,8 +525,12 @@ class KerykeionChartSVG:
|
|
|
608
525
|
|
|
609
526
|
else:
|
|
610
527
|
scale = 1
|
|
611
|
-
|
|
612
|
-
|
|
528
|
+
|
|
529
|
+
planet_details = self.user[self.available_planets_setting[i]["name"].lower()]
|
|
530
|
+
|
|
531
|
+
output += f'<g kr:node="ChartPoint" kr:house="{planet_details['house']}" kr:sign="{planet_details['sign']}" kr:slug="{planet_details['name']}" transform="translate(-{12 * scale},-{12 * scale}) scale({scale})">'
|
|
532
|
+
output += f'<use x="{planet_x * (1/scale)}" y="{planet_y * (1/scale)}" xlink:href="#{self.available_planets_setting[i]["name"]}" />'
|
|
533
|
+
output += f'</g>'
|
|
613
534
|
|
|
614
535
|
# make transit degut and display planets
|
|
615
536
|
if self.chart_type == "Transit" or self.chart_type == "Synastry":
|
|
@@ -751,269 +672,37 @@ class KerykeionChartSVG:
|
|
|
751
672
|
|
|
752
673
|
return output
|
|
753
674
|
|
|
754
|
-
def _makePatterns(self):
|
|
755
|
-
"""
|
|
756
|
-
* Stellium: At least four planets linked together in a series of continuous conjunctions.
|
|
757
|
-
* Grand trine: Three trine aspects together.
|
|
758
|
-
* Grand cross: Two pairs of opposing planets squared to each other.
|
|
759
|
-
* T-Square: Two planets in opposition squared to a third.
|
|
760
|
-
* Yod: Two qunicunxes together joined by a sextile.
|
|
761
|
-
"""
|
|
762
|
-
conj = {} # 0
|
|
763
|
-
opp = {} # 10
|
|
764
|
-
sq = {} # 5
|
|
765
|
-
tr = {} # 6
|
|
766
|
-
qc = {} # 9
|
|
767
|
-
sext = {} # 3
|
|
768
|
-
for i in range(len(self.available_planets_setting)):
|
|
769
|
-
a = self.points_deg_ut[i]
|
|
770
|
-
qc[i] = {}
|
|
771
|
-
sext[i] = {}
|
|
772
|
-
opp[i] = {}
|
|
773
|
-
sq[i] = {}
|
|
774
|
-
tr[i] = {}
|
|
775
|
-
conj[i] = {}
|
|
776
|
-
# skip some points
|
|
777
|
-
n = self.available_planets_setting[i]["name"]
|
|
778
|
-
if n == "earth" or n == "True_Node" or n == "osc. apogee" or n == "intp. apogee" or n == "intp. perigee":
|
|
779
|
-
continue
|
|
780
|
-
if n == "Dsc" or n == "Ic":
|
|
781
|
-
continue
|
|
782
|
-
for j in range(len(self.available_planets_setting)):
|
|
783
|
-
# skip some points
|
|
784
|
-
n = self.available_planets_setting[j]["name"]
|
|
785
|
-
if n == "earth" or n == "True_Node" or n == "osc. apogee" or n == "intp. apogee" or n == "intp. perigee":
|
|
786
|
-
continue
|
|
787
|
-
if n == "Dsc" or n == "Ic":
|
|
788
|
-
continue
|
|
789
|
-
b = self.points_deg_ut[j]
|
|
790
|
-
delta = float(degreeDiff(a, b))
|
|
791
|
-
# check for opposition
|
|
792
|
-
xa = float(self.aspects_settings[10]["degree"]) - float(self.aspects_settings[10]["orb"])
|
|
793
|
-
xb = float(self.aspects_settings[10]["degree"]) + float(self.aspects_settings[10]["orb"])
|
|
794
|
-
if xa <= delta <= xb:
|
|
795
|
-
opp[i][j] = True
|
|
796
|
-
# check for conjunction
|
|
797
|
-
xa = float(self.aspects_settings[0]["degree"]) - float(self.aspects_settings[0]["orb"])
|
|
798
|
-
xb = float(self.aspects_settings[0]["degree"]) + float(self.aspects_settings[0]["orb"])
|
|
799
|
-
if xa <= delta <= xb:
|
|
800
|
-
conj[i][j] = True
|
|
801
|
-
# check for squares
|
|
802
|
-
xa = float(self.aspects_settings[5]["degree"]) - float(self.aspects_settings[5]["orb"])
|
|
803
|
-
xb = float(self.aspects_settings[5]["degree"]) + float(self.aspects_settings[5]["orb"])
|
|
804
|
-
if xa <= delta <= xb:
|
|
805
|
-
sq[i][j] = True
|
|
806
|
-
# check for qunicunxes
|
|
807
|
-
xa = float(self.aspects_settings[9]["degree"]) - float(self.aspects_settings[9]["orb"])
|
|
808
|
-
xb = float(self.aspects_settings[9]["degree"]) + float(self.aspects_settings[9]["orb"])
|
|
809
|
-
if xa <= delta <= xb:
|
|
810
|
-
qc[i][j] = True
|
|
811
|
-
# check for sextiles
|
|
812
|
-
xa = float(self.aspects_settings[3]["degree"]) - float(self.aspects_settings[3]["orb"])
|
|
813
|
-
xb = float(self.aspects_settings[3]["degree"]) + float(self.aspects_settings[3]["orb"])
|
|
814
|
-
if xa <= delta <= xb:
|
|
815
|
-
sext[i][j] = True
|
|
816
|
-
|
|
817
|
-
yot = {}
|
|
818
|
-
# check for double qunicunxes
|
|
819
|
-
for k, v in qc.items():
|
|
820
|
-
if len(qc[k]) >= 2:
|
|
821
|
-
# check for sextile
|
|
822
|
-
for l, w in qc[k].items():
|
|
823
|
-
for m, x in qc[k].items():
|
|
824
|
-
if m in sext[l]:
|
|
825
|
-
if l > m:
|
|
826
|
-
yot["%s,%s,%s" % (k, m, l)] = [k, m, l]
|
|
827
|
-
else:
|
|
828
|
-
yot["%s,%s,%s" % (k, l, m)] = [k, l, m]
|
|
829
|
-
tsquare = {}
|
|
830
|
-
# check for opposition
|
|
831
|
-
for k, v in opp.items():
|
|
832
|
-
if len(opp[k]) >= 1:
|
|
833
|
-
# check for square
|
|
834
|
-
for l, w in opp[k].items():
|
|
835
|
-
for a, b in sq.items():
|
|
836
|
-
if k in sq[a] and l in sq[a]:
|
|
837
|
-
logging.debug(f"Got tsquare {a} {k} {l}")
|
|
838
|
-
if k > l:
|
|
839
|
-
tsquare[f"{a},{l},{k}"] = f"{self.available_planets_setting[a]['label']} => {self.available_planets_setting[l]['label']}, {self.available_planets_setting[k]['label']}"
|
|
840
|
-
|
|
841
|
-
else:
|
|
842
|
-
tsquare[f"{a},{k},{l}"] = f"{self.available_planets_setting[a]['label']} => {self.available_planets_setting[k]['label']}, {self.available_planets_setting[l]['label']}"
|
|
843
|
-
|
|
844
|
-
stellium = {}
|
|
845
|
-
# check for 4 continuous conjunctions
|
|
846
|
-
for k, v in conj.items():
|
|
847
|
-
if len(conj[k]) >= 1:
|
|
848
|
-
# first conjunction
|
|
849
|
-
for l, m in conj[k].items():
|
|
850
|
-
if len(conj[l]) >= 1:
|
|
851
|
-
for n, o in conj[l].items():
|
|
852
|
-
# skip 1st conj
|
|
853
|
-
if n == k:
|
|
854
|
-
continue
|
|
855
|
-
if len(conj[n]) >= 1:
|
|
856
|
-
# third conjunction
|
|
857
|
-
for p, q in conj[n].items():
|
|
858
|
-
# skip first and second conj
|
|
859
|
-
if p == k or p == n:
|
|
860
|
-
continue
|
|
861
|
-
if len(conj[p]) >= 1:
|
|
862
|
-
# fourth conjunction
|
|
863
|
-
for r, s in conj[p].items():
|
|
864
|
-
# skip conj 1,2,3
|
|
865
|
-
if r == k or r == n or r == p:
|
|
866
|
-
continue
|
|
867
|
-
|
|
868
|
-
l = [k, n, p, r]
|
|
869
|
-
l.sort()
|
|
870
|
-
stellium["%s %s %s %s" % (l[0], l[1], l[2], l[3])] = "%s %s %s %s" % (
|
|
871
|
-
self.available_planets_setting[l[0]]["label"],
|
|
872
|
-
self.available_planets_setting[l[1]]["label"],
|
|
873
|
-
self.available_planets_setting[l[2]]["label"],
|
|
874
|
-
self.available_planets_setting[l[3]]["label"],
|
|
875
|
-
)
|
|
876
|
-
# print yots
|
|
877
|
-
out = '<g transform="translate(-30,380)">'
|
|
878
|
-
if len(yot) >= 1:
|
|
879
|
-
y = 0
|
|
880
|
-
for k, v in yot.items():
|
|
881
|
-
out += f'<text y="{y}" style="fill:{self.chart_colors_settings["paper_0"]}; font-size: 12px;">{"Yot"}</text>'
|
|
882
|
-
|
|
883
|
-
# first planet symbol
|
|
884
|
-
out += f'<g transform="translate(20,{y})">'
|
|
885
|
-
out += f'<use transform="scale(0.4)" x="0" y="-20" xlink:href="#{self.available_planets_setting[yot[k][0]]["name"]}" /></g>'
|
|
886
|
-
|
|
887
|
-
# second planet symbol
|
|
888
|
-
out += f'<g transform="translate(30,{y})">'
|
|
889
|
-
out += f'<use transform="scale(0.4)" x="0" y="-20" xlink:href="#{self.available_planets_setting[yot[k][1]]["name"]}" /></g>'
|
|
890
|
-
|
|
891
|
-
# third planet symbol
|
|
892
|
-
out += f'<g transform="translate(40,{y})">'
|
|
893
|
-
out += f'<use transform="scale(0.4)" x="0" y="-20" xlink:href="#{self.available_planets_setting[yot[k][2]]["name"]}" /></g>'
|
|
894
|
-
|
|
895
|
-
y = y + 14
|
|
896
|
-
# finalize
|
|
897
|
-
out += "</g>"
|
|
898
|
-
# return out
|
|
899
|
-
return ""
|
|
900
|
-
|
|
901
675
|
# Aspect and aspect grid functions for natal type charts.
|
|
902
|
-
def
|
|
676
|
+
def _draw_all_aspects_lines(self, r, ar):
|
|
903
677
|
out = ""
|
|
904
|
-
for
|
|
678
|
+
for aspect in self.aspects_list:
|
|
905
679
|
out += draw_aspect_line(
|
|
906
680
|
r=r,
|
|
907
681
|
ar=ar,
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
color=self.aspects_settings[element["aid"]]["color"],
|
|
682
|
+
aspect=aspect,
|
|
683
|
+
color=self.aspects_settings[aspect["aid"]]["color"],
|
|
911
684
|
seventh_house_degree_ut=self.user.seventh_house.abs_pos
|
|
912
685
|
)
|
|
913
686
|
|
|
914
687
|
return out
|
|
915
688
|
|
|
916
|
-
def _makeAspectGrid(self, r):
|
|
917
|
-
out = ""
|
|
918
|
-
style = "stroke:%s; stroke-width: 1px; stroke-opacity:.6; fill:none" % (self.chart_colors_settings["paper_0"])
|
|
919
|
-
xindent = 380
|
|
920
|
-
yindent = 468
|
|
921
|
-
box = 14
|
|
922
|
-
revr = list(range(len(self.available_planets_setting)))
|
|
923
|
-
revr.reverse()
|
|
924
|
-
counter = 0
|
|
925
|
-
for a in revr:
|
|
926
|
-
counter += 1
|
|
927
|
-
out += f'<rect x="{xindent}" y="{yindent}" width="{box}" height="{box}" style="{style}"/>'
|
|
928
|
-
out += f'<use transform="scale(0.4)" x="{(xindent+2)*2.5}" y="{(yindent+1)*2.5}" xlink:href="#{self.available_planets_setting[a]["name"]}" />'
|
|
929
|
-
|
|
930
|
-
xindent = xindent + box
|
|
931
|
-
yindent = yindent - box
|
|
932
|
-
revr2 = list(range(a))
|
|
933
|
-
revr2.reverse()
|
|
934
|
-
xorb = xindent
|
|
935
|
-
yorb = yindent + box
|
|
936
|
-
for b in revr2:
|
|
937
|
-
out += f'<rect x="{xorb}" y="{yorb}" width="{box}" height="{box}" style="{style}"/>'
|
|
938
|
-
|
|
939
|
-
xorb = xorb + box
|
|
940
|
-
for element in self.aspects_list:
|
|
941
|
-
if (element["p1"] == a and element["p2"] == b) or (element["p1"] == b and element["p2"] == a):
|
|
942
|
-
out += f'<use x="{xorb-box+1}" y="{yorb+1}" xlink:href="#orb{element["aspect_degrees"]}" />'
|
|
943
|
-
|
|
944
|
-
return out
|
|
945
|
-
|
|
946
689
|
# Aspect and aspect grid functions for transit type charts
|
|
947
|
-
def
|
|
690
|
+
def _draw_all_transit_aspects_lines(self, r, ar):
|
|
948
691
|
out = ""
|
|
949
692
|
|
|
950
693
|
self.aspects_list = SynastryAspects(self.user, self.t_user, new_settings_file=self.new_settings_file).relevant_aspects
|
|
951
694
|
|
|
952
|
-
for
|
|
695
|
+
for aspect in self.aspects_list:
|
|
953
696
|
out += draw_aspect_line(
|
|
954
697
|
r=r,
|
|
955
698
|
ar=ar,
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
color=self.aspects_settings[element["aid"]]["color"],
|
|
699
|
+
aspect=aspect,
|
|
700
|
+
color=self.aspects_settings[aspect["aid"]]["color"],
|
|
959
701
|
seventh_house_degree_ut=self.user.seventh_house.abs_pos
|
|
960
702
|
)
|
|
961
703
|
|
|
962
704
|
return out
|
|
963
705
|
|
|
964
|
-
def _makeAspectTransitGrid(self, r):
|
|
965
|
-
out = '<g transform="translate(500,310)">'
|
|
966
|
-
out += f'<text y="-15" x="0" style="fill:{self.chart_colors_settings["paper_0"]}; font-size: 14px;">{self.language_settings["aspects"]}:</text>'
|
|
967
|
-
|
|
968
|
-
line = 0
|
|
969
|
-
nl = 0
|
|
970
|
-
|
|
971
|
-
for i in range(len(self.aspects_list)):
|
|
972
|
-
if i == 12:
|
|
973
|
-
nl = 100
|
|
974
|
-
|
|
975
|
-
line = 0
|
|
976
|
-
|
|
977
|
-
elif i == 24:
|
|
978
|
-
nl = 200
|
|
979
|
-
|
|
980
|
-
line = 0
|
|
981
|
-
|
|
982
|
-
elif i == 36:
|
|
983
|
-
nl = 300
|
|
984
|
-
|
|
985
|
-
line = 0
|
|
986
|
-
|
|
987
|
-
elif i == 48:
|
|
988
|
-
nl = 400
|
|
989
|
-
|
|
990
|
-
# When there are more than 60 aspects, the text is moved up
|
|
991
|
-
if len(self.aspects_list) > 60:
|
|
992
|
-
line = -1 * (len(self.aspects_list) - 60) * 14
|
|
993
|
-
else:
|
|
994
|
-
line = 0
|
|
995
|
-
|
|
996
|
-
out += f'<g transform="translate({nl},{line})">'
|
|
997
|
-
|
|
998
|
-
# first planet symbol
|
|
999
|
-
out += f'<use transform="scale(0.4)" x="0" y="3" xlink:href="#{self.planets_settings[self.aspects_list[i]["p1"]]["name"]}" />'
|
|
1000
|
-
|
|
1001
|
-
# aspect symbol
|
|
1002
|
-
out += f'<use x="15" y="0" xlink:href="#orb{self.aspects_settings[self.aspects_list[i]["aid"]]["degree"]}" />'
|
|
1003
|
-
|
|
1004
|
-
# second planet symbol
|
|
1005
|
-
out += '<g transform="translate(30,0)">'
|
|
1006
|
-
out += '<use transform="scale(0.4)" x="0" y="3" xlink:href="#%s" />' % (self.planets_settings[self.aspects_list[i]["p2"]]["name"])
|
|
1007
|
-
|
|
1008
|
-
out += "</g>"
|
|
1009
|
-
# difference in degrees
|
|
1010
|
-
out += f'<text y="8" x="45" style="fill:{self.chart_colors_settings["paper_0"]}; font-size: 10px;">{convert_decimal_to_degree_string(self.aspects_list[i]["orbit"])}</text>'
|
|
1011
|
-
# line
|
|
1012
|
-
out += "</g>"
|
|
1013
|
-
line = line + 14
|
|
1014
|
-
out += "</g>"
|
|
1015
|
-
return out
|
|
1016
|
-
|
|
1017
706
|
def _makePlanetGrid(self):
|
|
1018
707
|
li = 10
|
|
1019
708
|
offset = 0
|
|
@@ -1102,7 +791,7 @@ class KerykeionChartSVG:
|
|
|
1102
791
|
out += end_of_line
|
|
1103
792
|
return out
|
|
1104
793
|
|
|
1105
|
-
def
|
|
794
|
+
def _makeHouseGrid(self):
|
|
1106
795
|
"""
|
|
1107
796
|
Generate SVG code for a grid of astrological houses.
|
|
1108
797
|
|
|
@@ -1157,21 +846,18 @@ class KerykeionChartSVG:
|
|
|
1157
846
|
# Calculate the elements points
|
|
1158
847
|
self._calculate_elements_points_from_planets()
|
|
1159
848
|
|
|
1160
|
-
# Viewbox and sizing
|
|
1161
|
-
svgHeight = "100%"
|
|
1162
|
-
svgWidth = "100%"
|
|
1163
849
|
rotate = "0"
|
|
1164
|
-
|
|
1165
|
-
# To increase the size of the chart, change the viewbox
|
|
1166
|
-
if self.chart_type == "Natal" or self.chart_type == "ExternalNatal":
|
|
1167
|
-
viewbox = self.chart_settings["basic_chart_viewBox"]
|
|
1168
|
-
else:
|
|
1169
|
-
viewbox = self.chart_settings["wide_chart_viewBox"]
|
|
1170
850
|
|
|
1171
851
|
# template dictionary
|
|
1172
852
|
td: ChartTemplateDictionary = dict() # type: ignore
|
|
1173
853
|
r = 240
|
|
1174
854
|
|
|
855
|
+
# To increase the size of the chart, change the viewbox
|
|
856
|
+
if self.chart_type == "Natal" or self.chart_type == "ExternalNatal":
|
|
857
|
+
td['viewbox'] = self.chart_settings["basic_chart_viewBox"]
|
|
858
|
+
else:
|
|
859
|
+
td['viewbox'] = self.chart_settings["wide_chart_viewBox"]
|
|
860
|
+
|
|
1175
861
|
if self.chart_type == "ExternalNatal":
|
|
1176
862
|
self.c1 = 56
|
|
1177
863
|
self.c2 = 92
|
|
@@ -1189,35 +875,31 @@ class KerykeionChartSVG:
|
|
|
1189
875
|
# circles
|
|
1190
876
|
td["first_circle"] = draw_first_circle(r, self.chart_colors_settings["zodiac_transit_ring_2"], self.chart_type)
|
|
1191
877
|
td["second_circle"] = draw_second_circle(r, self.chart_colors_settings['zodiac_transit_ring_1'], self.chart_colors_settings['paper_1'], self.chart_type)
|
|
878
|
+
td['third_circle'] = draw_third_circle(r, self.chart_colors_settings['zodiac_transit_ring_0'], self.chart_colors_settings['paper_1'], self.chart_type)
|
|
1192
879
|
|
|
1193
|
-
td["
|
|
1194
|
-
td["c3style"] = f"fill: {self.chart_colors_settings['paper_1']}; fill-opacity:.8; stroke: {self.chart_colors_settings['zodiac_transit_ring_0']}; stroke-width: 1px"
|
|
880
|
+
td["makeAspects"] = self._draw_all_transit_aspects_lines(r, (r - 160))
|
|
1195
881
|
|
|
1196
|
-
td["
|
|
1197
|
-
|
|
1198
|
-
|
|
882
|
+
td["makeAspectGrid"] = draw_aspect_transit_grid(
|
|
883
|
+
self.language_settings["aspects"],
|
|
884
|
+
self.aspects_list,
|
|
885
|
+
self.planets_settings,
|
|
886
|
+
self.aspects_settings
|
|
887
|
+
)
|
|
888
|
+
|
|
889
|
+
# Natal, External Natal
|
|
1199
890
|
else:
|
|
1200
891
|
td["transitRing"] = ""
|
|
1201
892
|
td["degreeRing"] = draw_degree_ring(r, self.c1, self.user.seventh_house.abs_pos, self.chart_colors_settings["paper_0"])
|
|
1202
893
|
|
|
1203
894
|
td['first_circle'] = draw_first_circle(r, self.chart_colors_settings["zodiac_radix_ring_2"], self.chart_type, self.c1)
|
|
1204
|
-
|
|
1205
895
|
td["second_circle"] = draw_second_circle(r, self.chart_colors_settings["zodiac_radix_ring_1"], self.chart_colors_settings["paper_1"], self.chart_type, self.c2)
|
|
896
|
+
td['third_circle'] = draw_third_circle(r, self.chart_colors_settings["zodiac_radix_ring_0"], self.chart_colors_settings["paper_1"], self.chart_type, self.c3)
|
|
1206
897
|
|
|
1207
|
-
td["
|
|
1208
|
-
td["
|
|
1209
|
-
|
|
1210
|
-
td["makeAspects"] = self._makeAspects(r, (r - self.c3))
|
|
1211
|
-
td["makeAspectGrid"] = self._makeAspectGrid(r)
|
|
1212
|
-
td["makePatterns"] = self._makePatterns()
|
|
1213
|
-
|
|
898
|
+
td["makeAspects"] = self._draw_all_aspects_lines(r, (r - self.c3))
|
|
899
|
+
td["makeAspectGrid"] = draw_aspect_grid(self.chart_colors_settings['paper_0'], self.available_planets_setting, self.aspects_list)
|
|
900
|
+
|
|
1214
901
|
td["chart_height"] = self.height
|
|
1215
902
|
td["chart_width"] = self.width
|
|
1216
|
-
td["circleX"] = str(0)
|
|
1217
|
-
td["circleY"] = str(0)
|
|
1218
|
-
td["svgWidth"] = str(svgWidth)
|
|
1219
|
-
td["svgHeight"] = str(svgHeight)
|
|
1220
|
-
td["viewbox"] = viewbox
|
|
1221
903
|
|
|
1222
904
|
# Chart Title
|
|
1223
905
|
if self.chart_type == "Synastry":
|
|
@@ -1250,60 +932,11 @@ class KerykeionChartSVG:
|
|
|
1250
932
|
td["bottomLeft3"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.t_user.lunar_phase.moon_phase_name}'
|
|
1251
933
|
td["bottomLeft4"] = f'{self.t_user.perspective_type}'
|
|
1252
934
|
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
lfcx = None
|
|
1259
|
-
lfr = None
|
|
1260
|
-
|
|
1261
|
-
if deg < 90.0:
|
|
1262
|
-
maxr = deg
|
|
1263
|
-
if deg > 80.0:
|
|
1264
|
-
maxr = maxr * maxr
|
|
1265
|
-
lfcx = 20.0 + (deg / 90.0) * (maxr + 10.0)
|
|
1266
|
-
lfr = 10.0 + (deg / 90.0) * maxr
|
|
1267
|
-
lffg = self.chart_colors_settings["lunar_phase_0"]
|
|
1268
|
-
lfbg = self.chart_colors_settings["lunar_phase_1"]
|
|
1269
|
-
|
|
1270
|
-
elif deg < 180.0:
|
|
1271
|
-
maxr = 180.0 - deg
|
|
1272
|
-
if deg < 100.0:
|
|
1273
|
-
maxr = maxr * maxr
|
|
1274
|
-
lfcx = 20.0 + ((deg - 90.0) / 90.0 * (maxr + 10.0)) - (maxr + 10.0)
|
|
1275
|
-
lfr = 10.0 + maxr - ((deg - 90.0) / 90.0 * maxr)
|
|
1276
|
-
lffg = self.chart_colors_settings["lunar_phase_1"]
|
|
1277
|
-
lfbg = self.chart_colors_settings["lunar_phase_0"]
|
|
1278
|
-
|
|
1279
|
-
elif deg < 270.0:
|
|
1280
|
-
maxr = deg - 180.0
|
|
1281
|
-
if deg > 260.0:
|
|
1282
|
-
maxr = maxr * maxr
|
|
1283
|
-
lfcx = 20.0 + ((deg - 180.0) / 90.0 * (maxr + 10.0))
|
|
1284
|
-
lfr = 10.0 + ((deg - 180.0) / 90.0 * maxr)
|
|
1285
|
-
lffg, lfbg = self.chart_colors_settings["lunar_phase_1"], self.chart_colors_settings["lunar_phase_0"]
|
|
1286
|
-
|
|
1287
|
-
elif deg < 361:
|
|
1288
|
-
maxr = 360.0 - deg
|
|
1289
|
-
if deg < 280.0:
|
|
1290
|
-
maxr = maxr * maxr
|
|
1291
|
-
lfcx = 20.0 + ((deg - 270.0) / 90.0 * (maxr + 10.0)) - (maxr + 10.0)
|
|
1292
|
-
lfr = 10.0 + maxr - ((deg - 270.0) / 90.0 * maxr)
|
|
1293
|
-
lffg, lfbg = self.chart_colors_settings["lunar_phase_0"], self.chart_colors_settings["lunar_phase_1"]
|
|
1294
|
-
|
|
1295
|
-
if lffg is None or lfbg is None or lfcx is None or lfr is None:
|
|
1296
|
-
raise KerykeionException("Lunar phase error")
|
|
1297
|
-
|
|
1298
|
-
td["lunar_phase_fg"] = lffg
|
|
1299
|
-
td["lunar_phase_bg"] = lfbg
|
|
1300
|
-
td["lunar_phase_cx"] = lfcx
|
|
1301
|
-
td["lunar_phase_r"] = lfr
|
|
1302
|
-
td["lunar_phase_outline"] = self.chart_colors_settings["lunar_phase_2"]
|
|
1303
|
-
|
|
1304
|
-
# rotation based on latitude
|
|
1305
|
-
td["lunar_phase_rotate"] = -90.0 - self.geolat
|
|
1306
|
-
|
|
935
|
+
td['moon_phase'] = draw_moon_phase(
|
|
936
|
+
self.user.lunar_phase["degrees_between_s_m"],
|
|
937
|
+
self.geolat
|
|
938
|
+
)
|
|
939
|
+
|
|
1307
940
|
# stringlocation
|
|
1308
941
|
if len(self.location) > 35:
|
|
1309
942
|
split = self.location.split(",")
|
|
@@ -1355,7 +988,6 @@ class KerykeionChartSVG:
|
|
|
1355
988
|
td[f"orb_color_{self.aspects_settings[i]['degree']}"] = self.aspects_settings[i]['color']
|
|
1356
989
|
|
|
1357
990
|
# config
|
|
1358
|
-
td["cfgZoom"] = str(self.zoom)
|
|
1359
991
|
td["cfgRotate"] = rotate
|
|
1360
992
|
|
|
1361
993
|
# ---
|
|
@@ -1363,9 +995,38 @@ class KerykeionChartSVG:
|
|
|
1363
995
|
#---
|
|
1364
996
|
|
|
1365
997
|
td["makeZodiac"] = self._draw_zodiac_circle_slices(r)
|
|
1366
|
-
td["makeHousesGrid"] = self.
|
|
1367
|
-
|
|
1368
|
-
|
|
998
|
+
td["makeHousesGrid"] = self._makeHouseGrid()
|
|
999
|
+
|
|
1000
|
+
# Houses Cusps and Number
|
|
1001
|
+
if self.chart_type == "Transit" or self.chart_type == "Synastry":
|
|
1002
|
+
td["makeHouses"] = draw_houses_cusps_and_text_number(
|
|
1003
|
+
r=r,
|
|
1004
|
+
first_subject_houses_list_ut=self.user.houses_degree_ut,
|
|
1005
|
+
standard_house_cusp_color=self.chart_colors_settings["houses_radix_line"],
|
|
1006
|
+
first_house_color=self.planets_settings[12]["color"],
|
|
1007
|
+
tenth_house_color=self.planets_settings[13]["color"],
|
|
1008
|
+
seventh_house_color=self.planets_settings[14]["color"],
|
|
1009
|
+
fourth_house_color=self.planets_settings[15]["color"],
|
|
1010
|
+
c1=self.c1,
|
|
1011
|
+
c3=self.c3,
|
|
1012
|
+
chart_type=self.chart_type,
|
|
1013
|
+
second_subject_houses_list_ut=self.t_user.houses_degree_ut,
|
|
1014
|
+
transit_house_cusp_color=self.chart_colors_settings["houses_transit_line"],
|
|
1015
|
+
)
|
|
1016
|
+
else:
|
|
1017
|
+
td["makeHouses"] = draw_houses_cusps_and_text_number(
|
|
1018
|
+
r=r,
|
|
1019
|
+
first_subject_houses_list_ut=self.user.houses_degree_ut,
|
|
1020
|
+
standard_house_cusp_color=self.chart_colors_settings["houses_radix_line"],
|
|
1021
|
+
first_house_color=self.planets_settings[12]["color"],
|
|
1022
|
+
tenth_house_color=self.planets_settings[13]["color"],
|
|
1023
|
+
seventh_house_color=self.planets_settings[14]["color"],
|
|
1024
|
+
fourth_house_color=self.planets_settings[15]["color"],
|
|
1025
|
+
c1=self.c1,
|
|
1026
|
+
c3=self.c3,
|
|
1027
|
+
chart_type=self.chart_type,
|
|
1028
|
+
)
|
|
1029
|
+
|
|
1369
1030
|
td["makePlanets"] = self._make_planets(r)
|
|
1370
1031
|
td["elements_percentages"] = draw_elements_percentages(
|
|
1371
1032
|
self.language_settings['fire'],
|
|
@@ -1377,6 +1038,7 @@ class KerykeionChartSVG:
|
|
|
1377
1038
|
self.language_settings['water'],
|
|
1378
1039
|
self.water,
|
|
1379
1040
|
)
|
|
1041
|
+
|
|
1380
1042
|
td["makePlanetGrid"] = self._makePlanetGrid()
|
|
1381
1043
|
|
|
1382
1044
|
# Date time String
|