
這CFR 的漂亮解決方案可以使用等級 2 的節點將其樣式設定為註釋。
非常不同的方法這個或者那個增加額外節點的地方外部心智圖本身。
然而,我正在與錨點作鬥爭,level 2
以便它看起來更和諧,如下所示(我在油漆上作弊以顯示預期結果)。
我想這個想法是有一個移動錨點(east
對於心智level 2
圖左側的節點,west
錨點在心智圖的右側節點?更精細,傾斜以遵循從等級1 開始的路徑?我不知道什麼是可行的) 。也就是說,我無法確定如何區分這些情況的起點:/
% original MWE from cfr.
\documentclass[border=10pt]{standalone}
\usepackage[condensed,math]{iwona}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees,positioning}
\tikzset{
set angles for level/.style={level #1/.append style={sibling angle=360/(\the\tikznumberofchildren+4)}},
level/.append code={
\edef\tempa{#1}\edef\tempb{1}
\ifx\tempa\tempb\tikzset{level 1/.append style={sibling angle=360/\the\tikznumberofchildren}}\else\tikzset{set angles for level=#1}\fi},
% set angles for level=#1},% solution 1
non-concept/.style={
rectangle,
text width=15em,
text=black,
align=left,
font=\large,
},
cncc/.style={ edge from parent path={ (\tikzparentnode.#1) to [bend right] (\tikzchildnode) } },
}
\begin{document}
\begin{tikzpicture}[level 1 concept/.append style={font=\large, level distance=150}]
\path[mindmap, concept color=Aquamarine, grow cyclic]
node[concept] {ICF Core \\ Competencies}%[clockwise from=45]
child[concept color=blue!20!white] {
node[concept] (def) {Setting the Foundation}
child[level distance=5cm] { node[non-concept] {Meeting Ethical Guidelines \& Professional Standards} edge from parent[cncc=west] }
child[level distance=5cm] { node[non-concept] {Establishing the Coaching Agreement} edge from parent[cncc=west] }
}
child[concept color=Pink] { node[concept] {Co-creating the \\ Relationship}
child[level distance=5cm] { node[non-concept] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc=south] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=south] }
}
child[concept color=Bisque]{ node[concept] {Communicating Effectively}
[clockwise from=0]
child[level distance=5cm] { node[non-concept] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc=east] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=east] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=south] }
}
child[concept color=Cyan] { node[concept] {Facilitating Learning \& Results}
[clockwise from=90]
child[level distance=5cm] { node[non-concept] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc=west] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=west] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=north] }
child[level distance=5cm] { node[non-concept] {Coaching Presence} edge from parent[cncc=east] }
};
\end{tikzpicture}
\end{document}
答案1
如果您想將路徑與 2 級條目完美對齊。您需要手動調整它們。因為它取決於文字寬度、最小尺寸和條目的錨點。我在 中添加了兩個參數,non-concept/.style
並在 中添加了一個參數cncc/.style
。在 中non-concept/.style
,第一個參數 #1 指定文字寬度,第二個參數 #2 指定 2 層節點的最小大小。在 中cncc/.style
,第一個參數 #1 仍然是 1 層父節點的錨點,第二個參數 #2 是 2 層子節點的錨點。我還在每個 2 級條目中添加了框架,以便明確地看到效果(註釋draw
innon-concept/.style
將不產生框架)。您可以調整這些參數以使數字接近問題中的預期結果。另外在某些情況下,您可能需要手動shift
調整 2 級條目的位置(例如child[shift={(2.5cm,-3cm)},level distance=5cm]
)。
這是代碼:
% original MWE from cfr.
\documentclass[border=10pt]{standalone}
\usepackage[condensed,math]{iwona}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees,positioning}
\tikzset{
set angles for level/.style={level #1/.append style={sibling angle=360/(\the\tikznumberofchildren+4)}},
level/.append code={
\edef\tempa{#1}\edef\tempb{1}%
\ifx\tempa\tempb\tikzset{level 1/.append style={sibling angle=360/\the\tikznumberofchildren}}\else\tikzset{set angles for level=#1}\fi},
% set angles for level=#1},% solution 1
non-concept/.style 2 args={
draw, % comment to make no frames
minimum size=#2,
text width=#1,
text=black,
align=left,
font=\large,
},
cncc/.style n args={2}{ edge from parent path={ (\tikzparentnode.#1) to [bend right] (\tikzchildnode.#2) } },
}
\begin{document}
\begin{tikzpicture}[level 1 concept/.append style={font=\large, level distance=150}]
\path[mindmap, concept color=Aquamarine, grow cyclic]
node[concept] {ICF Core \\ Competencies}%[clockwise from=45]
child[concept color=blue!20!white] {
node[concept] (def) {Setting the Foundation}
child[level distance=5cm] { node[non-concept={14em}{1cm}] {Meeting Ethical Guidelines \& Professional Standards} edge from parent[cncc={west}{north}] }
child[shift={(-2cm,1.5cm)},level distance=5cm] { node[non-concept={12em}{1cm}] {Establishing the Coaching Agreement} edge from parent[cncc={west}{north west}]}
}
child[concept color=Pink] {
node[concept] {Co-creating the \\ Relationship}
child[level distance=5cm] { node[non-concept={14em}{1cm}] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc={south}{north west}] }
child[level distance=6cm] { node[non-concept={9em}{0.5cm}] {Coaching Presence} edge from parent[cncc={south}{south west}] }
}
child[text width=7em,concept color=Bisque]{ node[concept] {Communicating Effectively} [clockwise from=0]
child[shift={(2.5cm,-3cm)},level distance=5cm] { node[non-concept={14em}{1cm}] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc={east}{south west}] }
child[level distance=5cm] { node[non-concept={9em}{0.5cm}] {Coaching Presence} edge from parent[cncc={east}{west}] }
child[level distance=5cm] { node[non-concept={9em}{0.5cm}] {Coaching Presence} edge from parent[cncc={south}{north west}] }
}
child[concept color=Cyan] { node[concept] {Facilitating Learning \& Results}
[clockwise from=90]
child[level distance=5cm] { node[non-concept={14em}{1cm}] {Establishing Trust \& Intimacy with the Client} edge from parent[cncc={west}{north}] }
child[level distance=5cm] { node[non-concept={8.8em}{0.5cm}] {Coaching Presence} edge from parent[cncc={west}{north east}] }
child[level distance=5cm] { node[non-concept={8.8em}{0.5cm}] {Coaching Presence} edge from parent[cncc={north}{east}] }
child[level distance=5cm] { node[non-concept={8.8em}{0.5cm}] {Coaching Presence} edge from parent[cncc={east}{south east}] }
};
\end{tikzpicture}
\end{document}