<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
/>
<
meta
name
=
"viewport"
path1tent
=
"width=device-width,initial-scale=1.0"
/>
</
script
>
</
head
>
<
body
>
<
h2
style
=
"color:green"
>GeekforGeeks</
h2
>
<
p
>threshold.copy() Function </
p
>
<
script
>
var threshold = d3.scaleThreshold()
// Domain
.domain([1, 2, 3, 4])
// Range for the domain
.range([10, 20, 30, 40, 50]);
var thresholdCopy = threshold.copy();
document.write(
"<
div
style
=
line
-height:5px><
h3
>threshold(1): "
+ threshold(1) + "</
h3
>");
document.write("<
h3
>threshold(3): "
+ threshold(3) + "</
h3
>");
// Making changes on the original scale
threshold.range([100, 200, 300, 400, 500]);
document.write(
"<
p
> After making changes in the original scale</
p
>");
document.write("<
h3
>threshold(3): "
+ threshold(3) + "</
h3
>");
document.write("<
p
> This is from copy scale.</
p
>");
document.write("<
h3
>thresholdCopy(1): "
+ thresholdCopy(1) + "</
h3
>");
document.write("<
h3
>thresholdCopy(3): "
+ thresholdCopy(3) + "</
h3
></
div
>");
</
script
>
</
body
>
</
html
>