Skip to content
This repository has been archived by the owner on Nov 2, 2021. It is now read-only.

Latest commit

 

History

History
59 lines (42 loc) · 1.03 KB

Getting-started.md

File metadata and controls

59 lines (42 loc) · 1.03 KB

DocsGetting started

Download the library

You can get the package from npm or bower. It depends on d3-selection and d3-dispatch from D3.js v4.

npm

npm install d3 d3kit --save
# or to be more specific
npm install d3-selection d3-dispatch d3kit --save

bower

bower install d3 d3kit --save

Add to your project

d3Kit was packaged as UMD (Universal Module Definition). You can use it via:

Option 1: Global (Simple script tag)

<script src="path/to/d3.min.js"></script>
<script src="path/to/d3kit.min.js"></script>

d3Kit will be available as d3Kit.

Option 2: ES6 import

import { SvgChart, CanvasChart } from 'd3kit';

Option 3: AMD (requirejs)

require.config({
  paths: {
    d3:    'path/to/d3',
    d3Kit: 'path/to/d3Kit'
  }
});
require(['d3', 'd3Kit'], function(d3, d3Kit) {
  // do something
});

Option 4: commonjs (browserify)

var d3Kit = require('d3kit');