Skip to content

module

data

The data a chart draws: from src or data, whichever it was given, down to one x axis and some series.

Structs

  • Dataset

    A chart's data: the x labels, and a series of values per measure.

  • Series

    One series of a chart: its name and values, with why any value is missing, per-datum colours and uncertainty where the data gives them.

Functions

check_mixed

pub fn check_mixed(t: &Table, used: &[&str]) -> Result<(), String>

Refuse a dimension the chart doesn't use, rather than mix its values.

column_named

pub fn column_named(p: &Props, t: &Table, prop_name: &str, fallback: &[&str]) -> Option<String>

The columns a chart reads directly: named by a prop, else fallback.

dataset

pub fn dataset(p: &Props, t: &Table) -> Result<Dataset, String>

A table down to what the chart draws. Errors are for the reader.

first_of

pub fn first_of(t: &Table, kinds: &[Kind], not: &[&str]) -> Option<String>

The first column of a kind, other than these.

footnote

pub fn footnote(p: &Props, t: &Table) -> Vec<String>

Source: …, the unit and the base period.

is_total

pub fn is_total(label: &str) -> bool

Whether a label names a total, which parts already add up to.

local_table

pub fn local_table(p: &Props) -> Option<Rc<Table>>

data: as a table. Plain numbers (values:, or series: with labels:) count too.

loose

pub fn loose(p: &Props, t: &Table) -> Dataset

What a table has, for a chart that reads columns itself: for its table view and source line.

require

pub fn require(t: &Table, keys: &[&str]) -> Result<(), String>

Missing-column error, naming what there is.

x_range

pub fn x_range(p: &Props, xs: &[String], times: Option<&[f64]>) -> Result<Option<Vec<bool>>, String>

Which of xs (with their times, if they're dates) are between x-start and x-end, as [within_x_range] keeps them; None when neither is set.