plotkit-ndarray 0.4.0

ndarray integration for the plotkit plotting library
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented1 out of 1 items with examples
  • Size
  • Source code size: 11.15 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 378.1 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 6s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • anonymousAAK/plotrs
    2 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • anonymousAAK

ndarray integration for plotkit.

This crate activates ndarray support in plotkit-core, providing IntoSeries implementations for common ndarray one-dimensional array types. Depend on this crate (or enable the ndarray feature on the plotkit umbrella crate) to pass ndarray arrays directly to any plotkit charting function.

Supported types

Type Conversion
&Array1<f64> / Array1<f64> zero-copy (contiguous slice borrow)
ArrayView1<'_, f64> zero-copy when contiguous, O(n) copy when strided
&Array1<f32> / Array1<f32> O(n) widening cast
&Array1<i32> / Array1<i32> O(n) cast to f64
&Array1<i64> / Array1<i64> O(n) cast to f64
ArrayView1<'_, f32/i32/i64> O(n) cast to f64

Examples

use ndarray::array;
use plotkit_core::series::IntoSeries;

let arr = array![1.0, 2.0, 3.0];
let series = (&arr).into_series();
assert_eq!(series.data, vec![1.0, 2.0, 3.0]);