1
0
mirror of https://github.com/taigrr/skyline synced 2025-01-18 04:33:13 -08:00

Tweak graph to 99th percentile smoothing.

This commit is contained in:
Martin Woodward 2020-12-16 14:16:41 +00:00
parent 6f187e59cb
commit a189f6c881
2 changed files with 4 additions and 4 deletions

View File

@ -15,6 +15,6 @@ Examples:
I've been using `vercel` for local dev. To load up a local server: `vercel dev`. I've been using `vercel` for local dev. To load up a local server: `vercel dev`.
Note that this version creates a distribution from the 90th percentile on the contributions per day to stop the odd _really_ big days blowing out the scale. It also has a default minimum for non-zero contribition days (10% of the maximum height) Note that this version creates a distribution from the 99th percentile on the contributions per day to stop the odd _really_ big days blowing out the scale. It also has a default minimum for non-zero contribition days (10% of the maximum height)

View File

@ -207,11 +207,11 @@ const init = () => {
if (day.count === json.min) if (day.count === json.min)
{ {
height = MAX_HEIGHT * 0.1 height = MAX_HEIGHT * 0.1
} else if (day.count > json.min && day.count <= json.p90) } else if (day.count > json.min && day.count <= json.p99)
{ {
height = ((MAX_HEIGHT * 0.1) + (((MAX_HEIGHT * 0.8) / json.p90) * day.count)).toFixed(4) height = ((MAX_HEIGHT * 0.1) + (((MAX_HEIGHT * 0.8) / json.p99) * day.count)).toFixed(4)
} }
else if (day.count > json.p90) else if (day.count > json.p99)
{ {
height = ((MAX_HEIGHT * 0.9) + (((MAX_HEIGHT * 0.1) / json.max) * day.count)).toFixed(4) height = ((MAX_HEIGHT * 0.9) + (((MAX_HEIGHT * 0.1) / json.max) * day.count)).toFixed(4)
} }