Skip to content

charton API


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

Function: layoutDepthRows() ​

layoutDepthRows(book, area): DepthRow[]

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

Lay out the rows of book in an area width × height, using the price scale's priceToY (which already applies log, percent and inverted modes). Rows off the area or at prices the scale cannot place are left out. Each bar is as thick as the distance to its nearest neighbour on the same side allows (minus a pixel of gap), and as long as its size relative to the largest visible size.

Parameters ​

book ​

DepthBook

area ​

Pick<PrimitiveEnv, "width" | "height" | "priceToY">

Returns ​

DepthRow[]