"""Metrologist blueprint - SPC statistics and dashboards.""" from flask import Blueprint, render_template, session, redirect, url_for statistics_bp = Blueprint("statistics", __name__) @statistics_bp.route("/dashboard") def dashboard(): """SPC dashboard overview.""" if "user" not in session: return redirect(url_for("auth.login")) return render_template("statistics/dashboard.html") @statistics_bp.route("/control-chart") def control_chart(): """X-bar / R control chart.""" if "user" not in session: return redirect(url_for("auth.login")) return render_template("statistics/control_chart.html") @statistics_bp.route("/histogram") def histogram(): """Histogram with normal curve.""" if "user" not in session: return redirect(url_for("auth.login")) return render_template("statistics/histogram.html") @statistics_bp.route("/capability") def capability(): """Cp/Cpk/Pp/Ppk capability gauge.""" if "user" not in session: return redirect(url_for("auth.login")) return render_template("statistics/capability.html") @statistics_bp.route("/trend") def trend(): """Temporal trends and period comparison.""" if "user" not in session: return redirect(url_for("auth.login")) return render_template("statistics/trend.html")