@using MeterVault.App.Energy
@using MeterVault.Core.Analysis
@using MeterVault.Infrastructure.Analysis
@inject NavigationManager Nav
@* The energy type's History (brief §7.3): the shared chart and table for the chosen metric, over the page's period and
interval, compared with the chosen period (a calendar year for a year). "Total" charts the type's measures — never a
breakdown on top of its parent or a calculated view on top of its sources (D-22); "Individual meters" charts the
meters side by side and says how each one counts, so their bars are not read as adding up. Signed values stay signed.
A bucket opens its finer detail (D-51). *@
@(_view?.IsIndividual == true ? S.EnergyView_ViewMetersHelp : S.EnergyView_ViewTotalHelp)
@if (_view is null || _quantities is null)
{
@* Nothing read yet: the page shows its own loading state. *@
}
else if (_view.IsEmpty)
{
@EmptyText()
}
else if (_view.Main is { IsPending: true })
{
}
else if (_quantities.NotYetOccurred || NoData())
{
}
else
{
@if (_view.IsIndividual)
{
@if (_view.Hidden > 0)
{
@Loc.F(S.EnergyView_MoreMeters, _view.Shown.Count, _view.Shown.Count + _view.Hidden)
@S.Nav_Analysis
}
@if (_view.Memberships.Count > 0)
{
@S.EnergyView_HowCounted
@foreach (var (series, membership) in _view.Memberships)
{
-
@series.Name:
@membership.Label@(string.IsNullOrEmpty(membership.Detail) ? null : " — " + membership.Detail)
}
}
}
else if (_view.Metric == AnalysisMetric.Cost && Analysis.Cost is { } cost)
{
}
}
@code {
///