Skip to main content

Crate ferrochart_core

Crate ferrochart_core 

Source
Expand description

Platform-independent core of the FerroChart financial charting engine.

The core holds the data model, scales, layout, LOD and interaction state, and produces a backend-agnostic Frame. It never depends on GPU, windowing, font, time or async libraries and builds for wasm32-unknown-unknown.

Re-exports§

pub use chart::Chart;
pub use chart::ChartOptions;
pub use error::Error;
pub use error::Result;

Modules§

chart
Chart: the public object that owns data, scales and layout and builds frames.
data
Core data model: basic types, columnar (SoA) input formats and column storage.
drawing
Drawing tools.
error
Error type of the public API. Hand-written in thiserror style; the core does not depend on thiserror.
format
Number formats of axis and value labels: fixed decimals, automatic precision with subscript zeros, percentages and K/M/B.
frame
Frame: the platform-independent draw description that the core produces and the backends consume.
geom
Coordinate, span and color types.
interaction
Platform-independent input events and the interaction state machine: panning with kinetic scrolling, wheel and pinch zoom, axis dragging, keyboard navigation and the crosshair.
pane
Panes: plot areas stacked vertically that share the time scale, each with its own price scale.
plugin
Plugin interfaces: indicators, custom series, layer plugins and series transforms, and MinMaxIndex for plugins’ range queries.
price_scale
Price scales: value-to-y mapping (y = a * f(p) + b, f = identity or ln), auto-scaling, “nice number” ticks and price formatting.
render
The interface every rendering backend implements.
state
Saving and loading the state of a chart.
sync
Multi-chart sync: crosshair time, visible time range and drawings.
text
Text measurement interface and allocation-free text helpers.
theme
Themes: plain data (colors, sizes). All colors are resolved by the core before the frame is built; backends never see “up” or “down” semantics beyond the per-draw SeriesStyle.
time_scale
The global time scale (bar spacing, right offset, index <-> x) and the weight-based time tick algorithm, with pure-algorithm calendar math.
transform
Built-in series transforms: Renko, Range Bars, Kagi and Point & Figure. Their exact rules are in docs/book/src/series.md. Add one to a chart with Chart::add_transform_series.
transform_helpers
CPU implementation of the series transforms that the wgpu shaders perform.