[ Launch: boston playground ] 9255346 by samselikoff
-
-
Save samselikoff/9255346 to your computer and use it in GitHub Desktop.
cambridge
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","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/p99ovwR.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 = 246402, | |
translate = [90000, 59400], | |
lat = 42.3783903, | |
long = -71.1129097, | |
//scale = 100 | |
center = [tributary.sw/2, tributary.sh/2] | |
//translate = center, | |
; | |
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); | |
console.log("translate(" + [center[0]-xy[0], center[1]-xy[1]] + ")"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment