Node-Red configuration
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

d3-ease.js 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. // https://d3js.org/d3-ease/ v3.0.1 Copyright 2010-2021 Mike Bostock, 2001 Robert Penner
  2. (function (global, factory) {
  3. typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  4. typeof define === 'function' && define.amd ? define(['exports'], factory) :
  5. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.d3 = global.d3 || {}));
  6. }(this, (function (exports) { 'use strict';
  7. const linear = t => +t;
  8. function quadIn(t) {
  9. return t * t;
  10. }
  11. function quadOut(t) {
  12. return t * (2 - t);
  13. }
  14. function quadInOut(t) {
  15. return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;
  16. }
  17. function cubicIn(t) {
  18. return t * t * t;
  19. }
  20. function cubicOut(t) {
  21. return --t * t * t + 1;
  22. }
  23. function cubicInOut(t) {
  24. return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;
  25. }
  26. var exponent = 3;
  27. var polyIn = (function custom(e) {
  28. e = +e;
  29. function polyIn(t) {
  30. return Math.pow(t, e);
  31. }
  32. polyIn.exponent = custom;
  33. return polyIn;
  34. })(exponent);
  35. var polyOut = (function custom(e) {
  36. e = +e;
  37. function polyOut(t) {
  38. return 1 - Math.pow(1 - t, e);
  39. }
  40. polyOut.exponent = custom;
  41. return polyOut;
  42. })(exponent);
  43. var polyInOut = (function custom(e) {
  44. e = +e;
  45. function polyInOut(t) {
  46. return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;
  47. }
  48. polyInOut.exponent = custom;
  49. return polyInOut;
  50. })(exponent);
  51. var pi = Math.PI,
  52. halfPi = pi / 2;
  53. function sinIn(t) {
  54. return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi);
  55. }
  56. function sinOut(t) {
  57. return Math.sin(t * halfPi);
  58. }
  59. function sinInOut(t) {
  60. return (1 - Math.cos(pi * t)) / 2;
  61. }
  62. // tpmt is two power minus ten times t scaled to [0,1]
  63. function tpmt(x) {
  64. return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494;
  65. }
  66. function expIn(t) {
  67. return tpmt(1 - +t);
  68. }
  69. function expOut(t) {
  70. return 1 - tpmt(t);
  71. }
  72. function expInOut(t) {
  73. return ((t *= 2) <= 1 ? tpmt(1 - t) : 2 - tpmt(t - 1)) / 2;
  74. }
  75. function circleIn(t) {
  76. return 1 - Math.sqrt(1 - t * t);
  77. }
  78. function circleOut(t) {
  79. return Math.sqrt(1 - --t * t);
  80. }
  81. function circleInOut(t) {
  82. return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;
  83. }
  84. var b1 = 4 / 11,
  85. b2 = 6 / 11,
  86. b3 = 8 / 11,
  87. b4 = 3 / 4,
  88. b5 = 9 / 11,
  89. b6 = 10 / 11,
  90. b7 = 15 / 16,
  91. b8 = 21 / 22,
  92. b9 = 63 / 64,
  93. b0 = 1 / b1 / b1;
  94. function bounceIn(t) {
  95. return 1 - bounceOut(1 - t);
  96. }
  97. function bounceOut(t) {
  98. return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;
  99. }
  100. function bounceInOut(t) {
  101. return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;
  102. }
  103. var overshoot = 1.70158;
  104. var backIn = (function custom(s) {
  105. s = +s;
  106. function backIn(t) {
  107. return (t = +t) * t * (s * (t - 1) + t);
  108. }
  109. backIn.overshoot = custom;
  110. return backIn;
  111. })(overshoot);
  112. var backOut = (function custom(s) {
  113. s = +s;
  114. function backOut(t) {
  115. return --t * t * ((t + 1) * s + t) + 1;
  116. }
  117. backOut.overshoot = custom;
  118. return backOut;
  119. })(overshoot);
  120. var backInOut = (function custom(s) {
  121. s = +s;
  122. function backInOut(t) {
  123. return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;
  124. }
  125. backInOut.overshoot = custom;
  126. return backInOut;
  127. })(overshoot);
  128. var tau = 2 * Math.PI,
  129. amplitude = 1,
  130. period = 0.3;
  131. var elasticIn = (function custom(a, p) {
  132. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  133. function elasticIn(t) {
  134. return a * tpmt(-(--t)) * Math.sin((s - t) / p);
  135. }
  136. elasticIn.amplitude = function(a) { return custom(a, p * tau); };
  137. elasticIn.period = function(p) { return custom(a, p); };
  138. return elasticIn;
  139. })(amplitude, period);
  140. var elasticOut = (function custom(a, p) {
  141. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  142. function elasticOut(t) {
  143. return 1 - a * tpmt(t = +t) * Math.sin((t + s) / p);
  144. }
  145. elasticOut.amplitude = function(a) { return custom(a, p * tau); };
  146. elasticOut.period = function(p) { return custom(a, p); };
  147. return elasticOut;
  148. })(amplitude, period);
  149. var elasticInOut = (function custom(a, p) {
  150. var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);
  151. function elasticInOut(t) {
  152. return ((t = t * 2 - 1) < 0
  153. ? a * tpmt(-t) * Math.sin((s - t) / p)
  154. : 2 - a * tpmt(t) * Math.sin((s + t) / p)) / 2;
  155. }
  156. elasticInOut.amplitude = function(a) { return custom(a, p * tau); };
  157. elasticInOut.period = function(p) { return custom(a, p); };
  158. return elasticInOut;
  159. })(amplitude, period);
  160. exports.easeBack = backInOut;
  161. exports.easeBackIn = backIn;
  162. exports.easeBackInOut = backInOut;
  163. exports.easeBackOut = backOut;
  164. exports.easeBounce = bounceOut;
  165. exports.easeBounceIn = bounceIn;
  166. exports.easeBounceInOut = bounceInOut;
  167. exports.easeBounceOut = bounceOut;
  168. exports.easeCircle = circleInOut;
  169. exports.easeCircleIn = circleIn;
  170. exports.easeCircleInOut = circleInOut;
  171. exports.easeCircleOut = circleOut;
  172. exports.easeCubic = cubicInOut;
  173. exports.easeCubicIn = cubicIn;
  174. exports.easeCubicInOut = cubicInOut;
  175. exports.easeCubicOut = cubicOut;
  176. exports.easeElastic = elasticOut;
  177. exports.easeElasticIn = elasticIn;
  178. exports.easeElasticInOut = elasticInOut;
  179. exports.easeElasticOut = elasticOut;
  180. exports.easeExp = expInOut;
  181. exports.easeExpIn = expIn;
  182. exports.easeExpInOut = expInOut;
  183. exports.easeExpOut = expOut;
  184. exports.easeLinear = linear;
  185. exports.easePoly = polyInOut;
  186. exports.easePolyIn = polyIn;
  187. exports.easePolyInOut = polyInOut;
  188. exports.easePolyOut = polyOut;
  189. exports.easeQuad = quadInOut;
  190. exports.easeQuadIn = quadIn;
  191. exports.easeQuadInOut = quadInOut;
  192. exports.easeQuadOut = quadOut;
  193. exports.easeSin = sinInOut;
  194. exports.easeSinIn = sinIn;
  195. exports.easeSinInOut = sinInOut;
  196. exports.easeSinOut = sinOut;
  197. Object.defineProperty(exports, '__esModule', { value: true });
  198. })));