MDK Logo

Chart

Data visualization and chart components

Components for data visualization and charting.

Prerequisites

  • Complete the installation

  • Add the dependency to your app's package.json
{
  "dependencies": {
    "@tetherto/mdk-react-devkit": "*",
    "@tetherto/mdk-react-adapter": "*",
    "@tetherto/mdk-ui-foundation": "*"
  }
}

Run npm install from the mdk/ui workspace root after your app is under apps/ so npm links workspace packages.

  • 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.

Prop data shapes

Props are generated from this component's TypeScript types, the source of truth. The following are supplementary (object-prop shapes, allowed values, or passthrough props), not the full prop list.

LegendItem

FieldTypeRequiredDescription
labelstringyesLegend label
colorstringyesColor string (hex, hsl, etc.)
hiddenbooleannoWhether this dataset is currently hidden

HighlightedValueProps

FieldTypeRequiredDescription
valuestring | numberyesThe primary value to display
unitstringnoUnit suffix
classNamestringnoAdditional class
styleReact.CSSPropertiesnoInline style

RangeSelectorProps

FieldTypeRequiredDescription
optionsRangeSelectorOption[]yes{ label, value } items
valuestringyesCurrently selected value
onChange(value: string) => voidyesFires when user picks a range

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.

ActualEbitdaCard

Stat card summarising the realised EBITDA for the selected reporting window vs the prior period

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/actual-ebitda-card.tsx

Props

PropStatusType / OptionsDefaultDescription
valueRequirednumber--

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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

AvgAllInCostChart

Avg All-in Cost - revenue vs cost ($/MWh) bar chart over time.

Renders the OSS SiteEnergyVsCostChart. The revenue/cost time-series isn't carried by the cost-summary response, so consumers feed it through as a separate prop (the OSS app sources it from useAvgAllInPowerCostData)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/avg-all-in-cost-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeRequiredFinancialDateRange | null--
dataOptionalreadonly AvgAllInCostDataPoint[]--
isLoadingOptionalboolean--

BarChart

Presentational Chart.js bar chart. Data must be pre-aggregated; use grouped or stacked categories via datasets

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

BitcoinPriceCard

Stat card showing the BTC reference price used by the reporting view with currency and timestamp

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/bitcoin-price-card.tsx

Props

PropStatusType / OptionsDefaultDescription
valueRequirednumber--

BitcoinProducedCard

Stat card summarising the bitcoin produced during the reporting window with delta to prior period

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/bitcoin-produced-card.tsx

Props

PropStatusType / OptionsDefaultDescription
valueRequirednumber--

BitcoinProducedChart

Time-series chart of bitcoin produced per day across the selected reporting window

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/bitcoin-produced-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
chartDataRequiredBarChartDataResult--
hasAllZerosOptionalboolean--
heightOptionalnumber--
isLoadingOptionalboolean--

BitcoinProductionCostCard

Stat card showing the average cost in USD to produce one bitcoin during the reporting window

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/bitcoin-production-cost-card.tsx

Props

PropStatusType / OptionsDefaultDescription
valueRequirednumber--

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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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
emptyMessageOptionalstring"No data available"Message shown when empty is true
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
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

ChartExpandAction

Expand / collapse toggle rendered in a dashboard chart card's header. Swaps between a maximize and a minimize glyph based on isExpanded

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/chart-expand-action.tsx

Props

PropStatusType / OptionsDefaultDescription
isExpandedRequiredboolean-Whether the parent chart is currently expanded to full width
onToggleOptionalVoidFunction-Toggles the expanded state

ChartStatsFooter

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

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/primitives/components/chart-stats-footer/USAGE.md#props-detail

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)

CostCharts

Convenience wrapper that renders the three cost-page charts in declaration order. Pages that need bespoke layouts (e.g. CostContent's 2x2 Mosaic) compose the individual chart components directly instead

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/cost-charts.tsx

Props

PropStatusType / OptionsDefaultDescription
btcPriceLogRequiredreadonly BtcPriceTimeSeriesEntry[]--
costLogRequiredreadonly CostTimeSeriesEntry[]--
dateRangeRequiredFinancialDateRange | null--
totalsRequiredCostSummaryMonetaryTotals | null--
avgAllInCostDataOptionalreadonly AvgAllInCostDataPoint[]--
isLoadingOptionalboolean--

DetailLegend

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

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/primitives/components/detail-legend/USAGE.md#props-detail

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

DoughnutChart

DoughnutChart – Presentational Chart.js doughnut chart with custom HTML legend matching the MDK design

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/primitives/components/doughnut-chart/USAGE.md#props-detail

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

Ebitda

Top-level EBITDA section of the reporting view — pulls together metric cards, charts, and tables

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/ebitda.tsx

Props

PropStatusType / OptionsDefaultDescription
btcProducedChartInputRequiredToBarChartDataInput | null-Data for the BTC produced chart
currentBTCPriceRequirednumber-Current Bitcoin price in USD
datePickerRequiredReact.ReactElement<unknown, string | React.JSXElementConstructor<any>>-Date picker element
ebitdaChartInputRequiredToBarChartDataInput | null-Data for the EBITDA bar chart
hasBtcProducedAllZerosRequiredboolean-Whether all BTC produced values are zero
hasDateSelectionRequiredboolean-When false, show the "select a period" hint instead of empty data
metricsRequiredEbitdaDisplayMetrics | null-Computed EBITDA metrics
showEbitdaBarChartRequiredboolean-Show the EBITDA bar chart
errorsOptionalstring[][]Error messages to display
isLoadingOptionalbooleanfalseLoading state
setCostHrefOptionalstring-Optional URL for the "Set Monthly Cost" control (hidden when omitted)

EbitdaCharts

Chart panel inside the EBITDA section visualising revenue, cost, and EBITDA over time

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/ebitda-charts.tsx

Props

PropStatusType / OptionsDefaultDescription
btcDisplayDataRequiredBarChartDataResult--
ebitdaChartDataRequiredBarChartDataResult--
hasBtcProducedAllZerosRequiredboolean--
isLoadingRequiredboolean--
showEbitdaBarChartRequiredboolean--

EbitdaHodlCard

Stat card projecting EBITDA assuming all produced bitcoin is held instead of sold

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/ebitda-hodl-card.tsx

Props

PropStatusType / OptionsDefaultDescription
currentBTCPriceRequirednumber--
valueRequirednumber--

EbitdaMetrics

Row of summary metric cards across the top of the EBITDA section (actual, hodl, selling, cost)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/ebitda-metrics.tsx

Props

PropStatusType / OptionsDefaultDescription
currentBTCPriceRequirednumber--
metricsRequiredEbitdaDisplayMetrics--

EbitdaSellingCard

Stat card projecting EBITDA assuming all produced bitcoin is sold at the daily reference price

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/ebitda-selling-card.tsx

Props

PropStatusType / OptionsDefaultDescription
valueRequirednumber--

EnergyBalance

Full energy balance view with tabbed revenue and cost sections, charts, and metric cards

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/energy-balance.tsx

Props

PropStatusType / OptionsDefaultDescription
onCostDisplayModeChangeRequired(mode: DisplayMode) => void-Called when the user toggles USD / BTC on the cost tab
onRevenueDisplayModeChangeRequired(mode: DisplayMode) => void-Called when the user toggles USD / BTC on the revenue tab
onTabChangeRequired(tab: EnergyBalanceTab) => void-Called when the user switches between Revenue and Cost tabs
viewModelRequiredEnergyBalanceViewModel-All display state: chart inputs, metrics, active tab, display modes, loading/error flags. Returned directly by useEnergyBalanceViewModel
isDemoModeOptionalbooleanfalseSuppresses error banners in demo/mock environments
setCostHrefOptionalstring-Optional URL for the "Set Monthly Cost" control (hidden when omitted)
timeframeControlsOptionalReact.ReactNode-Slot for timeframe / date-range controls rendered by the host app

EnergyBalanceCostCharts

Layout container for the energy cost tab charts: revenue-vs-cost bar chart and power line chart

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/energy-balance-cost-charts.tsx

Props

PropStatusType / OptionsDefaultDescription
barLabelFormatterRequired(v: number) => string--
btcUnitRequiredstring | null--
costChartDataRequiredBarChartDataResult--
displayModeRequired"BTC" | "USD"--
onDisplayModeChangeRequired(mode: DisplayMode) => void--
periodTypeRequired"month" | "week" | "day"--
powerChartInputRequiredThresholdLineChartInput--
showCostBarChartRequiredboolean-Show the revenue-vs-cost bar chart only for non-daily periods

EnergyBalanceCostMetrics

Grid of stat cards summarising energy cost metrics for the selected period

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/energy-balance-cost-metrics.tsx

Props

PropStatusType / OptionsDefaultDescription
metricsRequiredEnergyCostMetrics--

EnergyBalancePowerChart

Line chart visualising power consumption against threshold for the energy balance view

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/components/energy-balance-power-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
chartInputRequiredThresholdLineChartInput-Series and optional threshold line for power vs availability
periodTypeRequired"month" | "week" | "day"-Controls x-axis date formatting (month uses MM-yy)
fillHeightOptionalbooleanfalseStretch the panel and chart to fill a mosaic cell (uses height 320 and mdk-energy-balance__panel--fill). Used on the revenue tab power column in EnergyBalanceRevenueCharts
heightOptionalnumber280Chart height when fillHeight is false

EnergyBalanceRevenueCharts

Mosaic layout of revenue, downtime, and power charts for the energy balance revenue tab

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/energy-balance-revenue-charts.tsx

Props

PropStatusType / OptionsDefaultDescription
averageDowntimeDataRequiredAverageDowntimeChartData--
barLabelFormatterRequired(v: number) => string--
displayModeRequired"BTC" | "USD"--
onDisplayModeChangeRequired(mode: DisplayMode) => void--
periodTypeRequired"month" | "week" | "day"--
powerChartInputRequiredThresholdLineChartInput--
revenueChartDataRequiredBarChartDataResult--
revenueMetricsRequiredEnergyRevenueMetrics--

EnergyBalanceRevenueMetrics

Grid of stat cards summarising energy revenue metrics for the selected period

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/energy-balance-revenue-metrics.tsx

Props

PropStatusType / OptionsDefaultDescription
metricsRequiredEnergyRevenueMetrics--

EnergyCostChart

Bar chart comparing site revenue vs cost per MWh, with USD/BTC currency toggle

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/components/energy-cost-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
barLabelFormatterRequired(v: number) => string--
btcUnitRequiredstring | null--
chartDataRequiredBarChartDataResult--
displayModeRequired"BTC" | "USD"--
onDisplayModeChangeRequired(mode: DisplayMode) => void--
heightOptionalnumber--

EnergyMetricCard

Stat card for a single energy balance metric

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/components/energy-metric-card.tsx

Props

PropStatusType / OptionsDefaultDescription
nameRequiredstring-Metric label shown on the card
unitRequiredstring-Unit suffix shown next to the value
valueRequirednumber-Metric value, formatted via formatNumber
fallbackOptionalstring-Text shown when value can't be formatted

EnergyReportMinerTypeView

Energy report — power consumption grouped by miner model (latest day in range)

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/operational/energy-report/miner-type-view/miner-type-view.tsx

Props

PropStatusType / OptionsDefaultDescription
containersOptionalContainer[]--
groupedConsumptionOptionalMetricsConsumptionGroupedResponse--
isLoadingOptionalboolean--
onTimeFrameChangeOptional((start: Date, end: Date) => void)--

EnergyReportMinerUnitView

Energy report — power consumption grouped by mining unit / container

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/operational/energy-report/miner-unit-view/miner-unit-view.tsx

Props

PropStatusType / OptionsDefaultDescription
containersOptionalContainer[]--
groupedConsumptionOptionalMetricsConsumptionGroupedResponse--
isLoadingOptionalboolean--
onTimeFrameChangeOptional((start: Date, end: Date) => void)--

EnergyReportSiteView

Energy report site tab — power trend, power-mode table, and per–mining-unit activity cards

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/composite/reporting-tool/operational/energy-report/site-view/site-view.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeRequiredEnergyReportDateRange--
consumptionErrorOptionalunknown--
consumptionFetchingOptionalboolean--
consumptionLoadingOptionalboolean--
consumptionLogOptionalMetricsConsumptionLogEntry[]--
containersOptionalEnergyReportContainer[]--
containersLoadingOptionalboolean--
nominalConfigLoadingOptionalboolean--
nominalPowerAvailabilityMwOptionalnumber | null--
onDateRangeChangeOptional((range: EnergyReportDateRange) => void)--
onRefetchSnapshotOptionalVoidFunction--
snapshotLoadingOptionalboolean--
tailLogOptionalEnergyReportTailLogItem[][]--
tailLogLoadingOptionalboolean--

EnergyRevenueChart

Bar chart showing site energy revenue per MWh, with USD/BTC currency toggle

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/energy-balance/components/energy-revenue-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
barLabelFormatterRequired(v: number) => string--
chartDataRequiredBarChartDataResult--
displayModeRequired"BTC" | "USD"--
onDisplayModeChangeRequired(mode: DisplayMode) => void--
heightOptionalnumber--

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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

Hashrate

Top-level hashrate reporting section - composes the site / miner-type / mining-unit drilldowns into a tabbed shell. Each tab fetches independently because the three views use different groupBy axes; the composite stitches them via per-tab prop bags

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/hashrate/hashrate.tsx

Props

PropStatusType / OptionsDefaultDescription
defaultTabOptional"site-view" | "miner-type-view" | "mining-unit-view""site-view"Tab selected on first render. Defaults to the Site View
minerTypeViewOptionalHashrateMinerTypeViewProps-Props forwarded to the Miner Type View tab
miningUnitViewOptionalHashrateMiningUnitViewProps-Props forwarded to the Mining Unit View tab
siteViewOptionalHashrateSiteViewProps-Props forwarded to the Site View tab

HashrateMinerTypeView

Hashrate drilldown grouped by miner model - bar chart of the latest hashrate per miner type, with an optional multi-select filter

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/hashrate/tabs/miner-type-view/miner-type-view.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeOptionalHashrateDateRange-Selected date range
isLoadingOptionalbooleanfalseDrives the chart spinner
logOptionalHashrateGroupedLog[]Hashrate log grouped by miner type (groupBy=miner)
onDateRangeChangeOptional((range: HashrateDateRange) => void)-Fires when the user picks a new range
onResetOptionalVoidFunction-Optional reset handler

HashrateMiningUnitView

Hashrate drilldown grouped by mining unit / container - bar chart of the latest hashrate per container with an optional multi-select filter. Drops BE-leaked rollup keys (group-N, maintenance) via the utils layer

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/hashrate/tabs/mining-unit-view/mining-unit-view.tsx

Props

PropStatusType / OptionsDefaultDescription
dateRangeOptionalHashrateDateRange-Selected date range
isLoadingOptionalbooleanfalseDrives the chart spinner
logOptionalHashrateGroupedLog[]Hashrate log grouped by container / mining unit (groupBy=container)
onDateRangeChangeOptional((range: HashrateDateRange) => void)-Fires when the user picks a new range
onResetOptionalVoidFunction-Optional reset handler

HashrateSiteView

Site-level hashrate trend - aggregates hashrate across the whole site for the selected date range, with an optional miner-type filter that scopes the sum to a subset

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/hashrate/tabs/site-view/USAGE.md#props-detail

Props

PropStatusType / OptionsDefaultDescription
dateRangeOptionalHashrateDateRange-Selected date range used by the host to drive the query
isLoadingOptionalbooleanfalseLoading state - drives the chart spinner
logOptionalHashrateGroupedLog[]Hashrate log grouped by miner type
onDateRangeChangeOptional((range: HashrateDateRange) => void)-Fires when the user picks a new range from the DateRangePicker
onResetOptionalVoidFunction-Optional reset handler shown as a "Reset" button next to the date picker

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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

MinMaxAvg

Min / Max / Avg summary row with consistent MDK label and value styling

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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)

MonthlyEbitdaChart

Bar chart comparing EBITDA across the most recent months for trend visualisation

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/ebitda/components/monthly-ebitda-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
chartDataRequiredBarChartDataResult--
heightOptionalnumber--

OperationalHashrateChart

Hashrate trend card for the operational dashboard. Renders the site hashrate over time (TH/s) with an optional nominal reference line, plus an expand toggle. Purely presentational - pass pre-shaped data from useOperationsDashboard

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/hashrate-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalLineChartCardData--
isExpandedOptionalboolean--
isLoadingOptionalboolean--
onToggleExpandOptionalVoidFunction--

OperationalMinersStatusChart

Miners-status card for the operational dashboard. Renders a stacked daily breakdown of miner states (online / error / offline / sleep / maintenance) with an expand toggle. Purely presentational - pass pre-shaped data from useOperationsDashboard

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/miners-status-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalMinersStatusChartData--
isExpandedOptionalboolean--
isLoadingOptionalboolean--
onToggleExpandOptionalVoidFunction--

OperationalPowerConsumptionChart

Power-consumption trend card for the operational dashboard. Renders site power draw over time (MW) with an optional power-availability reference line, plus an expand toggle. Purely presentational - pass pre-shaped data from useOperationsDashboard

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/power-consumption-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalLineChartCardData--
isExpandedOptionalboolean--
isLoadingOptionalboolean--
onToggleExpandOptionalVoidFunction--

OperationalSiteEfficiencyChart

Site-efficiency trend card for the operational dashboard. Renders measured site efficiency over time (W/TH/s) with an optional nominal reference line, an info tooltip, and an expand toggle. Purely presentational - pass pre-shaped data from useOperationsDashboard

advanced

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/operational/dashboard/site-efficiency-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalLineChartCardData--
isExpandedOptionalboolean--
isLoadingOptionalboolean--
onToggleExpandOptionalVoidFunction--

OperationsEnergyChart

Doughnut breakdown of Operations vs Energy cost (in USD totals).

Mirrors the OSS OperationsEnergyCostChart. Returns the empty-state placeholder when both totals are zero (the OSS chart hides both slices in that case)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/operations-energy-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
totalsRequiredCostSummaryMonetaryTotals | null--
isLoadingOptionalboolean--

OperationsEnergyCostChart

Doughnut breakdown of Operations vs Energy cost (USD per MWh). Wraps ChartContainer and DoughnutChart; pass operationalCostsUSD and energyCostsUSD via data

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

ProductionCostChart

Production cost over time, overlaid with BTC price.

Mirrors the OSS ProductionCostPriceChart - both series rendered as bars on the same x-axis (bucket labels derived from dateRange.period)

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/cost/production-cost-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
btcPriceLogRequiredreadonly BtcPriceTimeSeriesEntry[]--
costLogRequiredreadonly CostTimeSeriesEntry[]--
dateRangeRequiredFinancialDateRange | null--
isLoadingOptionalboolean--

RevenueChart

Stacked bar chart displaying monthly revenue per site. Automatically switches between BTC and Sats display based on value scale. Receives pre-fetched data as props — no internal data fetching

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/src/domain/components/reporting-tool/financial/revenue-chart/revenue-chart.tsx

Props

PropStatusType / OptionsDefaultDescription
dataOptionalRevenueDataItem[][]Raw API response, each entry is one time period with site IDs as dynamic keys
isLoadingOptionalbooleanfalseShows a loading spinner while data is being fetched
legendAlignOptional"center" | "start" | "end""start"Chart legend alignment
legendPositionOptional"left" | "right" | "top" | "bottom""bottom"Chart legend position
siteListOptional(string | SiteItem)[][]List to resolve site IDs to display names

ThresholdLineChart

Line chart with optional horizontal threshold lines. Wraps ChartContainer and LineChart; pass series and optional thresholds via data

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

TimelineChart

Discrete-event timeline chart (e.g. miner state over time) with a category legend. Supports streaming updates via newData

agent-ready

Source

https://github.com/tetherto/mdk/blob/main/ui/packages/react-devkit/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

On this page