From 3cffea282d93e0a636ac3c022a4fb3d2cefb85ae Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Tue, 28 May 2019 17:58:21 +0200 Subject: update countries by year chart --- client/chart/countriesByYear.chart.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'client/chart') diff --git a/client/chart/countriesByYear.chart.js b/client/chart/countriesByYear.chart.js index df7a4530..4f8cc44e 100644 --- a/client/chart/countriesByYear.chart.js +++ b/client/chart/countriesByYear.chart.js @@ -118,7 +118,7 @@ class CountriesByYearChart extends Component { tick: { values: ticks, }, - default: [ 0, maxCitationsInAYear * 286 / 261 ], + default: [0, maxCitationsInAYear * 286 / 261], show: true, } }} @@ -129,7 +129,7 @@ class CountriesByYearChart extends Component { pattern: colorPattern }} tooltip={{ - contents: function (d, defaultTitleFormat, defaultValueFormat, color) { + contents: d => { const countriesByYearLookup = years[yearList[d[0].x]] let countriesByYear = Object.keys(countriesByYearLookup).map(country => [country, countriesByYearLookup[country]]).sort((a,b) => b[1] - a[1]) let topCountriesForThisYear = countriesByYear.slice(0, topCountryCount) @@ -139,15 +139,15 @@ class CountriesByYearChart extends Component { 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 ] + const countryColor = colorPattern[colorIndex] return [ "", "", - "", - country, + "", + country, "", "", - total, + total, "", "", ].join('') @@ -160,7 +160,16 @@ class CountriesByYearChart extends Component { } }} /> -
{paper.name}{' dataset citations per country per year. We verified ' + citations.length + ' papers that used the dataset.'}
+ {paper.vetting && +
+ {paper.name} + {' dataset citations per country per year. We confirmed use of the dataset in '} + {citations.length} + {' papers, out of '} + {paper.vetting.total} + {' citations vetted.'} +
+ } ) } -- cgit v1.2.3-70-g09d2