答案1
作为起点。通过使用forest
绘制树:
\documentclass[border=3mm,
preview]{standalone}
\usepackage[edges]{forest}
\usetikzlibrary{positioning,
shapes.callouts}
\begin{document}
{
\tikzset{
node distance = 3mm,
every label/.style = {circle, fill=blue, minimum size=2em,
inner sep=0pt, anchor=center,
font=\small\sffamily, text=white},
CO/.style = {ellipse callout, inner sep=1pt,
callout absolute pointer={#1},
callout pointer width=1.2 mm, callout pointer shorten=-1mm,
fill=black, font=\small\sffamily, text=white},
Root/.style = {double, rounded corners, fill=cyan!30,
font=\small\sffamily\bfseries},
}
\begin{forest}
for tree={
% style of tree nodes
font=\sffamily\small,
draw, semithick,
align = center,
inner sep = 2mm,
% style of tree (edges, distances, direction)
edge = {draw, semithick, -stealth},
parent anchor = south,
child anchor = north,
grow = south,
forked edge,
l sep = 12mm, % level distance
fork sep = 6mm, % distance from parent to branching point
s sep = 4mm
}
[Support for\\ visually impaired,
Root, name=root
[AAA\\ aaaa,label=south east:5]
[BB\\ bbbbb bbb\\ bb bbb b bbb,label=south east:114]
]
\node[CO=(root.north east),above right=of root] {159};
\end{forest}
}
\end{document}