feat(lapaloma-financial): OHLC + candlesticks con preserva-volatilidad
- axis.rs: paint_axes extraído a función pública reusable entre crates de visualización. LapalomaChartElement::paint_axes ahora es un thin wrapper. - OhlcBuffer: stride 6 f32 por bar (t, o, h, l, c, v). Bar struct con is_bull/is_bear. price_range y time_range. 5 tests. - aggregate_time_bucketed (sección 3.2 del ARCHITECTURE.md): buckets por TIEMPO (no índice) — open=first, close=last, high=max, low=min, volume=sum. Preserva volatilidad (los wicks sobreviven al downsample, a diferencia de LTTB). Fallback a copy 1:1 si el span temporal es cero. 4 tests cubren bucket count, preservation of volatility, fallback, empty input. - paint_candlesticks: render agnóstico contra el trait Canvas. Wick = stroke_line vertical (high → low). Body = fill_rect open ↔ close con color bull/bear/neutral. body_width derivado del spacing entre bars (con body_min_width floor). - LapalomaCandlestickElement: Element GPUI que reusa paint_axes + paint_candlesticks. Sin pan-blit cache en v0.1 (≤500 bars on-screen no lo necesita). - crates/apps/lapaloma-financial-demo: random walk determinístico (xorshift32 inline + seed fijo) de 120 bars, pan + zoom + reset igual que el cartesian demo. Paleta nórdica para bull (#a3be8c) y bear (#bf616a). 60 tests verdes (28 cartesian + 20 core + 9 financial + 3 render). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -11,4 +11,8 @@ description = "Lapaloma — gráficos financieros. OHLC / candlesticks con agreg
|
||||
lapaloma-core = { path = "../../libs/lapaloma-core" }
|
||||
lapaloma-render = { path = "../lapaloma-render" }
|
||||
lapaloma-cartesian = { path = "../lapaloma-cartesian" }
|
||||
gpui = { workspace = true }
|
||||
gpui = { workspace = true, optional = true }
|
||||
|
||||
[features]
|
||||
default = ["gpui"]
|
||||
gpui = ["dep:gpui", "lapaloma-render/gpui", "lapaloma-cartesian/gpui"]
|
||||
|
||||
Reference in New Issue
Block a user