summaryrefslogtreecommitdiff
path: root/client/chart/chart.container.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/chart/chart.container.js')
-rw-r--r--client/chart/chart.container.js9
1 files changed, 4 insertions, 5 deletions
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 ]