Skip to content
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

Various fixes to resolve barchart style inconsistencies #284

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nuxy
Copy link

@nuxy nuxy commented Dec 7, 2020

This PR contains a couple changes to resolve UI inconsistencies I found when using this library. The overall goal is to have these items fixed upstream so I don't have to include a modified version of the barchart.go file in my project source.

Proposed changes

Commit 1
The percent text value always starts from the bar center position.

While this looks great when working with one character Data values (as pictured in the termui example) it looks awkward when dealing with long values since items greater than BarWidth / 2 end up bleeding into the next bar. The position should be calculated based on the character length and BarWidth size available.

Commit 2
The bar is not completely rendered when Data values < 2% exist. I'm not sure this is intentional but the chart should maintain consistent sizing in regard to the bar width even if the value is 1% or less.

Before

Before

After

After

v3/widgets/barchart.go Outdated Show resolved Hide resolved
@dcorbe
Copy link

dcorbe commented Nov 17, 2021

Hello!

Thank you for contributing to termui. I've merged this PR into a downstream fork at https://github.com/dcorbe/termui-dpc

This was done in response to the following issue: #304 (comment)

My intention is not to create a permanent fork for termui. I'm only trying to facilitate maintenance while the original author(s) are away. My hope is that my fork is eventually merged back into this repo along with your commits.

I would like to invite you to collaborate further. I would appreciate any help curating fixes and generally getting this project going in the right direction. Thanks again for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants