# TimelineMemoryRenderer

> Renders profiler memory samples as the shared inline timeline SVG.

[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) › TimelineMemoryRenderer

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

Renders profiler memory samples as the shared inline timeline SVG.

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| [`render()`](#method-render) static | Renders an SVG memory graph, or `''` when its geometry cannot be resolved. | `TimelineMemoryRenderer` |

## Method details

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

```php
public static function render(list<PHPForge\Debug\Panel\MemorySample> $samples, float $start, float $duration, int $memory, int $width = 1920, int $height = 40): string
```

Renders an SVG memory graph, or `''` when its geometry cannot be resolved.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$samples` | `list<`[`PHPForge\Debug\Panel\MemorySample`](/docs/extensions/debug-core/reference/panel/memorysample/index.md)`>` | Memory samples in any order. |
| `$start` | `float` | Request start time the horizontal axis is offset from. |
| `$duration` | `float` | Request duration the horizontal axis spans, in seconds. |
| `$memory` | `int` | Peak memory the vertical axis scales to, in bytes. |
| `$width` | `int` | Viewport width, in user units. |
| `$height` | `int` | Viewport height, in user units. |

**Returns**

`string`: Inline SVG markup, or an empty string when the geometry cannot be resolved.