Monthly Archives: March 2012

Combining RRDtool with jpGraph for Heatmaps

Yes it works. Story below. Results:

 

 

How did he do it?

Simple. This is a combination of RRD Tool, jpGraph and PHP. RRD provides the database with measurements, jpGraph provides heat map graphs and PHP glues it all together. (colors are taken from exploded creepers from minecraft).

What am i seeing anyway?

It looks cool, but you’re looking at a heat map of the open/closed state of our hackerspace. For the last year, we’ve measured if the hackerspace was opened or closed. We measured about every five minutes.

The average of the past three months is displayed in a granularity of hours. This roughly means 2000 measures for a single graph. It renders nearly instant.

Step by step

Export measured values

rrdtool xport --start $e-$timespan --end $e --step 3600 --maxrows 4242 --enumds 
        DEF:st=../state.rrd:state:AVERAGE 
        CDEF:open=st,1,0,IF 
        XPORT:open:"isopen" 

 

Spread the measured values by hours

foreach($measurements["data"]["row"] as $row) {
       switch ($row["t"] % 86400) {
           case 82800: $hourOpen[0] += $row["v0"]; break;
           case 0: $hourOpen[1] += $row["v0"]; break;

 

Shift is six hours, so primetime is clearly visible

for($i=0;$i<$steps;$i++){
       $element = array_shift($array);
       $array[] = $element;
   }

 

Feed the data to jpgraph

$mp->colormap->SetMap($colormap);
unset($colormap);
$mp->SetCenterPos(0.5,0.47);
$mp->SetSize(0.75, 0.7);

 

Other uses:

The same type of graph can also be used to visualize the temperature in a day. To see how the temperature rises over time. I don’t think there will be a rewrite though, definition of done.

Note: the graph is supposed to give an estimate if Hack42 is open or not.

See also

OMGWTFBBQ Naar House flyer

Superbatsie came across an oldschool Dutch flyer regarding a semi-christian organization called “Naar House”. It associates House music with satan and warns of the unrepairable damage house music can inflict on your soul.

The flyer i got was photograph, so i decided to remake it to a high-res print-ready version. What shame when such a valuable document could not be reprinted (and burned) anymore.

Above: the original. Above: the reconstruction [small] [medium] [huge]

Download the A4 sized, 300dpi version here: [huge] [medium] [small]

Enjoy! 🙂

Did you know there are tons of Christian metal groups? Yes there are, and not even half bad.

Update: welcome to 2012: NOOOOOOOOOO the ‘Naar House’ foundation still exists. It is now targeting all popular music. In their seemingly-happy-colorful-educational material, link, you can read that pop music annihilates all you hold dear. It’s stuff nobody cares about. Let it stay that way. ALL GLORY TO THE HYPNOTOAD.

Laser Portraits

YES! I love this, all of this design just screams “NO” and defines an era of portraits!

Check out more Laser Portraits!

Stitch has one! Do you?

 

Source material: