Skip to content

Instantly share code, notes, and snippets.

@yonicd
Created April 1, 2017 00:55
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 yonicd/ee44de2991215d2e03a96631dfb85708 to your computer and use it in GitHub Desktop.
Save yonicd/ee44de2991215d2e03a96631dfb85708 to your computer and use it in GitHub Desktop.
fresh block
license: mit
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://d3js.org/d3.v3.min.js"></script>
<style>
</style>
</head>
<body>
<script>
var margin = {top: 40, right: 90, bottom: 30, left: 400},
width = 960 - margin.left - margin.right,
height = 500 - margin.top - margin.bottom;
//The SVG Container
var 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 + ")");
/*
svg.append("g")
.append("path")
.attr("d", "M100 50 A50 50 0 1 0 50 100 A60 60 0 1 1 0 100")
.attr("stroke", "red")
.attr("stroke-width", 40)
.attr("fill","none");
*/
svg.append("g")
.append("path")
.attr("d", "M90 40 A60 40 0 1 0 0 0")
.attr("stroke", "blue")
.attr("stroke-width", 8)
.attr("fill","none");
<!---g>
svg.append("g")
.append("path")
.attr("d", "M50 100 A60 60 0 1 1 0 100")
.attr("stroke", "green")
.attr("stroke-width", 8)
.attr("fill","none");
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment