Skip to content

Instantly share code, notes, and snippets.

@dustin
Created May 1, 2012 00:09
Show Gist options
  • Save dustin/2563862 to your computer and use it in GitHub Desktop.
Save dustin/2563862 to your computer and use it in GitHub Desktop.
Path test
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Path Test</title>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
</head>
<body>
<script type="text/javascript">
var svg = d3.select("body")
.append("svg:svg")
.attr("viewBox", "0 0 500 300")
.attr("version", "1.1");
svg.append("defs")
.append("path")
.attr("id", "s3")
.attr("d", "M 10,90 Q 100,15 200,70 Q 340,140 400,30");
svg.append("svg:g")
.attr("id", "thing")
.attr("fill", "navy")
.append("text")
.attr("font-size", "20")
.append("textPath")
.attr("xlink:href", "#s3")
.text("Wavy text is the gimmick for many years to come (d3)");
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment