you can create a node at each end of the lines and then connect these nodes. by adjusting the minimum size of node you can improve aesthetics.
(sorry for my google english)
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,petri,calc,shadows}
\begin{document}
\begin{tikzpicture}[
parent/.style={%
rounded corners,
thick,
draw=red!75,
fill=red!20,
thick,
inner ysep=2pt,
inner xsep=2pt,
minimum width = 4cm,
minimum height = 1.5cm,
align=center
},
child/.style={%
rounded corners,
thick,
draw=blue!90,
fill=blue!35,
thick,
inner ysep=2pt,
inner xsep=2pt,
minimum width = 4cm,
minimum height = 1.5cm,
align=center
},
grandchild/.style={%
rounded corners,
thick,
draw=green!90,
fill=green!35,
thick,
inner ysep=2pt,
inner xsep=2pt,
minimum width = 4cm,
minimum height = 1.5cm,
align=center
},
line/.style={%
semithick,
->,
shorten >=1pt,
>=stealth'
},
call/.style={%
blue,
semithick,
->,
shorten >=1pt,
>=stealth'
},
return/.style={%
red,
semithick,
->,
shorten >=1pt,
>=stealth'
}]
\node[child] (child) {Child};
\node[parent] at (-6,3) (parent 1) {Node 1\\I have manually\\connected this one};
\node[parent] at (0,3) (parent 2) {Node 2\\I have manually\\connected this one};
\node[parent] at (6,3) (parent 3) {Node 3\\I have manually\\connected this one};
\node[parent] at (-6,-3) (grandchild 1) {Node 4\\I have manually\\connected this one};
\node[parent] at (0,-3) (grandchild 2) {Node 5\\I have NOT manually\\connacted this one};
\node[parent] at (6,-3) (grandchild 3) {Node 6\\I have NOT manually\\connacted this one};
%draw three lines from each parent to each child
\draw [line] (parent 1.south east)node[above left](p1){} -- (child.north west)node[below right](c1){};
\draw [line] (parent 2.south)node[above](p2){} -- (child.north)node[below](c2){};
\draw [line] (parent 3.south west)node[above right](p3){} -- (child.north east) node[below left](c3){};
%draw three lines from each parent to each child
\draw [line] (grandchild 1.north east)node[below left,minimum size=2em](p4){} -- (child.south west)node[above right,minimum size=2em](c4){};
\draw [line] (grandchild 2.north)node[below,minimum size=2em](p5){} -- (child.south)node[above,minimum size=2em](c5){};
\draw [line] (grandchild 3.north west)node[below right](p6){} -- (child.south east)node[above left](c6){};
\foreach \nn in{1,2,3,4,5,6}{
\draw [call] (p\nn) to [bend right=15] (c\nn);
\draw [return] (c\nn) to [bend right=15] (p\nn);
}
\end{tikzpicture}
\end{document}!
![the result](https://i.stack.imgur.com/5OMCq.png)
By default, tikz
uses centimeter
s (cm) as unit. You are using dimensions of the order of 200
(meaning 200cm) resulting in your image going beyond page and part of the image is not seen. Try setting [x=1mm,y=1mm]
, specifying all dimensions in mm and changing (unrelated) all tikzstyle
s (deprecated) to tikzset
brings the image within the page.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes}
\usetikzlibrary{backgrounds,fit,shapes}
\usetikzlibrary{positioning}
\tikzset{X/.style = {rectangle, fill=orange!30!white},
Y/.style = {rectangle, fill=green!30!white},
Other/.style = {rectangle, fill=blue!30!white}
}
\begin{document}
\begin{tikzpicture}[x=1mm,y=1mm]
\draw [thin,dashed][help lines,step=5mm] (0,0) grid (125,20);
\draw [help lines,step=10mm] (0,0) grid (125,20);
\node [Y, anchor=south west, minimum width=100mm,minimum height=10mm] (Response) at (0,0) {};
\node [below=of Response] {\small Variation in response};
\node [X, anchor=south west, minimum width=75mm,minimum height=5mm] (Explanatory) at (0,0) {};
\node [above=of Explanatory] {\small Explanatory};
\node [Other, anchor=south west, minimum width=50mm,minimum height=5mm] (Other) at (75mm,1mm) {};
\node [above=of Other] {\small Other};
\end{tikzpicture}
\end{document}
![enter image description here](https://i.stack.imgur.com/wTGv9.png)
The dashed lines are 5mm
apart from 0 to 125mm and the solid ones are 10mm apart. Hope this is helpful.
Best Answer
Adjust the stars as you wish:
Update
As Pier Paolo says, if you would like the lines to be drawn 'behind' the shapes, the easiest way is to draw the triangles as nodes and to drop the
.center
anchor whose sole purpose was to draw the lines in front of the star nodes.