import sys
sys.path.insert(0, "/opt/coinglass-strategy")
from tools.generate_charts import collect, strat_b, get_correlation, build_html

data = collect()
sb = strat_b()
corr = get_correlation()
print("Corr assets:", len(corr.get("symbols",[])))

html = build_html(data, sb, corr)
has = "panel-corr" in html
print("Has corr tab:", has)

import re
tabs = re.findall(r"switchTab\('[^']*'\)", html)
print("Tabs:", tabs)

with open("/tmp/test_output.html", "w") as f:
    f.write(html[:5000])
print("Done")
