diff options
| author | adamhrv <adam@ahprojects.com> | 2019-05-29 15:25:02 +0200 |
|---|---|---|
| committer | adamhrv <adam@ahprojects.com> | 2019-05-29 15:25:02 +0200 |
| commit | ca0d3ed1a451ce65960ff2e0f44fd5a9008eeaf4 (patch) | |
| tree | 345f0ee4a2fd7a917d7d604290fa2bda51225c68 /client | |
| parent | 5c21bdb664649c62ebbed29448a7c653ab32ddb0 (diff) | |
| parent | 2963cd2ec73860e3bf3a5e4d469b4e573ce4817c (diff) | |
Merge branch 'master' of github.com:adamhrv/megapixels_dev
Diffstat (limited to 'client')
| -rw-r--r-- | client/chart/countriesByYear.chart.js | 23 |
1 files changed, 16 insertions, 7 deletions
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 [ "<tr>", "<td>", - "<span style='background-color:" + color + "' class='swatch'></span>", - country, + "<span style='background-color:" + countryColor + "' class='swatch'></span>", + country, "</td>", "<td>", - total, + total, "</td>", "</tr>", ].join('') @@ -160,7 +160,16 @@ class CountriesByYearChart extends Component { } }} /> - <div className='caption'>{paper.name}{' dataset citations per country per year. We verified ' + citations.length + ' papers that used the dataset.'}</div> + {paper.vetting && + <div className='caption'> + {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.'} + </div> + } </div> ) } |
