Skip to content

Instantly share code, notes, and snippets.

@why-not
Forked from milroc/README.md
Last active August 29, 2015 13:57
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 why-not/9693438 to your computer and use it in GitHub Desktop.
Save why-not/9693438 to your computer and use it in GitHub Desktop.

d3.unconf example gist. Fork it here.

<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link type="text/css" rel="stylesheet" href="style.css"/>
</head>
<body>
<h2 class="d3-unconf">register me already!</h2>
<div id="chart"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="src.js"></script>
</body>
</html>
d3.unconf = function() {
console.log('register me already!');
};
d3.unconf();
var svg = d3.select("body")
.append("svg")
.attr("width", 500)
.attr("height", 500);
svg.append("circle")
.attr("cx", 100)
.attr("cy", 0)
.attr("r", 50)
.attr("fill", "steelblue");
svg.append("circle")
.attr("cx", 300)
.attr("cy", 0)
.attr("r", 50)
.attr("fill", "steelblue");
svg.append("circle")
.attr("cx", 200)
.attr("cy", 150)
.attr("r", 75)
.attr("fill", "black");
svg.append("svg:path")
.attr("d","M 65 400 q 150 -300 300 0")
.style("stroke-width", 10)
.style("stroke", "steelblue")
.style("fill", "none");
@import url("//fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700");
body {
font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Helvetica, Arial, sans-serif;
}
.d3-unconf {
color: #222;
font-size: 44px;
font-style: normal;
font-weight: 300;
text-rendering: optimizelegibility;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment