Tracing the intersections between moving lines.
license: gpl-3.0 |
//creates new point | |
function P(x, y, color){ | |
var rv = {x: x, y: y, color: color || 'black'} | |
rv.toString = function(){ return rv.x + ',' + rv.y } | |
return rv | |
} | |
//dist |
//creates new point | |
function P(x, y, color){ | |
var rv | |
if (x.map){ | |
rv = {x: x[0], y: x[1], color: 'black'} | |
} else{ | |
rv = {x: x, y: y, color: color || 'black'} | |
} | |
rv.toString = function(){ return rv.x + ',' + rv.y } | |
rv.type = 'point' |
Electoral hexagrams as snowfall.
Would be nice if the floating block was in the shape of the US, but didn't make it that far. Mouseover to adjust speed.
mask
lets you draw an area with multiple colors using just one path
.
Show direction with dots.
Idea stolen from https://bl.ocks.org/emeeks/21f99959d48dd0d0c746
d3-jetpack's d3.conventions can now create canvas and html elements. Here d3.conventions({layers: 'csd'})
makes an canvas ctx, svg and div with a shared coordinate system. Yellow shapes are drawn on canvas, cyan on svg and purple on html.
Layers are position absolutely on top of each other in the order listed in the layer string. To create an svg with two canvas elements on top:
var {layers: [svg, bg_ctx, fg_ctx]} = d3.conventions({layers: 'scc'})
Hurricane How-To describes using multiple renders for something more practical than bouncing circles.
license: mit |