Extends D3 with some common jQuery functions and more
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
build
docs
examples refactor(general): create rollup configsm, update tests Aug 25, 2017
src docs(jsdoc): use only global category Aug 30, 2017
test refactor(general): create rollup configsm, update tests Aug 25, 2017
.babelrc refactor(general): create rollup configsm, update tests Aug 25, 2017
.gitignore refactor(general): create rollup configsm, update tests Aug 25, 2017
.npmignore new plugin structure Dec 20, 2016
LICENSE refactor(general): extend d3-selection Aug 25, 2017
README.md Update README.md Aug 30, 2017
index.js refactor(general): extend d3-selection Aug 25, 2017
jsdoc.json docs(jsdoc): fix function names and theme title Aug 30, 2017
package-lock.json docs(theme): change theme to braintree/jsdoc-template Aug 30, 2017
package.json docs(theme): change theme to braintree/jsdoc-template Aug 30, 2017
rollup.config.js refactor(general): create rollup configsm, update tests Aug 25, 2017
rollup.min.config.js

README.md

d3 Extended

d3 Extended is compatible with d3 v4. If you are looking for the v3 compatible module you can find it on the v3 branch.

This module extends d3-selection with helpful functions which are similar to the jQuery API. If you want to get to know more about this project, feel free to read the blog post: Replacing jQuery with d3.

You can find the docs on the d3 Extended website

Installation

npm

npm install --save d3-extended

git clone

git clone https://github.com/wbkd/d3-extended.git

Usage

ES6 modules

import * as d3Selection from 'd3-selection';
import 'd3-extended'; // d3Selection is now extended

CommonJS

const d3Selection = require('d3-selection');
require('d3-extended'); // d3Selection is now extended

Oldschool

You can use the compressed or uncompressed version. To use the plugin, include it after d3-selection in your HTML:

<script src="https://cdnjs.cloudflare.com/ajax/libs/d3-selection/1.1.0/d3-selection.min.js"></script>
<script src="path/to/d3-extended.js"></script>
<script>
  // d3 is now extended
</script>

Build

To build d3-extended run npm run build. This will create d3-extended.js and a minified version in the build folder.

Test

To run tests use npm test. Note: The tests require that you have phantomjs installed globally. If you see errors, try npm install -g phantomjs before running the tests.