ExLTTB v0.3.0 ExLTTB View Source

Documentation for ExLTTB.

Link to this section Summary

Link to this section Functions

Link to this function downsample_to(sample_list, threshold, opts \\ []) View Source

Downsamples a sample list using LTTB.

Arguments

  • sample_list: a List of samples. These can have any representation provided that access functions are provided (see Options). The samples are assumed to be sorted by the x coordinate.
  • threshold: the number of required output samples. Must be >= 0.
  • opts: a keyword list of options.

Options

  • sample_to_x_fun: a function that takes as argument a sample and returns its x coordinate. Defaults to sample[:x]
  • sample_to_y_fun: a function that takes as argument a sample and returns its y coordinate. Defaults to sample[:y]
  • xy_to_sample_fun: a function that takes as argument x and y and returns a sample with these coordinates. Defaults to %{x: x, y: y}

Return

  • sample_list: a downsampled list of samples.