@* 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%
}
@last.Precision%allarme sotto @Format.Number(alarm)%