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

    Interface HorzScaleBehavior<T>

    Pluggable behavior for the horizontal domain, abstracting the engine away from "X is always time". The default TimeScaleBehavior keeps the existing time axis byte-for-byte; PriceScaleBehavior drives an options-style numeric X axis (strikes), and hosts can register their own.

    The engine positions bars by uniform buffer index regardless of behavior (so all existing geometry/interaction is unchanged); a behavior decides what each index means and how to label it. Truly non-uniform geometry (proportional yield-curve spacing) is reserved for a future extension via domainToCoord01 + uniform = false.

    T is the domain value type (Unix seconds for time, a number for price).

    interface HorzScaleBehavior<T = number> {
        uniform: boolean;
        domainToCoord01?(value: T, fromLogical: number, toLogical: number): number;
        formatValue(value: T): string;
        fromLogical(logical: number, buffer: CandleBuffer): T | null;
        toLogical(value: T, buffer: CandleBuffer): number;
    }

    Type Parameters

    • T = number

    Implemented by

    Index

    Properties

    uniform: boolean

    When true (all built-ins), bars are positioned by uniform buffer index and domainToCoord01 is ignored — the standard, fully-tested geometry.

    Methods

    • Future (non-uniform) hook: map a domain value to a 0..1 position across the visible logical range, for proportional spacing. Unused while uniform is true.

      Parameters

      • value: T
      • fromLogical: number
      • toLogical: number

      Returns number