> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Panels

> Stat tiles, sortable tables and scatter maps in a Script panel, on a clock of its own.

Tables, stat tiles and scatter maps in a workspace panel, with the script's graphs, in the order declared. Made for what has no time axis, such as a table of 20 markets or where each sits by price change and open interest change. Declared at the top level; set by key from the chart's handlers, and rolled back with the forming bar. A chart script's blocks show in a Script panel its legend opens; a panel script (`indicator(name, { panel: true })`) runs in one.

## panel

Blocks for a script panel, at most 16 a script with its graphs.

**stats()** `(title?: string, options?: PanelBlockOptions & \{ format?: CellFormat; precision?: number \}): PanelStats`

A row of stat tiles, such as Positioning, Absorption and Leaders. Spans both columns by default.

**table()** `(title: string, options: PanelTableOptions): PanelTable`

A table the reader can sort by any column, arrange and resize.

**scatter()** `(title: string, options?: PanelScatterOptions): PanelScatter`

Points on two value axes, labelled, with lines through 0 and named quadrants.

## CellFormat

How a value is written: `number` to the precision or compact from 10,000 (12.4K), `percent` with
a % sign (set values in percent), `price` as the panel's market prints prices, `compact` always
compact (1.2M). `text` and `market` cells take text; a market cell (`'ETH'`, `'xyz:GOLD'`)
switches the charts linked to the panel when clicked.

```ts theme={"theme":"github-dark"}
type CellFormat = 'text' | 'number' | 'percent' | 'price' | 'compact' | 'market';
```

## PanelBlockOptions

**span?** `1 | 2`

Columns of the panel's grid the block spans when the panel is wide enough for two.

## PanelStats

**set()** `(label: string, value: number | string, options?: \{ color?: Color | null; note?: string; signed?: boolean \}): void`

A tile: its label, which is its key, and its value, a number in the block's format or text.
`note` is a smaller line under the value; `signed` writes a + on a positive number and colours
it up or down where `color` is not set. Tiles keep the order their labels were first set.

**delete()** `(label: string): void`

**clear()** `(): void`

## PanelTableColumn

**title** `string`

**format?** `CellFormat`

Default `'number'`; a bare title makes the first column `'text'`.

**precision?** `number`

**signed?** `boolean`

A + on positive numbers, and up and down colours where the row sets none.

## PanelTableOptions

**columns** `(string | PanelTableColumn)[]`

Titles, or columns with a format. At most 16.

**sort?** `string | number | \{ column: string | number; descending?: boolean \}`

The column rows are sorted by (its title or index) until the reader clicks another; descending unless `descending: false`.

## PanelTable

**row()** `(key: string, values: (number | string | null)[], options?: \{ colors?: (Color | null | undefined)[] \}): void`

A row by key: a value per column, numbers for number columns (`na` prints a dash and sorts
last) and text for text and market ones. Setting a key again replaces the row in place. At most
1,000 rows.

**delete()** `(key: string): void`

**clear()** `(): void`

## PanelScatterAxis

**title?** `string`

**format?** `'number' | 'percent'`

**precision?** `number`

**scale?** `'linear' | 'sqrt'`

`'sqrt'`: a signed square root about 0, so a cluster near 0 spreads and one outlier does not squash it.

## PanelQuadrant

```ts theme={"theme":"github-dark"}
type PanelQuadrant = string | { label: string; color?: Color | null };
```

## PanelScatterOptions

**x?** `string | PanelScatterAxis`

An axis's title, or its title, format, precision and scale.

**y?** `string | PanelScatterAxis`

**quadrants?** `[PanelQuadrant, PanelQuadrant, PanelQuadrant, PanelQuadrant]`

The four quadrants about 0, top left, top right, bottom left, bottom right: a name written in
its corner, or a name and a colour the quadrant is faintly tinted with.

## PanelScatter

**point()** `(key: string, x: number, y: number, options?: \{ color?: Color | null; label?: string; note?: string; /** Where the point was before, oldest first, up to 30 `\[x, y]` pairs: drawn as a fading tail into it, as a relative rotation graph does. */ tail?: [number, number][]; \}): void`

A point by key at (`x`, `y`): `label` is written on it (24 characters at most), `note` shows
on hover. A point with an `na` coordinate is not drawn. At most 1,000.

**delete()** `(key: string): void`

**clear()** `(): void`

## Next step

Continue with [Drawings](https://docs.0xarchive.io/terminal/reference/drawings.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.