Macaw.Frame.Transforms.Ridge (macaw_frame v0.1.0)

Copy Markdown View Source

The ridge step (spec/04 §7.1, spec/13 §7.1): a ridgeline's baselines, a frame concern (needs: [:frame]), for an area per series.

Its rows are a density estimate's (macaw_data's density by by): field is each point's density, by its series. Each series is a band of a band scale down the plot's height, its domain the series in order of first appearance (a nil series a band of its own), padding none. A ridge rises from its band's bottom by up to 1 + overlap band steps, so overlap (1) of a step reaches into the bands above it; the band scale's range starts that far below the plot's top, so the first ridge's peak stays in the plot. The step adds baseline, the row's ridge's pixel along y, and top, the baseline less the density scaled so that the greatest density of every series (macaw_data's max, never the step's own arithmetic) spans a ridge's height. A density that is no number places no top (nil). The area draws from baseline to top; the statistic is macaw_data's.