javascript - Jittering geo paths using D3.js -


i'm trying add 'jitter' or add random noise d3.js map contains line features. note, different other example because involves geo paths. additionally, while i'd use custom transformation this, don't think can because need able use standard transformation (from wgs84 ny state plane). think jittering function should either based on modified path function, or separate function takes path input.

var projection = d3.geo.conicconformal()       .parallels([40 + 40 / 60, 41 + 2 / 60])       .rotate([74, -40 - 10 / 60]);  var path = d3.geo.path()     .projection(projection); 

note don't want modify input data @ (i.e., jittering should on paths, not input geodata). note jittering can totally random (i.e., not have same every time). initial thought wrap data in jitter function, or wrap path function in jitter function. either way, i'm not sure start on this? suggestions? link relevant api item awesome!

svg.selectall("path")     .data(jitter(lines.features)) // wrap data in jitter function... or...   .enter().append("path")     .attr("class", "line")     .attr("d", function(d) { return jitter(path(d)); })  // jitter path directly 

a (simplified) jsfiddle available here reference.


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -