[ddj] Conspiracy Theories as network graphs (David Weisz)
Marko Plahuta
vito.solipsy at gmail.com
Thu Apr 24 12:24:28 UTC 2014
Hi David,
yes, I used d3 for the map. First I used my MapBox account and a
classic map API, but then I realized that if this thing was going to
get popular, it was going to cost me. So I decided on d3, because
it's all in the browser and it doesn't call data from any other
server.
How I learned to code d3? Well, I'm still learning. My previous
backgroud was Java, which is a different language than Javascript. And
d3 in particular looks like black magic, until you understand it, but
then it's pretty easy. The reason it looks hard is because it's hard
for a programmer to understand that it does pretty much everything you
would otherwise have to code manually. But for a person with no
coding experience that may be a good thing. The key thing with d3 is
to learn the selections - the enter/exit/update cycle on data, There's
where the real work happens, and if you manage to wrap your head
around it, you're home free.
In a way, my blog is a chronicle of my learning new technologies. My
first published project with d3 sucked! The next one I didn't even
manage to publish, because I couldn't figure out the selection cycles
on a multiline chart, even though there's a lot of examples online.
When I'm learning something new with d3, I do it like this:
- first I copy some example from Mike Bostock's d3.org in my IDE
(that's a program to write programs. I use Aptana, it's free). I try
to change a few parameters in code to see how it works.
- then I substitute his data for mine, and try to make it work. To
load data properly, you will have to master some data formats (csv,
json), and be able to generate them on your own. I usually use a
separate Java program for that, but that's not at all necessary, so
don't panic. Start with csv, you can export it from Excel.
- then I proceed in concentric circles outward with styling and
interactivity, until I'm satisfied.
I read a few books and sites in the process:
https://www.dashingd3js.com/
http://shop.oreilly.com/product/0636920026938.do
https://github.com/mbostock/d3/wiki/Tutorials
While learning, you'll find that StackOverflow probably has all the
answers to your questions. Do not despair if you can't make it work in
the beginning. That's why I suggest starting on a working example
that's close to your desired outcome. Just stick with it, sleep over
it and try again in the morning. That's what I do, and I generally
don't let go until I made it work.
Good luck! If you have very specific questions, you can mail me privately.
Marko
--
virostatiq.com
More information about the data-driven-journalism
mailing list