DataMap
A library for defining an abstract interface around datasets (alternatively: a
well-intentioned attempt to simplify d3.chart).
Usage
This utility allows library authors to define an abstract "shape" for datasets.
Library consumers may have datasets that conform to a different structure. They
can use this data directly if they provide a "mapping" function.
this.dm = new DataMap(['time', 'space']);
Library.dm.map({
time: function() { return this.tiempo; },
space: function() { return this.espacio; }
});
Library.draw([ { tiempo: 23, espacio: 45 } ]);
draw: function(userData) {
var normalized = this.dm.wrap(userData);
normalized.time;
normalized.space;
}
License
Copyright (c) 2013 Mike Pennisi
Licensed under the MIT license.