# TimelineGeometry

> Computes framework-neutral timeline ruler positions and profile-span geometry.

[API reference](/docs/api/index.md) › [Debug Core](/docs/extensions/debug-core/reference/index.md) › [Panel](/docs/extensions/debug-core/reference/panel/index.md) › [Timeline](/docs/extensions/debug-core/reference/panel/timeline/index.md) › TimelineGeometry

| final class | `PHPForge\Debug\Panel\Timeline\TimelineGeometry` |
| --- | --- |
| Source | [`src/Panel/Timeline/TimelineGeometry.php`](https://github.com/php-forge/debug-core/blob/main/src/Panel/Timeline/TimelineGeometry.php#L17) |

Computes framework-neutral timeline ruler positions and profile-span geometry.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`rulers()`](#method-rulers) static | Returns adaptive ruler ticks keyed by milliseconds and valued by percentage offsets. | `TimelineGeometry` |
| [`spans()`](#method-spans) static | Converts captured profile rows into positioned timeline spans. | `TimelineGeometry` |

## Method details

### rulers() <span id="method-rulers"></span>

```php
public static function rulers(float $duration, int $line = 6): array<int, float>
```

Returns adaptive ruler ticks keyed by milliseconds and valued by percentage offsets.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$duration` | `float` |  |
| `$line` | `int` |  |

**Returns**

`array<int, float>`: Ruler offsets.

### spans() <span id="method-spans"></span>

```php
public static function spans(list<PHPForge\Debug\Panel\Profile\ProfileRow> $rows, float $start, float $duration): list<PHPForge\Debug\Panel\Timeline\TimelineSpanRow>
```

Converts captured profile rows into positioned timeline spans.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$rows` | `list<`[`PHPForge\Debug\Panel\Profile\ProfileRow`](/docs/extensions/debug-core/reference/panel/profile/profilerow/index.md)`>` | Profile rows in capture order. |
| `$start` | `float` |  |
| `$duration` | `float` |  |

**Returns**

`list<`[`TimelineSpanRow`](/docs/extensions/debug-core/reference/panel/timeline/timelinespanrow/index.md)`>`: Positioned spans in capture order.