Create a scaffold from d3Kit SvgChart.
Last active
October 17, 2016 13:50
Star
You must be signed in to star a gist
Using d3Kit to scaffold <svg>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<title>blockup</title> | |
<link href='style.css' rel='stylesheet' /> | |
<body> | |
<div id="chart"></div> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script src="https://rawgit.com/twitter/d3kit/v3/dist/d3kit.min.js"></script> | |
<script src='main.js'></script> | |
</body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var chart = new d3Kit.SvgChart('#chart', { | |
initialWidth: 720, | |
initialHeight: 500, | |
margin: { top: 30, right: 30, bottom: 30, left: 30 }, | |
offset: { x: 0.5, y: 0.5 } // add little offset for sharp-edge rendering | |
}); | |
chart.rootG.append('circle') | |
.attr('cx', 40) | |
.attr('cy', 40) | |
.attr('r', 30) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment