Documentation Index
Fetch the complete documentation index at: https://mintlify.com/nrwl/nx/llms.txt
Use this file to discover all available pages before exploring further.
nx dep-graph
nx graph opens an interactive visualization of your workspace’s project dependency graph in the browser. You can also export the graph as JSON or HTML, filter by project, or show only affected projects.
Options
Output
Write the graph to a file instead of opening the browser. Supports
.json for raw data and .html for a self-contained interactive page.Print the project graph to stdout in the terminal instead of opening the browser.
View mode
Choose whether to visualize the project graph or the task graph. Choices:
projects, tasks.The targets to show when viewing the task graph (
--view=tasks). Accepts comma-separated values.Filtering
Highlight a single project and all of its ancestors and descendants. All other projects are dimmed.
Comma-separated list of projects to hide from the graph.
Highlight only the projects that are affected by recent changes. Requires git context (uses the same base/head logic as
nx affected).Base git ref for computing affected projects. Implies
--affected.Head git ref for computing affected projects. Implies
--affected.Treat specific files as changed when computing affected projects. Implies
--affected.Include uncommitted changes when computing affected projects. Implies
--affected.Include untracked files when computing affected projects. Implies
--affected.Display
Group projects visually by their folder path in the interactive graph.
Watch for workspace changes and automatically update the graph in the browser.
Open the graph in the default browser. Set to
false to start the server without opening.Server
IP address to bind the graph server to. Defaults to
localhost.Port to bind the graph server to.
Print additional information about the command.
Examples
The
nx affected:graph command is a deprecated alias for nx graph --affected. Use nx graph --affected instead.Using the interactive graph
When the graph opens in the browser, you can:- Click a project node to see its dependencies and dependents
- Use the sidebar to search for and filter projects
- Toggle between Projects and Tasks views
- Enable Group by folder to organize nodes by directory structure
- Use Focus to isolate a project’s subgraph
- Export the current view as a PNG or JSON
