[ Launch: prototype: d3.geo ] 4737103 by ptvans
[ Launch: Tributary inlet ] 4700486 by enjalot
-
-
Save ptvans/4737103 to your computer and use it in GitHub Desktop.
prototype: d3.geo
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":"prototype: d3.geo","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},"world110.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"config.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"_.md":{"default":true,"vim":false,"emacs":false,"fontSize":12},"style.css":{"default":true,"vim":false,"emacs":false,"fontSize":12},"scheduledarrivals.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"realtimearrivals.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12}},"fullscreen":false,"play":false,"loop":false,"restart":false,"autoinit":true,"pause":true,"loop_type":"period","bv":false,"nclones":15,"clone_opacity":0.4,"duration":3000,"ease":"linear","dt":0.01} |
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 schedule = tributary.scheduledarrivals; | |
var realtime = tributary.realtimearrivals; | |
var svg = d3.select("svg"); | |
//console.log(schedule) | |
var width = tributary.sw; | |
var height = tributary.sh; | |
var center = { | |
x: width/2, | |
y: height/2 | |
} | |
var world = tributary.world110; | |
var countries = topojson.object(world, world.objects.land); | |
//san francisco [-122.4194200, 37.7749300 ] | |
var lonlat = [-122.4194200, 37.7749300 ]; | |
var projection = d3.geo.mercator() | |
.scale(937413) | |
.center(lonlat) | |
.translate([width/2, height/2]) | |
var xy = projection(lonlat); | |
var path = d3.geo.path() | |
.projection(projection); | |
svg.append("path") | |
.attr("transform", "translate(" + [xy[0] - center.x, xy[1] - center.y ] + ")") | |
.attr("d", path(countries)) | |
.classed("land", true); | |
svg.append("circle") | |
.classed("locator", true) | |
.attr({ | |
cx: xy[0], | |
cy: xy[1], | |
r: 283 | |
}) | |
svg.append("g") | |
.attr("id", "schedule") | |
var points = svg.select("#schedule") | |
.selectAll("circle") | |
.data(schedule) | |
.enter() | |
.append("circle") | |
.classed("arrival", true); | |
points | |
.attr("transform", function(d) { | |
var p = projection([d.LONGITUDE, d.LATITUDE]); | |
return "translate(" + p + ")"; | |
}) | |
.attr({ | |
"r": 5 | |
}) | |
svg.append("g") | |
.attr("id", "realtime") | |
var points = svg.select("#realtime") | |
.selectAll("circle") | |
.data(realtime) | |
.enter() | |
.append("circle") | |
.classed("realtime", true); | |
points | |
.attr("transform", function(d) { | |
var p = projection([d.LONGITUDE, d.LATITUDE]); | |
return "translate(" + p + ")"; | |
}) | |
.attr({ | |
"r": 5 | |
}) |
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
PUBLIC_ROUTE_NAME | NEXTBUS_VEHICLE_ASSIGNMENT | TRIP_ID | BLOCK_NAME | IS_TWO_CAR | CAR_NUMBER | STOP_ID | LONGITUDE | LATITUDE | NEXTBUS_ARRIVAL_TIME | |
---|---|---|---|---|---|---|---|---|---|---|
01 | 5602 | 5212999 | 119 | N | 0 | 4027 | -122.409774 | 37.79379 | 10/1/2012 10:34:54.000000 AM | |
01 | 5602 | 5212999 | 119 | N | 0 | 6296 | -122.433669 | 37.789839 | 10/1/2012 10:20:43.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 4027 | -122.409774 | 37.79379 | 10/1/2012 10:45:46.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 4028 | -122.401118 | 37.79482 | 10/1/2012 10:51:28.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 4277 | -122.493227 | 37.779744 | 10/1/2012 10:10:38.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 4015 | -122.396996 | 37.795415 | 10/1/2012 10:54:19.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 3825 | -122.464709 | 37.784902 | 10/1/2012 10:19:46.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 4026 | -122.420714 | 37.792385 | 10/1/2012 10:40:57.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 3893 | -122.446885 | 37.787149 | 10/1/2012 10:27:45.000000 AM | |
01 | 5503 | 5213002 | 110 | N | 0 | 6296 | -122.433669 | 37.789839 | 10/1/2012 10:32:37.000000 AM | |
01 | 5554 | 5213013 | 105 | N | 0 | 4026 | -122.420714 | 37.792385 | 10/1/2012 11:34:15.000000 AM | |
01 | 5554 | 5213013 | 105 | N | 0 | 3825 | -122.464709 | 37.784902 | 10/1/2012 11:17:09.000000 AM | |
01 | 5554 | 5213013 | 105 | N | 0 | 4028 | -122.401118 | 37.79482 | 10/1/2012 11:44:05.000000 AM | |
01 | 5554 | 5213013 | 105 | N | 0 | 4015 | -122.396996 | 37.795415 | 10/1/2012 11:47:00.000000 AM | |
03 | 5636 | 5214578 | 301 | N | 0 | 6603 | -122.420198 | 37.787797 | 10/1/2012 2:17:21.000000 PM | |
03 | 5636 | 5214578 | 301 | N | 0 | 6089 | -122.44688 | 37.78737 | 10/1/2012 2:34:14.000000 PM | |
03 | 5636 | 5214578 | 301 | N | 0 | 6591 | -122.433151 | 37.786158 | 10/1/2012 2:23:44.000000 PM | |
03 | 5636 | 5214578 | 301 | N | 0 | 6604 | -122.408677 | 37.789266 | 10/1/2012 2:10:31.000000 PM | |
03 | 5636 | 5214578 | 301 | N | 0 | 6606 | -122.400674 | 37.790298 | 10/1/2012 2:05:43.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 4028 | -122.401118 | 37.79482 | 10/3/2012 5:33:55.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 4015 | -122.396996 | 37.795415 | 10/3/2012 5:36:11.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 6296 | -122.433669 | 37.789839 | 10/3/2012 5:16:00.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 4027 | -122.409774 | 37.79379 | 10/3/2012 5:27:29.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 4026 | -122.420714 | 37.792385 | 10/3/2012 5:22:53.000000 PM | |
01 | 5494 | 5213053 | 112 | N | 0 | 3893 | -122.446885 | 37.787149 | 10/3/2012 5:10:06.000000 PM | |
02 | 8305 | 5214646 | 202 | N | 0 | 6604 | -122.408677 | 37.789266 | 10/1/2012 2:17:42.000000 PM | |
02 | 8305 | 5214646 | 202 | N | 0 | 7543 | -122.473077 | 37.782498 | 10/1/2012 2:55:14.000000 PM | |
02 | 8305 | 5214646 | 202 | N | 0 | 3892 | -122.446908 | 37.787328 | 10/1/2012 2:40:53.000000 PM | |
02 | 8305 | 5214646 | 202 | N | 0 | 7227 | -122.394917 | 37.794454 | 10/1/2012 2:10:44.000000 PM | |
01 | 5588 | 5213084 | 107 | N | 0 | 3893 | -122.446885 | 37.787149 | 10/3/2012 6:06:47.000000 PM | |
02 | 8305 | 5214646 | 202 | N | 0 | 6603 | -122.420198 | 37.787797 | 10/1/2012 2:24:05.000000 PM | |
03 | 5638 | 5214611 | 351 | N | 0 | 6089 | -122.44688 | 37.78737 | 10/2/2012 10:47:22.000000 PM | |
03 | 5638 | 5214611 | 351 | N | 0 | 6606 | -122.400674 | 37.790298 | 10/2/2012 10:17:17.000000 PM | |
03 | 5638 | 5214611 | 351 | N | 0 | 6603 | -122.420198 | 37.787797 | 10/2/2012 10:28:54.000000 PM | |
03 | 5638 | 5214611 | 351 | N | 0 | 6604 | -122.408677 | 37.789266 | 10/2/2012 10:21:36.000000 PM | |
03 | 5638 | 5214611 | 351 | N | 0 | 6591 | -122.433151 | 37.786158 | 10/2/2012 10:36:45.000000 PM | |
02 | 8301 | 5214710 | 203 | N | 0 | 6022 | -122.40793 | 37.7883 | 10/1/2012 7:26:47.000000 AM |
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
PUBLIC_ROUTE_NAME | TRIP_ID | BLOCK_NAME | LONGITUDE | LATITUDE | SCHEDULED_ARRIVAL_TIME | |
---|---|---|---|---|---|---|
01 | 5212999 | 119 | -122.409774 | 37.79379 | 10/1/2012 10:31:00.881000 AM | |
01 | 5212999 | 119 | -122.433669 | 37.789839 | 10/1/2012 10:19:00.887000 AM | |
01 | 5213002 | 110 | -122.409774 | 37.79379 | 10/1/2012 10:46:00.148000 AM | |
01 | 5213002 | 110 | -122.401118 | 37.79482 | 10/1/2012 10:52:00.159000 AM | |
01 | 5213002 | 110 | -122.493227 | 37.779744 | 10/1/2012 10:10:00.170000 AM | |
01 | 5213002 | 110 | -122.396996 | 37.795415 | 10/1/2012 10:54:00.178000 AM | |
01 | 5213002 | 110 | -122.464709 | 37.784902 | 10/1/2012 10:21:00.186000 AM | |
01 | 5213002 | 110 | -122.420714 | 37.792385 | 10/1/2012 10:41:00.194000 AM | |
01 | 5213002 | 110 | -122.446885 | 37.787149 | 10/1/2012 10:28:00.201000 AM | |
01 | 5213002 | 110 | -122.433669 | 37.789839 | 10/1/2012 10:34:00.211000 AM | |
01 | 5213013 | 105 | -122.420714 | 37.792385 | 10/1/2012 11:35:00.482000 AM | |
01 | 5213013 | 105 | -122.464709 | 37.784902 | 10/1/2012 11:15:00.491000 AM | |
01 | 5213013 | 105 | -122.401118 | 37.79482 | 10/1/2012 11:47:00.498000 AM | |
01 | 5213013 | 105 | -122.396996 | 37.795415 | 10/1/2012 11:49:00.506000 AM | |
03 | 5214578 | 301 | -122.420198 | 37.787797 | 10/1/2012 2:18:00.459000 PM | |
03 | 5214578 | 301 | -122.44688 | 37.78737 | 10/1/2012 2:36:00.466000 PM | |
03 | 5214578 | 301 | -122.433151 | 37.786158 | 10/1/2012 2:26:00.472000 PM | |
03 | 5214578 | 301 | -122.408677 | 37.789266 | 10/1/2012 2:11:00.478000 PM | |
03 | 5214578 | 301 | -122.400674 | 37.790298 | 10/1/2012 2:05:00.482000 PM | |
01 | 5213053 | 112 | -122.401118 | 37.79482 | 10/3/2012 5:34:00.519000 PM | |
01 | 5213053 | 112 | -122.396996 | 37.795415 | 10/3/2012 5:36:00.526000 PM | |
01 | 5213053 | 112 | -122.433669 | 37.789839 | 10/3/2012 5:16:00.533000 PM | |
01 | 5213053 | 112 | -122.409774 | 37.79379 | 10/3/2012 5:28:00.539000 PM | |
01 | 5213053 | 112 | -122.420714 | 37.792385 | 10/3/2012 5:23:00.546000 PM | |
01 | 5213053 | 112 | -122.446885 | 37.787149 | 10/3/2012 5:10:00.552000 PM | |
02 | 5214646 | 202 | -122.408677 | 37.789266 | 10/1/2012 2:20:00.726000 PM | |
02 | 5214646 | 202 | -122.473077 | 37.782498 | 10/1/2012 2:55:00.733000 PM | |
02 | 5214646 | 202 | -122.446908 | 37.787328 | 10/1/2012 2:41:00.740000 PM | |
02 | 5214646 | 202 | -122.394917 | 37.794454 | 10/1/2012 2:11:00.746000 PM | |
01 | 5213084 | 107 | -122.446885 | 37.787149 | 10/3/2012 6:06:00.758000 PM | |
02 | 5214646 | 202 | -122.420198 | 37.787797 | 10/1/2012 2:26:00.752000 PM | |
03 | 5214611 | 351 | -122.44688 | 37.78737 | 10/2/2012 10:39:00.712000 PM | |
03 | 5214611 | 351 | -122.400674 | 37.790298 | 10/2/2012 10:15:00.720000 PM | |
03 | 5214611 | 351 | -122.420198 | 37.787797 | 10/2/2012 10:24:00.728000 PM | |
03 | 5214611 | 351 | -122.408677 | 37.789266 | 10/2/2012 10:19:00.734000 PM | |
03 | 5214611 | 351 | -122.433151 | 37.786158 | 10/2/2012 10:30:00.742000 PM | |
02 | 5214710 | 203 | -122.40793 | 37.7883 | 10/1/2012 7:22:00.879000 AM |
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
.land { | |
fill: #555555; | |
stroke: #000000; | |
} | |
circle.locator { | |
fill: #A5A5A5; | |
stroke: #F8BB79; | |
stroke-width: 3; | |
fill-opacity: 0.0 | |
} | |
circle.arrival { | |
fill: #47AFCF; | |
stroke: #FDFDFD; | |
stroke-width: 0.5; | |
fill-opacity: 0.2 | |
} | |
circle.realtime { | |
fill: #F1F133; | |
stroke: #FDFDFD; | |
stroke-width: 0.5; | |
fill-opacity: 0.2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment