Skip to content

charton API


charton API / @chart-on/core / index / DepthLane

Interface: DepthLane ​

Defined in: packages/core/src/depth-lane.ts:76

A depth lane primitive. Attach it with chart.attachPrimitive, or create one with chart.addDepthLane.

Extends ​

Properties ​

bestAsk ​

readonly bestAsk: DepthLevel | null

Defined in: packages/core/src/depth-lane.ts:89


bestBid ​

readonly bestBid: DepthLevel | null

Defined in: packages/core/src/depth-lane.ts:88


layer? ​

optional layer?: PrimitiveLayer

Defined in: packages/core/src/primitives.ts:81

Plot layer (default 'normal'): under the series, with them, or above drawings.

Inherited from ​

Primitive.layer


levels ​

readonly levels: DepthBook

Defined in: packages/core/src/depth-lane.ts:87

Shown levels: bids from the highest price down, asks from the lowest up, at most maxLevels each.


options ​

readonly options: Readonly<DepthLaneOptions>

Defined in: packages/core/src/depth-lane.ts:77

Methods ​

applyOptions() ​

applyOptions(options): void

Defined in: packages/core/src/depth-lane.ts:79

Merge new options; width, side and visibility changes relay the chart out.

Parameters ​

options ​

Partial<DepthLaneOptions>

Returns ​

void


attached()? ​

optional attached(host): void

Defined in: packages/core/src/primitives.ts:82

Parameters ​

host ​

PrimitiveHost

Returns ​

void

Inherited from ​

Primitive.attached


clear() ​

clear(): void

Defined in: packages/core/src/depth-lane.ts:85

Remove every level.

Returns ​

void


detached()? ​

optional detached(): void

Defined in: packages/core/src/primitives.ts:83

Returns ​

void

Inherited from ​

Primitive.detached


drawLane()? ​

optional drawLane(ctx, env): void

Defined in: packages/core/src/primitives.ts:99

Draw in the reserved lane (clipped to it); env.width is the lane width.

Parameters ​

ctx ​

CanvasRenderingContext2D

env ​

PrimitiveEnv

Returns ​

void

Inherited from ​

Primitive.drawLane


drawPlot()? ​

optional drawPlot(ctx, env): void

Defined in: packages/core/src/primitives.ts:85

Draw in the pane's plot area (clipped to it).

Parameters ​

ctx ​

CanvasRenderingContext2D

env ​

PrimitiveEnv

Returns ​

void

Inherited from ​

Primitive.drawPlot


drawPriceAxis()? ​

optional drawPriceAxis(ctx, env): void

Defined in: packages/core/src/primitives.ts:87

Draw in the pane's price-axis area; env.width is the axis width.

Parameters ​

ctx ​

CanvasRenderingContext2D

env ​

PrimitiveEnv

Returns ​

void

Inherited from ​

Primitive.drawPriceAxis


drawTimeAxis()? ​

optional drawTimeAxis(ctx, env): void

Defined in: packages/core/src/primitives.ts:89

Draw in the time-axis area; env.height is the axis height.

Parameters ​

ctx ​

CanvasRenderingContext2D

env ​

PrimitiveEnv

Returns ​

void

Inherited from ​

Primitive.drawTimeAxis


hitTest()? ​

optional hitTest(p, env): PrimitiveHit | null

Defined in: packages/core/src/primitives.ts:105

Hit test a plot-local point (pane-local css px).

Parameters ​

p ​

Point

env ​

PrimitiveEnv

Returns ​

PrimitiveHit | null

Inherited from ​

Primitive.hitTest


lane()? ​

optional lane(): PrimitiveLane | null

Defined in: packages/core/src/primitives.ts:97

Reserve a lane of this width between the plot and the price axis on one side; null (or no method) takes no width. The plot narrows to make room, so the axis keeps its place and width. Lanes of one pane and side sit side by side in attach order, the first next to the plot. Read on every full redraw: call requestRedraw after the answer changes.

Returns ​

PrimitiveLane | null

Inherited from ​

Primitive.lane


on() ​

on<K>(event, listener): () => void

Defined in: packages/core/src/depth-lane.ts:91

Subscribe to lane events; returns an unsubscribe function.

Type Parameters ​

K ​

K extends "levels:change"

Parameters ​

event ​

K

listener ​

(payload) => void

Returns ​

() => void


priceAxisLabels()? ​

optional priceAxisLabels(env): PriceAxisLabel[]

Defined in: packages/core/src/primitives.ts:101

Labels drawn on the price axis like last-value labels.

Parameters ​

env ​

PrimitiveEnv

Returns ​

PriceAxisLabel[]

Inherited from ​

Primitive.priceAxisLabels


priceRange()? ​

optional priceRange(from, to): [number, number] | null

Defined in: packages/core/src/primitives.ts:103

Price span to keep in view over visible indices [from, to].

Parameters ​

from ​

number

to ​

number

Returns ​

[number, number] | null

Inherited from ​

Primitive.priceRange


setLevels() ​

setLevels(book): void

Defined in: packages/core/src/depth-lane.ts:81

Replace every level. Levels with size 0 or invalid numbers are left out.

Parameters ​

book ​

Partial<DepthBook>

Returns ​

void


update() ​

update(changes): void

Defined in: packages/core/src/depth-lane.ts:83

Apply changes to single levels: size 0 removes a level, any other size sets it.

Parameters ​

changes ​

DepthChanges

Returns ​

void