bar refactor

This commit is contained in:
Will McGugan 2020-10-16 10:56:08 +01:00
parent e1cb4796ba
commit 447ed72fe3
12 changed files with 320 additions and 339 deletions

18
examples/bars.py Normal file
View file

@ -0,0 +1,18 @@
"""
Use Bar to renderer a sort-of cirlce.
"""
import math
from rich.bar import Bar
from rich import print
SIZE = 40
for row in range(SIZE):
y = (row / SIZE) * 2 - 1
x = math.sqrt(1 - y * y)
bar = Bar(1.0, width=SIZE * 2, begin=1 - x, end=x, color="red")
print(bar)