polymorph
polymorph copied to clipboard
adopt reusable chart API convention?
This looks great, but it feels a bit imperative vs the fluent, chainable style of d3 where it is most likely to be used. Specifically, you have to .each
each time you'd want to use this for particular data.
Not that I can imagine what they'd be (other than maybe direction), but as you add more configurable features, rather than passing them as a big old jquery-style config object, how about an API like this (loosely based on the example in the readme):
var transpose = polymorph.transpose()
.before(d3.geo.path().projection(proj))
.after(circleIt);
shape.transition()
.attr(d, transpose)
.transition()
.attr(d, transpose.direction(false))
The problem is, this code isn't working outside of D3, as stated by developer.