> For the complete documentation index, see [llms.txt](https://docs.hex-rays.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hex-rays.com/ida-9.5/core/disassembler/concepts/xref-graph.md).

# Xref Graph

{% hint style="info" %}
Starting with IDA 9.2, the external *qwingraph* used to make graphs has been replaced with a native and interactive graphing tool, **Xref Graph**.
{% endhint %}

The integrated **Xref Graph** visualizes cross-reference relationships between code and data elements in a binary through an interactive interface. Xref Graph is available right out of the box via **View → Graphs**: **Xrefs graph to** and **Xrefs graph from** start a graph at the current address, **Function calls** builds a call graph from the program's entry point (all cross-references followed in depth up to the [node count threshold](#options), with only Code edges shown), and **Manage...** opens the [Xref graph manager](#xref-graph-manager). The Xref Graph is also integrated in the [Pathfinder](/ida-9.5/core/disassembler/concepts/pathfinder.md) view.

## Core Features

* Interactive graph visualization of cross-references
* Multiple node types (code, data, imports) with distinct visual styling and cues
* Filtering options to focus your analysis
* Force-directed layout with interactive adjustment, or aligned hierarchical layout
* Multiple savable graphs per database
* Fully supported dark theme

## How to use Xref Graph

### Finding call paths

1. Use **View → Open Subviews →** [**Pathfinder**](/ida-9.5/core/disassembler/concepts/pathfinder.md) to select and add start, end, and optional intermediate points (waypoints). For example, if you want to see all possible ways from `main` to `LogError`, but want to exclude `Socket::Listen`, add `main` and `LogError` as start and end points, and add `Socket::Listen` to the **Exclusions** list.

![Pathfinder with waypoints, exclusions, and the built-in graph](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-c7298750a9045b2c89c72b39342c6021a86e7f68%2Fpathfinder-with-xg.png?alt=media)

2. The matching paths appear directly in the graph next to the waypoint list; see [Visualizing results](/ida-9.5/core/disassembler/concepts/pathfinder.md#visualizing-results). You get a hierarchical graph in which the start and end points, as well as any waypoints, are highlighted with a color scheme. The graph uses a static hierarchical layout with all nodes pinned; you can switch the layout mode, but every change of the path lays the graph out again. The **Add xrefs to/from node** and **Pin** actions are not available here; see [Built-in graph actions](/ida-9.5/core/disassembler/concepts/pathfinder.md#built-in-graph-actions) for what is.

### Exploring functions with aligned graph

You can also start your exploration from the selected entry point.

1. Place the cursor on a function, for example `main`, and invoke **Xrefs graph from...**.

![Unaligned graph](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-b4c01b6235b3bb5d92fe3e5c90a239c48efe121b%2Fbig-main-graph-not-aligned.png?alt=media)

Large graphs can be hard to read and confusing in the default layout.

2. If the initial graph looks cluttered, press `L` and get a much cleaner, better-aligned, and static graph.

![Aligned graph](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-90306e97de0d66539b7be65a928985482c6f0442%2Fbig-main-graph-aligned.png?alt=media)

3. Zoom in with the mouse wheel and take a closer look at the nodes.

![Zoomed aligned graph](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-e5028b1893bde801fe654fbf9106bceff51fc486%2Fbig-main-graph-aligned-part.png?alt=media)

Zooming in also reveals the small icons on each node. See [Visual Cues](#visual-cues) for what each one means.

## Visual Cues

Nodes display small icons in their headers to indicate associated annotations:

* **Bookmark** - the node has a bookmark set at that address. Click the icon to open the Bookmarks view filtered to that node.
* **Breakpoint** - a breakpoint is set at that address. Click the icon to open the Breakpoints view filtered to that node.
* **Comment** - the node has a comment attached. Click the icon to open a dialog with comments.
* **More references** - nodes that have cross-references to or from addresses not yet added to the graph are marked with an indicator, signaling that the node has more connections to explore. Click the up or down chevron to open a chooser for adding those xrefs, equivalent to [**Add xrefs...**](/ida-9.5/ida-actions/xrefgraphchoosexrefs.md) action filtered to a single direction. One, two, or three chevrons indicate the approximate number of references for this node that have not yet been added to the graph. The more references are missing, the more chevrons are shown, with three chevrons indicating the maximum level. The threshold values for the chevrons can be [adjusted](#options).

![Node Header with all cues](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-c4797e84b4e1474543cfa9b6b8a45ec1b5cb4267%2Fxref_graph_node.png?alt=media)

## Xref Graph Basic Controls

* **Move nodes around**: Click and drag a selected node
* **Pan**: Click and drag graph background to move the whole graph. Hold <kbd>Shift</kbd> while dragging to pan without accidentally selecting and moving nodes.
* **Zoom**: Hold <kbd>Ctrl</kbd>/<kbd>CMD</kbd> while scrolling to zoom in/out
* **Jump to address**: Double-click a node to navigate to the corresponding item in the IDA View
* **Layout**: Press <kbd>Space</kbd> to cycle the layout mode: **On** (the force-directed layout runs continuously), **Auto** (it runs until the graph settles, then stops) and **Off** (nodes stay where they are). The current mode is also shown and selectable in the [Options panel](#options-panel).
* **Pin**: Press <kbd>P</kbd> to pin the node in place
* **Search**: Press <kbd>Ctrl</kbd>/<kbd>CMD</kbd>+<kbd>F</kbd> to navigate to the Search Bar and search for nodes by name
* **Select**: Click a node, or hold <kbd>Ctrl</kbd> and drag on the background to select nodes with a rubber band. Right-click the background to clear the selection
* **Select all / invert**: <kbd>Ctrl</kbd>+<kbd>A</kbd> selects all nodes, <kbd>Ctrl</kbd>+<kbd>I</kbd> inverts the selection
* **Walk the graph**: With a single node selected, <kbd>Ctrl</kbd>+<kbd>Up</kbd> / <kbd>Ctrl</kbd>+<kbd>Down</kbd> jump to the node that leads to it / is reachable from it; when there are several, a chooser lets you pick one

### Adding and Removing Nodes

You can add or remove nodes from the graph using the right-click context menu on a node, or by using the following shortcuts with one or more nodes selected:

* Press <kbd>A</kbd> to add all cross-referenced nodes (**A**ll Xrefs)
* Press <kbd>F</kbd> to add nodes referenced by the selected nodes (Xrefs **F**rom)
* Press <kbd>T</kbd> to add nodes that reference the selected nodes (Xrefs **T**o)
* Press <kbd>X</kbd> to open a chooser dialog for selecting specific cross-references (**X**ref from or to)
* Press <kbd>D</kbd> or <kbd>Del</kbd> to delete the selected nodes (**D**elete)

### Components of the main graph view

#### Nodes

Nodes are color-coded by type:

* **Blue**: Code (functions, instructions)
* **Green**: Data (variables, structures)
* **Pink**: Imports (external references)

Each node displays the name of the element it represents.

#### Information Display

* **Node information**: Hover over a node to see its name, address, type, and cross-reference count in the top-left corner.
* **Edge information**: Hover over an edge to see its source, destination, and reference type.

## Fit to viewport

The Fit to viewport option adjusts the view to optimally display content:

* <kbd>W</kbd> (Now) - Fits selected nodes to the viewer; if no nodes are selected, it fits the entire graph.
* <kbd>Shift</kbd>+<kbd>W</kbd> (Always) - Enables continuous fitting to the viewer.

## Aligning nodes

You can rearrange nodes into a hierarchical layout, placing ancestor nodes above their descendants for a clearer tree-like view. To do so, choose [**Align**](/ida-9.5/ida-actions/xrefgraphalignlayout.md) from the context menu or press <kbd>L</kbd>. Aligning also pins every node, so the force-directed layout no longer moves them, and fits the whole graph in the view.

![Default layout](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-2cfa3fa3d213086ad117e36ad287b09754deb586%2Fdefault-layout-xrefgraph.png?alt=media) ![Aligned layout](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-ab122c643cc76cee0ad69951f5d7e102903b98cc%2Faligned-layout.png?alt=media)

## Xref graph manager

You can open Xref Graph manager via **View → Graphs → Manage...**.

![Xref Graph Manager](https://492083732-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FFP6ibt8r6WPBHTqekG9u%2Fuploads%2Fgit-blob-d0d4e04af256d5d8450e765129dc1b341e971c8e%2Fxref_graph_manager.png?alt=media)

The manager is a dirtree widget that lets you do all the usual things with graphs:

* open graphs in a new tab, or switch to a graph if it is already open;
* delete graphs (or folders containing graphs) using the <kbd>Del</kbd> key;
* create new graphs with the <kbd>Ins</kbd> key, using the current address as the starting point;
* rename graphs using <kbd>F2</kbd> or <kbd>Ctrl</kbd>/<kbd>CMD</kbd>+<kbd>E</kbd>;
* create a copy of a graph using the **Duplicate** action;
* rearrange and organize graphs into folders however you prefer;
* view the number of nodes in the graph.

By default, newly created paths (marked with `P`) are placed in the `Paths` folder.

## Additional elements

### Minimap

Press <kbd>M</kbd> to toggle the minimap, which shows an overview of the entire graph and helps with navigation in large graphs. The minimap highlights the current viewport area for easy orientation.

### Search Bar

Press <kbd>S</kbd> to toggle the Search Bar and Layout button.

### Options Panel

Press <kbd>O</kbd> to toggle the options panel, which includes:

#### Filters

The filters section allows you to control which elements are displayed:

* **Node name filter** - Filter nodes by name
* **Filter orphan nodes** - Hide nodes with no visible connections
* **Edge type filters** - Show/hide specific edge types (Read, Write, Offset, Code)
* **Node type filters** - Show/hide specific node types (Code, Data, Import)

The number of filtered (hidden) nodes is displayed at the top of the filter panel.

#### Gravity layout

The **On / Auto / Off** radio buttons select the layout mode; see [Basic Controls](#xref-graph-basic-controls).

## Options

Go to **Options → General → Graph** tab to configure the graph display parameters in the Xref Graph section:

* **Show strlits**: Show the contents of string literals inside data nodes
* **Max lines of strlits**: How many lines of a string literal to show; available only when **Show strlits** is on
* **Max node name length**: Maximum characters displayed in a node label
* **Nodes count threshold**: a limit on graph size for automatic generation; the graph is built only until this limit is reached. Adding additional cross-references (xrefs) beyond this limit requires confirmation, and the [Pathfinder](/ida-9.5/core/disassembler/concepts/pathfinder.md) tool suggests the shortest paths instead of full ones
* **Few missing xrefs threshold**: Nodes with fewer missing xrefs than this show the "low amount" indicator. Higher values widen the "low" band (for chevrons)
* **Many missing xrefs threshold**: Nodes with at least this many missing xrefs show the "high amount" indicator (for chevrons). The displayed count is also capped at this

## Low-Level Layout Configuration

The force-directed graph layout can be customized with the following parameters, stored in the **xref-graph.cfg** file:

* **Drag** - Controls how quickly node movement slows down (damping)
* **Gravity** - Pulls nodes toward the center of the graph
* **Repulsion** - Controls how strongly nodes push each other away
* **Spring strength** - Determines how rigidly the edges hold nodes together
* **Spring length** - Sets the preferred distance between connected nodes
* **Minimum velocity** - Threshold below which node movement stops
* **Maximum velocity** - Caps the maximum speed of node movement
* **Node mass** - Base mass value for nodes (affects how easily they move)
* **Edge mass** - Base mass value for edges (affects how easily group of nodes move)
* **Timestep** - Controls the simulation speed
* **Theta threshold** - Performance parameter for the Barnes-Hut approximation
* **New node spawn radius** - How far from their origin node newly added nodes appear
* **Settle time limit** - Hard cap, in milliseconds, on how long the **Auto** layout mode keeps running
* **Settle quiet ticks** - How many consecutive ticks the graph must stay quiet before **Auto** stops
* **Settle drift velocity** - Speed below which a node counts as at rest
* **Settle drift fraction** - Fraction of the nodes that must be at rest for the graph to count as settled


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.hex-rays.com/ida-9.5/core/disassembler/concepts/xref-graph.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
