damascene_core/plot/mod.rs
1//! Backend-neutral data and interaction state for the 2D `plot` widget:
2//! polished, hardware-accelerated 2D plots and graphs (time series, scatter,
3//! and — as the feature lands — area and bar charts).
4//!
5//! Scope and rationale live in `docs/PLOT2D_PLAN.md`. The short version: a
6//! 2D plot's data marks are a degenerate 3D scene (orthographic, all
7//! geometry at `z = 0`), so `plot` **reuses the shipped [`scene`](crate::scene)
8//! GPU pipelines** — screen-pixel anti-aliased lines and points, offscreen
9//! MSAA, color-managed linear blending, and the versioned-handle upload
10//! cache — rather than adding a parallel 2D renderer. This module owns the
11//! *data* and *interaction state* the widget carries; the pipelines that
12//! render it live in the backend crates, never here.
13//!
14//! ## API layering
15//!
16//! The surface is layered so a simple plot is a one-liner while a power user
17//! can build a custom plotting system from the same pieces:
18//!
19//! 1. `plot([...marks])` — the common case; auto-scaled axes, pan/zoom,
20//! and a crosshair for free.
21//! 2. [`Scale`] + axis configuration — override the warp (linear/time/log),
22//! ticks, and formatting per axis.
23//! 3. The public primitives — [`Scale`] and [`PlotView`] (here), plus the
24//! series handle and data op — compose a bespoke chart with no `plot()`
25//! at all.
26
27pub mod decimate;
28pub mod lower;
29pub mod palette;
30pub mod request;
31pub mod resolve;
32pub mod scale;
33pub mod series;
34pub mod spec;
35pub mod view;
36
37pub use decimate::Decimation;
38pub use request::PlotRequest;
39pub use scale::{Scale, Tick};
40pub use series::{Sample, SeriesBounds, SeriesHandle};
41pub use spec::{
42 Axis, LegendPosition, LineMark, Mark, PlotControls, PlotSpec, PlotStyle, ScatterMark, line,
43 scatter,
44};
45pub use view::{AxisView, PlotView};