Chartsv26.10.18
Kits

Table kit

The table layer of the kits - the column model of the core, figure cells drawn live in both palettes, and a table that drives the chart next to it.

The table kit is the table layer of the library: @unifin/chart-core owns the column model, the sorting, the figure cells and the export, and @unifin/chart-react owns the table widget. There is no extra package to install - a host that already uses the core and the binding has the whole layer, and the domain kits feed it their rows.

For a worked book with the whole chain - SID, accounts, sub-balances, settlement agent and broker - see Balances table layouts.

Mini figures of the table layer, drawn live by @unifin/chart-core - nothing here is an image.

A table answers "how much"; an instrument row also has to answer "where the value came from", "how large it is against the rest", "is the row trustworthy" and "what happens if". Mini figures carry that second half inside the cell, so the reader never leaves the row.

25 primitives, drawn live by @unifin/chart-core
  • Sparklinesparkline

    Where the value came from over the window

    Sixteen closes of one instrument

  • Delta bardeltaBar

    How far and which way a signed value moved

    Day change +0.42 % against the full range

  • Inline barinlineBar

    How large the value is against the column maximum

    Coupon 42 against a 100 bp column maximum

  • Micro barsmicroBars

    The shape of a small series (volume, prints)

    Ten prints of one session, open marked

  • Heat stripheatStrip

    Monthly or bucket returns at a glance

    Twelve monthly returns, sign and size

  • Share stackminiStack

    What the group is made of

    Four rating buckets of a portfolio

  • Scale markscaleMark

    Where a rating or tenor sits on its scale

    Rating BBB on the AAA to D scale

  • Quality stripqualityStrip

    Which fields are filled and which are stale

    Eight fields, the sixth stale

  • Timeline striptimelineStrip

    When the events of the row happen

    Seven cash-flow dates: coupons, an offer, the maturity

  • DistributionminiDistribution

    The spread of the column around its median

    Yield of the screened universe, median and kept range

  • GaugeminiGauge

    Utilisation of a limit as one arc

    Limit utilisation 72 %

  • Mini waterfallminiWaterfall

    How the pieces build the total

    Attribution of a portfolio result

  • Depth ladderminiLadder

    Bid and ask depth around the mid

    Bid and ask depth around the mid

  • Risk ladderriskLadder

    Where the stop and the target sit against the entry

    Entry 812, stop 805, target 828 - a 2.3 R order

  • Status funnelstatusFunnel

    How many items reached each stage

    Payments per stage, the fourth short

  • IV matrixivMatrix

    Implied volatility across strikes and expiries, with the smile

    Two expiries and five strikes: the smile of every row

  • Payoff curvepayoffCurve

    Where the strategy wins, where it loses and where it breaks even

    A long call: the break-even at 100 and the profit after it

  • Greek barsgreekBars

    The greeks of the position in one signed row

    Delta, gamma, vega and a negative theta

  • Term curvetermCurve

    The futures curve with the open interest under it

    Five futures in contango with the open interest under the curve

  • Correlation matrixcorrelationMatrix

    How the members move together, cell by cell

    Four names: two move together, one moves apart

  • Scenario conescenarioCone

    The band a shock spreads over the horizon

    A stress cone: the band widens with the horizon

  • Balance timelinebalanceTimeline

    How the account balance stepped through the window

    Twelve settlements: the balance holds, then jumps, and dips once

  • Cash-flow laddercashflowLadder

    Inflows and outflows per period with the running total

    Inflows above the line, outflows below, the running total over them

  • Limit barlimitBar

    How much of a limit is used and where the breach starts

    Sixty percent of the limit used, the breach starts at eighty

  • Agreement scatteragreementScatter

    Expected against actual, with the diagonal and the breaks

    Expected against actual: three breaks above the diagonal of agreement

Figure columns of the data table

A column declares its figure, and every visible row draws it next to the number:

const columns: TableColumn<Row>[] = [
  {
    id: 'trend',
    title: 'Trend',
    kind: 'number',
    digits: 2,
    value: (row) => row.closes.at(-1) ?? null,
    figure: {
      kind: 'sparkline',
      values: (row) => row.closes,
      label: (row) => `${row.symbol} trend, last sixteen closes`,
    },
  },
];

<DataTable columns={columns} rows={rows} getRowKey={(row) => row.symbol} />;

The figure repeats the number, it never replaces it: the column keeps value, so sorting, filtering and copying work unchanged. A cell whose figure has nothing to draw - an empty window, a non-finite value, a column without a figure spec - renders the number alone, without an exception.

A host that renders for a locale passes it down: <DataTable locale="de-DE" ... /> reformats every numeric cell through the table model - grouping and the decimal separator follow the locale, while the digits and the unit of each column stay as the kit declares them. The live boards on the bonds, portfolio and options kit pages carry a switch that shows the same rows in en-US, de-DE and ru-RU.

The board below runs five figure columns off one shared canvas pool. The counters come from the pool itself, and a virtualised board holds canvases for the visible rows only, so a long table keeps the same bound:

12 rows, five figure columns, one shared canvas pool
Watchlist: the figure is declared in the column, the number stays in the cell
AKMG.0630100.490.96157BBB-6 of 8
RDGR.043295.690.80185B+6 of 8
BTPR.1131107.990.80189BB7 of 8
KZAP.0720102.110.71234B6 of 8
USDK.0524106.830.65316A6 of 8
KZIK.0619107.370.51120B+7 of 8
BAC.043197.640.14337BB+7 of 8
CCBN.0928103.970.07188A-7 of 8
KZSP.0417103.77-0.16138BB-5 of 8
KZGB.032997.33-0.17113BBB-6 of 8
AAPL.052798.72-0.31308BB7 of 8
KEGC.082999.85-0.65255BBB5 of 8

Canvas pool: 0 created, 0 reused, 0 in use of 0. A virtualised board holds canvases for the visible rows only, so 100 000 rows use the same pool.

Two rules keep the pool honest: a canvas is borrowed for a cell and returned when the row leaves, and a cell that cannot get one degrades to its number - the pool never grows past its limit to hide a leak.

Column kinds and signed scales

A financial board needs five kinds the plain model does not have: basis points, money with a currency code, tenor, rating and boolean. They are declared in the column, so alignment, sorting, filtering and copying keep working:

const columns: TableColumn<Row>[] = [
  { id: 'coupon', title: 'Coupon', kind: 'bp', digits: 1, signed: true, value: (row) => row.couponBp },
  { id: 'notional', title: 'Notional', kind: 'money', currency: 'USD', value: (row) => row.notional },
  { id: 'tenor', title: 'Tenor', kind: 'tenor', value: (row) => row.tenorMonths, inlineBar: true },
  {
    id: 'rating',
    title: 'Rating',
    kind: 'rating',
    value: (row) => row.rating,
    pills: (row) => [{ text: row.rating, tone: 'warn' }],
  },
];

Three rules keep the cells honest:

  • signed tones the cell by the sign of the value, while tone stays the function form for rules that are not about the sign;
  • inlineBar draws a thin bar under the number against the column maximum, so the reader sees the size before reading the figure;
  • a pill carries text and a tone, never an icon font or an emoji, and the vocabulary of statuses comes from the platform, not from the library.
Six rows, one per financial column kind, updated every 1.6 s
Covenant board: basis points, money, tenor, rating and flags
KZ2C0000719125.0 bpUSD 1,250,000.502Y6MBBB-GreenCovenant
KZ2C0000883135.1 bpUSD 42,000.003MAAANo
KZ2C0000941134.5 bpUSD 875,000.001YBB+Covenant
KZ2C0001024120.7 bpUSD 9,600,000.007YB+Green
KZ2C0001156101.0 bpUSD 315,000.005YA-Covenant
KZ2C000120887.4 bpUSD 2,050,000.001Y6MBBBGreenCovenant

The coupon column is signed, so the tone follows the sign of the value; the tenor column carries an inline bar against the column maximum; a cell whose value changed flashes in the direction of the move and stays still under prefers-reduced-motion.

Column histogram, brush and sort chain

The head of a numeric column is the cheapest place to answer "what is in this column":

<DataTable
  columns={columns}
  rows={rows}
  getRowKey={(row) => row.symbol}
  histogram={{ buckets: 18, brush: true }}
  onRangeFilter={(columnId, range) => setRange(range === null ? null : { columnId, ...range })}
  rangeFilter={range}
  loadingProgress={loading}
  initialSorts={[{ key: 'ytw', direction: 'desc' }]}
/>;
  • the histogram is drawn from the column values, marks the median and shows the applied range as a band;
  • the brush needs Shift on purpose: a plain drag keeps selecting text, which is what a reader expects in a table of numbers, and a range that was set can always be cleared;
  • a header click replaces the sort, Shift-click appends a key (up to three, each with its priority number), and the same key cycles its direction;
  • loadingProgress draws the load strip over the numeric headers while history is fetched.
Forty instruments, histogram in every numeric header, Shift-drag to filter
Fixed income screener: the header histogram filters the range, the sort chain keeps the priority
KZ223810.41%91.003Y2MBBB2,908
KZ22529.84%100.937Y10MAA-2,185
KZ21479.38%98.209Y1MA1,201
KZ20989.15%92.275Y2MA+2,983
KZ20288.69%90.4511MBBB+556
KZ20498.52%95.788Y2MB+3,592
KZ20708.41%90.134Y8MBBB-2,028
KZ20218.22%93.903YAAA1,435
KZ22668.18%96.795Y8MA+3,388
KZ20428.11%98.032Y2MBB+164
KZ22108.04%96.678Y5MA+3,761
KZ20007.92%89.566Y4MBB-2,747
KZ20917.84%96.514Y4MA+1,082
KZ20777.52%89.106Y7MB+1,766
KZ21337.49%92.615Y6MAA-389
KZ22037.20%93.485Y9MBBB3,846
KZ21967.11%90.682Y10MA-44
KZ20077.04%88.836Y3MBBB-3,630
KZ21546.95%95.215Y6MBB-126
KZ21756.94%94.119Y1MBB3,068
KZ20846.69%96.264Y8MA87
KZ20636.62%93.466Y4MBBB-1,943
KZ21126.32%92.265Y6MA-742
KZ21406.29%92.967Y7MAA-3,812
KZ21896.28%99.0510MBB+1,662
KZ20146.23%97.437Y7MA-2,858
KZ22176.14%89.128Y6MA-1,418
KZ22736.11%98.405MA3,585
KZ20565.96%96.082Y7MBB-3,498
KZ22315.89%99.287Y6MAAA1,207
KZ21685.76%89.584Y3MAAA3,437
KZ21265.69%88.312Y11MA-1,135
KZ21615.62%98.013YBBB-2,461
KZ21055.11%96.247Y4MBBB1,514
KZ22454.82%88.655Y6MA-1,848
KZ22594.80%96.431Y4MAA-2,448
KZ21194.60%89.612Y2MBB2,200
KZ20354.57%90.213Y1MBB2,851
KZ21824.57%97.624MB+4,003
KZ22244.54%91.487Y6MAAA3,763

40 of 40 rows shown, no range applied. Shift-click a header to add a second sort key; a plain drag still selects text.

Sharing one selection with the chart

The link is a public contract of the core, createTableChartLink, and it carries one reference: the row key, the series the row points at and the time the row is about.

import { createTableChartLink } from '@unifin/chart-core';

const link = createTableChartLink({ group: 'board' }); // crosshair group of the host, optional
link.onRow((event) => {
  // event.ref: { key, seriesId, at }; event.from: 'table' | 'chart'
  setRow(event.ref);
});
<DataTable columns={columns} rows={rows} getRowKey={(row) => row.symbol} link={link}
  rowRefOf={(row) => ({ key: row.symbol, seriesId: row.symbol, at: row.sessionDate })} />

Four rules keep the link predictable:

  • the row key is the one the host already uses, never a position in the current sort, so sorting does not move the selection;
  • the same row published twice raises one event, so a pointer resting on a row does not repaint the chart;
  • the row is the single source of the selection: the chart puts its crosshair on the row time and keeps no idea of "current" of its own;
  • rows are reachable from the keyboard (Tab, then Enter) and the linked row carries aria-current.
Hover or focus a row: the chart follows the row and its date; click to pin it
Rows and series share one selection
RDGR.0432Corporate99.845.40%96.000
KZGB.0329Government96.605.82%97.400
BAC.0431Bank102.496.24%98.800
AAPL.0527Corporate106.436.66%100.200
KEGC.0829Utility105.417.08%101.600
AKMG.0630Municipal107.707.50%103.000

No row under the pointer

Hierarchy, group totals and export

An issue is not a leaf: it has tranches, a position has lots, a strike has a call and a put. The board carries the tree and the totals of a group, and the columns declare what a total means:

// The model flattens what is visible and totals the children of a group.
const tree = { childrenOf: (row: Issue) => tranchesOf(row.isin) };

const columns: TableColumn<Issue>[] = [
  {
    id: 'nominal',
    title: 'Nominal',
    kind: 'money',
    value: (row) => row.nominal,
    aggregate: sumAggregate((row) => row.nominal),   // a book adds up
  },
  {
    id: 'ytw',
    title: 'YTW',
    kind: 'percent',
    value: (row) => row.ytw,
    aggregate: weightedAverageAggregate((row) => row.ytw, (row) => row.nominal), // a yield does not
  },
];

<DataTable columns={columns} rows={roots} getRowKey={(row) => row.isin} tree={tree} stickyFirst
  onCopy={(text, format) => log(format, text)} />;
  • a column without an aggregate shows nothing in a group line, because a sum of yields is not a yield;
  • the first column can stay put while the board scrolls sideways (stickyFirst), which is what makes a wide financial board readable;
  • the caption copies the board as TSV or CSV: the table builds the text itself, the host receives it and can write a file (the PDF path stays in buildChartPdf, where the chart frame is added).
An issue expands into its tranches, the group line carries the totals
Book of three issues5 lines
RDGR 2031USD 1,500,000,0007.25%5YBBB-6,300
Total of 2 entriesUSD 1,500,000,0007.27%--6,300
RDGR 2031USD 1,500,000,0007.25%5YBBB-6,300
KZ2C0000719-t1USD 900,000,0007.41%5YBBB-3,780
KZ2C0000719-t2USD 600,000,0007.06%6YBBB-2,520
KZGB 2029USD 900,000,0006.40%3YA-3,780
BAC 2033USD 1,200,000,0008.10%7YBB5,040

Copy TSV or CSV from the caption, the board builds the text itself.

Basket of rows, actions and edits

A reader rarely wants one row: a book is a basket of holdings, and the numbers that matter belong to the basket, not to a row. Three pieces of the layer turn a selection into one thing:

import { basketMetrics, basketSeries, timeFilterFromCursor } from '@unifin/chart-core';

// One weighted figure over the ticked rows.
const metrics = basketMetrics({
  members: keys.map((key) => ({ key, weight: nominalOf(key) })),
  valueOf: (key) => yieldOf(key),
  sumOf: (key) => nominalOf(key),
});

// Their composite, aligned by time and normalised, so a basket of ten draws like a basket of two.
const composite = basketSeries(seriesOf(keys), { mode: 'normalised' });

// The cursor of the chart, read the other way round: the rows of one bucket.
const filter = timeFilterFromCursor(rows, cursor, (row) => row.tradedAt);
<DataTable
  columns={columns}
  rows={visible}
  getRowKey={(row) => row.isin}
  selectable
  initialSelectedKeys={['KZ2C0000719', 'KZ2C0000941']}
  onSelectionChange={setKeys}
  rowActions={(row) => [{ id: 'watch', label: 'Watch', onSelect: () => watch(row) }]}
  editable={(column, row) =>
    column.id === 'nominal'
      ? { value: row.nominal, min: 0, max: 2_000_000_000, onCommit: (value) => commit(row, value) }
      : null
  }
/>;

Four rules keep the basket honest:

  • the selection is a set of row keys, so sorting and filtering never move it, and the keys leave the table as the host's own identifiers - the basket survives a re-sort because it never referred to a position;
  • the arithmetic lives in the core, not in the board: the same basketMetrics answers a React table, a custom element and an export, and a member with a missing weight stays in the count but leaves the mean;
  • a row action is a button with a label from the host (watch, add to a portfolio, open in the chart); the library ships no icons and no menu of its own;
  • an editable cell only opens on a deliberate gesture, commits through the host callback - which is the only party that knows the rules - and shows the range it may take, so an out-of-range entry is visible before it is written back.
Tick the holdings: the bar, the composite on the right and the export follow the basket
2 of 4 selectedweight USD 2.70 bnweighted yield 7.63%
Holdings of the portfolio
KZ2C0000719 - RDGR 20317.25%99.382026-09-01
KZ2C0000883 - KZGB 20296.40%99.872026-09-02
KZ2C0000941 - BAC 20338.10%96.452026-09-03
KZ2C0001015 - NASDAQ 20285.88%93.852026-09-04
Normalised composite of 2 holdings

Tick two holdings: the bar turns them into one weighted figure, the chart draws their composite.

Derivatives: the surface, the payoff and the greeks

A derivative row has no single number: an option is a surface plus a payoff, a future is a curve, a book is a correlation table. The family carries six more primitives for that:

import { paintIvMatrix, paintPayoffCurve, paintGreekBars, paintTermCurve, paintCorrelationHeat, paintScenarioCone } from '@unifin/chart-core';

// One cell per strike and expiry; the smile of every row is drawn through the
// cheapest strike of that row.
paintIvMatrix(ctx, { strikes, expiries, vols }, box);

// The payoff against the underlying, with a mark on every break-even.
paintPayoffCurve(ctx, payoff, box);

// Delta, gamma, vega and theta in one signed row: a negative theta has to be visible.
paintGreekBars(ctx, [delta, gamma, vega, theta], box);

// The futures curve with the open interest under it - a flat curve without interest
// is not a signal.
paintTermCurve(ctx, settlePrices, box);

// The correlation of the book: the diagonal stays empty, because a name is always
// correlated with itself.
paintCorrelationHeat(ctx, { labels, values }, box);

// The band a shock spreads over the horizon, with the value of today marked.
paintScenarioCone(ctx, { base, lower, upper }, box);
<DataTable
  columns={columns}
  rows={contracts}
  getRowKey={(row) => row.id}
  onRowSelect={(row) => setFocus(row.id)}
/>;

Four rules of the derivative figures:

  • a surface, a correlation table and a cone are passed as structures, not as flat samples: flattening them would be ambiguous, and the painter is the one place that validates the shape;
  • the smile, the break-even and the open-interest bars are part of the primitive: a reader should not have to reconstruct them from numbers beside the cell;
  • the greeks are signed bars around the middle line, and a greek that is not a number is dropped instead of being drawn as zero;
  • the board composes the cell figures with the same painters on a larger canvas, so one implementation serves both the cell and the side panel.
Every row answers its own question: the surface, the payoff, the greeks, the curve
Book of four derivative positions
OPT-2431 - RDGR call 105, 30 days214.521.4133.00.6221.430 days
OPT-2432 - RDGR put 95, 30 days118.223.7-44.9-0.3823.730 days
FUT-2603 - AAPL future, March1014.0101.41014.01.00101.474 days
STR-01 - Covered call 105/115268.919.8118.30.4419.845 days
Correlation of the underlying book, focus OPT-2431

The matrix and the cone come from the same core painters the cells use, from the same numbers: the host owns the layout, the library owns the drawing.

Portfolio, depository and money

A position row carries the heat of its months, and the questions of a book - what is the allocation, how deep was the drawdown, does the account survive the month - are answered next to it, not in another screen:

import { paintBalanceTimeline, paintCashflowLadder } from '@unifin/chart-core';

// Money does not move between two settlements: the line steps, the part below zero is
// tinted as a violation and the lowest point of the window carries a mark.
paintBalanceTimeline(ctx, dailyBalances, box);

// One column per period, inflows above the line and outflows below, with the running
// total over them - the question is whether the account survives the month.
paintCashflowLadder(ctx, periodFlows, box);
<DataTable columns={columns} rows={positions} getRowKey={(row) => row.symbol} onRowSelect={setFocus} />;

Three rules of the money figures:

  • the balance steps and never slopes: a sloping line would claim a continuous change the ledger does not have, and an account below zero has to be visible without reading the number;
  • the running total of the cash-flow ladder is the point of the figure, so the columns share one scale and the total keeps its own;
  • an instruction carries its stage in the row (a funnel of the stages and a status pill), because the stage is what the reader acts on.
Positions with the heat of their months, the allocation and the drawdown beside them
Book of 5 positions
AAPL - Apple Inc.28.0%420.0%1.1
KZAP - Kazatomprom22.0%-160.0%-0.7
BAC - Bank of America19.0%280.0%1.2
RDGR - RDGR 203117.0%110.0%0.2
KEGC - KEGOC14.0%-90.0%0.9
Allocation and drawdown, focus AAPL

The table owns the weights; the donut and the waterfall are drawn by the portfolio kit and the core from the same numbers.

Portfolio against the benchmark, indexed to 100
Balances step, payments run a total, instructions show the stage they reached
Depository accounts of the session
DEPO-101 (main)USD 430USD 398CoveredDEPO-101 (main)
DEPO-102 (clients)USD 190USD 156CoveredDEPO-102 (clients)
DEPO-103 (fund)USD 45USD 55OverdrawnDEPO-103 (fund)

The balance timeline and the cash-flow ladder are core figures: the account that went below zero carries the warning mark and the overdrawn pill in the same row.

Compliance, limits and the journal of a row

A compliance reader asks four things about a row: how much of the limit is used, where the breach starts, who changed the row and whether its sources are fresh. All four fit in the row:

import { paintLimitBar } from '@unifin/chart-core';

// Utilisation against the ceiling with the threshold marked on the track; the part
// above the threshold takes the violation colour.
paintLimitBar(ctx, { used: 1420, limit: 1500, warnAt: 1200 }, box);
<DataTable
  columns={columns}
  rows={limits}
  getRowKey={(row) => row.id}
/>;

Three rules of the compliance figures:

  • the breach is drawn, not described: the excess over the threshold has its own colour, so the state of a row is visible before the number is read;
  • the journal of a row is a timeline strip of its changes plus a pill with the author: the figure answers when, the text answers who, and neither pretends to do the other's job;
  • freshness is a strip of the sources with the stale one flagged (qualityStrip), because a limit computed from a stale source is a different statement about the same row.
Limits with their breach threshold, the journal of the row and the freshness of its sources
Limits of three desks
LIM-01 - Fixed income62.0%Within limitA. Sultanov35
LIM-02 - Equities94.7%Above thresholdD. Iskakova35
LIM-03 - Depository34.4%Within limitSystem15
Stress of the book: the four factors that cost the most

A breach is a fact of the row: the excess takes the violation colour and the pill names the state, so the reader does not have to compare two numbers to see it.

Reconciliation: expected against actual

Two books of the same thing - a clearing statement and the ledger, a portfolio and its custodian - are compared row by row, and the difference is the answer the reader needs:

import { asOfGap, asOfVersion, reconcile, reasonWaterfall, reconciliationSummary, reconciliationToText } from '@unifin/chart-core';

const entries = reconcile(rows, {
  tolerance: 1,                                     // absolute, in the currency of the books
  pairOf: (row) => ({ key: row.key, expected: row.expected, actual: row.actual, reason: row.reason }),
});
const summary = reconciliationSummary(entries);     // matched, broken, net and gross difference
const steps = reasonWaterfall(entries);             // what caused the difference, largest first
const report = reconciliationToText(entries);       // text the host can export

const before = asOfVersion(history, '2026-10-06');  // the last version of every key as of a date
const after = asOfVersion(history, '2026-10-08');
const gap = asOfGap(before, after);                 // changed, added and removed rows

A saved view keeps the arrangement of the board, not the data:

import { applyTableViewColumns, parseTableView, serializeTableView } from '@unifin/chart-core';

const payload = serializeTableView(view);           // stable key order, comparable text
const restored = parseTableView(payload);           // null on a broken or foreign payload
const columns = applyTableViewColumns(restored ?? view, columns);  // view order wins, new columns appended

Four rules of a reconciliation:

  • the tolerance is absolute by default: a relative one hides a small break inside a large number, and the reader of a clearing statement wants the currency amount;
  • a pair the host cannot express as two finite numbers is reported as broken, not skipped: silence about a missing number is the one answer a reconciliation must never give;
  • a row is read as of a date, and the gap names what changed, appeared and disappeared - the versions are compared by the host object, so a stale flag moving is a change;
  • the report leaves the screen as text (TSV or CSV), because a break has to be signed off by someone who is not looking at the board.
Statement against ledger: the difference in the cell, the reasons beside the table
Breaks of 2026-10-06 - 3 of 4 pairs differ
AAPL - Apple Inc.USD 1,000,000USD 1,000,000USD 01000000Matched
BAC - Bank of AmericaUSD 250,000USD 250,400USD 400250400Rounding
KZAP - KazatompromUSD 500,000USD 480,400USD -19,600480400Commission
RDGR - RDGR 2031USD 0USD 12,000USD 12,00012000Coupon accrued
Gross difference USD 32,000
  • Commission (1)-19,600
  • Coupon accrued (1)+12,000
  • Rounding (1)+400

Compare the two books, then export the report. Between 2026-10-06 and 2026-10-07 the book changed 1, gained 0 and lost 0 rows.

The linking pattern

A figure cell is useful on its own, but the reason a financial table belongs to a charting library is the link: the row and the chart share one selection. Hovering a row moves the chart, the keyboard does the same with Tab and Enter, and a click pins the choice so the pointer can move away.

Hover or focus a row, click to pin it
Screened universe, one figure per row
SymbolTrendYTWPriceRating
RDGR.04325.40%96.000B+
KZGB.03295.82%97.400BBB-
BAC.04316.24%98.800BB+
AAPL.05276.66%100.200BB
KEGC.08297.08%101.600BBB
AKMG.06307.50%103.000BBB-

RDGR.0432 - Corporate, sixty sessions, hover to compare

Three rules make the link predictable:

  • the row is the single source of selection - the chart never holds its own idea of "current";
  • the link uses the row key the host already has (getRowKey), not a position in the current sort;
  • hiding a row (filter, collapse) clears the selection instead of leaving the chart on a hidden row.

Using a figure cell

import { paintMiniFigure, resolveThemeByName } from '@unifin/chart-core';

const theme = resolveThemeByName('dark');

// 208 x 30 CSS pixels inside the cell, device pixel ratio applied by the host.
paintMiniFigure(context, 'sparkline', closes, { width: 208, height: 30, theme });
<canvas
  role="img"
  aria-label="RDGR.0432 trend, last sixteen closes"
  style={{ width: '208px', height: '30px' }}
  ref={canvasRef}
/>

The painter draws into any canvas-like context, so a cell, a tooltip row or a printed report share one implementation. A figure keeps its numbers in the host: the cell paints, it never computes.

The primitives

FigureAnswersTypical column
sparklineWhere the value came from over the windowPrice, yield, position
deltaBarHow far and which way a signed value movedDay change, P&L, spread
inlineBarHow large the value is against the column maximumCoupon, volume, exposure
microBarsThe shape of a small seriesPrints, intraday volume
heatStripMonthly or bucket returns at a glanceReturns, cash flow calendar
miniStackWhat the group is made ofRating buckets, sector mix
scaleMarkWhere a rating or tenor sits on its scaleRating, maturity, percentile
qualityStripWhich fields are filled and which are staleData coverage
timelineStripWhen the events of the row happenCoupons, settlements, audit
miniDistributionThe spread of the column around its medianUniverse screening
miniGaugeUtilisation of a limit as one arcLimits, margin
miniWaterfallHow the pieces build the totalAttribution, reconciliation
miniLadderBid and ask depth around the midOrder book, liquidity
statusFunnelHow many items reached each stagePayments, onboarding

What to keep in mind

  • One canvas per cell is not free. A hundred thousand rows must not hold a hundred thousand contexts: paint only visible rows and reuse contexts through a pool, and measure before shipping a busy column.
  • The figure repeats the number, it does not replace it. Keep the value as text in the neighbouring cell - a colour or a shape alone is not readable for everyone, and it is not searchable.
  • Every figure needs a text equivalent. The canvas carries role="img" and an aria-label with the value and its direction; the same sentence belongs in the accessible description of the row.
  • Colours come from the theme. A figure never hardcodes a palette: the cell stays correct in all six palettes and in a white-label shell.

See also

  • Analytic figures - the larger analytic painters these cells borrow from.
  • Bonds, portfolio and options kit pages - tables that use the figures in a working surface, with the number locale switch.
  • Theming - palettes, tokens and what a host can restyle.

On this page