Skip to content

Instantly share code, notes, and snippets.

@enjalot
Created August 8, 2013 04:13
Show Gist options
  • Save enjalot/6181384 to your computer and use it in GitHub Desktop.
Save enjalot/6181384 to your computer and use it in GitHub Desktop.
for CryptoQuick
{"description":"for CryptoQuick","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"thumbnail":"http://i.imgur.com/zG7EG7E.png"}
var width = 960,
height = 500;
var color = d3.scale.linear()
.range(['#aad', '#556']);
var data0 = [
[100, 100],
[150, 75],
[200, 100],
[200, 150],
[150, 175],
[100, 150]
];
var data1 = [
[300, 300],
[350, 275],
[400, 300],
[400, 350],
[350, 375],
[300, 350]
];
var line = d3.svg.line()
.x(function(d) { return d[0] })
.y(function(d) { return d[1] })
.interpolate('linear-closed')
var svg = d3.select('svg')
.attr('width', width)
.attr('height', height);
svg.
selectAll('path.area')
.data([data0, data1])
.enter().append('path')
.style({
fill: function() { return color(0.5); },
stroke: '#909',
'stroke-width': 5
})
.attr('class', 'area')
.attr('d', function(d) {
return line(d)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment