mddub / urchin-cgm

A graph of your CGM data on a Pebble watch.
MIT License
56 stars 45 forks source link

Graph Gridlines / Target Range Offset #10

Open channemann opened 8 years ago

channemann commented 8 years ago

It appears as if there is an offset or scaling issue between the gridlines and the target range lines.

My graph boundaries are 40 - 240, and my target range is 80 - 180, with gridlines every 20. The lower and upper target range lines should therefor overlap normal gridlines. As you can see in the photo, it appears as if the upper target range line is offset from where it should be, sitting slightly lower (it's closer to 160 than 200).

img_1789

mddub commented 8 years ago

Yeah, this is a result of the target range lines being an even number of pixels tall (4). I chose to make the extra pixel fall on the inside of the range (so the top looks a little low, and the bottom looks a little high). It just happens to be super noticeable on a shorter graph:

https://github.com/mddub/urchin-cgm/blob/ead0c4/src/graph_element.c#L63

They look less wrong if I reduce it from 4 to 3 pixels:

My on-wrist testing suggested 3 pixels was a little too thin, and 5 pixels... well, that just sounds crazy. Maybe you can try building with 3/5 and let me know how it feels. I'll have to think about this a little more.

channemann commented 8 years ago

3 feels pretty good, actually. Since they are pretty distinct from the dashed lines, they don't need a lot of thickness to be glanceable. 5 is definitely overkill. It's pretty minor, so I wouldn't sweat it.

On Thu, Jan 28, 2016 at 1:10 PM, Mark Wilson notifications@github.com wrote:

Yeah, this is a result of the target range lines being an even number of pixels tall (4). I chose to make the extra pixel fall on the inside of the range (so the top looks a little low, and the bottom looks a little high). It just happens to be super noticeable on a shorter graph:

https://github.com/mddub/urchin-cgm/blob/ead0c4/src/graph_element.c#L63

They look less wrong if I reduce it from 4 to 3 pixels:

https://camo.githubusercontent.com/5630c5c054b47b2248a38c39893a319860aa4a3a/687474703a2f2f692e696d6775722e636f6d2f6f7951554733432e706e67

https://camo.githubusercontent.com/cb394a2c1bd78539da0fbe2e823572d80eb74189/687474703a2f2f692e696d6775722e636f6d2f634f45416455732e706e67

My on-wrist testing suggested 3 pixels was a little too thin, and 5 pixels... well, that just sounds crazy. Maybe you can try building with 3/5 and let me know how it feels. I'll have to think about this a little more.

— Reply to this email directly or view it on GitHub https://github.com/mddub/urchin-cgm/issues/10#issuecomment-176417714.

Chris Hannemann chris.hannemann@gmail.com