在思维导图中添加独立(小)节点

在思维导图中添加独立(小)节点

我用了模板,做了一些修改,得出了以下思维导图:

实际状态

最小工作示例(MWE)可以在这里看到:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,paths.ortho,calc,paths.rectangle,positioning-plus,arrows.meta,shapes,positioning,shadows,trees,mindmap,backgrounds}

\begin{document}

\begin{figure}[!h]
    \centering
    \resizebox{0.8\textwidth}{!}{
        \begin{tikzpicture}[mindmap,
        level 1 concept/.append style={level distance=130,sibling angle=90},
        extra concept/.append style={color=blue!50,text=black}]
        \path[mindmap,concept color=black,text=white]
        node[concept] {Something}
        [clockwise from=0]
        child[concept color=green!50!black] {
            node[concept] (gov) {Something}
            [clockwise from=0]
            child { node[concept] (blub) {Something} }
            child { node[concept] (bla) {Something} }
            child { node[concept] (sep) {Something} }
            [clockwise from=-90]
            child { node[concept] (pau) {Something} }
        }  
        child[concept color=blue] {
            node[concept] (top) {Something}
        }
        child[concept color=red] { 
            node[concept] {Something} 
            [clockwise from=310]
            child { node[concept] (cot) {Something} }
            child { node[concept] (cont) {Something} }
        }
        child[concept color=orange] {
            node[concept] (gen) {Something} 
            [clockwise from=-180]
            child { node[concept] {Something} }
        };

        \begin{pgfonlayer}{background}
        \draw [left color=blue, right color=green!50!black, draw=white, decorate,decoration=circle connection bar] (pau) -- (top);
        \draw [left color=orange, right color=green!50!black, draw=white, decorate,decoration=circle connection bar] (gen) -- (gov);
        \draw [left color=red, right color=blue, draw=white, decorate,decoration=circle connection bar] (cot) -- (top);
        \draw [left color=red, right color=blue, draw=white, decorate,decoration=circle connection bar] (cont) -- (top);
        \end{pgfonlayer}
        \end{tikzpicture}
    }
\end{figure}
\end{document}

此 MWE 的一个特点是,我已将我在 tex 文件中使用的所有 tikz 库以及 都包含在内\resizebox。如果这没有添加任何有用的信息,请告诉我。

我现在想添加一个与其他较小节点大小大致相同的独立节点。我的想法是这样的:

目标状态

我知道模板存在。但是,第二个独立节点会非常大。有人对如何解决这个问题有什么建议吗?我将不胜感激。

答案1

您可以使用extra concept附加节点的样式(这正是设计该样式的确切情况)并使用循环绘制线条:

\node[fill=blue,circle,font=\scriptsize,extra concept,text=white]
  (additional)
  at (blub|-pau)
 {Something else};
\foreach \Name in {blub,sep,bla}
  \draw[dashed,ultra thick,blue] (additional) -- (\Name);

结果:

在此处输入图片描述

完整代码:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{matrix,calc,,arrows.meta,shapes,positioning,shadows,trees,mindmap,backgrounds}

\begin{document}

\begin{figure}
    \centering
    \resizebox{0.8\textwidth}{!}{%
        \begin{tikzpicture}[mindmap,
        level 1 concept/.append style={level distance=130,sibling angle=90},
        extra concept/.append style={color=blue!50,text=black}]
        \path[mindmap,concept color=black,text=white]
        node[concept] {Something}
        [clockwise from=0]
        child[concept color=green!50!black] {
            node[concept] (gov) {Something}
            [clockwise from=0]
            child { node[concept] (blub) {Something} }
            child { node[concept] (bla) {Something} }
            child { node[concept] (sep) {Something} }
            [clockwise from=-90]
            child { node[concept] (pau) {Something} }
        }  
        child[concept color=blue] {
            node[concept] (top) {Something}
        }
        child[concept color=red] { 
            node[concept] {Something} 
            [clockwise from=310]
            child { node[concept] (cot) {Something} }
            child { node[concept] (cont) {Something} }
        }
        child[concept color=orange] {
            node[concept] (gen) {Something} 
            [clockwise from=-180]
            child { node[concept] {Something} }
        };

        \begin{pgfonlayer}{background}
        \draw [left color=blue, right color=green!50!black, draw=white, decorate,decoration=circle connection bar] (pau) -- (top);
        \draw [left color=orange, right color=green!50!black, draw=white, decorate,decoration=circle connection bar] (gen) -- (gov);
        \draw [left color=red, right color=blue, draw=white, decorate,decoration=circle connection bar] (cot) -- (top);
        \draw [left color=red, right color=blue, draw=white, decorate,decoration=circle connection bar] (cont) -- (top);
        \end{pgfonlayer}

\node[fill=blue,circle,font=\scriptsize,extra concept,text=white]
  (additional)
  at (blub|-pau)
 {Something else};
\foreach \Name in {blub,sep,bla}
  \draw[dashed,ultra thick,blue] (additional) -- (\Name);
\end{tikzpicture}%
}


\end{figure}
\end{document}

附注:使用[!h]浮动位置说明符是灾难的根源;请使用限制较少的选项,例如[!htp],或者更好的是,根本不使用限制。

相关内容