Raw Data from Wikipedia table from the Chinese zodiac on current Sexagenary Cycle
Raw Data from Wikipedia table from the Chinese zodiac on current Sexagenary Cycle
data=;
Dataset for years 1924 to 2043
Dataset for years 1924 to 2043
In[]:=
sexagenaryCycleDataset=Dataset@Association@MapIndexed[<|First@#2-><|"Force"If[OddQ[First@#2],"Yang","Yin"],"Element"->StringTrim@StringDrop[#1[[1]],6],"Animal"->StringTrim@StringDrop[#1[[2]],2]|>|>&,StringSplit[Drop[data,2],"\t"][[All,{3,4}]]]
Out[]=
Functions and items needed to create the Calendar Graphics
Functions and items needed to create the Calendar Graphics
In[]:=
sexagenaryCycleNumber[y_Integer]:=Mod[(y-3),60]
In[]:=
animals=Values@Normal@sexagenaryCycleDataset[;;12,"Animal"]
Out[]=
{Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig}
In[]:=
animalOpenMojis=
,
,
,
,
,
,
,
,
,
,
,
;
In[]:=
yinYang=
;
In[]:=
yinColors=,,,,;
yangColors=Map[Lighter,yinColors];
In[]:=
elements={"Wood","Fire","Earth","Metal","Water"};
In[]:=
getAnimalIcon[y_Integer]:=ReplaceAll[Thread[Rule[animals,animalOpenMojis]]][Normal@sexagenaryCycleDataset[sexagenaryCycleNumber[y]]["Animal"]]
In[]:=
getForce[y_Integer]:=If[y1983,"Yin",Normal@sexagenaryCycleDataset[sexagenaryCycleNumber[y]]["Force"]]
In[]:=
getElement[y_Integer]:=If[y1983,"Water",Normal@sexagenaryCycleDataset[sexagenaryCycleNumber[y]]["Element"]]
In[]:=
getColor[y_Integer]:=If[getForce[y]"Yin",ReplaceAll[Thread[Rule[elements,yinColors]]][getElement[y]],ReplaceAll[Thread[Rule[elements,yangColors]]][getElement[y]]]
Plot Calendar
Plot Calendar
In[]:=
chineseYear[y_Integer]:=Module[{year=y,cycleNumber},cycleNumber=IntegerPart[(year-1924)/12];Legended[Labeled[Graphics[Join[{Rotate[Table[Table[{Rotate[Join[{getColor[n],Annulus[{0,0},{2.5+c,3.5+c},{-Pi/12-Pi/2,Pi/12-Pi/2}]},{Transparent,Disk[{0,0},13]}],sexagenaryCycleNumber[n]Pi/6]},{n,1924+12c,If[c<cycleNumber,1924+12c+11,year]}],{c,0,cycleNumber}],-sexagenaryCycleNumber[year]Pi/6]},(*AnimalIcons*){Rotate[Table[{Rotate[Join[{Transparent,Disk[{0,0},13]},{Inset[getAnimalIcon[n],{0,-4-cycleNumber},Automatic,{2,2}]}],sexagenaryCycleNumber[n]Pi/6]},{n,1924,year}],-sexagenaryCycleNumber[year]Pi/6]},(*YinYangAnnulus*){Rotate[Join[Flatten[Table[{If[OddQ[n],White,Black],Annulus[{0,0},{0.5,2.5},{nPi/6-Pi/12,(n+1)Pi/6-Pi/12}]},{n,1,12}]],{Inset[yinYang,{0,0},Automatic,{5,5}]}],(1-sexagenaryCycleNumber[year])Pi/6]}],ImageSize600],{Style[year,26,FontFamily"Helvetica Neue",Bold],Style["Happy Metal Rat Year!",30,Gray,FontFamily"Helvetica Neue",Bold]},{Bottom,Top}],SwatchLegend[yinColors,elements]]]
In[]:=
chineseYear[2020]
In[]:=
SetDirectory[NotebookDirectory[]]
In[]:=
Export["Chinese_Sexagenary_Cycle_Calendar.gif",ParallelTable[chineseYear[y],{y,Append[Range[1924,2020],2020]}],"DisplayDurations"0.5,"AnimationRepetitions"Infinity]
Out[]=
Chinese_Sexagenary_Cycle_Calendar.gif