Skip to content

Commit 010bbc4

Browse files
authored
add tests (#96)
* add tests * add tests
1 parent fdd65bf commit 010bbc4

19 files changed

+3367
-1539
lines changed

plotly/examples/basic_charts.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use itertools_num::linspace;
2-
use plotly::common::{
3-
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode,
4-
Orientation, Title,
5-
};
6-
use plotly::layout::{Axis, BarMode, Layout, Legend, TicksDirection, TraceOrder};
7-
use plotly::sankey::{Line as SankeyLine, Link, Node};
82
use plotly::{
93
color::{NamedColor, Rgb, Rgba},
4+
common::{
5+
ColorScale, ColorScalePalette, DashType, Fill, Font, Line, LineShape, Marker, Mode,
6+
Orientation, Title,
7+
},
8+
layout::{Axis, BarMode, Layout, Legend, TicksDirection, TraceOrder},
9+
sankey::{Line as SankeyLine, Link, Node},
1010
Bar, Plot, Sankey, Scatter, ScatterPolar,
1111
};
1212
use rand_distr::{Distribution, Normal, Uniform};

plotly/examples/fundamentals.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
use itertools_num::linspace;
2-
use plotly::common::{DashType, Fill, Font, Mode};
3-
use plotly::layout::{
4-
Axis, GridPattern, Layout, LayoutGrid, Margin, Shape, ShapeLayer, ShapeLine, ShapeType,
2+
use plotly::{
3+
color::NamedColor,
4+
common::{DashType, Fill, Font, Mode},
5+
layout::{
6+
Axis, GridPattern, Layout, LayoutGrid, Margin, Shape, ShapeLayer, ShapeLine, ShapeType,
7+
},
8+
Bar, Plot, Scatter,
59
};
6-
use plotly::{color::NamedColor, Bar, Plot, Scatter};
710
use rand::thread_rng;
811
use rand_distr::{Distribution, Normal};
912

plotly/examples/plot3d.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use itertools_num::linspace;
2-
use plotly::common::{ColorScale, ColorScalePalette, Marker, MarkerSymbol, Mode, Title};
3-
use plotly::layout::{Axis, Layout};
4-
use plotly::{Plot, Scatter3D, Surface};
2+
use plotly::{
3+
common::{ColorScale, ColorScalePalette, Marker, MarkerSymbol, Mode, Title},
4+
layout::{Axis, Layout},
5+
Plot, Scatter3D, Surface,
6+
};
57

68
// 3D Scatter Plots
79
fn simple_scatter3d_plot(show: bool) {
@@ -26,7 +28,7 @@ fn customized_scatter3d_plot(show: bool) {
2628
let z: Vec<f64> = t.iter().map(|x| x.cos()).collect();
2729
let sizelookup = z.clone();
2830

29-
let trace = Scatter3D::new(t.clone(), y.clone(), z.iter().map(|i| -i))
31+
let trace = Scatter3D::new(t.clone(), y.clone(), z.iter().map(|i| -i).collect())
3032
.mode(Mode::Markers)
3133
.marker(
3234
Marker::new()

plotly/examples/statistical_charts.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use itertools_num::linspace;
2-
use plotly::box_plot::{BoxMean, BoxPoints};
3-
use plotly::common::{ErrorData, ErrorType, Line, Marker, Mode, Orientation, Title};
4-
use plotly::histogram::{Bins, Cumulative, HistFunc, HistNorm};
5-
use plotly::layout::{Axis, BarMode, BoxMode, Layout, Margin};
62
use plotly::{
3+
box_plot::{BoxMean, BoxPoints},
74
color::{NamedColor, Rgb, Rgba},
5+
common::{ErrorData, ErrorType, Line, Marker, Mode, Orientation, Title},
6+
histogram::{Bins, Cumulative, HistFunc, HistNorm},
7+
layout::{Axis, BarMode, BoxMode, Layout, Margin},
88
Bar, BoxPlot, Histogram, Plot, Scatter,
99
};
1010
use rand_distr::{Distribution, Normal, Uniform};

0 commit comments

Comments
 (0)