News for hackers. Stuff that matters.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by TwistedWeasel on Wednesday May 09, 2012 @09:57AM (#3948559)
I've been learning d3.js myself lately, and i'm very impressed. As it's popularity increases it's worth reading this article from Mike Bostock, the creator of d3 proposing some conventions to follow when building charts with d3...

http://bost.ocks.org/mike/chart/

Re:Build An Animated Chart In 19 Lines Of Code With d3.js by ajtulloch on Wednesday May 09, 2012 @10:32AM (#3948740)
A few months ago I learned d3.js and made myself an interactive site logo for myself with it. It's an awesome library.

Check out the logo (try clicking it and dragging the letters) and tutorial at http://tullo.ch/2012/making-the-site-logo/.

Re:Build An Animated Chart In 19 Lines Of Code With d3.js by oulipian on Wednesday May 09, 2012 @11:29AM (#3948994)
Your logo doesn't work. I'm using the latest Firefox on a Mac. Error: strengths is undefined.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by ajtulloch on Wednesday May 09, 2012 @11:48AM (#3949095)
Hmm strange, just tested then and works on my end with Chrome 18 and Firefox 12.0 on OS X.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by fceccon on Wednesday May 09, 2012 @02:17PM (#3949822)
I'm on Chrome 20 on OS X and I got this error:

    Cannot read property '0' of undefined      d3.v2.js:5166
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by rralian on Wednesday May 09, 2012 @02:29PM (#3949880)
I got this too. It's reproduceable for me if I click on any of the nodes before the page is ready for it, and once this happens I can't use it at all. But if I wait a second or two before doing this it works fine. Using latest chrome.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by xxbondsxx on Wednesday May 09, 2012 @11:46AM (#3949082)
Same as oulipian, I got some error about 0 being undefined.

Also, if you are planning on doing a spring-mass simulation, it's much better to use arbor.js which has background thread support (and is non-blocking)

Re:Build An Animated Chart In 19 Lines Of Code With d3.js by vlandham on Wednesday May 09, 2012 @10:37AM (#3948762)
Also plenty of really good beginner d3 tutorials from Scott Murray:

http://alignedleft.com/tutorials/

Re:Build An Animated Chart In 19 Lines Of Code With d3.js by stephenlee on Wednesday May 09, 2012 @10:15AM (#3948644)
Beautiful chart, I want to make some interactive charts and d3.js is just suited for me. But I can't dive into JavaScript though it looks like easy. I'm familiar with Python. Anyone can suggest enough JavaScript tutorials to hack d3.js. Thanks!
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by monkeyfacebag on Wednesday May 09, 2012 @11:40AM (#3949047)
I would get yourself a copy of The Good Parts. As someone who also went from Python to JS, it didn't fully click until I sat down and read through the book. Now there are aspects of JS I actually prefer over Python.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by stephenlee on Wednesday May 09, 2012 @11:44PM (#3951763)
Thanks, the book is fantastic.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by dm8 on Wednesday May 09, 2012 @02:48PM (#3949941)
D3 is awesome but I've always felt it is more suitable for complex visualizations. For simple stuff like line graph etc. Existing graphing libraries are pretty cool. Anyone using it for common visualizations like line chart or pie chart?
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by louischatriot on Wednesday May 09, 2012 @03:16PM (#3950039)
What I like in d3 is that it leaves completely free to do whatever you want, be it simple bar charts or complicated stuff. I don't like integrative libraries that don't allow you to make your graphs evolve.

I used it to build animated line charts but those are a bit more complex (you have to use SVG paths with Bezier curves which are a pain to calculate ...)

Re:Build An Animated Chart In 19 Lines Of Code With d3.js by cdomigan on Wednesday May 09, 2012 @10:19PM (#3951550)
Pfft. I can Build An Animated Chart In 1 Line Of Code With DoesEverythingForYou.js
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by louischatriot on Thursday May 10, 2012 @03:14AM (#3952249)
Of course, but the point here is that d3.js really is not "doeseverythingforyou.js" : it only takes care of the "boring" stuff (manipulating DOM, binding data) and lets you do whatever you imagine. So it's more like "build this chart writing only the 19 lines of javascript that matter".
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by dgabriel on Wednesday May 09, 2012 @10:03AM (#3948589)
Alas, the site is down. I'd love to see this.
Re:Build An Animated Chart In 19 Lines Of Code With d3.js by louischatriot on Wednesday May 09, 2012 @10:21AM (#3948679)
I just checked and it is up, you can retry!