Package Exports
- d3-node
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (d3-node) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
D3-Node
Server-side D3 with ease
Notice: work in-progress, feedback welcome.
Example usage:
var D3Node = require('d3-node');
//-- with defaults
var d3n = new D3Node(); // initializes D3 with container element
d3n.d3Element.append('span'); // insert span tag
d3n.html() // returns: <html><head></head><body><span></span></body></html>
//-- setting container & selection
var options = {selector: '#chart'}
options.container = '<div id="container"><div id="chart"></div></div>';
var d3n = new D3Node(options); // initializes D3 with container element
d3n.d3Element.append('span'); // insert span tag into #chart
d3n.html() // returns: <div id="container"><div id="chart"><span></span></div></div>
Run Tests:
$ npm testSee examples
TODOs:
- Add more examples: (remote data, world map)
- create Gulp task
- simplify init params, remove need for container markup
- way to inject css file into html output
