Skip to content

Instantly share code, notes, and snippets.

@jdutta
Last active August 29, 2015 14:17
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 jdutta/85f6416a6cdf1eb85d55 to your computer and use it in GitHub Desktop.
Save jdutta/85f6416a6cdf1eb85d55 to your computer and use it in GitHub Desktop.
blur-experiment-1
{"description":"blur-experiment-1","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"chart_data.csv":{"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":"pingpong","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01,"ajax-caching":true,"thumbnail":"http://i.imgur.com/rUn1ian.gif"}
// Blur experiment (onion skin)
// Configurable params
// Click on the number and see a magic slider appears to tweak it.
var config = {
width: 500,
height: 500
};
var svg = d3.select('svg');
var gRoot = svg.append('svg:g')
//.attr('transform', 'translate(100, 100) scale(1)')
//.style('shape-rendering', 'crispEdges')
//.style('stroke', 'red')
.style('stroke-width', '1')
.style('fill', 'red')
var circle = gRoot.append('svg:circle')
.classed('foo', true)
.attr({
cx: 50,
cy: 50,
r: 30
})
svg.on('mousemove', function () {
var m = d3.mouse(this);
console.log('mouse', m);
//*
circle
//.transition()
.attr({
cx: m[0],
cy: m[1]
});
//*/
gRoot.append('svg:circle')
.attr({
cx: m[0],
cy: m[1],
r: 30
})
.transition()
.duration(500)
.style({opacity: 0})
.remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment