mirror of
https://github.com/ANL-CEEESA/RELOG.git
synced 2025-12-06 07:48:50 -06:00
Extract constants from CSV
This commit is contained in:
@@ -63,11 +63,8 @@ const PlantBlock = (props) => {
|
|||||||
});
|
});
|
||||||
const result = {};
|
const result = {};
|
||||||
data.forEach((el) => {
|
data.forEach((el) => {
|
||||||
result[el["name"]] = {
|
let { name, ...props } = el;
|
||||||
"latitude (deg)": el["latitude (deg)"],
|
result[name] = props;
|
||||||
"longitude (deg)": el["longitude (deg)"],
|
|
||||||
"area cost factor": el["area cost factor"],
|
|
||||||
};
|
|
||||||
});
|
});
|
||||||
onChange(result, "locations");
|
onChange(result, "locations");
|
||||||
};
|
};
|
||||||
@@ -79,9 +76,7 @@ const PlantBlock = (props) => {
|
|||||||
)) {
|
)) {
|
||||||
result.push({
|
result.push({
|
||||||
name: locationName,
|
name: locationName,
|
||||||
"latitude (deg)": locationDict["latitude (deg)"],
|
...locationDict,
|
||||||
"longitude (deg)": locationDict["longitude (deg)"],
|
|
||||||
"area cost factor": locationDict["area cost factor"],
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
generateFile(`Candidate locations - ${props.name}.csv`, csvFormat(result));
|
generateFile(`Candidate locations - ${props.name}.csv`, csvFormat(result));
|
||||||
|
|||||||
Reference in New Issue
Block a user