Multi-Excel Data Dashboard with Analytics

By Sapan Sora · Published July 25, 2026

Build a self-contained HTML dashboard embedding SheetJS and Chart.js to visualize and analyze multi-Excel data with interactive charts.

  • excel
  • dashboard
  • data-visualization
  • sheetjs
  • chartjs
  • html
2 cells1 experiment21 views1 forks

Inside this notebook

# Assemble the single self-contained dashboard: inline SheetJS + Chart.js into the HTML template.
from pathlib import Path

vendor = Path("/home/user/vendor")
template = Path("/home/user/app_template.html").read_text(encoding="utf-8")

xlsx_js = (vendor / "xlsx.full.min.js").read_text(encoding="utf-8")
chart_js = (vendor / "chart.umd.min.js").read_text(encoding="utf-8")

# Sanity: markers must each appear exactly once and NOT inside the library code
assert template.count("/*__XLSX__*/") == 1, "XLSX marker missing/duplicated"
assert template.count("/*__CHART__*/") == 1, "CHART marker missing/duplicated"
assert "/*__XLSX__*/" not in xlsx_js and "/*__CHART__*/" not in chart_js, "marker collision in vendor code"

html = template.replace("/*__XLSX__*/", xlsx_js).replace("/*__CHART__*/", chart_js)

# Confirm both libs are now embedded and no placeholder markers remain
assert "/*__XLSX__*/" not in html and "/*__CHART__*/" not in html
…
# Final verification: file completeness + JS bracket balance of the app script.
import re, os

path = "/home/user/excel_dashboard.html"
html = open(path, encoding="utf-8").read()
print("file bytes on disk :", f"{os.path.getsize(path):,}")
print("ends with </html>  :", html.rstrip().endswith("</html>"))

scripts = re.findall(r"<script>(.*?)</script>", html, flags=re.S)
app = scripts[-1]
print("script blocks      :", len(scripts), "| app script chars:", f"{len(app):,}")

def strip_js(code):
    """Remove comments/strings/templates so bracket counts aren't fooled."""
    out, i, n, mode = [], 0, len(code), None
    while i < n:
        c = code[i]; nxt = code[i+1] if i+1 < n else ""
        if mode is None:
…
Multi-Excel Data Dashboard with Analytics | Clusy