[new feature] Enhanced Time In Range (TIR) Visualization#4492
[new feature] Enhanced Time In Range (TIR) Visualization#4492dlvoy wants to merge 1 commit intonightscout:devfrom
Conversation
- Add TIR chart type to overview configuration menu - Implement today's TIR calculation from midnight to now - Create custom horizontal stacked bar chart view - Display below/in/above range percentages with color coding - Auto-refresh every 60 seconds with existing refresh loop - Integrate TIR chart into history browser layout - Update dynamically when user changes date filters - Unit tests for TIR calculation logic
|
|
👍Will have a look at this. TIR: What range? E.g: 3.9-10 or 3.9-7.8 (see statistics) |
It uses user configurable LOW and HIGH markers - visualization range config, so "green" area of main SGV chart. By default it is 70-180 (3.9-10.0) but LOW marker can be configured in range 25-160, and HIGH 90-250 |
|
I like time in range, just for me time in range by hours help more than day. |
|
Merges with dev ok. Looks good to me. No issues encountered. (Ok for me. Just wondering if this belongs to AAPS "overview" or to "Statistics" 🤔- The later already gives info on TIR?) |
|
Thanks for review! Stats give post-factum analysis of TIR and many other metrics, per day, week etc. This - on the other hand - is meant to be glanced - to feel how good are you doing reaching the goal. I felt need for that after my doctor ordered me to improve my TIR. While stats dialog updated after midnight to tell how was yesterday, i had hard time to feel how i am doing right now and - if i am on good track. |
|
hello @dlvoy I check today’s TIR every day, and it’s very helpful to me—thank you for adding this feature. I tested this PR today. There was a hypoglycemia event, and I saw today’s TIR change to 99%, but the base case still showed 100%. A few hours later, today’s TIR also changed to 100%. Finally, these two percentages both changed back to 99%. All three screenshots above occurred on the same day. Could you please help confirm whether this behavior matches your expected results? Thank you. |
0109088 to
d1bad3c
Compare
|
Hi @dlvoy, nice to see you again here 😉. I like a lot the proposal, but the user interface is completely reworked and in work for the future V4 (see compose branch). Your chart can probably be added easily in the future statistic page. |
Hi @Philoul! I will definitely take a look and adapt it for the new UI. |
Thanks @Angus-repo for testing and sorry for replying so late. Such "jumping" of percentages is side effect of rounding - algorithm making sure that percentages adds up to 100% and not showing decimals. At begin of the day just a few low measurements are able to be rounded up to 1% and show up. But they are overwhelmed by majority in-range and disappear during rounding, while highs later on again goes above 1% threshold. It might seem silly that 100% is show when there were some lows earlier. But i still find it better than showing that with decimals, like: 0.1% ... 99.9% as it suggests that it is precise and matter. While given how precise really those measurements are (MARD etc.) it really does not matter at all. Whole idea of it is have a quick glance for "how i am doing today". |






This PR introduces an Time In Range (TIR) chart for the main overview screen, providing users with predictive insights about their daily glucose management.
Overview
The new TIR chart displays two complementary graphs of your glucose control for the current day:
Enable TIR chart from the overview screen menu (chart settings). The chart automatically updates with new glucose readings and adjusts predictions as the day progresses.
Till Now Bar
Shows your actual glucose distribution from midnight until the current moment:
Worst and Best Case Bar
A predictive visualization showing potential end-of-day outcomes:
History dialog graph
Adds graph to history dialog, displaying TIR for time range shown on graph.
User Benefits
Features
Data Validation
Displays "not enough data" message when:
Visual Design Features
Technical Details