# Analytics Heatmap

Analytics mode provides a visual representation of traffic directly on the bot's flowchart. It is enabled via the **"Graph"** button (chart icon) on the builder's left toolbar.

## How to enable

Click the **"Graph"** button in the top-left corner of the editor. Standard angular connector lines are replaced by smooth "rivers" that visualize traffic volume through color and line thickness.

---

## What is displayed

### "River" flows

In analytics mode, every connection (transition between commands) transforms into a smooth Bézier curve:

- **For button-based transitions** — the "river" flows out from the right edge of the specific button.
- **For automatic transitions** (where the "Next command" field is used without buttons) — the "river" flows out from the bottom of the block.

### Line thickness

Reflects the absolute number of transitions along that connection:

- **Thin line (1–2 px)** — an infrequent path; very few transitions.
- **Thick line (5–10 px)** — a major "artery" taken by the majority of users.

Formula: `W = 1 + (V / V_max) × 9`

### Line color (temperature)

Indicates CTR — the percentage of users who viewed the block and clicked that specific button:

| Color | CTR | Meaning |
|------|-----|----------|
| 🔵 Blue | < 20% | Button rarely clicked |
| 🟢 Green | 20–60% | Moderate activity |
| 🟠 Orange / 🔴 Red | > 60% | High response |

### Particle animation

Slow-moving white dots appear on the most "heavily loaded" connections (traffic ≥ 20% of the maximum). The speed depends on the average time a user spent on the previous block before clicking—the faster the clicks, the faster the dots move.

---

## Tooltip

Hovering the mouse over a line displays a pop-up box:

```
Transitions: 450 (12% of traffic)
Average time: 5 sec
```

---

## Control Panel

A mini-panel with two controls appears below the toolbar:

### "Successful Path" Filter

The **"Successful Path"** button (route icon) dims all lines and blocks that **do not lead to the scenario's final point**. A final point is defined as a command with no outgoing transitions (a leaf node in the graph).

Use this mode to instantly see the path a client takes to reach the end of the scenario—such as completing a test or making a payment.

### "Refresh" Button

Forces a reload of statistics from the server without refreshing the page.