@reuters-graphics/covid-tracker-headlines
v0.1.4
Published
[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines)
Downloads
13
Keywords
Readme
@reuters-graphics/covid-tracker-headlines
SmartText headline generator for COVID tracker project
Quickstart
$ yarn add @reuters-graphics/covid-tracker-headlines
import CovidTrackerHeadlines from '@reuters-graphics/covid-tracker-headlines';
const covidTrackerHeadlines = new CovidTrackerHeadlines({
globalStatistics: { ... },
smartText: { ... },
locale: 'en',
});
covidTrackerHeadlines.getHeadlines(3);
Restrict headlines by countries...
// Get headlines only from included countries
const covidTrackerHeadlines = new CovidTrackerHeadlines({
globalStatistics: { ... },
smartText: { ... },
include: ['IN'],
});
covidTrackerHeadlines.getHeadlines(3);
// Get headlines for all BUT excluded countries
const covidTrackerHeadlines = new CovidTrackerHeadlines({
globalStatistics: { ... },
smartText: { ... },
exclude: ['IN', 'BR', 'RU', 'CH'],
});
covidTrackerHeadlines.getHeadlines(3);
SmartText Schema
{
daysSinceSoHigh: { cases: [], deaths: [] },
highestAvg: { cases: [], deaths: [] },
newMax: {
cases: { count: [], dailyAvg: [] },
deaths: { count: [], dailyAvg: [] },
},
newMilestone: { cases: [], deaths: [] },
newPeakTrend: {
cases: { increasing: [], decreasing: [] },
deaths: { increasing: [], decreasing: [] },
},
newRank: {
cases: { total: [], dailyAvg: [] },
deaths: { total: [], dailyAvg: [] },
},
newStreak: {
cases: { increasing: [], decreasing: [] },
deaths: { increasing: [], decreasing: [] },
},
newGlobalMilestone: { cases: [], deaths: [] },
}
Testing
$ yarn test