d3-inertia icon indicating copy to clipboard operation
d3-inertia copied to clipboard

zero inertia option

Open Fil opened this issue 7 years ago • 3 comments

it should be easy to unset inertia

Fil avatar Nov 30 '17 07:11 Fil

I've just implemented your inertia library, really nice! What I'm missing, and I think it would be rather easy to implement, is an option to choose how much inertia I'd like to have. So it's like this ticket, but more of an option between zero and full inertia: 0 to 1 I've (shortly) studied your code, but haven't seen a straightforward way to implement a variable. Maybe the magic number 1000?

nirazul avatar Dec 17 '20 19:12 nirazul

1000 is the conversion from ms to seconds :) If I remember correctly the magic number is A = 5000 (5 seconds) in https://github.com/Fil/d3-inertia/blob/master/src/index.js#L83 Contributions welcome!

Fil avatar Dec 17 '20 21:12 Fil

@Fil Thanks for your reply! Rather than the time, I'm talking about some sort of "friction" to apply to the inertia, not the amount of time that the projection is easing out, but the distance that the projection is being changed after the cursor stopped dragging it. Do you have any pointers for that? In any case, I'll have a stab on it and try if I can get to a solution :)

nirazul avatar Dec 18 '20 10:12 nirazul