drzg15 commited on
Commit
3be71f7
·
1 Parent(s): ab7559f

dark mode completed

Browse files
frontend/src/components/analysis/CompositeCurvesChart.tsx CHANGED
@@ -2,10 +2,13 @@
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
 
5
 
6
  export default function CompositeCurvesChart() {
7
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
8
  const showShifted = useAnalysisStore((s) => s.showShifted);
 
 
9
 
10
  if (!pinchResult) return null;
11
 
@@ -34,12 +37,30 @@ export default function CompositeCurvesChart() {
34
  ];
35
 
36
  const layout: any = {
37
- title: { text: titleText, font: { size: 14 } },
38
- xaxis: { title: 'Enthalpy H (kW)', rangemode: 'tozero' },
39
- yaxis: { title: 'Temperature T (°C)', rangemode: 'tozero' },
 
 
 
 
 
 
 
 
 
 
 
 
40
  height: 400,
 
 
41
  margin: { l: 60, r: 20, t: 40, b: 50 },
42
- legend: { x: 0.01, y: 0.99, xanchor: 'left', yanchor: 'top' },
 
 
 
 
43
  hovermode: 'closest' as const,
44
  shapes: [
45
  {
@@ -56,7 +77,7 @@ export default function CompositeCurvesChart() {
56
  y: pinchResult.pinch_temperature,
57
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
58
  showarrow: false,
59
- font: { size: 11, color: 'gray' },
60
  },
61
  ],
62
  };
 
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
5
+ import { useUIStore } from '../../store/uiStore';
6
 
7
  export default function CompositeCurvesChart() {
8
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
9
  const showShifted = useAnalysisStore((s) => s.showShifted);
10
+ const theme = useUIStore((s) => s.theme);
11
+ const isDark = theme === 'dark';
12
 
13
  if (!pinchResult) return null;
14
 
 
37
  ];
38
 
39
  const layout: any = {
40
+ title: { text: titleText, font: { size: 14, color: isDark ? '#F8FAFC' : '#1A1C1E' } },
41
+ xaxis: {
42
+ title: 'Enthalpy H (kW)',
43
+ rangemode: 'tozero',
44
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
45
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
46
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
47
+ },
48
+ yaxis: {
49
+ title: 'Temperature T (°C)',
50
+ rangemode: 'tozero',
51
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
52
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
53
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
54
+ },
55
  height: 400,
56
+ paper_bgcolor: 'rgba(0,0,0,0)',
57
+ plot_bgcolor: 'rgba(0,0,0,0)',
58
  margin: { l: 60, r: 20, t: 40, b: 50 },
59
+ legend: {
60
+ x: 0.01, y: 0.99,
61
+ xanchor: 'left', yanchor: 'top',
62
+ font: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
63
+ },
64
  hovermode: 'closest' as const,
65
  shapes: [
66
  {
 
77
  y: pinchResult.pinch_temperature,
78
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
79
  showarrow: false,
80
+ font: { size: 11, color: isDark ? '#60A5FA' : 'gray' },
81
  },
82
  ],
83
  };
frontend/src/components/analysis/GrandCompositeCurveChart.tsx CHANGED
@@ -2,9 +2,12 @@
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
 
5
 
6
  export default function GrandCompositeCurveChart() {
7
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
 
 
8
 
9
  if (!pinchResult) return null;
10
 
@@ -33,10 +36,23 @@ export default function GrandCompositeCurveChart() {
33
  }
34
 
35
  const layout: any = {
36
- title: { text: 'Grand Composite Curve', font: { size: 14 } },
37
- xaxis: { title: 'Net ΔH (kW)' },
38
- yaxis: { title: 'Shifted Temperature (°C)', rangemode: 'tozero' },
 
 
 
 
 
 
 
 
 
 
 
39
  height: 400,
 
 
40
  margin: { l: 60, r: 20, t: 40, b: 50 },
41
  hovermode: 'closest' as const,
42
  shapes: [
@@ -51,7 +67,7 @@ export default function GrandCompositeCurveChart() {
51
  type: 'line',
52
  x0: 0, x1: 0,
53
  y0: 0, y1: 1, yref: 'paper',
54
- line: { color: 'black', width: 1 },
55
  opacity: 0.3,
56
  },
57
  ],
@@ -61,7 +77,7 @@ export default function GrandCompositeCurveChart() {
61
  y: pinchResult.pinch_temperature,
62
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
63
  showarrow: false,
64
- font: { size: 11, color: 'gray' },
65
  },
66
  ],
67
  };
 
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
5
+ import { useUIStore } from '../../store/uiStore';
6
 
7
  export default function GrandCompositeCurveChart() {
8
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
9
+ const theme = useUIStore((s) => s.theme);
10
+ const isDark = theme === 'dark';
11
 
12
  if (!pinchResult) return null;
13
 
 
36
  }
37
 
38
  const layout: any = {
39
+ title: { text: 'Grand Composite Curve', font: { size: 14, color: isDark ? '#F8FAFC' : '#1A1C1E' } },
40
+ xaxis: {
41
+ title: 'Net ΔH (kW)',
42
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
43
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
44
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
45
+ },
46
+ yaxis: {
47
+ title: 'Shifted Temperature (°C)',
48
+ rangemode: 'tozero',
49
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
50
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
51
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
52
+ },
53
  height: 400,
54
+ paper_bgcolor: 'rgba(0,0,0,0)',
55
+ plot_bgcolor: 'rgba(0,0,0,0)',
56
  margin: { l: 60, r: 20, t: 40, b: 50 },
57
  hovermode: 'closest' as const,
58
  shapes: [
 
67
  type: 'line',
68
  x0: 0, x1: 0,
69
  y0: 0, y1: 1, yref: 'paper',
70
+ line: { color: isDark ? '#94A3B8' : 'black', width: 1 },
71
  opacity: 0.3,
72
  },
73
  ],
 
77
  y: pinchResult.pinch_temperature,
78
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
79
  showarrow: false,
80
+ font: { size: 11, color: isDark ? '#60A5FA' : 'gray' },
81
  },
82
  ],
83
  };
frontend/src/components/analysis/HPIChart.tsx CHANGED
@@ -2,6 +2,7 @@
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
 
5
 
6
  const HP_COLORS = [
7
  '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3',
@@ -12,6 +13,8 @@ export default function HPIChart() {
12
  const hpiResult = useAnalysisStore((s) => s.hpiResult);
13
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
14
  const selectedHPTypes = useAnalysisStore((s) => s.selectedHPTypes);
 
 
15
 
16
  if (!hpiResult || !pinchResult) return null;
17
 
@@ -87,17 +90,30 @@ export default function HPIChart() {
87
  });
88
 
89
  const layout: any = {
90
- title: { text: 'Heat Pump Integration - Grand Composite Curve', font: { size: 14 } },
91
- xaxis: { title: 'Net ΔH (kW)' },
92
- yaxis: { title: 'Shifted Temperature (°C)', rangemode: 'tozero' },
 
 
 
 
 
 
 
 
 
 
 
93
  height: 400,
 
 
94
  margin: { l: 220, r: 20, t: 40, b: 50 },
95
  hovermode: 'closest' as const,
96
  showlegend: true,
97
  legend: {
98
  x: -0.15, y: 1.0,
99
  xanchor: 'right', yanchor: 'top',
100
- font: { size: 10 },
101
  itemsizing: 'constant'
102
  },
103
  shapes: [
@@ -112,7 +128,7 @@ export default function HPIChart() {
112
  type: 'line',
113
  x0: 0, x1: 0,
114
  y0: 0, y1: 1, yref: 'paper',
115
- line: { color: 'black', width: 1 },
116
  opacity: 0.3,
117
  },
118
  ],
@@ -122,7 +138,7 @@ export default function HPIChart() {
122
  y: pinchResult.pinch_temperature,
123
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
124
  showarrow: false,
125
- font: { size: 11, color: 'gray' },
126
  },
127
  ],
128
  };
 
2
 
3
  import Plot from 'react-plotly.js';
4
  import { useAnalysisStore } from '../../store/analysisStore';
5
+ import { useUIStore } from '../../store/uiStore';
6
 
7
  const HP_COLORS = [
8
  '#00CC96', '#AB63FA', '#FFA15A', '#19D3F3',
 
13
  const hpiResult = useAnalysisStore((s) => s.hpiResult);
14
  const pinchResult = useAnalysisStore((s) => s.pinchResult);
15
  const selectedHPTypes = useAnalysisStore((s) => s.selectedHPTypes);
16
+ const theme = useUIStore((s) => s.theme);
17
+ const isDark = theme === 'dark';
18
 
19
  if (!hpiResult || !pinchResult) return null;
20
 
 
90
  });
91
 
92
  const layout: any = {
93
+ title: { text: 'Heat Pump Integration - Grand Composite Curve', font: { size: 14, color: isDark ? '#F8FAFC' : '#1A1C1E' } },
94
+ xaxis: {
95
+ title: 'Net ΔH (kW)',
96
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
97
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
98
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
99
+ },
100
+ yaxis: {
101
+ title: 'Shifted Temperature (°C)',
102
+ rangemode: 'tozero',
103
+ gridcolor: isDark ? '#334155' : '#E2E8F0',
104
+ tickfont: { color: isDark ? '#94A3B8' : '#5F6368' },
105
+ titlefont: { color: isDark ? '#F8FAFC' : '#1A1C1E' }
106
+ },
107
  height: 400,
108
+ paper_bgcolor: 'rgba(0,0,0,0)',
109
+ plot_bgcolor: 'rgba(0,0,0,0)',
110
  margin: { l: 220, r: 20, t: 40, b: 50 },
111
  hovermode: 'closest' as const,
112
  showlegend: true,
113
  legend: {
114
  x: -0.15, y: 1.0,
115
  xanchor: 'right', yanchor: 'top',
116
+ font: { size: 10, color: isDark ? '#F8FAFC' : '#1A1C1E' },
117
  itemsizing: 'constant'
118
  },
119
  shapes: [
 
128
  type: 'line',
129
  x0: 0, x1: 0,
130
  y0: 0, y1: 1, yref: 'paper',
131
+ line: { color: isDark ? '#94A3B8' : 'black', width: 1 },
132
  opacity: 0.3,
133
  },
134
  ],
 
138
  y: pinchResult.pinch_temperature,
139
  text: `Pinch: ${pinchResult.pinch_temperature.toFixed(1)}°C`,
140
  showarrow: false,
141
+ font: { size: 11, color: isDark ? '#60A5FA' : 'gray' },
142
  },
143
  ],
144
  };
frontend/src/pages/PotentialAnalysisPage.css CHANGED
@@ -482,7 +482,7 @@
482
  }
483
 
484
  /* ---------- Dark mode overrides ---------- */
485
- .dark .pa-metric-hot { background: #3e1c1c !important; border-color: #c62828 !important; }
486
- .dark .pa-metric-cold { background: #1c2a3e !important; border-color: #1565c0 !important; }
487
- .dark .pa-metric-pinch { background: #2a1c3e !important; border-color: #7b1fa2 !important; }
488
- .dark .pa-metric-recovery { background: #1c3e1c !important; border-color: #2e7d32 !important; }
 
482
  }
483
 
484
  /* ---------- Dark mode overrides ---------- */
485
+ .dark .pa-metric-hot { border-color: #ef4444 !important; background: rgba(239, 68, 68, 0.1) !important; }
486
+ .dark .pa-metric-cold { border-color: #3b82f6 !important; background: rgba(59, 130, 246, 0.1) !important; }
487
+ .dark .pa-metric-pinch { border-color: #a855f7 !important; background: rgba(168, 85, 247, 0.1) !important; }
488
+ .dark .pa-metric-recovery { border-color: #22c55e !important; background: rgba(34, 197, 94, 0.1) !important; }