# Scale providers

Import `LinearScale`, `BarScale`, `UTCScale`, and their types from `@pibbl/core/viz`. Use the core JSX runtime.

Each provider requires `id`, `domain`, and `range`, with optional `reverse`,
`style`, and `children`. `BarScale` also accepts `paddingInner` and `paddingOuter`.
There is no `type` prop. The corresponding props are `LinearScaleProps`,
`BarScaleProps`, and `UTCScaleProps` (see [UTC domains](/reference/functions/utc-domains/)).
`ScaleId` is a nonempty string or symbol. Nested providers shadow the nearest
matching ID; siblings and independent roots cannot see each other's providers.

`LinearDomain` contains two finite, unequal numbers, ascending or descending.
`ScaleRange` is a finite numeric pair, `"width"`, or `"height"`. Allocation ranges
start at zero and end at the local allocated extent. `reverse` swaps endpoints;
use it with height to make larger values appear higher. Domain, range, and reverse
accept core `SignalValue` inputs. Signal resolution is shallow.

`ScaleLayoutStyle` contains width, height, and core layout-item styles. Whole
styles and direct fields may be core signals. Scale does not paint, transform,
reserve gutters, or create a global chart rectangle. Its children receive the
same allocation; put gutters and placement in ordinary core layout.

`ResolvedScale` is `ResolvedContinuousScale | ResolvedBandScale`. The linear snapshot has:

- `type`, `domain`, and `range` describe the mapping.
- `frame` has local x/y zero and the allocation's width/height.
- `map(value)` maps finite values with linear extrapolation, without clamping.
- `invert(pixel)` reverses that mapping. A zero-span range maps to its endpoint
  but cannot be inverted.
- `ticks(count = 5)` returns evenly spaced values including both domain ends.
  Count must be an integer from 2 through 100. These are not calendar or nice ticks.

Use [`useLinearScale`](/reference/hooks/use-scale/) to read the scale signal. Definitions are
lazy; malformed resolved inputs throw on evaluation. Nonfinite arithmetic results
also throw. Updating a signal or allocation refreshes the existing scale signal;
equivalent domain/range/frame values suppress downstream invalidation.

A scale provider and consumer must share one rendering instance. Put the complete
scale subtree inside a `Layer`; lookup across a Layer boundary is unsupported.
UTC calendar scales are available; see [UTC domains](/reference/functions/utc-domains/).
Local time, logarithmic, and auto-domain scales remain deferred.

## Band scales

Use `BarScale` with an explicit ordered `BandDomain` of strings or finite
numbers (`BandCategory`). Identity uses SameValueZero: `1` and `"1"` are distinct;
`-0` and `0` are the same category. Duplicate entries reject. Input order is
preserved, and empty domains are valid. Unknown categories map to `undefined`.

`paddingInner` defaults to 0 and is a fraction of the step in `[0, 1]`.
`paddingOuter` defaults to 0 and is a finite nonnegative number of steps per side.
For n categories, step = extent / max(1, n - paddingInner + 2 * paddingOuter).
Bandwidth = step * (1 - paddingInner); remaining space is centered. Empty domains
have zero step/bandwidth. Collapsed ranges have zero bandwidth. Reverse changes
category placement, while each `map(category)` remains the lower pixel edge.

Read `useBarScale(id).get()` for the immutable `ResolvedBandScale`: `domain`,
`range`, `frame`, `step`, `bandwidth`, and `map(category)`. There is no numeric
inversion or tick method. Labels can use `map(category) + bandwidth / 2`.
Domain, padding, reverse, and range accept signals and follow local allocation.
For nested bands, `BandScaleRange` additionally accepts
`{ bandwidthOf: ancestorId }`. It resolves to `[0, ancestor.bandwidth]`,
reacting to ancestor domain, padding, and allocation changes. The reference
must identify a visible ancestor band scale in the same rendering instance.
Nearest matching scope wins, as with `useLinearScale`. Missing references and wrong
scale families reject. Ancestor-only lookup prevents circular references.
Zero ancestor bandwidth produces a collapsed range. The inner frame remains
the layout allocation; only its range uses the ancestor bandwidth. Linear
scales do not accept this range form.

## API details from source

<span id="api-LinearScale"></span>

### LinearScale

Provides a named linear mapping to descendant visualization components.

```ts
LinearScale: (props: LinearScaleProps) => PibblNode
```

Related API: [LinearScale](/reference/components/scale/), [LinearScaleProps](/reference/components/scale/), [PibblNode](/reference/types/elements-components/#pibblnode).

#### Parameters

- **`props`** — Identity, domain, range, and children. See [LinearScaleProps](/reference/components/scale/).

#### Returns

Descendant content within the scale scope.

[View source — packages/core/src/features/viz/lib/linear-scale-component.ts:10](/source/packages/core/src/features/viz/lib/linear-scale-component-ts/#L10)

<span id="api-BarScale"></span>

### BarScale

Provides categorical bands, including nested groups sized to a parent band.

```ts
BarScale: (props: BarScaleProps) => PibblNode
```

Related API: [BarScale](/reference/components/scale/), [BarScaleProps](/reference/components/scale/), [PibblNode](/reference/types/elements-components/#pibblnode).

#### Parameters

- **`props`** — Categories, spacing, range, and children. See [BarScaleProps](/reference/components/scale/).

#### Returns

Descendant content within the scale scope.

[View source — packages/core/src/features/viz/lib/bar-scale.ts:11](/source/packages/core/src/features/viz/lib/bar-scale-ts/#L11)

<span id="api-UTCScale"></span>

### UTCScale

Provides a named utc mapping to descendant visualization components.

```ts
UTCScale: (props: UTCScaleProps) => PibblNode
```

Related API: [UTCScale](/reference/components/scale/), [UTCScaleProps](/reference/functions/utc-domains/), [PibblNode](/reference/types/elements-components/#pibblnode).

#### Parameters

- **`props`** — Identity, domain, range, and children. See [UTCScaleProps](/reference/functions/utc-domains/).

#### Returns

Descendant content within the scale scope.

[View source — packages/core/src/features/viz/lib/utc-scale-component.ts:10](/source/packages/core/src/features/viz/lib/utc-scale-component-ts/#L10)

<span id="api-ScaleId"></span>

### ScaleId

A string or symbol identifying a scale within visualization context.

```ts
type ScaleId = string | symbol
```

Related API: [ScaleId](/reference/components/scale/).

#### See also

[BandScaleRange](/reference/components/scale/)

[LinearScaleProps](/reference/components/scale/)

[LineSeriesProps](/reference/components/line-series/)

[View source — packages/core/src/features/viz/lib/types.ts:24](/source/packages/core/src/features/viz/lib/types-ts/#L24)

<span id="api-LinearDomain"></span>

### LinearDomain

The two numeric endpoints of a continuous scale domain.

```ts
type LinearDomain = readonly [number, number]
```

Related API: [LinearDomain](/reference/components/scale/).

#### See also

[LinearScaleProps](/reference/components/scale/)

[ResolvedLinearScale](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:31](/source/packages/core/src/features/viz/lib/types-ts/#L31)

<span id="api-BandCategory"></span>

### BandCategory

A string or number used as a discrete band-scale category.

```ts
type BandCategory = string | number
```

Related API: [BandCategory](/reference/components/scale/).

#### See also

[BandDomain](/reference/components/scale/)

[ResolvedBandScale](/reference/components/scale/)

[BarCategoryAccessor](/reference/components/bar-series/)

[View source — packages/core/src/features/viz/lib/types.ts:103](/source/packages/core/src/features/viz/lib/types-ts/#L103)

<span id="api-BandDomain"></span>

### BandDomain

The ordered categories allocated by a band scale.

```ts
type BandDomain = readonly BandCategory[]
```

Related API: [BandDomain](/reference/components/scale/), [BandCategory](/reference/components/scale/).

#### See also

[BandCategory](/reference/components/scale/)

[BarScaleProps](/reference/components/scale/)

[ResolvedBandScale](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:111](/source/packages/core/src/features/viz/lib/types-ts/#L111)

<span id="api-BarScaleProps"></span>

### BarScaleProps

Authored inputs for BandScale, including the declared data and presentation options.

```ts
interface BarScaleProps extends Omit<
  LinearScaleProps,
  "domain" | "range"
>
```

Related API: [BarScaleProps](/reference/components/scale/), [LinearScaleProps](/reference/components/scale/).

#### See also

[LinearScaleProps](/reference/components/scale/)

[SignalValue](/reference/types/signal-inputs/#signalvalue)

[BandDomain](/reference/components/scale/)

[BandScaleRange](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:121](/source/packages/core/src/features/viz/lib/types-ts/#L121)

#### Properties and methods

<span id="api-BarScaleProps-domain"></span>
<details>
<summary>domain</summary>


```ts
readonly domain: SignalValue<BandDomain>
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [BandDomain](/reference/components/scale/).

Data values or endpoints accepted by the scale. See SignalValue, BandDomain.

[View source — packages/core/src/features/viz/lib/types.ts:128](/source/packages/core/src/features/viz/lib/types-ts/#L128)

</details>

<span id="api-BarScaleProps-range"></span>
<details>
<summary>range</summary>


```ts
readonly range: SignalValue<BandScaleRange>
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [BandScaleRange](/reference/components/scale/).

Logical output coordinates produced by the scale. See SignalValue,
BandScaleRange.

[View source — packages/core/src/features/viz/lib/types.ts:133](/source/packages/core/src/features/viz/lib/types-ts/#L133)

</details>

<span id="api-BarScaleProps-paddingInner"></span>
<details>
<summary>paddingInner (optional)</summary>


```ts
readonly paddingInner?: SignalValue<number> | undefined
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue).

Relative spacing between adjacent categorical bands. See SignalValue.

[View source — packages/core/src/features/viz/lib/types.ts:135](/source/packages/core/src/features/viz/lib/types-ts/#L135)

</details>

<span id="api-BarScaleProps-paddingOuter"></span>
<details>
<summary>paddingOuter (optional)</summary>


```ts
readonly paddingOuter?: SignalValue<number> | undefined
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue).

Relative spacing outside the first and last categorical bands. See SignalValue.

[View source — packages/core/src/features/viz/lib/types.ts:137](/source/packages/core/src/features/viz/lib/types-ts/#L137)

</details>

<span id="api-BarScaleProps-id"></span>
<details>
<summary>id</summary>


```ts
readonly id: ScaleId
```

Related API: [ScaleId](/reference/components/scale/).

Stable identifier of this resource or connection. See ScaleId.

[View source — packages/core/src/features/viz/lib/types.ts:75](/source/packages/core/src/features/viz/lib/types-ts/#L75)

</details>

<span id="api-BarScaleProps-reverse"></span>
<details>
<summary>reverse (optional)</summary>


```ts
readonly reverse?: SignalValue<boolean> | undefined
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue).

Whether to reverse the direction of the mapping or guide. See SignalValue.

[View source — packages/core/src/features/viz/lib/types.ts:87](/source/packages/core/src/features/viz/lib/types-ts/#L87)

</details>

<span id="api-BarScaleProps-style"></span>
<details>
<summary>style (optional)</summary>


<details>
<summary>Full type declaration</summary>

```ts
readonly style?: SignalValue<Readonly<{ left?: SignalValue<number | `${number}%` | undefined>; top?: SignalValue<number | `${number}%` | undefined>; width?: SignalValue<Length | undefined>; height?: SignalValue<Length | undefined>; alignSelf?: SignalValue<"auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined>; justifySelf?: SignalValue<"auto" | "center" | "end" | "start" | "stretch" | undefined>; flexBasis?: SignalValue<Length | undefined>; flexGrow?: SignalValue<number | undefined>; flexShrink?: SignalValue<number | undefined>; gridColumnStart?: SignalValue<number | undefined>; gridColumnSpan?: SignalValue<number | undefined>; gridRowStart?: SignalValue<number | undefined>; gridRowSpan?: SignalValue<number | undefined>; transition?: SignalValue<PibblTransitionBinding | undefined>; custom?: unknown; filter?: SignalValue<PibblFilter | readonly PibblFilter[] | undefined>; }>> | undefined
```

</details>

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [Length](/reference/types/layout/#length), [PibblTransitionBinding](/reference/hooks/use-visibility-transition/), [PibblFilter](/reference/types/filters/#pibblfilter).

Declared presentation and layout properties. See SignalValue, SignalStyle,
ScaleLayoutStyle.

[View source — packages/core/src/features/viz/lib/types.ts:92](/source/packages/core/src/features/viz/lib/types-ts/#L92)

</details>

<span id="api-BarScaleProps-children"></span>
<details>
<summary>children (optional)</summary>


```ts
readonly children?: PibblNode
```

Related API: [PibblNode](/reference/types/elements-components/#pibblnode).

Descendant content or the callback that supplies it. See PibblNode.

[View source — packages/core/src/features/viz/lib/types.ts:94](/source/packages/core/src/features/viz/lib/types-ts/#L94)

</details>

<span id="api-BandScaleRange"></span>

### BandScaleRange

A logical range or the bandwidth of another scale for nested band layouts.

```ts
type BandScaleRange = | ScaleRange
  | {
      /** Identifier of a parent band scale whose bandwidth supplies this range. See {@link ScaleId}. */
      readonly bandwidthOf: ScaleId;
    }
```

Related API: [BandScaleRange](/reference/components/scale/), [ScaleRange](/reference/components/scale/), [ScaleId](/reference/components/scale/).

#### See also

[ScaleRange](/reference/components/scale/)

[ScaleId](/reference/components/scale/)

[BarScaleProps](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:46](/source/packages/core/src/features/viz/lib/types-ts/#L46)

<span id="api-ResolvedBandScale"></span>

### ResolvedBandScale

A resolved categorical mapping with its frame, bandwidth, and step.

```ts
interface ResolvedBandScale
```

Related API: [ResolvedBandScale](/reference/components/scale/).

#### See also

[BandDomain](/reference/components/scale/)

[LayoutBox](/reference/types/layout/#layoutbox)

[BandCategory](/reference/components/scale/)

[ResolvedScale](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:160](/source/packages/core/src/features/viz/lib/types-ts/#L160)

#### Properties and methods

<span id="api-ResolvedBandScale-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "band"
```

The literal "band" identifying this variant. See ResolvedBandScale.

[View source — packages/core/src/features/viz/lib/types.ts:162](/source/packages/core/src/features/viz/lib/types-ts/#L162)

</details>

<span id="api-ResolvedBandScale-domain"></span>
<details>
<summary>domain</summary>


```ts
readonly domain: BandDomain
```

Related API: [BandDomain](/reference/components/scale/).

Data values or endpoints accepted by the scale. See BandDomain.

[View source — packages/core/src/features/viz/lib/types.ts:164](/source/packages/core/src/features/viz/lib/types-ts/#L164)

</details>

<span id="api-ResolvedBandScale-range"></span>
<details>
<summary>range</summary>


```ts
readonly range: readonly [number, number]
```

Logical output coordinates produced by the scale. See ResolvedBandScale.

[View source — packages/core/src/features/viz/lib/types.ts:166](/source/packages/core/src/features/viz/lib/types-ts/#L166)

</details>

<span id="api-ResolvedBandScale-frame"></span>
<details>
<summary>frame</summary>


```ts
readonly frame: Readonly<LayoutBox>
```

Related API: [LayoutBox](/reference/types/layout/#layoutbox).

Resolved layout frame containing the scale. See LayoutBox.

[View source — packages/core/src/features/viz/lib/types.ts:168](/source/packages/core/src/features/viz/lib/types-ts/#L168)

</details>

<span id="api-ResolvedBandScale-bandwidth"></span>
<details>
<summary>bandwidth</summary>


```ts
readonly bandwidth: number
```

Width allocated to one categorical band. See ResolvedBandScale.

[View source — packages/core/src/features/viz/lib/types.ts:170](/source/packages/core/src/features/viz/lib/types-ts/#L170)

</details>

<span id="api-ResolvedBandScale-step"></span>
<details>
<summary>step</summary>


```ts
readonly step: number
```

Distance between successive band starts. See ResolvedBandScale.

[View source — packages/core/src/features/viz/lib/types.ts:172](/source/packages/core/src/features/viz/lib/types-ts/#L172)

</details>

<span id="api-ResolvedBandScale-map"></span>
<details>
<summary>map</summary>


```ts
map: (value: BandCategory) => number | undefined
```

Related API: [BandCategory](/reference/components/scale/).

Maps a category to its band coordinate, or returns undefined for an unknown category. See
ResolvedBandScale .

##### Parameters

- **`value`** — Category to locate in the domain. See [BandCategory](/reference/components/scale/).

##### Returns

The category's range position, or undefined if it is absent from the domain.

[View source — packages/core/src/features/viz/lib/types.ts:179](/source/packages/core/src/features/viz/lib/types-ts/#L179)

</details>

<span id="api-ScaleRange"></span>

### ScaleRange

An explicit numeric range or a range derived from layout width or height.

```ts
type ScaleRange = "width" | "height" | readonly [number, number]
```

Related API: [ScaleRange](/reference/components/scale/).

#### See also

[BandScaleRange](/reference/components/scale/)

[LinearScaleProps](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:38](/source/packages/core/src/features/viz/lib/types-ts/#L38)

<span id="api-ScaleLayoutStyle"></span>

### ScaleLayoutStyle

Sizing and parent-layout participation of a scale's coordinate frame.

```ts
type ScaleLayoutStyle = Pick<BoxStyle, "width" | "height"> &
  LayoutItemStyle
```

Related API: [ScaleLayoutStyle](/reference/components/scale/), [BoxStyle](/reference/types/layout/#boxstyle), [LayoutItemStyle](/reference/types/layout/#layoutitemstyle).

#### See also

[BoxStyle](/reference/types/layout/#boxstyle)

[LayoutItemStyle](/reference/types/layout/#layoutitemstyle)

[LinearScaleProps](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:59](/source/packages/core/src/features/viz/lib/types-ts/#L59)

#### Properties and methods

<span id="api-ScaleLayoutStyle-width"></span>
<details>
<summary>width (optional)</summary>


```ts
width?: Length | undefined
```

Related API: [Length](/reference/types/layout/#length).

Horizontal extent in the units of the containing geometry or surface. See Length.

[View source — packages/core/src/lib/style/types.ts:81](/source/packages/core/src/lib/style/types-ts/#L81)

</details>

<span id="api-ScaleLayoutStyle-height"></span>
<details>
<summary>height (optional)</summary>


```ts
height?: Length | undefined
```

Related API: [Length](/reference/types/layout/#length).

Vertical extent in the units of the containing geometry or surface. See Length.

[View source — packages/core/src/lib/style/types.ts:83](/source/packages/core/src/lib/style/types-ts/#L83)

</details>

<span id="api-ScaleLayoutStyle-left"></span>
<details>
<summary>left (optional)</summary>


```ts
left?: number | `${number}%` | undefined
```

Left edge coordinate or inset. See Length.

[View source — packages/core/src/lib/style/positioning.ts:127](/source/packages/core/src/lib/style/positioning-ts/#L127)

</details>

<span id="api-ScaleLayoutStyle-top"></span>
<details>
<summary>top (optional)</summary>


```ts
top?: number | `${number}%` | undefined
```

Top edge value or top envelope guide. See Length.

[View source — packages/core/src/lib/style/positioning.ts:129](/source/packages/core/src/lib/style/positioning-ts/#L129)

</details>

<span id="api-ScaleLayoutStyle-alignSelf"></span>
<details>
<summary>alignSelf (optional)</summary>


```ts
alignSelf?: "auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined
```

This child's cross-axis or block-axis alignment override. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:121](/source/packages/core/src/lib/style/types-ts/#L121)

</details>

<span id="api-ScaleLayoutStyle-justifySelf"></span>
<details>
<summary>justifySelf (optional)</summary>


```ts
justifySelf?: "auto" | "center" | "end" | "start" | "stretch" | undefined
```

This child's inline-axis alignment override. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:123](/source/packages/core/src/lib/style/types-ts/#L123)

</details>

<span id="api-ScaleLayoutStyle-flexBasis"></span>
<details>
<summary>flexBasis (optional)</summary>


```ts
flexBasis?: Length | undefined
```

Related API: [Length](/reference/types/layout/#length).

Initial main-axis size before flex growth or shrinkage. See Length.

[View source — packages/core/src/lib/style/types.ts:125](/source/packages/core/src/lib/style/types-ts/#L125)

</details>

<span id="api-ScaleLayoutStyle-flexGrow"></span>
<details>
<summary>flexGrow (optional)</summary>


```ts
flexGrow?: number | undefined
```

Relative share of positive free space assigned to this child. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:127](/source/packages/core/src/lib/style/types-ts/#L127)

</details>

<span id="api-ScaleLayoutStyle-flexShrink"></span>
<details>
<summary>flexShrink (optional)</summary>


```ts
flexShrink?: number | undefined
```

Relative factor used when reducing main-axis size. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:129](/source/packages/core/src/lib/style/types-ts/#L129)

</details>

<span id="api-ScaleLayoutStyle-gridColumnStart"></span>
<details>
<summary>gridColumnStart (optional)</summary>


```ts
gridColumnStart?: number | undefined
```

Explicit starting grid column. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:131](/source/packages/core/src/lib/style/types-ts/#L131)

</details>

<span id="api-ScaleLayoutStyle-gridColumnSpan"></span>
<details>
<summary>gridColumnSpan (optional)</summary>


```ts
gridColumnSpan?: number | undefined
```

Number of columns occupied by this child. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:133](/source/packages/core/src/lib/style/types-ts/#L133)

</details>

<span id="api-ScaleLayoutStyle-gridRowStart"></span>
<details>
<summary>gridRowStart (optional)</summary>


```ts
gridRowStart?: number | undefined
```

Explicit starting grid row. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:135](/source/packages/core/src/lib/style/types-ts/#L135)

</details>

<span id="api-ScaleLayoutStyle-gridRowSpan"></span>
<details>
<summary>gridRowSpan (optional)</summary>


```ts
gridRowSpan?: number | undefined
```

Number of rows occupied by this child. See LayoutItemStyle.

[View source — packages/core/src/lib/style/types.ts:137](/source/packages/core/src/lib/style/types-ts/#L137)

</details>

<span id="api-ScaleLayoutStyle-transition"></span>
<details>
<summary>transition (optional)</summary>


```ts
transition?: PibblTransitionBinding | undefined
```

Related API: [PibblTransitionBinding](/reference/hooks/use-visibility-transition/).

Visibility-transition binding applied to this primitive and its captured descendants. See SystemStyle.

[View source — packages/core/src/lib/types.ts:69](/source/packages/core/src/lib/types-ts/#L69)

</details>

<span id="api-ScaleLayoutStyle-custom"></span>
<details>
<summary>custom (optional)</summary>


```ts
custom?: unknown
```

Application-defined style payload passed through the runtime. See SystemStyle.

[View source — packages/core/src/lib/types.ts:71](/source/packages/core/src/lib/types-ts/#L71)

</details>

<span id="api-ScaleLayoutStyle-filter"></span>
<details>
<summary>filter (optional)</summary>


```ts
filter?: PibblFilter | readonly PibblFilter[] | undefined
```

Related API: [PibblFilter](/reference/types/filters/#pibblfilter).

Ordered pixel-only filters applied to the receiving primitive and its descendants. See
PibblFilter.

[View source — packages/core/src/lib/types.ts:76](/source/packages/core/src/lib/types-ts/#L76)

</details>

<span id="api-LinearScaleProps"></span>

### LinearScaleProps

Authored inputs for LinearScale, including the declared data and presentation options.

```ts
interface LinearScaleProps
```

Related API: [LinearScaleProps](/reference/components/scale/).

#### See also

[ScaleId](/reference/components/scale/)

[SignalValue](/reference/types/signal-inputs/#signalvalue)

[LinearDomain](/reference/components/scale/)

[ScaleRange](/reference/components/scale/)

`SignalStyle`

[ScaleLayoutStyle](/reference/components/scale/)

[PibblNode](/reference/types/elements-components/#pibblnode)

[BarScaleProps](/reference/components/scale/)

[View source — packages/core/src/features/viz/lib/types.ts:73](/source/packages/core/src/features/viz/lib/types-ts/#L73)

#### Properties and methods

<span id="api-LinearScaleProps-id"></span>
<details>
<summary>id</summary>


```ts
readonly id: ScaleId
```

Related API: [ScaleId](/reference/components/scale/).

Stable identifier of this resource or connection. See ScaleId.

[View source — packages/core/src/features/viz/lib/types.ts:75](/source/packages/core/src/features/viz/lib/types-ts/#L75)

</details>

<span id="api-LinearScaleProps-domain"></span>
<details>
<summary>domain</summary>


```ts
readonly domain: SignalValue<LinearDomain>
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [LinearDomain](/reference/components/scale/).

Data values or endpoints accepted by the scale. See SignalValue, LinearDomain
.

[View source — packages/core/src/features/viz/lib/types.ts:80](/source/packages/core/src/features/viz/lib/types-ts/#L80)

</details>

<span id="api-LinearScaleProps-range"></span>
<details>
<summary>range</summary>


```ts
readonly range: SignalValue<ScaleRange>
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [ScaleRange](/reference/components/scale/).

Logical output coordinates produced by the scale. See SignalValue, ScaleRange
.

[View source — packages/core/src/features/viz/lib/types.ts:85](/source/packages/core/src/features/viz/lib/types-ts/#L85)

</details>

<span id="api-LinearScaleProps-reverse"></span>
<details>
<summary>reverse (optional)</summary>


```ts
readonly reverse?: SignalValue<boolean> | undefined
```

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue).

Whether to reverse the direction of the mapping or guide. See SignalValue.

[View source — packages/core/src/features/viz/lib/types.ts:87](/source/packages/core/src/features/viz/lib/types-ts/#L87)

</details>

<span id="api-LinearScaleProps-style"></span>
<details>
<summary>style (optional)</summary>


<details>
<summary>Full type declaration</summary>

```ts
readonly style?: SignalValue<Readonly<{ left?: SignalValue<number | `${number}%` | undefined>; top?: SignalValue<number | `${number}%` | undefined>; width?: SignalValue<Length | undefined>; height?: SignalValue<Length | undefined>; alignSelf?: SignalValue<"auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined>; justifySelf?: SignalValue<"auto" | "center" | "end" | "start" | "stretch" | undefined>; flexBasis?: SignalValue<Length | undefined>; flexGrow?: SignalValue<number | undefined>; flexShrink?: SignalValue<number | undefined>; gridColumnStart?: SignalValue<number | undefined>; gridColumnSpan?: SignalValue<number | undefined>; gridRowStart?: SignalValue<number | undefined>; gridRowSpan?: SignalValue<number | undefined>; transition?: SignalValue<PibblTransitionBinding | undefined>; custom?: unknown; filter?: SignalValue<PibblFilter | readonly PibblFilter[] | undefined>; }>> | undefined
```

</details>

Related API: [SignalValue](/reference/types/signal-inputs/#signalvalue), [Length](/reference/types/layout/#length), [PibblTransitionBinding](/reference/hooks/use-visibility-transition/), [PibblFilter](/reference/types/filters/#pibblfilter).

Declared presentation and layout properties. See SignalValue, SignalStyle,
ScaleLayoutStyle.

[View source — packages/core/src/features/viz/lib/types.ts:92](/source/packages/core/src/features/viz/lib/types-ts/#L92)

</details>

<span id="api-LinearScaleProps-children"></span>
<details>
<summary>children (optional)</summary>


```ts
readonly children?: PibblNode
```

Related API: [PibblNode](/reference/types/elements-components/#pibblnode).

Descendant content or the callback that supplies it. See PibblNode.

[View source — packages/core/src/features/viz/lib/types.ts:94](/source/packages/core/src/features/viz/lib/types-ts/#L94)

</details>

<span id="api-ResolvedLinearScale"></span>

### ResolvedLinearScale

A resolved continuous scale with forward mapping, inversion, and tick generation.

```ts
interface ResolvedLinearScale
```

Related API: [ResolvedLinearScale](/reference/components/scale/).

#### See also

[LinearDomain](/reference/components/scale/)

[LayoutBox](/reference/types/layout/#layoutbox)

[ResolvedScale](/reference/components/scale/)

[nearestDomainValue](/reference/functions/nearest-domain-value/)

[View source — packages/core/src/features/viz/lib/types.ts:189](/source/packages/core/src/features/viz/lib/types-ts/#L189)

#### Properties and methods

<span id="api-ResolvedLinearScale-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "linear"
```

The literal "linear" identifying this variant. See ResolvedLinearScale.

[View source — packages/core/src/features/viz/lib/types.ts:191](/source/packages/core/src/features/viz/lib/types-ts/#L191)

</details>

<span id="api-ResolvedLinearScale-domain"></span>
<details>
<summary>domain</summary>


```ts
readonly domain: LinearDomain
```

Related API: [LinearDomain](/reference/components/scale/).

Data values or endpoints accepted by the scale. See LinearDomain.

[View source — packages/core/src/features/viz/lib/types.ts:193](/source/packages/core/src/features/viz/lib/types-ts/#L193)

</details>

<span id="api-ResolvedLinearScale-range"></span>
<details>
<summary>range</summary>


```ts
readonly range: readonly [number, number]
```

Logical output coordinates produced by the scale. See ResolvedLinearScale.

[View source — packages/core/src/features/viz/lib/types.ts:195](/source/packages/core/src/features/viz/lib/types-ts/#L195)

</details>

<span id="api-ResolvedLinearScale-frame"></span>
<details>
<summary>frame</summary>


```ts
readonly frame: Readonly<LayoutBox>
```

Related API: [LayoutBox](/reference/types/layout/#layoutbox).

Resolved layout frame containing the scale. See LayoutBox.

[View source — packages/core/src/features/viz/lib/types.ts:197](/source/packages/core/src/features/viz/lib/types-ts/#L197)

</details>

<span id="api-ResolvedLinearScale-map"></span>
<details>
<summary>map</summary>


```ts
map: (value: number) => number
```

Maps a numeric domain value to a logical range coordinate. See ResolvedLinearScale.

##### Parameters

- **`value`** — Numeric domain coordinate.

##### Returns

The corresponding range coordinate.

[View source — packages/core/src/features/viz/lib/types.ts:203](/source/packages/core/src/features/viz/lib/types-ts/#L203)

</details>

<span id="api-ResolvedLinearScale-invert"></span>
<details>
<summary>invert</summary>


```ts
invert: (pixel: number) => number
```

Related API: [invert](/reference/types/filters/#invert).

Maps a logical range coordinate back into the numeric domain. See ResolvedLinearScale
.

##### Parameters

- **`pixel`** — Coordinate in the scale's pixel range.

##### Returns

The corresponding numeric domain value.

[View source — packages/core/src/features/viz/lib/types.ts:210](/source/packages/core/src/features/viz/lib/types-ts/#L210)

</details>

<span id="api-ResolvedLinearScale-ticks"></span>
<details>
<summary>ticks</summary>


```ts
ticks: (count?: number) => readonly number[]
```

Returns representative numeric tick values for the requested count. See
ResolvedLinearScale.

##### Parameters

- **`count`** — Suggested number of ticks.

##### Returns

Tick values in domain coordinates.

[View source — packages/core/src/features/viz/lib/types.ts:217](/source/packages/core/src/features/viz/lib/types-ts/#L217)

</details>

<span id="api-ResolvedScale"></span>

### ResolvedScale

A numeric or categorical mapping snapshot. See ResolvedContinuousScale.

```ts
type ResolvedScale = ResolvedContinuousScale | ResolvedBandScale | ResolvedPointScale
```

Related API: [ResolvedScale](/reference/components/scale/), [ResolvedContinuousScale](/reference/functions/utc-domains/), [ResolvedBandScale](/reference/components/scale/), [ResolvedPointScale](/reference/components/symlog-point-scales/).

[View source — packages/core/src/features/viz/lib/types.ts:256](/source/packages/core/src/features/viz/lib/types-ts/#L256)

#### Properties and methods

<span id="api-ResolvedScale-type"></span>
<details>
<summary>type</summary>


```ts
readonly type: "band" | "linear" | "log" | "point" | "symlog" | "utc"
```

The literal "band" identifying this variant. See ResolvedBandScale.
The literal "linear" identifying this variant. See ResolvedLinearScale.
Logarithmic mapping discriminant. See LogScaleProps.
Categorical point discriminant. See PointScaleProps.
Signed logarithmic discriminant. See SymlogScaleProps.
UTC calendar scale discriminant. See UTCScaleProps.

[View source — packages/core/src/features/viz/lib/types.ts:162](/source/packages/core/src/features/viz/lib/types-ts/#L162)

</details>

<span id="api-ResolvedScale-domain"></span>
<details>
<summary>domain</summary>


```ts
readonly domain: BandDomain | LinearDomain
```

Related API: [BandDomain](/reference/components/scale/), [LinearDomain](/reference/components/scale/).

Data values or endpoints accepted by the scale. See BandDomain.
Data values or endpoints accepted by the scale. See LinearDomain.

[View source — packages/core/src/features/viz/lib/types.ts:164](/source/packages/core/src/features/viz/lib/types-ts/#L164)

</details>

<span id="api-ResolvedScale-range"></span>
<details>
<summary>range</summary>


```ts
readonly range: readonly [number, number]
```

Logical output coordinates produced by the scale. See ResolvedBandScale.
Logical output coordinates produced by the scale. See ResolvedLinearScale.

[View source — packages/core/src/features/viz/lib/types.ts:166](/source/packages/core/src/features/viz/lib/types-ts/#L166)

</details>

<span id="api-ResolvedScale-frame"></span>
<details>
<summary>frame</summary>


```ts
readonly frame: Readonly<LayoutBox>
```

Related API: [LayoutBox](/reference/types/layout/#layoutbox).

Resolved layout frame containing the scale. See LayoutBox.

[View source — packages/core/src/features/viz/lib/types.ts:168](/source/packages/core/src/features/viz/lib/types-ts/#L168)

</details>

<span id="api-ResolvedScale-map"></span>
<details>
<summary>map</summary>


```ts
map: ((value: BandCategory) => number | undefined) | ((value: number) => number)
```

Related API: [BandCategory](/reference/components/scale/).

Maps a category to its band coordinate, or returns undefined for an unknown category. See
ResolvedBandScale .
Maps a numeric domain value to a logical range coordinate. See ResolvedLinearScale.

##### Parameters

- **`value`** — Category to locate in the domain. See [BandCategory](/reference/components/scale/).

- **`value`** — Numeric domain coordinate.

##### Returns

The category's range position, or undefined if it is absent from the domain.

The corresponding range coordinate.

[View source — packages/core/src/features/viz/lib/types.ts:179](/source/packages/core/src/features/viz/lib/types-ts/#L179)

</details>

## Implementation guidance for agents

Read the [Data visualization companion](/agents/topics/visualization/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Scales and axes](/minimal-examples/viz/scales/): Create band and linear scales with a typed axis and inspect resolved mappings. [Plain source](/minimal/viz/scales.tsx)
- [UTC dates across New Year](/minimal-examples/viz/utc-numeric/): Keep month, day, and year visible when a calendar axis crosses into a new year. [Plain source](/minimal/viz/utc-numeric.tsx)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
