Macaw.Data.Operations.Transforms.Lttb (macaw_data v0.9.0)

View Source

lttb (spec/04 §4.4): shape-preserving downsampling to n rows by MinMaxLTTB (Van Der Donckt et al., 2023), whole rows kept, gaps passing through. n is frame-bound: "plot" is the plot's width in whole pixels. A reducer (spec/04 §7).

A combine (spec/04 §1.4) on the bucket ladder (Macaw.Data.Operations.Transforms.Ladder): each chunk's partial is its buckets' least and greatest points (the preselection), at the level whose bucket is at most span / (2n), so at least 4n candidates; the merge selects n of them, each run's first and last among them, by Largest-Triangle-Three- Buckets (Macaw.Data.Reduce.lttb/3, the exact algorithm, also its oracle).