Transpile the C component ind_* function for every kind into
lightgui/xframe/indicators.py (tools/transpile_indicators.py), verified
250/250 against the C++ reference dump (<=1e-9, NaN patterns included).
IndicatorWidget gains the StockWidget series API (set_series, populate,
get_series, add_point, clear, load_csv, item_count, get_lines) and draws
the computed lines (14-colour palette, NaN gaps, dots for isolated
marker points) with the demo series as fallback. Docs in
docs/indicators-data.md; tests/test_indicators_csv.py (17 tests, golden
spot values vs the C++ reference); Xvfb shots via
tools/ind_csv_shots.py.
Every chart widget rendered only the baked-in 250-bar demo series:
no set_series existed in Python despite the docstring naming it, so
there was no way to plot real data at all. Now StockWidget holds up
to three series slots (primary + two extra for the multi-symbol
charts) via set_series (the C API), get_series, add_point, clear /
populate, item_count, and load_csv; all 37 draw paths read the
widget series through _bars(widget) instead of module DEMO_SERIES,
so derived series (Heikin-Ashi, Renko, VWAP, OBV, ...) rebuild from
the loaded data and the drawing tools inherit it as background.
load_csv reads date,open,high,low,close,volume with the stdlib csv
module: header optional (matched by name, any order, extra columns
ignored), dates YYYY-MM-DD / YYYY/MM/DD / DD-MM-YYYY / ISO datetime
/ epoch seconds (validated, not stored -- the x-axis is bar index),
ValueError naming the row on bad data. A cleared series draws a
no-data placeholder; a one-bar series draws (Price: flat change).
Tests: tests/test_stock_csv.py, 27 tests (parsing, API, headless
renders of all 24 chart kinds incl. CSV-vs-template pixel diff).
Fixture tests/data/ohlcv_30.csv (30 weekday bars). Full suite 311
tests pass; visreg 24/24 stock charts pixel-identical to template
goldens. Docs: docs/stock-charts-data.md. Screenshots:
tools/stock_csv_shots.py (Xvfb, RMSE 9-35% vs template goldens).
tools/visreg/run.sh re-renders every widget example the same way the
pythondoc sweep did (Xvfb, import -window root, crop to window size),
diffs each shot against its golden with ImageMagick RMSE (normalized,
0.5% threshold), and writes out/report.md + report.json with per-widget
PASS/FAIL and diff percentages. Goldens vendored from the pythondoc
sweep shots. Full run on a clean tree: 547/547 PASS, max diff 0.0%.
Cairo drawings for all 103 kinds in lightgui/xframe/stock.py and
instruments.py (seeded 250-bar demo series so charts show their
colours with no series data; ddaf4bd anchor guard: ParallelChannel /
Pitchfork draw with 0-2 anchors; plot guard below 16px height).
Property tables generated by tools/gen_props_phase6.py from the C
Phase 4 tables (103 kinds, 1008 props, 116 distinct names; symbol
model-only; corrected up/down rgb(0,150,0)/rgb(200,30,30)).
Registry-name dispatch in core.lookup so kind-sharing entries
(IndVWAP/IndAnchoredVWAP kind VWAP, TArrow kind Arrow) keep their
own archetype drawings and generic-only tables.
- tools/gen_props.py parses /opt/lightgui/src/props.h (common_props +
props_for tables, enum labels/values) and the 547-kind palette,
emitting lightgui/props.py; REQUIRED spot-checks enforce the
proposal SS2.1-SS2.10 lists against the C tables.
- Every kind gets the 43-prop generic set (Name, geometry, Color,
Font Name/Size/Color/Style, Border, Enabled, Visible, Hint,
ShowHint, Cursor, TabOrder, TabStop, Constraints, BorderSpacing,
AutoSize, Tag, Align, Anchors); 38 family custom tables cover the
generic widgets. Stock/Instrumentation get the generic set only
(Phase 6 adds theirs via register_custom_table()).
- Lazarus display names + model_only flags (stored, generator
comments, no live canvas effect); validate() canonicalises
bool/int/double/enum/color or raises ValueError.