JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 42320
  • Score
    100M100P100Q138864F
  • License MIT

Server-side D3 with ease

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

Build Status

Notice: work in-progress, feedback welcome.

NPM

Example usage:

var D3Node = require('d3-node');

var selector = '#chart';
var containerMarkup = '<div id="container"><div id="chart">TEST</div></div>';

var d3n = new D3Node(selector, containerMarkup); // initializes D3 with container element

d3n.d3Element.style("background-color", "black"); // set bg color on #chart

d3n.html() // output: <div id="container"><div id="chart" style="background-color: black;">TEST</div></div>

Run Tests:

$ npm test

Run examples

$ node examples/county-map

TODOs:

  • Add more example
  • example usage with Gulp
  • more tests
  • option to omit container, simplify init params
  • function to output svg only
  • injecting css into html output