@* The precision of the model week by week with the alarm line (SPEC 13.6, mockup 06). Weeks without enough cases leave no point; the days on the axis keep the distance between the others. *@ @if (Weeks.Count >= 2) { var alarm = (decimal)(Anubis.Learning.Health.Alarm * 100); var lo = Math.Min(Weeks.Min(w => w.Precision), alarm) - 4m; var hi = Math.Max(Weeks.Max(w => w.Precision), alarm) + 4m; var (first, last) = (Weeks[0], Weeks[^1]); var lowest = Weeks.MinBy(w => w.Precision)!; decimal X(LearningWeek w) => (w.Monday.DayNumber - first.Monday.DayNumber) * 1000m / (last.Monday.DayNumber - first.Monday.DayNumber); decimal Y(decimal v) => (hi - v) / (hi - lo) * 1000m;
Precisione settimana per settimana
@foreach (var w in Weeks) { Settimana del @Day(w.Monday)
@w.Precision%
} @if (lowest != last) { @lowest.Precision% }
Vedi i numeri in una tabella
@foreach (var w in Weeks.Reverse()) { }
Settimana dal lunedìPrecisione
@Format.LongDate(w.Monday)@w.Precision%
} @code { [Parameter, EditorRequired] public IReadOnlyList Weeks { get; set; } = []; private static string Day(DateOnly day) => day.ToString("d MMM", CultureInfo.GetCultureInfo("it-IT")); private static string Css(decimal v) => v.ToString("0.##", CultureInfo.InvariantCulture); private static string Pct(decimal v) => v.ToString("0.###", CultureInfo.InvariantCulture) + "%"; }