diff --git a/src/pages/policy/output/decile/AverageImpactByDecile.jsx b/src/pages/policy/output/decile/AverageImpactByDecile.jsx index e95e3b369..2f7dca330 100644 --- a/src/pages/policy/output/decile/AverageImpactByDecile.jsx +++ b/src/pages/policy/output/decile/AverageImpactByDecile.jsx @@ -135,6 +135,14 @@ export function ImpactPlot(props) { export default function averageImpactByDecile(props) { const { impact, policyLabel, metadata, mobile, useHoverCard = false } = props; const decileAverage = impact.decile.average; + + // Hot fix to be removed to avoid deciles outside of 1-10 + Object.keys(decileAverage).forEach((key) => { + if (key > 10 || key < 1) { + delete decileAverage[key]; + } + }); + const averageChange = -impact.budget.budgetary_impact / impact.budget.households; const chart = ( diff --git a/src/pages/policy/output/decile/RelativeImpactByDecile.jsx b/src/pages/policy/output/decile/RelativeImpactByDecile.jsx index be46a882e..bd873d347 100644 --- a/src/pages/policy/output/decile/RelativeImpactByDecile.jsx +++ b/src/pages/policy/output/decile/RelativeImpactByDecile.jsx @@ -126,6 +126,14 @@ export function ImpactPlot(props) { export default function relativeImpactByDecile(props) { const { impact, policyLabel, metadata, mobile, useHoverCard = false } = props; const decileRelative = impact.decile.relative; + + // Hot fix to be removed to avoid deciles outside of 1-10 + Object.keys(decileRelative).forEach((key) => { + if (key > 10 || key < 1) { + delete decileRelative[key]; + } + }); + const relativeChange = -impact.budget.budgetary_impact / impact.budget.baseline_net_income; const chart = (