From 60a6fe5adf1077fbccd1cfb715045361e9b62cca Mon Sep 17 00:00:00 2001 From: MichaelPesce Date: Wed, 23 Oct 2024 13:25:35 -0400 Subject: [PATCH] use v_c (cost numbers) for reuse rate and total disposal kpis in the case that the raw numbers arent available --- .../ui/src/views/ModelResults/KPIDashboard.js | 25 +++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/electron/ui/src/views/ModelResults/KPIDashboard.js b/electron/ui/src/views/ModelResults/KPIDashboard.js index b3a43cc..26c2fe3 100644 --- a/electron/ui/src/views/ModelResults/KPIDashboard.js +++ b/electron/ui/src/views/ModelResults/KPIDashboard.js @@ -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] @@ -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:") @@ -167,7 +170,18 @@ export default function KPIDashboard(props) { -

{Math.round(kpiData.e_CompletionsReusedFrac?.value * 100)}%

+

+ { + 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 + ) + } +

@@ -185,7 +199,14 @@ export default function KPIDashboard(props) { -

{kpiData.v_F_TotalDisposed?.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_F_TotalDisposed?.unit}

+

+ { + 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 + } +