5

Suppose I've got the following mindmap:

\documentclass[margin=10pt]{standalone}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees,shadows}
\usepackage{fontspec}

\begin{document}
    \begin{tikzpicture}
      [mindmap,
      font=\large\bfseries\sffamily,
      grow cyclic,
every node/.style={concept, circular drop shadow, 
    %minimum size=0pt,
    execute at begin node=\hskip0pt},
      %concept color=magenta!70!black,
      root concept/.append style={
        font=\huge\sffamily\bfseries,text width=8cm,concept color=Gold},
      level 1/.append style={sibling angle=360/10,
        font=%\color{Seashell}
        \bfseries\sffamily
        \LARGE,
        level distance=35em,
        inner sep=0pt,
        text width=4cm,
        sibling distance=1cm,
        concept color=Goldenrod},
      level 2/.append style={%sibling angle=37.5,
        sibling distance=21em,
        font=\color{Seashell}\sffamily\bfseries\fontsize{36pt}{48pt}\selectfont,level distance=10cm,inner sep=0pt,text width=7cm,color=purple!50},
]

         \node [root concept] {Root Concept}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}};
  \end{tikzpicture}
\end{document}

enter image description here

It's fine, but I was wondering if it is at all possible to implement a "textured" background for those nodes, as it's possible with other tikz nodes as per here.

1 Answers1

6

Yes, it is. One way to achieve this is to put the path picture into nodes and make sure that then the node you put in the path picture does not see the options, which can be achieved by setting locally every node/.style={}.

\documentclass[margin=10pt]{standalone}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap,trees,shadows}
\usepackage{fontspec}

\begin{document}
    \begin{tikzpicture}
      [mindmap,
      font=\large\bfseries\sffamily,
      grow cyclic,
every node/.style={concept, circular drop shadow, 
    %minimum size=0pt,
    execute at begin node=\hskip0pt},
      %concept color=magenta!70!black,
      root concept/.append style={
        font=\huge\sffamily\bfseries,text width=8cm,concept color=Gold},
      level 1/.append style={sibling angle=360/10,
        font=%\color{Seashell}
        \bfseries\sffamily
        \LARGE,
        level distance=35em,
        inner sep=0pt,
        text width=4cm,
        sibling distance=1cm,
        concept color=Goldenrod,
        nodes={%
            fill=none,draw,
            path picture={\node[every node/.style={}] at (path picture bounding box.center) 
                {\includegraphics[width=4cm,height=4.1cm]{example-image-duck}};},%},
            },      
        },
      level 2/.append style={%sibling angle=37.5,
        sibling distance=21em,
        font=\color{Seashell}\sffamily\bfseries\fontsize{36pt}{48pt}\selectfont,level distance=10cm,inner sep=0pt,text width=7cm,color=purple!50},
]

         \node [root concept] {Root Concept}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}};
  \end{tikzpicture}
\end{document}

enter image description here

If you replace example-image-duck by GoldLeaf.jpg from here you get

enter image description here

If you want to make the nodes of more levels golden, you may want to define a style for that.

\documentclass[margin=10pt]{standalone}
\usepackage[dvipsnames,svgnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{mindmap,shadows}
\usepackage{fontspec}
\tikzset{golden/.style={
          fill=none,draw,
          path picture={\node[every node/.style={}] at (path picture bounding box.center) 
              {\includegraphics[width=#1,height=#1]{GoldLeaf.jpg}};},%},
          },golden/.default=4cm         
}

\begin{document}
    \begin{tikzpicture}[mindmap,
      font=\large\bfseries\sffamily,
      grow cyclic,
    every node/.style={concept, circular drop shadow, 
    %minimum size=0pt,
    execute at begin node=\hskip0pt},
      %concept color=magenta!70!black,
      root concept/.append style={
        font=\huge\sffamily\bfseries,text width=8cm,concept color=Gold,
        golden=8cm},
      level 1/.append style={sibling angle=360/10,
        font=%\color{Seashell}
        \bfseries\sffamily
        \LARGE,
        level distance=35em,
        inner sep=0pt,
        text width=4cm,
        sibling distance=1cm,
        concept color=Goldenrod,nodes={golden=4cm}
        }]

         \node [root concept] {Root Concept}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
         child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}}
child {node {Node}};
\end{tikzpicture}
\end{document}

enter image description here

Notice that if you want to make the connecting bars follow the pattern, too, you will probably be better off with a different approach using path fading, something that I will be happy to spell out at another day.

  • The golden leaf image is exactly the kind of image I had in mind. So if I want to repeat the process for the root concept, I should just add nodes={...} either to root concept or to every node/.style, right? –  Nov 25 '19 at 22:15
  • @Joseph In that case I'd use a style that I apply at different levels. I added this to the answer. –  Nov 25 '19 at 22:36
  • Great! I'll be glad to make another question in the future regarding the connecting bars. –  Nov 25 '19 at 23:05