Show HN: Weekend project, D3.js Globe of Recent Earthquakes
boydgreenfield.com
boydgreenfield.com
It doesn't always auto play, and clicking play/pause doesn't make it work (happened twice to me in five refreshes on Chrome).
When it said "Highlight an earthquake..." I was nervous I would have to follow those little circles with my mouse while trying to read the information, but it works well!
The earth quake zones just popping into view looks a little goofy. Is there any way to fade them in, or have them start as a line and transform into a circle (going through an ellipse). That might make it look a little cleaner on entry/exit.
Great work!
Let me know -- and I'd love to hear if anybody has suggestions for better catching JSONP callback-related errors.
Nice project though, as a geo guy who's been meaning to play with D3, it's inspiring.
Particularly with high latency, it will sometimes fail to load the JSONP from the USGS. Because JSONP is a <script> and I'm not properly catching the thrown error that causes D3 to bug out. I'm trying to get USGS to let me use CORS with the JSON files so I don't have to deal with the callback function of JSONP.
Oh - and refreshing the page should fix that! Thanks, and glad you like it.
All of this can be changed in the JS parameters easily enough, however.
I'd like to use it for a project and credit you. The most advanced I've found open so far is just a base rotating D3.js globe (http://bl.ocks.org/d/1246403/).
Email me at boyd.greenfield at gmail and I'll get you the source if you'd like to chat about it. Otherwise I'll get to opening it up and adding an (open) license shortly.
Edit: Oh, and how you distort svg to make it look spherical while dragging? This is very cool.
All of the SVG magic is D3.js and simply modified from this sweet example by Mike Bostock: http://mbostock.github.com/d3/talk/20111018/azimuthal.html
Edit: Oddly, I'm noticing that the title of Mike's page is "Afghanistan", which is the one country in the GEOJSON I'm using that doesn't render properly... (it shows empty like a 2nd Caspian Sea)
Maybe it has something to do with Afghanistan being the first country in an alphabetical list? I'd try putting another country in the first position in the data table and see if the rendering problem switches locations.
One nitpick I have is that earthquakes are no longer measured on the Richter scale, but rather the Momentum magnitude scale. See http://www.usgs.gov/faq/index.php?sid=54684&lang=en&...
I glanced at the comments to see if anyone said "It's broken" and nobody did, so I went back and tried hitting the play button but nothing happened, same result.
Then I read the first comment on here and went back one more time and it worked; however, this time when it spins and I click on a red dot nothing happens and I get ' error parsing d="" ' in the console, with the line being /quakes/:1, which is just the <html> tag.
It's possible that it's not properly loading the data for you, either due to latency or some browser restrictions. What are you running?
I'd like to debug if possible. I believe D3.js only fully works in Chrome, Safari, and Firefox (+ maybe Opera?).
I actually had the same idea, but changed it slightly when it came time for execution because I wanting to use geolocation api's. Never really ended up finishing it though, turns out theres not much quake activity on the east coast and I lost intrest. :(
[edit, since i can't reply directly, and probably shouldn't string out a long thread anyway: i do agree with your choice, it looks good as it is. i just assumed it meant something. not sure how you avoid that.]