Facebook Mutual Friend Network Visualization in Flash

I started building a Facebook friends visualization using Constellation months ago but the project got buried by other work. I've finally brought it to a point where it's presentable. (-:

The interface lets you see which of your friends know each other. At any given time it will show one of your friends as the selected node (in bold), and any mutual friends as additional nodes. Lines between nodes represent friendships. Clicking a node will select it and you and the new person's mutual friends will appear. Finally, the colour of the circles represents gender for now: red is female, blue is male, and green is unknown.

To use the application, you'll need to click the link below, log in to your Facebook user account, and enable the Friends Constellation application. That will reveal the Flash movie which will promptly begin loading information about your friends and friendships.

This information can't be retrieved all at once so you'll find that the visualization will constantly change as more information comes in. It takes a while to load the data but it (usually) gets more interesting the longer you wait. Watching the nodes re-arrange themselves is fun, but also processor-heavy. If you have a lot of friends the CPU load will be pretty high. Be warned.

  • To view the Facebook friends Constellation, login to Facebook. It's really easy and don't worry—it won't add anything to your Facebook profile page.

There's a lot of functionality missing from this prototype and I'll probably be posting updates in the near future. If you have any suggestions for improving the interface/visualization post away...

Comments

Keenan says, "I have no friends :("
Keenan's picture

It doesn't seem to be working for me, it's only showing one guy who's not really my friend! Or is it just choosing a poor starting node?

daniel says, "Poor starting node. Hitting"
daniel's picture

Poor starting node. Hitting the browser refresh might help you there... in a future version I'd like to put a list of friends so that clicking on a person in the list will make them the selected node.

daniel says, "Drop-down friends list"
daniel's picture

Alright, I figured it wouldn't be too hard to just add a combobox with a list of friends. So there it is! Now if the initial selected node is some one who doesn't know your friends you can jump to any of your other friends.

Sybil says, "Wow... that's pretty cool :)"
Sybil's picture

Wow... that's pretty cool :) Good job!

Eric says, "Really cool. But I think in"
Eric's picture

Really cool. But I think in your reducing the vibration, you made it so that the whole thing stops moving when one of the contacts is manually moved?

daniel says, "Facebook Constellation Update"
daniel's picture

Thanks, Eric, for the feedback. I've updated the demo so that the physics engine won't go to standby mode while the user is dragging a node around.

turgay says, "hiii"
turgay's picture

l want to make matual friend please help me

Anonymous says, "Mutual Friends"
Anonymous's picture

Hey Daniel,

Great app! I really like it! I am trying to work on playing with the Facebook API and I was wondering if you could advise on how to figure out how many mutual friends a friend might have? I was trying to find something about it on the developers wiki, and hoping there's a better method than simply iterating through lists of friends over and over again. If you could help me out, I'd greatly appreciate it! Thanks!

jrj says, "What about me?"
jrj's picture

Hey Daniel,

Neat App, Thanks. Call me an egomaniac but I'd love to be the central node so I can see all of my friends around me - is that not possible?

Top Stuff. Thanks,

Jason

daniel says, "An Egomaniac's Mutual Friends"
daniel's picture

Hey Jason,

The reason I didn't put the logged in user into the visualization at all is because he/she would be connected to every person in the graph anyway, and this visualization is meant to explore the mutual friend relationships.

That said, having all of your friends in a single visualization would probably be pretty cool, if a little heavy on the ol' CPU.

daniel says, "Facebook API: How Many Mutual Friends?"
daniel's picture

Hi Anonymous,

After much searching I was left disappointed and ended up just doing the iteration solution you mentioned. That's the reason why this visualization constantly changes. It can take several minutes for all the relationships to be tested.

If somebody finds a better way to discover mutual friends using the Facebook API, please let us know!

Matthew Fedak says, "Facebook API: How Many Mutual Friends?"
Matthew Fedak's picture

I too am trying to work this out. Using this code:

$friends = $facebook->api_client->friends_get();
 
$arefriends = $facebook->api_client->friends_areFriends($friends, $friends);

You can compare two arrays of friends and then loop though the resulting array and count how many arefriends indexs = 1. that should do the trick but in this code both arrays are of users friends so hence they all come back zero as your friends are not friends with themselves etc.

I tried to change this by using an array of the users friends and an array of same length butevery value being the id of a single friend but facebook API throws an error. puzzled me too big time.

Post new comment

The content of this field is kept private and will not be shown publicly.
If you have a Gravatar account, used to display your avatar.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • You can enable syntax highlighting of source code with the following tags: <code>. Beside the tag style "<foo>" it is also possible to use "[foo]".
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

About

Daniel McLaren

Daniel is a Flash and Flex developer specializing in the art of information visualization.

Latest from SketchyD

Latest Drawing from SketchyD

This is the most recent drawing from my mobile sketch blog, SketchyD.com.

Recent comments