Interface CurveGenerator

A minimal interface for a curve generator which supports the rendering of lines and areas.

While lines are defined as a sequence of two-dimensional [x, y] points, and areas are similarly defined by a topline and a baseline, there remains the task of transforming this discrete representation into a continuous shape: i.e., how to interpolate between the points. A curve generator serves this purpose.

Curves are typically not constructed or used directly, instead being passed to line.curve and area.curve.

interface CurveGenerator {
    areaEnd(): void;
    areaStart(): void;
    lineEnd(): void;
    lineStart(): void;
    point(x, y): void;
}

Hierarchy

Methods

  • Indicates the end of the current area segment.

    Returns void

  • Indicates the start of a new area segment. Each area segment consists of exactly two line segments: the topline, followed by the baseline, with the baseline points in reverse order.

    Returns void

  • Indicates a new point in the current line segment with the given x- and y-values.

    Parameters

    • x: number
    • y: number

    Returns void