Jure Cuhalev

25 Dec, 2008

Graphication on OS X (with pycairo)

Posted by: Jure Cuhalev In: Tech

I’m working on some visualizations and I want to achieve the look of Last.fm visualization lastgraph3:

wavegraph

The great thing about this is that Andew Godwin, author of the site open sourced the underlying library – Graphication.

Since I’m an OS X user, I decided to make the whole thing work on my system – Leopard 10.5.6 at the time of this writing. Here are the notes, mostly for my reference and because it might be also useful to others:

Get free XCode from Apple: http://developer.apple.com/

First build and install pkg-config from: http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz

Then install libpng and libjpeg libraries: http://ethan.tira-thompson.com/Mac%20OS%20X%20Ports.html

Build and install pixman from: http://www.cairographics.org/releases/

Build and install cairo from: http://cairographics.org/releases/

Build and install pycairo from: http://cairographics.org/releases/

Patching:
- you’ll need to edit cairo/Makefile.in file by modifying parameter _cairo_la_LDFLAGS (around line 215) to remove ‘-export-symbols-regex init_cairo’
(thanks Michael Dales)

Build instructions:
- just follow INSTALL file. Essential running:
./configure –prefix=/System/Library/Frameworks/Python.framework/Versions/2.5 (sys.path for my system)
and then make && sudo make install

Now you can finally build and install Graphication package :-)

All the installations steps are just ./configure && make && sudo make install and just work out of the box. I already have Python PIL installed from sources and I think you need this for one of the steps, but I’m not sure anymore for which one.

After you go through all the steps, you can start drawing something like that:

Simple visualization

Simple visualization

Now to figure out how to create something meaningful with it.

Reblog this post [with Zemanta]

Related posts:

  1. Visualizing Koornk chatter
  2. Visualizing Slovenian IT tax spending
  3. Visualizing books using Zemanta and Wordle

1 Response to "Graphication on OS X (with pycairo)"

1 | Jure Cuhalev » Blog Archive » Visualizing Koornk chatter

December 26th, 2008 at 6:49 pm

Avatar

[...] I got Graphication working yesterday, I quickly realized that my initial data set doesn’t fit this technique out of the box as it [...]

Flickr PhotoStream

    Visualizing Slovenian IT tax spendingMuffins in the makingWorkspace

About

jure100px_colour Jure Cuhalev is an Open Source Hacker, with background in Social Sciences and Usability and User Experience (UX).