Code example for an skeleton to a charting npm package.
AMD modules containing D3.js graphs written with the Reusable API methodology.
Requirements: node and npm
While on your selected folder within a command line terminal type:
git clone https://github.com/Golodhros/codementor.git
npm install
npm install -g karma-cli
The code for the charts is ubicated in src/chart
Create a new chart by calling the method, then configure it via the API and call it with the right data set. Example:
barChart = chart();
barChart.width(600).margin({left: 10, top: 20});
d3.select('.dom-container').datum(dataset).call(barChart);
We are using Karma as a test runner. Just type:
karma start
- Developing a D3.js Edge (Bleeding edge press)
- Mastering D3 (Packt Publishing)
- D3.js community in general