mirror of
https://github.com/mum4k/termdash.git
synced 2026-04-27 03:15:55 +03:00
[PR #185] [MERGED] Allow empty values on line chart #241
Labels
No labels
bug
cleanup
enhancement
enhancement
enhancement
good first issue
help wanted
help wanted
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/termdash#241
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/mum4k/termdash/pull/185
Author: @slok
Created: 4/14/2019
Status: ✅ Merged
Merged: 4/18/2019
Merged by: @mum4k
Base:
devel← Head:linechart-no-values📝 Commits (6)
42c2731Allow 'no values' on linechart represented by NaN float64 that will be displayed as empty cells6cf2cafUpdate changelog9b25e35Make MinMax return NaN when all values are NaNb54694eLineChart defaults to 0 mix and max when these are NaN2ae5ca1Simplify MinMax result float checks on test53abc10Remove not required constants from linechart minMax wrapper📊 Changes
5 files changed (+180 additions, -13 deletions)
View changed files
📝
CHANGELOG.md(+7 -6)📝
internal/numbers/numbers.go(+13 -1)📝
internal/numbers/numbers_test.go(+17 -2)📝
widgets/linechart/linechart.go(+30 -4)📝
widgets/linechart/linechart_test.go(+113 -0)📄 Description
This PR Fixes #184.
It will allow having values on the line chart that will not be displayed if they are missing. To do so it will use the
math.NaNfloat64 value.If this is combined with adaptive Y-axis option, the graphs that have empty gaps and high values with small variance will be more accurate regarding the Y axis (because they will not start at 0).
In this example, we can see that we don't have metrics around 10:03-10:05 making the graph render values as 0 and making Y axis start at 0:
Instead of representing the missing metrics as 0, with this change and using
math.NaN, the Y axis has a better range around the min and max values making the graph more accurate.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.