Skip to main content

sampling

Method of Figure.

Overloads

NameDescription
sampling(const string mode) -> FigureSets figure-level sampling mode. Auto uses minmax for line series and sum for ordered bar series; scatter and heatmap are not auto-sampled.
sampling(const Map options) -> FigureConfigures figure-level sampling. Dataset-backed series can be sampled when x/y dimensions are resolved from encode or inferred from series order.

sampling(const string mode) -> Figure

Sets figure-level sampling mode. Auto uses minmax for line series and sum for ordered bar series; scatter and heatmap are not auto-sampled.

Parameters

  • mode: Sampling mode or explicit method: 'auto', 'disable', 'minmax', 'lttb', 'average', 'median', 'min', 'max', or 'sum'.

sampling(const Map options) -> Figure

Configures figure-level sampling. Dataset-backed series can be sampled when x/y dimensions are resolved from encode or inferred from series order.

Parameters

  • options: Sampling options map.
    • method (string): Sampling mode or method: 'auto', 'disable', 'minmax', 'lttb', 'average', 'median', 'min', 'max', or 'sum'. Auto uses minmax for line series and sum for ordered bar series.
    • max_points (number): Maximum number of points to emit for sampled series. Defaults to 50000.
    • preserve_endpoints (boolean): Keep the first and last point when sampling. Defaults to true.