Skip to content

Instantly share code, notes, and snippets.

@michaelsbradleyjr
Created December 5, 2012 00:45
Show Gist options
  • Save michaelsbradleyjr/4210789 to your computer and use it in GitHub Desktop.
Save michaelsbradleyjr/4210789 to your computer and use it in GitHub Desktop.
r2d3 experiment
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>Line Example</title>
<!--[if lte IE 9]><script src="https://raw.github.com/mhemesath/r2d3/master/r2d3.v2.js"></script><![endif]-->
<!--[if gte IE 10]><!-->
<script src="http://d3js.org/d3.v2.js"></script>
<!--<![endif]-->
</head>
<body>
<script>
var svg = d3.select("body").append("svg")
.attr("viewBox", "0 0 500 300");
svg.append("defs").append("path")
.attr("id", "s3")
.attr("d", "M 10,90 Q 100,15 200,70 Q 340,140 400,30");
var thing = svg.append("g")
.attr("id", "thing")
.style("fill", "navy");
thing.append("text")
.style("font-size", "20px")
.append("textPath")
.attr("xlink:href", "#s3")
.text("Wavy text is the gimmick for many years to come (d3)");
thing.append("use")
.attr("xlink:href", "#s3")
.style("stroke", "black")
.style("fill", "none");
</script>
</body>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment