polymorph icon indicating copy to clipboard operation
polymorph copied to clipboard

adopt reusable chart API convention?

Open bollwyvl opened this issue 9 years ago • 1 comments

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))

bollwyvl avatar Aug 14 '15 17:08 bollwyvl

The problem is, this code isn't working outside of D3, as stated by developer.

thednp avatar Feb 23 '16 07:02 thednp