open-index/open-npm huggingface dataset:
npm package: @reuters-graphics/covid-tracker-headlines
Description: [![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines)
Author: Jon McClure
Latest version: 0.1.4

![](badge.svg)

# @reuters-graphics/covid-tracker-headlines

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fcovid-tracker-headlines)

SmartText headline generator for COVID tracker project

## Quickstart

```
$ yarn add @reuters-graphics/covid-tracker-headlines
```

```javascript
import CovidTrackerHeadlines from '@reuters-graphics/covid-tracker-headlines';

const covidTrackerHeadlines = new CovidTrackerHeadlines({
  globalStatistics: { ... },
  smartText: { ... },
  locale: 'en',
});

covidTrackerHeadlines.getHeadlines(3);
```

Restrict headlines by countries...
```javascript
// 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
```