Package Dependency Graph Visualization
pkg-dep-draw
8.17.0.6

Package Dependency Graph Visualization🔗ℹ

The pkg-dep-draw module provides a pkg-dep-draw function for drawing a package-dependency graph, and it also supports command-line options when run as a program.

To run from the command line, use

  racket -l- pkg-dep-draw option* root-pkg*

which shows packages reachable from the root-pkgs (or all packages if no root-pkgs are specified). The visualization shows packages that are either installed or available from the catalogs/directories specified by --catalog/--dir options. By default, the graph is shown in a GUI window, but use the -o flag to direct the output to a PNG or PDF file.

Packages are sorted in the visualization so that a package’s dependencies appear below it or at the same vertical layer (in the case that packages are mutually dependent). Build dependencies are shown with purple lines, while run-time dependencies are shown with blue lines. A blue or purple square connects packages that are mutually dependent, depending on whether they have a mutual run-time dependence (blue square) or merely a mutual build-time dependence (purple square). In GUI mode, click on a package name to pin its dependency lines (and click in an empty area to unpin lines).

As a program, pkg-dep-draw accepts the following command-line options:

  • --select pkg Draw dependencies starting from pkg, along with any other selected package (i.e., this flag can be specified multiple times to select multiple packages).

    By default, all dependency lines are show. Note that supplying a root-pkg as a command-line argument limits the packages that are listed in the graph overall, while --select limits only which dependency lines are shown.

  • --catalog catalog Read package information from catalog, along with any other specified catalogs and directories (i.e., this flag can be specified multiple times), instead of using the set of installed packages.

    If multiple catalogs and directories are provided, information in a later catalog/directory takes precedence over information in an earlier one.

  • --dir dir Read package information from dir (i.e., this flag can be specified multiple times), along with any other specified catalogs and directories, instead of using the set of installed packages.

    Each directory within dir that contains an "info.rkt" file is treated as a package.

  • --no-build Ignore build dependencies (as specified by build-deps in a package’s "info.rkt" file).

  • --no-build-lines Suppress lines in the visualization that represent build dependencies, even when build dependencies are otherwise used to compute the graph.

    In GUI mode, this option selects the initial state of the GUI, but it can be changed interactively.

  • --no-trans-lines Suppress lines in the visualization that represent transitive dependencies.

    In GUI mode, this option selects the initial state of the GUI, but it can be changed interactively.

  • --reverse Draw dependency lines backwards from the selected packages.

    In GUI mode, this option selects the initial state of the GUI, but it can be changed interactively.

  • --scale scale : Use scale as the initial drawing scale.

    Note that the width of lines used to show dependencies is insensitive to the scale. In GUI mode, this option selects the initial state of the GUI, but it can be changed interactively.

  • -o file Write the visualization to file, which must have an extension that is either ".png" or ".pdf", and disable the default GUI mode.

  • --quiet or -q Suppress hints and notes.

procedure

(pkg-dep-draw [#:root-pkgs root-pkgs    
  #:select-pkgs select-pkgs    
  #:srcs srcs    
  #:no-build? no-build?    
  #:no-build-lines? no-build-lines?    
  #:no-trans-lines? no-trans-lines?    
  #:invert? invert?    
  #:quiet quiet?    
  #:dest-file dest-file    
  #:dest-format dest-format    
  #:scale scale])  void?
  root-pkgs : (listof string?) = null
  select-pkgs : (listof string?) = null
  srcs : (listof (cons/c (or/c 'dir 'catalog) string?)) = null
  no-build? : any/c = #f
  no-build-lines? : any/c = #f
  no-trans-lines? : any/c = #f
  invert? : any/c = #f
  quiet? : any/c = #t
  dest-file : (or/c #f path-string?) = #f
  dest-format : (or/c 'png 'pdf) = #f
  scale : real? = 1
Draws a dependency graph the same as running pkg-dep-draw as a program with command-line arguments (with hopefully obvious representations and treatments of the arguments).