Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Fixed

- Handling nulls in line series

## [0.3.0] - 2026-02-19

### Changed
Expand Down
1 change: 0 additions & 1 deletion examples/bitcoin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use plotive::{data, des};
mod common;

fn main() {
// FIXME: support parsing datetime in CSV
let btc_csv = common::example_res("BTC-USD.csv");
let csv_data = std::fs::read_to_string(&btc_csv).unwrap();
let data_source = data::csv::parse_str(&csv_data, Default::default()).unwrap();
Expand Down
12 changes: 10 additions & 2 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ pub enum SampleRef<'a> {
impl SampleRef<'_> {
/// Check if the sample is null
pub fn is_null(&self) -> bool {
matches!(self, SampleRef::Null)
match self {
SampleRef::Null => true,
SampleRef::Num(v) => !v.is_finite(),
_ => false,
}
}

/// Get the sample as a numeric value, if possible
Expand Down Expand Up @@ -200,7 +204,11 @@ pub enum Sample {
impl Sample {
/// Check if the sample is null
pub fn is_null(&self) -> bool {
matches!(self, Sample::Null)
match self {
Sample::Null => true,
Sample::Num(v) => !v.is_finite(),
_ => false,
}
}

/// Get the sample as a numeric value, if possible
Expand Down
Loading
Loading