From 1e8199d08457fd8a76d6acddbed8231aac726457 Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sun, 14 Apr 2024 06:38:41 +0800 Subject: [PATCH] Fix typos --- CHANGELOG.md | 16 +++++------ RELEASE-NOTES.md | 4 +-- plotters-backend/src/lib.rs | 8 +++--- plotters-backend/src/rasterizer/circle.rs | 28 +++++++++---------- plotters-backend/src/rasterizer/path.rs | 4 +-- plotters-backend/src/text.rs | 4 +-- plotters-bitmap/src/bitmap.rs | 6 ++-- plotters-bitmap/src/error.rs | 2 +- plotters/examples/README.md | 2 +- plotters/src/chart/dual_coord.rs | 2 +- plotters/src/chart/state.rs | 2 +- .../src/coord/ranged1d/combinators/ckps.rs | 4 +-- .../coord/ranged1d/combinators/group_by.rs | 12 ++++---- .../coord/ranged1d/combinators/linspace.rs | 2 +- .../coord/ranged1d/combinators/logarithmic.rs | 6 ++-- plotters/src/coord/ranged1d/discrete.rs | 16 +++++------ plotters/src/coord/ranged1d/mod.rs | 4 +-- plotters/src/coord/ranged1d/types/numeric.rs | 2 +- plotters/src/coord/ranged2d/cartesian.rs | 2 +- plotters/src/drawing/mod.rs | 2 +- plotters/src/element/image.rs | 2 +- plotters/src/element/mod.rs | 2 +- plotters/src/series/line_series.rs | 2 +- plotters/src/style/colors/colormaps.rs | 2 +- 24 files changed, 68 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be9630ea..dd50469f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,7 @@ ### Improved -- Improved documentaiton for predefined colors. (Thanks to @siefkenj) +- Improved documentation for predefined colors. (Thanks to @siefkenj) - Introduce the full Material Design 2014 Color Palette. (Thanks to @siefkenj) - Massive documentation improvements (Thanks to @facorread and many others) @@ -60,19 +60,19 @@ ### Fixed -- Infinte loop / panic when the axis range is zero +- Infinite loop / panic when the axis range is zero - UB in minifb example (thanks to TheEdward162) - Examples that uses old APIs (thanks to chrisduerr) ## Plotters 0.3.0 (2020-09-03) -This is the next major release of Plotters, see [release notes](./RELEASE-NOTES.md) for more detials. +This is the next major release of Plotters, see [release notes](./RELEASE-NOTES.md) for more details. ### Added - The plotters backend API crate is introduced which allows third-party backend. - Allow slice used as a coordinate if the item type implements `PartialOrd`. -- Linspace coordinate type, which allows define a discrete coordinate on continous value types (such as f32, DateTime, etc) with a step specification +- Linspace coordinate type, which allows define a discrete coordinate on continuous value types (such as f32, DateTime, etc) with a step specification - Nested coordinate type, now we support define pair of category and nested values as nested coordinate. - Introduce backend crates: plotters-bitmap, plotters-svg, plotters-cairo, plotters-canvas, plotters-console - 3D Plotting features @@ -83,7 +83,7 @@ This is the next major release of Plotters, see [release notes](./RELEASE-NOTES. ### Improvement -- Enhanced key point algorithms: New key point hint trait are used for key point algorithms && many improvment on key point algorithms for different types +- Enhanced key point algorithms: New key point hint trait are used for key point algorithms && many improvement on key point algorithms for different types - Renamed `MeshStyle::line\_style\_1` and `MeshStyle::line\_style\_2` to `bold\_line\_style` and `light\_line\_style` - Reorganize the "plotters::coord" namespace - Improved discrete coordinate trait @@ -128,7 +128,7 @@ This is the next major release of Plotters, see [release notes](./RELEASE-NOTES. - Incremental Rendering by saving the previous chart context into a state and restore it on a different drawing area. - BoxPlot support (See boxplot example for more details) (Thanks to @nuald) - Category coordinate spec which allows use a list of given values as coordinate (Thanks to @nuald) -- New text positioning model which allows develvoper sepecify the anchor point. This is critical for layouting SVG correctly. See `plotters::style::text::text_anchor` for details. (Thanks to @nuald) +- New text positioning model which allows develvoper specify the anchor point. This is critical for layouting SVG correctly. See `plotters::style::text::text_anchor` for details. (Thanks to @nuald) ### Improved @@ -147,9 +147,9 @@ This is the next major release of Plotters, see [release notes](./RELEASE-NOTES. - Font description is greatly improved, general font family is supported: `serif`, `serif-sans`, `monospace` (Thanks to @Tatrix) - Tested the font loading on Linux, OSX and Windowns. Make font loading more reliable. -- `BitMapBackend` isn't depdends on `image` crate now. Only the image encoding part relies on the `image` crate +- `BitMapBackend` isn't depends on `image` crate now. Only the image encoding part relies on the `image` crate - Refactored WASM demo use ES6 and `wasm-pack` (Thanks to @Tatrix) -- Label style for X axis and Y axis can be set seperately now using `x\_label\_style` and `y\_label\_style`. (Thanks to @zhiburt) +- Label style for X axis and Y axis can be set separately now using `x\_label\_style` and `y\_label\_style`. (Thanks to @zhiburt) ## Plotters 0.2.10 (2019-10-23) diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md index 91713c8f..5a6c9a7a 100644 --- a/RELEASE-NOTES.md +++ b/RELEASE-NOTES.md @@ -15,7 +15,7 @@ more and more backend is supported, those backend implementation cause a huge ma For example, when `cairo-rs` crate is updated, plotters should release a new version with updated `cairo-rs` dependency for our cairo backend. However, most of the users doesn't actually use this backend and pushing new version for updating cairo backend -seems to be annoying for most of the people. As more and more backend is added, the depdendency is out of control. +seems to be annoying for most of the people. As more and more backend is added, the dependency is out of control. ### Details @@ -74,7 +74,7 @@ Plotters 0.3 ships with tons of improvement made in the coordinate abstraction a * `chrono::NaiveDate` and `chrono::NaiveDateTime` are now supported * Better abstraction of discrete coordinates -* Linspace coordinate, which can be used converting a continous coorindate into a discrete buckets +* Linspace coordinate, which can be used converting a continuous coorindate into a discrete buckets * Nested coordinate * Slices can now be used as cooradnite specification, which allows people define an axis of category. * 3D Coordinate is now supported diff --git a/plotters-backend/src/lib.rs b/plotters-backend/src/lib.rs index b21b6f4f..93706bbd 100644 --- a/plotters-backend/src/lib.rs +++ b/plotters-backend/src/lib.rs @@ -3,7 +3,7 @@ Plotters project, please check the [main crate](https://crates.io/crates/plotters). This is the crate that used as the connector between Plotters and different backend crates. Since Plotters 0.3, all the backends has been - hosted as seperate crates for the usability and maintainability reasons. + hosted as separate crates for the usability and maintainability reasons. At the same time, Plotters is now supporting third-party backends and all the backends are now supports "plug-and-play": To use a external backend, just depends on both the Plotters main crate and the third-party backend crate. @@ -16,7 +16,7 @@ If the backend only implements [DrawingBackend::draw_pixel](trait.DrawingBackend.html#tymethod.draw_pixel), the default CPU rasterizer will be used to give your backend ability of drawing different shapes. For those backend that supports advanced drawing instructions, such as, GPU - acelerated shape drawing, all the provided trait method can be overriden from the specific backend code. + accelerated shape drawing, all the provided trait method can be overridden from the specific backend code. If your backend have text rendering ability, you may want to override the [DrawingBackend::estimate_text_size](trait.DrawingBackend.html#tymethod.estimate_text_size) to avoid wrong spacing, since the Plotters default text handling code may behaves differently from the backend in terms of text rendering. @@ -48,12 +48,12 @@ - For dynamic drawing, frames are defined by invocation of `DrawingBackend::present`, everything prior the invocation should belongs to previous frame # Compatibility Note - Since Plotters v0.3, plotters use the "plug-and-play" schema to import backends, this requires both Plotters and the backend crates depdens on a + Since Plotters v0.3, plotters use the "plug-and-play" schema to import backends, this requires both Plotters and the backend crates depends on a same version of `plotters-backend` crate. This crate (`plotters-backend`) will enforce that any revision (means the last number in a version number) won't contains breaking change - both on the Plotters side and backend side. Plotters main crate is always importing the backend crate with version specification `plotters-backend = "^.*"`. - It's highly recommended that all the external crates follows the same rule to import `plotters-backend` depdendency, to avoid protential breaking + It's highly recommended that all the external crates follows the same rule to import `plotters-backend` dependency, to avoid potential breaking caused by `plotters-backend` crates gets a revision update. We also impose a versioning rule with `plotters` and some backends: diff --git a/plotters-backend/src/rasterizer/circle.rs b/plotters-backend/src/rasterizer/circle.rs index 0584167a..fdc31b4e 100644 --- a/plotters-backend/src/rasterizer/circle.rs +++ b/plotters-backend/src/rasterizer/circle.rs @@ -53,9 +53,9 @@ fn draw_part_c< let (x0, x1) = ((-half_size).ceil() as i32, half_size.floor() as i32); for x in x0..x1 { - let outter_y0 = ((r_limit as f64) * (r_limit as f64) - x as f64 * x as f64).sqrt(); + let outer_y0 = ((r_limit as f64) * (r_limit as f64) - x as f64 * x as f64).sqrt(); let inner_y0 = r as f64 - 1.0; - let mut y1 = outter_y0.min(inner_y0); + let mut y1 = outer_y0.min(inner_y0); let y0 = ((r as f64) * (r as f64) - x as f64 * x as f64).sqrt(); if y0 > y1 { @@ -69,9 +69,9 @@ fn draw_part_c< } for x in x1 + 1..r { - let outter_y0 = ((r_limit as f64) * (r_limit as f64) - x as f64 * x as f64).sqrt(); + let outer_y0 = ((r_limit as f64) * (r_limit as f64) - x as f64 * x as f64).sqrt(); let inner_y0 = r as f64 - 1.0; - let y0 = outter_y0.min(inner_y0); + let y0 = outer_y0.min(inner_y0); let y1 = x as f64; if y1 < y0 { @@ -220,8 +220,8 @@ fn draw_annulus( )); let d_inner = ((radius.1 as f64) / (2f64).sqrt()) as i32; - let d_outter = (((radius.0 as f64) / (2f64).sqrt()) as i32).min(radius.1 as i32 - 1); - let d_outter_actually = (radius.1 as i32).min( + let d_outer = (((radius.0 as f64) / (2f64).sqrt()) as i32).min(radius.1 as i32 - 1); + let d_outer_actually = (radius.1 as i32).min( (radius.0 as f64 * radius.0 as f64 - radius.1 as f64 * radius.1 as f64 / 2.0) .sqrt() .ceil() as i32, @@ -229,43 +229,43 @@ fn draw_annulus( check_result!(b.draw_line( (center.0 - d_inner, center.1 - d_inner), - (center.0 - d_outter, center.1 - d_outter), + (center.0 - d_outer, center.1 - d_outer), &style.color() )); check_result!(b.draw_line( (center.0 + d_inner, center.1 - d_inner), - (center.0 + d_outter, center.1 - d_outter), + (center.0 + d_outer, center.1 - d_outer), &style.color() )); check_result!(b.draw_line( (center.0 - d_inner, center.1 + d_inner), - (center.0 - d_outter, center.1 + d_outter), + (center.0 - d_outer, center.1 + d_outer), &style.color() )); check_result!(b.draw_line( (center.0 + d_inner, center.1 + d_inner), - (center.0 + d_outter, center.1 + d_outter), + (center.0 + d_outer, center.1 + d_outer), &style.color() )); check_result!(b.draw_line( (center.0 - d_inner, center.1 + d_inner), - (center.0 - d_outter_actually, center.1 + d_inner), + (center.0 - d_outer_actually, center.1 + d_inner), &style.color() )); check_result!(b.draw_line( (center.0 + d_inner, center.1 - d_inner), - (center.0 + d_inner, center.1 - d_outter_actually), + (center.0 + d_inner, center.1 - d_outer_actually), &style.color() )); check_result!(b.draw_line( (center.0 + d_inner, center.1 + d_inner), - (center.0 + d_inner, center.1 + d_outter_actually), + (center.0 + d_inner, center.1 + d_outer_actually), &style.color() )); check_result!(b.draw_line( (center.0 + d_inner, center.1 + d_inner), - (center.0 + d_outter_actually, center.1 + d_inner), + (center.0 + d_outer_actually, center.1 + d_inner), &style.color() )); diff --git a/plotters-backend/src/rasterizer/path.rs b/plotters-backend/src/rasterizer/path.rs index eae0bfe2..f23d987e 100644 --- a/plotters-backend/src/rasterizer/path.rs +++ b/plotters-backend/src/rasterizer/path.rs @@ -64,7 +64,7 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec f64::EPSILON { let u = (c0 * b1 - c1 * b0) / (a0 * b1 - a1 * b0); @@ -74,7 +74,7 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec 0.0 && d > 0.0) { - // Then we are at the outter side of the angle, so we need to consider a cap. + // Then we are at the outer side of the angle, so we need to consider a cap. let dist_square = (x - triple[1].0 as f64).powi(2) + (y - triple[1].1 as f64).powi(2); // If the point is too far away from the line, we need to cap it. if dist_square > d * d * 16.0 { diff --git a/plotters-backend/src/text.rs b/plotters-backend/src/text.rs index b16ec169..1b92edcd 100644 --- a/plotters-backend/src/text.rs +++ b/plotters-backend/src/text.rs @@ -188,8 +188,8 @@ impl<'a> From<&'a str> for FontStyle { /// text drawing, those font information provides instructions about how the text should be /// rendered: color, size, slant, anchor, font, etc. /// -/// This trait decouples the detailed implementaiton about the font and the backend code which -/// wants to perfome some operation on the font. +/// This trait decouples the detailed implementation about the font and the backend code which +/// wants to perform some operation on the font. /// pub trait BackendTextStyle { /// The error type of this text style implementation diff --git a/plotters-bitmap/src/bitmap.rs b/plotters-bitmap/src/bitmap.rs index 39d23bf3..5edd3cda 100644 --- a/plotters-bitmap/src/bitmap.rs +++ b/plotters-bitmap/src/bitmap.rs @@ -28,7 +28,7 @@ use target::{Buffer, Target}; /// `BitMapBackend`, not just `drop` it or allow it to go out of scope. /// /// If the `BitMapBackend` is just dropped, it will make a best effort attempt to write the -/// generated charts to the output file, but any errors that occcur (such as inability to +/// generated charts to the output file, but any errors that occur (such as inability to /// create the output file) will be silently ignored. pub struct BitMapBackend<'a, P: PixelFormat = RGBPixel> { /// The path to the image @@ -95,7 +95,7 @@ impl<'a> BitMapBackend<'a, RGBPixel> { /// in RGB pixel format. /// /// Note: This function provides backward compatibility for those code that assumes Plotters - /// uses RGB pixel format and maniuplates the in-memory framebuffer. + /// uses RGB pixel format and manipulates the in-memory framebuffer. /// For more pixel format option, use `with_buffer_and_format` instead. /// /// - `buf`: The buffer to operate @@ -141,7 +141,7 @@ impl<'a, P: PixelFormat> BitMapBackend<'a, P> { /// multi-threading rendering. /// /// - `area_size`: The size of the area - /// - **returns**: The splitted backends that can be rendered in parallel + /// - **returns**: The split backends that can be rendered in parallel pub fn split(&mut self, area_size: &[u32]) -> Vec> { let (w, h) = self.get_size(); let buf = self.get_raw_pixel_buffer(); diff --git a/plotters-bitmap/src/error.rs b/plotters-bitmap/src/error.rs index 4fa10205..10a668df 100644 --- a/plotters-bitmap/src/error.rs +++ b/plotters-bitmap/src/error.rs @@ -6,7 +6,7 @@ use image::ImageError; pub enum BitMapBackendError { /// The buffer provided is invalid, for example, wrong pixel buffer size InvalidBuffer, - /// Some IO error occurs while the bitmap maniuplation + /// Some IO error occurs while the bitmap manipulation IOError(std::io::Error), #[cfg(all(feature = "gif", not(target_arch = "wasm32"), feature = "image"))] GifEncodingError(gif::EncodingError), diff --git a/plotters/examples/README.md b/plotters/examples/README.md index b6dd1666..3149df7c 100644 --- a/plotters/examples/README.md +++ b/plotters/examples/README.md @@ -4,7 +4,7 @@ To run any example, from within the repo, run `cargo run --example ` where `` is the name of the file without the `.rs` extension. -All the examples assumes the directory [plotters-doc-data](https://github.com/38/plotters-doc-data) exists, otherwise those example crashs. +All the examples assumes the directory [plotters-doc-data](https://github.com/38/plotters-doc-data) exists, otherwise those example crashes. The output of these example files are used to generate the [plotters-doc-data](https://github.com/38/plotters-doc-data) repo that populates the sample images in the main README. We also rely on the output of examples to detect potential layout changes. diff --git a/plotters/src/chart/dual_coord.rs b/plotters/src/chart/dual_coord.rs index 434e3477..048bea02 100644 --- a/plotters/src/chart/dual_coord.rs +++ b/plotters/src/chart/dual_coord.rs @@ -17,7 +17,7 @@ use crate::element::{Drawable, PointCollection}; use plotters_backend::{BackendCoord, DrawingBackend}; /// The chart context that has two coordinate system attached. -/// This situation is quite common, for example, we with two different coodinate system. +/// This situation is quite common, for example, we with two different coordinate system. /// For instance this example /// This is done by attaching a second coordinate system to ChartContext by method [ChartContext::set_secondary_coord](struct.ChartContext.html#method.set_secondary_coord). /// For instance of dual coordinate charts, see [this example](https://github.com/plotters-rs/plotters/blob/master/examples/two-scales.rs#L15). diff --git a/plotters/src/chart/state.rs b/plotters/src/chart/state.rs index 1ce2f828..55c4056e 100644 --- a/plotters/src/chart/state.rs +++ b/plotters/src/chart/state.rs @@ -50,7 +50,7 @@ impl<'a, DB: DrawingBackend, CT: CoordTranslate> From> impl<'a, DB: DrawingBackend, CT: CoordTranslate> ChartContext<'a, DB, CT> { /// Convert a chart context into a chart state, by doing so, the chart context is consumed and - /// a saved chart state is created for later use. This is typically used in incrmental rendering. See documentation of `ChartState` for more detailed example. + /// a saved chart state is created for later use. This is typically used in incremental rendering. See documentation of `ChartState` for more detailed example. pub fn into_chart_state(self) -> ChartState { self.into() } diff --git a/plotters/src/coord/ranged1d/combinators/ckps.rs b/plotters/src/coord/ranged1d/combinators/ckps.rs index 5e1ed72b..402ffd8c 100644 --- a/plotters/src/coord/ranged1d/combinators/ckps.rs +++ b/plotters/src/coord/ranged1d/combinators/ckps.rs @@ -11,7 +11,7 @@ use crate::coord::ranged1d::{AsRangedCoord, DiscreteRanged, KeyPointHint, Ranged /// This decorator allows customized tick mark specifiied by vector. /// See [BindKeyPoints::with_key_points](trait.BindKeyPoints.html#tymethod.with_key_points) /// for details. -/// Note: For any coordinate spec wrapped by this decorator, the maxium number of labels configured by +/// Note: For any coordinate spec wrapped by this decorator, the maximum number of labels configured by /// MeshStyle will be ignored and the key point function will always returns the entire vector pub struct WithKeyPoints { inner: Inner, @@ -122,7 +122,7 @@ where impl BindKeyPoints for T {} /// The coordinate decorator that allows customized keypoint algorithms. -/// Normally, all the coordinate spec implements its own key point algorith +/// Normally, all the coordinate spec implements its own key point algorithm /// But this decorator allows you override the pre-defined key point algorithm. /// /// To use this decorator, see [BindKeyPointMethod::with_key_point_func](trait.BindKeyPointMethod.html#tymethod.with_key_point_func) diff --git a/plotters/src/coord/ranged1d/combinators/group_by.rs b/plotters/src/coord/ranged1d/combinators/group_by.rs index 5c0a4e56..7648f8e7 100644 --- a/plotters/src/coord/ranged1d/combinators/group_by.rs +++ b/plotters/src/coord/ranged1d/combinators/group_by.rs @@ -82,16 +82,16 @@ impl Ranged for GroupBy { let idx_iter = (0..hint.bold_points()).map(|x| x * interval); if hint.weight().allow_light_points() && count < hint.bold_points() * 2 { - let outter_ticks = idx_iter; - let outter_tick_size = interval * self.1; - let inner_ticks_per_group = hint.max_num_points() / outter_ticks.len(); + let outer_ticks = idx_iter; + let outer_tick_size = interval * self.1; + let inner_ticks_per_group = hint.max_num_points() / outer_ticks.len(); let inner_ticks = - (outter_tick_size + inner_ticks_per_group - 1) / inner_ticks_per_group; - let inner_ticks: Vec<_> = (0..(outter_tick_size / inner_ticks)) + (outer_tick_size + inner_ticks_per_group - 1) / inner_ticks_per_group; + let inner_ticks: Vec<_> = (0..(outer_tick_size / inner_ticks)) .map(move |x| x * inner_ticks) .collect(); let size = self.0.size(); - return outter_ticks + return outer_ticks .flat_map(|base| inner_ticks.iter().map(move |&ofs| base * self.1 + ofs)) .take_while(|&idx| idx < size) .map(|x| self.0.from_index(x).unwrap()) diff --git a/plotters/src/coord/ranged1d/combinators/linspace.rs b/plotters/src/coord/ranged1d/combinators/linspace.rs index 7f4ac864..85ff6c35 100644 --- a/plotters/src/coord/ranged1d/combinators/linspace.rs +++ b/plotters/src/coord/ranged1d/combinators/linspace.rs @@ -152,7 +152,7 @@ where } } -/// The coordinate combinator that transform a continous coordinate to a discrete coordinate +/// The coordinate combinator that transform a continuous coordinate to a discrete coordinate /// to a discrete coordinate by a giving step. /// /// For example, range `0f32..100f32` is a continuous coordinate, thus this prevent us having a diff --git a/plotters/src/coord/ranged1d/combinators/logarithmic.rs b/plotters/src/coord/ranged1d/combinators/logarithmic.rs index f105ff01..abcb24cc 100644 --- a/plotters/src/coord/ranged1d/combinators/logarithmic.rs +++ b/plotters/src/coord/ranged1d/combinators/logarithmic.rs @@ -78,7 +78,7 @@ impl IntoLogRange for Range { } } -/// The logarithmic coodinate decorator. +/// The logarithmic coordinate decorator. /// This decorator is used to make the axis rendered as logarithmically. #[derive(Clone)] pub struct LogRangeExt { @@ -103,7 +103,7 @@ impl LogRangeExt { self } - /// Set the base multipler + /// Set the base multiplier pub fn base(mut self, base: f64) -> Self { if self.base > 1.0 { self.base = base; @@ -256,7 +256,7 @@ impl Ranged for LogCoord { } } -/// The logarithmic coodinate decorator. +/// The logarithmic coordinate decorator. /// This decorator is used to make the axis rendered as logarithmically. #[deprecated(note = "LogRange is deprecated, use IntoLogRange trait method instead")] #[derive(Clone)] diff --git a/plotters/src/coord/ranged1d/discrete.rs b/plotters/src/coord/ranged1d/discrete.rs index 074eece8..8ae0e565 100644 --- a/plotters/src/coord/ranged1d/discrete.rs +++ b/plotters/src/coord/ranged1d/discrete.rs @@ -20,8 +20,8 @@ where /// Map a value to the index /// - /// Note: This function doesn't guareentee return None when the value is out of range. - /// The only way to confirm the value is in the range is to examing the return value isn't + /// Note: This function doesn't guarantee return None when the value is out of range. + /// The only way to confirm the value is in the range is to examining the return value isn't /// larger than self.size. /// /// - `value`: The value to map @@ -30,11 +30,11 @@ where /// Reverse map the index to the value /// - /// Note: This function doesn't guareentee returning None when the index is out of range. + /// Note: This function doesn't guarantee returning None when the index is out of range. /// /// - `value`: The index to map /// - **returns** The value - // TODO: This doesn't follows rust's naming convention - however, this is a protential breaking + // TODO: This doesn't follows rust's naming convention - however, this is a potential breaking // change, so postpone the fix to the next major release #[allow(clippy::wrong_self_convention)] fn from_index(&self, index: usize) -> Option; @@ -87,13 +87,13 @@ where } /// A `SegmentedCoord` is a decorator on any discrete coordinate specification. -/// This decorator will convert the discrete coordiante in two ways: -/// - Add an extra dummy element after all the values in origianl discrete coordinate -/// - Logically each value `v` from original coordinate system is mapped into an segment `[v, v+1)` where `v+1` denotes the sucessor of the `v` +/// This decorator will convert the discrete coordinate in two ways: +/// - Add an extra dummy element after all the values in original discrete coordinate +/// - Logically each value `v` from original coordinate system is mapped into an segment `[v, v+1)` where `v+1` denotes the successor of the `v` /// - Introduce two types of values `SegmentValue::Exact(value)` which denotes the left end of value's segment and `SegmentValue::CenterOf(value)` which refers the center of the segment. /// This is used in histogram types, which uses a discrete coordinate as the buckets. The segmented coord always emits `CenterOf(value)` key points, thus it allows all the label and tick marks /// of the coordinate rendered in the middle of each segment. -/// The coresponding trait [IntoSegmentedCoord](trait.IntoSegmentedCoord.html) is used to apply this decorator to coordinates. +/// The corresponding trait [IntoSegmentedCoord](trait.IntoSegmentedCoord.html) is used to apply this decorator to coordinates. #[derive(Clone)] pub struct SegmentedCoord(D); diff --git a/plotters/src/coord/ranged1d/mod.rs b/plotters/src/coord/ranged1d/mod.rs index 97664a2f..7b92d6e9 100644 --- a/plotters/src/coord/ranged1d/mod.rs +++ b/plotters/src/coord/ranged1d/mod.rs @@ -61,7 +61,7 @@ pub use discrete::{DiscreteRanged, IntoSegmentedCoord, SegmentValue, SegmentedCo /// Since stable Rust doesn't have specialization, it's very hard to make our own trait that /// automatically implemented the value formatter. This trait uses as a marker indicates if we -/// should automatically implement the default value formater based on it's `Debug` trait +/// should automatically implement the default value formatter based on it's `Debug` trait pub trait DefaultValueFormatOption {} /// This makes the ranged coord uses the default `Debug` based formatting @@ -115,7 +115,7 @@ impl KeyPointWeight { /// The trait for a hint provided to the key point algorithm used by the coordinate specs. /// The most important constraint is the `max_num_points` which means the algorithm could emit no more than specific number of key points /// `weight` is used to determine if this is used as a bold grid line or light grid line -/// `bold_points` returns the max number of coresponding bold grid lines +/// `bold_points` returns the max number of corresponding bold grid lines pub trait KeyPointHint { /// Returns the max number of key points fn max_num_points(&self) -> usize; diff --git a/plotters/src/coord/ranged1d/types/numeric.rs b/plotters/src/coord/ranged1d/types/numeric.rs index bd3ba84e..f11ab39e 100644 --- a/plotters/src/coord/ranged1d/types/numeric.rs +++ b/plotters/src/coord/ranged1d/types/numeric.rs @@ -422,7 +422,7 @@ mod test { } #[test] - fn regession_test_issue_358_key_points_no_hang() { + fn regression_test_issue_358_key_points_no_hang() { let coord: RangedCoordf64 = (-200.0..801.0).into(); let points = coord.key_points(500); assert!(points.len() <= 500); diff --git a/plotters/src/coord/ranged2d/cartesian.rs b/plotters/src/coord/ranged2d/cartesian.rs index 5052a62f..f431e539 100644 --- a/plotters/src/coord/ranged2d/cartesian.rs +++ b/plotters/src/coord/ranged2d/cartesian.rs @@ -2,7 +2,7 @@ The 2-dimensional cartesian coordinate system. This module provides the 2D cartesian coordinate system, which is composed by two independent - ranged 1D coordinate sepcification. + ranged 1D coordinate specification. This types of coordinate system is used by the chart constructed with [ChartBuilder::build_cartesian_2d](../../chart/ChartBuilder.html#method.build_cartesian_2d). */ diff --git a/plotters/src/drawing/mod.rs b/plotters/src/drawing/mod.rs index 9e32d913..5c055fb8 100644 --- a/plotters/src/drawing/mod.rs +++ b/plotters/src/drawing/mod.rs @@ -6,7 +6,7 @@ The low-level drawing abstraction, the module defines the `DrawingBackend` trait It exposes a set of functions which allows basic shape, such as pixels, lines, rectangles, circles, to be drawn on the screen. The low-level API uses the pixel based coordinate. -The high-level API is built on the top of high-level API. The `DrawingArea` type exposes the high-level drawing API to the remianing part +The high-level API is built on the top of high-level API. The `DrawingArea` type exposes the high-level drawing API to the remaining part of Plotters. The basic drawing blocks are composable elements, which can be defined in logic coordinate. To learn more details about the [coordinate abstraction](../coord/index.html) and [element system](../element/index.html). */ diff --git a/plotters/src/element/image.rs b/plotters/src/element/image.rs index f50ce77b..a1e5f8bd 100644 --- a/plotters/src/element/image.rs +++ b/plotters/src/element/image.rs @@ -123,7 +123,7 @@ impl<'a, Coord, P: PixelFormat> BitMapElement<'a, Coord, P> { }) } - /// Create a new bitmap element with a shared borrowed buffer. This means if we want to modifiy + /// Create a new bitmap element with a shared borrowed buffer. This means if we want to modify /// the content of the image, the buffer is automatically copied /// /// - `pos`: The left upper coordinate of the elelent diff --git a/plotters/src/element/mod.rs b/plotters/src/element/mod.rs index 849f8ae4..921b2c0f 100644 --- a/plotters/src/element/mod.rs +++ b/plotters/src/element/mod.rs @@ -218,7 +218,7 @@ use crate::drawing::Rect; /// /// However, /// [Generic Associated Types](https://github.com/rust-lang/rfcs/blob/master/text/1598-generic_associated_types.md) -/// is far away from stablize. +/// is far away from stabilize. /// So currently we have the following workaround: /// /// Instead of implement the PointCollection trait on the element type itself, it implements on the diff --git a/plotters/src/series/line_series.rs b/plotters/src/series/line_series.rs index 2e67503b..55c58f7b 100644 --- a/plotters/src/series/line_series.rs +++ b/plotters/src/series/line_series.rs @@ -183,7 +183,7 @@ mod test { m.check_draw_path(|c, s, _path| { assert_eq!(c, RED.to_rgba()); assert_eq!(s, 3); - // TODO when cleanup the backend coordinate defination, then we uncomment the + // TODO when cleanup the backend coordinate definition, then we uncomment the // following check //for i in 0..100 { // assert_eq!(path[i], (i as i32 * 2, 199 - i as i32 * 2)); diff --git a/plotters/src/style/colors/colormaps.rs b/plotters/src/style/colors/colormaps.rs index a320502c..35ebddbf 100644 --- a/plotters/src/style/colors/colormaps.rs +++ b/plotters/src/style/colors/colormaps.rs @@ -7,7 +7,7 @@ where { /// Takes a scalar value 0.0 <= h <= 1.0 and returns the corresponding color. /// Typically color-scales are named according to which color-type they return. - /// To use upper and lower bounds with ths function see [get_color_normalized](ColorMap::get_color_normalized). + /// To use upper and lower bounds with this function see [get_color_normalized](ColorMap::get_color_normalized). fn get_color(&self, h: FloatType) -> ColorType { self.get_color_normalized(h, FloatType::zero(), FloatType::one()) }