[ Launch: Another Inlet ] 4736734 by ptvans
See Previous Inlet [ Gist ]
-
-
Save ptvans/4736734 to your computer and use it in GitHub Desktop.
Another Inlet
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":"Another Inlet","endpoint":"","display":"svg","public":true,"require":[],"fileconfigs":{"inlet.svg":{"default":true,"vim":false,"emacs":false,"fontSize":12},"worldcountries.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"costofliving.json":{"default":true,"vim":false,"emacs":false,"fontSize":12},"inlet.js":{"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},"scheduled-arrivals.excerpt.csv":{"default":true,"vim":false,"emacs":false,"fontSize":12},"scheduledarrivals.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,"tab":"edit","display_percent":0.6289991445680069,"editor_editor":{"coffee":false,"vim":false,"emacs":false,"width":934,"height":530,"hide":true},"editor_json0":{"vim":false,"emacs":false,"width":825,"height":474,"hide":true},"editor_json1":{"vim":false,"emacs":false,"width":873,"height":317,"hide":true}} |
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 countries = tributary.worldcountries; | |
var schedule = tributary.scheduledarrivals; | |
var svg = d3.select("svg"); | |
d3.select("#display").style("background-color","#242a3e") | |
var cw = 809; | |
var ch = 406; | |
var xy = d3.geo.mercator() | |
.scale(101067) | |
.translate([34789, 11636]) | |
//then we need a path function | |
var geopath = d3.geo.path() | |
.projection(xy); | |
var chart = svg.append("g") | |
.attr("transform", "translate(" + [54, 77] + ")") | |
.attr("id","chart"); | |
chart.append("g") | |
.attr("id", "countries"); | |
chart.append("g") | |
.attr("id", "points") | |
var labels = chart.append("g") | |
.classed("labels",true) | |
.attr("id", "labels"); | |
var countriesGroup = chart.select("#countries"); | |
//create a path for each country | |
countriesGroup.selectAll("path") | |
.data(countries.features) | |
.enter() | |
.append("path") | |
.attr("d", geopath) | |
.attr("id", function(d) { | |
return d.properties.name; | |
}) | |
.classed("country", true) | |
.style({ | |
fill:"#000000", | |
"fill-opacity": 0.26, | |
stroke:"#6682AC", | |
"stroke-width": 0.5, | |
"stroke-opacity": 0.5 | |
}) | |
var points = chart.select("#points") | |
.selectAll("circle") | |
.data(schedule) | |
.enter() | |
.append("circle") | |
points | |
.attr("transform", function(d) { | |
var p = xy([d.LONGITUDE, d.LATITUDE]); | |
return "translate(" + p + ")"; | |
}) | |
.attr({ | |
"r": 5, | |
"fill": "#ffffff", | |
"fill-opacity": 0.4, | |
"stroke":"#C5EE6D", | |
"stroke-width": 0.5 | |
}) | |
.append("title") | |
.text(function(d) { | |
return (d.city + ", " + d.days + " days"); | |
}) | |
points | |
.on("mouseover", function(d,i) { | |
labels.selectAll("g.lbltxt") | |
.data([d],function(c){ | |
return c.city; | |
}) | |
.attr({ | |
"fill-opacity": 1, | |
"font-size": 11, | |
"font-weight": 700 | |
}) | |
.on("mouseover") | |
.attr({"fill-opacity":1}) | |
}) | |
.on("mouseout", function(d,i) { | |
labels.selectAll("g.lbltxt") | |
.data([d],function(c){ | |
return c.city; | |
}) | |
.attr({ | |
"fill-opacity": 0.5, | |
"font-size": 9, | |
"font-weight": 300 | |
}) | |
}) | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment