> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fallow.tools/llms.txt
> Use this file to discover all available pages before exploring further.

# fallow viz

> CLI reference for fallow viz. Render your codebase as a single self-contained interactive HTML map: a file treemap and an import graph, each recolored by dead-code, duplication, boundaries, and complexity lenses.

Render your codebase as an interactive map. `fallow viz` runs one project analysis and writes a single self-contained HTML file (no server, no external assets) styled like the rest of fallow. It is read-only and honors `--production`, `--config`, and `--no-cache` like the analysis commands.

```bash theme={null}
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 report gives you two views over the same project:

* **Treemap** of files sized by bytes, nested by directory.
* **Force-directed import graph** with directory and import-community clustering.

## The four lenses

Both views share four lenses that recolor the same map:

| Lens                    | What it shows                                                                                           |
| :---------------------- | :------------------------------------------------------------------------------------------------------ |
| **Dead code**           | Unused files, unused exports, and entry points                                                          |
| **Duplication**         | Share of duplicated lines per file, with clone previews                                                 |
| **Boundaries**          | Architecture zones from your `boundaries` config, with violating imports drawn in red                   |
| **Complexity hotspots** | Per-function cyclomatic and cognitive scores, including React context such as hook counts and JSX depth |

Click any file to open a detail panel with the evidence behind each finding: unused export names, clone groups and their other locations, boundary crossings, cycle membership, importers and imports as click-through navigation, and a runnable `fallow ... --trace` command to verify the finding yourself.

Search, breadcrumb drill-down, keyboard shortcuts, shareable URL deep links, and dark/light themes are built in. Findings carry a hatch texture and `[E]`/`[W]` prefixes so color is never the only signal, and all motion honors `prefers-reduced-motion`.

## Options

| Flag                    | Description                                                                   |
| :---------------------- | :---------------------------------------------------------------------------- |
| `--out <PATH>`          | Output file path (default: `fallow-viz.html` in the project root)             |
| `--no-open`             | Do not open the output file in the browser                                    |
| `--viz-format <FORMAT>` | Visualization output format: `html` (default), `dot` (Graphviz), or `mermaid` |
| `--root <ROOT>`         | Project root directory                                                        |
| `--config <CONFIG>`     | Path to a config file                                                         |
| `--production`          | Production mode: exclude test/story/dev files                                 |
| `--no-cache`            | Disable incremental caching                                                   |

Global flags such as `--changed-since`, `--workspace`, and `--threads` also apply; see [global flags](/cli/global-flags).

## Text formats

`--viz-format dot` and `--viz-format mermaid` emit the import graph as text instead of the HTML map, for piping into other tools:

```bash theme={null}
fallow viz --viz-format dot | dot -Tsvg -o graph.svg
fallow viz --viz-format mermaid > graph.mmd
```

## Related

* [`fallow dead-code`](/cli/dead-code), [`fallow dupes`](/cli/dupes), and [`fallow health`](/cli/health) produce the findings the lenses visualize
* [`fallow trace`](/cli/trace) verifies a single finding from the command line, matching the `--trace` command in each detail panel
