Giter VIP home page Giter VIP logo

Comments (11)

wout avatar wout commented on August 16, 2024

You'll have to use the gradientTransform attribute:

gradient.attr('gradientTransform', 'skewX(30)')

I fiddled something here so you can test it yourself:
http://jsfiddle.net/wout/KpYZy/1/

from svg.js.

gnomathibus avatar gnomathibus commented on August 16, 2024

Thank you for that answer, what is the correct syntax with the matrix? I tried with :

"gradient.attr('gradientTransform','matrix(0.79545714,-0.70713416,0.51685009,0.58140605,-3.2162008,-48.602235)')" but it does not work

from svg.js.

wout avatar wout commented on August 16, 2024

That should be the right syntax. I'm not quite sure on SVG support on matrix transformations applied to gradients. At first sight they don't work in Chrome but I didn't go really deep into it.

from svg.js.

gnomathibus avatar gnomathibus commented on August 16, 2024

I have a svg file where there are gradients with matrix

from svg.js.

wout avatar wout commented on August 16, 2024

Is it working in the browser as well? Can you send it so I can have a look? Maybe that would explain a little bit more.

from svg.js.

gnomathibus avatar gnomathibus commented on August 16, 2024

my svg file with "gradientTransform =" matrix "

http://jsfiddle.net/WRnX8/

from svg.js.

wout avatar wout commented on August 16, 2024

Ah, ok, I see now. You should set the gradientUnits to:

gradient.attr('gradientUnits', 'userSpaceOnUse')

from svg.js.

gnomathibus avatar gnomathibus commented on August 16, 2024

I add gradient.attr ('gradientUnits', 'userSpaceOnUse') but it does not work

from svg.js.

wout avatar wout commented on August 16, 2024

It does here: http://jsfiddle.net/wout/KpYZy/9/

from svg.js.

gnomathibus avatar gnomathibus commented on August 16, 2024

I found my mistake I forgot it;
gradient.attr ('cx', '68 .138 ')
gradient.attr ('cy', '29 .869 ')
gradient.attr ('r', '33 .934 ')
and thank you again

from svg.js.

wout avatar wout commented on August 16, 2024

No problem.

from svg.js.

Related Issues (20)

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.