Source

htsql / doc / dia / singular-links.tex

Full commit

\documentclass{article}

\include{prelude}

\begin{document}

\tikzset{
    > = stealth', shorten > = 1pt, shorten < = 1pt,
    node distance = 0.1cm,
    class node/.style = {fill=black!10, circle, minimum size=3cm},
    node content/.style = {matrix, nodes={font=\ttfamily\footnotesize,
                                          inner sep=.5pt,
                                          text depth=.25ex, text height=1.5ex}},
    node header/.style = {font=\itshape},
    arrow/.style = {single arrow, fill=black!5, minimum height=3cm,
                    minimum width=2.5cm, single arrow head extend=.1cm,
                    single arrow tip angle=120},
    arrow header/.style = {font=\ttfamily},
    brace/.style = {decorate, decoration={brace, amplitude=8pt, raise=1.5cm},
                    draw=blue!50},
    brace header/.style = {below=1.75cm, font=\itshape\color{blue!75}}
}

\begin{tikzpicture}

\node[class node] (program) {};
\node[arrow] (program to school) [right=of program] {};
\node[class node] (school) [right=of program to school] {};
\node[arrow] (school to department) [right=of school] {};
\node[class node] (department) [right=of school to department] {};

\node[node header] at (program.north) [above]
    {program};
\node[arrow header] at (program to school.north) [above]
    {school};
\node[node header] at (school.north) [above]
    {school};
\node[arrow header] at (school to department.north) [above]
    {department};
\node[node header] at (department.north) [above]
    {department};

\node[node content] at (program)
{
    \node[text height=2.5ex] {\vdots}; \\
    \node (gee) {{[eng.gee]}}; \\
    \node (uelec) {{[eng.uelec]}}; \\
    \node (pmth) {{[ns.pmth]}}; \\
    \node (gmth) {{[ns.gmth]}}; \\
    \node (umth) {{[ns.umth]}}; \\
    \node[text height=2.5ex] {\vdots}; \\
};

\node[node content] at (school)
{
    \node[text height=2.5ex] {\vdots}; \\
    \node (eng) {{[eng]}}; \\
    \node (ns) {{[ns]}}; \\
    \node (sc) {{[sc]}}; \\
    \node[text height=2.5ex] {\vdots}; \\
};

\node[node content] at (department)
{
    \node[text height=2.5ex] {\vdots}; \\
    \node (ee) {{[ee]}}; \\
    \node (comp) {{[comp]}}; \\
    \node (chem) {{[chem]}}; \\
    \node (career) {{[career]}}; \\
    \node (astro) {{[astro]}}; \\
    \node[text height=2.5ex] {\vdots}; \\
};

\draw[->]
    (gee.east) to (eng.west);
\draw[->]
    (uelec.east) to (eng.west);
\draw[->]
    (pmth.east) to (ns.west);
\draw[->]
    (gmth.east) to (ns.west);
\draw[->]
    (umth.east) to (ns.west);

\draw[->]
    (eng.east) to (ee.west);
\draw[->]
    (eng.east) to (comp.west);
\draw[->]
    (ns.east) to (chem.west);
\draw[->]
    (ns.east) to (astro.west);

\draw[brace]
    (school.west)
    -- node[brace header] {a singular link}
    (program.east);
\draw[brace]
    (department.west)
    -- node[brace header] {a plural link}
    (school.east);

\end{tikzpicture}

\end{document}