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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! Core chart engine for high-performance financial charting.
//!
//! This module is the heart of the `egui-charts` crate, providing a TradingView-like
//! charting engine built on [`egui`]. It is organized into several sub-modules that
//! separate concerns cleanly:
//!
//! # Architecture
//!
//! ```text
//! ┌─────────────┐
//! │ builder.rs │ ChartBuilder / TradingChart
//! └──────┬───────┘
//! │ owns
//! ┌──────▼───────┐
//! │ widget::Chart│ Core chart widget (state + data)
//! └──────┬───────┘
//! ┌────────┬───────────┼───────────┬──────────┐
//! │ │ │ │ │
//! ┌────▼───┐┌───▼────┐┌────▼───┐┌──────▼───┐┌────▼────────┐
//! │ coords ││pan_zoom││interact││ rendering ││tool_interact│
//! │ ││ ││ ││ ││ │
//! │idx ↔ x ││scroll ││keys ││candles ││drawings │
//! │price↔y ││zoom ││track ││grid/axes ││selection │
//! └────────┘│kinetic ││focus ││overlays ││effects │
//! └────────┘└───────┘│pipeline │└─────────────┘
//! └───────────┘
//! ```
//!
//! # Public Modules
//!
//! | Module | Purpose |
//! |--------|---------|
//! | [`builder`] | `ChartBuilder` (fluent API) and `TradingChart` (runtime wrapper) |
//! | [`coords`] | Unified coordinate system — single source of truth for idx/price ↔ screen |
//! | [`series`] | Series types (Line, Area, Baseline, Histogram, Bar) with hit testing and selection |
//! | [`series_api`] | TradingView-compatible `ISeriesApi` / `ITimeScaleApi` / `IStudyApi` traits |
//! | [`overlays`] | Visual overlays — order lines, heatmap strips, volume bubbles |
//!
//! # Internal Modules (crate-only)
//!
//! The remaining sub-modules (`state`, `interaction`, `pan_zoom`, `helpers`,
//! `hit_test`, `indicators`, `selection`, `cursor_modes`, `tool_interaction`,
//! `renderers`, `rendering`) are implementation details and not part of the
//! public API.
//!
//! # Getting Started
//!
//! The primary entry point for consumers is [`builder::ChartBuilder`]:
//!
//! ```rust,ignore
//! use egui_charts::ChartBuilder;
//!
//! let mut trading_chart = ChartBuilder::extended()
//! .with_symbol("BTCUSDT")
//! .with_timeframe(Timeframe::Min1)
//! .with_data_src(Box::new(my_data_source))
//! .build();
//!
//! // In your update loop:
//! trading_chart.update();
//! trading_chart.show(ui);
//! ```
// Internal engine modules — used within the crate but not part of the public API.
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub