---
name: RelationType
lang: cpp
domain: viz
version: "1.0.0"
algebraic: product
definition: |
  struct RelationType {
      uint32_t color;
      uint8_t  style;
      float    width;
      const char* name;
  };
description: "Clase visual de una arista. La tabla RelationType[] vive en GraphData::rel_types y las aristas referencian via GraphEdge::type_id. Define color (RGBA8), style (EDGE_SOLID/DASHED/DOTTED), width en pixels y nombre."
tags: [graph, type, relation, edge, visual, style]
uses_types: []
file_path: "cpp/functions/viz/graph_types.h"
---

## Campos

| Campo | Descripcion |
|---|---|
| `color` | RGBA8 (R en LSB) |
| `style` | `EDGE_*` (`SOLID`, `DASHED`, `DOTTED`). Issue 0049f anadira los estilos no-solid a la GPU |
| `width` | Pixels en pantalla. Aplicado via `glLineWidth` (clamp del driver al maximo soportado) |
| `name` | C-string propiedad del caller. Solo UI/debug |

## Helper

```cpp
RelationType knows  = relation_type(0xFF888888u, EDGE_SOLID,  1.0f, "knows");
RelationType owns   = relation_type(0xFFEAB308u, EDGE_DASHED, 1.5f, "owns");
```

## Uso tipico

```cpp
RelationType rels[] = {
    relation_type(0xFF888888u, EDGE_SOLID, 1.0f, "default"),
};
graph.rel_types     = rels;
graph.rel_type_count = 1;
```
