Background
The cone of uncertainty for Trio predictions is currently rendered out to the longest of the available predBG arrays (ZT, IOB, COB, UAM).
Graphs.swift (in updateOpenAPSPredictionDisplay()):
let maxLength = min(allArrays.map { $0.count }.max()!, toLoad + 1)
At indices past the end of a shorter array, that array simply stops contributing to min/max. This causes the cone to visibly "deform" at the tail — the band narrows or shifts as contributing arrays drop out one by one, which doesn't match how Trio draws its cone.
Proposal
If the goal is to be visually identical to Trio, cap the cone length at the shortest of the (up to 4) available predBG arrays:
let minLength = min(allArrays.map { $0.count }.min()!, toLoad + 1)
This way every point in the cone is computed from the same set of contributing arrays, and the band ends cleanly when the first array runs out instead of deforming.
Open questions
- Confirm this matches Trio's actual rendering behavior.
Background
The cone of uncertainty for Trio predictions is currently rendered out to the longest of the available predBG arrays (ZT, IOB, COB, UAM).
Graphs.swift(inupdateOpenAPSPredictionDisplay()):At indices past the end of a shorter array, that array simply stops contributing to min/max. This causes the cone to visibly "deform" at the tail — the band narrows or shifts as contributing arrays drop out one by one, which doesn't match how Trio draws its cone.
Proposal
If the goal is to be visually identical to Trio, cap the cone length at the shortest of the (up to 4) available predBG arrays:
This way every point in the cone is computed from the same set of contributing arrays, and the band ends cleanly when the first array runs out instead of deforming.
Open questions