From 7dc83a74384a404ecc739cd17953c742c82a3fbc Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 8 Mar 2019 21:18:11 +0100 Subject: update colorblind colors --- client/chart/chart.container.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'client/chart') diff --git a/client/chart/chart.container.js b/client/chart/chart.container.js index cbfc4de1..ea86f998 100644 --- a/client/chart/chart.container.js +++ b/client/chart/chart.container.js @@ -12,6 +12,7 @@ const rainbow = [ '#f46d43', '#fdae61', '#fee08b', + '#ffffbf', '#e6f598', '#abdda4', '#66c2a5', @@ -26,6 +27,7 @@ const colorblindSafeRainbow = [ '#f46d43', '#fdae61', '#fee090', + '#ffffbf', '#e0f3f8', '#abd9e9', '#74add1', @@ -34,14 +36,11 @@ const colorblindSafeRainbow = [ // '#888888', ] -const topCountryCount = 9 +const topCountryCount = 10 const otherCountriesLabel = 'Other Countries' class ChartContainer extends Component { - state = { - } - render() { const { payload } = this.props const { paper, citations } = payload.data @@ -168,7 +167,7 @@ class ChartContainer extends Component { let bottomTotal = countriesByYear.slice(topCountryCount).reduce((a,b) => (a + b[1]), 0) console.log(topCountriesForThisYear) topCountriesForThisYear.push([otherCountriesLabel, bottomTotal]) - const tableRows = topCountriesForThisYear.map(([country, total]) => { + const tableRows = topCountriesForThisYear.filter(pair => !!pair[1]).map(([country, total]) => { let colorIndex = topCountries.indexOf(country) if (colorIndex < 0) colorIndex = colorPattern.length - 1 const color = colorPattern[ colorIndex ] -- cgit v1.2.3-70-g09d2