GithubHelp home page GithubHelp logo

jmtrivial / flatten.js Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 24 KB

Transform any svg file into a simplified version by removing all the transformation matrices

License: MIT License

JavaScript 100.00%

flatten.js's Introduction

flatten.js

Transform any svg file into a simplified version by removing all the transformation matrices.

A demo interface is provided to test the library.

flatten.js's People

Contributors

jmtrivial avatar

Stargazers

Christophe Desguez avatar Cuixiping avatar Vladislav Ponomarev avatar Emmanuel LOUISY-GABRIEL avatar

Watchers

 avatar  avatar

Forkers

mollerzhu

flatten.js's Issues

Linear gradient matrix not touched

Interesting tool. I gave the demo a shot with a logo which I have been working on and unfortunately it was 'jumbled' by the app. Also, the linear gradients were not touched, this is what I most want to fix. Of course, I realise the world doesn't revolve around me, but I would be interested in an update should you get round to looking at it.

If you would like a copy of the logo for testing, please let me know.

SVGO awareness

I don't know if you used SVGO before, but it seems like a lot of code in this library could be made as a plugin to SVGO or use SVGO plugins to do certain operations that are implemented here. Just wanted to bring awareness to those plugins: https://github.com/svg/svgo

Btw, it also works in the browser beautifully.

<image> element result is wrong

Example case:

<g transform="scale(2,3)">
    <image  transform="translate(112,113)" --- />
</g>

flatten.js removed the outer transform but not changed the inner transform attribute.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.