summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjules@lens <julescarbon@gmail.com>2019-03-09 00:12:42 +0100
committerjules@lens <julescarbon@gmail.com>2019-03-09 00:12:42 +0100
commit25fd369135060e96f4d9f8d5fa593fc517eea543 (patch)
treecbeac56972820fd3235640e17a9fa42f4f133ff0
parent4abc168844c0c1c1cda4842086f3afb57ac50000 (diff)
parent7dc83a74384a404ecc739cd17953c742c82a3fbc (diff)
Merge branch 'master' of asdf.us:megapixels_dev
-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 ]