# Functions T–T

Import these from `@grafloria/engine`.

## Functions

### `translateOptions`

One vocabulary in, each engine's dialect out.

The adapters disagree about names for the same concept — dagre says `rankdir`,
`nodesep`, `ranksep`; ELK says `elk.direction` with words instead of letters. Callers use one vocabulary whichever engine runs.

Exported for nested layout, which runs a DIFFERENT engine per container
(`group.subgraphLayout.algorithm`), so it has to translate the one vocabulary
per level rather than once up front. Reusing this is what stops the nested
path from quietly forking the options schema.

```ts
function translateOptions(
  engine: string,
  options: UnifiedLayoutOptions
): Partial<LayoutOptions>
```

### `treeLayout`

Tree layout over one connected component.

Component packing (see component-packing.ts) is what turns this into a FOREST
layout: each tree is laid out here, alone, and the boxes are packed afterwards. That division is why a five-tree forest comes out as five tidy trees rather
than the pile dagre produces.

```ts
function treeLayout(
  nodes: NodeModel[],
  links: LinkModel[],
  options: TreeLayoutOptions = {}
): LayoutResult
```
