Chart
Data visualization and chart components
Components for data visualization and charting.
Prerequisites
- Install the packages
npm install \
@tetherto/mdk-react-devkit \
@tetherto/mdk-react-adapter \
@tetherto/mdk-ui-foundationInstall zod@^4.6.6 first. @tetherto/mdk-react-devkit@0.12.1 declares zod@^4.6.6 as a peer while its
@hookform/resolvers peer pulls a chain that pins zod 3, so the command above aborts with ERESOLVE in a project that
has no zod. Installing zod 4 at the project root resolves it:
npm install zod@^4.6.6- Import styles:
import '@tetherto/mdk-react-devkit/styles.css'
Components
@tetherto/mdk-react-devkit
Chart container
import { ChartContainer } from '@tetherto/mdk-react-devkit'A layout wrapper for charts that provides a title/header row, interactive legend, range selector, highlighted value display, loading/empty states, and a stats footer.
Notes
minMaxAvgandtimeRangeare only rendered when the chart is not loading or empty
Example
/**
* Runnable example for ChartContainer.
*/
import { useState } from 'react'
import { ChartContainer } from '@tetherto/mdk-react-devkit'
const RANGE_OPTIONS = [
{ label: '1H', value: '1h' },
{ label: '24H', value: '24h' },
{ label: '7D', value: '7d' },
]
const LEGEND_DATA = [
{ label: 'Pool A', color: '#59E8E8' },
{ label: 'Pool B', color: '#FF9500' },
]
const MockChart = () => (
<div
style={{
height: 160,
background: 'var(--mdk-color-surface-secondary, #1a1a2e)',
borderRadius: 4,
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
color: 'var(--mdk-color-text-secondary, #888)',
fontSize: 13,
}}
>
Chart content
</div>
)
export const ChartContainerExample = () => {
const [range, setRange] = useState('24h')
return (
<div className="mdk-example-row" style={{ display: 'flex', flexDirection: 'column', gap: 24 }}>
{/* Basic with title only */}
<ChartContainer title="Simple Chart">
<MockChart />
</ChartContainer>
{/* Full-featured: highlighted value, legend, range selector, min/max/avg */}
<ChartContainer
title="Hashrate"
highlightedValue={{ value: 102.4, unit: 'TH/s' }}
legendData={LEGEND_DATA}
rangeSelector={{ options: RANGE_OPTIONS, value: range, onChange: setRange }}
minMaxAvg={{ min: '10 TH/s', avg: '55 TH/s', max: '100 TH/s' }}
>
<MockChart />
</ChartContainer>
{/* Loading state */}
<ChartContainer title="Loading" loading>
<MockChart />
</ChartContainer>
{/* Empty state */}
<ChartContainer title="No Data" empty emptyMessage="No data available for this period">
<MockChart />
</ChartContainer>
</div>
)
}Related API
@tetherto/mdk-react-devkit
Import the public APIs on this page from @tetherto/mdk-react-devkit.
AreaChart
Presentational Chart.js area chart (Line with fill). Data must be provided via props; this component does no fetching of its own
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Required | ChartData<"line", (number | Point | null)[], unknown> | - | Chart data - required, provided by parent |
className | Optional | string | - | Additional class names |
height | Optional | number | 300 | Chart height in pixels |
options | Optional | object | - | Chart.js options - merged with defaults |
tooltip | Optional | ChartTooltipConfig | - | Custom HTML tooltip configuration. When provided, replaces the default Chart.js tooltip |
AverageDowntimeChart
Stacked bar chart of average downtime (curtailment vs operational issues). Wraps ChartContainer and BarChart; pass period labels and rate arrays via data
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
barWidth | Optional | number | 38 | Max bar thickness |
className | Optional | string | - | Extra class on the container |
data | Optional | AverageDowntimeChartData | - | Period labels and rate arrays (fractions 0–1) |
emptyMessage | Optional | string | - | Message when there are no period labels or rate series |
height | Optional | number | 280 | Chart height in pixels |
isLoading | Optional | boolean | false | Shows loading overlay |
showDataLabels | Optional | boolean | false | Show values above stacked bars |
title | Optional | string | "Monthly Average Downtime" | Chart title (unit renders on its own line below) |
unit | Optional | string | % | Unit subtitle under the title |
yTicksFormatter | Optional | (value: number) => string | - | Formats Y-axis ticks, tooltips, and bar data labels (values are 0–1 rates). Defaults to rate × 100 via formatNumber |
AverageDowntimeChartData
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
labels | Required | string[] | - | X-axis period labels, one per bar; empty renders the empty state |
curtailment | Optional | number[] | - | "Curtailment" downtime rate per period, as a fraction (0–1), aligned to labels |
operationalIssues | Optional | number[] | - | "Op. Issues" downtime rate per period, as a fraction (0–1), stacked on curtailment |
BarChart
Presentational Chart.js bar chart. Data must be pre-aggregated; use grouped or stacked categories via datasets
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Required | any | - | Chart data - required, provided by parent. Use as any for mixed bar+line datasets |
className | Optional | string | - | Additional class for the wrapper div |
formatDataLabel | Optional | ((value: number) => string) | - | Format data label values (default: round to nearest integer) |
formatYLabel | Optional | ((value: number) => string) | - | Format Y-axis tick labels |
height | Optional | number | 300 | Chart height in pixels |
isHorizontal | Optional | boolean | false | Render bars horizontally (indexAxis: 'y') |
isStacked | Optional | boolean | false | Stack bars on top of each other |
legendAlign | Optional | "center" | "start" | "end" | "start" | Alignment of the legend labels within their position |
legendPosition | Optional | "left" | "right" | "top" | "bottom" | "top" | Position of the legend |
options | Optional | object | - | Chart.js options - merged with defaults |
showDataLabels | Optional | boolean | false | Show values above each bar |
showLegend | Optional | boolean | true | Show built-in Chart.js legend |
tooltip | Optional | ChartTooltipConfig | - | Custom HTML tooltip configuration. When provided, replaces the default Chart.js tooltip |
ChartContainer
Standard chrome for charts: title, optional highlighted value, legend with toggle, range selector (radio cards), loading / empty states, and a footer for min/max/avg stats
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
children | Required | React.ReactNode | - | The chart element to render |
className | Optional | string | - | Additional class for the root element |
empty | Optional | boolean | - | Hides the chart and shows emptyMessage |
emptyMessage | Optional | React.ReactNode | "No data available" | Message shown when empty is true: a string, or any element (an EmptyState, say) |
footer | Optional | React.ReactNode | - | Custom footer content rendered below the chart |
footerClassName | Optional | string | - | Additional class for the footer area |
header | Optional | React.ReactNode | - | Replaces the default title heading with a custom element |
headerAction | Optional | React.ReactNode | - | Optional action rendered on the right side of the header row (e.g. an expand/fullscreen toggle). Sits alongside the range selector when both are present. Purely additive - omit it and the header renders exactly as before |
highlightedValue | Optional | HighlightedValueProps | - | Large value/unit displayed alongside the legend |
legendData | Optional | LegendItem[] | - | Color-keyed legend items; each item can be toggled |
loader | Optional | React.ReactNode | - | Replaces the default <Loader> in the loading overlay |
loading | Optional | boolean | - | Shows a centered <Loader> overlay |
minMaxAvg | Optional | Partial<{ min: string; max: string; avg: string }> | - | Built-in footer showing Min / Avg / Max values |
onToggleDataset | Optional | ((index: number) => void) | - | Fired when a legend item is clicked |
rangeSelector | Optional | RangeSelectorProps | - | Radio-card time-range selector |
timeRange | Optional | string | - | Time range label shown in the footer |
title | Optional | string | - | Chart heading (renders as <h3> unless header is provided) |
titleExtra | Optional | React.ReactNode | - | Optional node rendered immediately after the title text (e.g. an info tooltip). Only shown when title is set and header is not. Additive - omit it and the title renders exactly as before |
LegendItem
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
color | Required | string | - | Color string (hex, hsl, etc.) |
label | Required | string | - | Legend label |
hidden | Optional | boolean | - | Whether this dataset is currently hidden |
HighlightedValueProps
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
value | Required | string | number | - | The primary value to display |
className | Optional | string | - | Additional class |
style | Optional | React.CSSProperties | - | Inline style |
unit | Optional | string | - | Unit suffix |
RangeSelectorProps
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
onChange | Required | (value: string) => void | - | Fires when user picks a range |
options | Required | RangeSelectorOption[] | - | { label, value } items |
value | Required | string | - | Currently selected value |
buttonClassName | Optional | string | - | Additional class for each option button |
className | Optional | string | - | Additional class for the selector |
style | Optional | React.CSSProperties | - | Inline style for the selector |
ChartStatsFooter
ChartStatsFooter - Displays Min/Max/Avg values and optional stats grid below a chart
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
className | Optional | string | - | Custom class name |
minMaxAvg | Optional | Partial<{ min: string; max: string; avg: string }> | - | Min/Max/Avg values row |
secondaryLabel | Optional | SecondaryLabel | - | Secondary label displayed below stats |
stats | Optional | ChartStatsFooterItem[] | - | Additional stats displayed in a columnar grid |
statsPerColumn | Optional | number | 1 | Number of stat items per column (default: 1) |
ChartStatsFooterItem
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
label | Required | string | - | Stat label |
value | Required | string | number | - | Stat value |
SecondaryLabel
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
title | Required | string | - | Label text |
value | Required | string | number | - | Value text |
DetailLegend
DetailLegend - Enhanced chart legend with current values and percentage change indicators
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
items | Required | DetailLegendItem[] | - | Legend items to display |
className | Optional | string | - | Custom class name |
onToggle | Optional | ((label: string, index: number) => void) | - | Callback when a legend item is toggled |
DetailLegendItem
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
color | Required | string | - | Hex color for the default swatch (border, plus 20% opacity fill) and the color of a custom icon |
label | Required | string | - | Display label; also passed to onToggle |
currentValue | Optional | { value: string | number; unit?: string } | - | Value shown below the label, numbers formatted, with optional unit; also the row that holds percentChange |
hidden | Optional | boolean | - | Dims the item (30% opacity) to show its dataset is hidden |
icon | Optional | React.ReactNode | - | Custom icon replacing the default color swatch |
percentChange | Optional | number | null | - | Percentage change shown after currentValue: positive as a green ▲, negative as a red ▼; hidden when 0, null or without currentValue |
DoughnutChart
DoughnutChart – Presentational Chart.js doughnut chart with custom HTML legend matching the MDK design
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Required | DoughnutChartDataset[] | - | Array of labelled slices |
borderWidth | Optional | number | 4 | Border width between segments (default: 4) |
className | Optional | string | - | Additional class for the root element |
cutout | Optional | string | "75%" | Doughnut cutout percentage (default: '75%') |
formatValue | Optional | ((value: number) => string) | - | Formats slice values in the built-in legend and default tooltip (default: raw number) |
height | Optional | number | 260 | Chart height in pixels |
legendPosition | Optional | "left" | "right" | "top" | "bottom" | "top" | Where to place the legend relative to the chart (default: 'top') |
options | Optional | object | - | Chart.js options – merged with defaults |
tooltip | Optional | ChartTooltipConfig | - | Custom HTML tooltip configuration. When provided, replaces the default doughnut tooltip (which shows label, value with unit, and percentage). Use valueFormatter to replicate the percentage display if needed |
unit | Optional | string | "" | Unit suffix appended to values in tooltips and legends |
DoughnutChartDataset
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
label | Required | string | - | Slice label |
value | Required | number | - | Numeric slice value |
color | Optional | string | - | Slice color (falls back to the built-in palette) |
GaugeChart
GaugeChart - Presentational gauge / speedometer chart.
Implementation note: the gauge is drawn by a pure-SVG internal implementation (see ./gauge-svg.tsx), so the component is bundler- and runtime-agnostic and carries no third-party runtime dependency. The gauge packages on NPM are published CommonJS-only with a module field pointing at the same CJS file, which crashes under ESM bundlers that add no __esModule ? .default : module interop shim (Webpack 4, raw esbuild, some SSR setups) with React's "Element type is invalid" error
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
percent | Required | number | - | Value between 0 and 1 (e.g. 0.75 = 75%). Values outside the range are clamped |
arcsLength | Optional | number[] | - | Custom arc-segment proportions (auto-normalised), overriding nrOfLevels. e.g. [0.7, 0.3] for a progress-style gauge whose first arc is the fill |
arcWidth | Optional | number | 0.2 | Arc thickness as a fraction of the gauge radius (0–1) |
className | Optional | string | - | Additional class for the root div |
colors | Optional | string[] | [COLOR.GREEN, COLOR.RED] | Arc colours in HEX format |
formatTextValue | Optional | ((percent: number) => string) | - | Format the center label from the clamped fraction (0–1) |
height | Optional | string | number | 200 | Chart height in pixels or any CSS length (e.g. '200px' or '50%') |
hideNeedle | Optional | boolean | false | Hide the needle + hub (e.g. for a progress-style gauge) |
hideText | Optional | boolean | false | Hide the percentage text rendered inside the gauge |
id | Optional | string | "mdk-gauge-chart" | Stable id used for the gauge's accessibility labels |
maxWidth | Optional | number | - | Maximum width in pixels |
needleColor | Optional | string | COLOR.STEEL_GRAY | Needle + hub colour |
nrOfLevels | Optional | number | 3 | Number of arc segments. Ignored when arcsLength is provided |
Heatmap
Heatmap — a generic grid of value-coloured cells on a low→high gradient.
Presentational and domain-agnostic: pass a row-major matrix of cells and an optional [min, max] range (auto-derived otherwise). Use renderCell to overlay domain content (socket borders, selection, tooltips) without forking the primitive — the grid still owns each cell's background colour. Pair with HeatmapLegend for a gradient scale
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Required | HeatmapCell[][] | - | Rows of cells (row-major). Rows may be ragged |
ariaLabel | Optional | string | "Heatmap" | Accessible label for the grid |
className | Optional | string | - | Additional class for the root element |
colors | Optional | readonly string[] | HEATMAP_GRADIENT | Gradient stops low→high. Defaults to the cold→hot HEATMAP_GRADIENT |
emptyColor | Optional | string | #000000 | Colour used for null cells |
max | Optional | number | auto | Range ceiling (maps to the last gradient stop); auto-derived from the finite values when omitted |
min | Optional | number | auto | Range floor (maps to the first gradient stop); auto-derived from the finite values when omitted |
renderCell | Optional | ((cell: HeatmapCell, context: HeatmapCellContext) => React.ReactNode) | - | Override the cell's inner content — e.g. to overlay socket borders, selection, or tooltips for a PDU grid. The primitive still owns the cell's background colour (passed via context.color) |
showValues | Optional | boolean | false | Render each cell's value/label as text |
HeatmapLegend
HeatmapLegend — a gradient bar with low/high scale labels, matching the gradient used by Heatmap
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
max | Required | string | number | - | Value (or pre-formatted label) at the high end of the scale |
min | Required | string | number | - | Value (or pre-formatted label) at the low end of the scale |
className | Optional | string | - | Additional class for the root element |
colors | Optional | readonly string[] | HEATMAP_GRADIENT | Gradient stops low→high |
label | Optional | string | - | Heading above the gradient bar (e.g. "Temperature") |
unit | Optional | string | - | Unit suffix appended to min/max |
LineChart
Customisable Chart.js line chart with built-in zoom, tooltip, and legend. Data is passed via props; the component does no fetching
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Required | LineChartData | - | Data of the chart |
backgroundColor | Optional | string | - | Background color of the chart |
beginAtZero | Optional | boolean | - | Starts the value axis at 0 |
chartRef | Optional | React.MutableRefObject<IChartApi | null> | - | Mutable ref to hold the LightWeightCharts reference |
customDateFormat | Optional | string | - | Custom date format |
customLabel | Optional | string | - | TODO: Doc |
disableAutoRange | Optional | boolean | - | Disable automatically determining range |
fadedBackground | Optional | boolean | - | Use a faded background |
fixedTimezone | Optional | string | - | Applies offset if provided, otherwise timestamps are assumed to already be in local time. Otherwise, use browser's current timezone offset for consistent time display |
height | Optional | number | 240 | Controls the height of the chart |
horizontalLineLabelVisible | Optional | boolean | - | Show horizontal line at mouse position |
priceFormatter | Optional | ((value: number) => string) | - | Callback to format ticks on y axis |
roundPrecision | Optional | number | - | The number of decimals to show |
shouldResetZoom | Optional | boolean | - | Wether to Reset Zoom |
showDateInTooltip | Optional | boolean | - | Show date line in tooltip |
showPointMarkers | Optional | boolean | - | Show a marker on the line |
skipMinWidth | Optional | boolean | - | Do not enforce a min width |
skipRound | Optional | boolean | - | Prevent rounding of values |
timeline | Optional | string | - | TODO: DOC |
uniformDistribution | Optional | boolean | - | Changes horizontal scale marks generation. With this flag equal to true, marks of the same weight are either all drawn or none are drawn at all |
unit | Optional | string | "" | The unit to display with values |
verticalLineLabelVisible | Optional | boolean | - | Show vertical line at mouse position |
yTicksFormatter | Optional | ((value: number) => string) | - | Callback to format ticks on y axis. If priceFormatter is given. It would be used instead |
LineChartData
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
datasets | Required | LineDataset[] | - | One line series per entry; visible: false hides a series without removing it |
LineChartCard
Composable line-chart card with title, timeline range selector, legend (basic or detailed), error boundary, and an optional min/max/avg footer.
Accepts either pre-shaped data or rawData + a dataAdapter callback so upstream domain components can keep their data wrangling local
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
chartProps | Optional | Partial<LightWeightLineChartProps> | - | Pass-through props to the core LineChart |
chartRef | Optional | React.MutableRefObject<IChartApi | null> | - | Ref to the lightweight-charts IChartApi |
className | Optional | string | - | Custom class name |
data | Optional | LineChartCardData | - | Pre-adapted chart data (use this OR rawData+dataAdapter) |
dataAdapter | Optional | (data: unknown) => LineChartCardData | - | Adapter to transform rawData into LineChartCardData |
defaultTimeline | Optional | string | first option | Default timeline when uncontrolled |
detailLegends | Optional | boolean | false | Show detail legends with current values |
headerAction | Optional | React.ReactNode | - | Optional action rendered on the right of the card header (e.g. an expand toggle). Passed straight through to ChartContainer. Additive - omit it and the card header is unchanged |
isLoading | Optional | boolean | false | Loading state |
minHeight | Optional | string | number | 350 | Minimum chart height |
onTimelineChange | Optional | (timeline: string) => void | - | Callback when timeline changes |
rawData | Optional | unknown | - | Raw data to be transformed by dataAdapter |
shouldResetZoom | Optional | boolean | true | Whether to reset zoom on timeline change (default: true) |
timeline | Optional | string | - | Controlled timeline value |
timelineOptions | Optional | TimelineOption[] | - | Timeline range selector options |
title | Optional | string | - | Chart title |
titleExtra | Optional | React.ReactNode | - | Optional node rendered next to the title (e.g. an info tooltip). Passed straight through to ChartContainer. Additive |
TimelineOption
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
label | Required | string | - | Range-selector button text |
value | Required | string | - | Timeline key (e.g. 5m, 1h) passed to onTimelineChange and matched against timeline |
disabled | Optional | boolean | - | Not forwarded to the range selector; currently has no effect |
MinMaxAvg
Min / Max / Avg summary row with consistent MDK label and value styling
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
avg | Optional | string | - | Average value (hidden if empty) |
className | Optional | string | - | Additional root class |
max | Optional | string | - | Maximum value (hidden if empty) |
min | Optional | string | - | Minimum value (hidden if empty) |
OperationsEnergyCostChart
Doughnut breakdown of Operations vs Energy cost (USD per MWh). Wraps ChartContainer and DoughnutChart; pass operationalCostsUSD and energyCostsUSD via data
agent-ready
Source
src/primitives/components/operations-energy-cost-chart/USAGE.md
src/primitives/components/operations-energy-cost-chart/index.tsx
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
className | Optional | string | - | Extra class on the container |
data | Optional | Partial<{ energyCostsUSD: number; operationalCostsUSD: number }> | - | operationalCostsUSD and energyCostsUSD |
emptyMessage | Optional | string | - | Message when both costs are zero or missing |
height | Optional | number | 200 | Doughnut height in pixels |
isLoading | Optional | boolean | false | Shows loading overlay on the chart area |
title | Optional | string | "Operations vs Energy Cost" | Chart title |
unit | Optional | string | $/MWh | Subtitle and tooltip unit label |
PowerModeTimelineChart
Timeline chart for power-mode state changes over time. Wraps TimelineChart with mining-specific data shaping
agent-ready
Source
src/domain/components/dashboard/power-mode-timeline-chart/USAGE.md
src/domain/components/dashboard/power-mode-timeline-chart/power-mode-timeline-chart.tsx
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
data | Optional | PowerModeTimelineEntry[] | [] | Initial power-mode entries (each with start/end ts + mode) |
dataUpdates | Optional | PowerModeTimelineEntry[] | [] | Streaming updates appended to the initial data |
isLoading | Optional | boolean | false | Show a loading skeleton instead of the chart |
timezone | Optional | string | "UTC" | IANA timezone string for x-axis tick formatting |
title | Optional | string | CHART_TITLES.POWER_MODE_TIMELINE | Chart title |
PowerModeTimelineEntry
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
power_mode_group_aggr | Optional | Record<string, string> | - | Power mode keyed by miner; takes precedence over the miner's status for the bar's mode |
status_group_aggr | Optional | Record<string, string> | - | Status keyed by miner; its keys decide which miners get a row, and an entry without it adds nothing |
ts | Optional | number | - | Sample time (epoch ms); consecutive samples with the same mode merge into one bar |
ThresholdLineChart
Line chart with optional horizontal threshold lines. Wraps ChartContainer and LineChart; pass series and optional thresholds via data
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
className | Optional | string | - | Extra class on the container |
data | Optional | ThresholdLineChartData | - | series points plus optional thresholds lines |
emptyMessage | Optional | string | - | Message when data is missing or all zero |
height | Optional | number | 280 | Chart height in pixels (360 when isTall) |
isLegendVisible | Optional | boolean | true | Legend with click-to-hide series |
isTall | Optional | boolean | false | When true, uses a taller default height (360px) |
title | Optional | string | - | Chart title (unit appended when unit is set) |
unit | Optional | string | - | Shown in title and axis/tooltip formatting |
yTicksFormatter | Optional | (value: number) => string | - | Custom Y-axis tick labels |
ThresholdLineChartData
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
series | Required | ThresholdLineChartSeries[] | - | Data lines; points with a non-finite timestamp are dropped. All-zero values render the empty state |
thresholds | Optional | ThresholdLineChartThreshold[] | - | Horizontal reference lines at a fixed value, spanning every timestamp in series |
TimelineChart
Discrete-event timeline chart (e.g. miner state over time) with a category legend. Supports streaming updates via newData
agent-ready
Props
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
initialData | Required | TimelineChartData | - | Initial timeline data |
axisTitleText | Optional | AxisTitleText | { x: "Time", y: "" } | Axis title strings |
height | Optional | number | - | Chart pixel height |
isLoading | Optional | boolean | false | Show loader |
newData | Optional | TimelineChartData | - | Streaming updates appended to the initial data |
range | Optional | ChartRange | - | Visible time window |
skipUpdates | Optional | boolean | false | Ignore newData |
title | Optional | string | - | Chart title |
TimelineChartData
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
datasets | Required | TimelineChartDataset[] | - | Bar series; each dataset's label is its tooltip title and legend entry |
labels | Required | string[] | - | Row labels, one row each; a data point lands in the row whose label equals its y. Nothing renders when empty |
ChartRange
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
max | Required | number | Date | - | Right edge of the time axis (Date or epoch ms) |
min | Required | number | Date | - | Left edge of the time axis (Date or epoch ms); without a range the axis spans the data |
AxisTitleText
| Prop | Status | Type / Options | Default | Description |
|---|---|---|---|---|
x | Required | string | - | Title under the time axis; hidden when empty |
y | Required | string | - | Title beside the row labels; hidden when empty |