Well, well, well. That’s done.
The visualization of exercise data proved to involve much more work than I had originally anticipated, mainly because it involved so many different data events: .fit file data, sensor readings, BG fingerstick values, basal rates (both regular and temporary), carb intake (whether covered by boluses or not), bolused insulin, and insulin concentration. That’s almost everything that I had already built for the app plus several new parts. It also led me to create some routines to find “interesting” events and then retrieve a subset of values around those events.
Here’s last Sunday’s 2.5-hour, 40-mile bike ride along with five hours of context before and two after:
The curve in the top chart is my continuous glucose monitor (CGM) sensor data. The red X’s are the “ground truth” fingerstick readings. (Some of the values are duplicates, and I need to remove those.) The blue box is the actual duration of the bike ride. The numbers along the bottom of the upper plot show carbs that I ate before, during, and after the ride.
The lower chart shows insulin events. The horizontal step plot is basal (background) insulin delivery. The red portion of that plot is when I had a temporary basal rate in place. The green spikes are larger bolused insulin doses. You can see a small one before the ride and a larger one afterward to cover my recovery snack. (Evidently, that bolus didn’t do its job very well, since my BG shot way up immediately after I finished cycling.) The dashed curves are estimates of the insulin concentration in my blood.
Now that I’ve done this for one day, I can start looking at more days. But that has to wait until tomorrow (or later) because it’s way past my bedtime.