Skip to main content

plotters_ternary/
lib.rs

1//! Publication-quality ternary diagrams built on Plotters.
2//!
3//! The crate combines a backend-independent ternary geometry and clipping kernel
4//! with a Cartesian-backed Plotters chart. It supports full and rectangularly
5//! cropped ternary views, configurable axes, native Plotters legends, scientific
6//! markers, polygons, composition-anchored text, regular-grid line contours,
7//! per-level contour styling, native legends, colour bars, and portable labels.
8//!
9//! Start with [`prelude`] for common stable types, then see the README and the
10//! examples for complete PNG/SVG rendering programs. Cubic-alpha contour
11//! construction requires the [`cubic-alpha`](https://docs.rs/plotters-ternary/latest/plotters_ternary/#cargo-features) feature.
12//!
13//! ## Guarantees and limits
14//!
15//! Ternary coordinates always retain semantic A/B/C order. Viewport clipping is
16//! mathematical and the viewport frame is invisible. Cubic contour fields share
17//! exact one-dimensional edge intervals and are C0 across regular-grid edges; C1
18//! continuity, cubic-alpha filled contours, irregular triangulation, and N-component grids
19//! are not provided in 0.1.0.
20
21pub mod chart;
22pub mod contour;
23pub mod coord;
24pub mod interpolation;
25pub mod prelude;
26pub mod series;
27
28pub use chart::{
29    AxisLabelFormat, AxisNamePosition, AxisTextStyle, CartesianChartContext, CartesianPlottingArea,
30    ContourColorBar, ContourColorBarOrientation, ContourColorBarPosition, ContourDisplayError,
31    ContourLabelAnchor, ContourLabelConfig, ContourLabelMode, ContourLabelPlacement,
32    ContourLabelStyle, CornerLabelVisibility, CroppedAxisPolicy, EndpointLabelPolicy, TernaryAxis,
33    TernaryAxisConfig, TernaryChart, TernaryChartBuilder, TernaryChartError, TernaryMesh,
34    TernaryMeshConfig, TickDirection, TickRangeMode, TickSpec, TickStyle,
35};
36pub use coord::{
37    CartesianSegment, ClippedSegment, Component, EQUILATERAL_TRIANGLE_HEIGHT, Error, Normalization,
38    PixelBounds, PixelPoint, PixelRect, TernaryCartesian, TernaryGeometry, TernaryPoint,
39    TernaryViewport, Tolerance, TriangleEdge, TriangleOrientation, TrianglePointLocation,
40    VertexOrder, ViewportAlignment, ViewportFit, ViewportPointLocation, ViewportTransform,
41    VisibleTriangleEdge, clip_segment, clip_segment_with_parameters,
42};
43pub use series::{
44    AnnotationClipMode, AnnotationError, AnnotationTextStyle, ContourBandBorderMode,
45    ContourBandStylePolicy, ContourLegendPolicy, ContourStylePolicy, HorizontalAnchor,
46    InvalidPointPolicy, LocalPoint, LocalSegment, MarkerClipMode, MarkerDrawing, MarkerElement,
47    MarkerError, MarkerFill, MarkerFillPolygon, MarkerGeometry, MarkerPartition, MarkerShape,
48    MarkerSlice, MarkerStyle, PointMarkerStyleProvider, PolygonError, PreparedPolygon,
49    ScalarMapResolution, SeriesError, SweepDirection, TernaryContourBandSeries,
50    TernaryContourSeries, TernaryInterpolation, TernaryLineSeries, TernaryPointSeries,
51    TernaryPolygon, TernaryScalarMapSeries, TernarySeries, TernarySmoothSeries, TernaryText,
52    TextAnchor, TextRotation, VerticalAnchor, prepare_points, prepare_polygon, prepare_polyline,
53};
54
55pub use contour::{
56    AdaptiveContourOptions, ContourBand, ContourBandOptions, ContourBandSet, ContourError,
57    ContourFragment, ContourInterpolation, ContourLevel, ContourOptions, ContourPath,
58    ContourRegion, ContourRegularization, ContourSet, CubicAlphaMethod, CubicAlphaOptions,
59    CubicBoundaryPolicy, CubicContourDiagnostics, FieldError, GridEvaluationError, GridVertexId,
60    LatticeCoordinate, RegularTernaryGrid, RegularTernaryScalarField, TernaryCoordinate,
61};
62pub use interpolation::BinaryExtrapolation;