types.d3
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

Type definitions for d3.js 4.x

travis-ci

Install

npm install d3-selection d3-transition d3-array ... --save
npm install types.d3 --save

Install d3 modules and types.d3 module.

{
  "compilerOptions" : {
    "typeRoots" : [ "node_modules" ],
    "types" : [ "types.d3" ]
  }
}

Add typeRoots and types to your tsconfig.json.

tsc compiler will find index.d.ts files with typeRoots and types it is like add /// <reference path="${typeRoots}/${types}/index.d.ts"/> to your ts file.

import {select} from 'd3-selection';
import {min, max} from 'd3-array';

d3-selection and d3-transition

d3-selection include d3-transition API.

If you want use Selection.transition(). You need to import d3-transition before use that.

import 'd3-transition'; // import the d3-transition
import {select} from 'd3-selection';
 
select('a').transition(); // then you can use Selection.transition()

Work Status

License

MIT

Other definitions for d3.js 4.x

Dependencies (0)

    Dev Dependencies (7)

    Package Sidebar

    Install

    npm i types.d3

    Weekly Downloads

    3

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • ssen