Code Monkey home page Code Monkey logo

Comments (15)

wout avatar wout commented on May 18, 2024

I am working on a morph plugin that will use this technique but it is not yet ready for release.

from svg.js.

kevin7 avatar kevin7 commented on May 18, 2024

oh.. cool, do you have an ETA. I'm from queness.com, and working on a tutorial about this plugin. btw, good job.

from svg.js.

wout avatar wout commented on May 18, 2024

In fact it is already working but I need to overcome one problem. I can't really give an ETA because the plugin can only be released when I found a decent solution. This can be tomorrow or next month.

from svg.js.

kevin7 avatar kevin7 commented on May 18, 2024

Ok, looking forward to it.

from svg.js.

wout avatar wout commented on May 18, 2024

If you need any help on the tutorial, please let me know.
I am looking forward to it.
Thanks.

from svg.js.

hyperboreans avatar hyperboreans commented on May 18, 2024

@wout why don't you tell us what is the problem? You might find help :-)

from svg.js.

wout avatar wout commented on May 18, 2024

Well, my main concern with SMIL animations is that they are difficult to control. For example, you can't simply stop an animation halfway the defined duration. In case of a path morph that would result in the element returning to its initial state, or at best with a bit of tweaking to its destination. This is a huge problem if you want to use those animations in combination with mouse events.

Another, more dramatic problem with SMIL is that if paths get complicated no animation happens at all. It seems points in a path needs to match. The result is a hard switch from one shape to the other at the end of the given duration.

Therefore I am looking into forging a path recalculation module. This will take more time and it's a lot more complex but it will be much more flexible and it will integrate nicely with our the built-in SVG.FX module.

from svg.js.

hyperboreans avatar hyperboreans commented on May 18, 2024

So the problem is realizing the animations while sticking to SMIL -- while as far as I can see most of the libraries out there (Raphael, D3) simply keep track of the animation in the code and modify the attributes in the SVG accordingly (e.g. on a frame-by-frame basis).

A "dummy" path recalculation function should be an easy task, if one is not too picky 😄. I wrote a piece of code that does exactly that by simply adding points to the original path without modifying its appearance, such that the total count of points before/after the animation stays the same. That was enough in the context I wrote it for. I would advise against more complex solutions, unless the result is a simple and flexible way for the developer to specify what section of the path should be "affected" by the animation.

from svg.js.

wout avatar wout commented on May 18, 2024

Yes, the questions was about SMIL animations. I have briefly walked this path but quickly realised that SMIL is absolutely not the way to go. In fact I don't think there is any future for it unless they would completely rewrite SMIL to make it dynamically controllable.

I have also looked at path tweening/recalculations and it is absolutely manageable. Although time is not on my hands an I am developing svg.js as I go. Currently I am only implementing features when I need them myself. Of course I would love to add some fancy features and any help with that would be greatly appreciated.

My plan is to add this kind of functionality in a plugin. Any interest in working together on this?

from svg.js.

hyperboreans avatar hyperboreans commented on May 18, 2024

Sure, I can spend some time (few hours per week) on this. I'm only afraid a plugin is not enough if we need to work on individual points of the paths. As soon as you have an initial idea for the design of the plugin just let me know and let's move on from there.

from svg.js.

wout avatar wout commented on May 18, 2024

There is no difference to a plugin or native modules in svg.js. It's architecture allows extension of core classes without limitations. I will set up a draft so we can work from there.

from svg.js.

marthijn avatar marthijn commented on May 18, 2024

Any news on this guys? I'm interested in this functionality as well!

from svg.js.

wout avatar wout commented on May 18, 2024

The good news is that it will be a plugin. The bad news is that I have very little time on my hands, so no ETA.

from svg.js.

marthijn avatar marthijn commented on May 18, 2024

Any chance you can send me an early development version? I really need it! :-)

from svg.js.

wout avatar wout commented on May 18, 2024

I would but I haven't started yet :)

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.