franciscop / ola Goto Github PK
View Code? Open in Web Editor NEW๐ Smooth animation library for interpolating numbers
License: MIT License
๐ Smooth animation library for interpolating numbers
License: MIT License
Hi,
When using Ola, it's not possible to change the values array length or object properties. It makes it a little hard to work with user inputs.
IMO, Ola should check if a value exists before updating it.
const values = Ola([10, 10]);
values.set([20, 20]); // Ok
values.set([30, 30, 30]); // Fail
The demo use setInterval
to update another value, any prop of Ola instance can let me know the update is over?
Such as a Boolean __done__
prop:
const data = new Ola({x: 0});
data.set({x: 10});
let target;
let intervalId;
intervalId = setInterval(() => {
target = data
if (data.__done__) {
clearInterval(intervalId)
}
}, 10)
Really nice library.
Would it be possible to expose speed & also acceleration, even if read-only?
Since Ola actually uses maths, it currently only uses the existing time.
A user might like to predict or look ahead for future positions (& speeds).
For example if I had a boid/particle swarm and wanted to debug/visualise a future trajectory, I'd draw a line or points.
Another usecase might be multiplayer games, where servers & clients may need to predict future values.
Are there other usecases?
Does Ola need to change to support usecases like that in some way?
This is just a rough idea. I'm not sure there is a strong case for it, doesn't seem like a big deal to add it either, apart from API complexity and documentation.
Thanks for his great little library!
Is there a way to set the "speed" or damping factor of the interpolation?
are your line graphs custom canvas implementations or done with a library? they're nice :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.