diff --git a/examples/3d_charts/Cargo.toml b/examples/3d_charts/Cargo.toml index 48058077..78dcb9d5 100644 --- a/examples/3d_charts/Cargo.toml +++ b/examples/3d_charts/Cargo.toml @@ -5,6 +5,6 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.15.6" +ndarray = "0.16.0" rand = "0.8.5" plotly = { path = "../../plotly" } diff --git a/examples/3d_charts/src/main.rs b/examples/3d_charts/src/main.rs index ed484f73..cacbfb4d 100644 --- a/examples/3d_charts/src/main.rs +++ b/examples/3d_charts/src/main.rs @@ -12,7 +12,7 @@ use rand::Rng; // 3D Scatter Plots fn simple_scatter3d_plot() { let n: usize = 100; - let t: Vec = Array::linspace(0., 10., n).into_raw_vec(); + let t: Vec = Array::linspace(0., 10., n).into_raw_vec_and_offset().0; let y: Vec = t.iter().map(|x| x.sin()).collect(); let z: Vec = t.iter().map(|x| x.cos()).collect(); @@ -25,7 +25,7 @@ fn simple_scatter3d_plot() { fn customized_scatter3d_plot() { let n: usize = 100; - let t: Vec = Array::linspace(0., 10., n).into_raw_vec(); + let t: Vec = Array::linspace(0., 10., n).into_raw_vec_and_offset().0; let y: Vec = t.iter().map(|x| x.sin()).collect(); let z: Vec = t.iter().map(|x| x.cos()).collect(); let sizelookup = z.clone(); @@ -114,7 +114,7 @@ fn customized_scatter3d_plot() { // 3D Line Plots fn simple_line3d_plot() { let n: usize = 100; - let t: Vec = Array::linspace(0., 10., n).into_raw_vec(); + let t: Vec = Array::linspace(0., 10., n).into_raw_vec_and_offset().0; let y: Vec = t.iter().map(|x| x.sin()).collect(); let z: Vec = t.iter().map(|x| x.cos()).collect(); @@ -128,8 +128,8 @@ fn simple_line3d_plot() { // 3D Surface Plot fn surface_plot() { let n: usize = 100; - let x: Vec = Array::linspace(-10., 10., n).into_raw_vec(); - let y: Vec = Array::linspace(-10., 10., n).into_raw_vec(); + let x: Vec = Array::linspace(-10., 10., n).into_raw_vec_and_offset().0; + let y: Vec = Array::linspace(-10., 10., n).into_raw_vec_and_offset().0; let z: Vec> = x .iter() .map(|i| { diff --git a/examples/basic_charts/Cargo.toml b/examples/basic_charts/Cargo.toml index 82e198a4..8cc479e6 100644 --- a/examples/basic_charts/Cargo.toml +++ b/examples/basic_charts/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.15.6" +ndarray = "0.16.0" plotly = { path = "../../plotly" } rand = "0.8.5" rand_distr = "0.4.3" diff --git a/examples/basic_charts/src/main.rs b/examples/basic_charts/src/main.rs index 14f31adb..43d30911 100644 --- a/examples/basic_charts/src/main.rs +++ b/examples/basic_charts/src/main.rs @@ -17,7 +17,7 @@ use rand_distr::{Distribution, Normal, Uniform}; // Scatter Plots fn simple_scatter_plot() { let n: usize = 100; - let t: Vec = Array::linspace(0., 10., n).into_raw_vec(); + let t: Vec = Array::linspace(0., 10., n).into_raw_vec_and_offset().0; let y: Vec = t.iter().map(|x| x.sin()).collect(); let trace = Scatter::new(t, y).mode(Mode::Markers); @@ -30,7 +30,7 @@ fn simple_scatter_plot() { fn line_and_scatter_plots() { let n: usize = 100; let mut rng = rand::thread_rng(); - let random_x: Vec = Array::linspace(0., 1., n).into_raw_vec(); + let random_x: Vec = Array::linspace(0., 1., n).into_raw_vec_and_offset().0; let random_y0: Vec = Normal::new(5., 1.) .unwrap() .sample_iter(&mut rng) @@ -86,7 +86,7 @@ fn bubble_scatter_plots() { fn polar_scatter_plot() { let n: usize = 400; - let theta: Vec = Array::linspace(0., 360., n).into_raw_vec(); + let theta: Vec = Array::linspace(0., 360., n).into_raw_vec_and_offset().0; let r: Vec = theta .iter() .map(|x| { diff --git a/examples/images/Cargo.toml b/examples/images/Cargo.toml index 59a3bc34..cda293ac 100644 --- a/examples/images/Cargo.toml +++ b/examples/images/Cargo.toml @@ -6,5 +6,5 @@ edition = "2021" [dependencies] image = "0.25" -ndarray = "0.15.6" +ndarray = "0.16.0" plotly = { path = "../../plotly", features = ["plotly_image", "plotly_ndarray"] } diff --git a/examples/ndarray/Cargo.toml b/examples/ndarray/Cargo.toml index 4383ff13..444ca9cd 100644 --- a/examples/ndarray/Cargo.toml +++ b/examples/ndarray/Cargo.toml @@ -5,5 +5,5 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.15.6" +ndarray = "0.16.0" plotly = { path = "../../plotly", features = ["plotly_ndarray"] } diff --git a/examples/shapes/Cargo.toml b/examples/shapes/Cargo.toml index 23361d74..74599e29 100644 --- a/examples/shapes/Cargo.toml +++ b/examples/shapes/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.15.6" +ndarray = "0.16.0" plotly = { path = "../../plotly" } rand = "0.8.5" rand_distr = "0.4.3" diff --git a/examples/shapes/src/main.rs b/examples/shapes/src/main.rs index 84eaafc0..0554ad66 100644 --- a/examples/shapes/src/main.rs +++ b/examples/shapes/src/main.rs @@ -130,7 +130,7 @@ fn lines_positioned_relative_to_the_plot_and_to_the_axes() { } fn creating_tangent_lines_with_shapes() { - let x0 = Array::linspace(1.0, 3.0, 200).into_raw_vec(); + let x0 = Array::linspace(1.0, 3.0, 200).into_raw_vec_and_offset().0; let y0 = x0.iter().map(|v| *v * (v.powf(2.)).sin() + 1.).collect(); let trace = Scatter::new(x0, y0); diff --git a/examples/statistical_charts/Cargo.toml b/examples/statistical_charts/Cargo.toml index df5a20ac..dc8b1f9f 100644 --- a/examples/statistical_charts/Cargo.toml +++ b/examples/statistical_charts/Cargo.toml @@ -5,7 +5,7 @@ authors = ["Michael Freeborn "] edition = "2021" [dependencies] -ndarray = "0.15.6" +ndarray = "0.16.0" plotly = { path = "../../plotly" } rand = "0.8.5" rand_distr = "0.4.3" diff --git a/examples/statistical_charts/src/main.rs b/examples/statistical_charts/src/main.rs index f1c00633..8bde9c95 100644 --- a/examples/statistical_charts/src/main.rs +++ b/examples/statistical_charts/src/main.rs @@ -93,7 +93,7 @@ fn bar_chart_with_error_bars() { } fn colored_and_styled_error_bars() { - let x_theo: Vec = Array::linspace(-4., 4., 100).into_raw_vec(); + let x_theo: Vec = Array::linspace(-4., 4., 100).into_raw_vec_and_offset().0; let sincx: Vec = x_theo .iter() .map(|x| (x * std::f64::consts::PI).sin() / (*x * std::f64::consts::PI)) diff --git a/plotly/Cargo.toml b/plotly/Cargo.toml index ff9b07aa..660c54d1 100644 --- a/plotly/Cargo.toml +++ b/plotly/Cargo.toml @@ -30,7 +30,7 @@ image = { version = "0.25", optional = true } js-sys = { version = "0.3", optional = true } plotly_derive = { version = "0.9.0", path = "../plotly_derive" } plotly_kaleido = { version = "0.9.0", path = "../plotly_kaleido", optional = true } -ndarray = { version = "0.15.4", optional = true } +ndarray = { version = "0.16.0", optional = true } once_cell = "1" serde = { version = "1.0.132", features = ["derive"] } serde_json = "1.0.73" @@ -45,6 +45,6 @@ csv = "1.1.6" image = "0.25" itertools = ">=0.10, <0.14" itertools-num = "0.1.3" -ndarray = "0.15.4" +ndarray = "0.16.0" plotly_kaleido = { version = "0.9.0", path = "../plotly_kaleido" } rand_distr = "0.4" diff --git a/plotly/src/traces/scatter_polar.rs b/plotly/src/traces/scatter_polar.rs index 7951ed4d..7bb51073 100644 --- a/plotly/src/traces/scatter_polar.rs +++ b/plotly/src/traces/scatter_polar.rs @@ -266,7 +266,7 @@ where /// let theta: Array = Array::range(0., 360., 360. / n as f64); /// let mut rs: Array = Array::zeros((11, 11)); /// let mut count = 0.; - /// for mut row in rs.gencolumns_mut() { + /// for mut row in rs.columns_mut() { /// for index in 0..row.len() { /// row[index] = count + (index as f64).powf(2.); /// }