Skip to content

Commit

Permalink
use v_c (cost numbers) for reuse rate and total disposal kpis in the …
Browse files Browse the repository at this point in the history
…case that the raw numbers arent available
  • Loading branch information
MichaelPesce committed Oct 23, 2024
1 parent 766441d commit 60a6fe5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions electron/ui/src/views/ModelResults/KPIDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default function KPIDashboard(props) {
try {
let tempData = {}
// organize results dict data
console.log(props.overviewData)
for (var index in props.overviewData) {
let item = props.overviewData[index]
let key = item[0]
Expand All @@ -68,6 +69,8 @@ export default function KPIDashboard(props) {
let value = item[3]
tempData[key] = {"description": description, "unit": unit, "value": value}
}
console.log("kpi data")
console.log(tempData)
setKpiData(tempData)
} catch(e) {
console.log("error setting kpi data:")
Expand Down Expand Up @@ -167,7 +170,18 @@ export default function KPIDashboard(props) {
</Grid>
<Grid item xs={12}>
<Box sx={{display: 'flex', justifyContent: 'center'}}>
<p style={styles.kpiValue}>{Math.round(kpiData.e_CompletionsReusedFrac?.value * 100)}%</p>
<p style={styles.kpiValue}>
{
kpiData.e_CompletionsReusedFrac ?
(
Math.round(kpiData.e_CompletionsReusedFrac.value * 100) && Math.round(kpiData.e_CompletionsReusedFrac.unit)
)
:
(
kpiData.v_C_TotalReuse.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_C_TotalReuse?.unit
)
}
</p>
</Box>
</Grid>
</Grid>
Expand All @@ -185,7 +199,14 @@ export default function KPIDashboard(props) {
</Grid>
<Grid item xs={12}>
<Box sx={{display: 'flex', justifyContent: 'center'}}>
<p style={styles.kpiValue}>{kpiData.v_F_TotalDisposed?.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_F_TotalDisposed?.unit}</p>
<p style={styles.kpiValue}>
{
kpiData.v_F_TotalDisposed ?
kpiData.v_F_TotalDisposed.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_F_TotalDisposed.unit
:
kpiData.v_C_TotalDisposal?.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_C_TotalDisposal?.unit
}
</p>
</Box>
</Grid>
</Grid>
Expand Down

0 comments on commit 60a6fe5

Please sign in to comment.