d3 / d3-interpolate

Interpolate numbers, colors, strings, arrays, objects, whatever!
https://d3js.org/d3-interpolate
ISC License
494 stars 70 forks source link

Expose `/transform` helpers/methods #30

Closed c-dante closed 7 years ago

c-dante commented 7 years ago

Can you extract out or expose the transformation decomposition, manipulation, and recompose logic?

Specifically, parseSvg has been very useful to build the object from the attribute, and it'd be nice if the "build the CSS string from the transform JSON" logic was also exposed (instead of closed over in the interpolation logic).

https://github.com/d3/d3-interpolate/tree/master/src/transform

https://github.com/d3/d3-interpolate/blob/master/src/transform/index.js

Is there a good reason to not make this functionality a dedicated micro library?

d3-transform-matrix? d3-css-transform?

In charge of:

mbostock commented 7 years ago

You’re welcome to fork the code (or just parse.js and decompose.js) and expose it as a new microlibrary, but personally, I’m not sufficiently convinced that the proposed API is useful enough to want to maintain such a library myself. See also d3-transform (for 3.x).

c-dante commented 7 years ago

Sure! Sounds good!