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

    Class ParallelChannel

    Parallel (bounded) channel — three anchor points: A, B → the base line segment (defines slope and extent) C → a point on the parallel boundary (defines the offset)

    Unlike Channel, which extends its boundaries across the whole visible window like an equidistant channel, ParallelChannel draws the two boundaries as finite segments spanning the base anchors' x-range, with a translucent fill between them. Useful for marking a measured move bounded to a specific window.

    The parallel boundary is offset from the base by the vertical (price) distance between C and the base line at C's index, so the two lines stay parallel under any price re-scale.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    color: string | null = null
    id: string
    points: AnchorPoint[] = []
    KIND: "parallelchannel" = 'parallelchannel'

    Accessors

    • get isComplete(): boolean

      True once requiredPoints clicks have been collected.

      Returns boolean

    • get isReplayCapExempt(): boolean

      True when the drawing's rendered geometry does NOT depend on its anchor index/time — e.g. a full-width horizontal price level. Such drawings stay visible (and selectable) under a replay cap even when their stored anchor index sits past the revealed prefix, because the index is cosmetic for them. Index/time-dependent drawings (the default) are hidden once every anchor is past the cap, so a not-yet-revealed shape never leaks. Subclasses whose render ignores the index override this to true.

      Returns boolean

    • get kind(): string

      Unique discriminator used in snapshots. Subclasses override.

      Returns string

    • get requiredPoints(): number

      How many clicks are needed before the drawing is "complete".

      Returns number

    Methods

    • Hit-test a screen point (in canvas pixels) against this drawing for selection. Returns true when the point is within tolerance pixels of the rendered geometry.

      The default implementation treats the anchors as a polyline (correct for segment shapes like TrendLine and Arrow). Shapes whose rendered geometry differs from a simple anchor polyline — full-width/height lines, rectangles, rays, channels, fib levels — override this.

      Parameters

      • px: number
      • py: number
      • layout: ChartLayout
      • viewport: Viewport
      • tolerance: number = DRAWING_HIT_TOLERANCE_PX

      Returns boolean

    • Restore the numeric payload produced by snapshotData. Called by the snapshot factory after the anchors are populated. No-op in the base class.

      Parameters

      • _data: number[] | undefined

      Returns void

    • Optional numeric payload persisted alongside the anchors. The base class emits nothing; subclasses that derive geometry from sampled data (regression channel) override this so the snapshot round-trips exactly. Mirrors restoreData.

      Returns number[] | undefined