Skip to main content

Crate orbital_data

Crate orbital_data 

Source
Expand description

Shared typed dataset primitives for Orbital tables and charts.

This crate provides Dataset, DataRecord, and DataValue — the canonical data model shared by orbital-datatable and orbital-charts. Because it has no UI or framework dependencies, any crate in the workspace can depend on it without introducing cycles.

§Example

use std::collections::HashMap;
use orbital_data::{DataRecord, DataSchema, DataValue, Dataset, FieldDef};

let schema = DataSchema::new(vec![
    FieldDef::text("name", "Name"),
    FieldDef::text("role", "Role"),
]);
let record = DataRecord::new(
    "1",
    HashMap::from([
        ("name".into(), DataValue::Text("Ada".into())),
        ("role".into(), DataValue::Text("Admin".into())),
    ]),
);
let dataset = Dataset::from_records(schema, vec![record]);
assert_eq!(dataset.records.len(), 1);

Structs§

ChartFieldBinding
Declarative binding from crate::Dataset fields to chart geometry.
DataRecord
One row of typed values, addressable by field key.
DataSchema
Schema describing the fields in a crate::Dataset.
Dataset
The shared shape. Tables render it; charts build series by field key.
FieldDef
Shared field descriptor — binding key for table columns and chart series.

Enums§

CompareHint
Column type hint for typed comparison (mirrors data table ColumnType without coupling).
DataType
Column/field data type descriptor.
DataValue
Typed cell value — replaces stringly-typed HashMap<String, String>.
ProjectionError
Errors raised when extracting or projecting chart columns from a crate::Dataset.

Functions§

text_map_from_strings
Convert a string map into typed text values.