Skip to content

Commit 8f5acea

Browse files
Magnet plot screen modifications
1 parent 8dc3034 commit 8f5acea

File tree

3 files changed

+237
-292
lines changed

3 files changed

+237
-292
lines changed

src/screens/Magnet.js

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import { magnetConfigs, organization } from "../config/MagnetConfig.js";
88
import { findKeyByText } from "../utils/data-handling-functions.js";
99
import { StickyBand } from "../utils/rendering-items.js";
1010
import { europeanCountries, lcaIndicators } from "../utils/useful-constants.js";
11+
import { getFile } from "../api/index.js";
1112

1213
import MagnetMap from "./MagnetMap.js";
1314
import MAGNETGraphs from "./MagnetGraphs.js";
@@ -114,8 +115,6 @@ const LcaMag = () => {
114115
setIsOpportunityState(isOpportunityIndicator(indicatorValue));
115116
}, [selections.indicator]);
116117

117-
console.log("Indicator changed:", selections.indicator);
118-
119118
const fetchConfigs = useMemo(() => {
120119
const compareCountries = (selections.compareCountries || []).map((countryText) => findKeyByText(EU_COUNTRIES, countryText));
121120
const indicatorValue = typeof selections.indicator === "string"
@@ -127,7 +126,6 @@ const LcaMag = () => {
127126

128127
const { state } = useInit(organization, fetchConfigs);
129128
const { isLoading, dataSets } = state;
130-
console.log("Data sets:", dataSets);
131129

132130
// Dropdown configurations with proper null checks
133131
const countryDropdown = useMemo(() => ({
@@ -159,26 +157,37 @@ const LcaMag = () => {
159157
<>
160158
<HighlightBackgroundButton
161159
title="Metrics"
160+
size="small"
162161
onClick={() => updateTab("Metrics")}
163162
/>
164163
<HighlightBackgroundButton
165164
title="Map"
165+
size="small"
166166
onClick={() => updateTab("Map")}
167167
/>
168168
</>
169169
)}
170170
togglePlacing="center"
171+
downloadContent={(
172+
<HighlightBackgroundButton
173+
title="Download Methodology"
174+
size="small"
175+
onClick={() => getFile("MAGNET", "Methodology PSILCA social 2.pdf", "Methodology PSILCA social 2.pdf")}
176+
/>
177+
)}
171178
/>
172179

173180
{selections.tab === "Metrics" && (
174-
<MAGNETGraphs
175-
selections={selections}
176-
updateSelection={updateSelection}
177-
updateCompareCountries={updateCompareCountries}
178-
dataSets={dataSets}
179-
isLoading={isLoading}
180-
isOpportunityState={isOpportunityState}
181-
/>
181+
<Grid item xs={12}>
182+
<MAGNETGraphs
183+
selections={selections}
184+
updateSelection={updateSelection}
185+
updateCompareCountries={updateCompareCountries}
186+
dataSets={dataSets}
187+
isLoading={isLoading}
188+
isOpportunityState={isOpportunityState}
189+
/>
190+
</Grid>
182191
)}
183192

184193
{/* Map Section */}
@@ -187,7 +196,6 @@ const LcaMag = () => {
187196
<MagnetMap dataEU={dataSets.metrics_EU} opportunity={isOpportunityState} isLoading={isLoading} />
188197
</Grid>
189198
)}
190-
191199
<Footer
192200
sticky
193201
customMessage={(

0 commit comments

Comments
 (0)