Skip to content

Commit c36ffa2

Browse files
committed
Improve the surface series
1 parent 4a10b61 commit c36ffa2

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Plotters latest(?)
4+
5+
### Improved
6+
7+
- Surface series now supports more customizations
8+
39
## Plotters 0.3.0 (2020-09-03)
410
This is the next major release of Plotters, see [release notes](./RELEASE-NOTES.md) for more detials.
511

examples/wasm-demo/src/plot3d.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ pub fn draw(canvas: HtmlCanvasElement, pitch: f64, yaw: f64) -> DrawResult<()> {
2424

2525
chart.configure_axes().draw()?;
2626

27-
chart.draw_series(SurfaceSeries::<f64, _, f64>::new(
28-
x_axis.values(),
29-
z_axis.values(),
30-
|&x, &z| (x * x + z * z).cos(),
31-
&BLUE.mix(0.2),
32-
))?;
27+
chart.draw_series(
28+
SurfaceSeries::xoz(x_axis.values(), z_axis.values(), |x:f64, z:f64| {
29+
(x * x + z * z).cos()
30+
})
31+
.style(&BLUE.mix(0.2)),
32+
)?;
3333

3434
chart.draw_series(LineSeries::new(
3535
(-100..100)

src/series/surface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ macro_rules! impl_constructor {
137137
{
138138
pub fn $name<IterA, IterB>(a: IterA, b: IterB, f: SurfaceFunc) -> Self
139139
where
140-
IterA: DoubleEndedIterator<Item = <$dir as Direction<X, Y, Z>>::Input1Type>,
141-
IterB: DoubleEndedIterator<Item = <$dir as Direction<X, Y, Z>>::Input2Type>,
140+
IterA: Iterator<Item = <$dir as Direction<X, Y, Z>>::Input1Type>,
141+
IterB: Iterator<Item = <$dir as Direction<X, Y, Z>>::Input2Type>,
142142
{
143143
Self::new(a, b, f)
144144
}

0 commit comments

Comments
 (0)