-
-
Notifications
You must be signed in to change notification settings - Fork 346
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
docs(canvas): add documentation for x_bounds, y_bounds #35
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.
I feel like we don't really need the examples in the end. If the issue is ever brought up again we can add them back in, but for the time being we could simplify this
src/widgets/canvas/mod.rs
Outdated
/// # Examples | ||
/// | ||
/// ``` | ||
/// # use tui::style::Color; | ||
/// # use tui::widgets::{Block, Borders}; | ||
/// # use tui::widgets::canvas::{Canvas, Map, MapResolution}; | ||
/// let canvas = Canvas::default() | ||
/// .block(Block::default().borders(Borders::ALL).title("World")) | ||
/// .paint(|ctx| { | ||
/// ctx.draw(&Map { | ||
/// color: Color::White, | ||
/// resolution: MapResolution::High, | ||
/// }); | ||
/// }) | ||
/// .x_bounds([-180.0, 180.0]) | ||
/// .y_bounds([-90.0, 90.0]); | ||
/// ``` | ||
/// | ||
/// If you were to "zoom" to a certain part of the world you may want to choose different | ||
/// bounds. |
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.
Maybe not really needed ? A bit wordy
src/widgets/canvas/mod.rs
Outdated
/// # Examples | ||
/// | ||
/// ``` | ||
/// # use tui::style::Color; | ||
/// # use tui::widgets::{Block, Borders}; | ||
/// # use tui::widgets::canvas::{Canvas, Map, MapResolution}; | ||
/// let canvas = Canvas::default() | ||
/// .block(Block::default().borders(Borders::ALL).title("World")) | ||
/// .paint(|ctx| { | ||
/// ctx.draw(&Map { | ||
/// color: Color::White, | ||
/// resolution: MapResolution::High, | ||
/// }); | ||
/// }) | ||
/// .x_bounds([-180.0, 180.0]) | ||
/// .y_bounds([-90.0, 90.0]); | ||
/// ``` | ||
/// | ||
/// If you were to "zoom" to a certain part of the world you may want to choose different | ||
/// bounds. |
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.
Maybe not really need ? A bit wordy.
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.
@mindoodoo @orhun Feel free to merge the suggested changes if you agree with it.
Co-authored-by: Arijit Basu <[email protected]>
Description
There is no description in docs for
Canvas::x_bounds
andCanvas::y_bounds
, but there is a question about that with response of the author. So this PR puts this response as documentation for the methods with some small corrections and formatting.Testing guidelines
This PR does not add any code, but all code fragments in documentation are valid & buildable.
Checklist