Skip to content

Scale providers

Read as Markdown

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). 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 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. Local time, logarithmic, and auto-domain scales remain deferred.

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.

Provides a named linear mapping to descendant visualization components.

LinearScale: (props: LinearScaleProps) => PibblNode

Related API: LinearScale, LinearScaleProps, PibblNode.

Descendant content within the scale scope.

View source — packages/core/src/features/viz/lib/linear-scale-component.ts:10

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

BarScale: (props: BarScaleProps) => PibblNode

Related API: BarScale, BarScaleProps, PibblNode.

  • props — Categories, spacing, range, and children. See BarScaleProps.

Descendant content within the scale scope.

View source — packages/core/src/features/viz/lib/bar-scale.ts:11

Provides a named utc mapping to descendant visualization components.

UTCScale: (props: UTCScaleProps) => PibblNode

Related API: UTCScale, UTCScaleProps, PibblNode.

  • props — Identity, domain, range, and children. See UTCScaleProps.

Descendant content within the scale scope.

View source — packages/core/src/features/viz/lib/utc-scale-component.ts:10

A string or symbol identifying a scale within visualization context.

type ScaleId = string | symbol

Related API: ScaleId.

BandScaleRange

LinearScaleProps

LineSeriesProps

View source — packages/core/src/features/viz/lib/types.ts:24

The two numeric endpoints of a continuous scale domain.

type LinearDomain = readonly [number, number]

Related API: LinearDomain.

LinearScaleProps

ResolvedLinearScale

View source — packages/core/src/features/viz/lib/types.ts:31

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

type BandCategory = string | number

Related API: BandCategory.

BandDomain

ResolvedBandScale

BarCategoryAccessor

View source — packages/core/src/features/viz/lib/types.ts:103

The ordered categories allocated by a band scale.

type BandDomain = readonly BandCategory[]

Related API: BandDomain, BandCategory.

BandCategory

BarScaleProps

ResolvedBandScale

View source — packages/core/src/features/viz/lib/types.ts:111

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

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

Related API: BarScaleProps, LinearScaleProps.

LinearScaleProps

SignalValue

BandDomain

BandScaleRange

View source — packages/core/src/features/viz/lib/types.ts:121

domain
readonly domain: SignalValue<BandDomain>

Related API: SignalValue, BandDomain.

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

View source — packages/core/src/features/viz/lib/types.ts:128

range
readonly range: SignalValue<BandScaleRange>

Related API: SignalValue, BandScaleRange.

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

View source — packages/core/src/features/viz/lib/types.ts:133

paddingInner (optional)
readonly paddingInner?: SignalValue<number> | undefined

Related API: SignalValue.

Relative spacing between adjacent categorical bands. See SignalValue.

View source — packages/core/src/features/viz/lib/types.ts:135

paddingOuter (optional)
readonly paddingOuter?: SignalValue<number> | undefined

Related API: SignalValue.

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

View source — packages/core/src/features/viz/lib/types.ts:137

id
readonly id: ScaleId

Related API: ScaleId.

Stable identifier of this resource or connection. See ScaleId.

View source — packages/core/src/features/viz/lib/types.ts:75

reverse (optional)
readonly reverse?: SignalValue<boolean> | undefined

Related API: SignalValue.

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

View source — packages/core/src/features/viz/lib/types.ts:87

style (optional)
Full type declaration
readonly style?: SignalValue<Readonly<{ position?: SignalValue<"absolute" | "relative" | "static" | undefined>; left?: SignalValue<number | `${number}%` | undefined>; right?: SignalValue<number | `${number}%` | undefined>; top?: SignalValue<number | `${number}%` | undefined>; bottom?: SignalValue<number | `${number}%` | undefined>; insetStart?: SignalValue<number | `${number}%` | undefined>; insetEnd?: SignalValue<number | `${number}%` | undefined>; width?: SignalValue<SizingLength | undefined>; height?: SignalValue<SizingLength | undefined>; aspectRatio?: SignalValue<number | undefined>; margin?: SignalValue<FlexMargin | undefined>; marginTop?: SignalValue<FlexMargin | undefined>; marginRight?: SignalValue<FlexMargin | undefined>; marginBottom?: SignalValue<FlexMargin | undefined>; marginLeft?: SignalValue<FlexMargin | undefined>; marginStart?: SignalValue<FlexMargin | undefined>; marginEnd?: SignalValue<FlexMargin | undefined>; alignSelf?: SignalValue<"auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined>; justifySelf?: SignalValue<"auto" | "center" | "end" | "start" | "stretch" | undefined>; flexBasis?: SignalValue<SizingLength | 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>; layoutParticipation?: SignalValue<"contents" | "hidden" | "normal" | undefined>; transition?: SignalValue<PibblTransitionBinding | undefined>; custom?: unknown; filter?: SignalValue<PibblFilter | readonly PibblFilter[] | undefined>; }>> | undefined

Related API: SignalValue, SizingLength, FlexMargin, PibblTransitionBinding, PibblFilter.

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

View source — packages/core/src/features/viz/lib/types.ts:92

children (optional)
readonly children?: PibblNode

Related API: PibblNode.

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

View source — packages/core/src/features/viz/lib/types.ts:94

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

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

Related API: BandScaleRange, ScaleRange, ScaleId.

ScaleRange

ScaleId

BarScaleProps

View source — packages/core/src/features/viz/lib/types.ts:46

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

interface ResolvedBandScale

Related API: ResolvedBandScale.

BandDomain

LayoutBox

BandCategory

ResolvedScale

View source — packages/core/src/features/viz/lib/types.ts:160

type
readonly type: "band"

The literal “band” identifying this variant. See ResolvedBandScale.

View source — packages/core/src/features/viz/lib/types.ts:162

domain
readonly domain: BandDomain

Related API: BandDomain.

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

View source — packages/core/src/features/viz/lib/types.ts:164

range
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

frame
readonly frame: Readonly<LayoutBox>

Related API: LayoutBox.

Resolved layout frame containing the scale. See LayoutBox.

View source — packages/core/src/features/viz/lib/types.ts:168

bandwidth
readonly bandwidth: number

Width allocated to one categorical band. See ResolvedBandScale.

View source — packages/core/src/features/viz/lib/types.ts:170

step
readonly step: number

Distance between successive band starts. See ResolvedBandScale.

View source — packages/core/src/features/viz/lib/types.ts:172

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

Related API: BandCategory.

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

  • value — Category to locate in the domain. See BandCategory.

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

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

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

Related API: ScaleRange.

BandScaleRange

LinearScaleProps

View source — packages/core/src/features/viz/lib/types.ts:38

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

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

Related API: ScaleLayoutStyle, BoxStyle, LayoutItemStyle.

BoxStyle

LayoutItemStyle

LinearScaleProps

View source — packages/core/src/features/viz/lib/types.ts:59

width (optional)
width?: SizingLength | undefined

Related API: SizingLength.

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

View source — packages/core/src/lib/style/types.ts:91

height (optional)
height?: SizingLength | undefined

Related API: SizingLength.

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

View source — packages/core/src/lib/style/types.ts:93

aspectRatio (optional)
aspectRatio?: number | undefined

Positive finite outer width/height ratio consumed by finite Flex, including wrapped lines. Final per-line main size derives cross size before cross bounds; intrinsic main sizing is unsupported. A documented direct absolute Flex child may derive exactly one automatic outer axis from its declared numeric opposite axis when no opposing inset pair supplies that axis. See FlexItemStyle.

View source — packages/core/src/lib/style/types.ts:144

margin (optional)
margin?: FlexMargin | undefined

Related API: FlexMargin.

Uniform physical margin in logical Canvas units, a percentage of allocated Flex content width, or auto on supported finite Flex axes. Finite negatives are allowed; specific edges override this value. Consumed by experimental Flex only. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:146

marginTop (optional)
marginTop?: FlexMargin | undefined

Related API: FlexMargin.

Physical top margin overriding margin. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:148

marginRight (optional)
marginRight?: FlexMargin | undefined

Related API: FlexMargin.

Physical right margin overriding margin. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:150

marginBottom (optional)
marginBottom?: FlexMargin | undefined

Related API: FlexMargin.

Physical bottom margin overriding margin. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:152

marginLeft (optional)
marginLeft?: FlexMargin | undefined

Related API: FlexMargin.

Physical left margin overriding margin. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:154

marginStart (optional)
marginStart?: FlexMargin | undefined

Related API: FlexMargin.

Inline-start margin overriding the corresponding physical edge and margin shorthand in experimental Flex. Signed percentages use allocated content width. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:156

marginEnd (optional)
marginEnd?: FlexMargin | undefined

Related API: FlexMargin.

Inline-end margin overriding the corresponding physical edge and margin shorthand in experimental Flex. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:158

alignSelf (optional)
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:160

justifySelf (optional)
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:162

flexBasis (optional)
flexBasis?: SizingLength | undefined

Related API: SizingLength.

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

View source — packages/core/src/lib/style/types.ts:164

flexGrow (optional)
flexGrow?: number | undefined

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

View source — packages/core/src/lib/style/types.ts:166

flexShrink (optional)
flexShrink?: number | undefined

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

View source — packages/core/src/lib/style/types.ts:168

gridColumnStart (optional)
gridColumnStart?: number | undefined

Explicit starting grid column. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:170

gridColumnSpan (optional)
gridColumnSpan?: number | undefined

Number of columns occupied by this child. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:172

gridRowStart (optional)
gridRowStart?: number | undefined

Explicit starting grid row. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:174

gridRowSpan (optional)
gridRowSpan?: number | undefined

Number of rows occupied by this child. See LayoutItemStyle.

View source — packages/core/src/lib/style/types.ts:176

position (optional)
position?: "absolute" | "relative" | "static" | undefined

Experimental direct-Flex placement mode. In a finite Flex, static keeps the allocated slot and ignores insets; relative offsets final geometry once without moving siblings. Primitive static/relative leaves support every main/writing direction and wrapping mode. Wrapped parents admit fixed numeric direct Flex owners that remain internally nowrap; non-row chains use the same fixed owner restriction, with zero grow/shrink and omitted or automatic basis; physical offsets retain their sign through main reversal. Absolute stays out of sibling allocation, using the padding box for explicit insets and content alignment for omitted axes. Fixed numeric, percentage and admitted automatic absolute profiles support all main directions and RTL, with numeric or percentage bounds applied before placement. In every wrapping mode, omitted axes use whole-content main/cross alignment; wrap-reverse reverses omitted cross alignment and combines with column RTL exactly once. Paired natural providers keep their exact/unbounded query in every admitted direction. Direct wrapped Text with a generic pixel font and visible fit/overflow may measure automatic height at a resolved numeric or percentage width through the same owned query. Unwrapped Text may measure automatic width at a resolved numeric or percentage height, using its existing Canvas ink-bounds width before bounds and physical anchoring. Generic unwrapped Text also supports natural ink height and both automatic dimensions through one unbounded query before independent numeric clamps; mixed opposing-pair/natural feedback and both-auto aspect remain excluded. On the documented finite direct-child path, automatic absolute axes resolve from opposing numeric or percentage physical insets. With a positive finite aspectRatio, exactly one automatic axis can instead derive from its resolved declared finite numeric or percentage opposite axis. Opposing insets win. Finite numeric or percentage min/max bounds clamp used axes independently after derivation; a clamp does not recouple aspectRatio, and a numeric minimum above its maximum rejects. A direct custom primitive with paired pure measurement providers may instead measure natural automatic width at a declared numeric or percentage height, or natural height at a declared numeric or percentage width. The automatic axis is unbounded; the exact axis uses its declared resolved padding-box value before bounds clamp the used dimensions. In direct declarative Flex chains, static Flex passes the containing box outward while relative Flex owns a local box. Omission retains the legacy local Flex boundary and left/top behavior.

View source — packages/core/src/lib/style/positioning.ts:194

left (optional)
left?: number | `${number}%` | undefined

Left edge coordinate or inset. Explicit absolute Flex insets accept finite numbers or percentages of the containing padding-box axis; relative percentages use the parent content-box axis. See Length.

View source — packages/core/src/lib/style/positioning.ts:196

right (optional)
right?: number | `${number}%` | undefined

Right edge inset. Absolute Flex accepts finite numbers or percentages of the containing padding-box width; relative percentages use the parent content-box width. See Length.

View source — packages/core/src/lib/style/positioning.ts:198

top (optional)
top?: number | `${number}%` | undefined

Top edge coordinate or inset. Explicit absolute Flex insets accept finite numbers or percentages of the containing padding-box axis; relative percentages use the parent content-box axis. See Length.

View source — packages/core/src/lib/style/positioning.ts:200

bottom (optional)
bottom?: number | `${number}%` | undefined

Bottom edge inset. Absolute Flex accepts finite numbers or percentages of the containing padding-box height; relative percentages use the parent content-box height. See Length.

View source — packages/core/src/lib/style/positioning.ts:202

insetStart (optional)
insetStart?: number | `${number}%` | undefined

Experimental direct absolute Flex inline-start inset, mapped through the receiving Flex direction. Overrides the corresponding physical edge, including zero. Percentages use the selected containing padding-box width. See Length.

View source — packages/core/src/lib/style/positioning.ts:204

insetEnd (optional)
insetEnd?: number | `${number}%` | undefined

Experimental direct absolute Flex inline-end inset, mapped through the receiving Flex direction. Overrides the corresponding physical edge. See Length.

View source — packages/core/src/lib/style/positioning.ts:206

layoutParticipation (optional)
layoutParticipation?: "contents" | "hidden" | "normal" | undefined

Numeric layout participation. Hidden subtrees retain mounted ownership without geometry or paint; contents retains logical ancestry without owning a box. See SystemStyle.

View source — packages/core/src/lib/types.ts:69

transition (optional)
transition?: PibblTransitionBinding | undefined

Related API: PibblTransitionBinding.

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

View source — packages/core/src/lib/types.ts:71

custom (optional)
custom?: unknown

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

View source — packages/core/src/lib/types.ts:73

filter (optional)
filter?: PibblFilter | readonly PibblFilter[] | undefined

Related API: PibblFilter.

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

View source — packages/core/src/lib/types.ts:78

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

interface LinearScaleProps

Related API: LinearScaleProps.

ScaleId

SignalValue

LinearDomain

ScaleRange

SignalStyle

ScaleLayoutStyle

PibblNode

BarScaleProps

View source — packages/core/src/features/viz/lib/types.ts:73

id
readonly id: ScaleId

Related API: ScaleId.

Stable identifier of this resource or connection. See ScaleId.

View source — packages/core/src/features/viz/lib/types.ts:75

domain
readonly domain: SignalValue<LinearDomain>

Related API: SignalValue, LinearDomain.

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

View source — packages/core/src/features/viz/lib/types.ts:80

range
readonly range: SignalValue<ScaleRange>

Related API: SignalValue, ScaleRange.

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

View source — packages/core/src/features/viz/lib/types.ts:85

reverse (optional)
readonly reverse?: SignalValue<boolean> | undefined

Related API: SignalValue.

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

View source — packages/core/src/features/viz/lib/types.ts:87

style (optional)
Full type declaration
readonly style?: SignalValue<Readonly<{ position?: SignalValue<"absolute" | "relative" | "static" | undefined>; left?: SignalValue<number | `${number}%` | undefined>; right?: SignalValue<number | `${number}%` | undefined>; top?: SignalValue<number | `${number}%` | undefined>; bottom?: SignalValue<number | `${number}%` | undefined>; insetStart?: SignalValue<number | `${number}%` | undefined>; insetEnd?: SignalValue<number | `${number}%` | undefined>; width?: SignalValue<SizingLength | undefined>; height?: SignalValue<SizingLength | undefined>; aspectRatio?: SignalValue<number | undefined>; margin?: SignalValue<FlexMargin | undefined>; marginTop?: SignalValue<FlexMargin | undefined>; marginRight?: SignalValue<FlexMargin | undefined>; marginBottom?: SignalValue<FlexMargin | undefined>; marginLeft?: SignalValue<FlexMargin | undefined>; marginStart?: SignalValue<FlexMargin | undefined>; marginEnd?: SignalValue<FlexMargin | undefined>; alignSelf?: SignalValue<"auto" | "center" | "end" | "flex-end" | "flex-start" | "start" | "stretch" | undefined>; justifySelf?: SignalValue<"auto" | "center" | "end" | "start" | "stretch" | undefined>; flexBasis?: SignalValue<SizingLength | 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>; layoutParticipation?: SignalValue<"contents" | "hidden" | "normal" | undefined>; transition?: SignalValue<PibblTransitionBinding | undefined>; custom?: unknown; filter?: SignalValue<PibblFilter | readonly PibblFilter[] | undefined>; }>> | undefined

Related API: SignalValue, SizingLength, FlexMargin, PibblTransitionBinding, PibblFilter.

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

View source — packages/core/src/features/viz/lib/types.ts:92

children (optional)
readonly children?: PibblNode

Related API: PibblNode.

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

View source — packages/core/src/features/viz/lib/types.ts:94

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

interface ResolvedLinearScale

Related API: ResolvedLinearScale.

LinearDomain

LayoutBox

ResolvedScale

nearestDomainValue

View source — packages/core/src/features/viz/lib/types.ts:189

type
readonly type: "linear"

The literal “linear” identifying this variant. See ResolvedLinearScale.

View source — packages/core/src/features/viz/lib/types.ts:191

domain
readonly domain: LinearDomain

Related API: LinearDomain.

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

View source — packages/core/src/features/viz/lib/types.ts:193

range
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

frame
readonly frame: Readonly<LayoutBox>

Related API: LayoutBox.

Resolved layout frame containing the scale. See LayoutBox.

View source — packages/core/src/features/viz/lib/types.ts:197

map
map: (value: number) => number

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

  • value — Numeric domain coordinate.

The corresponding range coordinate.

View source — packages/core/src/features/viz/lib/types.ts:203

invert
invert: (pixel: number) => number

Related API: invert.

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

  • pixel — Coordinate in the scale’s pixel range.

The corresponding numeric domain value.

View source — packages/core/src/features/viz/lib/types.ts:210

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

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

  • count — Suggested number of ticks.

Tick values in domain coordinates.

View source — packages/core/src/features/viz/lib/types.ts:217

A numeric or categorical mapping snapshot. See ResolvedContinuousScale.

type ResolvedScale = | ResolvedContinuousScale
| ResolvedBandScale
| ResolvedPointScale
| ResolvedTradingTimeScale

Related API: ResolvedScale, ResolvedContinuousScale, ResolvedBandScale, ResolvedPointScale, ResolvedTradingTimeScale.

View source — packages/core/src/features/viz/lib/types.ts:256

type
readonly type: "band" | "linear" | "log" | "point" | "symlog" | "trading-time" | "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. Describes this resolved mapping. UTC calendar scale discriminant. See UTCScaleProps.

View source — packages/core/src/features/viz/lib/types.ts:162

domain
readonly domain: BandDomain | LinearDomain | readonly number[]

Related API: BandDomain, LinearDomain.

Data values or endpoints accepted by the scale. See BandDomain. Data values or endpoints accepted by the scale. See LinearDomain. Owned supplied timestamp domain, not logical slot endpoints.

View source — packages/core/src/features/viz/lib/types.ts:164

range
readonly range: readonly [number, number]

Logical output coordinates produced by the scale. See ResolvedBandScale. Logical output coordinates produced by the scale. See ResolvedLinearScale. Output local-logical endpoints.

View source — packages/core/src/features/viz/lib/types.ts:166

frame
readonly frame: Readonly<LayoutBox> | Readonly<{ x: number; y: number; width: number; height: number; }>

Related API: LayoutBox.

Resolved layout frame containing the scale. See LayoutBox. Receiving allocation in local logical units.

View source — packages/core/src/features/viz/lib/types.ts:168

map
map: ((time: number) => number) | ((value: BandCategory) => number | undefined) | ((value: number) => number)

Related API: BandCategory.

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. Maps an exact supplied UTC timestamp; unknown timestamps throw.

  • value — Category to locate in the domain. See BandCategory.

  • value — Numeric domain coordinate.

  • time — Supplied UTC milliseconds.

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

The corresponding range coordinate.

Series-local coordinate.

View source — packages/core/src/features/viz/lib/types.ts:179

Read the Data visualization companion for ownership, adaptation, failure modes, and verification. Agent start provides the version-selection workflow.

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