0

When I use a large number of Nodes in Tikz, they begin to overlap (see screenshot below). I tried following the instructions in Overlapping nodes in tikz, but it does not solve the problem in my situation.

Can anyone advise as to how I can fix this so that there is no overlap as I increase the number of nodes from 5 to 50, to 100, and so on. In other words, I don't want the nodes to be confined to the page only and have to overlap. I want the tikz image to be scaled so the nodes get smaller and smaller.

NOTE I am using pdflatex to compile

\documentclass{article}

\usepackage{tikz}
\usepackage{adjustbox}     %shrink Tikz or figures
\usepackage{pdflscape}     %landscape Tikz image
\usetikzlibrary{positioning,shadows,shapes,arrows}

\begin{document}

\tikzstyle{abstract}=[rectangle, draw=black, rounded corners, fill=blue, drop shadow,
text centered, anchor=north, text=white, text width=3cm, text justified]
\tikzstyle{comment}=[rectangle, draw=black, rounded corners, fill=blue!70, drop shadow,
text centered, anchor=north, text=white, text width=3cm]
\tikzstyle{myarrow}=[->, >=open triangle 90, thick]
\tikzstyle{line}=[-, thick]

%\begin{minipage}{0.6\textwidth}
\begin{landscape}
   \begin{center}
      \begin{adjustbox}{max size={\textwidth}{\textheight}}
         \begin{tikzpicture}[node distance=2cm]

            \node (909581201875) [abstract, rectangle split, rectangle split parts=2]
            {
               \textbf{Blablabla}
               \nodepart{second}Date
            };

            \node (898435211607) [abstract, rectangle split, rectangle split parts=2, below=of 909581201875.south east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (584324999444) [abstract, rectangle split, rectangle split parts=2, below=of 898435211607.south, anchor=north]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (423475839122) [abstract, rectangle split, rectangle split parts=2, below=of 584324999444.south, anchor=north]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (540317204728) [abstract, rectangle split, rectangle split parts=2, left=of 423475839122.north west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (852163503990) [abstract, rectangle split, rectangle split parts=2, right=of 423475839122.north east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (633894928094) [abstract, rectangle split, rectangle split parts=2, below=of 852163503990.south, anchor=north]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (54320513415) [abstract, rectangle split, rectangle split parts=2, below=of 633894928094.south east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (238657438490) [abstract, rectangle split, rectangle split parts=2, below=of 633894928094.south west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (464370106410) [abstract, rectangle split, rectangle split parts=2, below=of 909581201875.south west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (633460844958) [abstract, rectangle split, rectangle split parts=2, right=of 898435211607.north east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (218694230243) [abstract, rectangle split, rectangle split parts=2, left=of 464370106410.north west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (61530530105) [abstract, rectangle split, rectangle split parts=2, below=of 218694230243.south, anchor=north]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (968717179313) [abstract, rectangle split, rectangle split parts=2, left=of 61530530105.north west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (508997622434) [abstract, rectangle split, rectangle split parts=2, right=of 61530530105.north east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (341903186786) [abstract, rectangle split, rectangle split parts=2, below=of 508997622434.south, anchor=north]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (193704826075) [abstract, rectangle split, rectangle split parts=2, below=of 341903186786.south east, anchor=north west]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \node (405958494301) [abstract, rectangle split, rectangle split parts=2, below=of 341903186786.south west, anchor=north east]
            {
               \textbf{Blablabla}
               \nodepart{second}
            };

            \draw[myarrow] (898435211607.north) -- ++(0,0.8) -| (909581201875.south);
            \draw[myarrow] (584324999444.north) -- ++(0,0.8) -| (898435211607.south);
            \draw[myarrow] (423475839122.north) -- ++(0,0.8) -| (584324999444.south);
            \draw[myarrow] (540317204728.north) -- ++(0,0.8) -| (584324999444.south);
            \draw[myarrow] (852163503990.north) -- ++(0,0.8) -| (584324999444.south);
            \draw[myarrow] (633894928094.north) -- ++(0,0.8) -| (852163503990.south);
            \draw[myarrow] (54320513415.north) -- ++(0,0.8) -| (633894928094.south);
            \draw[myarrow] (238657438490.north) -- ++(0,0.8) -| (633894928094.south);
            \draw[myarrow] (464370106410.north) -- ++(0,0.8) -| (909581201875.south);
            \draw[myarrow] (633460844958.north) -- ++(0,0.8) -| (909581201875.south);
            \draw[myarrow] (218694230243.north) -- ++(0,0.8) -| (909581201875.south);
            \draw[myarrow] (61530530105.north) -- ++(0,0.8) -| (218694230243.south);
            \draw[myarrow] (968717179313.north) -- ++(0,0.8) -| (218694230243.south);
            \draw[myarrow] (508997622434.north) -- ++(0,0.8) -| (218694230243.south);
            \draw[myarrow] (341903186786.north) -- ++(0,0.8) -| (508997622434.south);
            \draw[myarrow] (193704826075.north) -- ++(0,0.8) -| (341903186786.south);
            \draw[myarrow] (405958494301.north) -- ++(0,0.8) -| (341903186786.south);

         \end{tikzpicture}
      \end{adjustbox}
   \end{center}
\end{landscape}

\end{document}

enter image description here

puk
  • 3,061
  • 5
  • 30
  • 41

0 Answers0