Skip to content

Instantly share code, notes, and snippets.

@jgoodie
Created August 8, 2022 05:20
Show Gist options
  • Save jgoodie/81f94f4f8b002e37dc4aeb6e547472a8 to your computer and use it in GitHub Desktop.
Save jgoodie/81f94f4f8b002e37dc4aeb6e547472a8 to your computer and use it in GitHub Desktop.
Append the svg object to the body of the page
// append the svg object to the body of the page
const svg = d3.select("body")
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", `translate(${margin.left},${margin.top})`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment