[ Launch: cambridge ] 9353154 by samselikoff
[ Launch: boston playground ] 9255346 by samselikoff
-
-
Save samselikoff/9353154 to your computer and use it in GitHub Desktop.
cambridge with towns
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"description":"cambridge with towns","endpoint":"","display":"svg","public":true,"require":[{"name":"topojson","url":"http://d3js.org/topojson.v0.min.js"}],"fileconfigs":{"inlet.js":{"default":true,"vim":false,"emacs":false,"fontSize":12},"data.json":{"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},"uk.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"boston.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"world.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,"thumbnail":"http://i.imgur.com/fJi47K1.gif","inline-console":false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var svg = d3.select('svg'), | |
width = svg[0][0].clientWidth, | |
height = svg[0][0].clientHeight, | |
scale = 265610, | |
translate = [90000, 59400], | |
lat = 42.3783903, | |
long = -71.1129097, | |
//scale = 100 | |
center = [tributary.sw/2, tributary.sh/2] | |
//translate = center, | |
pin = "M256,50c-72.072,0-130.5,58.427-130.5,130.5c0,72.073,57.114,155.833,130.5,281.5c73.388-125.666,130.5-209.427,130.5-281.5C386.5,108.427,328.074,50,256,50z M256,224.133c-25.848,0-46.801-20.953-46.801-46.8s20.953-46.8,46.801-46.8s46.801,20.953,46.801,46.8S281.848,224.133,256,224.133z" | |
; | |
console.log(tributary.boston); | |
var proj = d3.geo.mercator() | |
.scale(scale) | |
.translate(center), | |
//.translate(translate), | |
path = d3.geo.path().projection(proj), | |
//data = tributary.world | |
data = tributary.boston | |
; | |
var xy = proj([long, lat]); | |
svg.append('g') | |
.attr("transform", "translate(" + [center[0]-xy[0], center[1]-xy[1]] + ")") | |
.append("path") | |
.datum(data) | |
.attr("d", path) | |
.style('fill', 'none') | |
.style('stroke', '#666'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment