Skip to Content
๐ŸŽ‰ Coral x Panda has been released ๐ŸŽ‰ Read the Migration Guide
DocumentationMoleculesEnergyOverviewuseEnergyOverview

useEnergyOverview

This hook is used to transform the data from the useMeasurements hook into an object that can be used to display the relevant information within the EnergyOverview compound component.

Basic Usage

import { useMeasurementFilters, useMeasurements, } from "@krakentech/blueprint-utils/client"; import { useEnergyOverview } from "@krakentech/coral-molecules"; const measurementFilters = useMeasurementFilters(); const electricityMeasurements = useMeasurements({ variables: { accountNumber, dateLocale, propertyId, utilityType: FuelType.Electricity, measurementFilters, }, }); const electricityData = useEnergyOverview({ measurementsData: electricityMeasurements, currency: "GBP", locale: "en-GB", });

Please see the EnergyOverview component for a full example of how to use this object within the compound component.

Full API

Arguments

NameDescriptiontypeDefault valueRequired
measurementsDataThe initial data provided by the consumer from the useMeasurements hookUseMeasurementsDataundefinedtrue
currencyThe local 3-digit currency codeCurrencyCodesGBPfalse
localeThe local code for your regionLocaleCodesen-GBfalse
includeTaxWhether to include tax in the calculationsbooleantruefalse

Return

NameDescriptiontype
[const].dataThe data object from the useMeasurements hookobject
[const].chartDataAn object used to create the charts and tablesobject
[const].legendEntriesThe legendEntries object from useMeasurements, used to create the legend in the chartsobject
[const].lineChartDataThe lineChartData object from useMeasurements, used to create the line chart on cost day viewobject
[const].marketSupplyPointIdA unique identifier for the supply pointstring
[const].measurementUnitThe unit which energy is measured e.g. โ€˜kWhโ€™string
[const].dateLocaleA locale object representing the date formatobject
[const].localeThe locale e.g. โ€˜en-GBโ€™string
[const].currencyThe currency e.g. โ€˜GBPโ€™string
[const].totalConsumptionThe total consumption value in cost or measurement unitnumber
[const].totalStandingChargeThe total standing charge value in costnumber
[const].measurementWithMultipleStatisticsEntriesUsed to help create the charts and tablesany
[const].costOfUsageCurrencyThe costOfUsageCurrency object from useMeasurementsstring
Last updated on