kerykeion 4.14.1__py3-none-any.whl → 4.14.3__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/charts/charts_utils.py +389 -24
- kerykeion/charts/kerykeion_chart_svg.py +80 -424
- kerykeion/charts/templates/chart.xml +69 -58
- kerykeion/kr_types/chart_types.py +1 -8
- kerykeion/kr_types/kr_models.py +35 -22
- kerykeion/kr_types/settings_models.py +2 -0
- {kerykeion-4.14.1.dist-info → kerykeion-4.14.3.dist-info}/METADATA +1 -1
- {kerykeion-4.14.1.dist-info → kerykeion-4.14.3.dist-info}/RECORD +11 -11
- {kerykeion-4.14.1.dist-info → kerykeion-4.14.3.dist-info}/LICENSE +0 -0
- {kerykeion-4.14.1.dist-info → kerykeion-4.14.3.dist-info}/WHEEL +0 -0
- {kerykeion-4.14.1.dist-info → kerykeion-4.14.3.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,275 +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 = f"stroke:{self.chart_colors_settings['paper_0']}; stroke-width: 1px; stroke-opacity:.6; fill:none"
|
|
919
|
-
xindent = 380
|
|
920
|
-
yindent = 468
|
|
921
|
-
box = 14
|
|
922
|
-
counter = 0
|
|
923
|
-
|
|
924
|
-
actual_planets = []
|
|
925
|
-
for planet in self.available_planets_setting:
|
|
926
|
-
if planet.is_active:
|
|
927
|
-
actual_planets.append(planet)
|
|
928
|
-
|
|
929
|
-
first_iteration_revers_planets = actual_planets[::-1]
|
|
930
|
-
for index, a in enumerate(first_iteration_revers_planets):
|
|
931
|
-
counter += 1
|
|
932
|
-
out += f'<rect x="{xindent}" y="{yindent}" width="{box}" height="{box}" style="{style}"/>'
|
|
933
|
-
out += f'<use transform="scale(0.4)" x="{(xindent+2)*2.5}" y="{(yindent+1)*2.5}" xlink:href="#{a["name"]}" />'
|
|
934
|
-
|
|
935
|
-
xindent = xindent + box
|
|
936
|
-
yindent = yindent - box
|
|
937
|
-
|
|
938
|
-
xorb = xindent
|
|
939
|
-
yorb = yindent + box
|
|
940
|
-
|
|
941
|
-
second_iteration_revers_planets = first_iteration_revers_planets[index+1:]
|
|
942
|
-
for b in second_iteration_revers_planets:
|
|
943
|
-
out += f'<rect x="{xorb}" y="{yorb}" width="{box}" height="{box}" style="{style}"/>'
|
|
944
|
-
xorb = xorb + box
|
|
945
|
-
|
|
946
|
-
for element in self.aspects_list:
|
|
947
|
-
if (element["p1"] == a["id"] and element["p2"] == b['id']) or (element["p1"] == b["id"] and element["p2"] == a["id"]):
|
|
948
|
-
out += f'<use x="{xorb-box+1}" y="{yorb+1}" xlink:href="#orb{element["aspect_degrees"]}" />'
|
|
949
|
-
|
|
950
|
-
return out
|
|
951
|
-
|
|
952
689
|
# Aspect and aspect grid functions for transit type charts
|
|
953
|
-
def
|
|
690
|
+
def _draw_all_transit_aspects_lines(self, r, ar):
|
|
954
691
|
out = ""
|
|
955
692
|
|
|
956
693
|
self.aspects_list = SynastryAspects(self.user, self.t_user, new_settings_file=self.new_settings_file).relevant_aspects
|
|
957
694
|
|
|
958
|
-
for
|
|
695
|
+
for aspect in self.aspects_list:
|
|
959
696
|
out += draw_aspect_line(
|
|
960
697
|
r=r,
|
|
961
698
|
ar=ar,
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
color=self.aspects_settings[element["aid"]]["color"],
|
|
699
|
+
aspect=aspect,
|
|
700
|
+
color=self.aspects_settings[aspect["aid"]]["color"],
|
|
965
701
|
seventh_house_degree_ut=self.user.seventh_house.abs_pos
|
|
966
702
|
)
|
|
967
703
|
|
|
968
704
|
return out
|
|
969
705
|
|
|
970
|
-
def _makeAspectTransitGrid(self, r):
|
|
971
|
-
out = '<g transform="translate(500,310)">'
|
|
972
|
-
out += f'<text y="-15" x="0" style="fill:{self.chart_colors_settings["paper_0"]}; font-size: 14px;">{self.language_settings["aspects"]}:</text>'
|
|
973
|
-
|
|
974
|
-
line = 0
|
|
975
|
-
nl = 0
|
|
976
|
-
|
|
977
|
-
for i in range(len(self.aspects_list)):
|
|
978
|
-
if i == 12:
|
|
979
|
-
nl = 100
|
|
980
|
-
|
|
981
|
-
line = 0
|
|
982
|
-
|
|
983
|
-
elif i == 24:
|
|
984
|
-
nl = 200
|
|
985
|
-
|
|
986
|
-
line = 0
|
|
987
|
-
|
|
988
|
-
elif i == 36:
|
|
989
|
-
nl = 300
|
|
990
|
-
|
|
991
|
-
line = 0
|
|
992
|
-
|
|
993
|
-
elif i == 48:
|
|
994
|
-
nl = 400
|
|
995
|
-
|
|
996
|
-
# When there are more than 60 aspects, the text is moved up
|
|
997
|
-
if len(self.aspects_list) > 60:
|
|
998
|
-
line = -1 * (len(self.aspects_list) - 60) * 14
|
|
999
|
-
else:
|
|
1000
|
-
line = 0
|
|
1001
|
-
|
|
1002
|
-
out += f'<g transform="translate({nl},{line})">'
|
|
1003
|
-
|
|
1004
|
-
# first planet symbol
|
|
1005
|
-
out += f'<use transform="scale(0.4)" x="0" y="3" xlink:href="#{self.planets_settings[self.aspects_list[i]["p1"]]["name"]}" />'
|
|
1006
|
-
|
|
1007
|
-
# aspect symbol
|
|
1008
|
-
out += f'<use x="15" y="0" xlink:href="#orb{self.aspects_settings[self.aspects_list[i]["aid"]]["degree"]}" />'
|
|
1009
|
-
|
|
1010
|
-
# second planet symbol
|
|
1011
|
-
out += '<g transform="translate(30,0)">'
|
|
1012
|
-
out += '<use transform="scale(0.4)" x="0" y="3" xlink:href="#%s" />' % (self.planets_settings[self.aspects_list[i]["p2"]]["name"])
|
|
1013
|
-
|
|
1014
|
-
out += "</g>"
|
|
1015
|
-
# difference in degrees
|
|
1016
|
-
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>'
|
|
1017
|
-
# line
|
|
1018
|
-
out += "</g>"
|
|
1019
|
-
line = line + 14
|
|
1020
|
-
out += "</g>"
|
|
1021
|
-
return out
|
|
1022
|
-
|
|
1023
706
|
def _makePlanetGrid(self):
|
|
1024
707
|
li = 10
|
|
1025
708
|
offset = 0
|
|
@@ -1108,7 +791,7 @@ class KerykeionChartSVG:
|
|
|
1108
791
|
out += end_of_line
|
|
1109
792
|
return out
|
|
1110
793
|
|
|
1111
|
-
def
|
|
794
|
+
def _makeHouseGrid(self):
|
|
1112
795
|
"""
|
|
1113
796
|
Generate SVG code for a grid of astrological houses.
|
|
1114
797
|
|
|
@@ -1163,21 +846,18 @@ class KerykeionChartSVG:
|
|
|
1163
846
|
# Calculate the elements points
|
|
1164
847
|
self._calculate_elements_points_from_planets()
|
|
1165
848
|
|
|
1166
|
-
# Viewbox and sizing
|
|
1167
|
-
svgHeight = "100%"
|
|
1168
|
-
svgWidth = "100%"
|
|
1169
849
|
rotate = "0"
|
|
1170
|
-
|
|
1171
|
-
# To increase the size of the chart, change the viewbox
|
|
1172
|
-
if self.chart_type == "Natal" or self.chart_type == "ExternalNatal":
|
|
1173
|
-
viewbox = self.chart_settings["basic_chart_viewBox"]
|
|
1174
|
-
else:
|
|
1175
|
-
viewbox = self.chart_settings["wide_chart_viewBox"]
|
|
1176
850
|
|
|
1177
851
|
# template dictionary
|
|
1178
852
|
td: ChartTemplateDictionary = dict() # type: ignore
|
|
1179
853
|
r = 240
|
|
1180
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
|
+
|
|
1181
861
|
if self.chart_type == "ExternalNatal":
|
|
1182
862
|
self.c1 = 56
|
|
1183
863
|
self.c2 = 92
|
|
@@ -1195,35 +875,31 @@ class KerykeionChartSVG:
|
|
|
1195
875
|
# circles
|
|
1196
876
|
td["first_circle"] = draw_first_circle(r, self.chart_colors_settings["zodiac_transit_ring_2"], self.chart_type)
|
|
1197
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)
|
|
879
|
+
|
|
880
|
+
td["makeAspects"] = self._draw_all_transit_aspects_lines(r, (r - 160))
|
|
1198
881
|
|
|
1199
|
-
td["
|
|
1200
|
-
|
|
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
|
+
)
|
|
1201
888
|
|
|
1202
|
-
|
|
1203
|
-
td["makeAspectGrid"] = self._makeAspectTransitGrid(r)
|
|
1204
|
-
td["makePatterns"] = ""
|
|
889
|
+
# Natal, External Natal
|
|
1205
890
|
else:
|
|
1206
891
|
td["transitRing"] = ""
|
|
1207
892
|
td["degreeRing"] = draw_degree_ring(r, self.c1, self.user.seventh_house.abs_pos, self.chart_colors_settings["paper_0"])
|
|
1208
893
|
|
|
1209
894
|
td['first_circle'] = draw_first_circle(r, self.chart_colors_settings["zodiac_radix_ring_2"], self.chart_type, self.c1)
|
|
1210
|
-
|
|
1211
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)
|
|
1212
897
|
|
|
1213
|
-
td["
|
|
1214
|
-
td["
|
|
1215
|
-
|
|
1216
|
-
td["makeAspects"] = self._makeAspects(r, (r - self.c3))
|
|
1217
|
-
td["makeAspectGrid"] = self._makeAspectGrid(r)
|
|
1218
|
-
td["makePatterns"] = self._makePatterns()
|
|
1219
|
-
|
|
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
|
+
|
|
1220
901
|
td["chart_height"] = self.height
|
|
1221
902
|
td["chart_width"] = self.width
|
|
1222
|
-
td["circleX"] = str(0)
|
|
1223
|
-
td["circleY"] = str(0)
|
|
1224
|
-
td["svgWidth"] = str(svgWidth)
|
|
1225
|
-
td["svgHeight"] = str(svgHeight)
|
|
1226
|
-
td["viewbox"] = viewbox
|
|
1227
903
|
|
|
1228
904
|
# Chart Title
|
|
1229
905
|
if self.chart_type == "Synastry":
|
|
@@ -1256,60 +932,11 @@ class KerykeionChartSVG:
|
|
|
1256
932
|
td["bottomLeft3"] = f'{self.language_settings.get("lunar_phase", "Lunar Phase")}: {self.t_user.lunar_phase.moon_phase_name}'
|
|
1257
933
|
td["bottomLeft4"] = f'{self.t_user.perspective_type}'
|
|
1258
934
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
lfcx = None
|
|
1265
|
-
lfr = None
|
|
1266
|
-
|
|
1267
|
-
if deg < 90.0:
|
|
1268
|
-
maxr = deg
|
|
1269
|
-
if deg > 80.0:
|
|
1270
|
-
maxr = maxr * maxr
|
|
1271
|
-
lfcx = 20.0 + (deg / 90.0) * (maxr + 10.0)
|
|
1272
|
-
lfr = 10.0 + (deg / 90.0) * maxr
|
|
1273
|
-
lffg = self.chart_colors_settings["lunar_phase_0"]
|
|
1274
|
-
lfbg = self.chart_colors_settings["lunar_phase_1"]
|
|
1275
|
-
|
|
1276
|
-
elif deg < 180.0:
|
|
1277
|
-
maxr = 180.0 - deg
|
|
1278
|
-
if deg < 100.0:
|
|
1279
|
-
maxr = maxr * maxr
|
|
1280
|
-
lfcx = 20.0 + ((deg - 90.0) / 90.0 * (maxr + 10.0)) - (maxr + 10.0)
|
|
1281
|
-
lfr = 10.0 + maxr - ((deg - 90.0) / 90.0 * maxr)
|
|
1282
|
-
lffg = self.chart_colors_settings["lunar_phase_1"]
|
|
1283
|
-
lfbg = self.chart_colors_settings["lunar_phase_0"]
|
|
1284
|
-
|
|
1285
|
-
elif deg < 270.0:
|
|
1286
|
-
maxr = deg - 180.0
|
|
1287
|
-
if deg > 260.0:
|
|
1288
|
-
maxr = maxr * maxr
|
|
1289
|
-
lfcx = 20.0 + ((deg - 180.0) / 90.0 * (maxr + 10.0))
|
|
1290
|
-
lfr = 10.0 + ((deg - 180.0) / 90.0 * maxr)
|
|
1291
|
-
lffg, lfbg = self.chart_colors_settings["lunar_phase_1"], self.chart_colors_settings["lunar_phase_0"]
|
|
1292
|
-
|
|
1293
|
-
elif deg < 361:
|
|
1294
|
-
maxr = 360.0 - deg
|
|
1295
|
-
if deg < 280.0:
|
|
1296
|
-
maxr = maxr * maxr
|
|
1297
|
-
lfcx = 20.0 + ((deg - 270.0) / 90.0 * (maxr + 10.0)) - (maxr + 10.0)
|
|
1298
|
-
lfr = 10.0 + maxr - ((deg - 270.0) / 90.0 * maxr)
|
|
1299
|
-
lffg, lfbg = self.chart_colors_settings["lunar_phase_0"], self.chart_colors_settings["lunar_phase_1"]
|
|
1300
|
-
|
|
1301
|
-
if lffg is None or lfbg is None or lfcx is None or lfr is None:
|
|
1302
|
-
raise KerykeionException("Lunar phase error")
|
|
1303
|
-
|
|
1304
|
-
td["lunar_phase_fg"] = lffg
|
|
1305
|
-
td["lunar_phase_bg"] = lfbg
|
|
1306
|
-
td["lunar_phase_cx"] = lfcx
|
|
1307
|
-
td["lunar_phase_r"] = lfr
|
|
1308
|
-
td["lunar_phase_outline"] = self.chart_colors_settings["lunar_phase_2"]
|
|
1309
|
-
|
|
1310
|
-
# rotation based on latitude
|
|
1311
|
-
td["lunar_phase_rotate"] = -90.0 - self.geolat
|
|
1312
|
-
|
|
935
|
+
td['moon_phase'] = draw_moon_phase(
|
|
936
|
+
self.user.lunar_phase["degrees_between_s_m"],
|
|
937
|
+
self.geolat
|
|
938
|
+
)
|
|
939
|
+
|
|
1313
940
|
# stringlocation
|
|
1314
941
|
if len(self.location) > 35:
|
|
1315
942
|
split = self.location.split(",")
|
|
@@ -1361,7 +988,6 @@ class KerykeionChartSVG:
|
|
|
1361
988
|
td[f"orb_color_{self.aspects_settings[i]['degree']}"] = self.aspects_settings[i]['color']
|
|
1362
989
|
|
|
1363
990
|
# config
|
|
1364
|
-
td["cfgZoom"] = str(self.zoom)
|
|
1365
991
|
td["cfgRotate"] = rotate
|
|
1366
992
|
|
|
1367
993
|
# ---
|
|
@@ -1369,9 +995,38 @@ class KerykeionChartSVG:
|
|
|
1369
995
|
#---
|
|
1370
996
|
|
|
1371
997
|
td["makeZodiac"] = self._draw_zodiac_circle_slices(r)
|
|
1372
|
-
td["makeHousesGrid"] = self.
|
|
1373
|
-
|
|
1374
|
-
|
|
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
|
+
|
|
1375
1030
|
td["makePlanets"] = self._make_planets(r)
|
|
1376
1031
|
td["elements_percentages"] = draw_elements_percentages(
|
|
1377
1032
|
self.language_settings['fire'],
|
|
@@ -1383,6 +1038,7 @@ class KerykeionChartSVG:
|
|
|
1383
1038
|
self.language_settings['water'],
|
|
1384
1039
|
self.water,
|
|
1385
1040
|
)
|
|
1041
|
+
|
|
1386
1042
|
td["makePlanetGrid"] = self._makePlanetGrid()
|
|
1387
1043
|
|
|
1388
1044
|
# Date time String
|
|
@@ -1498,4 +1154,4 @@ if __name__ == "__main__":
|
|
|
1498
1154
|
# With Topocentric Perspective
|
|
1499
1155
|
topocentric_subject = AstrologicalSubject("John Lennon - Topocentric", 1940, 10, 9, 18, 30, "Liverpool", "GB", perspective_type="Topocentric")
|
|
1500
1156
|
topocentric_chart = KerykeionChartSVG(topocentric_subject)
|
|
1501
|
-
topocentric_chart.makeSVG()
|
|
1157
|
+
topocentric_chart.makeSVG()
|