Skip to content

Commit

Permalink
Merge pull request #570 from jayvdb/typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
AaronErhardt authored Apr 15, 2024
2 parents 6879002 + 1e8199d commit 123764a
Show file tree
Hide file tree
Showing 24 changed files with 68 additions and 68 deletions.
16 changes: 8 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions plotters-backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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 = "^<major>.<minor>*"`.
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:
Expand Down
28 changes: 14 additions & 14 deletions plotters-backend/src/rasterizer/circle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down Expand Up @@ -220,52 +220,52 @@ fn draw_annulus<B: DrawingBackend, S: BackendStyle>(
));

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,
);

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()
));

Expand Down
4 changes: 2 additions & 2 deletions plotters-backend/src/rasterizer/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec<Back
let mut x = f64::INFINITY;
let mut y = f64::INFINITY;

// Well if the determinant is not 0, then we can actuall get a intersection point.
// Well if the determinant is not 0, then we can actually get a intersection point.
if (a0 * b1 - a1 * b0).abs() > f64::EPSILON {
let u = (c0 * b1 - c1 * b0) / (a0 * b1 - a1 * b0);

Expand All @@ -74,7 +74,7 @@ fn compute_polygon_vertex(triple: &[BackendCoord; 3], d: f64, buf: &mut Vec<Back

let cross_product = a_t.0 * b_t.1 - a_t.1 * b_t.0;
if (cross_product < 0.0 && d < 0.0) || (cross_product > 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 {
Expand Down
4 changes: 2 additions & 2 deletions plotters-backend/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions plotters-bitmap/src/bitmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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<BitMapBackend<P>> {
let (w, h) = self.get_size();
let buf = self.get_raw_pixel_buffer();
Expand Down
2 changes: 1 addition & 1 deletion plotters-bitmap/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion plotters/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

To run any example, from within the repo, run `cargo run --example <example_name>` where `<example name>` 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.
Expand Down
2 changes: 1 addition & 1 deletion plotters/src/chart/dual_coord.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 <img src="https://plotters-rs.github.io/plotters-doc-data/twoscale.png"></img>
/// 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).
Expand Down
2 changes: 1 addition & 1 deletion plotters/src/chart/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl<'a, DB: DrawingBackend, CT: CoordTranslate> From<ChartContext<'a, DB, CT>>

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<CT> {
self.into()
}
Expand Down
4 changes: 2 additions & 2 deletions plotters/src/coord/ranged1d/combinators/ckps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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: Ranged> {
inner: Inner,
Expand Down Expand Up @@ -122,7 +122,7 @@ where
impl<T: AsRangedCoord> 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)
Expand Down
12 changes: 6 additions & 6 deletions plotters/src/coord/ranged1d/combinators/group_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@ impl<T: DiscreteRanged> Ranged for GroupBy<T> {
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())
Expand Down
2 changes: 1 addition & 1 deletion plotters/src/coord/ranged1d/combinators/linspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 123764a

Please sign in to comment.