![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/lavocat.quebec/private_html/node_modules/d3-scale/src/ |
import continuous from "./continuous.js";
import {initRange} from "./init.js";
import {linearish} from "./linear.js";
import number from "./number.js";
function square(x) {
return Math.sign(x) * x * x;
}
function unsquare(x) {
return Math.sign(x) * Math.sqrt(Math.abs(x));
}
export default function radial() {
var squared = continuous(),
range = [0, 1],
round = false,
unknown;
function scale(x) {
var y = unsquare(squared(x));
return isNaN(y) ? unknown : round ? Math.round(y) : y;
}
scale.invert = function(y) {
return squared.invert(square(y));
};
scale.domain = function(_) {
return arguments.length ? (squared.domain(_), scale) : squared.domain();
};
scale.range = function(_) {
return arguments.length ? (squared.range((range = Array.from(_, number)).map(square)), scale) : range.slice();
};
scale.rangeRound = function(_) {
return scale.range(_).round(true);
};
scale.round = function(_) {
return arguments.length ? (round = !!_, scale) : round;
};
scale.clamp = function(_) {
return arguments.length ? (squared.clamp(_), scale) : squared.clamp();
};
scale.unknown = function(_) {
return arguments.length ? (unknown = _, scale) : unknown;
};
scale.copy = function() {
return radial(squared.domain(), range)
.round(round)
.clamp(squared.clamp())
.unknown(unknown);
};
initRange.apply(scale, arguments);
return linearish(scale);
}