Skip to content

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

@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