<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
/>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0"
/>
</
script
>
</
script
>
<
script
src
=
</
script
>
<
script
src
=
</
script
>
</
head
>
<
body
>
<
h2
style
=
"color: green;"
>Geeksforgeeks</
h2
>
<
p
>continuous.interpolateRound() Function </
p
>
<
script
>
var continuous = d3.scaleLinear()
// Domain ranges -10, 0, 10
.domain([-10, 0, 10])
// Range for the domain
.range([10, 20, 30, 40, 50, 60, 70, 80, 90])
// Using interpolateRound
.interpolate(d3.interpolateRound);
document.write("<
div
>");
document.write("<
h3
>" + continuous(1) + "</
h3
>");
document.write("<
h3
>" + continuous(2) + "</
h3
>");
document.write("<
h3
>" + continuous(3.5) + "</
h3
>");
document.write("<
h3
>" + continuous(4.5) + "</
h3
>");
document.write("<
h3
>" + continuous(5.5) + "</
h3
>");
document.write("<
h3
>"
+ continuous(-2.5) + "</
h3
></
div
>");
</
script
>
</
body
>
</
html
>