diff --git a/src/public/viz-guardrails/LineChart.tsx b/src/public/viz-guardrails/LineChart.tsx index bc3b83e1a..a28837530 100644 --- a/src/public/viz-guardrails/LineChart.tsx +++ b/src/public/viz-guardrails/LineChart.tsx @@ -42,6 +42,13 @@ export function LineChart({ const [hover, setHover] = useState(null); const shouldBeColor = ((country: string) => { + if (parameters.condition === 'salient') { + if (!selection?.includes(country)) { + return true; + } + return false; + } + if (!selection?.includes(country)) { return false; } @@ -127,8 +134,7 @@ export function LineChart({ const cats = Array.from(new Set(data.map((d) => d[parameters.cat_var]))); if (parameters.condition === 'salient') { - const paletteWithoutOrange = OwidDistinctLinesPalette.filter((color) => color !== 'orange'); - return d3.scaleOrdinal(paletteWithoutOrange).domain(cats); + return d3.scaleOrdinal(['orange']).domain(cats); } return d3.scaleOrdinal(OwidDistinctLinesPalette).domain(cats); @@ -359,8 +365,7 @@ export function LineChart({ { const t = e.target as HTMLElement; if (!selection?.includes(t.innerText)) {