const Sampler: LiveComponent<SamplerProps<string | string[]>>
Up-to-4D array of a WGSL type. Samples a given expr
on the given range
.
number[]
Sample count up to [width, height, depth, layers]
number
Shorthand for size=[length]
string
Axis to sample on (1D)
string
Axes to sample on (2D+)
VectorLike
Sample origin to maintain alignment to
string
WGSL type per sample
Emitter
Input emitter expression
([number, number])[]
Input range to sample on each axis. Use RangeContext if omitted.
number
Extra padding samples to add outside the input range.
number
Emit N items per expr
call. Output size is [items, ...size]
if > 1.
boolean
Emit 0 or N items per expr
call. Output size is [N]
or [items, N]
.
boolean[] | boolean
Use centered samples (0.5, 1.5, ..., N-0.5) instead of edge-to-edge samples (0, 1, ..., N).
boolean
Add current indices i
, j
, k
, l
to the expr
arguments.
boolean
Add current TimeContext
to the expr
arguments.
boolean
Resample data
or expr
on every animation frame.
S
Inject into DataContext under this key(s) render?
S
extends
any[]
?
(
data: Record<ElementType<S>, TensorArray>,
) => LiveElement
:
(data: TensorArray) => LiveElement
children?
| LiveElement
| S extends any[] ? (data: Record<ElementType<S>, TensorArray>) => LiveElement : (data: TensorArray) => LiveElement
packages / plot / src / source / sampler.ts