Skip to content

Instantly share code, notes, and snippets.

@Ledragon
Last active August 29, 2015 14:16
Show Gist options
  • Save Ledragon/bf2aae9b17298bc4ddff to your computer and use it in GitHub Desktop.
Save Ledragon/bf2aae9b17298bc4ddff to your computer and use it in GitHub Desktop.
Test bl.ocks.org
(
function () {
var svg = d3.select('#surface')
.append('svg')
.attr({
'width': '640px',
'height': '480px'
});
var data = new Array(10);
svg.selectAll('rect')
.data(data)
.enter()
.append('rect')
.attr({
'x': 0,
'y': function (d, i) {
return i * 10;
},
'width': function (d, i) {
return i * 5;
},
'height': 8
})
}()
);
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<div id="surface">
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<script src="app.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment