diff --git a/Cargo.lock b/Cargo.lock index ffbcfc9..f1c46f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,18 +150,18 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bon" -version = "1.2.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e4c5fa2da1ff5ce802338a5c34eb28c62da9d6144d1f52612473dbbc7b3a51" +checksum = "ea8256e3cff531086cc3faf94c1649930ff64bceb2d0e8cc84fc0356d7ee9806" dependencies = [ "bon-macros", ] [[package]] name = "bon-macros" -version = "1.2.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c378eb299098565855276f54d0c01cbee8af3eaea1722f37dcedce2aebd5bb3" +checksum = "b99838f77c5073bc7846ecce92b64e7e5a5bd152a8ec392facf90ee4d90b4b35" dependencies = [ "darling", "ident_case", diff --git a/Cargo.toml b/Cargo.toml index 55091b4..0e701b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["chart", "plot", "plotly", "polars", "visualization"] categories = ["visualization"] [dependencies] -bon = "1.2.0" +bon = "2.0.0" plotly = "0.9.0" polars = { version = "0.42", features = ["dtype-categorical", "lazy", "strings"] } serde = "1.0.208" diff --git a/README.md b/README.md index 1a251e2..fca3610 100644 --- a/README.md +++ b/README.md @@ -64,10 +64,10 @@ fn main() { .unique().unwrap(); let layout = Layout::new() - .title(Title::new("Penguin Flipper Length vs Body Mass")) - .x_axis(Axis::new().title(Title::new("Body Mass (g)"))) - .y_axis(Axis::new().title(Title::new("Flipper Length (mm)"))) - .legend(Legend::new().title(Title::new("Species"))); + .title(Title::with_text("Penguin Flipper Length vs Body Mass")) + .x_axis(Axis::new().title(Title::with_text("Body Mass (g)"))) + .y_axis(Axis::new().title(Title::with_text("Flipper Length (mm)"))) + .legend(Legend::new().title(Title::with_text("Species"))); let mut plot = Plot::new(); plot.set_layout(layout); diff --git a/src/traces/barplot.rs b/src/traces/barplot.rs index 5fd6aa9..f0a75ba 100644 --- a/src/traces/barplot.rs +++ b/src/traces/barplot.rs @@ -88,7 +88,7 @@ impl VerticalBarPlot { /// /// ![Vertical Bar Plot](https://imgur.com/Fd6DpB0.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( data: &DataFrame, x: String, @@ -258,7 +258,7 @@ impl HorizontalBarPlot { /// /// ![Horizontal Bar Plot](https://imgur.com/saoTcNg.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( data: &DataFrame, x: String, diff --git a/src/traces/boxplot.rs b/src/traces/boxplot.rs index 95fc227..93c7c82 100644 --- a/src/traces/boxplot.rs +++ b/src/traces/boxplot.rs @@ -96,7 +96,7 @@ impl VerticalBoxPlot { /// /// ![Vertical Box Plot](https://imgur.com/0Zn0mFu.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( data: &DataFrame, x: String, @@ -281,7 +281,7 @@ impl HorizontalBoxPlot { /// /// ![Horizontal Box Plot](https://imgur.com/Lu92liU.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( data: &DataFrame, x: String, diff --git a/src/traces/lineplot.rs b/src/traces/lineplot.rs index f24c68d..2e36d01 100644 --- a/src/traces/lineplot.rs +++ b/src/traces/lineplot.rs @@ -93,7 +93,7 @@ impl LinePlot { /// /// ![Line Plot](https://imgur.com/cOH707b.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( // Data data: &DataFrame, diff --git a/src/traces/scatterplot.rs b/src/traces/scatterplot.rs index 66e5cf0..2f1a0d8 100644 --- a/src/traces/scatterplot.rs +++ b/src/traces/scatterplot.rs @@ -86,7 +86,7 @@ impl ScatterPlot { /// /// ![Scatter Plot](https://imgur.com/f5vgrNd.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( // Data data: &DataFrame, diff --git a/src/traces/timeseriesplot.rs b/src/traces/timeseriesplot.rs index 8b99bfe..f69d940 100644 --- a/src/traces/timeseriesplot.rs +++ b/src/traces/timeseriesplot.rs @@ -93,7 +93,7 @@ impl TimeSeriesPlot { /// /// ![Time Series Plot](https://imgur.com/sjxJ2og.png) /// - #[builder] + #[builder(on(String, into), on(Text, into))] pub fn new( // Data data: &DataFrame,