Skip to content

Commit 3887295

Browse files
committed
Run cargo fmt
1 parent 321767a commit 3887295

File tree

6 files changed

+36
-24
lines changed

6 files changed

+36
-24
lines changed

src/chart/context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ pub(super) mod cartesian3d;
66

77
pub(super) use cartesian3d::Coord3D;
88

9-
109
#[cfg(test)]
1110
mod test {
1211
use crate::prelude::*;

src/chart/context/cartesian2d/draw_impl.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ use std::ops::Range;
22

33
use plotters_backend::DrawingBackend;
44

5-
use crate::coord::{ranged1d::{Ranged, KeyPointHint}, cartesian::{Cartesian2d, MeshLine}, Shift};
65
use crate::chart::ChartContext;
7-
use crate::style::{ShapeStyle, TextStyle, text_anchor::{HPos, VPos, Pos}, FontTransform};
8-
use crate::drawing::{DrawingAreaErrorKind, DrawingArea};
6+
use crate::coord::{
7+
cartesian::{Cartesian2d, MeshLine},
8+
ranged1d::{KeyPointHint, Ranged},
9+
Shift,
10+
};
11+
use crate::drawing::{DrawingArea, DrawingAreaErrorKind};
912
use crate::element::PathElement;
10-
13+
use crate::style::{
14+
text_anchor::{HPos, Pos, VPos},
15+
FontTransform, ShapeStyle, TextStyle,
16+
};
1117

1218
impl<'a, DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<'a, DB, Cartesian2d<X, Y>> {
1319
/// The actual function that draws the mesh lines.
@@ -363,5 +369,4 @@ impl<'a, DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<'a, DB, Cartesia
363369

364370
Ok(())
365371
}
366-
367372
}

src/chart/context/cartesian2d/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
use std::ops::Range;
22

3-
use plotters_backend::{DrawingBackend, BackendCoord};
3+
use plotters_backend::{BackendCoord, DrawingBackend};
44

5-
use crate::chart::{ChartContext, MeshStyle, DualCoordChartContext};
6-
use crate::coord::{cartesian::Cartesian2d, ranged1d::{ValueFormatter, Ranged, AsRangedCoord}, Shift};
5+
use crate::chart::{ChartContext, DualCoordChartContext, MeshStyle};
6+
use crate::coord::{
7+
cartesian::Cartesian2d,
8+
ranged1d::{AsRangedCoord, Ranged, ValueFormatter},
9+
Shift,
10+
};
711
use crate::drawing::DrawingArea;
812

913
mod draw_impl;
@@ -58,7 +62,6 @@ impl<'a, DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<'a, DB, Cartesia
5862
pub fn backend_coord(&self, coord: &(X::ValueType, Y::ValueType)) -> BackendCoord {
5963
self.drawing_area.map_coordinate(coord)
6064
}
61-
6265
}
6366

6467
impl<'a, DB: DrawingBackend, X: Ranged, Y: Ranged> ChartContext<'a, DB, Cartesian2d<X, Y>> {

src/chart/context/cartesian3d/draw_impl.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
21
use plotters_backend::DrawingBackend;
32

43
use crate::chart::ChartContext;
5-
use crate::coord::{ranged1d::{Ranged, KeyPointHint}, CoordTranslate, cartesian::Cartesian3d};
4+
use crate::coord::{
5+
cartesian::Cartesian3d,
6+
ranged1d::{KeyPointHint, Ranged},
7+
CoordTranslate,
8+
};
69
use crate::drawing::DrawingAreaErrorKind;
7-
use crate::element::{EmptyElement, PathElement, Text, Polygon};
8-
use crate::style::{ShapeStyle, TextStyle, text_anchor::{Pos, VPos, HPos}};
10+
use crate::element::{EmptyElement, PathElement, Polygon, Text};
11+
use crate::style::{
12+
text_anchor::{HPos, Pos, VPos},
13+
ShapeStyle, TextStyle,
14+
};
915

1016
use super::Coord3D;
1117

@@ -286,4 +292,3 @@ where
286292
])
287293
}
288294
}
289-

src/chart/context/cartesian3d/mod.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
use crate::chart::{axes3d::Axes3dStyle, ChartContext};
2+
use crate::coord::{
3+
cartesian::Cartesian3d,
4+
ranged1d::{Ranged, ValueFormatter},
5+
ranged3d::{ProjectionMatrix, ProjectionMatrixBuilder},
6+
};
17
use plotters_backend::DrawingBackend;
2-
use crate::chart::{ChartContext, axes3d::Axes3dStyle};
3-
use crate::coord::{ranged1d::{Ranged, ValueFormatter}, cartesian::Cartesian3d, ranged3d::{ProjectionMatrixBuilder, ProjectionMatrix}};
48

59
mod draw_impl;
610

src/chart/context/chart_context.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
use std::borrow::Borrow;
22

3-
use plotters_backend::{DrawingBackend, BackendCoord};
3+
use plotters_backend::{BackendCoord, DrawingBackend};
44

5+
use crate::chart::{SeriesAnno, SeriesLabelStyle};
56
use crate::coord::{CoordTranslate, ReverseCoordTranslate, Shift};
67
use crate::drawing::{DrawingArea, DrawingAreaErrorKind};
7-
use crate::element::{CoordMapper, PointCollection, Drawable};
8-
use crate::chart::{SeriesAnno, SeriesLabelStyle};
9-
10-
8+
use crate::element::{CoordMapper, Drawable, PointCollection};
119

1210
/// The context of the chart. This is the core object of Plotters.
1311
/// Any plot/chart is abstracted as this type, and any data series can be placed to the chart
@@ -24,7 +22,6 @@ pub struct ChartContext<'a, DB: DrawingBackend, CT: CoordTranslate> {
2422
pub(crate) drawing_area_pos: (i32, i32),
2523
}
2624

27-
2825
impl<'a, DB: DrawingBackend, CT: ReverseCoordTranslate> ChartContext<'a, DB, CT> {
2926
/// Convert the chart context into an closure that can be used for coordinate translation
3027
pub fn into_coord_trans(self) -> impl Fn(BackendCoord) -> Option<CT::From> {
@@ -96,4 +93,3 @@ impl<'a, DB: DrawingBackend, CT: CoordTranslate> ChartContext<'a, DB, CT> {
9693
Ok(self.alloc_series_anno())
9794
}
9895
}
99-

0 commit comments

Comments
 (0)