Skip to content

Commit

Permalink
fix kpi dashboard to stop erroring out on operational model; need to …
Browse files Browse the repository at this point in the history
…figure out what the dictionary keys are for operational model kpis
  • Loading branch information
MichaelPesce committed Oct 21, 2024
1 parent e3acdaa commit 3d64cc5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 0 additions & 2 deletions electron/ui/src/components/Sidebar/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@ export default function Sidebar(props) {
if (tempOverrideList.length > 0) tempOverrideList.push("Results Tables")
setOverrideList(tempOverrideList)
let newSubCategories = SUBCATEGORIES[modelType || 'strategic']
console.log("setting subcategories to")
console.log(newSubCategories)
setSubCategories(newSubCategories)
},[scenario])

Expand Down
20 changes: 10 additions & 10 deletions electron/ui/src/views/ModelResults/KPIDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ 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?.value.toLocaleString('en-US', {maximumFractionDigits:0})+" "+kpiData.v_F_TotalDisposed?.unit}</p>
</Box>
</Grid>
</Grid>
Expand Down Expand Up @@ -225,10 +225,10 @@ export default function KPIDashboard(props) {
{
type: "pie",
values: [
kpiData.v_C_StorageCapEx.value,
kpiData.v_C_TreatmentCapEx.value,
kpiData.v_C_DisposalCapEx.value,
kpiData.v_C_PipelineCapEx.value],
kpiData.v_C_StorageCapEx?.value,
kpiData.v_C_TreatmentCapEx?.value,
kpiData.v_C_DisposalCapEx?.value,
kpiData.v_C_PipelineCapEx?.value],
labels: [
"Storage",
"Treatment",
Expand Down Expand Up @@ -275,11 +275,11 @@ export default function KPIDashboard(props) {
{
type: "pie",
values: [
kpiData.v_C_TotalSourced.value >= 0 ? kpiData.v_C_TotalSourced.value : 0,
kpiData.v_C_TotalTreatment.value >= 0 ? kpiData.v_C_TotalTreatment.value : 0,
kpiData.v_C_TotalDisposal.value >= 0 ? kpiData.v_C_TotalDisposal.value : 0,
kpiData.v_C_TotalPiping.value >= 0 ? kpiData.v_C_TotalPiping.value : 0,
kpiData.v_C_TotalTrucking.value >= 0 ? kpiData.v_C_TotalTrucking.value : 0],
kpiData.v_C_TotalSourced?.value >= 0 ? kpiData.v_C_TotalSourced?.value : 0,
kpiData.v_C_TotalTreatment?.value >= 0 ? kpiData.v_C_TotalTreatment?.value : 0,
kpiData.v_C_TotalDisposal?.value >= 0 ? kpiData.v_C_TotalDisposal?.value : 0,
kpiData.v_C_TotalPiping?.value >= 0 ? kpiData.v_C_TotalPiping?.value : 0,
kpiData.v_C_TotalTrucking?.value >= 0 ? kpiData.v_C_TotalTrucking?.value : 0],
labels: [
"Source",
"Treatment",
Expand Down

0 comments on commit 3d64cc5

Please sign in to comment.