
今天用正在调试中的heatmap做了一个网站访问量的可视化。数据从google analytics得到,再通过我本地的geonames数据库做了geocoding(用google的就太慢了)。这里有一个live版本。
关于这个heatmap目前还在开发中,很快会介绍给大家的。


今天用正在调试中的heatmap做了一个网站访问量的可视化。数据从google analytics得到,再通过我本地的geonames数据库做了geocoding(用google的就太慢了)。这里有一个live版本。
关于这个heatmap目前还在开发中,很快会介绍给大家的。

You want to visualize a call hierarchy of a C function.
Utilities you need are listed below:
Take ‘rdbSaveBackground’ (redis/rdb.c) for example:
Source: unix diary
The post is brought to you by lekhonee v0.7
Glad to announce my works this morning: A simple heatmap API based on HTML5 canvas.

The programming interface is rather simple now. To create such a heatmap, you just new a heatmap object by:
<canvas width="300" height="215" id="canv"></canvas>
heatmap = new HeatMap("canv");
Then read your dataset and push data into the heatmap:
heatmap.push(x, y, value);
At last, spread the data and get the canvas rendered:
heatmap.spread(); heatmap.render();
Now you got it.
For advanced usage, you can specify the resolution of heatmap by px:
heatmap = new HeatMap("canv", 2);
Large value will gain performance with low image quality.
Also, you can specify a value to define the attenuation value of each px.
heatmap.spread(5);
Finally, there is an option to use your own color schema for heatmap generation.
heatmap.render(function(value, maxValue){
var light = value / maxValue * 100;
return "hsl(20, 75%, "+light+"%)";
});
The parameters passed in are current pixel value and max value in whole context.
That’s all the toolkit. More functionality and options might be added in future. Grab it from my bitbucket page:
http://bitbucket.org/sunng/daily-coding/src/tip/canvas-heatmap/
There is a demo page which you can test the api by clicking canvas:

then click heatmap button!

This is the new year gift for my readers and my dear friends !