MCPcopy Create free account
hub / github.com/microsoft/SandDance / powish

Function powish

docs/tests/v2/es6/js/sanddance.js:108158–108171  ·  view source on GitHub ↗
(transform)

Source from the content-addressed store, hash-verified

108156}
108157
108158function powish(transform) {
108159 var scale = transform(_continuous.identity, _continuous.identity),
108160 exponent = 1;
108161
108162 function rescale() {
108163 return exponent === 1 ? transform(_continuous.identity, _continuous.identity) : exponent === 0.5 ? transform(transformSqrt, transformSquare) : transform(transformPow(exponent), transformPow(1 / exponent));
108164 }
108165
108166 scale.exponent = function (_) {
108167 return arguments.length ? (exponent = +_, rescale()) : exponent;
108168 };
108169
108170 return (0, _linear.linearish)(scale);
108171}
108172
108173function pow() {
108174 var scale = powish((0, _continuous.transformer)());

Callers 1

powFunction · 0.70

Calls 2

transformFunction · 0.70
rescaleFunction · 0.70

Tested by

no test coverage detected