Expand description
Polars integration for plotkit.
This crate activates Polars support in plotkit-core, providing
IntoSeries and
IntoCategories implementations
for Polars Series. Depend on this crate (or
enable the polars feature on the plotkit umbrella crate) to pass
Polars data directly to any plotkit charting function.
§Supported types
| Type | Conversion |
|---|---|
&Series (numeric: f64, f32, i32, i64, u32, u64) | O(n) cast to f64, nulls become NAN |
Series (numeric, owned) | delegates to borrowed impl |
&Series (string / Utf8) | O(n) extraction to Vec<String>, nulls become "null" |
§Examples
use polars::prelude::*;
use plotkit_core::series::IntoSeries;
let s = Series::new("values".into(), &[1.0_f64, 2.0, 3.0]);
let plotkit_series = (&s).into_series();
assert_eq!(plotkit_series.data, vec![1.0, 2.0, 3.0]);Re-exports§
pub use polars;
Structs§
- DfPlot
- A builder produced by
DataFramePlotExt::plot. Terminal methods (line,scatter,hist,bar) consume the builder and return a fully builtFigure, ready to.save(...)via the umbrella crate’sFigureExt. - Series
- A sequence of
f64values representing one dimension of chart data.
Traits§
- Data
Frame Plot Ext - Adds a pandas/seaborn-style
.plot()accessor to a PolarsDataFrame. - Into
Categories - Trait for types that can be converted into
Categories. - Into
Series - Trait for types that can be converted into a
Series.