-
Notifications
You must be signed in to change notification settings - Fork 5
Add progress bar components #3
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
Conversation
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.
Great works on this, added minor comments.
@sampila I've update the comments section as you suggested. Thanks |
Added a label support in the linear progress bar and I've update the screenshot above to reflect the latest changes |
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.
Added minor comments
@sampila comments updated in the latest commit. |
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.
Looks good to me
} | ||
} | ||
|
||
// Render renders the progrss bar with the given renderer to the given io.Writer. |
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.
typo in "progrss"
progress_bar_circular.go
Outdated
render.Text.DrawWithin(r, cp.label, render.NewBox(fgStrokeWidth, fgStrokeWidth, cp.Size()-fgStrokeWidth, cp.Size()-fgStrokeWidth), labelStyle) | ||
} | ||
|
||
// Render renders the progrss bar with the given renderer to the given io.Writer. |
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.
typo in "progrss"
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.
Looks great. Added minor comment. Would be nice to add to README.md in similar style as other components.
@gunnsth I've fixed those typos and update the readme file. |
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.
@3ace For the circular progress bar, is it possible to display the percentage like "95%" or "95.9%" inside the circle instead of the A? Is that somehow customizable? I imagine a percentage might be a common case. But would be nice if that was the default but could be overridden in some way, like a function that gets the input percentage and outputs the text to display or something like that.
@gunnsth that text (and it's size or color) is customizable via |
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.
LGTM
This PR add a linear progress bar and a circular progress bar component.
Preview: