refactor: update nutrition chart colors and enhance layout
- Changed color codes for macro nutrients in the nutrition interpretation and metrics files to improve visual consistency. - Added new CSS styles for uniform chart height and layout adjustments in the frontend components, enhancing the overall user experience. - Refactored the NutritionCharts component to utilize the new macro chart theme for better maintainability and readability.
This commit is contained in:
1 parent
b96b1931db
commit
31fbf33031
7 files changed
+131
-59
No files matched your search
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Einheitliche Makro-Farben für Verlauf (Balken, Donut, E3).
|
||||
* Reihenfolge gestapelter Balken (Recharts, unten zuerst): Protein → Fett → Kohlenhydrate.
|
||||
*/
|
||||
export const MACRO_CHART = {
|
||||
protein: '#4a8f72',
|
||||
fat: '#6e8eb8',
|
||||
carbs: '#c17d45',
|
||||
}
|
||||
|
||||
/** Einheitliche Höhe Donut-Bereich / E3-Balken (Verlauf) */
|
||||
export const NUTRITION_MACRO_CHART_BLOCK_PX = 260
|
||||
|
||||
/** Farbe nach Segment-Name (Protein / KH / Fett / englische Keys). */
|
||||
export function macroFillByName(name) {
|
||||
const n = String(name || '').toLowerCase()
|
||||
if (n.includes('protein') || n === 'p') return MACRO_CHART.protein
|
||||
if (n.includes('fett') || n.includes('fat')) return MACRO_CHART.fat
|
||||
if (n.includes('kh') || n.includes('kohlenhydrat') || n.includes('carb')) return MACRO_CHART.carbs
|
||||
return MACRO_CHART.carbs
|
||||
}
|
||||
Reference in new issue
Block a user