Following command will list out the dependency of a package.sudo apt-get install --dry-run eclipse | sed -n '/The following NEW/{n; :a; $!N;s/\n[[:blank:]][[:blank:]]/ /;ta;P;D;}'
sudo apt-get install --dry-run expect | sed -n '/The following NEW/{n; :a; $!N;s/\n[[:blank:]][[:blank:]]/ /;ta;P;D;}'
To generate charts, especially from scripts, i'd suggest you try
graphviz. I've found it to be very handy for such tasks.
SB