Skip to content
Fallow home
All docs pages

fallow viz

See where dead code, duplication, boundary violations, and complexity sit in your codebase. Fallow viz writes one self-contained HTML map with a file treemap and an import graph.

Use fallow viz to see where the findings sit in your codebase, and to click from a finding to the evidence behind it. The command runs one project analysis and writes one self-contained HTML file. The file needs no server and no external assets, and it has the same style as the rest of fallow. fallow viz is read-only.

fallow viz                       # writes fallow-viz.html and opens it in your browser
fallow viz --out map.html --no-open
fallow viz --viz-format dot      # emit the import graph as Graphviz DOT
fallow viz --viz-format mermaid  # emit the import graph as a Mermaid diagram

The two views

The HTML map has two views of the same project:

  • Treemap of files sized by bytes, nested by directory.
  • Force-directed import graph, with clusters by directory and by import community. When you focus a file, an import that loads its target only on demand (import(), a lazy glob, a worker) has a dashed line.

The four lenses

Each lens gives the map different colors. The two views share the four lenses:

LensWhat it shows
Dead codeUnused files, unused exports, and entry points
DuplicationShare of duplicated lines per file, with clone previews
BoundariesArchitecture zones from your boundaries config, with violating imports drawn in red
Complexity hotspotsPer-function cyclomatic and cognitive scores, including React context such as hook counts and JSX depth

Click a file to open a detail panel. The panel shows the evidence behind each finding:

  • unused export names
  • clone groups and their other locations
  • boundary crossings
  • cycle membership
  • importers and imports, as links to click through
  • a fallow ... --trace command that you can run to verify the finding

The map also has search, breadcrumb drill-down, keyboard shortcuts, shareable URL deep links, and dark and light themes. Findings have a hatch texture and an [E] or [W] prefix, so color is never the only signal. All motion follows prefers-reduced-motion.

Options

FlagDescription
--out <PATH>Output file path (default: fallow-viz.html in the project root)
--no-openDo not open the output file in the browser
--viz-format <FORMAT>Output format: html (default), dot (Graphviz), or mermaid

Global flags such as --root, --config, --production, --no-cache, --changed-since, --workspace, and --threads also apply.

Text formats

To pipe the import graph into other tools, use --viz-format dot or --viz-format mermaid. Fallow then writes the graph as text, and does not write the HTML map:

fallow viz --viz-format dot | dot -Tsvg -o graph.svg
fallow viz --viz-format mermaid > graph.mmd