Skip to main content

teksilo_charts/
lib.rs

1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! `teksilo-charts` — BarChart, LineChart, and PieChart for Teksilo.
5//!
6//! All three render via the existing [`teksilo_canvas`] Path / fill_rect /
7//! draw_line API and integrate with the standard widget tree, signal /
8//! prop binding, and theme system.
9//!
10//! - [`BarChart`] — vertical or horizontal bars, single or grouped series.
11//! - [`LineChart`] — points connected by polylines, optional area fill
12//!   and per-point hover tooltips.
13//! - [`PieChart`] — pie or donut (via `inner_radius_ratio`), with an
14//!   optional center widget slot for donut total / icon / drilldown.
15//!
16//! Series data lives in a [`teksilo_data::ChartModel`] — the reactive,
17//! multi-series data model shared by all three chart widgets (mirroring
18//! `ListModel`/`TreeModel` in shape). `T` is the category / x-axis type.
19//! Numeric values are always `f32`. Default series colors come from
20//! [`ChartPalette::FromTheme`], which reads the active theme's
21//! `chart_palette` (Okabe-Ito by default). Per-datum marks are exposed to
22//! assistive technology as synthetic AT nodes and are the basis of the
23//! hover/selection hit-testing shared across the three chart kinds.
24
25pub mod axis;
26pub mod bar_chart;
27pub(crate) mod hit;
28pub mod layout;
29pub mod legend;
30pub mod line_chart;
31pub mod palette;
32pub mod pattern;
33pub mod pie_chart;
34#[cfg(feature = "preview")]
35mod preview_catalog;
36pub mod recipe_style;
37pub mod reference_line;
38pub mod style;
39pub(crate) mod text;
40
41pub use axis::{AxisConfig, auto_tick_count, nice_ticks};
42pub use bar_chart::{BarChart, BarGrouping, BarOrientation};
43pub use layout::LegendPosition;
44pub use legend::{ChartLegend, LegendOrientation};
45pub use line_chart::LineChart;
46pub use palette::ChartPalette;
47pub use pattern::{LegendSwatch, PatternPolicy};
48pub use pie_chart::{PieChart, PieLabelMode};
49pub use recipe_style::RecipeChartStyle;
50pub use teksilo_data::{
51    ChartAggregate, ChartAggregateFn, ChartDatum, ChartModel, ChartSelection, ChartSeries,
52    ChartSource, ChartWindow, SeriesHatch, SeriesId, SeriesMarker, SeriesPattern, SeriesView,
53};