UNPKG
@plotly/d3
Version:
latest (3.8.2)
3.8.2
3.8.1
3.8.0
3.7.0
3.6.1
3.6.0
3.5.18
A JavaScript visualization library for HTML and SVG.
d3js.org
plotly/d3
@plotly/d3
/
src
/
scale
/
bilinear.js
8 lines
(7 loc)
•
212 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
function
d3_scale_bilinear
(
domain, range, uninterpolate, interpolate
) {
var
u =
uninterpolate
(domain[
0
], domain[
1
]), i =
interpolate
(range[
0
], range[
1
]);
return
function
(
x
) {
return
i
(
u
(x)); }; }