Skip to content

Instantly share code, notes, and snippets.

@jgoodie
Created August 8, 2022 19:37
Show Gist options
  • Save jgoodie/22c8a484610b9ce332e5cec9d520c99d to your computer and use it in GitHub Desktop.
Save jgoodie/22c8a484610b9ce332e5cec9d520c99d to your computer and use it in GitHub Desktop.
how to declare a scale object
// Add X axis
const x = d3.scaleLinear()
.domain([1.5, 5])
.range([ 0, width ]);
// Add Y axis
const y = d3.scaleLinear()
.domain([3, 8.5])
.range([ height, 0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment