open-index/open-npm huggingface dataset:
npm package: @reuters-graphics/d3-locale
Description: D3 localization shortcut for Reuters graphics
Author: Jon McClure
Latest version: 2.0.0

![](badge.svg)

# @reuters-graphics/d3-locale

Easy translation for d3 charting.

Covers the following locales:

- `en`: US English
- `de`: German
- `es`: Spanish
- `fr`: French
- `it`: Italian
- `ja`: Japanese
- `pt`: Portuguese
- `zh`: Chinese

### Install

```
yarn add @reuters-graphics/d3-locale d3-format d3-time-format d3-time
```

### Use

```javascript
import D3Locale from '@reuters-graphics/d3-locale';

const locale = new D3Locale('de');

// Use it alone...
locale.format(',')(23000);
// '23.000'
locale.formatTime('%B %d')(new Date('2020-07-13'));
// 'Juli 13'

// ... or with an axis
d3.axisBottom(xScale)
  .tickFormat(locale.formatTime('%b. %d, %Y'));

// Can also override a part of a locale specifier...
locale.format('$')(12.2)
// R$12,2
locale.formatSpecifier = { currency: ['', '€'] };
locale.format('$')(12.2)
// '12,2€'
```

### Extra features

#### AP-style dates

You can set the formatter to use AP-style month abbreviations in English.

```javascript
const locale = new D3Locale('en');
locale.apStyle();
locale.formatTime('%b %d, %Y')(new Date('2020-03-13'));
// March 13, 2020
locale.formatTime('%b %d, %Y')(new Date('2020-01-13'));
// Jan. 13, 2020
```

#### Time multiformat

By default, d3 time scales use a [multi-scale time format](https://github.com/d3/d3-time-format#d3-time-format). You can recreate this using your locale and pass it to an axis' `tickFormat` method.

```javascript
const locale = new D3Locale('en');

const timeScale = d3.timeScale().domain([ /* ... */ ]);

d3.axisBottom(timeScale)
  .tickFormat(locale.timeMultiFormat());

// Example formats...
locale.timeMultiFormat()(new Date('2020-01-01'));
// 2020
locale.timeMultiFormat()(new Date('2020-02-01'));
// February
locale.timeMultiFormat()(new Date('2020-02-02'));
// Feb 02
```

You can also customize the component formatters used in the multi-scale time formatter. For example, our preferred formatter for AP-style date series:

```javascript
locale.apStyle();
locale.timeMultiFormat({ month: '%b', week: '%b %-e' })(new Date('2020-01-01'));
// 2020
locale.timeMultiFormat({ month: '%b', week: '%b %-e' })(new Date('2020-02-01'));
// Feb.
locale.timeMultiFormat({ month: '%b', week: '%b %-e' })(new Date('2020-02-02'));
// Feb. 2
```

#### Japanese/Chinese myriad groupings

There is special handling for decimal notation with an SI prefix (`s` format) in Japanese and Chinese in order to handle grouping by [myriads](https://en.wikipedia.org/wiki/Japanese_numerals#Large_numbers) rather than thousands.

```javascript
const locale = new D3Locale('ja');
locale.format(',s')(16000);
// 1.6万
locale.format(',s')(25000000);
// 2,500万
locale.format('$,s')(1233000);
// 123.3万円
```
npm package: @reuters-graphics/ejector
Description: Eject a dependency's source files from your `node_modules` directly into your working directory.
Author: Jon McClure
Latest version: 0.0.3

![](badge.svg)

# ⏏️ EJECTOR

Eject a dependency's source files from your `node_modules` directly into your working directory.

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fejector.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fejector) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20source/?color=ff8000)](https://github.com/reuters-graphics/)

## Why this?

TK.

## Quickstart

```
$ yarn global add @reuters-graphics/ejector
```

### CLI

Run ejector from the root of your project, and it will ask you which dependency you'd like to eject.

```
$ ejector
```

You can also supply a filter to limit the dependency options.

```
$ ejector -f @reuters-graphics
```

### Module

```javascript
import Ejector from '@reuters-graphics/ejector';

const ejector = new Ejector();

await ejector.eject();

// ... or with a filter
await ejector.eject('@reuters-graphics');
```


## Testing

```
$ yarn build && yarn test
```
npm package: @reuters-graphics/electoral-college-permutations
Description: [![npm version](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations.svg)](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20sou
Author: Jon McClure
Latest version: 0.0.2

![](badge.svg)

# @reuters-graphics/electoral-college-permutations

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations.svg)](https://badge.fury.io/js/%40reuters-graphics%2Felectoral-college-permutations) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20source/?color=ff8000)](https://github.com/reuters-graphics/)

## Quickstart

```
$ yarn add @reuters-graphics/electoral-college-permutations
```

```javascript
import Election2020Scenarios from '@reuters-graphics/electoral-college-permutations';

const outstandingStates = {
  WI: 10,
  MI: 16,
  GA: 16,
  PA: 20,
  NC: 15,
  AZ: 11,
  NV: 6,
  AK: 3,
};
const candidateElectoralVotes = {
  R: 213,
  D: 227,
};

const election2020Scenarios = new Election2020Scenarios(candidateElectoralVotes, outstandingStates);

const scenarios = election2020Scenarios.call('MI', 'D');

// {
//  states: ['WI', 'MI', ...],
//  scenariosByWinner: {
//    R: [
//      {
//         scenario: ['R', 'D', ...],
//         result: { R: 220, D: 230 },
//      },
//      ...
//    ],
//    D: [ {}, ...],
//    Tie: [{}, ...],
//  }
// }
```


## Testing

```
$ yarn test
```
npm package: @reuters-graphics/eslint-config
Description: ![](../../badge.svg)
Author: Jon McClure
Latest version: 0.0.2

![](../../badge.svg)

# @reuters-graphics/eslint-config

### Quickstart

1.  Install the package:

        $ yarn add -D @reuters-graphics/eslint-config eslint

2.  Create a `.eslintrc.json` in the root of your project:

        {
          "root": true,
          "extends": "@reuters-graphics/eslint-config"
        }
npm package: @reuters-graphics/graphics-aws-tools
Description: A simple CLI to help manage access to the TR AWS account.
Author: Jon McClure
Latest version: 1.0.0

# @reuters-graphics/graphics-aws-tools 🔫

A simple CLI to help manage access to the TR AWS account.

[![npm version](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-aws-tools.svg)](https://badge.fury.io/js/%40reuters-graphics%2Fgraphics-aws-tools) [![Reuters open source software](https://badgen.net/badge/Reuters/open%20source/?color=ff8000)](https://github.com/reuters-graphics/)

## Prereqs

You must have the Reuters `cloud-tool` CLI installed, TR's Python CLI tool which facilitates authenticated access to Amazon AWS and helps users manage their local configuration for the AWS CLI.

Read more about [installing](https://techtoc.thomsonreuters.com/non-functional/cloud-landing-zones/aws-cloud-landing-zones/command-line-access/cloud-tool-quickstart/) and [using](https://techtoc.thomsonreuters.com/non-functional/cloud-landing-zones/aws-cloud-landing-zones/command-line-access/user_guide/) the tool in the docs on TechTOC.

## Quickstart

```console
npm install -g @reuters-graphics/graphics-aws-tools
```

### CLI

```console
  Usage
    $ gat <command> [options]

  Available Commands
    setup    Setup defaults for AWS tools
    logon    Refresh your AWS deployment profile
    manage   Access the AWS management console

  For more info, run any command with the `--help` flag
    $ gat setup --help
    $ gat logon --help
    $ gat manage --help

  Options
    -v, --version    Displays current version
    -h, --help       Displays this message
```