Refactor code structure for improved readability and maintainability

This commit is contained in:
bolade
2025-09-29 09:17:11 +01:00
parent 604ef375aa
commit a44a763640
17 changed files with 123 additions and 59 deletions
Binary file not shown.
+2 -2
View File
@@ -27,10 +27,10 @@ page_3_context = {
page_4_context = { page_4_context = {
"body_composition_chart": image_to_base64( "body_composition_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/page_1_body_composition.png" "/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/body_composition_chart.png"
), ),
"body_fat_chart": image_to_base64( "body_fat_chart": image_to_base64(
"/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/page_1_body_fat.png" "/home/oluwasanmi/Documents/Work/MKD/report_generation/graphs/body_fat_percent_chart.png"
), ),
} }
Binary file not shown.

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 291 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 420 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 256 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

After

Width:  |  Height:  |  Size: 314 KiB

+1 -2
View File
@@ -86,8 +86,7 @@ html_doc = f"""
}} }}
/* Prevent images from being too large */ /* Prevent images from being too large */
img {{ img {{
max-height: 200px; max-height: 300px;
object-fit: contain;
}} }}
/* Larger images for specific charts */ /* Larger images for specific charts */
.chart-large {{ .chart-large {{
Binary file not shown.
+115 -46
View File
File diff suppressed because one or more lines are too long
+3 -7
View File
@@ -13,19 +13,15 @@
<h3 class="text-2xl font-bold text-center text-black mb-6">Body Composition</h3> <h3 class="text-2xl font-bold text-center text-black mb-6">Body Composition</h3>
<!-- Body Composition Chart --> <!-- Body Composition Chart -->
<div class="flex justify-center mb-8"> <div class="flex justify-center mb-16 w-full">
<div class="relative">
<img src="data:image/png;base64, {{ body_composition_chart}}" <img src="data:image/png;base64, {{ body_composition_chart}}"
alt="Body Composition Chart" alt="Body Composition Chart"
class="w-80 h-80 object-contain"> class=" object-contain ">
<!-- Chart Labels -->
</div>
</div> </div>
<!-- Body Fat Percentage Section --> <!-- Body Fat Percentage Section -->
<div class="mb-8"> <div class="mb-8">
<h3 class="text-2xl font-bold text-center text-black mb-6">Body Fat Percentage - {{ fat_percentage }}%</h3>
<!-- Body Fat Chart --> <!-- Body Fat Chart -->
<div class="flex justify-center"> <div class="flex justify-center">
<img src="data:image/png;base64, {{ body_fat_chart }}" <img src="data:image/png;base64, {{ body_fat_chart }}"
+1 -1
View File
@@ -12,7 +12,7 @@
</p> </p>
<!-- Lung Volume Chart --> <!-- Lung Volume Chart -->
<img src="data:image/png;base64,{{ lung_analysis_chart }}" alt="Lung Volume Analysis Chart" class="w-full mb-6"> <img src="data:image/png;base64,{{ lung_analysis_chart }}" alt="Lung Volume Analysis Chart" class="w-full">
<!-- Indications Box --> <!-- Indications Box -->
<div class="bg-gray-200 rounded-lg p-4 text-center mb-8"> <div class="bg-gray-200 rounded-lg p-4 text-center mb-8">