MDK Logo

PowerModeTimelineChart

Timeline chart for power-mode state changes over time. Wraps @link TimelineChart with mining-specific data shaping.

Timeline chart for power-mode state changes over time. Wraps {@link TimelineChart} with mining-specific data shaping.

import { PowerModeTimelineChart } from "@tetherto/mdk-react-devkit";
PropStatusTypeDefaultDescription
dataOptionalPowerModeTimelineEntry[]Initial power-mode entries (each with start/end ts + mode).
dataUpdatesOptionalPowerModeTimelineEntry[]Streaming updates appended to the initial data.
isLoadingOptionalbooleanShow a loading skeleton instead of the chart.
timezoneOptionalstringIANA timezone string for x-axis tick formatting.
titleOptionalstringChart title.

Usage

Timeline chart for power-mode state changes over time. Wraps TimelineChart with mining-specific data shaping.

Data contracts

PowerModeTimelineEntry lives in power-mode-timeline-chart.helper.ts.

Example

/** * Runnable example for PowerModeTimelineChart. */import { PowerModeTimelineChart } from '@tetherto/mdk-react-devkit'const NOW = Date.now() / 1000const HOUR = 60 * 60const mockEntries = [  { ts: NOW - 6 * HOUR, mode: 'normal', id: 'miner-01' },  { ts: NOW - 4 * HOUR, mode: 'boost', id: 'miner-01' },  { ts: NOW - 2 * HOUR, mode: 'normal', id: 'miner-01' },]export const PowerModeTimelineChartExample = () => {  return <PowerModeTimelineChart data={mockEntries as never} timezone="UTC" title="Power mode" />}