MDK Logo

Operational reporting

Operational reporting components — operational dashboard, energy consumption, and hashrate views

@tetherto/mdk-react-devkit/foundation

Operational reporting components cover a consolidated operations dashboard (OperationalDashboard), energy consumption (EnergyReport), and hashrate (Hashrate) views. Each is a self-contained reporting surface — supply your API data; the component handles layout, charts, and tab navigation.

For financial reporting see Financial. For operational efficiency see Operational efficiency.

Prerequisites

Components

ComponentDescription
EnergyReportOperational energy consumption reporting view
HashrateOperational hashrate reporting view
OperationalDashboard2×2 grid of site-operations charts (hashrate, power, efficiency, miners status)

OperationalDashboard

Composite operational dashboard showing a 2×2 grid of line-trend and stacked-bar charts. Each card can expand to full width; expand state persists across remounts. Pair with useOperationsDashboard to shape raw metric logs into chart-ready payloads.

Import

import { OperationalDashboard } from '@tetherto/mdk-react-devkit/foundation'
import type { OperationalDashboardProps, UseOperationsDashboardInput } from '@tetherto/mdk-react-devkit/foundation'

Props

All props are optional.

PropStatusTypeDefaultDescription
hashrateOptional{ data, isLoading }nonePre-shaped hashrate trend data from useOperationsDashboard
consumptionOptional{ data, isLoading }nonePre-shaped power-consumption trend data
efficiencyOptional{ data, isLoading }nonePre-shaped site-efficiency trend data
minersOptional{ data, isLoading }nonePre-shaped miners-status stacked-bar data
controlsOptionalReactElementnoneOptional slot rendered above the grid (for example a date-range picker)

Basic usage

import { OperationalDashboard, useOperationsDashboard } from '@tetherto/mdk-react-devkit/foundation'

function OperationsDashboardPage({ hashrateLog, consumptionLog, efficiencyLog, minersLog }) {
  const vm = useOperationsDashboard({
    hashrate: { log: hashrateLog, isLoading },
    consumption: { log: consumptionLog, isLoading },
    efficiency: { log: efficiencyLog, isLoading },
    miners: { log: minersLog, isLoading },
  })

  return (
    <OperationalDashboard
      hashrate={vm.hashrate}
      consumption={vm.consumption}
      efficiency={vm.efficiency}
      miners={vm.miners}
    />
  )
}

Behaviour

Renders a 2×2 grid of four LineChartCard-based chart cards: hashrate trend, power consumption trend, site efficiency trend, and miners status (stacked bar). Each card has an expand toggle that widens it to full grid width; expand state persists across remounts. Assumes a single OperationalDashboard instance is mounted at a time.

Styling

  • .mdk-operational-dashboard: Root element
  • .mdk-operational-dashboard__controls: Controls slot wrapper (only rendered when controls is supplied)
  • .mdk-operational-dashboard__grid: 2×2 chart grid
  • .mdk-operational-dashboard__cell: Individual chart cell
  • .mdk-operational-dashboard__cell--expanded: Modifier applied when a card is expanded to full width

EnergyReport

Multi-tab reporting surface for operational energy data: site view and miner-type breakdown charts.

Import

import { EnergyReport } from '@tetherto/mdk-react-devkit/foundation'
import type { EnergyReportProps, EnergyReportTabValue } from '@tetherto/mdk-react-devkit/foundation'

Props

PropStatusTypeDefaultDescription
defaultTabOptionalEnergyReportTabValue'site-view'Tab shown on first render — defaults to 'site-view'
siteViewOptionalHashrateSiteViewPropsnoneProps for the Site View tab
minerTypeViewOptionalHashrateMinerTypeViewPropsnoneProps for the Miner Type View tab
minerUnitViewOptionalEnergyReportMinerUnitViewPropsnoneProps for the Mining Unit View tab
classNameOptionalstringnoneOptional root class override

EnergyReportTabValue type

type EnergyReportTabValue = 'site-view' | 'miner-type-view' | 'miner-unit-view'

EnergyReportSiteViewProps key fields

type EnergyReportSiteViewProps = {
  consumptionLog?: MetricsConsumptionLogEntry[]  // power/consumption time-series
  nominalPowerAvailabilityMw?: number | null      // site nominal capacity
  containers?: EnergyReportContainer[]            // container inventory
  tailLog?: EnergyReportTailLogItem[][]           // snapshot tail-log for power-mode table
  dateRange?: EnergyReportDateRange               // controlled date range
  onDateRangeChange?: (range: EnergyReportDateRange) => void
}

Basic usage

import { EnergyReport } from '@tetherto/mdk-react-devkit/foundation'

export const EnergyReportPage = () => (
  <EnergyReport
    siteView={{
      consumptionLog: consumptionData,
      nominalPowerAvailabilityMw: 500,
      containers,
      tailLog,
    }}
    minerTypeView={{ groupedConsumption, containers }}
    minerUnitView={{ groupedConsumption: unitGroupedData, containers }}
  />
)

More examples

Behaviour

Renders a three-tab layout:

  • Site View — power consumption trend chart against nominal capacity, power-mode breakdown table per container. A DateRangePicker and Reset button appear above this tab only. Date range is managed internally unless siteView.dateRange is provided.
  • Miner Type View — consumption grouped by miner type as a bar chart with per-miner-type breakdown.
  • Mining Unit View — consumption grouped by mining unit as a bar chart.

Each tab fetches independently via its own prop bag.

Styling

  • .mdk-energy-report: Root element
  • .mdk-energy-report__date-controls: Date picker + Reset row (site view only)

Hashrate

Multi-tab reporting surface for fleet hashrate: site view and mining-unit breakdown charts.

Import

import { Hashrate } from '@tetherto/mdk-react-devkit/foundation'
import type { HashrateProps, HashrateTabValue, HashrateSiteViewProps } from '@tetherto/mdk-react-devkit/foundation'

Props

PropStatusTypeDefaultDescription
defaultTabOptionalHashrateTabValue'site-view'Tab shown on first render
siteViewOptionalHashrateSiteViewPropsnoneProps for the Site View tab
minerTypeViewOptionalHashrateMinerTypeViewPropsnoneProps for the Miner Type View tab
miningUnitViewOptionalHashrateMiningUnitViewPropsnoneProps for the Mining Unit View tab

HashrateTabValue type

type HashrateTabValue = 'site-view' | 'miner-type-view' | 'mining-unit-view'

Site view tab props

HashrateSiteView renders an aggregate hashrate trend line across the whole site, with an optional miner-type filter that scopes the sum to a subset. A date-range picker and optional reset button appear in the control row.

PropStatusTypeDefaultDescription
logOptionalHashrateGroupedLog[]Hashrate log grouped by miner type
isLoadingOptionalbooleanfalseShow a loading state on the chart
dateRangeOptionalHashrateDateRangenoneControlled date range { start, end } in ms epoch; drives the upstream query
onDateRangeChangeOptionalfunctionnoneFires when the user selects a new range from the date picker
onResetOptionalfunctionnoneWhen provided, renders a Reset button next to the date picker

Miner type and mining unit tab props

Both minerTypeView and miningUnitView render bar charts. Charts share axis scaling when both tabs are visible so relative comparisons remain accurate.

PropStatusTypeDefaultDescription
chartInputOptionalToBarChartDataInputnoneDeclarative bar data ({ labels, series })
isEmptyOptionalbooleanfalseWhen true, shows the chart empty state
isLoadingOptionalbooleanfalseShow a loading state on the bar chart

Basic usage

import { Hashrate } from '@tetherto/mdk-react-devkit/foundation'

<Hashrate
  siteView={{
    log: groupedHashrateLog,
    isLoading,
    dateRange,
    onDateRangeChange: setDateRange,
  }}
  minerTypeView={{ chartInput: minerTypeInput, isLoading }}
  miningUnitView={{ chartInput: miningUnitInput, isLoading }}
/>

More examples

Behaviour

Renders a three-tab layout using a shared Tabs shell. Each tab fetches independently via its own prop bag:

  • Site View — aggregate hashrate trend line for the whole site with optional miner-type filter; date-range picker and Reset button in the control row
  • Miner Type View — hashrate broken down by miner model/type as a bar chart with a toggle legend
  • Mining Unit View — hashrate broken down per mining unit (container) as a bar chart with a toggle legend

Miner type and mining unit bar charts share Y-axis scaling so relative comparisons across tabs remain accurate. Active tab is managed internally.

Styling

  • .mdk-hashrate: Root element
HookSupplies
useOperationsDashboardShapes raw operational metric logs into chart-ready payloads for the four OperationalDashboard cards
useHashrateNormalises a grouped-hashrate query result into the shape consumed by <Hashrate />
useEnergyReportSiteMerges consumption metrics with tail-log and container data for <EnergyReport />
useReportTimeFrameSelectorStateActive time-frame window and setters for the time-frame selector
useTimeframeControlsYear/month/week state machine for TimeframeControls

On this page