NightscoutFoundation / xDrip

Nightscout version of xDrip+
https://jamorham.github.io/#xdrip-plus
GNU General Public License v3.0
1.39k stars 1.14k forks source link

Y-axis scaling can lead to confusing views #2173

Open Navid200 opened 2 years ago

Navid200 commented 2 years ago

Discussed in https://github.com/NightscoutFoundation/xDrip/discussions/2144

Originally posted by **christian-rummey** May 25, 2022 Hi - I just posted this in the xDrip FB group, and someone asked me to replicate it here: The y-axis (BG value) currently is auto-scaled to the highest level within the last 24h - see an example on the screenshot (there was a 20+high the afternoon before). This makes sense during the high, and maybe few hours thereafter, for high insulin loads, or similar issues after the high. But one day later, the curve can give confusing impressions. As we all know, the slope is actually more important than the actual value, and if the y-axis is scaled up to very high values, really steep slopes (eg, +/- 1.5 or more) apper much flatter than they are. My suggestion is to let the y-axis scale to a normal range by default (e.g, 0-12 or so?), and only scale it up if higher values are visible on screen. Or at least let the user decide how he wants to scaling to work. hope that makes sense? thanks - Christian ![Screenshot_20220525-092910_xDrip+](https://user-images.githubusercontent.com/41680029/170321866-55f28f8b-abf7-455c-a716-e305f77339fe.jpg)
thedewi commented 2 years ago

The x-axis scaling is also unpredictable, which I find biases my reading of the chart as well. Can we lock the aspect ratio of the chart so gradients are consistent?

thedewi commented 2 years ago

In cases where scaling is warranted, it might be better to scale both axes consistently, so at least the gradient would be preserved.

Personally I would prefer if it stayed constant until manually changed.

Navid200 commented 2 years ago

@thedewi You can force the x axis range using time buttons.
https://navid200.github.io/xDrip/docs/TimeButtons.html

thedewi commented 2 years ago

Thanks! Never knew you could long-press that.

thedewi commented 2 years ago

I probably never would have figured out you need to long-press the time, as well, to lock it in

christian-rummey commented 1 year ago

So I liked the discussion in #874, and the time buttons.

But - I think the simple solution for this issue would be instead of the last 24h, for the y-axis scaling we should use 4 hours (or so).

Maybe a time when it's safe to say short-term insulin is out of the body after the peak?

It would keep us focused on what is relevant at the moment (and not what happened hours earlier).

Thanks for your help & discussion

thedewi commented 1 year ago

The locking isn't working anymore, in 689d22a-2022.12.24. I'm not sure what version this started but now that I'm using a longer insulin action curve the time axis crunches down significantly every time I look.

Navid200 commented 1 year ago

@thedewi This issue is about the y axis.

Would you be so kind to open a discussion if you have any questions, tips, concerns, etc. about the time (x) axis?

It is very important for us to know if something is not working. I am very interested to know what's going on with what you are experiencing. Would you please click on new discussion here: https://github.com/NightscoutFoundation/xDrip/discussions

Hexonium commented 1 year ago

Another issue with the y-axis being scaled to the highest value within the last 24h: it suffices to have a single bad point for the graph being useless for 24 hours. Here is an example after starting a new Libre 2 sensor whose first point is 400 for no reason:

Screenshot_20230509-182436

Navid200 commented 1 year ago

@Hexonium Can you delete the stop flag, shown in the image below? 237159266-7e3f703f-115e-43c4-adb2-0e523d1d0698

Hexonium commented 1 year ago

Thanks, it's much better now! The y-axis still scales up to 400 but it's readable (I don't know if there is a way to remove that point?).

Navid200 commented 1 year ago

You cannot remove a reading. You can mark it as a bad reading.

I will open a PR to remove bad readings from the view.

The other intent is to pan the screen with very large readings. That is going to take a little more time as it is challenging for me.

Navid200 commented 1 year ago

What I meant to say is to open a PR that will avoid resizing the vertical axis for a reading that is marked as bad.

christian-rummey commented 1 year ago

It slowly gets old by now, but I still believe the 24h window for y-axis scaling makes no sense at all. IMHO 2-4 hours would be much more practical and usable.

2144

Navid200 commented 1 year ago

, but I still believe the 24h window for y-axis scaling makes no sense at all. IMHO 2-4 hours would be much more practical and usable. #2144

You can scroll back up to 24 hours to see what happens yesterday. If we make the change you suggest and you have very high readings and in 2 hours your axis goes back to normal, what will happen if you scroll back 2 hours? Addressing that is not easy.

However, if you have a very high reading because of an error, meaning your blood glucose is not really high but for a technical reason, the CGM shows one ore two very high readings, after this PR, you will be able to mark the high reading as a bad reading. https://github.com/NightscoutFoundation/xDrip/pull/2825
Then, the vertical axis will not be adjusted to show the bad reading. You won't even have to wait 2 hours then.

Navid200 commented 1 year ago

You may have correct readings that are very high one day resulting in the vertical axis being adjusted and kept like that for 24 hours. My intent is to change xDrip such that it would automatically pan to always show the latest readings. If you scroll back, it will also automatically pan. So, the vertical axis will never be adjusted without your choice.

But, that is a very challenging programming exercise for me. I will need time to complete it.

christian-rummey commented 1 year ago

Thanks @Navid200, you're exactly right, and I understand the challenge.

I am not sure however, if the automatic panning is needed or the best option. The y-axis could just snap back to normal scale, once a few hours have passed.

When scrolling back, the curve would not be visible, but e.g., replaced by a big arrow (or more arrows) pointing upwards, where the curve would be. I remember this effect on an app (during my 35 T1-years), but can't which one it was. The larger y-scale could come back by clicking (e.g., on the arrow, see below).

Just an idea - in any case thanks for trying.

ArrowUp