Skip to content

Chart eng v1#18

Merged
TimelordUK merged 4 commits intomainfrom
chart_eng_v1
Aug 31, 2025
Merged

Chart eng v1#18
TimelordUK merged 4 commits intomainfrom
chart_eng_v1

Conversation

@TimelordUK
Copy link
Owner

No description provided.

TimelordUK and others added 4 commits August 31, 2025 17:54
🎯 Complete standalone terminal-based charting solution:

Features:
- Standalone sql-cli-chart binary (non-invasive architecture)
- Smart timestamp parsing (RFC3339 + naive datetime formats)
- Auto-scaling with 10% padding for optimal data visibility
- Interactive vim-like controls (hjkl pan, +/- zoom, r reset)
- Time series support with epoch conversion and HH:MM:SS labels

Architecture:
- Clean modular design in src/chart/
- ChartEngine: Data processing and query execution
- LineRenderer: Time series visualization with ratatui
- ChartTui: Interactive terminal interface
- ChartViewport: Pan/zoom state management

VWAP Integration:
- Perfect for algo trading data analysis
- Handles snapshot_time vs average_price charts
- Volume analysis and correlation plots
- Filters client vs algo orders effectively

Usage Examples:
./target/release/sql-cli-chart data/production_vwap_final.csv \
  -q "SELECT snapshot_time, average_price FROM vwap WHERE filled_quantity > 0" \
  -x snapshot_time -y average_price -t "VWAP Price Over Time"

Technical:
- Non-blocking: Zero interference with TUI refactoring
- Extensible: Easy to add candlestick, scatter, bar charts
- Future-ready: Can integrate into main TUI when ready
- Performance: btm-quality terminal graphics

🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
📊 Complete SQL Query Integration for Charts:
- SQL queries now execute before charting (no more Christmas tree!)
- Filters 3320 rows → 991 CLIENT-only rows for clean visualizations
- Demonstrates power of SQL filtering for focused analysis

📝 Documentation & Examples:
- Added comprehensive charting section to README
- Real-world VWAP trading analysis examples
- Shows CLIENT vs ALL orders comparison (clean vs noisy)

🎯 Example Scripts:
- scripts/chart-vwap-price.sh - VWAP average price over time
- scripts/chart-vwap-volume.sh - Fill quantity progression
- scripts/chart-vwap-algo-comparison.sh - Interactive order type comparison

🔧 Technical Improvements:
- Fixed query execution in chart_main.rs
- Proper Arc<DataTable> handling for query engine
- Removed unused imports and cleaned up warnings

The charting tool now perfectly demonstrates the separation of concerns:
SQL engine filters data → Chart engine visualizes results → Clean patterns emerge

🚀 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove unused NaiveDateTime import from chart/engine.rs
- Remove unused QueryEngine import from non_interactive.rs

CI runs with -D warnings flag which treats warnings as errors
@TimelordUK TimelordUK merged commit 867586e into main Aug 31, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant