-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignore math.NaN() values when drawing plots #67
ignore math.NaN() values when drawing plots #67
Conversation
b240957
to
8897f2f
Compare
Thanks for the PR looks perfect. can u please just sign your commits " got commit -s" Regards |
8897f2f
to
2993b79
Compare
I tried signing via intellij, did it work? No idea how I can tell 😅 but I honestly still have no Idea what to choose. How important is this signing stuff? |
Signed-off-by: Markus Ressel <[email protected]>
2993b79
to
3dd7ecf
Compare
It's signed now , thanks |
Hi @markusressel Thanks |
Signed-off-by: Markus Ressel <[email protected]>
Before: After (with holes added by myself): Thx for the hint, I found an issue that resulted in flickering between an empty and filled graph, caused by the code that determines the required range. Note that sparkling graphs are still broken. They still flicker to an empty graph sometimes, and do not leave real gaps. Do you want me to fix them as well? |
One thing I am noticing: The Braille lines seem to be much steeper in some cases than they "should be" if the holes were not present. Ia m not sure if this is simply an artifact of how braille lines are drawn, or an issue with the code. It does not look like the lines shift that much out of place to me, so it could just be related to the braille charaters. |
Signed-off-by: Markus Ressel <[email protected]>
3d91181
to
170954e
Compare
I had accidentally pushed my changes to the demo, its fixed now. |
The braille graph doesn't look ok in previous screenshots, can u send me the screenshot again with your changes again. Thanks |
@navidys I am not sure I am following, which ones do you mean? This is what it looks like without holes: Both images include the changes in this PR. |
Thanks @markusressel Is it possible to give me access to your tvxwidgets forked repo also ? Just want to check the sample data your are using |
I have not pushed the sample data, since there is only this one branch so far, which is also used for this PR and I didn't want to pollute or modify your demo apps. I can add a separate branch to show how I created the sample data if you want. I have to go to sleep now though (almost 4 AM here), thx for the quick conversation ❤️ |
Thanks for that , I all appreciate if you can do that and send me the branch name |
@navidys I think I know what is causing the "steeper than expected" lines: The Until then, you can checkout this branch to play around with both of the PRs, including data that has gaps: https://github.com/markusressel/tvxwidgets/tree/feature/math-nan-examples |
@navidys can a braille only be drawn using at least two data points? I know the EDIT: Yes it is possible, using |
Signed-off-by: Markus Ressel <[email protected]>
Signed-off-by: Markus Ressel <[email protected]>
for j, val := range line[1:] { | ||
lheight := int((val / plot.maxVal) * float64(height-1)) | ||
if math.IsNaN(val) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code could probably be written in a simpler way if it wasn't for the special handling of the first data point.
Since it works as is I didn't want to change it though.
Feel free to optimize.
The golangci-lint is failing. Can u please fix those failure, if not you can give me access to your branch and I can fix them easily. To run golangci-lint locally on your node 1- make .install.golanci-lint |
Signed-off-by: Navid Yaghoobi <[email protected]>
Drawing graphs with "gaps" in the data currently results in an ugly "0 line":
This PR simply ignores values that match
math.IsNaN(val)
, leaving an actual gap in the drawn line:Interestingly this behavior only affects the "braille" type line plot. Not sure whats different about the "dot" mode that makes it work anyway.
I tried to run tests, but it seems like running tests in this repo requires an extensive local setup involving multiple external packages, so I wasn't able to get it running. Let me know if I need to add anything else.
PS: Ignore the bad braille rendering, its caused by the IntelliJ integrated shell. Looks much better in an actual shell.