Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose /transform helpers/methods #30

Closed
c-dante opened this issue Sep 22, 2016 · 2 comments
Closed

Expose /transform helpers/methods #30

c-dante opened this issue Sep 22, 2016 · 2 comments

Comments

@c-dante
Copy link

c-dante commented Sep 22, 2016

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
@mbostock
Copy link
Member

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
Copy link
Author

c-dante commented Sep 23, 2016

Sure! Sounds good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants