Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@redsift/d3-rs-intl

Package Overview
Dependencies
Maintainers
23
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@redsift/d3-rs-intl

Internationalization toolkit for D3v4.

  • 0.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
483
increased by3.21%
Maintainers
23
Weekly downloads
 
Created
Source

d3-rs-intl

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

Builds

Circle CI

Example

View @redsift/d3-rs-intl on Codepen

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 and d3-time-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.

Keywords

FAQs

Package last updated on 15 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc