Open moravveji opened 4 years ago
Thanks for the contribution!
I updated recently in 0.4.2 to fix the issue with max < width, do you think this change is still necessary?
The int() to round() seems like a good change.
It is difficult to see your change with all of the linting changes, can you setup black formatter and run that on your change first, it should auto format and match the style of mine.
Installation: python -m pip install black
Run: black termgraph/termgraphy.py
Or run as a module if the above doesn't work: python -m black termgraph/termgraphy.py
You can also setup your Editor to auto format, instructions here, depends on what editor you use.
Hi.
I would like to propose three small modifications, in order to address the issue https://github.com/mkaz/termgraph/issues/60.
The major change is that now, the normalize() function basically uses the sum of each row of values in data, instead of the
max_dat
. This protects the case wheremax_dat < width
against bad bar plots.I also changed int() to round() to make sure that the bars (almost) add up to 100 when the data is expressed in percentage. Otherwise, the bars would not line up nicely.
Please let me know what you think of the changes.
Kind regards Ehsan