# @redsift/d3-rs-intl

> Internationalization toolkit for D3v4.

Latest version **0.4.0** (published 2023-08-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install @redsift/d3-rs-intl
pnpm add @redsift/d3-rs-intl
yarn add @redsift/d3-rs-intl
bun add @redsift/d3-rs-intl
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.0 |
| Published | 2023-08-15 |
| First published | 2016-06-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 431.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Rahul Powar |
| Maintainers | t00mas, sometimesitbetterstepasideandnotusejavascript, raul.lorenzo.redsift, sam.b, stefan.djokovic, asaf.lerner, kacper.pietrzak, luminous_cal, notmentat, pierredupuis, hortega_rs, alim-scott, anneshackelford, mcolladoredsift, redsift_operations, rahulpowar, randalpinto, njaremek, earada, jmiralles, nascimj, neilsaccardo, bmayolasredsift |
| Keywords | bar, redsift, d3, chart |

## Links

- npm: https://www.npmjs.com/package/@redsift/d3-rs-intl
- Repository: https://github.com/redsift/d3-rs-intl
- Issues: https://github.com/redsift/d3-rs-intl/issues
- npm.io page: https://npm.io/package/@redsift/d3-rs-intl

## Dependencies (2)

- [d3-format](https://npm.io/package/d3-format.md) ^1.0.0
- [d3-time-format](https://npm.io/package/d3-time-format.md) ^2.1.1

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.4.0 (latest) — 2023-08-15
- 0.3.0 — 2023-08-15
- 0.2.0 — 2019-03-06
- 0.1.0 — 2018-01-20
- 0.0.2 — 2016-06-27
- 0.0.1 — 2016-06-21

## README

# d3-rs-intl

`d3-rs-intl` is a module that includes a few Internationalization tools for D3v4.

## Builds

[![Circle CI](https://circleci.com/gh/Redsift/d3-rs-intl.svg?style=svg)](https://circleci.com/gh/Redsift/d3-rs-intl)

## Example

[View @redsift/d3-rs-intl on Codepen](https://....)

## Usage

### Browser
	
	<script src="//static.redsift.io/reusable/d3-rs-intl/latest/d3-rs-intl.umd-es2015.min.js"></script>
	<script>
		var l = d3_rs_intl.time();
		var t = d3.timeFormatLocale(l.d3).format('%c')(new Date());
	</script>

### ES6

	import { units } from "@redsift/d3-rs-intl";
	let l = units([ 'en-GB', 'en' ]);
	...
	
### Require

	var intl = require("@redsift/d3-rs-intl");
	var l = intl.units(intl.lookup('Catalan'));
	...

The main helpers in this module are `time()` and `units()` which can optionally take an array of preferred ISO 639 `language-CULTURE` or `language` values and return the appropriate formatter. This formatter can be used by [d3-format](https://github.com/d3/d3-format#locale_format) and [d3-time-format](https://github.com/d3/d3-time-format#locale_format) to emit localized values such as decimal separators, currency and day names.

If no parameters are supplied, both methods attempt to use the browser preferences.

## Building

As this package builds the node using imported JSON locales from d3-format and d3-time-format, you will need a JSON -> JS convesion helper in your build process if you are using a tool like Rollup, e.g. `rollup-plugin-json`.

---
_Source: https://npm.io/package/@redsift/d3-rs-intl · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
