8000 Add progress bar components by 3ace · Pull Request #3 · unidoc/unichart · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 22 commits into from
Apr 5, 2023
Merged

Add progress bar components #3

merged 22 commits into from
Apr 5, 2023

Conversation

3ace
Copy link
Contributor
@3ace 3ace commented Apr 1, 2023

This PR add a linear progress bar and a circular progress bar component.

Preview:

preview

@3ace 3ace requested review from gunnsth and sampila April 1, 2023 16:23
@3ace 3ace self-assigned this Apr 1, 2023
Copy link
@sampila sampila left a 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.

@3ace
Copy link
Contributor Author
3ace commented Apr 2, 2023

@sampila I've update the comments section as you suggested. Thanks

@3ace 3ace requested a review from sampila April 2, 2023 02:38
@3ace 3ace marked this pull request as draft April 2, 2023 05:32
@3ace 3ace marked this pull request as ready for review April 2, 2023 14:33
@3ace
Copy link
Contributor Author
3ace commented Apr 2, 2023

Added a label support in the linear progress bar and I've update the screenshot above to reflect the latest changes

Copy link
@sampila sampila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added minor comments

@3ace
Copy link
Contributor Author
3ace commented Apr 3, 2023

@sampila comments updated in the latest commit.

@3ace 3ace requested a review from sampila April 3, 2023 07:28
Copy link
@sampila sampila left a 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in "progrss"

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in "progrss"

Copy link
Contributor
@gunnsth gunnsth left a 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.

@3ace
Copy link
Contributor Author
3ace commented Apr 4, 2023

@gunnsth I've fixed those typos and update the readme file.

@3ace 3ace requested a review from gunnsth April 4, 2023 04:05
Copy link
Contributor
@gunnsth gunnsth left a 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.

@3ace
Copy link
Contributor Author
3ace commented Apr 5, 2023

@gunnsth that text (and it's size or color) is customizable via label parameter. User could also hide that label if they want. The default is just empty text

Copy link
Contributor
@gunnsth gunnsth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gunnsth gunnsth merged commit 570b9b5 into unidoc:master Apr 5, 2023
@3ace 3ace deleted the progress-bar branch April 9, 2023 08:55
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
0