pubviz 5.0.0 copy "pubviz: ^5.0.0" to clipboard
pubviz: ^5.0.0 copied to clipboard

A tool to visualize package dependencies and version constraints in your Dart project.

Visualize package dependencies in your Dart project #

Pub Package package publisher CI

Make sure you run pub get or pub upgrade in your target project directory.

Example #

Here's an example of pubviz run on itself.

Installing #

Activate pubviz.

$ dart pub global activate pubviz

Use #

If you have configured your PATH correctly, you can run pubviz directly.

$ pubviz

Otherwise, you can use the pub global command.

$ dart pub global run pubviz

Generate and open an HTML file for the package on the current path. #

$ pubviz

Should open your default browser to something like:

sample

$ pubviz -a print /path/to/http_package

You should see output something like:

digraph G {
  node [fontname=Helvetica];
  edge [fontname=Helvetica, fontcolor=gray];

  http [label="http
0.9.2+3",fontsize=18,style=bold,shape=box,margin="0.25,0.15"];
  http -> path [label=">=0.9.0 <2.0.0",penwidth=2];
  http -> stack_trace [label=">=0.9.1 <0.10.0",penwidth=2];
  http -> unittest [label=">=0.9.0 <0.10.0",penwidth=2,style=dashed];

  path [label="path
1.0.0",shape=box,margin="0.25,0.15",style=bold];

  stack_trace [label="stack_trace
0.9.1",shape=box,margin="0.25,0.15",style=bold];
  stack_trace -> path [label=">=1.0.0-rc.1 <2.0.0"];

  unittest [label="unittest
0.9.3",style=bold];
  unittest -> stack_trace [label=">=0.9.0 <0.10.0",color=gray];
}

Generate PDF, PNG and other files #

GraphViz tool allows dot format to be converted to various types of outputs like PNG, PDF or SVG.

In order to export pubviz data to PNG file you need to install GraphViz package on your machine (see detailed installation instructions).

On macOS:

brew install graphviz

On Windows:

winget install graphviz

Then you can save the pubviz output to a file and convert it with dot command to desired output type, e.g.:

pubviz -a print > output.dot
dot -Tpdf output.dot -o output.pdf

The full list of possible output types is available on the GraphViz website.

pubviz -? prints help #

$ pubviz -?
Usage: pubviz [<args>] [<package path>]

Arguments:
  -a, --action=<action>
            [create]               Generate the HTML web app in a directory.
            [open] (default)       Like "serve" but also opens the browser.
            [print]                Print the raw DOT output to stdout.
            [serve]                Like "create" but also hosts the app on a local server.

  -i, --ignore-packages            A comma separated list of packages to exclude in the output.
  -o, --[no-]flag-outdated         Check pub.dev for lasted packages and flag those that are outdated.
      --out-dir                    A directory to write the generated HTML file and its localized assets. (HTML format only)
  -d, --direct-dependencies        Include only direct dependencies.
  -p, --production-dependencies    Include only production (non-dev) dependencies.
  -v, --version                    Print the version of pubviz and exit.
  -w, --workspace                  Include all packages in the workspace.
  -?, --help                       Print this help content.

If <package path> is omitted, the current directory is used.
54
likes
140
points
6.06k
downloads

Documentation

API reference

Publisher

verified publisherkevmoo.com

Weekly Downloads

A tool to visualize package dependencies and version constraints in your Dart project.

Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

args, build_cli_annotations, collection, dhttpd, gviz, http, io, meta, path, pub_semver, pubspec_parse, stack_trace, string_scanner, yaml

More

Packages that depend on pubviz