Skip to content

Commit 446590b

Browse files
committed
Implement memory data
1 parent 7c51867 commit 446590b

1 file changed

Lines changed: 159 additions & 0 deletions

File tree

term_timer/server/templates/algorithm.html

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,64 @@
378378
}
379379
});
380380
}
381+
382+
// Memory Sub-scores Radar Chart
383+
const memoryRadarCtx = document.getElementById('memoryRadarChart');
384+
if (memoryRadarCtx) {
385+
{% set memory = algorithm.memory %}
386+
new Chart(memoryRadarCtx, {
387+
type: 'radar',
388+
data: {
389+
labels: [
390+
'Length',
391+
'Chunking',
392+
'Structure',
393+
'Repetition',
394+
'Face Diversity',
395+
'Flow',
396+
'Familiarity'
397+
],
398+
datasets: [{
399+
label: 'Difficulty Score',
400+
data: [
401+
{{ "%.1f"|format(memory.length_score) }},
402+
{{ "%.1f"|format(memory.chunk_score) }},
403+
{{ "%.1f"|format(memory.structure_score) }},
404+
{{ "%.1f"|format(memory.repetition_score) }},
405+
{{ "%.1f"|format(memory.face_diversity_score) }},
406+
{{ "%.1f"|format(memory.flow_score) }},
407+
{{ "%.1f"|format(memory.move_familiarity_score) }}
408+
],
409+
backgroundColor: 'rgba(255, 99, 132, 0.2)',
410+
borderColor: 'rgba(255, 99, 132, 1)',
411+
borderWidth: 2,
412+
pointBackgroundColor: 'rgba(255, 99, 132, 1)',
413+
pointBorderColor: '#fff',
414+
pointHoverBackgroundColor: '#fff',
415+
pointHoverBorderColor: 'rgba(255, 99, 132, 1)'
416+
}]
417+
},
418+
options: {
419+
responsive: true,
420+
maintainAspectRatio: true,
421+
plugins: {
422+
legend: { display: false },
423+
title: {
424+
display: true,
425+
text: 'Memory Difficulty Breakdown',
426+
font: { size: 16 }
427+
}
428+
},
429+
scales: {
430+
r: {
431+
beginAtZero: true,
432+
max: 100,
433+
ticks: { stepSize: 20 }
434+
}
435+
}
436+
}
437+
});
438+
}
381439
});
382440
</script>
383441
<script type="module">
@@ -961,6 +1019,107 @@ <h3 class="alg-section-title">Suggestions</h3>
9611019
</div>
9621020
</div>
9631021

1022+
<!-- Memory Analysis -->
1023+
<div class="card">
1024+
<div class="card-header">
1025+
<h2 class="card-title">
1026+
<i class="fas fa-brain"></i>
1027+
<a href="#memory" id="memory">Memory Analysis</a>
1028+
</h2>
1029+
</div>
1030+
<div class="card-body">
1031+
{% set memory = algorithm.memory %}
1032+
<div class="alg-ergo-grid">
1033+
<div>
1034+
<h3 class="alg-section-title">Overall Rating</h3>
1035+
<div class="alg-rating-box">
1036+
<div class="alg-comfort-score {% if memory.memory_score >= 80 %}score-very-poor{% elif memory.memory_score >= 60 %}score-poor{% elif memory.memory_score >= 40 %}score-fair{% elif memory.memory_score >= 20 %}score-good{% else %}score-excellent{% endif %}">
1037+
{{ "%.1f"|format(memory.memory_score) }}
1038+
</div>
1039+
<div class="alg-rating-label">
1040+
{{ memory.memory_rating }}
1041+
</div>
1042+
</div>
1043+
<div class="alg-metric-row">
1044+
<strong>Move Count:</strong> {{ memory.move_count }}
1045+
</div>
1046+
<div class="alg-metric-row">
1047+
<strong>Effective Chunks:</strong> {{ memory.effective_chunks }}
1048+
</div>
1049+
<div class="alg-metric-row">
1050+
<strong>Distinct Faces:</strong> {{ memory.distinct_faces }}
1051+
</div>
1052+
</div>
1053+
1054+
<div>
1055+
<h3 class="alg-section-title">Sub-scores</h3>
1056+
<table class="alg-table">
1057+
<tr>
1058+
<td><strong>Length</strong></td>
1059+
<td class="alg-value">{{ "%.1f"|format(memory.length_score) }}</td>
1060+
</tr>
1061+
<tr>
1062+
<td><strong>Chunking</strong></td>
1063+
<td class="alg-value">{{ "%.1f"|format(memory.chunk_score) }}</td>
1064+
</tr>
1065+
<tr>
1066+
<td><strong>Structure</strong></td>
1067+
<td class="alg-value">{{ "%.1f"|format(memory.structure_score) }}</td>
1068+
</tr>
1069+
<tr>
1070+
<td><strong>Repetition</strong></td>
1071+
<td class="alg-value">{{ "%.1f"|format(memory.repetition_score) }}</td>
1072+
</tr>
1073+
<tr>
1074+
<td><strong>Face Diversity</strong></td>
1075+
<td class="alg-value">{{ "%.1f"|format(memory.face_diversity_score) }}</td>
1076+
</tr>
1077+
<tr>
1078+
<td><strong>Flow</strong></td>
1079+
<td class="alg-value">{{ "%.1f"|format(memory.flow_score) }}</td>
1080+
</tr>
1081+
<tr>
1082+
<td><strong>Move Familiarity</strong></td>
1083+
<td class="alg-value">{{ "%.1f"|format(memory.move_familiarity_score) }}</td>
1084+
</tr>
1085+
</table>
1086+
</div>
1087+
1088+
<div>
1089+
<h3 class="alg-section-title">Raw Data</h3>
1090+
<table class="alg-table">
1091+
<tr>
1092+
<td><strong>Distinct Triggers</strong></td>
1093+
<td class="alg-value">{{ memory.distinct_triggers }}</td>
1094+
</tr>
1095+
<tr>
1096+
<td><strong>Trigger Coverage</strong></td>
1097+
<td class="alg-value">{{ "%.1f"|format(memory.trigger_coverage_percent * 100) }}%</td>
1098+
</tr>
1099+
<tr>
1100+
<td><strong>Has Structure</strong></td>
1101+
<td class="alg-value">{{ 'Yes' if memory.has_structure else 'No' }}</td>
1102+
</tr>
1103+
<tr>
1104+
<td><strong>Repeated Patterns</strong></td>
1105+
<td class="alg-value">{{ memory.repeated_patterns }}</td>
1106+
</tr>
1107+
<tr>
1108+
<td><strong>Unfamiliar Moves</strong></td>
1109+
<td class="alg-value">{{ "%.1f"|format(memory.unfamiliar_move_percent * 100) }}%</td>
1110+
</tr>
1111+
</table>
1112+
</div>
1113+
</div>
1114+
1115+
<div class="alg-ergo-grid">
1116+
<div>
1117+
<canvas id="memoryRadarChart"></canvas>
1118+
</div>
1119+
</div>
1120+
</div>
1121+
</div>
1122+
9641123
{% set impacts = algorithm.impacts %}
9651124
<!-- Facelet Impact Analysis -->
9661125
<div class="card">

0 commit comments

Comments
 (0)