feat: add HTML report screenshot generation via Playwright
- Add html_report.py module for Playwright-based screenshot generation - Add generate_html_report() method to SimpleRotationStrategy - Modify backtest_viewer.html to use window-scoped variables for external injection - Inject monthly/yearly returns table into screenshot - Auto-generate HTML report in __main__ after export_results() Output: simple_rotation_html_report.png with ranking table + monthly returns
This commit is contained in:
@@ -152,11 +152,15 @@ tr.below-threshold { color: #484f58; }
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let DATA = null;
|
||||
let currentIdx = 0;
|
||||
let playing = false;
|
||||
let playTimer = null;
|
||||
let rebalanceDays = [];
|
||||
// Use window. to allow external access (for Playwright screenshot injection)
|
||||
window.DATA = null;
|
||||
window.currentIdx = 0;
|
||||
window.playing = false;
|
||||
window.playTimer = null;
|
||||
window.rebalanceDays = [];
|
||||
|
||||
// Convenience aliases for script-internal use
|
||||
const DATA_PROXY = { get data() { return window.DATA; }, set data(v) { window.DATA = v; } };
|
||||
|
||||
const $ = id => document.getElementById(id);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user