# @askrjs/charts

> Published API exports for @askrjs/charts.

Source: [https://askrjs.com/docs/reference/api/charts/root](https://askrjs.com/docs/reference/api/charts/root)

Status: stable. Packages: @askrjs/charts.

**Published packages are authoritative.** Examples may lag behind a published contract. When guidance differs, verify the exports and TypeScript declarations in your installed package, then file an issue.

## Exports

This entrypoint publishes 100 exports from the declarations shipped by @askrjs/charts.

### `AggregatedNumericChannelInput`

```ts
AggregatedNumericChannelInput: RowChannelInput<Row, number> | ChannelExpression<number, NumericField<Row>, "count" | "sum" | "mean" | "stack" | "normalize">
```

A numeric channel input that may additionally be an aggregate expression.

### `AggregateOperation`

```ts
AggregateOperation: "count" | "sum" | "mean"
```

Aggregate operations supported by grouping expressions.

### `appendPlotRows`

```ts
appendPlotRows: <Row>(rows: readonly Row[], appended: readonly Row[] | Row) => readonly Row[]
```

Appends one or more rows to `rows`, returning a new frozen array (or `rows` if nothing was added).

### `ArcProps`

```ts
ArcProps: any
```

Props for `Plot.Arc`.

- `category`: category?: RowColorChannelInput<Row> | undefined;

- `colorScale`: colorScale?: string | undefined;

- `cornerRadius`: cornerRadius?: number | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `endAngle`: endAngle?: number | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `innerRadius`: innerRadius?: number | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `max`: max?: number | undefined;

- `min`: min?: number | undefined;

- `opacity`: opacity?: number | undefined;

- `outerRadius`: outerRadius?: number | undefined;

- `padAngle`: padAngle?: number | undefined;

- `startAngle`: startAngle?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `value`: value: RowNumericChannelInput<Row>;

- `xScale`: xScale?: string | undefined;

- `yScale`: yScale?: string | undefined;

### `AreaProps`

```ts
AreaProps: any
```

Props for `Plot.Area`.

- `baseline`: baseline?: number | undefined;

- `colorScale`: colorScale?: string | undefined;

- `curve`: curve?: "step" | "linear" | "monotone" | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `normalize`: normalize?: boolean | undefined;

- `opacity`: opacity?: number | undefined;

- `stack`: stack?: boolean | CategoricalField<Row> | RowAccessor<Row, PlotScalar> | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x: BinnedScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: AggregatedNumericChannelInput<Row>;

- `y2`: y2?: RowNumericChannelInput<Row> | undefined;

- `yScale`: yScale?: string | undefined;

### `AxisOrientation`

```ts
AxisOrientation: "top" | "right" | "bottom" | "left"
```

The side of the plot an axis is rendered on.

### `AxisProps`

```ts
AxisProps: any
```

Props for `Plot.Axis`.

- `axis`: axis?: CartesianAxis | undefined;

- `grid`: grid?: boolean | undefined;

- `label`: label?: string | undefined;

- `orient`: orient?: AxisOrientation | undefined;

- `scale`: scale?: string | undefined;

- `tickCount`: tickCount?: number | undefined;

- `tickFormat`: tickFormat?: ((value: ScaleValue) => string) | undefined;

### `BarProps`

```ts
BarProps: any
```

Props for `Plot.Bar`.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `inset`: inset?: number | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `max`: max?: number | undefined;

- `min`: min?: number | undefined;

- `normalize`: normalize?: boolean | undefined;

- `opacity`: opacity?: number | undefined;

- `orientation`: orientation?: "vertical" | "horizontal" | undefined;

- `radius`: radius?: number | undefined;

- `stack`: stack?: boolean | CategoricalField<Row> | RowAccessor<Row, PlotScalar> | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x: BinnedScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: AggregatedNumericChannelInput<Row>;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `bin`

```ts
bin: { <Field extends string>(input: Field, options?: BinOptions): ChannelExpression<number | Date, Field, "bin">; <Row>(input: ChannelInput<Row, number | Date>, options?: BinOptions): ChannelExpression<number | Date, never, "bin">; }
```

Bins a numeric or temporal channel into discrete intervals.

### `BinnedScaleChannelInput`

```ts
BinnedScaleChannelInput: RowChannelInput<Row, string | number | Date> | ChannelExpression<number | Date, NumericField<Row> | TemporalField<Row>, "bin">
```

A channel input for scales that may be binned, e.g. via {@link bin }.

### `BinOptions`

```ts
BinOptions: any
```

Options for {@link bin }.

- `thresholds`: thresholds?: number | readonly number[];

- `interval`: interval?: number;

- `domain`: domain?: readonly [number | Date, number | Date];

### `BrushProps`

```ts
BrushProps: any
```

Props for `Plot.Brush`.

- `axis`: axis?: "x" | "y" | "xy" | undefined;

- `modifier`: modifier?: "shift" | "none" | undefined;

### `CartesianAxis`

```ts
CartesianAxis: "x" | "y"
```

A Cartesian axis identifier.

### `CartesianMarkProps`

```ts
CartesianMarkProps: any
```

Props shared by marks positioned on Cartesian (x/y) axes.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x?: unknown;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y?: unknown;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `CategoricalField`

```ts
CategoricalField: FieldOfType<Row, string | number | boolean>
```

Field names of `Row` holding categorical (string, number, or boolean) values.

### `CellProps`

```ts
CellProps: any
```

Props for `Plot.Cell`.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `inset`: inset?: number | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `value`: value?: RowNumericChannelInput<Row> | undefined;

- `x`: x: RowScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: RowScaleChannelInput<Row>;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `ChannelExpression`

```ts
ChannelExpression: any
```

A serialized channel transform produced by helpers such as {@link bin }, {@link sum },
or {@link stack }, and consumed by mark channel props (e.g. `x`, `y`).

- `__askrPlotExpression`: readonly __askrPlotExpression: true;

- `kind`: readonly kind: Kind;

- `input`: readonly input?: unknown;

- `options`: readonly options: Readonly<Record<string, unknown>>;

- `__field`: readonly __field?: Field;

- `__value`: readonly __value?: Value;

### `ChannelExpressionKind`

```ts
ChannelExpressionKind: "constant" | "bin" | "count" | "sum" | "mean" | "group" | "stack" | "normalize" | "moving-window" | "moving-average" | "regression"
```

The discriminant `kind` values a {@link ChannelExpression} may carry.

### `ChannelInput`

```ts
ChannelInput: FieldOfType<Row, Value> | RowAccessor<Row, Value> | ChannelExpression<Value, FieldOfType<Row, Value>>
```

Anything usable as a mark channel input: a field name, an accessor, or a channel expression.

### `ColorChannelInput`

```ts
ColorChannelInput: ChannelInput<Row, string | number | boolean>
```

A channel input resolving to a color-scale-compatible value.

### `constant`

```ts
constant: <Value>(value: Value) => ChannelExpression<Value, never, "constant">
```

A channel expression that always resolves to the same fixed value for every row.

### `count`

```ts
count: () => ChannelExpression<number, never, "count">
```

Counts the number of rows in each group.

### `createPlot`

```ts
createPlot: <Row>() => PlotFactory<Row>
```

Creates a self-contained set of plot components (`Root`, marks, scales, and
annotations) bound to a single row type.

```tsx
const Plot = createPlot<{ x: number; y: number }>();
<Plot.Root data={rows} rowKey="x" label="Example">
  <Plot.Line x="x" y="y" />
</Plot.Root>
```

### `CrosshairProps`

```ts
CrosshairProps: any
```

Props for `Plot.Crosshair`.

- `axes`: axes?: "x" | "y" | "xy" | undefined;

### `FieldOfType`

```ts
FieldOfType: { [Field in RowField<Row>]-?: Present<Row[Field]> extends Value ? Field : never; }[RowField<Row>]
```

The field names of `Row` whose (non-nullable) value type is assignable to `Value`.

### `filterRows`

```ts
filterRows: <Row>(predicate: (row: Readonly<Row>, index: number) => boolean) => RowTransform<Row>
```

A row transform that keeps only rows for which `predicate` returns true.

### `FollowLatest`

```ts
FollowLatest: number | FollowLatestRows | FollowLatestTime<Row>
```

`RootProps.followLatest` shorthand: a bare number is treated as a row count
(equivalent to `{ rows: n }`).

### `FollowLatestRows`

```ts
FollowLatestRows: any
```

Keep only the most recent N rows; see {@link FollowLatest}.

- `rows`: rows: number;

### `FollowLatestTime`

```ts
FollowLatestTime: any
```

Keep only rows within a trailing time window of a temporal field; see {@link FollowLatest}.

- `durationMs`: durationMs: number;

- `field`: field: TemporalField<Row> | RowAccessor<Row, Date>;

### `GridProps`

```ts
GridProps: any
```

Props for `Plot.Grid`.

- `axis`: axis?: CartesianAxis | undefined;

- `scale`: scale?: string | undefined;

- `tickCount`: tickCount?: number | undefined;

### `group`

```ts
group: { <Field extends string>(input: Field): ChannelExpression<unknown, Field, "group">; <Row, Value>(input: ChannelInput<Row, Value>): ChannelExpression<Value, never, "group">; }
```

Groups rows by a channel's distinct values.

### `LegendProps`

```ts
LegendProps: any
```

Props for `Plot.Legend`.

- `interactive`: interactive?: boolean | undefined;

- `label`: label?: string | undefined;

- `position`: position?: "top" | "right" | "bottom" | "left" | undefined;

- `scale`: scale?: string | undefined;

### `LineProps`

```ts
LineProps: any
```

Props for `Plot.Line`.

- `colorScale`: colorScale?: string | undefined;

- `curve`: curve?: "step" | "linear" | "monotone" | undefined;

- `dash`: Explicit stroke dash pattern. When omitted, a multi-series line mark cycles
accessible dash patterns; pass an empty array to keep every series solid.

- `data`: data?: PlotData<Row> | undefined;

- `defined`: defined?: RowAccessor<Row, boolean> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `strokeWidth`: strokeWidth?: number | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x: RowScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: RowNumericChannelInput<Row>;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `MarkBaseProps`

```ts
MarkBaseProps: any
```

Props shared by all mark components.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `xScale`: xScale?: string | undefined;

- `yScale`: yScale?: string | undefined;

### `mean`

```ts
mean: { <Field extends string>(input: Field): ChannelExpression<number, Field, "mean">; <Row>(input: NumericChannelInput<Row>): ChannelExpression<number, never, "mean">; }
```

Averages a numeric channel across each group.

### `MeterSemantics`

```ts
MeterSemantics: any
```

ARIA `meter` role semantics applied to the plot's graphic region.

- `role`: role: "meter";

- `min`: min: number;

- `max`: max: number;

- `value`: value: number;

- `valueText`: valueText?: string;

### `movingAverage`

```ts
movingAverage: { <Field extends string>(input: Field, options: Omit<MovingWindowOptions, "operation">): ChannelExpression<number, Field, "moving-average">; <Row>(input: NumericChannelInput<Row>, options: Omit<MovingWindowOptions, "operation">): ChannelExpression<number, never, "moving-average">; }
```

Shorthand for {@link movingWindow} with `operation: "mean"`.

### `movingWindow`

```ts
movingWindow: { <Field extends string>(input: Field, options: MovingWindowOptions): ChannelExpression<number, Field, "moving-window">; <Row>(input: NumericChannelInput<Row>, options: MovingWindowOptions): ChannelExpression<number, never, "moving-window">; }
```

Applies a sliding-window aggregate (sum, mean, min, or max) to a numeric channel.

### `MovingWindowOptions`

```ts
MovingWindowOptions: any
```

Options for {@link movingWindow } and {@link movingAverage }.

- `window`: window: number;

- `operation`: operation?: WindowOperation;

- `partial`: partial?: boolean;

### `normalize`

```ts
normalize: { <Field extends string>(input: Field): ChannelExpression<number, Field, "normalize">; <Row>(input: NumericChannelInput<Row>): ChannelExpression<number, never, "normalize">; }
```

Normalizes a numeric channel's values within each group to a 0–1 (or proportional) range.

### `NumericChannelInput`

```ts
NumericChannelInput: ChannelInput<Row, number>
```

A channel input resolving to a number.

### `NumericField`

```ts
NumericField: FieldOfType<Row, number>
```

Field names of `Row` holding numbers.

### `partition`

```ts
partition: <Row>(options: PartitionOptions<Row>) => RowTransform<Row>
```

A row transform that builds a hierarchy (e.g. for treemap/icicle-style marks) from flat rows.

### `PartitionOptions`

```ts
PartitionOptions: any
```

Options for {@link partition }.

- `id`: id: RowField<Row> | RowAccessor<Row, PlotKey>;

- `parentId`: parentId?: RowField<Row> | RowAccessor<Row, PlotKey | null | undefined>;

- `children`: children?: RowField<Row> | RowAccessor<Row, readonly Row[] | null | undefined>;

- `value`: value: RowNumericChannelInput<Row>;

- `padding`: padding?: number;

### `PlotApi`

```ts
PlotApi: any
```

The imperative API exposed for a rendered plot, delivered via `RootProps.onApiChange`.

- `resetView`: resetView(): void;

- `resumeLive`: resumeLive(): void;

- `exportPng`: exportPng(options?: PlotPngExportOptions): Promise<Blob>;

- `exportSvg`: exportSvg(options?: PlotSvgExportOptions): string;

- `exportData`: exportData(options?: PlotDataExportOptions): string;

- `rows`: readonly rows: readonly Row[];

### `PlotChannelValue`

```ts
PlotChannelValue: PlotScalar | null | undefined
```

A channel value, allowing for missing data.

### `PlotData`

```ts
PlotData: readonly Row[] | (() => readonly Row[])
```

The data a plot consumes: a readonly array of rows, or a function producing one.

### `PlotDataExportOptions`

```ts
PlotDataExportOptions: any
```

Options for {@link PlotApi.exportData}.

- `view`: view?: "current" | "full";

- `rows`: rows?: "source" | "transformed";

- `scope`: scope?: "all" | "visible" | "selected";

- `format`: format?: "csv" | "json";

### `PlotExportViewOptions`

```ts
PlotExportViewOptions: any
```

Options shared by the plot export methods that capture a rendered view.

- `view`: view?: "current" | "full";

- `background`: background?: string | null;

### `PlotFactory`

```ts
PlotFactory: any
```

The set of components returned by {@link createPlot } for a given row type.

- `Root`: readonly Root: PrimitiveComponent<RootProps<Row>>;

- `Scale`: readonly Scale: PrimitiveComponent<ScaleProps>;

- `Axis`: readonly Axis: PrimitiveComponent<AxisProps>;

- `Grid`: readonly Grid: PrimitiveComponent<GridProps>;

- `Bar`: readonly Bar: PrimitiveComponent<BarProps<Row>>;

- `Line`: readonly Line: PrimitiveComponent<LineProps<Row>>;

- `Area`: readonly Area: PrimitiveComponent<AreaProps<Row>>;

- `Point`: readonly Point: PrimitiveComponent<PointProps<Row>>;

- `Arc`: readonly Arc: PrimitiveComponent<ArcProps<Row>>;

- `Cell`: readonly Cell: PrimitiveComponent<CellProps<Row>>;

- `Rect`: readonly Rect: PrimitiveComponent<RectProps<Row>>;

- `Rule`: readonly Rule: PrimitiveComponent<RuleProps<Row>>;

- `Text`: readonly Text: PrimitiveComponent<TextProps<Row>>;

- `Legend`: readonly Legend: PrimitiveComponent<LegendProps>;

- `Tooltip`: readonly Tooltip: PrimitiveComponent<TooltipProps>;

- `Crosshair`: readonly Crosshair: PrimitiveComponent<CrosshairProps>;

- `Select`: readonly Select: PrimitiveComponent<SelectProps>;

- `Zoom`: readonly Zoom: PrimitiveComponent<ZoomProps>;

- `Brush`: readonly Brush: PrimitiveComponent<BrushProps>;

### `PlotHeadingLevel`

```ts
PlotHeadingLevel: 1 | 2 | 3 | 4 | 5 | 6
```

A valid heading level (`h1`–`h6`) for `RootProps.headingLevel`.

### `PlotInteractionOrigin`

```ts
PlotInteractionOrigin: "pointer" | "keyboard"
```

How a plot interaction was triggered.

### `PlotInteractionTarget`

```ts
PlotInteractionTarget: any
```

The mark instance a pointer/keyboard interaction resolved to.

- `row`: readonly row: Row;

- `key`: readonly key: PlotKey;

- `sourceKeys`: readonly sourceKeys: readonly PlotKey[];

- `markKind`: readonly markKind: "bar" | "line" | "area" | "point" | "arc" | "cell" | "rect" | "rule" | "text";

- `markId`: readonly markId: string;

- `series`: readonly series: string | null;

- `channels`: readonly channels: Readonly<Record<string, unknown>>;

- `origin`: readonly origin: PlotInteractionOrigin;

### `PlotKey`

```ts
PlotKey: string | number
```

A row identity: any string or number usable as a stable key for a plot row.

### `PlotPngExportOptions`

```ts
PlotPngExportOptions: any
```

Options for {@link PlotApi.exportPng}.

- `pixelRatio`: pixelRatio?: number;

- `includeOverlays`: includeOverlays?: boolean;

### `PlotRowKey`

```ts
PlotRowKey: FieldOfType<Row, PlotKey> | RowAccessor<Row, PlotKey>
```

How to derive a row's stable {@link PlotKey}: a field name or an accessor function.

### `PlotScalar`

```ts
PlotScalar: string | number | boolean | Date
```

A primitive value a plot channel may resolve to.

### `PlotSelection`

```ts
PlotSelection: any
```

The set of row keys currently selected via `Plot.Select`.

- `keys`: keys: readonly PlotKey[];

### `PlotSummaryContext`

```ts
PlotSummaryContext: any
```

Context passed to a `RootProps.summary` function to compute the plot's summary text.

- `rows`: readonly rows: readonly Row[];

- `sourceRowCount`: readonly sourceRowCount: number;

- `transformedRowCount`: readonly transformedRowCount: number;

- `omittedRowCount`: readonly omittedRowCount: number;

- `visibleRowCount`: readonly visibleRowCount: number;

### `PlotSvgExportOptions`

```ts
PlotSvgExportOptions: any
```

Options for {@link PlotApi.exportSvg}.

- `includeOverlays`: includeOverlays?: boolean;

### `PlotView`

```ts
PlotView: any
```

The visible domain of a plot's scales, used for `view`/`defaultView`.

- `x`: x?: readonly [ScaleValue, ScaleValue];

- `y`: y?: readonly [ScaleValue, ScaleValue];

- `scales`: scales?: Readonly<Record<string, readonly [ScaleValue, ScaleValue]>>;

### `PointProps`

```ts
PointProps: any
```

Props for `Plot.Point`.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `r`: r?: number | RowNumericChannelInput<Row> | undefined;

- `shape`: Explicit point shape. When omitted, a multi-series point mark cycles shapes
so color is not the only default series encoding.

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x: RowScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: RowNumericChannelInput<Row>;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `PrimitiveComponent`

```ts
PrimitiveComponent: any
```

A plot component that renders `Props` to a `JSXElement`.

### `PrimitiveKind`

```ts
PrimitiveKind: Exclude<keyof PlotFactory<unknown>, "Root">
```

The keys of {@link PlotFactory} that identify a mark/annotation primitive (excludes `Root`).

### `RectProps`

```ts
RectProps: any
```

Props for `Plot.Rect`.

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `radius`: radius?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x?: RowScaleChannelInput<Row> | undefined;

- `x2`: x2?: RowScaleChannelInput<Row> | undefined;

- `xScale`: xScale?: string | undefined;

- `y`: y?: RowScaleChannelInput<Row> | undefined;

- `y2`: y2?: RowScaleChannelInput<Row> | undefined;

- `yScale`: yScale?: string | undefined;

### `regression`

```ts
regression: { <Field extends string>(input: Field, options?: { x?: string; method?: "linear"; }): ChannelExpression<number, Field, "regression">; <Row>(input: NumericChannelInput<Row>, options?: RegressionOptions<Row>): ChannelExpression<number, never, "regression">; }
```

Fits a regression curve (currently linear) to a numeric channel against an x channel.

### `RegressionOptions`

```ts
RegressionOptions: any
```

Options for {@link regression }.

- `x`: x?: RowScaleChannelInput<Row>;

- `method`: method?: "linear";

### `removePlotRows`

```ts
removePlotRows: <Row>(rows: readonly Row[], keys: readonly PlotKey[] | ReadonlySet<PlotKey> | ((row: Readonly<Row>, index: number) => boolean), rowKey?: PlotRowKey<Row>) => readonly Row[]
```

Removes rows matching a predicate, or by key (requires `rowKey` when `keys` is an array/set).
Returns the original `rows` reference unchanged if nothing was removed.

### `RootProps`

```ts
RootProps: any
```

Props accepted by a plot factory's `Root` component.

- `children`: children?: unknown;

- `class`: class?: string | undefined;

- `data`: data: PlotData<Row>;

- `defaultSelection`: defaultSelection?: PlotSelection | undefined;

- `defaultView`: defaultView?: PlotView | undefined;

- `description`: description?: string | undefined;

- `diagnostics`: diagnostics?: boolean | undefined;

- `empty`: empty?: string | undefined;

- `followLatest`: followLatest?: FollowLatest<Row> | undefined;

- `headingLevel`: headingLevel?: PlotHeadingLevel | undefined;

- `height`: height?: number | undefined;

- `id`: id?: string | undefined;

- `label`: label: string;

- `locale`: locale?: string | undefined;

- `meter`: meter?: MeterSemantics | undefined;

- `onActivate`: onActivate?: ((row: Row, key: PlotKey, target: PlotInteractionTarget<Row>) => void) | undefined;

- `onApiChange`: onApiChange?: ((api: PlotApi<Row> | null) => void) | undefined;

- `onSelectionChange`: onSelectionChange?: ((selection: PlotSelection) => void) | undefined;

- `onViewChange`: onViewChange?: ((view: PlotView) => void) | undefined;

- `rowKey`: rowKey: PlotRowKey<Row>;

- `selection`: selection?: PlotSelection | undefined;

- `style`: style?: string | Record<string, string | number | false | null | undefined> | undefined;

- `summary`: summary?: string | ((context: PlotSummaryContext<Row>) => string) | undefined;

- `title`: title?: string | undefined;

- `view`: view?: PlotView | undefined;

- `width`: width?: number | undefined;

### `RowAccessor`

```ts
RowAccessor: (row: Readonly<Row>, index: number) => Value | null | undefined
```

A function that reads a channel value from a row and its index.

### `RowChannelInput`

```ts
RowChannelInput: FieldOfType<Row, Value> | RowAccessor<Row, Value> | ChannelExpression<Value, FieldOfType<Row, Value>, RowExpressionKind>
```

A channel input restricted to row-level (non-aggregating) expression kinds.

### `RowColorChannelInput`

```ts
RowColorChannelInput: RowChannelInput<Row, string | number | boolean>
```

{@link RowChannelInput} resolving to a color-scale-compatible value.

### `RowField`

```ts
RowField: Extract<keyof Row, string>
```

The string-keyed field names of a row type.

### `RowNumericChannelInput`

```ts
RowNumericChannelInput: RowChannelInput<Row, number>
```

{@link RowChannelInput} resolving to a number.

### `RowScaleChannelInput`

```ts
RowScaleChannelInput: RowChannelInput<Row, string | number | Date>
```

{@link RowChannelInput} for a positional/categorical scale.

### `RowTextChannelInput`

```ts
RowTextChannelInput: RowChannelInput<Row, string | number | Date | boolean>
```

{@link RowChannelInput} resolving to a displayable text value.

### `RowTransform`

```ts
RowTransform: any
```

A serialized row-level transform produced by helpers such as {@link filterRows },
{@link sortRows }, or {@link partition }, and applied to a mark's `data` via `transform`.

- `__askrPlotTransform`: readonly __askrPlotTransform: true;

- `kind`: readonly kind: RowTransformKind;

- `options`: readonly options: Readonly<Record<string, unknown>>;

- `__row`: readonly __row?: (row: Row) => Row;

### `RowTransformKind`

```ts
RowTransformKind: "filter" | "sort" | "partition"
```

The discriminant `kind` values a {@link RowTransform} may carry.

### `RuleProps`

```ts
RuleProps: any
```

Props for `Plot.Rule`.

- `colorScale`: colorScale?: string | undefined;

- `dash`: dash?: readonly number[] | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `strokeWidth`: strokeWidth?: number | undefined;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x?: RowScaleChannelInput<Row> | undefined;

- `x2`: x2?: RowScaleChannelInput<Row> | undefined;

- `xScale`: xScale?: string | undefined;

- `y`: y?: RowScaleChannelInput<Row> | undefined;

- `y2`: y2?: RowScaleChannelInput<Row> | undefined;

- `yScale`: yScale?: string | undefined;

### `ScaleChannelInput`

```ts
ScaleChannelInput: ChannelInput<Row, string | number | Date>
```

A channel input for a positional/categorical scale.

### `ScaleDomainValue`

```ts
ScaleDomainValue: ScaleValue | boolean
```

A scale domain value, including booleans (for ordinal/color scales).

### `ScaleField`

```ts
ScaleField: FieldOfType<Row, string | number | Date>
```

Field names of `Row` usable as a scale channel (string, number, or Date).

### `ScaleProps`

```ts
ScaleProps: any
```

Props for `Plot.Scale`.

- `base`: base?: number | undefined;

- `channel`: channel?: "color" | "x" | "y" | undefined;

- `clamp`: clamp?: boolean | undefined;

- `constant`: constant?: number | undefined;

- `domain`: domain?: readonly ScaleDomainValue[] | undefined;

- `exponent`: exponent?: number | undefined;

- `name`: name?: string | undefined;

- `nice`: nice?: number | boolean | undefined;

- `padding`: padding?: number | undefined;

- `paddingInner`: paddingInner?: number | undefined;

- `paddingOuter`: paddingOuter?: number | undefined;

- `range`: range?: readonly (string | number)[] | undefined;

- `reverse`: reverse?: boolean | undefined;

- `type`: type?: ScaleType | undefined;

- `unknown`: unknown?: string | undefined;

### `ScaleType`

```ts
ScaleType: "band" | "point" | "linear" | "power" | "log" | "symlog" | "time" | "utc" | "ordinal-color" | "continuous-color"
```

The scale types supported by `Plot.Scale`.

### `ScaleValue`

```ts
ScaleValue: string | number | Date
```

A value usable as a scale domain/range endpoint.

### `SelectProps`

```ts
SelectProps: any
```

Props for `Plot.Select`.

- `mode`: mode?: "single" | "toggle" | undefined;

### `sortRows`

```ts
sortRows: <Row>(options: SortRowsOptions<Row>) => RowTransform<Row>
```

A row transform that sorts rows by a field or accessor.

### `SortRowsOptions`

```ts
SortRowsOptions: any
```

Options for {@link sortRows }.

- `by`: by: RowField<Row> | RowAccessor<Row, unknown>;

- `direction`: direction?: "ascending" | "descending";

### `stack`

```ts
stack: { <Field extends string>(input: Field, options?: StackOptions): ChannelExpression<number, Field, "stack">; <Row>(input: NumericChannelInput<Row>, options?: StackOptions): ChannelExpression<number, never, "stack">; }
```

Stacks a numeric channel's values within each group, e.g. for stacked bar/area charts.

### `StackOptions`

```ts
StackOptions: any
```

Options for {@link stack }.

- `offset`: offset?: "zero" | "diverging" | "expand";

- `order`: order?: "none" | "ascending" | "descending" | "inside-out";

### `sum`

```ts
sum: { <Field extends string>(input: Field): ChannelExpression<number, Field, "sum">; <Row>(input: NumericChannelInput<Row>): ChannelExpression<number, never, "sum">; }
```

Sums a numeric channel across each group.

### `TemporalField`

```ts
TemporalField: FieldOfType<Row, Date>
```

Field names of `Row` holding `Date` values.

### `TextChannelInput`

```ts
TextChannelInput: ChannelInput<Row, string | number | Date | boolean>
```

A channel input resolving to a displayable text value.

### `TextProps`

```ts
TextProps: any
```

Props for `Plot.Text`.

- `align`: align?: CanvasTextAlign | undefined;

- `baseline`: baseline?: CanvasTextBaseline | undefined;

- `colorScale`: colorScale?: string | undefined;

- `data`: data?: PlotData<Row> | undefined;

- `fill`: fill?: RowColorChannelInput<Row> | undefined;

- `font`: font?: string | undefined;

- `hidden`: hidden?: boolean | undefined;

- `key`: key?: PlotRowKey<Row> | undefined;

- `opacity`: opacity?: number | undefined;

- `stroke`: stroke?: RowColorChannelInput<Row> | undefined;

- `text`: text: RowTextChannelInput<Row>;

- `title`: title?: RowTextChannelInput<Row> | undefined;

- `transform`: transform?: RowTransform<Row> | readonly RowTransform<Row>[] | undefined;

- `x`: x: RowScaleChannelInput<Row>;

- `x2`: x2?: unknown;

- `xScale`: xScale?: string | undefined;

- `y`: y: RowScaleChannelInput<Row>;

- `y2`: y2?: unknown;

- `yScale`: yScale?: string | undefined;

### `TooltipProps`

```ts
TooltipProps: any
```

Props for `Plot.Tooltip`.

- `channels`: channels?: readonly string[] | undefined;

- `format`: format?: ((record: Readonly<Record<string, unknown>>) => string) | undefined;

- `mode`: mode?: "x" | "auto" | "mark" | undefined;

### `trimPlotRows`

```ts
trimPlotRows: <Row>(rows: readonly Row[], options: number | TrimPlotRowsOptions<Row>) => readonly Row[]
```

Trims `rows` down to a trailing window, either by row count or by a duration relative to a
temporal field. A bare number is shorthand for `{ rows: number }`. Returns the original `rows`
reference unchanged if nothing was trimmed.

### `TrimPlotRowsOptions`

```ts
TrimPlotRowsOptions: {
  rows: number;
} | {
  durationMs: number;
  field: RowField<Row> | RowAccessor<Row, Date>;
  now?: Date | number;
}
```

Options for {@link trimPlotRows}: keep the last `rows` rows, or rows within `durationMs` of `now`.

### `upsertPlotRows`

```ts
upsertPlotRows: <Row>(rows: readonly Row[], updates: readonly Row[] | Row, rowKey: PlotRowKey<Row>) => readonly Row[]
```

Inserts or updates rows by key: rows whose key matches an existing row replace it in place,
and new keys are appended. Throws if `updates` or the existing `rows` contain duplicate keys.

### `WindowOperation`

```ts
WindowOperation: "sum" | "mean" | "min" | "max"
```

Operations supported by moving-window expressions.

### `ZoomProps`

```ts
ZoomProps: any
```

Props for `Plot.Zoom`.

- `axes`: axes?: "x" | "y" | "xy" | undefined;

- `max`: max?: number | undefined;

- `min`: min?: number | undefined;

- `pan`: pan?: boolean | undefined;

- `pinch`: pinch?: boolean | undefined;

- `wheel`: wheel?: boolean | undefined;

## Documentation navigation

[Previous](https://askrjs.com/docs/reference/api/auth/webauthn-client/index.md) | [Next](https://askrjs.com/docs/reference/api/charts/styles/index.md)
