Charts API
Complete API reference for @oge-ui/charts. The kernel — 1-2-5 nice-tick scales, calendar-true time ticks, stacking, bar slotting, single-path builders, pie layout, zoom math and the O(log n) hit-testing — is pure TypeScript inside the package; live demos are on the overview page.
Properties Methods Events Types
OgeChart
oge-chartProperties 29
Data & series
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | [] | Data items; never mutated. |
series | readonly OgeChartSeriesInput[] | [] | Series definitions: type (26 kinds — see OgeChartSeriesType), field mapping (valueField/argumentField — names, dotted paths or getters), name, color, axis (value-axis index), stack group, dashStyle/width/opacity, showInLegend, rangeArea bounds (value1Field/value2Field) and candlestick/ohlc OHLC (openField/highField/lowField/closeField), sizeField (bubble area), visible (start hidden; the legend re-shows) and showLabels (shorthand for label.visible). The per-point, label and analytics options are listed under Series options. Null/NaN values render as gaps. |
commonSeries | Partial<OgeChartSeriesInput> | {} | Defaults merged under every series (dx commonSeriesSettings parity). |
palette | readonly string[] | undefined | — | Series colors; defaults to the 10-color OGE_CHART_PALETTE (concrete hex values so exported images keep their colors). |
Series options (OgeChartSeriesInput)
| Name | Type | Default | Description |
|---|---|---|---|
label | OgeChartLabelOptions | — | Data labels on any cartesian or polar series: { visible?, position?, format?, showForZero?, overlap? }. position: 'outside' (default; past the bar end / above the point), 'inside'/'insideEnd', 'center', 'insideBase' — inside labels pick a contrasting text colour from the mark. format(info) returns the text (info.text is the SI default, info.percent the full-stacked/pareto share). overlap: 'hide' (default) drops a label that would cover an earlier one, 'shift' nudges it clear first, 'none' keeps all; labels are always pulled inside the plot. Labels never change the screen-reader data table. |
colorField / customizePoint | field | (info: OgeChartPointInfo) => OgeChartPointStyle | — | Per-point colour from the data, or a hook returning { color?, label?: { visible?, text? }, marker?: { visible?, size? }, description? } per point (wins over colorField). Bars, markers, candles, OHLC ticks, boxes and polar sectors take the colour; the legend swatch stripes the distinct colours; the tooltip marker follows the point. description is spoken in the tooltip, the announcement and the sr-table cell — colour is never the only channel. |
trendline | OgeTrendlineType | OgeChartTrendlineOptions | — | A regression or smoothing line over the series: 'linear' | 'exponential' | 'logarithmic' | 'polynomial' | 'movingAverage', or { type, order? (polynomial 2–6), period? (moving average), color?, width?, dashStyle? ('dash'), showR2? }. showR2 appends the trend value and R² to the series' tooltip row. The fit is the pure ogeTrendline(). |
indicator | OgeChartIndicatorOptions | — | For type: 'indicator': { type: 'sma' | 'ema' | 'bollinger' | 'macd' | 'rsi', period?, stdDev?, fastPeriod?, slowPeriod?, signalPeriod?, levels? } computed from valueField (or closeField of OHLC data). Bollinger draws a band and two lines, MACD a signal line and a histogram, RSI reference levels at 30/70. Default names like SMA (10) come from messages.values. Put RSI/MACD into their own pane: pane: 'rsi' on the series plus a panes entry and a value axis with pane: 'rsi'. |
summaryField / upColor / downColor / totalColor / showConnectors | field / string / string / string / boolean | — | waterfall: values are deltas floating from the running total; summaryField marks sums — 'total' (or true) spans zero → running total, 'intermediate' the subtotal since the previous intermediate sum. Rising/falling/sum bars colour upColor (green), downColor (red), totalColor (the series colour); dashed connectors join the bars (showConnectors: false drops them). The sr table and tooltip say increase/decrease/total. |
valuesField / q1Field / medianField / q3Field / outliersField / whiskers | field / … / 'tukey' | 'minMax' | — | boxPlot: from raw values (valuesField holding a number[] per category — quartiles by linear interpolation, Tukey 1.5 × IQR whiskers by default, the rest as outlier dots) or precomputed (lowField/q1Field/medianField/q3Field/highField, outliersField). The tooltip and sr table read Min, Q1, Median, Q3, Max. Pure: ogeBoxStats(). |
bins | OgeHistogramBinning | — | histogram: bins valueField over the whole data source — { count? } (default: Sturges' rule, rounded to a 1-2-5 width), { width? } or explicit { thresholds? } edges. Bars span their bins on a linear argument axis; the argument reads start – end. Pure: ogeHistogramBins(). |
cumulativeAxis / cumulativeColor | number / string | — | pareto: categories sort by value (descending) and a cumulative-% line with dots runs over the bars. cumulativeAxis puts the line on a declared value axis (give it position: 'end'; it spans 0–100); without one the line uses an implicit 0–100% scale. The tooltip adds cumulative 45%. |
Axes
| Name | Type | Default | Description |
|---|---|---|---|
argumentAxis | OgeChartAxisOptions | {} | Argument axis: type auto-detects (numbers / dates / categories) when unset; min/max, inverted, grid, title; label (OgeChartAxisLabelOptions: format as a function or Intl options, template such as '{value} km', overlap rotate/stagger/hide/skip/none, visible) — labelFormat/labelOverlap remain as shorthands; tickInterval (axis units, every n-th category, or a calendar interval such as { weeks: 1 }), minorTicks, strips and constantLines. |
valueAxis | OgeChartAxisOptions | readonly OgeChartAxisOptions[] | {} | One or more value axes; series pick theirs via axis (or by pane). position: 'end' renders on the far side (right, or on top when rotated), type: 'logarithmic' spaces decades evenly, abbreviate: false disables SI labels (1.2K). pane places the axis in a pane; constantLines ({ value, label?, color?, dash?, width?, position: 'inside' | 'outside' }) draw threshold / target lines whose labels stay clear of the plot edges; strips ({ start, end, label?, color? }) shade value bands; breaks ({ start, end }[], linear axes) skip value ranges with a zig-zag marker; tickInterval, minorTicks, allowDecimals: false and label work as on the argument axis. |
stripLines | readonly OgeChartStripLine[] | [] | Argument-axis markers: { start, end?, label?, color? } — a line without end, a shaded band with it (see also argumentAxis.strips / constantLines). |
annotations | readonly OgeChartAnnotation[] | [] | Plot annotations: type: 'point' draws a marker dot with a connector into a label box at (argument, value); 'text' places the label alone (top of the plot without a value). axis, color and offsetX/Y refine placement. |
Layout & direction
| Name | Type | Default | Description |
|---|---|---|---|
rotated | boolean | false | Swaps the axes: the argument axis runs vertically (first argument on top), the value axis horizontally. Applies to every series type — bars become horizontal bars (stacked and range bars too), lines run top-down — and the tooltip, crosshair, zoom/pan, the data table and the keyboard follow (Up/Down walk the arguments, Left/Right the series). |
panes | readonly OgeChartPane[] | [] | Plot areas stacked over one shared argument axis (price + volume): { name, height? } with height as a ratio. Series pick a pane with pane (binding to that pane's first value axis, or a default one) and value axes with valueAxis[].pane; stacks and bar slots are per pane. The argument axis sits under the last pane, the crosshair spans every pane (its horizontal line stays in the hovered one) and zoom/pan move them together. Rotated charts lay panes side by side. |
rtlEnabled | boolean | undefined | undefined | Right-to-left layout: mirrors the argument axis, moves the value axes to the other side, flips the legend, the tooltip's opening side and the Left/Right arrow keys. Unset follows the page — the computed direction or the nearest dir attribute, read after the first render (re-read by refresh()); an explicit value also sets dir on the host. |
Interaction
| Name | Type | Default | Description |
|---|---|---|---|
zoomEnabled / panEnabled | 'none' | 'wheel' | 'drag' | 'both' / boolean | 'none' / false | Cursor-centered wheel zoom, drag-select zoom (Escape cancels mid-drag, 8px threshold), Shift+drag pan. Escape on the focused plot resets the zoom. On touch screens two fingers pinch-zoom and pan together (the argument values under both fingers stay under them) and one finger pans when panEnabled is on, otherwise drag-zooms; the plot declares touch-action so the page still scrolls across the argument axis. |
visualRange | OgeChartRange | null | null | The zoom window in argument-axis units (null = full extent). Two-way ([(visualRange)]); writes clamp into the data bounds. |
tooltip | OgeChartTooltipOptions | {} | { enabled?, shared? } — shared lists every series at the hovered argument; otherwise the value-nearest series wins. |
crosshair | OgeChartCrosshairOptions | {} | { enabled?, horizontal? } — the vertical tracker snaps to the nearest argument (binary search). |
legend | OgeChartLegendOptions | {} | { visible?, position? (top/bottom/start/end), interactive? } — real buttons with aria-pressed; clicking toggles the series and the axes rescale. |
selectionMode / selectedPoints | 'point' | 'series' | 'none' / readonly OgeChartPointRef[] | 'none' / [] | Click (or Enter) selects; Ctrl adds points to the set; series mode selects the whole series. Two-way ([(selectedPoints)]). |
Appearance & i18n
| Name | Type | Default | Description |
|---|---|---|---|
title / subtitle | string | '' | Headings above the plot. |
animation | boolean | OgeChartAnimationOptions | true | Hover/selection transitions, a one-time draw-in on the first render with data — each series grows from its value baseline (bars grow, lines rise) in every orientation — and tweens on every later data change: marks are matched by series name and category and glide to their new geometry, new marks grow from the baseline, removed ones shrink to it, line and area paths morph point by point; a legend toggle fades the series out (or in) while the value axis re-scales. New data arriving mid-tween continues from the frame on screen. Resizes, zoom and pan stay immediate. { enabled?, duration? (ms, 600 — draw-in and tweens), easing? ('linear' | 'ease' | 'easeIn' | 'easeOut' | 'easeInOut') }; the presets follow the motion tokens (easeOut → --oge-motion-easing-decelerate, easeIn → -accelerate, ease/easeInOut → -standard). false turns everything off and prefers-reduced-motion: reduce always does. |
locale | string | undefined | — | BCP 47 locale for every Intl format; defaults to the config locale, then the browser locale. |
messages | Partial<OgeChartsMessages> | {} | Per-instance message overrides, merged over the DI config per top-level block. |
Methods 12
| Name | Type | Description |
|---|---|---|
zoomToRange(range) / resetZoom() | void | Programmatic zoom (clamped into the data bounds) / back to the full extent, announced. |
hideTooltip() | void | Clears the hover state (tooltip + crosshair). |
refresh() | void | Re-measures the container (ResizeObserver normally covers it). |
focus() | void | Focuses the keyboard-inspectable plot region. |
getExportData() | OgeChartExportData<T> | Snapshot for custom pipelines: per-series names/types/colors/visibility/points plus the plotted range. |
getSvgElement() | SVGSVGElement | The live SVG root — what the image exporters serialize. |
print(options?) | Promise<void> | Opens the browser print dialog for the chart alone: the serialized SVG (computed styles inlined) in a hidden frame with a print stylesheet — the title above it, the chart scaled to the page, @page orientation from its aspect. OgeChartPrintOptions: { title?, orientation?, background? }. Dependency-free. |
Export entry points (lazy)
| Name | Type | Description |
|---|---|---|
exportChartToPng / exportChartToJpeg / exportChartToSvg / serializeChartSvg / rasterizeChartSvg | @oge-ui/charts/export-image | No third-party libraries: the live SVG is cloned with computed styles inlined, then downloaded as a standalone .svg, or rasterized onto a canvas (pixelRatio, background) for .png or .jpeg (quality, default 0.92 — JPEG has no alpha, so the background fills first). rasterizeChartSvg(svg, options) returns that canvas for custom pipelines. Import the entry point dynamically. |
exportChartToPdf / buildChartPdfDocument / chartPdfLayout | @oge-ui/charts/export-pdf | A one-page PDF: the chart rasterized like the PNG export and embedded into a jsPDF page (orientation from the aspect, pageFormat a4, margin 12 mm) under an optional title/subtitle drawn as real PDF text with font — or the font registered via setOgePdfDefaultFont() from @oge-ui/behavior (Turkish, Greek, Cyrillic need a Unicode font). jspdf is an optional peer pulled in only by this entry; buildChartPdfDocument returns the jsPDF document, chartPdfLayout the pure page geometry. |
Analytics (pure functions)
| Name | Type | Description |
|---|---|---|
ogeSma / ogeEma / ogeBollingerBands / ogeMacd / ogeRsi | (values, period, …) => aligned arrays | The technical indicators the indicator series runs, for your own pipelines: ogeSma(values, period), ogeEma(values, period) (seeded with the first SMA), ogeBollingerBands(values, period = 20, stdDev = 2) → { middle, upper, lower }[], ogeMacd(values, 12, 26, 9) → { macd, signal, histogram }[], ogeRsi(values, 14) (Wilder). Input: numbers or { value } objects; output aligned with the input, null until the window fills. |
ogeTrendline | (points, type, options?) => OgeTrendlineFit | null | Least-squares fits over { x, y } points: 'linear', 'exponential' (y > 0), 'logarithmic' (x > 0), 'polynomial' (order 2–6, x normalized so epoch-ms arguments stay well-conditioned) and 'movingAverage' (period). Returns { coefficients, r2, predict(x), points }. |
ogeBoxStats / ogeHistogramBins | (values, …) => OgeBoxStats | OgeHistogramBin[] | ogeBoxStats(values, 'tukey' | 'minMax') → { low, q1, median, q3, high, mean, outliers }; ogeHistogramBins(values, { count?, width?, thresholds? }) → { start, end, count, indexes }[] (the last edge inclusive). |
Events 5
| Name | Type | Description |
|---|---|---|
pointClick / seriesClick | OgeChartPointEvent<T> / OgeChartSeriesEvent | Pointer (and keyboard Enter) activation with the normalized point payload. |
legendClick | OgeChartLegendClickEvent | Cancelable — set cancel = true to veto the visibility toggle; carries willHide. |
tooltipShowing | OgeChartTooltipShowingEvent<T> | Cancelable, before the tooltip shows for a new argument. |
visualRangeChange / selectedPointsChange | OgeChartRange | null / readonly OgeChartPointRef[] | The two-way model outputs. |
drawn | void | After every render pass. |
Types 14
| Name | Type | Description |
|---|---|---|
OgeChartSeriesType | string union | 'line' | 'spline' | 'stepLine' | 'area' | 'splineArea' | 'stepArea' | 'stackedArea' | 'fullStackedArea' | 'stackedLine' | 'fullStackedLine' | 'stackedSplineArea' | 'fullStackedSplineArea' | 'bar' | 'stackedBar' | 'fullStackedBar' | 'rangeBar' | 'waterfall' | 'pareto' | 'histogram' | 'boxPlot' | 'scatter' | 'bubble' | 'rangeArea' | 'candlestick' | 'ohlc' | 'indicator' — plus 'radialBar' on the polar chart. |
OgeChartPoint<T> | interface | The normalized point: argument, argNumeric, value(s incl. OHLC), source, index, plus style (per-point overrides), extra (OgeChartPointExtra: box quartiles, histogram binStart/binEnd, pareto cumulative, indicator upper/lower/signal/histogram, waterfall total), outliers and the waterfall kind ('up' | 'down' | 'intermediate' | 'total'). |
OgeChartLabelOptions / OgeChartLabelInfo / OgeChartPointStyle / OgeChartPointInfo | interfaces | The label options, what label.format receives ({ seriesIndex, seriesName, pointIndex, argument, value, percent, source, text }), what customizePoint returns and receives. |
[ogeChartLabelTemplate] | structural directive (OgeChartLabelTemplate) | Replaces every data label of the chart (cartesian, pie and polar) — rendered in a 120 × 22 px foreignObject at the label position; context OgeChartLabelTemplateContext: { $implicit: OgeChartRenderLabel } (text, value, argument, seriesName, seriesIndex, pointIndex, inside). |
OgeChartAxisType / OgeChartRange | 'linear' | 'logarithmic' | 'category' | 'time' / { min, max } | Axis kinds and the numeric window type (time axes: epoch ms; category: index space). |
OgeChartConstantLine / OgeChartAxisStrip / OgeChartAxisBreak | interface | Guides of an axis: { value, label?, color?, dash? ('solid' | 'dash' | 'dot'), width?, position? ('inside' | 'outside') }, { start, end, label?, color? } and { start, end } (value axes only). Colours take any CSS colour, theme tokens included. |
OgeChartPane | interface | { name, height? } — a pane of panes; height is a ratio against the other panes (default 1). |
OgeChartTickInterval / OgeChartDateInterval / OgeChartMinorTickOptions | number | interface | tickInterval: a number in axis units (ms on time axes, every n-th category on category axes) or a calendar interval { years?, months?, weeks?, days?, hours?, minutes? } stepping real calendar boundaries; minorTicks: true or { visible?, count? (4) }. |
OgeChartAxisLabelOptions / OgeChartLabelFormat / OgeChartLabelOverlap | interface / union | { visible?, format?, template?, overlap? }; format is a function or Intl.NumberFormatOptions / Intl.DateTimeFormatOptions; overlap is 'rotate' | 'stagger' | 'hide' | 'skip' | 'none' — decided on measured label boxes (the chart measures each label in its own svg; a character estimate before the first render). On a rotated chart's vertical argument axis the boxes are measured by their height: a label wider than the side band wraps (up to three lines, the last ellipsized, centred on its tick), hide / skip compare the real line boxes, stagger alternates two columns and rotate falls back to skip. |
OgeChartAnimationOptions / OgeChartAnimationEasing | interface / union | { enabled?, duration?, easing? } with 'linear' | 'ease' | 'easeIn' | 'easeOut' | 'easeInOut'. |
OgeChartPeriod / OgeChartCustomPeriod | union / interface | Range-selector periods: '1M' | '3M' | '6M' | 'YTD' | '1Y' | 'All', or { label, range } where range is a window { min, max }, a span in axis units back from the data end, or a calendar interval back from it. |
[ogeChartTooltipTemplate] | structural directive (OgeChartTooltipTemplate) | Replaces the tooltip's content; context OgeChartTooltipTemplateContext: { $implicit: OgeChartPointEvent[] }. |
[ogeChartAnnotationTemplate] | structural directive (OgeChartAnnotationTemplate) | Replaces an annotation's label (rendered in a foreignObject, so any HTML works); context OgeChartAnnotationTemplateContext: { $implicit: { text } }. |
[ogeChartLegendTemplate] | structural directive (OgeChartLegendTemplate) | Replaces a legend item's content; context OgeChartLegendTemplateContext: { $implicit: { name, color, hidden } }. |
OgePieChart
oge-pie-chartProperties 11
| Name | Type | Default | Description |
|---|---|---|---|
dataSource / argumentField / valueField | readonly T[] / string | getter | [] / 'argument' / 'value' | One slice per item; negative values clamp to zero. |
type / innerRadius / startAngle | 'pie' | 'doughnut' / number / number | 'pie' / 0.5 / 0 | Doughnut hole as an outer-radius fraction; start angle in radians (0 = 12 o'clock, clockwise). |
smallValuesGrouping | OgeChartSmallValuesGrouping | null | null | { mode: 'topN' | 'smallValueThreshold', topCount?, threshold? } — the tail folds into an "Others" slice (othersLabel). |
othersLabel | string | 'Others' | Label (and argument of the event payload) of the grouped tail slice. |
showLabels | boolean | true | Outside labels in two anti-overlap columns with connector lines (shorthand for label.visible). |
label | OgeChartLabelOptions | undefined | — | Data labels: position 'outside' (two columns with connectors — connector: false drops the lines), 'inside'/'center' (mid-ring, contrast-picked text colour), 'insideEnd' (near the rim), 'insideBase' (near the hole); format(info) with info.percent = the slice share; showForZero; wedges too thin for text and overlapping inside labels are dropped. Default text: the argument. |
colorField / customizePoint | field / (info: OgeChartPointInfo) => OgeChartPointStyle | — | Per-slice colour from the data, or per-slice { color?, label?, description? } overrides; the legend follows, and description is spoken in the tooltip and the sr table. |
series | readonly OgePieSeriesInput[] | [] | Nested doughnut: one ring per entry, inner → outer ({ name?, dataSource?, argumentField?, valueField?, colorField?, customizePoint?, label? } — unset fields fall back to the chart inputs). Slices of the same argument share a colour and one legend button across rings; the sr table gets a column per ring, the tooltip prefixes the ring name, sliceClick carries ringIndex/ringName. Small-value grouping does not apply to rings. |
selectedSlices | readonly number[] | [] | Selected slice indexes — selected slices explode. Two-way ([(selectedSlices)]). |
animation | boolean | OgeChartAnimationOptions | true | Hover transitions plus an arc tween on data changes: slices matched by ring and argument sweep to their new angles, a new slice opens from the seam where it appears and a removed one closes onto its neighbours' seam; new data mid-tween continues from the frame on screen. { enabled?, duration? (ms, 600), easing? } as on the cartesian chart; false turns it off and prefers-reduced-motion: reduce always does. |
legend / tooltipEnabled / palette / title / locale / messages | see OgeChart | — | Shared options with the cartesian chart. |
Methods 1
| Name | Type | Description |
|---|---|---|
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize / opens the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
sliceClick | OgeChartPieSliceEvent<T> | Slice activation: argument, value, fraction, merged sources and the grouped flag for the "Others" slice. |
legendClick / selectedSlicesChange | OgeChartLegendClickEvent / readonly number[] | Cancelable legend toggle; the two-way selection output. |
OgePolarChart
oge-polar-chartProperties 6
| Name | Type | Default | Description |
|---|---|---|---|
dataSource / series / commonSeries | readonly T[] / readonly OgeChartSeriesInput[] / Partial | [] / [] / {} | Same field mapping as the cartesian chart; supported polar types: 'line' and 'area' (closed radar loops — a null value breaks the loop into a gap), 'scatter' (markers), 'bar' (sectors from the center) and 'radialBar' (one concentric ring per category whose arc length is the value against valueAxis.max, on a track; the category labels sit at each ring's start). Series take label, colorField and customizePoint like the cartesian chart. |
spider | boolean | false | Straight-segment (polygon) grid rings instead of circles. |
startAngle | number | 0 | First category's angle in radians (0 = 12 o'clock, clockwise). |
valueAxis | OgeChartAxisOptions | {} | The radial axis: max override and labelFormat of the nice-tick rings. |
selectionMode / selectedPoints | 'point' | 'none' / readonly OgeChartPointRef[] | 'none' / [] | Keyboard Enter on the active point selects it (a second Enter clears it); hovering markers and sectors shows the tooltip. Two-way ([(selectedPoints)]). |
legend / tooltipEnabled / palette / title / locale / messages | see OgeChart | — | Shared options — the legend, tooltip, sr data table and keyboard inspection (arrows walk categories and series) work exactly like the cartesian chart. |
Methods 1
| Name | Type | Description |
|---|---|---|
focus() / getSvgElement() / print(options?) | void / SVGSVGElement / Promise<void> | Focuses the keyboard-inspectable plot / the live SVG root for the image and PDF exporters / opens the browser print dialog for the chart alone. |
Events 1
| Name | Type | Description |
|---|---|---|
pointClick / legendClick / selectedPointsChange | OgeChartPointEvent<T> / OgeChartLegendClickEvent / readonly OgeChartPointRef[] | Point activation, the cancelable legend toggle and the two-way selection output. |
OgeRangeSelector
oge-range-selectorProperties 5
| Name | Type | Default | Description |
|---|---|---|---|
dataSource / series | readonly T[] / readonly OgeChartSeriesInput[] | [] / [] | The mini background chart (line/area recommended) drawn behind the selection window. |
value | OgeChartRange | null | null | The selected window in argument units (null = full range). Two-way ([(value)]) — bind the same signal to a chart's [(visualRange)] and the two stay in lockstep. |
scaleType | 'time' | 'linear' | undefined | — | Auto-detects from the first argument (dates → time) when unset. |
periods | readonly (OgeChartPeriod | OgeChartCustomPeriod)[] | [] | Period buttons above the strip (a role="group" of toggle buttons with aria-pressed): '1M' | '3M' | '6M' | '1Y' count calendar months back from the data end, 'YTD' starts on January 1st, 'All' resets; custom { label, range } entries take a window, a span or a calendar interval. Calendar periods only render on time scales; the texts and accessible descriptions come from messages.periods. |
palette / locale / messages | see OgeChart | — | Shared options; handle labels come from messages.aria.rangeStart/rangeEnd/rangeWindow. |
Methods 1
| Name | Type | Description |
|---|---|---|
reset() | void | Back to the full range (value = null). |
Events 1
| Name | Type | Description |
|---|---|---|
valueChange | OgeChartRange | null | The two-way model output. Interaction: drag the window (grab cursor), drag either handle, click the track to center the window there — Escape mid-drag restores; the handles are WAI-ARIA sliders (arrow keys adjust by 2%, Home/End jump to the bounds, changes announced). |
OgeCircularGauge
oge-circular-gaugeProperties 12
| Name | Type | Default | Description |
|---|---|---|---|
value | number | null | null | The reading; null draws the scale alone (and reads no data). Values outside the scale clamp the indicator, while aria-valuetext speaks the real value. |
scale | OgeGaugeScaleOptions | {} | { min?, max?, tickInterval?, minorTickInterval?, visible?, labelsVisible?, labelFormat? } — default 0..100 with 1-2-5 major ticks (about five intervals) and a fifth of that as minor ticks (0 hides them); labels thin out when they would collide. |
ranges | readonly OgeChartValueRange[] | [] | Coloured bands { start, end, color?, label? }; unset colours cycle the success / warning / danger tokens. A label is spoken with the value when it falls in the band (aria-valuetext “85, Warning”) and lists in the screen-reader table — colour is never the only channel. |
barBase | number | undefined | — | Where the bar indicator starts (a bar from 0 on a −50..50 scale); default the scale minimum. |
subvalues | readonly number[] | [] | Secondary readings drawn as small markers (targets, last week). |
showValue | boolean | true | The value text on the gauge. |
valueFormat | (value: number) => string | undefined | — | Value text and aria-valuetext (v => v + ' km/h'); default the locale number. |
color | string | undefined | — | Indicator colour — any CSS colour or token; default the accent. |
indicator | OgeCircularGaugeIndicator | 'needle' | 'needle', 'bar' (a filled arc from barBase) or 'marker' (a triangle on the scale). The needle and the marker rotate, the bar fills through stroke-dasharray — all three transition on value changes and sweep in from the minimum on the first render. |
startAngle / endAngle | number / number | -120 / 120 | The arc in degrees, 0 = 12 o'clock, clockwise (-90 / 90 is a half gauge); the radius is fitted to the arc's bounding box, so partial gauges fill their box. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 2
| Name | Type | Description |
|---|---|---|
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
Types 3
| Name | Type | Description |
|---|---|---|
OgeGaugeScaleOptions / OgeChartValueRange | interfaces | The scale and ranges shapes, shared by both gauges and the bullet chart. |
OgeCircularGaugeIndicator | 'needle' | 'bar' | 'marker' | The circular gauge's value indicators. |
role="meter" | semantics | The plot is a role="meter" with aria-valuenow (clamped into the scale), aria-valuemin, aria-valuemax and aria-valuetext; the svg is aria-hidden, and a screen-reader table outside the meter lists value, bounds, ranges and subvalues. |
OgeLinearGauge
oge-linear-gaugeProperties 13
| Name | Type | Default | Description |
|---|---|---|---|
value | number | null | null | The reading; null draws the scale alone (and reads no data). Values outside the scale clamp the indicator, while aria-valuetext speaks the real value. |
scale | OgeGaugeScaleOptions | {} | { min?, max?, tickInterval?, minorTickInterval?, visible?, labelsVisible?, labelFormat? } — default 0..100 with 1-2-5 major ticks (about five intervals) and a fifth of that as minor ticks (0 hides them); labels thin out when they would collide. |
ranges | readonly OgeChartValueRange[] | [] | Coloured bands { start, end, color?, label? }; unset colours cycle the success / warning / danger tokens. A label is spoken with the value when it falls in the band (aria-valuetext “85, Warning”) and lists in the screen-reader table — colour is never the only channel. |
barBase | number | undefined | — | Where the bar indicator starts (a bar from 0 on a −50..50 scale); default the scale minimum. |
subvalues | readonly number[] | [] | Secondary readings drawn as small markers (targets, last week). |
showValue | boolean | true | The value text on the gauge. |
valueFormat | (value: number) => string | undefined | — | Value text and aria-valuetext (v => v + ' km/h'); default the locale number. |
color | string | undefined | — | Indicator colour — any CSS colour or token; default the accent. |
orientation | OgeGaugeOrientation | 'horizontal' | 'horizontal' or 'vertical' (minimum at the bottom; give the host a height). |
indicator | OgeLinearGaugeIndicator | 'bar' | 'bar' fills the track from barBase; 'marker' slides a triangle along it. Both transition and sweep in like the circular gauge. |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 2
| Name | Type | Description |
|---|---|---|
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
Types 1
| Name | Type | Description |
|---|---|---|
OgeLinearGaugeIndicator / OgeGaugeOrientation | 'bar' | 'marker' / 'horizontal' | 'vertical' | The linear gauge's indicators and orientations; the meter semantics are the circular gauge's. |
OgeBulletChart
oge-bullet-chartProperties 10
| Name | Type | Default | Description |
|---|---|---|---|
value / target | number | null / number | null | null / null | The measure (the bar, from zero) and the comparative measure (the target marker). |
ranges | readonly OgeChartValueRange[] | [] | Qualitative bands, low → high; unset colours are shades of the muted colour, darkest first (poor → good). Labels list in the screen-reader table. |
scale | OgeGaugeScaleOptions | {} | min / max default to 0 and the nice ceiling of bands, value and target; visible: false drops the axis. |
orientation | OgeGaugeOrientation | 'horizontal' | Vertical bullets stand the bar up (give the host a height). |
color / targetColor | string | undefined / string | undefined | — | Bar and target colours; default the text colour. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
tooltipEnabled | boolean | true | Hovering shows the value and the target. |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 2
| Name | Type | Description |
|---|---|---|
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
Types 1
| Name | Type | Description |
|---|---|---|
role="img" | semantics | The svg's accessible name speaks title, value and target (visuals.bulletLabel); the screen-reader table lists value, target and every band. |
OgeSparkline
oge-sparklineProperties 12
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly (T | number | null)[] | [] | Plain numbers or items; null is a gap. |
valueField / argumentField | string | getter / string | getter | undefined | 'value' / undefined | Field mapping for items (names, dotted paths or getters); the argument only feeds the tooltip (default the 1-based position). |
type | OgeSparklineType | 'line' | 'line', 'area', 'bar' (bars from zero, negatives in negativeColor) or 'winloss' (equal-height ticks above / below the middle, flat for a draw). |
markers | boolean | OgeSparklineMarkers | false | Dots on the first / last / min / max points (true = all four; max in the success colour, min in danger). |
winlossThreshold | number | 0 | Win-loss: above wins, below loses, equal draws. |
minValue / maxValue | number | undefined | — | A fixed value range, so sparklines of one column compare; default the data range (bars always include 0). |
color / negativeColor | string | undefined | — | Series / positive colour (default the accent) and negative bars / losses (default danger). |
lineWidth | number | 1.5 | Line stroke width, px. |
tooltipEnabled | boolean | false | A hover balloon with argument: value of the nearest point. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | The prefix of the accessible label — the svg is a role="img" summarizing the series (visuals.sparklineLabel: “Sales sparkline, 7 points: first 171, last 182, low 171, high 182”), the locale of its numbers and message overrides. |
Methods 1
| Name | Type | Description |
|---|---|---|
getSvgElement() | SVGSVGElement | The live SVG root, for the image exporters. |
Types 1
| Name | Type | Description |
|---|---|---|
OgeSparklineType / OgeSparklineMarkers | 'line' | 'area' | 'bar' | 'winloss' / { first?, last?, min?, max? } | Import the component from @oge-ui/charts/sparkline (also re-exported by @oge-ui/charts): that entry never loads the cartesian chart. It has no frame, no animation and no screen-reader table — a cell-sized chart speaks one summary sentence. |
OgeFunnelChart
oge-funnel-chartProperties 14
| Name | Type | Default | Description |
|---|---|---|---|
dataSource / argumentField / valueField | readonly T[] / string | getter / string | getter | [] / 'argument' / 'value' | One stage per item; negative values clamp to zero. |
colorField / customizePoint | field / (info: OgeChartPointInfo) => OgeChartPointStyle | — | Per-stage colour, or { color?, label?, description? } overrides; description is spoken with the value. |
type | OgeFunnelType | 'funnel' | 'funnel' or 'pyramid' (a dynamic-height triangle with the apex on top and the first stage at the base). |
algorithm | OgeFunnelAlgorithm | 'dynamicSlope' | 'dynamicSlope': equal heights, widths follow the values. 'dynamicHeight': one fixed outline narrowing to the neck, heights follow the values. |
neckWidth / neckHeight | number / number | 0 / 0 | The neck as fractions of the width and (dynamic height) of the height. |
inverted / sortData / itemGap | boolean / boolean / number | false / true / 2 | Upside down; sort the stages largest first; the gap between stages, px. |
showLabels / label | boolean / OgeChartLabelOptions | true / undefined | Labels inside the stages (dropped where they do not fit, contrast-picked colour) or position: 'outside' in a column beside the shape with connectors; format(info) with info.percent = the share of the first stage. Default text stage: value. |
legend / tooltipEnabled | OgeChartLegendOptions / boolean | {} / true | One legend button per stage (toggles its selection, legendClick is cancelable); the tooltip adds the share of the first and of the previous stage. |
palette | readonly string[] | undefined | — | Colours in order; default OGE_CHART_PALETTE. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
selectedItems | readonly number[] | [] | Selected stage indexes (drawing order). Two-way ([(selectedItems)]). |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 3
| Name | Type | Description |
|---|---|---|
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 3
| Name | Type | Description |
|---|---|---|
itemClick | OgeChartFunnelItemEvent<T> | Stage click or Enter: { index, argument, value, percentOfFirst, percentOfPrevious, source }. |
legendClick | OgeChartLegendClickEvent | Cancelable legend toggle. |
selectedItemsChange | readonly number[] | The two-way selectedItems output. |
Types 2
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | Up/Down (and Left/Right, mirrored in RTL) walk the stages, Home/End jump, Enter/Space select. Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeFunnelType / OgeFunnelAlgorithm | 'funnel' | 'pyramid' / 'dynamicSlope' | 'dynamicHeight' | Shapes and algorithms. The [ogeChartLegendTemplate] and [ogeChartLabelTemplate] slots of the pie chart work here too. |
OgeHeatmap
oge-heatmapProperties 12
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | [] | One item per cell; missing cells render empty and read no data. |
xField / yField / valueField | string | getter | 'x' / 'y' / 'value' | Column category, row category and the value. |
xCategories / yCategories | readonly unknown[] | undefined | — | Explicit column / row orders (top to bottom); default the order of first appearance. Items outside them are skipped. |
colorScale | OgeChartColorScale | undefined | — | { type?: 'linear' | 'segmented', min?, max?, colors?, ranges?, emptyColor?, labelFormat? } — two or more colors blend evenly with color-mix() (three make a diverging scale; theme tokens follow the theme), segmented paints ranges flat. Default: the --oge-chart-heat-low / --oge-chart-heat-high tokens over the data range. |
showLabels | boolean | true | Values in the cells where they fit. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
cellGap / xAxisPosition | number / 'top' | 'bottom' | 2 / 'bottom' | Gap between cells, px; column labels above or below the grid. |
legend / tooltipEnabled | OgeChartLegendOptions / boolean | {} / true | The colour-scale legend (a gradient bar with ticks, or swatches when segmented; mirrored in RTL) and the cell tooltip. |
selectedCells | readonly OgeChartCellRef[] | [] | Selected { row, column } cells (click / Enter toggles). Two-way ([(selectedCells)]). |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 3
| Name | Type | Description |
|---|---|---|
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
cellClick | OgeChartHeatmapCellEvent<T> | Cell click or Enter: { row, column, x, y, value, source }. |
selectedCellsChange | readonly OgeChartCellRef[] | The two-way selectedCells output. |
Types 2
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | The APG grid's navigation keys: arrows move one cell (the horizontal pair mirrors in RTL), Home/End to the row's ends, Ctrl+Home/End to the first/last cell, PageUp/PageDown to the column's ends, Enter/Space select. The screen-reader table is two-dimensional — one row per row category, one column per column category. Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeChartColorScale / OgeChartCellRef | interfaces | The colour scale (shared with the treemap and the map) and a selected cell. |
OgeTreemap
oge-treemapProperties 14
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | [] | Nested items (children under childrenField) or a flat list (idField + parentField; unknown parents and cycles are tolerated). Groups sum their children. |
childrenField / idField / parentField | string | getter | 'items' / 'id' / undefined | Setting parentField switches to flat data. |
labelField / valueField / colorField | string | getter | 'name' / 'value' / undefined | Name, leaf value and an optional colour; unset colours come from the palette per top-level branch, lightened by depth. |
layoutAlgorithm | OgeTreemapLayoutAlgorithm | 'squarified' | 'squarified' (tiles as close to squares as the data allows) or 'sliceAndDice' (strips alternating per level, input order kept). |
maxDepth | number | undefined | — | Levels drawn below the current root; groups that are deep enough nest their children under a header band. Unset = all. |
colorScale | OgeChartColorScale | undefined | — | Colour the leaves by value instead (adds the colour-scale legend). |
palette | readonly string[] | undefined | — | Colours in order; default OGE_CHART_PALETTE. |
showLabels | boolean | true | Name and value lines fitted to each tile (cut with an ellipsis). |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
drillDown / tooltipEnabled | boolean / boolean | true / true | Clicking a group (or Enter) makes it the root and shows the breadcrumb; the tooltip shows the path, value and share of the parent. |
rootKey | string | '' | The drill-down root's key ('' = the whole tree; keys are index paths like '0/2'). Two-way ([(rootKey)]). |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 4
| Name | Type | Description |
|---|---|---|
drillTo(key) / drillUp() | void | Re-roots on a node (announced) / one level up (no-op at the top). |
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
tileClick | OgeChartHierarchyNodeEvent<T> | Tile click or Enter: { key, name, value, depth, percentOfParent, isGroup, source } — fires before a group drills. |
rootKeyChange | string | The two-way rootKey output. |
Types 2
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | Left/Right (mirrored in RTL) walk the siblings, Down goes to the first child, Up to the parent, Home/End to the first/last sibling, Enter/Space drill into a group (or activate a leaf) and Escape/Backspace drill up. The breadcrumb is a <nav> of buttons ending in the aria-current level. Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeChartHierarchyNodeEvent / OgeTreemapLayoutAlgorithm | interface / string union | The node payload (shared with the sunburst) and the tilings. |
OgeSunburstChart
oge-sunburst-chartProperties 12
| Name | Type | Default | Description |
|---|---|---|---|
dataSource | readonly T[] | [] | Nested items (children under childrenField) or a flat list (idField + parentField; unknown parents and cycles are tolerated). Groups sum their children. |
childrenField / idField / parentField | string | getter | 'items' / 'id' / undefined | Setting parentField switches to flat data. |
labelField / valueField / colorField | string | getter | 'name' / 'value' / undefined | Name, leaf value and an optional colour; unset colours come from the palette per top-level branch, lightened by depth. |
maxDepth | number | undefined | — | Rings drawn below the current root; unset = all. |
innerRadius / startAngle | number / number | 0.25 / 0 | The centre hole as a fraction of the radius (it shows the root and goes up on click) and the start in radians (0 = 12 o'clock, clockwise, as on the pie). |
palette | readonly string[] | undefined | — | Colours in order; default OGE_CHART_PALETTE. |
showLabels | boolean | true | Radial labels where a segment is wide and deep enough. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
drillDown / tooltipEnabled | boolean / boolean | true / true | Clicking a branch (or Enter) re-roots on it; the centre, the breadcrumb or Escape goes back up. |
rootKey | string | '' | The drill-down root's key ('' = the whole tree). Two-way ([(rootKey)]). |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 4
| Name | Type | Description |
|---|---|---|
drillTo(key) / drillUp() | void | Re-roots on a node / one level up. |
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
segmentClick | OgeChartHierarchyNodeEvent<T> | Segment click or Enter (before a branch drills). |
rootKeyChange | string | The two-way rootKey output. |
Types 1
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | The treemap's keys: Left/Right siblings, Down first child, Up parent, Enter drills, Escape goes up. Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeSankeyChart
oge-sankey-chartProperties 11
| Name | Type | Default | Description |
|---|---|---|---|
dataSource / sourceField / targetField / valueField | readonly T[] / string | getter | [] / 'source' / 'target' / 'value' | One item per flow; nodes are derived from the link ends. Zero links and self-loops are dropped; cycles are tolerated (their back-edges ignore the columns). |
nodes | readonly OgeSankeyNode[] | [] | Optional per-node { id, label?, color? }; listing nodes also fixes their order. |
nodeWidth / nodePadding | number / number | 14 / 12 | Node bar width and the vertical gap within a column, px. |
nodeAlign | OgeSankeyNodeAlign | 'justify' | Columns from the longest path from a source: 'justify' pushes sinks to the last column, 'left' / 'right' / 'center' align by depth / height. |
linkColor | OgeSankeyLinkColor | 'source' | Bands take the 'source' or 'target' node colour, or a 'neutral' grey (--oge-chart-link). |
showLabels / tooltipEnabled | boolean / boolean | true / true | Node labels facing the inside of the diagram; tooltips for nodes (in / out totals) and links (source → target: value). |
palette | readonly string[] | undefined | — | Colours in order; default OGE_CHART_PALETTE. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
rtlEnabled | boolean | undefined | undefined | Mirrored layout; unset follows the page dir (and a later flip of it). An explicit value is also set as dir on the host. |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 3
| Name | Type | Description |
|---|---|---|
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
nodeClick | OgeChartSankeyNodeEvent | Node click or Enter: { id, label, inflow, outflow }. |
linkClick | OgeChartSankeyLinkEvent<T> | Link click: { source, target, value, item }. |
Types 2
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | Up/Down within a column, Left/Right to the neighbouring column (mirrored in RTL) at the closest rank, Home/End, Enter/Space. The active node lights up its links like a hover; the screen-reader table lists every flow. Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeSankeyNode / OgeSankeyNodeAlign / OgeSankeyLinkColor | interface / string unions | Per-node settings, the column alignments and the link colourings. |
OgeVectorMap
oge-vector-mapProperties 12
| Name | Type | Default | Description |
|---|---|---|---|
geoJson | OgeGeoJsonFeatureCollection | null | null | Any GeoJSON FeatureCollection; Polygon and MultiPolygon features are drawn, fitted into the box. No tiles, no projection library. |
projection | OgeMapProjection | 'mercator' | 'mercator' or 'equirectangular'. |
regionKey / nameField | (feature) => string / string | undefined / 'name' | A feature's join key (default feature.id, then properties.name) and the property holding its display name. |
dataSource / keyField / valueField | readonly T[] / string | getter / string | getter | [] / 'key' / 'value' | The values, joined to the regions by key; regions without one read no data. |
colorScale | OgeChartColorScale | undefined | — | The choropleth scale (see the heatmap); default the heat tokens. |
showLabels | boolean | true | Region names where the region is wide enough at the current zoom. |
valueFormat | (value: number) => string | undefined | — | The text of every value — labels, tooltip, announcements, the screen-reader table; default the locale number. |
legend / tooltipEnabled | OgeChartLegendOptions / boolean | {} / true | The colour-scale legend and the region tooltip. |
zoomEnabled / maxZoom | boolean / number | true / 8 | Wheel (a non-passive listener), pinch, the zoom buttons and the keyboard zoom; dragging pans while zoomed (the shared chart gesture machine, Escape cancels). The view is clamped so the map never leaves the box. |
selectedRegions | readonly string[] | [] | Selected region keys (click / Enter toggles). Two-way ([(selectedRegions)]). |
animation | boolean | OgeChartAnimationOptions | true | The first-render draw-in and the hover / value transitions ({ enabled, duration, easing }); prefers-reduced-motion always wins. |
title / locale / messages | string / string | undefined / Partial<OgeChartsMessages> | — | Shared with every chart: the heading (also the start of the accessible name), the BCP 47 locale of every number, and per-instance message overrides — the strings of these charts live in the visuals block (OgeChartsVisualMessages). |
Methods 4
| Name | Type | Description |
|---|---|---|
zoomIn() / zoomOut() / resetZoom() | void | Zoom about the centre / back to the fitted view. |
focus() | void | Moves the keyboard focus to the plot. |
refresh() | void | Re-measures the container and re-reads the page direction (rarely needed — a ResizeObserver and a dir observer cover it). |
getSvgElement() / print(options?) | SVGSVGElement / Promise<void> | The live SVG root — what the image and PDF exporters serialize (token colours are resolved to their computed values) / the browser print dialog for the chart alone. |
Events 2
| Name | Type | Description |
|---|---|---|
regionClick | OgeChartMapRegionEvent<T> | Region click or Enter: { index, key, name, value, feature, source } (not fired by the click that ends a drag). |
selectedRegionsChange | readonly string[] | The two-way selectedRegions output. |
Types 2
| Name | Type | Description |
|---|---|---|
Keyboard | focusable plot (role="group") | Arrows move to the nearest region in that screen direction (by centroid) and pan it into view, + / - zoom, Shift+arrows pan, 0 resets, Home/End jump, Enter/Space select. The keys are described to screen readers (visuals.mapHint). Each move is announced in a polite live region; the screen-reader table carries every value. |
OgeGeoJsonFeatureCollection / OgeGeoJsonFeature / OgeGeoJsonGeometry / OgeMapProjection | interfaces / string union | The minimal GeoJSON shapes the map reads and the projections. |
Configuration
Properties 5
| Name | Type | Default | Description |
|---|---|---|---|
provideOgeChartsConfig(config) | Provider | — | Configures every chart below the provider (OgeChartsConfigInput); shallow merge over OGE_DEFAULT_CHARTS_CONFIG per top-level key — a partial messages replaces whole nested blocks. The token is OGE_CHARTS_CONFIG (OgeChartsConfig). |
messages | OgeChartsMessages | — | Every user-facing string, aria labels included: aria (OgeChartsAriaMessages — chart/pie labels with {title}/{count}, table caption, plot hint, legend label), announcements (OgeChartsAnnouncementMessages — live-region templates with {series}/{argument}/{value}), values (OgeChartsValueMessages — the words of analytic value texts: box-plot low/q1/median/q3/high/outliers, waterfall increase/decrease/intermediate/total, pareto cumulative, upper/lower/signal/histogram, the trendline suffix trend with {value}/{r2}, the histogram bin and the default indicator names sma/ema/bollinger/macd/rsi), periods (OgeChartsPeriodMessages — the range-selector period group label, button texts and their spelled-out descriptions) visuals (OgeChartsVisualMessages — the accessible names, keyboard hints, table headers, value words and announcements of the gauges, the bullet chart, the sparkline, the funnel, heatmap, treemap, sunburst, Sankey and map; count-bearing names are ICU plurals) and noData. Defaults: OGE_DEFAULT_CHARTS_MESSAGES. |
locale | string | undefined | — | BCP 47 locale for every Intl format in scope; a per-instance [locale] input wins. |
a11yTableLimit | number | 50 | Rows of the screen-reader data table. |
markerThreshold | number | 200 | Marker circles render only up to this many points per series — beyond it the single path carries the series alone. Line-family paths additionally auto-downsample with LTTB to about one point per pixel once a series outgrows the plot width (hit-testing and tooltips keep the full data). |
Notes
- Rendering is dependency-free SVG (no D3, no Chart.js, no canvas library) and dates are plain local
Dates (Intl-only house rule). Time ticks are calendar-true: month boundaries land on real month starts and DST never shifts a point. - No WAI-ARIA APG chart pattern exists. The widget composes:
role="img"with a generated label, a screen-reader-onlyrole="table"carrying the firsta11yTableLimitrows of data, real legend buttons witharia-pressed, and a focusable plot region where arrow keys walk arguments and series with polite live-region announcements — Enter selects, Escape resets the zoom. - The performance contract: one
<path>per series regardless of point count, markers only undermarkerThreshold, binary-search hit-testing and rAF-coalesced pointer/resize work — verified by a 50k-point smoke test.