Inventory planning heat map: a SKU-site per row, the next weeks as columns, days of cover or units, calm colouring, runs of stockout weeks as one band, supply landing marks, a week cursor; keyboard grid, virtualised past 300 rows.
Arrows, Page Up/Down and Enter; drag the week headers to move the cursor.
Part of High Command Pro. The preview and props are open to everyone; installing it needs your license key. Set up your key · Pricing
$ npx shadcn@latest add @highcommand/horizon-gridCopies the source into your project and pulls in what it needs (3 other items). First time? Add the registry to components.json.
The Planning home: a SKU-site per row, the next twelve weeks as columns, the projected number in every cell, riskiest rows first.
rowsrequiredHorizonRow[]—The SKU-site rows, riskiest first, one per grid row.
weeksrequiredHorizonWeek[]—The weeks to show as columns (the next twelve).
unitrequiredUnit—What each cell shows: "days" of cover or "units" available.
calmrequiredboolean—Calm mode: colour only the cells that need attention (stockout, below safety stock, excess).
limitrequirednumber—Overstock limit in days of cover: past it a cell reads as excess (it also sets the heavy line, two thirds of it).
selectedKeyrequiredstring | null—Key of the selected row (its drawer is open): it is highlighted and becomes the keyboard cursor row; null for none.
onOpenrequired(row: HorizonRow, week: number | null) => void—Open the drawer for a row (and the week the cursor is on).
riskRecord<string, RowRisk> | nullnullStage 2, per row key from GET /api/planning/risk/network: the share of simulated futures short each week (drawn as a thin grey bar when at least 5 of 100, on weeks the point projection does not already show out; not drawn with planned orders on, since the futures count committed supply), and the chance of running out before the next inbound line lands. Null: no futures (fixtures, or not loaded).
hideWeekRiskbooleanfalseHide the per-week bars (the planned-orders view: the futures count committed supply only).
mergeSafetybooleanfalseDraw a run of below-safety weeks as one band too (stockout runs always are).
scenario{ view: 'scenario' | 'baseline'; base: Record<string, RowRisk> | null } | nullnullStage 3: a scenario is active. The grid shows its rows (or, with view "baseline", the same rows without it); changed weeks are outlined either way, and a "Change vs baseline" column says what moved. `base` is the baseline's futures per row, for X of 100 before.
cursornumber1Pattern 8: the workspace's week cursor (1 = this week): its column is highlighted; dragging on the week headers, or a cell's column, moves it.
onCursor(w: number) => void—Fires with the 1-based week when the person drags across the week headers or picks a cell's column.
<ArrivalMark />2 propsSupply landing that week, the most committed kind shown: filled = in transit, open = purchase order, dashed accent = approved and not sent, dashed grey = planned; a scenario's own lines (transfer in or out, new order) are outlined accent with a dot.kindsrequiredArrivalKind[]—The supply kinds landing that week; the most committed one sets the mark's shape.
legendboolean—Draw it as a legend key (no test id, key styling).
compact(n: number): stringCompact for a narrow cell: 12,345 -> 12.3k; keeps the sign.
usdCompact(n: number): stringDollars as `usd`, except 10,000 and up print in thousands ("$12.3k", "$120k") and a million and up in millions ("$1M", "$2.5M").
cellText(c: HorizonCell, unit: Unit): stringThe number a cell prints: days of cover, or units at the end of the week.
runsOf(states: readonly HorizonCellState[], merge: (s: HorizonCellState) => boolean): Map<number, Run>Groups consecutive weeks in the same state for which `merge(state)` is true; the result maps each week index in such a run to its run.
nf(n: number): stringA whole number with thousands separators ("12,345").
signed(n: number): stringA signed whole number with a true minus sign.
usd(n: number): stringDollars with a true minus sign: whole dollars from $100 up, otherwise up to two decimals ("$4.50").
shortSite(n: string): stringA site's short name for a narrow column: "Austin DC" -> "Austin".
shortDate(d: string): stringAn ISO date (YYYY-MM-DD) as "Oct 05".
weekLabel(weeks: { iso_week: number; }[], n: number | null | undefined): stringThe week label of horizon week n (1-based).