<!DOCTYPE html>
<
html
>
<
head
>
</
script
>
</
head
>
<
body
>
<
h2
style
=
"color:green"
>
GeeksforGeeks
</
h2
>
<
h4
> D3.js | sequential.copy() Function </
h4
>
<
script
>
var sequential = d3.scaleSequential();
// Default scale is identity function
document.write("<
h4
>From original scale:</
h4
>");
document.write("<
p
>sequential(0.4): ",
sequential(0.4) + "</
p
>");
document.write("<
p
>sequential(0.6): ",
sequential(0.6) + "</
p
>");
// Creating copy of the original scale
var sequentialCopy = sequential.copy();
sequentialCopy.domain([1, 2]);
document.write(
"<
h4
>From copy scale after changing domain:</
h4
>");
document.write("<
p
>sequentialCopy(0.4): ",
sequentialCopy(0.4) + "</
p
>");
document.write("<
p
>sequentialCopy(0.6): ",
sequentialCopy(0.6) + "</
p
>");
</
script
>
</
body
>
</
html
>