Chartsv26.10.18
API reference

Bonds kit API (@unifin/chart-kit-bonds)

Generated reference of 314 public symbols of @unifin/chart-kit-bonds, grouped by kind and ordered as in the sources.

Generated from the package entry packages/chart-kit-bonds/src/index.ts. Names are reachable through @unifin/chart-kit-bonds; use your editor for full signatures - this page carries the map.

Functions (69)

SymbolWhat it does
yearFractionYear fraction between two ISO dates under ACT/365 or 30/360; NaN on a bad date. 30/360 counts whole months as thirty days, which is the convention an accrual period of a swap is usually quoted under.
curveCompassModelCurves projected onto the tenor angles with a shared radius domain.
paintCurveCompassPaints the compass: the polar grid, muted family outlines, then the active ring filled with its vertex dots; tenor chips ride on wide panels. Returns the number of painted rings.
countryHeatmapModelSigned deviations of the countries mapped onto a diverging scale.
paintCountryHeatmapPaints the tile grid: diverging tiles, the value inside large tiles, the accent edge of the active tile and its card above or below it. Returns the number of painted tiles.
creditSpreadPanelThe two readings over one window: series stats, stress zones and domain.
paintCreditSpreadPanelPaints the panel: the two corridors, the stress zones, the IG line and the glowing HY line with the window maximum marked and labelled in bp. Returns the number of painted lines (0..2).
yieldCurvePointsSorted copy of the points (by years); non-finite samples are dropped.
curveToPointsCurve points as analytic samples for the core painters.
interpolateCurveValueValue of a cleaned, sorted curve at a tenor: exact nodes win, a hit between two nodes interpolates; a repeated tenor reads its first node. With clamp the ends extend to the nearest node, otherwise a tenor outside the quoted range gives null.
curveSpreadDifference of two curves aligned by years, in basis points.
paintYieldCurvePaints the curve as a polyline over the numeric axis.
paintCurveLabelsPaints the labelled curve points as markers (label to the right).
paintCurveSpreadPaints the spread as signed bars from zero.
yieldDecompositionOne nominal date split into the real part and the expectations.
paintYieldDecompositionPaints the decomposition: for every date the real block from the zero line and the expectations block above it, the light edge of the nominal top and the share labels. Returns the number of painted dates.
morphSharesInterpolates the shares of the decomposition between two dates (S102): a linear blend with t clamped into 0..1; signs survive and the sum of the valid input pairs holds; a non-finite target returns from untouched.
couponEventsEvents from the cash flows; the final flow is the redemption.
eventPointsEvents as analytic samples (x = years, y = amount).
eventsTotalTotal of all events (coupons plus redemption).
paintCouponTimelinePaints the events as labelled markers (label to the right of the dot).
curveFanHistoryAligns the dated history: cleans the samples, thins the excess, assigns the alpha ramp by age and pads the domain for the labels and the glow.
paintCurveFanPaints the fan: muted lines first (oldest to newest), the hero accent line last with a light glow when the canvas supports shadows. Returns the number of painted lines.
buildLadderLadder buckets in the given order; non-finite amounts count as zero.
ladderWeightedYtmAmount-weighted average yield of the ladder; NaN when no row carries a yield.
paintBondLadderPaints the ladder as bars from zero over the category axis.
marketMapModelThe curve plus the issues: every bond reads its spread to the interpolated curve; issues with unreadable values are dropped, a curve without readable nodes drops every issue (there is nothing to compare against). Codes of the issues are expected to be unique - the connector and the spread resolve the first row of a code.
marketMapSpreadSpread between two issues in bp (A minus B); null when a code is absent.
paintMarketMapPaints the map: the hero curve, one bubble per issue in its verdict colour and, when two issues are selected, their connector with the spread chip. Returns the number of painted issues.
couponScheduleCoupon dates from settlement to maturity, back-stepped by the frequency.
couponFlowsCoupon plus redemption flows of a plain vanilla bond, near to far.
priceFromYieldPresent value of the flows at the given yield (decimal, nominal annual).
bondPriceClean price of the bond at the given yield.
bondYtmYield to maturity solved by bisection against the target clean price.
bondYtpYield to the call or put date: flows stop at the redemption date.
flowsUntilCash flows of a bond that redeems early at redemptionYears.
macaulayDurationMacaulay duration in years: present-value weighted mean term.
modifiedDurationModified duration: relative price sensitivity to the yield.
convexityConvexity in years squared: second-order price sensitivity (period-based).
accruedInterestAccrued interest since the last coupon: the coupon amount scales with the elapsed share of the coupon period under the chosen day count.
morphEaseCubic-in-out easing of the canon; non-finite input means the zero frame.
morphCurveSeriesOne morph frame: both curves are aligned on the union of their tenors (the ends extend to the nearest node: the morph moves the shape, not the range) and blended by the eased progress. t is clamped into 0..1; t = 0 gives the from curve, t = 1 the to curve. A curve empty on one side passes through unchanged.
paintDotRound dot; without arc the host canvas gets a square of the same box.
paintLabelChipRounded label capsule with a centred text; x/y address the centre of the capsule. A canvas without arc degrades to a plain filled rectangle - the text stays legible, the contrast survives (BOND-VISUALS §5).
priceToParClean price to par (100) from the absolute price of the terms.
parToPriceAbsolute clean price of the terms from a price-to-par reading.
priceFromYieldSeriesReads a yield series as clean prices to par: every point goes through the bond math of the terms. Unreadable points (zero face, NaN) are dropped.
yieldFromPriceSeriesReads a clean price series (to par) back as yields through the bond math.
priceModeSeriesThe series in the requested mode: yield passes the samples through (sorted, cleaned), price reads them as clean prices to par.
tenorPulseChipsChips of the pulse, ordered by tenor (the panel reads left to right).
paintTenorPulsePaints the pulse row: one chip per tenor with its tone underlay, the value inside and the signed delta under the chip on tall panels. Wraps the chips into at most rows (default 2) lines instead of clipping them. Returns the number of painted chips.
pvWaterfall3dModelBuilds the waterfall model. Non-positive and out-of-window flows paint nothing; PVs come from priceFromYield on a one-flow array (the exact per-flow present value), so a scenario total equals the kit price at the shifted yield by construction.
paintPvWaterfall3dPaints the waterfall through the scene3d bars painter and returns the number of painted faces (three per bar). Bar colors: the active scenario takes the theme accent, negative shifts the down tone, the rest the muted tone; widths follow the flow and scenario counts, so a single scenario is one flat row.
curveRidgelineModelThe dated history as bands: newest slot on top, alpha fading with age.
paintCurveRidgelinePaints the bands: oldest first, the hero last; labels ride in chips on wide panels. Returns the number of painted bands.
spreadRiverModelParallel spread channels over one shared half-domain (the sign kept).
paintSpreadRiverPaints the river: zero edges of every channel, the muted outlines, then the active channel filled by its sign with extreme dots and bp chips. Returns the number of painted channels.
buildBondScreenerRowsInput order is kept: sorting is the host's controlled step.
formatTenor0.25 -> 3M, 1 -> 1Y, 7.5 -> 7.5Y; non-finite values render as -.
curveSnapshotModelAligns the dated curves: cleans the samples, picks the hero and pads the domain so the hero underlay and labels never touch the edges.
paintCurveSnapshotPaints the snapshot: muted curves first, then the hero underlay, the hero line, its halo points and the term labels. Returns the number of painted curves (muted plus hero), matching the other painters of the kit.
yieldAtYearsLinear interpolation of the curve at a tenor: exact nodes win, a hit between two nodes interpolates, anything outside the quoted range returns null.
spreadStripModelOne pair over the dated history: spreads in bp, zones, stats and domain.
paintSpreadStripPaints the strip: recession plates with their year, the inversion underlay below the threshold, signed gradient bars from zero, the zero line, the extreme dots and the haloed marker of the current reading. Returns the number of painted bars.
curveSurfaceModelThe dated history as a surface: thinned rows, depth, alpha ramp and domain.
paintCurveSurfacePaints the surface: the flat underlay of the front curve, the muted rows from the farthest to the nearest, then the front hero with its end dot. Returns the number of painted rows.
yieldMapModelThe dated history as a tenor x time grid with a percentile colour domain.
yieldMapIsolinesIsolines of the requested levels (default: the 1 pp grid inside the domain).
paintYieldMapPaints the map: one diverging tile per quotable cell, then the isolines and their level chips on wide panels. Returns the number of painted cells.

Types (93)

SymbolWhat it does
DayCountConventionDay-count convention of an accrual period.
CompassSeries-
CurveCompassOptions-
CompassVertex-
CompassRing-
CurveCompass-
CurveCompassPaintOptions-
CountryHeatmapEntry-
CountryHeatmapOptions-
CountryRegionA titled cluster of country codes (order of the codes is the capture order).
CountryHeatmapTone-
CountryHeatmapCell-
CountryHeatmapGroupA titled cluster of tiles ready for the painter (empty clusters dropped).
CountryHeatmap-
CountryHeatmapPaintInput-
CountryHeatmapPaintOptions-
CreditSpreadPoint-
CreditSpreadOptions-
CreditSpreadSeries-
CreditSpreadRange-
CreditSpreadSpanZone boundaries as indexes into hy.points; parallel to zones.
CreditSpreadPanel-
CreditSpreadPaintOptions-
CurvePointOne curve point: years to maturity and the yield as a decimal.
CurveSpread-
YieldDecompositionInput-
YieldDecompositionRow-
YieldDecomposition-
YieldDecompositionPaintOptions-
CouponEventKind-
CouponEventOne dated event of the bond: coupon C1..Cn plus the final redemption M.
CurveFanEntry-
CurveFanOptions-
CurveFanLine-
CurveFan-
CurveFanPaintOptions-
BondLadderRowOne ladder row: a maturity bucket and the amount maturing in it.
BondLadder-
MarketBondInput-
MarketMapOptions-
MarketMapRow-
MarketMap-
MarketMapPaintOptions-
CashFlowOne future cash flow: years to the payment and its amount (face currency).
BondTermsTerms of a plain vanilla coupon bond.
MorphOptions-
LabelChipOptions-
PriceModePointOne dated sample of the series; x is the position on the time axis.
TenorPulseEntry-
TenorPulseChip-
TenorPulsePaintOptions-
PvWaterfallInput-
PvWaterfallOptions-
PvWaterfallBar-
PvWaterfall3d-
PvWaterfall3dPaintInput-
PvWaterfall3dPaintOptions-
CurveRidgelineEntry-
CurveRidgelineOptions-
CurveRidgelineRow-
CurveRidgeline-
CurveRidgelinePaintOptions-
SpreadRiverSeries-
SpreadRiverOptions-
SpreadRiverPoint-
SpreadRiverRow-
SpreadRiver-
SpreadRiverPaintOptions-
BondScreenerEntry-
BondScreenerRow-
CurveSnapshotInput-
CurveSnapshotOptions-
CurveSnapshotSeries-
CurveSnapshot-
CurveSnapshotPaintOptions-
SpreadPair-
SpreadStripInput-
SpreadStripRange-
SpreadStripOptions-
SpreadStripPoint-
SpreadStrip-
SpreadStripPaintOptions-
CurveSurfaceEntry-
CurveSurfaceOptions-
CurveSurfaceRow-
CurveSurface-
CurveSurfacePaintOptions-
YieldMapEntry-
YieldMapOptions-
YieldMap-
YieldMapIsolinePoint-
YieldMapIsoline-
YieldMapPaintOptions-

Constants (152)

SymbolWhat it does
COMPASS_DEFAULT_TENORSTenor angles of the radar.
COMPASS_MAX_SERIES-
COMPASS_MIN_VERTICES-
COMPASS_RING_COUNTRings of the polar grid and their tone.
COMPASS_RING_ALPHA-
COMPASS_SPOKE_ALPHA-
COMPASS_ACTIVE_FILL_ALPHAThe active ring is the single filled one.
COMPASS_MUTED_LINE_ALPHA-
COMPASS_HERO_WIDTH-
COMPASS_MUTED_WIDTH-
COMPASS_VERTEX_RADIUS-
COMPASS_TENOR_LABEL_MIN_PXTenor chips need this much panel width.
COMPASS_LABEL_GAP_PX-
COMPASS_PAD_SHAREShare of the radius kept free for the tenor chips.
COUNTRY_REGION_GAPVertical gap between regional clusters (S102).
COUNTRY_REGION_TITLE_MIN_PXCluster titles need this much panel width.
COUNTRY_REGION_FONT_PX-
COUNTRY_MIN_ALPHAIntensity floor and slope of a coloured tile (BOND-VISUALS §2: 0.06 + 0.5 t).
COUNTRY_INTENSITY_ALPHA-
COUNTRY_FLAT_ALPHAQuiet tile exactly on the neutral centre (text 0.04).
COUNTRY_VALUE_MIN_PXA tile shows its value only from this size (BOND-VISUALS §2).
COUNTRY_VALUE_FONT_PX-
COUNTRY_ACTIVE_EDGEEdge width of the active tile (BOND-VISUALS §2: 2 px accent).
COUNTRY_DEFAULT_COLUMNSDefaults of the tile grid.
COUNTRY_DEFAULT_GAP-
COUNTRY_DEFAULT_PADDING-
CREDIT_CORRIDOR_ALPHAQuiet corridor of each series (BOND-VISUALS §2: text 0.10).
CREDIT_STRESS_ALPHAStress zone underlay (BOND-VISUALS §2: down 0.06).
CREDIT_LINE_WIDTHWidth of the two lines; the glow belongs to HY alone.
CREDIT_HY_GLOW_BLUR-
CREDIT_HY_GLOW_ALPHA-
CREDIT_MAX_DOT_RADIUSRadius of the window-maximum dot.
CREDIT_MARKER_GAPGap between the maximum dot and the bottom of its bp chip.
CREDIT_PAD_SHAREVertical padding of the shared domain, as a share of the bp span.
DECOMP_REAL_ALPHA_TOPGradients of the two stacked parts (BOND-VISUALS §2), top -> bottom.
DECOMP_REAL_ALPHA_BOTTOM-
DECOMP_REAL_ALPHA_FLAT-
DECOMP_EXPECTED_ALPHA_TOP-
DECOMP_EXPECTED_ALPHA_BOTTOM-
DECOMP_EXPECTED_ALPHA_FLAT-
DECOMP_EDGE_ALPHALight 1 px edge on the top of the stack (BOND-VISUALS §2).
DECOMP_BAR_WIDTH_SHAREBar width as a share of the slot between the samples (clamped 1..18 px).
DECOMP_BAR_WIDTH_MAX-
DECOMP_LABEL_MIN_PXA share label needs this much block height.
DECOMP_LABEL_FONT_PX-
DECOMP_PAD_SHAREVertical padding of the domain, as a share of the value span.
DECOMP_SHEEN_ALPHADiagonal sheen inside the stack (S102, BOND-VISUALS §2).
DECOMP_SHEEN_ANGLE_DEG-
DECOMP_SHEEN_WIDTH_SHARE-
FAN_ALPHA_MINMuted alpha of the oldest line and of the one just before the hero.
FAN_ALPHA_MAX-
FAN_PAD_SHAREVertical padding of the domain, as a share of the curve span.
FAN_DEFAULT_MAX_LINESLongest fan kept; the extra history is thinned evenly, the newest stays.
FAN_HERO_GLOW_BLURHero glow: shadow blur and its share (only when the canvas supports it).
FAN_HERO_GLOW_ALPHA-
MARKET_BUBBLE_RADIUSBubble radius of one issue.
MARKET_FAIR_ALPHAAlpha of a fair (on-curve) issue.
MARKET_LINK_ALPHAConnector of the two selected issues.
MARKET_CHIP_GAPGap between the connector and its bp chip.
BOND_MORPH_DURATION_MSMorph duration of the canon, ms. Prefixed: the core ships its own morph.
BOND_MORPH_RACE_STEP_MSStep of the race mode: the scene advances the frames by this, ms.
CHIP_HEIGHTChip geometry and tone of the label capsules (BOND-VISUALS §3).
CHIP_RADIUS-
CHIP_BG_ALPHA-
CHIP_PAD_X-
CHIP_FONT_PX-
PRICE_MODE_PARPar value the price mode reads against: the canonical clean price 100.
PULSE_CHIP_GAP-
PULSE_CHIP_MIN_W-
PULSE_TONE_ALPHA-
PULSE_FLAT_ALPHA-
PULSE_MAX_CHIPS-
PULSE_DELTA_MIN_HThe delta line needs this much chip height.
PULSE_DELTA_FONT_PX-
PULSE_CHIP_HEIGHT_MAX-
PV_WATERFALL3D_SHIFTSDefault rate scenarios: -25/0/+25 bp around the base yield.
PV_WATERFALL3D_LABEL_MIN_WIDTHBelow this pane width the sum/date labels stay off.
PV_WATERFALL3D_LABEL_MAXLargest-PV bars of the active scenario that carry a label.
RIDGE_DEFAULT_MAX_ROWSLongest history kept; the extra rows are thinned evenly, the newest stays.
RIDGE_ROW_GAP_SHAREShare of a slot left as the gap between bands.
RIDGE_ALPHA_FARAlpha of the farthest band and of the one next to the hero.
RIDGE_ALPHA_NEAR-
RIDGE_HERO_WIDTH-
RIDGE_MUTED_WIDTH-
RIDGE_LABEL_MIN_PXLabels need this much panel width.
RIDGE_LABEL_FONT_PX-
RIDGE_LABEL_PAD_X-
RIVER_MAX_SERIES-
RIVER_ROW_GAP_SHAREShare of a channel left as the gap between channels.
RIVER_ACTIVE_TOP_ALPHAActive channel gradient and muted outline.
RIVER_ACTIVE_BOTTOM_ALPHA-
RIVER_MUTED_ALPHA-
RIVER_ZERO_ALPHA-
RIVER_EXTREME_RADIUS-
RIVER_ACTIVE_WIDTH-
RIVER_MUTED_WIDTH-
RIVER_CHIP_MIN_PXBp chips on the extremes need this much panel width.
RIVER_CHIP_GAP-
BOND_SCREENER_COLUMNSScreener columns of the bonds kit; the host renders and sorts them.
SNAPSHOT_MUTED_ALPHA_MINMuted alpha of the oldest curve and of the one just before the hero.
SNAPSHOT_MUTED_ALPHA_MAX-
SNAPSHOT_PAD_SHAREVertical padding of the domain, as a share of the curve span.
SNAPSHOT_HERO_ALPHA_TOPHero underlay gradient (BOND-VISUALS §2): top alpha -> bottom alpha.
SNAPSHOT_HERO_ALPHA_BOTTOM-
SNAPSHOT_HERO_ALPHA_FLATFlat fallback of the underlay when gradients are unavailable.
SNAPSHOT_POINT_RADIUSHero marker geometry: dot radius, halo radius and its alpha.
SNAPSHOT_HALO_RADIUS-
SNAPSHOT_HALO_ALPHA-
SNAPSHOT_LABEL_GAP_PXTerm label: gap between the point and the bottom of its chip.
STRIP_BAR_ALPHA_BASEBase and tip alpha of a bar: the tip of the move carries the accent.
STRIP_BAR_ALPHA_TIP-
STRIP_BAR_ALPHA_FLATFlat share of the bar when the canvas cannot paint gradients.
STRIP_ZONE_ALPHAUnderlay of the inversion zones: everything below the threshold (BOND-VISUALS §2).
STRIP_RECESSION_ALPHAQuiet plate of a recession range and its year label.
STRIP_RECESSION_FONT_PX-
STRIP_RECESSION_LABEL_MIN_PXNarrowest recession range that still earns a year label.
STRIP_BAR_WIDTH_SHAREWidth of a bar as a share of the slot between the samples (clamped 1..12 px).
STRIP_MARKER_RADIUSRadius of the current marker and its halo.
STRIP_HALO_RADIUS-
STRIP_HALO_ALPHA-
STRIP_ZERO_ALPHAAlpha of the zero line.
STRIP_EXTREME_RADIUSDot radius of the extremes.
STRIP_EXTREME_ALPHA-
SPREAD_PAIRS_DEFAULTThe two canonical readings of the Treasury curve.
STRIP_PAD_SHAREThe value is in the domain share of the padded span, either sign.
SURFACE_DEFAULT_MAX_ROWSLongest surface kept; the extra history is thinned evenly, the newest stays.
SURFACE_SKEW_PXDepth offsets of one step back, pixels: right and up.
SURFACE_LIFT_PX-
SURFACE_ALPHA_FARMuted alpha of the farthest and the nearest (pre-hero) curve.
SURFACE_ALPHA_NEAR-
SURFACE_UNDERLAY_ALPHAFlat underlay of the front curve (BOND-VISUALS §2: accent 0.04).
SURFACE_HERO_WIDTHWidth of the front curve and of the muted rows, and the dot radius.
SURFACE_MUTED_WIDTH-
SURFACE_FRONT_DOT_RADIUS-
SURFACE_PAD_SHAREVertical padding of the domain, as a share of the yield span.
SURFACE_FOG_ALPHAFog of depth: a quiet background wash towards the far edge (S102).
SURFACE_EDGE_ALPHALight edge above the hero line (BOND-VISUALS §2 highlight).
SURFACE_PLENUM_ALPHAIsometric mesh of the floor under the rows (S102 plenum).
SURFACE_YEAR_CHIP_GAPInset of a year chip from the frame edge; the chip font.
SURFACE_YEAR_LABEL_FONT_PX-
SURFACE_YEAR_LABEL_MIN_PXYear chips need this much panel width.
YIELD_MAP_DEFAULT_COLUMNSLongest history kept; the extra dates are thinned evenly, the newest stays.
YIELD_MAP_ROW_COUNTTenor grid lines (rows of the heatmap).
YIELD_MAP_LOW_PCTPercentile bounds of the colour domain (outliers do not stretch it).
YIELD_MAP_HIGH_PCT-
YIELD_MAP_FLAT_ALPHACell tones: quiet exactly on the centre, 0.06 + 0.5 t away from it.
YIELD_MAP_MIN_ALPHA-
YIELD_MAP_INTENSITY_ALPHA-
YIELD_MAP_LEVEL_STEPIsolines of the level contour: 1 pp step, thin text-toned line.
YIELD_MAP_ISOLINE_ALPHA-
YIELD_MAP_LEVEL_LABEL_MIN_PXLevel chips appear only on panels at least this wide.
YIELD_MAP_LEVEL_LABEL_GAP-

On this page