Depth chart

A React component in Beamline's Trading category.

Cumulative bid and ask depth as stepped areas around the mid, with hover readout.

Use it for

  • Showing how much size sits within a price range.

Not for

Anatomy

  • bid area + line
  • ask area + line
  • mid line
  • size axis (folds in a narrow room)
  • price axis
  • guide + marker
  • readout (side in words, price, % from the mid, size to fill)

Variants

  • range: fraction of mid

States

  • live
  • probed (pointer or keyboard: the readout names the side in words, the price, its distance from the mid and the size to fill it)
  • empty (no bids and no asks: says so instead of drawing)
  • room: under 240px the size axis folds and the areas take its gutter; with height="fill" any height (fewer size ticks under 160px)
  • RTL (price axis stays left to right)

Keyboard

  • Tab focuses the plot (one stop)
  • ← / → walk the levels by price; the first press starts at the best bid (←) or the best ask (→)
  • Home / End jump to the farthest bid / ask
  • Escape lets go; the chosen level is read aloud

Motion

Live data never travels: the areas redraw in place on each book update; the guide and readout follow the pointer or the keys at once. Marks take the look's line weight and fill finish (dots in mono, hatching in ink), never an animation.

Props

PropTypeDefaultDescription
bids / asks (required)Level[]—bids: Bid price and size levels from the market feed. Required. asks: Ask price and size levels from the market feed. Required.
rangenumber0.01Visible price range as a fraction of mid on each side.
heightnumber | 'fill'220Plot height in px, or "fill": the height the parent gives the chart.
style / refCSSProperties / native Ref—style: Inline styles on the documented visual root; no inline overrides by default. ref: Receives the documented root element; no ref by default.
classNamesDepthChartClassNames—Classes for the named visual parts; no part overrides by default.
styleCSSProperties—Inline styles on the documented visual root; no inline overrides by default.
bids (required)Level[]—Bid price and size levels from the market feed. Required.
asks (required)Level[]—Ask price and size levels from the market feed. Required.
priceDecimalsnumber—Fractional digits shown for prices. Defaults to 2.
sizeDecimalsnumber—Maximum fractional digits used for trade sizes. Defaults to 3.
basestring—Base asset label used with trade sizes. Defaults to an empty string.
classNamestring—Classes on the documented visual root; no override by default.
refRef<HTMLDivElement>—Receives the documented root element; no ref by default.

Used in

Dependencies

d3-scale, d3-shape

Import

import { DepthChart } from "@beamline/depth-chart";

Get it

Depth chart is part of Beamline UI. Install the parts you need in your React app as compiled packages or editable source. Get Beamline · Connect your agent

More in Trading

  • Price chart: Candles, line or area price chart with volume, OHLC legend and reference lines, built for live ticks.
  • Market heatmap: Treemap of markets sized by weight and coloured by change, grouped by sector, with hatched no-data tiles.
  • Order book: Asks, spread and bids with cumulative depth bars, grouping, change flashes and keyboard price picking.
  • Options chain: Calls and puts for one expiry around a centre column of strikes: bid, ask, implied volatility, delta, volume and open interest, the money shaded in, a…
  • Ticker tape: A continuously scrolling row of symbols with price, change and mini trend; anyone can hold it: hover, keyboard focus or a tap.
  • Watchlist: A selectable, sortable list of markets with mini trends, prices, changes and stars.
  • Trades tape: Recent trades, newest first, with side glyphs, large-print marking and one-time arrival flashes.
  • Order ticket: Buy/sell order entry with limit, market and stop types, % of balance, inline validation and a live cost summary.
  • Swap form: Exchange one token for another: type what you pay (or Max), pick each token from a searchable list with balances, and the form quotes what you receive…
  • Positions table: Open positions with live unrealised PnL, liquidation warnings and close actions.
  • P&L calendar: A trader's month at a glance: every trading day's profit or loss in its cell, shaded deeper the bigger it was in the gain or loss colour and marked ▲ or…
  • Price ticker: Symbol, last price with a directional flash, 24h change and stats.
  • Funding countdown: Perpetual funding rate with who pays, and a live countdown ring to the next funding.

Guides: Build a trading terminal in React

Part of Beamline UI: polished, editable React components and complete screens for custom applications. Build your own style from any look; tokens, fonts, radii, motion; not only colours.