d3/d3-interpolate

Expose `/transform` helpers/methods

c-dante opened this issue · 2 comments

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:

  • Parse the style string into a JSON representation
  • Write a style string from JSON
  • Apply multiple JSON transformations down into 1 representation

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

Sure! Sounds good!