Spaces:
Sleeping
Sleeping
Update templates/output.html
Browse files- templates/output.html +18 -156
templates/output.html
CHANGED
|
@@ -2,8 +2,6 @@
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
-
<!-- Add Plotly.js CDN in <head> -->
|
| 6 |
-
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
|
| 7 |
<title>Report Viewer</title>
|
| 8 |
<style>
|
| 9 |
body {
|
|
@@ -22,9 +20,7 @@
|
|
| 22 |
max-width: 90%;
|
| 23 |
box-shadow: 0px 0px 15px rgba(236, 179, 101, 0.3);
|
| 24 |
}
|
| 25 |
-
.toggle-buttons {
|
| 26 |
-
margin-bottom: 20px;
|
| 27 |
-
}
|
| 28 |
.toggle-buttons a {
|
| 29 |
padding: 10px 15px;
|
| 30 |
background-color: #ECB365;
|
|
@@ -34,20 +30,7 @@
|
|
| 34 |
border-radius: 5px;
|
| 35 |
font-weight: bold;
|
| 36 |
}
|
| 37 |
-
.toggle-buttons a.active {
|
| 38 |
-
background-color: #d69f50;
|
| 39 |
-
}
|
| 40 |
-
.pagination {
|
| 41 |
-
margin-top: 15px;
|
| 42 |
-
}
|
| 43 |
-
.pagination a {
|
| 44 |
-
padding: 8px 12px;
|
| 45 |
-
background-color: #ECB365;
|
| 46 |
-
color: #041C32;
|
| 47 |
-
text-decoration: none;
|
| 48 |
-
margin: 0 5px;
|
| 49 |
-
border-radius: 5px;
|
| 50 |
-
}
|
| 51 |
.table-wrapper {
|
| 52 |
overflow-x: auto;
|
| 53 |
margin: auto;
|
|
@@ -65,10 +48,16 @@
|
|
| 65 |
padding: 10px;
|
| 66 |
text-align: center;
|
| 67 |
}
|
| 68 |
-
th {
|
| 69 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
}
|
| 71 |
-
/* Improved Button Styling */
|
| 72 |
.btn {
|
| 73 |
display: inline-block;
|
| 74 |
padding: 12px 20px;
|
|
@@ -80,9 +69,7 @@
|
|
| 80 |
font-weight: bold;
|
| 81 |
transition: background-color 0.3s ease;
|
| 82 |
}
|
| 83 |
-
.btn:hover {
|
| 84 |
-
background-color: #d69f50;
|
| 85 |
-
}
|
| 86 |
</style>
|
| 87 |
</head>
|
| 88 |
<body>
|
|
@@ -90,9 +77,9 @@
|
|
| 90 |
<!-- Toggle Buttons -->
|
| 91 |
<div class="toggle-buttons">
|
| 92 |
<a href="{{ url_for('report_view', report_type='pred', page=1) }}"
|
| 93 |
-
class="{% if report_type == 'pred' %}active{% endif %}">
|
| 94 |
-
|
| 95 |
-
|
| 96 |
</div>
|
| 97 |
|
| 98 |
<!-- Report Table -->
|
|
@@ -100,145 +87,20 @@
|
|
| 100 |
{{ table_html | safe }}
|
| 101 |
</div>
|
| 102 |
|
| 103 |
-
<!-- Chart Section -->
|
| 104 |
-
<div class="table-wrapper" style="margin-top: 30px;">
|
| 105 |
-
<h2 style="color:#ECB365;">Makable Predicted & Diff vs EngCts</h2>
|
| 106 |
-
<div id="line-chart" style="height: 400px;"></div>
|
| 107 |
-
</div>
|
| 108 |
-
|
| 109 |
-
<!-- Line Chart with Markers -->
|
| 110 |
-
<!-- <script>
|
| 111 |
-
const chartData = {{ chart_data | safe }};
|
| 112 |
-
|
| 113 |
-
const trace1 = {
|
| 114 |
-
x: chartData.EngCts,
|
| 115 |
-
y: chartData.Makable_Predicted,
|
| 116 |
-
type: 'scatter',
|
| 117 |
-
mode: 'lines+markers',
|
| 118 |
-
name: 'Makable_Predicted',
|
| 119 |
-
line: { color: '#00BFFF' }
|
| 120 |
-
};
|
| 121 |
-
|
| 122 |
-
const trace2 = {
|
| 123 |
-
x: chartData.EngCts,
|
| 124 |
-
y: chartData.Makable_Diff,
|
| 125 |
-
type: 'scatter',
|
| 126 |
-
mode: 'lines+markers',
|
| 127 |
-
name: 'Makable_Diff',
|
| 128 |
-
line: { color: '#FF6347' }
|
| 129 |
-
};
|
| 130 |
-
|
| 131 |
-
const layout = {
|
| 132 |
-
paper_bgcolor: "#04293A",
|
| 133 |
-
plot_bgcolor: "#041C32",
|
| 134 |
-
font: { color: "#ECB365" },
|
| 135 |
-
xaxis: { title: "EngCts" },
|
| 136 |
-
yaxis: { title: "Values" },
|
| 137 |
-
margin: { t: 40, l: 50, r: 30, b: 50 }
|
| 138 |
-
};
|
| 139 |
-
|
| 140 |
-
Plotly.newPlot('line-chart', [trace1, trace2], layout);
|
| 141 |
-
</script> -->
|
| 142 |
-
|
| 143 |
-
<!-- Dot Chart with Markers -->
|
| 144 |
-
<!-- <script>
|
| 145 |
-
const chartData = {{ chart_data | safe }};
|
| 146 |
-
|
| 147 |
-
const trace1 = {
|
| 148 |
-
x: chartData.EngCts,
|
| 149 |
-
y: chartData.Makable_Predicted,
|
| 150 |
-
type: 'scatter',
|
| 151 |
-
mode: 'markers', // Changed here
|
| 152 |
-
name: 'Makable_Predicted',
|
| 153 |
-
marker: { color: '#00BFFF' }
|
| 154 |
-
};
|
| 155 |
-
|
| 156 |
-
const trace2 = {
|
| 157 |
-
x: chartData.EngCts,
|
| 158 |
-
y: chartData.Makable_Diff,
|
| 159 |
-
type: 'scatter',
|
| 160 |
-
mode: 'markers', // Changed here
|
| 161 |
-
name: 'Makable_Diff',
|
| 162 |
-
marker: { color: '#FF6347' }
|
| 163 |
-
};
|
| 164 |
-
|
| 165 |
-
const layout = {
|
| 166 |
-
paper_bgcolor: "#04293A",
|
| 167 |
-
plot_bgcolor: "#041C32",
|
| 168 |
-
font: { color: "#ECB365" },
|
| 169 |
-
xaxis: { title: "EngCts" },
|
| 170 |
-
yaxis: { title: "Values" },
|
| 171 |
-
margin: { t: 40, l: 50, r: 30, b: 50 }
|
| 172 |
-
};
|
| 173 |
-
|
| 174 |
-
Plotly.newPlot('line-chart', [trace1, trace2], layout);
|
| 175 |
-
</script> -->
|
| 176 |
-
|
| 177 |
-
<!-- Dot Chart Fixed View -->
|
| 178 |
-
<script>
|
| 179 |
-
const chartData = {{ chart_data | safe }};
|
| 180 |
-
|
| 181 |
-
const trace1 = {
|
| 182 |
-
x: chartData.EngCts,
|
| 183 |
-
y: chartData.Makable_Predicted,
|
| 184 |
-
type: 'scatter',
|
| 185 |
-
mode: 'markers',
|
| 186 |
-
name: 'Makable_Predicted',
|
| 187 |
-
marker: { color: '#00BFFF', size: 8 }
|
| 188 |
-
};
|
| 189 |
-
|
| 190 |
-
const trace2 = {
|
| 191 |
-
x: chartData.EngCts,
|
| 192 |
-
y: chartData.Makable_Diff,
|
| 193 |
-
type: 'scatter',
|
| 194 |
-
mode: 'markers',
|
| 195 |
-
name: 'Makable_Diff',
|
| 196 |
-
marker: { color: '#FF6347', size: 8 }
|
| 197 |
-
};
|
| 198 |
-
|
| 199 |
-
const layout = {
|
| 200 |
-
paper_bgcolor: "#04293A",
|
| 201 |
-
plot_bgcolor: "#041C32",
|
| 202 |
-
font: { color: "#ECB365" },
|
| 203 |
-
xaxis: {
|
| 204 |
-
title: "EngCts",
|
| 205 |
-
tickangle: 0
|
| 206 |
-
},
|
| 207 |
-
yaxis: {
|
| 208 |
-
title: "Values",
|
| 209 |
-
tickfont: {
|
| 210 |
-
size: 10,
|
| 211 |
-
color: "#ECB365"
|
| 212 |
-
},
|
| 213 |
-
automargin: true, // 🔧 Add space for long labels
|
| 214 |
-
tickmode: "auto", // Let Plotly auto-decide tick values
|
| 215 |
-
nticks: 10, // Reduce clutter
|
| 216 |
-
},
|
| 217 |
-
margin: { t: 40, l: 80, r: 30, b: 50 } // ⬅️ Increase left margin for Y-axis labels
|
| 218 |
-
};
|
| 219 |
-
|
| 220 |
-
Plotly.newPlot('line-chart', [trace1, trace2], layout);
|
| 221 |
-
</script>
|
| 222 |
-
|
| 223 |
-
|
| 224 |
<!-- Pagination Controls -->
|
| 225 |
<div class="pagination">
|
| 226 |
{% if has_prev %}
|
| 227 |
-
|
| 228 |
{% endif %}
|
| 229 |
<span>Page {{ page }}</span>
|
| 230 |
{% if has_next %}
|
| 231 |
-
|
| 232 |
{% endif %}
|
| 233 |
</div>
|
| 234 |
|
| 235 |
-
<!-- Download
|
| 236 |
<div style="margin-top:20px;">
|
| 237 |
-
{% if report_type == 'pred' %}
|
| 238 |
<a href="{{ url_for('download_pred') }}" class="btn">Download Prediction CSV</a>
|
| 239 |
-
{% else %}
|
| 240 |
-
<a href="{{ url_for('download_class') }}" class="btn">Download Classification CSV</a>
|
| 241 |
-
{% endif %}
|
| 242 |
<a href="/" class="btn">Go Back</a>
|
| 243 |
</div>
|
| 244 |
</div>
|
|
|
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
<meta charset="UTF-8">
|
|
|
|
|
|
|
| 5 |
<title>Report Viewer</title>
|
| 6 |
<style>
|
| 7 |
body {
|
|
|
|
| 20 |
max-width: 90%;
|
| 21 |
box-shadow: 0px 0px 15px rgba(236, 179, 101, 0.3);
|
| 22 |
}
|
| 23 |
+
.toggle-buttons { margin-bottom: 20px; }
|
|
|
|
|
|
|
| 24 |
.toggle-buttons a {
|
| 25 |
padding: 10px 15px;
|
| 26 |
background-color: #ECB365;
|
|
|
|
| 30 |
border-radius: 5px;
|
| 31 |
font-weight: bold;
|
| 32 |
}
|
| 33 |
+
.toggle-buttons a.active { background-color: #d69f50; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
.table-wrapper {
|
| 35 |
overflow-x: auto;
|
| 36 |
margin: auto;
|
|
|
|
| 48 |
padding: 10px;
|
| 49 |
text-align: center;
|
| 50 |
}
|
| 51 |
+
th { background-color: #064663; }
|
| 52 |
+
.pagination { margin-top: 15px; }
|
| 53 |
+
.pagination a {
|
| 54 |
+
padding: 8px 12px;
|
| 55 |
+
background-color: #ECB365;
|
| 56 |
+
color: #041C32;
|
| 57 |
+
text-decoration: none;
|
| 58 |
+
margin: 0 5px;
|
| 59 |
+
border-radius: 5px;
|
| 60 |
}
|
|
|
|
| 61 |
.btn {
|
| 62 |
display: inline-block;
|
| 63 |
padding: 12px 20px;
|
|
|
|
| 69 |
font-weight: bold;
|
| 70 |
transition: background-color 0.3s ease;
|
| 71 |
}
|
| 72 |
+
.btn:hover { background-color: #d69f50; }
|
|
|
|
|
|
|
| 73 |
</style>
|
| 74 |
</head>
|
| 75 |
<body>
|
|
|
|
| 77 |
<!-- Toggle Buttons -->
|
| 78 |
<div class="toggle-buttons">
|
| 79 |
<a href="{{ url_for('report_view', report_type='pred', page=1) }}"
|
| 80 |
+
class="{% if report_type == 'pred' %}active{% endif %}">
|
| 81 |
+
Prediction Report
|
| 82 |
+
</a>
|
| 83 |
</div>
|
| 84 |
|
| 85 |
<!-- Report Table -->
|
|
|
|
| 87 |
{{ table_html | safe }}
|
| 88 |
</div>
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
<!-- Pagination Controls -->
|
| 91 |
<div class="pagination">
|
| 92 |
{% if has_prev %}
|
| 93 |
+
<a href="{{ url_for('report_view', report_type=report_type, page=page-1) }}">Previous</a>
|
| 94 |
{% endif %}
|
| 95 |
<span>Page {{ page }}</span>
|
| 96 |
{% if has_next %}
|
| 97 |
+
<a href="{{ url_for('report_view', report_type=report_type, page=page+1) }}">Next</a>
|
| 98 |
{% endif %}
|
| 99 |
</div>
|
| 100 |
|
| 101 |
+
<!-- Download & Nav Buttons -->
|
| 102 |
<div style="margin-top:20px;">
|
|
|
|
| 103 |
<a href="{{ url_for('download_pred') }}" class="btn">Download Prediction CSV</a>
|
|
|
|
|
|
|
|
|
|
| 104 |
<a href="/" class="btn">Go Back</a>
|
| 105 |
</div>
|
| 106 |
</div>
|