chenglou / react-motion

A spring that solves your animation problems.
MIT License
21.68k stars 1.16k forks source link

Physics documentation? #302

Open ghost opened 8 years ago

ghost commented 8 years ago

It seems like the README doesn't have any definitions of "stiffness" or "damping". I also skimmed through the React Europe talk and didn't see any explanations.

Since this is a "physics-based" library, it would be very helpful to explain what the physics are.

There are a number of issues circling this question:

Some desirables:

If so, some detailed information like the below image, for example, would be extremely helpful:

wikipedia step response

nkbt commented 8 years ago

That's really helpful, @talexand! Keen to PR?

ghost commented 8 years ago

I'm keen, but I'll have to sit with the source for a bit. :wink:

chenglou commented 8 years ago

I'm incorporating https://github.com/chenglou/react-motion/issues/265#issuecomment-184697874 soon. Sorry about the codebase; it's trickier than it looks like, partially because it sits at the intersection of React lifecycle, async states, physics and animation coordination with StaggeredMotion and TransitionMotion. The combination of these things makes the code complex; also I partially suck at it =P.

I'd love to have this explained clearly; but we're "competing" against e.g. "it's an animation that slows down and takes 2 seconds" kind of alternative, mainstream animation API here. The more physic theory we put into the docs the more likely people will just go for a CSS ease curve.

That being said, I'd love to have this documented as a dedicated wiki page; it can be very informative and interesting for some people.