@rekurt/openkline - v0.2.0
    Preparing search index...

    Interface SeriesDefinition

    A pluggable primary-series type. Built-ins (candles, line, area, ohlc, heikinashi) implement this, and hosts can registerSeriesType their own (footprint, range bars, …) as first-class citizens that participate in autoscale, conflation, and the legend.

    interface SeriesDefinition {
        type: string;
        draw(c: SeriesRenderContext): void;
        priceRange?(view: CandleView, i: number): SeriesPriceRange;
        transformView?(
            buffer: CandleBuffer,
            start: number,
            end: number,
        ): CandleView;
    }
    Index

    Properties

    type: string

    Discriminator stored in state and passed to setChartType.

    Methods

    • Min/max price contributed by entry i of view, so autoscale fits the series correctly. Defaults to the candle's low/high when omitted. When present (or when transformView is), autoscale scans the view via this hook instead of the raw buffer (so it can't use the range pyramid).

      Parameters

      Returns SeriesPriceRange

    • Optional pre-render transform producing a synthetic, index-aligned CandleView for the window [start, end) (Heikin-Ashi, custom). The result flows through autoscale → conflation → draw like any view. Must stay index-aligned to the buffer window (one output row per input row).

      Parameters

      Returns CandleView