Skip to content

Instantly share code, notes, and snippets.

@biovisualize
Created March 14, 2018 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biovisualize/10486dbd56f8da259acd35293c0c0ce7 to your computer and use it in GitHub Desktop.
Save biovisualize/10486dbd56f8da259acd35293c0c0ce7 to your computer and use it in GitHub Desktop.
scale copy
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v4.min.js"></script>
</head>
<body>
<script>
var scale = d3.scaleLinear()
.domain([0, 10])
.range([0, 100])
console.log("before",scale.domain())
var scale2 = scale
.domain([30, 60])
.copy()
console.log("after", scale.domain())
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment