# `DalaDev.ClusterViz`
[🔗](https://github.com/manhvu/dala_dev/blob/main/lib/dala_dev/cluster_viz.ex#L1)

Cluster visualization for dala Elixir nodes.

Provides web-based dashboard with D3.js graphs for:
- Cluster topology visualization
- Node health dashboard
- Process distribution visualization
- LiveView message flow diagram
- Real-time metrics (memory, reductions, message queue)

Integrates with `dala.server` to serve the dashboard.

# `node_info`

```elixir
@type node_info() :: %{
  node: node(),
  status: :alive | :unreachable,
  memory: map(),
  reductions: integer(),
  process_count: integer(),
  message_queue_len: integer(),
  latency_ms: integer() | nil
}
```

# `generate_dashboard`

```elixir
@spec generate_dashboard(keyword()) :: {:ok, :started} | {:error, term()}
```

Generate HTML dashboard page.

Options:
- `:port` - Server port (default: 4000)
- `:refresh_interval` - Auto-refresh interval in ms (default: 5000)

# `health_dashboard`

```elixir
@spec health_dashboard() :: {:ok, map()} | {:error, term()}
```

Generate node health dashboard data.

Returns a map with per-node metrics.

# `liveview_flow`

```elixir
@spec liveview_flow() :: {:ok, map()} | {:error, term()}
```

Generate LiveView message flow data.

Returns a map with message flow between processes.

# `process_distribution`

```elixir
@spec process_distribution() :: {:ok, map()} | {:error, term()}
```

Generate process distribution visualization data.

Returns a map with:
- `:supervisors` - Supervision tree structure
- `:processes` - Process list with stats

# `topology`

```elixir
@spec topology() :: {:ok, map()} | {:error, term()}
```

Generate cluster topology data.

Returns a map with:
- `:nodes` - List of node information
- `:connections` - List of {node1, node2} tuples
- `:timestamp` - Current timestamp

---

*Consult [api-reference.md](api-reference.md) for complete listing*
