1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! 2D visualization: turn geometry into pictures (SVG / PNG / GIF).
//!
//! A small rendering stack, backend-agnostic at the core and working
//! entirely in f64 pixel/point space -- it has no knowledge of `Rat`,
//! rings, or tiles. Callers flatten their geometry to points (via the
//! ring point's `.xy()`) before handing it here, which keeps rendering
//! decoupled from the exact-arithmetic core: nothing in the core
//! depends on `vis`.
//!
//! Always-available layers, bottom to top:
//!
//! - [`scene`] -- the declarative model ([`scene::Scene`] = a list of
//! [`scene::Item`]s: polylines, tiles, points, text, arrows) plus the
//! canonical SVG emitter ([`scene::Scene::to_svg`]) and the
//! math-to-pixel [`scene::Viewport`]. The one required backend.
//! - [`draw`] -- high-level helpers over the scene primitives
//! ([`draw::TileStyle`] / [`draw::MarkerStyle`], tile / point / arrow
//! drawing, and the [`draw::rainbow`] palette).
//! - [`plotutils`] -- f64 point/rect aliases ([`plotutils::P64`] /
//! [`plotutils::R64`]) and geometry helpers (centroid, bounds).
//! - [`notebook`] -- inline display of a `Scene` in evcxr Jupyter
//! notebooks (SVG always; PNG under the `raster` feature).
//!
//! Optional output backends (feature-gated), each fed by a `Scene`:
//!
//! - [`raster`] (`raster`) -- PNG via `resvg` + `tiny-skia`.
//! - [`pointcloud`] (`raster`) -- grid / animation layout of point clouds.
//! - [`animation`] (`animation`) -- multi-frame GIF from a `Scene` sequence.