I took code previously posted here: Is there a way to make "sunburst charts" (multi-level pie charts) in LaTeX?
And I wanted to modify this for genealogy purposes. I have the setup I would like, but I am not sure how to modify the function such that I can have two lines of text for each arctext piece.
Can anyone help me to understand the function such that I can modify it for displaying two lines?
I think the "height" of the boxes is already coded and I can play with the function to adjust it for the size text accordingly.
Thanks.
\documentclass[border=5pt]{standalone}
\usepackage{xcolor}
\definecolor{orange1}{HTML}{F1753A}
\definecolor{orange2}{HTML}{F7A13E}
\definecolor{orange3}{HTML}{FC6300}
\definecolor{root}{HTML}{B2B2B2}
\usepackage{tikz}
\usepackage{pgfmath}
\usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings}
\renewcommand*\familydefault{\sfdefault} % Set font to serif family
% arctext from Andrew code with modifications:
%Variables: 1: ID, 2:Style 3:box height 4: Radious 5:start-angl 6:end-angl 7:text {format along path}
\def\arctext[#1][#2][#3](#4)(#5)(#6)#7{
\draw[
color=white,
thick,
line width=1.3pt,
fill=#2
]
(#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3)
-- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1)
arc (#6:#5:#4cm-#3) coordinate (below #1)
-- (#5:#4) coordinate (left #1) -- cycle;
\def\a#1{#4cm+#3}
\def\b#1{#4cm-#3}
\path[
decoration={
raise = -0.5ex, % Controls relavite text height position.
text along path,
text = {#7},
text align = center,
},
decorate
]
(#5:#4) arc (#5:#6:#4);
}
%arcarrow, this is mine, for beerware purpose...
%Function: Draw an arrow from arctex coordinate specific nodes to another
%Arrow start at the start of arctext box and could be shifted to change the position
%to avoid go over another box.
%Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box
\def\arcarrow[#1](#2)(#3)[#4]{
\draw[thick,-,>=latex,color=#1,line width=1pt,shorten >=-2pt, shorten <=-2pt]
let \p1 = (#2), \p2 = (#3), % To access cartesian coordinates x, and y.
\n1 = {veclen(\x1,\y1)}, % Distance from the origin
\n2 = {veclen(\x2,\y2)}, % Distance from the origin
\n3 = {atan2(\y1,\x1)} % Angle where acrtext starts.
in (\n3-#4: \n1) -- (\n3-#4: \n2); % Draw the arrow.
}
\begin{document}
\begin{tikzpicture}[
% Environment Cfg
font=\sf \scriptsize,
% Styles
myarrow/.style={
thick,
-latex,
},
Center/.style ={
circle,
fill=white,
text=root,
align=center,
font =\footnotesize,
inner sep=1pt,
},
]
% Drawing the center
\node[Center](ROOT) at (0,0) {Test \\ Boy};
% Drawing the Tex Arcs
% \Arctext[ID][box-style][box-height](radious)(start-angl)(end-angl){|text-styles| Text}
% Node 1: Father
\arctext[N1][orange1][15pt](1.5)(180)(0){|\footnotesize\bf\color{white}| John Boy B. 12 Jun 2016};
%Sub 1: Grandfather
\arctext[N1S1][orange1][13pt](2.5)(180)(90){|\footnotesize\bf\color{white}| Sub1};
%Sub 1-Sub 1: Great Grandfather
\arctext[N1S1S1][orange1][8pt](3.25)(180)(135){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 1-Sub 1: Great-Great Grandfather
\arctext[N1S1S1S1][orange1][8pt](3.8)(180)(157.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 1-Sub 2: Great-Great Grandmother
\arctext[N1S1S1S2][orange1][8pt](3.8)(157.5)(135){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 1-Sub 2: Great Grandmother
\arctext[N1S1S2][orange1][8pt](3.25)(135)(90){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 1-Sub 2-Sub 1: Great-Great Grandfather
\arctext[N1S1S2S1][orange1][8pt](3.8)(135)(112.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 2-Sub 2: Great-Great Grandmother
\arctext[N1S1S2S2][orange1][8pt](3.8)(112.5)(90){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 2: Grandmother
\arctext[N1S2][orange1][13pt](2.5)(90)(0){|\footnotesize\bf\color{white}| Sub2};
%Sub 2-Sub 1: Great Grandfather
\arctext[N1S2S1][orange1][8pt](3.25)(90)(45){|\footnotesize\bf\color{white}| Sub2-Sub1};
%Sub 2-Sub 1-Sub 1: Great-Great Grandfather
\arctext[N1S2S1S1][orange1][8pt](3.8)(90)(67.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 2-Sub 1-Sub 2: Great-Great Grandmother
\arctext[N1S2S1S2][orange1][8pt](3.8)(67.5)(45){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 2-Sub 2: Great Grandmother
\arctext[N1S2S2][orange1][8pt](3.25)(45)(0){|\footnotesize\bf\color{white}| Sub2-Sub2};
%Sub 2-Sub 2-Sub 1: Great-Great Grandfather
\arctext[N1S2S2S1][orange1][8pt](3.8)(45)(22.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 2-Sub 2-Sub 2: Great-Great Grandmother
\arctext[N1S2S2S2][orange1][8pt](3.8)(22.5)(0){|\footnotesize\bf\color{white}| Sub1-Sub2}
\arctext[N2][orange2][15pt](1.5)(180)(360){|\footnotesize\bf\color{white}| John Boy B. 12 Jun 2016};
%Sub 1: Grandfather
\arctext[N2S1][orange2][13pt](2.5)(180)(270){|\footnotesize\bf\color{white}| Sub1};
%Sub 1-Sub 1: Great Grandfather
\arctext[N2S1S1][orange2][8pt](3.25)(180)(225){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 1-Sub 1: Great-Great Grandfather
\arctext[N2S1S1S1][orange2][8pt](3.8)(180)(202.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 1-Sub 2: Great-Great Grandmother
\arctext[N2S1S1S2][orange2][8pt](3.8)(202.5)(225){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 1-Sub 2: Great Grandmother
\arctext[N2S1S2][orange2][8pt](3.25)(225)(270){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 1-Sub 2-Sub 1: Great-Great Grandfather
\arctext[N2S1S2S1][orange2][8pt](3.8)(225)(247.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 1-Sub 2-Sub 2: Great-Great Grandmother
\arctext[N2S1S2S2][orange2][8pt](3.8)(247.5)(270){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 2: Grandmother
\arctext[N2S2][orange2][13pt](2.5)(270)(360){|\footnotesize\bf\color{white}| Sub2};
%Sub 2-Sub 1: Great Grandfather
\arctext[N2S2S1][orange2][8pt](3.25)(270)(315){|\footnotesize\bf\color{white}| Sub2-Sub1};
%Sub 2-Sub 1-Sub 1: Great-Great Grandfather
\arctext[N2S2S1S1][orange2][8pt](3.8)(270)(292.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 2-Sub 1-Sub 2: Great-Great Grandmother
\arctext[N2S2S1S2][orange2][8pt](3.8)(292.5)(315){|\footnotesize\bf\color{white}| Sub1-Sub2}
%Sub 2-Sub 2: Great Grandmother
\arctext[N2S2S2][orange2][8pt](3.25)(315)(360){|\footnotesize\bf\color{white}| Sub2-Sub2};
%Sub 2-Sub 2-Sub 1: Great-Great Grandfather
\arctext[N2S2S2S1][orange2][8pt](3.8)(315)(337.5){|\footnotesize\bf\color{white}| Sub1-Sub1};
%Sub 2-Sub 2-Sub 2: Great-Great Grandmother
\arctext[N2S2S2S2][orange2][8pt](3.8)(337.5)(360){|\footnotesize\bf\color{white}| Sub1-Sub2}
\end{tikzpicture}
\end{document}


