MDK Logo

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-foundation

Install 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

  • minMaxAvg and timeRange are 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>
  )
}
@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

Source

src/primitives/components/area-chart/USAGE.md

src/primitives/components/area-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredChartData<"line", (number | Point | null)[], unknown>-Chart data - required, provided by parent
classNameOptionalstring-Additional class names
heightOptionalnumber300Chart height in pixels
optionsOptionalobject-Chart.js options - merged with defaults
tooltipOptionalChartTooltipConfig-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

Source

src/primitives/components/average-downtime-chart/USAGE.md

src/primitives/components/average-downtime-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
barWidthOptionalnumber38Max bar thickness
classNameOptionalstring-Extra class on the container
dataOptionalAverageDowntimeChartData-Period labels and rate arrays (fractions 0–1)
emptyMessageOptionalstring-Message when there are no period labels or rate series
heightOptionalnumber280Chart height in pixels
isLoadingOptionalbooleanfalseShows loading overlay
showDataLabelsOptionalbooleanfalseShow values above stacked bars
titleOptionalstring"Monthly Average Downtime"Chart title (unit renders on its own line below)
unitOptionalstring%Unit subtitle under the title
yTicksFormatterOptional(value: number) => string-Formats Y-axis ticks, tooltips, and bar data labels (values are 0–1 rates). Defaults to rate × 100 via formatNumber
AverageDowntimeChartData
PropStatusType / OptionsDefaultDescription
labelsRequiredstring[]-X-axis period labels, one per bar; empty renders the empty state
curtailmentOptionalnumber[]-"Curtailment" downtime rate per period, as a fraction (0–1), aligned to labels
operationalIssuesOptionalnumber[]-"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

Source

src/primitives/components/bar-chart/USAGE.md

src/primitives/components/bar-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredany-Chart data - required, provided by parent. Use as any for mixed bar+line datasets
classNameOptionalstring-Additional class for the wrapper div
formatDataLabelOptional((value: number) => string)-Format data label values (default: round to nearest integer)
formatYLabelOptional((value: number) => string)-Format Y-axis tick labels
heightOptionalnumber300Chart height in pixels
isHorizontalOptionalbooleanfalseRender bars horizontally (indexAxis: 'y')
isStackedOptionalbooleanfalseStack bars on top of each other
legendAlignOptional"center" | "start" | "end""start"Alignment of the legend labels within their position
legendPositionOptional"left" | "right" | "top" | "bottom""top"Position of the legend
optionsOptionalobject-Chart.js options - merged with defaults
showDataLabelsOptionalbooleanfalseShow values above each bar
showLegendOptionalbooleantrueShow built-in Chart.js legend
tooltipOptionalChartTooltipConfig-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

Source

src/primitives/components/chart-container/USAGE.md

src/primitives/components/chart-container/index.tsx

Props

PropStatusType / OptionsDefaultDescription
childrenRequiredReact.ReactNode-The chart element to render
classNameOptionalstring-Additional class for the root element
emptyOptionalboolean-Hides the chart and shows emptyMessage
emptyMessageOptionalReact.ReactNode"No data available"Message shown when empty is true: a string, or any element (an EmptyState, say)
footerOptionalReact.ReactNode-Custom footer content rendered below the chart
footerClassNameOptionalstring-Additional class for the footer area
headerOptionalReact.ReactNode-Replaces the default title heading with a custom element
headerActionOptionalReact.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
highlightedValueOptionalHighlightedValueProps-Large value/unit displayed alongside the legend
legendDataOptionalLegendItem[]-Color-keyed legend items; each item can be toggled
loaderOptionalReact.ReactNode-Replaces the default <Loader> in the loading overlay
loadingOptionalboolean-Shows a centered <Loader> overlay
minMaxAvgOptionalPartial<{ min: string; max: string; avg: string }>-Built-in footer showing Min / Avg / Max values
onToggleDatasetOptional((index: number) => void)-Fired when a legend item is clicked
rangeSelectorOptionalRangeSelectorProps-Radio-card time-range selector
timeRangeOptionalstring-Time range label shown in the footer
titleOptionalstring-Chart heading (renders as <h3> unless header is provided)
titleExtraOptionalReact.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
PropStatusType / OptionsDefaultDescription
colorRequiredstring-Color string (hex, hsl, etc.)
labelRequiredstring-Legend label
hiddenOptionalboolean-Whether this dataset is currently hidden
HighlightedValueProps
PropStatusType / OptionsDefaultDescription
valueRequiredstring | number-The primary value to display
classNameOptionalstring-Additional class
styleOptionalReact.CSSProperties-Inline style
unitOptionalstring-Unit suffix
RangeSelectorProps
PropStatusType / OptionsDefaultDescription
onChangeRequired(value: string) => void-Fires when user picks a range
optionsRequiredRangeSelectorOption[]-{ label, value } items
valueRequiredstring-Currently selected value
buttonClassNameOptionalstring-Additional class for each option button
classNameOptionalstring-Additional class for the selector
styleOptionalReact.CSSProperties-Inline style for the selector

ChartStatsFooter

ChartStatsFooter - Displays Min/Max/Avg values and optional stats grid below a chart

agent-ready

Source

src/primitives/components/chart-stats-footer/USAGE.md

src/primitives/components/chart-stats-footer/index.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Custom class name
minMaxAvgOptionalPartial<{ min: string; max: string; avg: string }>-Min/Max/Avg values row
secondaryLabelOptionalSecondaryLabel-Secondary label displayed below stats
statsOptionalChartStatsFooterItem[]-Additional stats displayed in a columnar grid
statsPerColumnOptionalnumber1Number of stat items per column (default: 1)
ChartStatsFooterItem
PropStatusType / OptionsDefaultDescription
labelRequiredstring-Stat label
valueRequiredstring | number-Stat value
SecondaryLabel
PropStatusType / OptionsDefaultDescription
titleRequiredstring-Label text
valueRequiredstring | number-Value text

DetailLegend

DetailLegend - Enhanced chart legend with current values and percentage change indicators

agent-ready

Source

src/primitives/components/detail-legend/USAGE.md

src/primitives/components/detail-legend/index.tsx

Props

PropStatusType / OptionsDefaultDescription
itemsRequiredDetailLegendItem[]-Legend items to display
classNameOptionalstring-Custom class name
onToggleOptional((label: string, index: number) => void)-Callback when a legend item is toggled
DetailLegendItem
PropStatusType / OptionsDefaultDescription
colorRequiredstring-Hex color for the default swatch (border, plus 20% opacity fill) and the color of a custom icon
labelRequiredstring-Display label; also passed to onToggle
currentValueOptional{ value: string | number; unit?: string }-Value shown below the label, numbers formatted, with optional unit; also the row that holds percentChange
hiddenOptionalboolean-Dims the item (30% opacity) to show its dataset is hidden
iconOptionalReact.ReactNode-Custom icon replacing the default color swatch
percentChangeOptionalnumber | 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

Source

src/primitives/components/doughnut-chart/USAGE.md

src/primitives/components/doughnut-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredDoughnutChartDataset[]-Array of labelled slices
borderWidthOptionalnumber4Border width between segments (default: 4)
classNameOptionalstring-Additional class for the root element
cutoutOptionalstring"75%"Doughnut cutout percentage (default: '75%')
formatValueOptional((value: number) => string)-Formats slice values in the built-in legend and default tooltip (default: raw number)
heightOptionalnumber260Chart height in pixels
legendPositionOptional"left" | "right" | "top" | "bottom""top"Where to place the legend relative to the chart (default: 'top')
optionsOptionalobject-Chart.js options – merged with defaults
tooltipOptionalChartTooltipConfig-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
unitOptionalstring""Unit suffix appended to values in tooltips and legends
DoughnutChartDataset
PropStatusType / OptionsDefaultDescription
labelRequiredstring-Slice label
valueRequirednumber-Numeric slice value
colorOptionalstring-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

Source

src/primitives/components/gauge-chart/USAGE.md

src/primitives/components/gauge-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
percentRequirednumber-Value between 0 and 1 (e.g. 0.75 = 75%). Values outside the range are clamped
arcsLengthOptionalnumber[]-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
arcWidthOptionalnumber0.2Arc thickness as a fraction of the gauge radius (0–1)
classNameOptionalstring-Additional class for the root div
colorsOptionalstring[][COLOR.GREEN, COLOR.RED]Arc colours in HEX format
formatTextValueOptional((percent: number) => string)-Format the center label from the clamped fraction (0–1)
heightOptionalstring | number200Chart height in pixels or any CSS length (e.g. '200px' or '50%')
hideNeedleOptionalbooleanfalseHide the needle + hub (e.g. for a progress-style gauge)
hideTextOptionalbooleanfalseHide the percentage text rendered inside the gauge
idOptionalstring"mdk-gauge-chart"Stable id used for the gauge's accessibility labels
maxWidthOptionalnumber-Maximum width in pixels
needleColorOptionalstringCOLOR.STEEL_GRAYNeedle + hub colour
nrOfLevelsOptionalnumber3Number 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

Source

src/primitives/components/heatmap/USAGE.md

src/primitives/components/heatmap/index.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredHeatmapCell[][]-Rows of cells (row-major). Rows may be ragged
ariaLabelOptionalstring"Heatmap"Accessible label for the grid
classNameOptionalstring-Additional class for the root element
colorsOptionalreadonly string[]HEATMAP_GRADIENTGradient stops low→high. Defaults to the cold→hot HEATMAP_GRADIENT
emptyColorOptionalstring#000000Colour used for null cells
maxOptionalnumberautoRange ceiling (maps to the last gradient stop); auto-derived from the finite values when omitted
minOptionalnumberautoRange floor (maps to the first gradient stop); auto-derived from the finite values when omitted
renderCellOptional((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)
showValuesOptionalbooleanfalseRender 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

Source

src/primitives/components/heatmap/USAGE.md

src/primitives/components/heatmap/heatmap-legend.tsx

Props

PropStatusType / OptionsDefaultDescription
maxRequiredstring | number-Value (or pre-formatted label) at the high end of the scale
minRequiredstring | number-Value (or pre-formatted label) at the low end of the scale
classNameOptionalstring-Additional class for the root element
colorsOptionalreadonly string[]HEATMAP_GRADIENTGradient stops low→high
labelOptionalstring-Heading above the gradient bar (e.g. "Temperature")
unitOptionalstring-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

Source

src/primitives/components/line-chart/USAGE.md

src/primitives/components/line-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
dataRequiredLineChartData-Data of the chart
backgroundColorOptionalstring-Background color of the chart
beginAtZeroOptionalboolean-Starts the value axis at 0
chartRefOptionalReact.MutableRefObject<IChartApi | null>-Mutable ref to hold the LightWeightCharts reference
customDateFormatOptionalstring-Custom date format
customLabelOptionalstring-TODO: Doc
disableAutoRangeOptionalboolean-Disable automatically determining range
fadedBackgroundOptionalboolean-Use a faded background
fixedTimezoneOptionalstring-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
heightOptionalnumber240Controls the height of the chart
horizontalLineLabelVisibleOptionalboolean-Show horizontal line at mouse position
priceFormatterOptional((value: number) => string)-Callback to format ticks on y axis
roundPrecisionOptionalnumber-The number of decimals to show
shouldResetZoomOptionalboolean-Wether to Reset Zoom
showDateInTooltipOptionalboolean-Show date line in tooltip
showPointMarkersOptionalboolean-Show a marker on the line
skipMinWidthOptionalboolean-Do not enforce a min width
skipRoundOptionalboolean-Prevent rounding of values
timelineOptionalstring-TODO: DOC
uniformDistributionOptionalboolean-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
unitOptionalstring""The unit to display with values
verticalLineLabelVisibleOptionalboolean-Show vertical line at mouse position
yTicksFormatterOptional((value: number) => string)-Callback to format ticks on y axis. If priceFormatter is given. It would be used instead
LineChartData
PropStatusType / OptionsDefaultDescription
datasetsRequiredLineDataset[]-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

Source

src/domain/components/line-chart-card/USAGE.md

src/domain/components/line-chart-card/index.tsx

Props

PropStatusType / OptionsDefaultDescription
chartPropsOptionalPartial<LightWeightLineChartProps>-Pass-through props to the core LineChart
chartRefOptionalReact.MutableRefObject<IChartApi | null>-Ref to the lightweight-charts IChartApi
classNameOptionalstring-Custom class name
dataOptionalLineChartCardData-Pre-adapted chart data (use this OR rawData+dataAdapter)
dataAdapterOptional(data: unknown) => LineChartCardData-Adapter to transform rawData into LineChartCardData
defaultTimelineOptionalstringfirst optionDefault timeline when uncontrolled
detailLegendsOptionalbooleanfalseShow detail legends with current values
headerActionOptionalReact.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
isLoadingOptionalbooleanfalseLoading state
minHeightOptionalstring | number350Minimum chart height
onTimelineChangeOptional(timeline: string) => void-Callback when timeline changes
rawDataOptionalunknown-Raw data to be transformed by dataAdapter
shouldResetZoomOptionalbooleantrueWhether to reset zoom on timeline change (default: true)
timelineOptionalstring-Controlled timeline value
timelineOptionsOptionalTimelineOption[]-Timeline range selector options
titleOptionalstring-Chart title
titleExtraOptionalReact.ReactNode-Optional node rendered next to the title (e.g. an info tooltip). Passed straight through to ChartContainer. Additive
TimelineOption
PropStatusType / OptionsDefaultDescription
labelRequiredstring-Range-selector button text
valueRequiredstring-Timeline key (e.g. 5m, 1h) passed to onTimelineChange and matched against timeline
disabledOptionalboolean-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

Source

src/primitives/components/min-max-avg/USAGE.md

src/primitives/components/min-max-avg/index.tsx

Props

PropStatusType / OptionsDefaultDescription
avgOptionalstring-Average value (hidden if empty)
classNameOptionalstring-Additional root class
maxOptionalstring-Maximum value (hidden if empty)
minOptionalstring-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

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Extra class on the container
dataOptionalPartial<{ energyCostsUSD: number; operationalCostsUSD: number }>-operationalCostsUSD and energyCostsUSD
emptyMessageOptionalstring-Message when both costs are zero or missing
heightOptionalnumber200Doughnut height in pixels
isLoadingOptionalbooleanfalseShows loading overlay on the chart area
titleOptionalstring"Operations vs Energy Cost"Chart title
unitOptionalstring$/MWhSubtitle 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

PropStatusType / OptionsDefaultDescription
dataOptionalPowerModeTimelineEntry[][]Initial power-mode entries (each with start/end ts + mode)
dataUpdatesOptionalPowerModeTimelineEntry[][]Streaming updates appended to the initial data
isLoadingOptionalbooleanfalseShow a loading skeleton instead of the chart
timezoneOptionalstring"UTC"IANA timezone string for x-axis tick formatting
titleOptionalstringCHART_TITLES.POWER_MODE_TIMELINEChart title
PowerModeTimelineEntry
PropStatusType / OptionsDefaultDescription
power_mode_group_aggrOptionalRecord<string, string>-Power mode keyed by miner; takes precedence over the miner's status for the bar's mode
status_group_aggrOptionalRecord<string, string>-Status keyed by miner; its keys decide which miners get a row, and an entry without it adds nothing
tsOptionalnumber-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

Source

src/primitives/components/threshold-line-chart/USAGE.md

src/primitives/components/threshold-line-chart/index.tsx

Props

PropStatusType / OptionsDefaultDescription
classNameOptionalstring-Extra class on the container
dataOptionalThresholdLineChartData-series points plus optional thresholds lines
emptyMessageOptionalstring-Message when data is missing or all zero
heightOptionalnumber280Chart height in pixels (360 when isTall)
isLegendVisibleOptionalbooleantrueLegend with click-to-hide series
isTallOptionalbooleanfalseWhen true, uses a taller default height (360px)
titleOptionalstring-Chart title (unit appended when unit is set)
unitOptionalstring-Shown in title and axis/tooltip formatting
yTicksFormatterOptional(value: number) => string-Custom Y-axis tick labels
ThresholdLineChartData
PropStatusType / OptionsDefaultDescription
seriesRequiredThresholdLineChartSeries[]-Data lines; points with a non-finite timestamp are dropped. All-zero values render the empty state
thresholdsOptionalThresholdLineChartThreshold[]-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

Source

src/domain/components/timeline-chart/USAGE.md

src/domain/components/timeline-chart/timeline-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
initialDataRequiredTimelineChartData-Initial timeline data
axisTitleTextOptionalAxisTitleText{ x: "Time", y: "" }Axis title strings
heightOptionalnumber-Chart pixel height
isLoadingOptionalbooleanfalseShow loader
newDataOptionalTimelineChartData-Streaming updates appended to the initial data
rangeOptionalChartRange-Visible time window
skipUpdatesOptionalbooleanfalseIgnore newData
titleOptionalstring-Chart title
TimelineChartData
PropStatusType / OptionsDefaultDescription
datasetsRequiredTimelineChartDataset[]-Bar series; each dataset's label is its tooltip title and legend entry
labelsRequiredstring[]-Row labels, one row each; a data point lands in the row whose label equals its y. Nothing renders when empty
ChartRange
PropStatusType / OptionsDefaultDescription
maxRequirednumber | Date-Right edge of the time axis (Date or epoch ms)
minRequirednumber | Date-Left edge of the time axis (Date or epoch ms); without a range the axis spans the data
AxisTitleText
PropStatusType / OptionsDefaultDescription
xRequiredstring-Title under the time axis; hidden when empty
yRequiredstring-Title beside the row labels; hidden when empty

On this page