carto-vl icon indicating copy to clipboard operation
carto-vl copied to clipboard

Review support for different easing functions on blendTo

Open davidmanzanares opened this issue 6 years ago • 1 comments

In blend, we allowed (a long time ago) the usage of cubic, linear and other interpolation methods.

davidmanzanares avatar May 31 '18 14:05 davidmanzanares

To clarify this, apart from the space of the input of a blend (the famous CieLAB vs sRGB), it is important to use easing functions to improve eye candy. See https://easings.net/es

I recommend porting https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c to GLSL. (C is very similar to GLSL and the library has a liberal license, although this is not a copy/paste).

Right now, there are a few easing functions in interpolators.js. Some of them ported from the mentioned library.

The current state is that Blend accepts a fourth parameter which is not documented, but it is used by blendToViz to perform cubic easing instead of linear (which I think it's a better default).

I think we should:

  • [ ] Review and expose the easing API
  • [ ] Port and expose most easing functions
  • [ ] Show a nice example. This plays well for example with feature interactive styling.

davidmanzanares avatar Oct 30 '18 10:10 davidmanzanares