d5-boots
v0.0.2
Published
some boilerplate d3 code- made for February pdx d3 meetup
Downloads
1
Readme
d5 (ddddd)
don't duplicate data driven documents
about
Some sugar for creating a d3 timeseries chart.
Heavily inspired by M. Bostock's Towards Reusable Charts.
usage
- include
d5.js
ord5.min.js
(from thedist
folder) on your page
<script src="/path/to/d5.js"></script>
- place a chart element on the same page
<div id="#chart"></div>
- choose the type of chart you want (hint: there's only one right now)
var opts = {}; // configure some stuff
var charter = d5.timeSeries(opts);
- d5 it up
var selector = "#chart";
var data = d5.utils.timeSeriesData(); // grab some random data
// IMPORTANT!
// * you have set set accessor functions for your data on `charter`
charter.x(function(d) { return d[0]; });
charter.y(function(d) { return d[1]; });
// Now we're ready to go!
// try this
var charty = d5(selector, data, charter);
// or this
var charty = d5(selector, data).update(charter);
// or even this
var charty = d5(selector).datum(data).update(charter);
what's included
TODO :grin: