# `core/layout/layout.ts`

<p class="generated-note">Generated from the exports of <a href="https://github.com/altasystem-ai/alta/blob/main/core/layout/layout.ts"><code>core/layout/layout.ts</code></a> · <code>npm run docs:gen</code></p>

Places the neutral entities in a 2D world, deterministically: the same state always gives the same places, so switching universes keeps every element where it was. Units are world pixels, origin at the centre.

**Standards that cite this file**: No standard page cites this file yet.

## Exports

### `Placed` 
```ts
interface Placed {
  e: Entity;
  x: number;
  y: number;
  /** Radius within which the player can interact with it. */
  r: number;
  /** For automations: the entity they circle around, and their angle and distance. */
  around?: { x: number; y: number; angle: number; dist: number };
}
```

### `Link` 
```ts
interface Link {
  from: string;
  to: string;
  kind: "flow" | "cycle" | "control";
}
```

### `Layout` 
```ts
interface Layout {
  placed: Placed[];
  links: Link[];
  bounds: { minX: number; minY: number; maxX: number; maxY: number };
  /** Where the player starts. */
  spawn: { x: number; y: number };
  /** The edge band where devices, accounts and interfaces sit (the outside world). */
  edgeY: number;
}
```

### `RING` 
Radius of the ring of the four core agents around the centre.

```ts
const RING = 400
```

### `layout` 
```ts
function layout(world: WorldState): Layout
```
