Spaces:
Paused
Paused
Download node_modules/@plotly/d3/src/scale/pow.js from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.29 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/scale/pow.js
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/@plotly/d3/src/scale/pow.js
-
curl -L -o pow.js https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/%40plotly/d3/src/scale/pow.js
1.29 kB
| import "linear"; | |
| import "scale"; | |
| d3.scale.pow = function() { | |
| return d3_scale_pow(d3.scale.linear(), 1, [0, 1]); | |
| }; | |
| function d3_scale_pow(linear, exponent, domain) { | |
| var powp = d3_scale_powPow(exponent), | |
| powb = d3_scale_powPow(1 / exponent); | |
| function scale(x) { | |
| return linear(powp(x)); | |
| } | |
| scale.invert = function(x) { | |
| return powb(linear.invert(x)); | |
| }; | |
| scale.domain = function(x) { | |
| if (!arguments.length) return domain; | |
| linear.domain((domain = x.map(Number)).map(powp)); | |
| return scale; | |
| }; | |
| scale.ticks = function(m) { | |
| return d3_scale_linearTicks(domain, m); | |
| }; | |
| scale.tickFormat = function(m, format) { | |
| return d3_scale_linearTickFormat(domain, m, format); | |
| }; | |
| scale.nice = function(m) { | |
| return scale.domain(d3_scale_linearNice(domain, m)); | |
| }; | |
| scale.exponent = function(x) { | |
| if (!arguments.length) return exponent; | |
| powp = d3_scale_powPow(exponent = x); | |
| powb = d3_scale_powPow(1 / exponent); | |
| linear.domain(domain.map(powp)); | |
| return scale; | |
| }; | |
| scale.copy = function() { | |
| return d3_scale_pow(linear.copy(), exponent, domain); | |
| }; | |
| return d3_scale_linearRebind(scale, linear); | |
| } | |
| function d3_scale_powPow(e) { | |
| return function(x) { | |
| return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e); | |
| }; | |
| } | |